Animating Area path with React Spring #1317
-
|
I'm trying to animate I'm not using I assumed I would be able to put my path value into a This works pretty well if the Which causes the graph not to animate. Any tips on how to animate a line graph? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey @creativiii , yeah this wasn't as straight forward as I expected when implementing it for The solution I used in Hope that helps! Also curious what customization you'd like in your graphs that |
Beta Was this translation helpful? Give feedback.

Hey @creativiii , yeah this wasn't as straight forward as I expected when implementing it for
@visx/xychartand I hit the samearityissue you mention. I think overallreact-springdefault interpolation won't work when you have varying numbers of points.The solution I used in
xychartwas to use thed3-interpolate-pathas the interpolator and usereact-springto tween from0 -> 1. If you are specifically interested in areas/closed paths, you might want to check outflubberwhich I think is by far the best interpolator, but it assumes closed paths (which is perfect for area but fails for lines).Hope that helps!
Also curious what customization you'd like in your graphs that
xychartdoesn't…