-
Notifications
You must be signed in to change notification settings - Fork 12k
Better animation when adding or removing data #3399
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
Conversation
0801126 to
8a1b294
Compare
etimberg
left a comment
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.
These look good. just one minor comment about the comments
src/core/core.datasetController.js
Outdated
| }, | ||
|
|
||
| /** | ||
| * private |
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.
should this be "@Private" ?
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.
Fixed :)
35009b7 to
dae14e8
Compare
|
I am 👍 to merge this. I don't know if you prefer waiting for any other comments or not |
In order to simulate real-time chart updates (i.e. horizontal animation), it's necessary to distinguish a removed or added value from a simple update. The dataset controller now hooks array methods that alter the data array length to synchronize metadata accordingly. Also remove the duplicate calls of updateBezierControlPoints() for line and radar charts.
dae14e8 to
2dae0a1
Compare
|
Added data cleanup ( |
etimberg
left a comment
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.
Just the one comment on documentation. Other than that, this is good to go 👍
| } | ||
| }, | ||
|
|
||
| createMetaDataset: function() { |
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.
I realized this method isn't mentioned in the docs ... is that intentional? We don't document the datasetElementType and dataElementType properties either
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.
You right, we should document datasetElementType and dataElementType, not sure about createMetaDataset and createMetaData. That can be done in a future PR though :)
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.
ok, wll merge this
|
Can we merge this? |

In order to simulate real-time chart updates (i.e. horizontal animation), it's necessary to distinguish a removed or added value from a simple update. The dataset controller now hooks array methods that alter the data array length to synchronize metadata accordingly. Also remove the duplicate calls of updateBezierControlPoints() for line and radar charts.
Examples: http://playground.abysscorp.org/chartjs/livecharts/
Plunker: http://plnkr.co/Imxwl9OQJuaMepLNy6ly
Related issues: #1997 #3126