-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
svg #66
Comments
fontawesome + svg: http://stackoverflow.com/a/19892061/592125
The a = fontawesome yml -> to json -> this js:
|
Added icons and zoom breakpoints to change design: http://forresto.github.io/prototyping/react/ SVG certainly makes some things quite nice. Aligning the icon in the node, for example. Also, circles. Unfortunately
Even though it makes the framerate slow, it is steady, so it doesn't feel super janky. But it doesn't feel like 60fps. Could maybe work around by using |
Figured out that svg transform is much faster without css, as that's what's forcing the purple layout bars above. Here's a similar demo, fast without css. I don't think it is worth ditching CSS now, though (I went down that road a bit). If we did that (converting all styling to attributes, passing styles through) it would be almost as much work to go all-2d canvas. Dragging a node works, is fast: Most of the frame budget is yellow, because React forces anything that affects stuff elsewhere in the tree (moving node changes its edges) to be rerendered by the common ancestor. In this case, it seems like it would be faster to have a listener on the edge (like we have in Polymer). OTOH, the pattern is clean. |
Unexpected: Safari and Firefox feel way faster than Chrome with zooming and panning. There must be a bug causing all those purple layout invalidations. |
Very interesting experiments! There might be an issue in Chrome where simply listening for wheel events disables some rendering optimizations. If you want to explore it further, one can build the current React master that doesn't listen for all events by default, but only the needed ones, and then compare performance if you declare an onWheel handler or not. |
For the layout invalidations I made a reduced case and bug report to see what the Chromium folks say. |
prototyping: http://forresto.github.io/prototyping/react/ ~ forresto/dataflow-prototyping#2
React's virtual dom will make it easy to render svg on the server, if we ever need that for previews, etc: https://github.com/facebook/react-page/
The text was updated successfully, but these errors were encountered: