Making the Victory Native Line animation right-->left (hack for animation to select subset of data) #2880
Unanswered
JamisonSavvyWealth
asked this question in
Q&A
Replies: 1 comment
-
Still interested in an answer to this if possible! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Curious if anyone has advice for a workaround here. Currently building out a chart that will have 4 buttons to select various subsets of financial data (3 yrs - present, 1 yr - present, etc). I know there is technically no way to animate the addition or removal of points via the built-in skia point interpolation as mentioned in the docs. As a workaround, I've built a hack that does the following:
screenWidth * (1 + totalDataLength - selectedDataLength) / (selectedDataLength - 1)
. This expands the width just enough for the graph to overflow out of the parent box so that only the selected data is displayed, and there is a single animation connecting state1 --> state2.Now this works okay, but the animation is still slightly confusing because it makes it look like the user is selecting the "first N points" when they're really selecting the "last N points." I've considered setting another property like
right: calculatedWidth-screenWidth
in order to essentially expand the graph width left instead of right; however, the line animation always grows from left-->right, so this creates a sudden "jump" in the animation (see second recording below).Is there any way to make the line grow right-->left or any place in the victory repo OR skia repo that I should look to try to add this in myself?
This is what it looks like with my current logic:
447930275_997263208657094_5877279501665028056_n.mp4
This is what it looks like with the addition of
right: calculatedWidth-screenWidth
RPReplay_Final1718034584.MP4
Beta Was this translation helpful? Give feedback.
All reactions