r/javascript • u/joelburget • Jul 18 '16
d4.js — declarative data-driven documents
https://d4.js.org1
u/TeamHelloWorld Jul 18 '16
Is there an example of transitions?
d3 transitions are really easy to do, but I haven't seen/figured out how to do them well with react(or ember); I end up writing a lot of code to simulate a tween transition.
1
1
u/flying-sheep Jul 18 '16
i tend to use CSS transitions. they’re more performant anyway.
1
u/tbranyen Jul 19 '16
How do they relate to SVG? Seems like Web Animations are more in line with SVG stuff than CSS animations meant for HTML elements.
1
u/flying-sheep Jul 19 '16
“web animations”?
I only know SMIL and CSS animations/transitions. SVG can do both
1
u/tbranyen Jul 19 '16
Pretty sure css transitions dont work with svg attributes making them useless. Siml is deprecated?
1
u/flying-sheep Jul 19 '16
you’re right. CSS can only animate properties that have a CSS equivalent (e.g. fill, but not cx)
in the end i had to do e.g. all placement that i wanted to animate into transforms (which are animatable via CSS)
4
u/goshakkk R Jul 18 '16
Some great thought here, Joel!
With React and JSX, I like where the things are headed. I don't think we're far from having reusable SVG components, allowing to express high-level visualizations pretty easily.
Given the tendency... I've also recently experimented with using React to draw to canvas, using an engaging image editor as an example (demo, sources, post on how it works), and I really love how React provides us a baseline to implement, reason about, and use pieces of UI, regardless of where they render — be it native mobile, terminal, canvas, and more.