You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some discussion regarding using react-spring with vx, and for it to perform optimally (i.e. not involve React diffing during the animation), we would need to be able to pass the path data generator to it's template function (tag template function) and consider using it's <animated.path /> instead of just <path />
In order to support this (and without bringing react-spring as a dependency within our Link* components), we should export each generator within our Link components, such as this one for LinkHorizontalStep. We'll probably need to look at currying all the props with default values, something like:
Regarding the exports, maybe they are the named exports from these files (all called path or pathGenerator)? Not sure how (and if we should) export them at the top level (i.e. what do we name them, etc).
These paths could also be useful outside of links (at one point I considered using them for annotations until I saw react-annotation. Could they also be used as custom curves for line graphs?
The text was updated successfully, but these errors were encountered:
To expose these functions would come in handy for any lib that can handle it (animated, react-spring, etc.) and allow VX to compete against plain d3-animations.
Just to illustrate what kind of difference it would make:
Letting React render an animation results in a full re-render of the entire subtree (in the example ~300 path components) on every frame, on top of re-styling and paints, making it pretty hard if not impossible to get 30-60fps without drops for bigger trees (avg for a single frame: 50-80ms):
Doing the animation in a raf-loop like d3 or animated would do results in a single render, from then on the animation is going to be applied directly in the dom (react-springs avg for a single frame: 15-20ms):
After some discussion regarding using react-spring with vx, and for it to perform optimally (i.e. not involve React diffing during the animation), we would need to be able to pass the path data generator to it's
template
function (tag template function) and consider using it's<animated.path />
instead of just<path />
For example:
In order to support this (and without bringing react-spring as a dependency within our Link* components), we should export each generator within our Link components, such as this one for
LinkHorizontalStep
. We'll probably need to look at currying all the props with default values, something like:Regarding the exports, maybe they are the named exports from these files (all called
path
orpathGenerator
)? Not sure how (and if we should) export them at the top level (i.e. what do we name them, etc).These paths could also be useful outside of links (at one point I considered using them for annotations until I saw react-annotation. Could they also be used as custom curves for line graphs?
The text was updated successfully, but these errors were encountered: