-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Added initial animation for LineChart / BarChart / RadarChart #1445
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1445 +/- ##
==========================================
+ Coverage 86.54% 89.38% +2.84%
==========================================
Files 45 47 +2
Lines 2996 3044 +48
==========================================
+ Hits 2593 2721 +128
+ Misses 403 323 -80
... and 5 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
ce469e5
to
2278ab3
Compare
2278ab3
to
ecb1256
Compare
If data changes, will e.g Bar values jump to zero, then animate to new values? |
@jebstern That should not happen based on this PR, it would animate from current values to the next ones |
|
||
T getAppearanceAnimationData(T data); | ||
|
||
double getAppearanceValue(double minY, double maxY) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have PieChart and RadarChart which are not axis-based charts, so we need to implement an approach that supports all kinds of charts. (In the future, we will add more chart types which are not axis-based. Such as GaugeChart)
Hi, Thanks for contributing! That's why I write the points that are on my head here, then you can try to implement them:
|
Hi, thank you for your comments regarding this issue. I agree with your points but my initial intention was to just give users the ability to animate on start the same way we animate between data sets changes. As of the moment I don't have any intention on working further on it and I hope the code provided gives some starting point for the others |
Nice, thanks for letting me know about your intention. So I will close the PR. |
PR adds some animations at the first appearance of the widgets: LineChart / BarChart / RadarChart. It is enabled by default but can be disabled by providing simple configuration object.
For line/bar charts it works by replacing displayed data with datasets where y axis values are zeroed (most of the time) so that they are animated from the bottom of the graph by evaluating the tween up to the target/initial data.
For radar chart a scaleFactor value was introduced for the renderer so that it can multiply the target distance from the center of the radar to the target point. It is used in the initial animation by moving from scaleFactor 0 to 1.
Issue: #406