-
Do you have example how to make the chart animated ? for example I have initial data :
then data updated to
the chart would animate from initial data to updated data Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
(Moving this over to the layercake repo and converting it to a discussion...) This is more of a question on how to do animations in Svelte since there's nothing LayerCake specific. Here's an example: https://svelte.dev/repl/846da111e43d45e6809433c59c5a37a8?version=3.46.2 We create a Svelte tween and set our new data to that. Svelte handles interpolating between the data values according to the directions you give it. Since the scales in LayerCake are all created based on the data, all you have to do is pass in a new value of the tweened object and everything will be calculated downstream from that. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer |
Beta Was this translation helpful? Give feedback.
(Moving this over to the layercake repo and converting it to a discussion...)
This is more of a question on how to do animations in Svelte since there's nothing LayerCake specific. Here's an example: https://svelte.dev/repl/846da111e43d45e6809433c59c5a37a8?version=3.46.2
We create a Svelte tween and set our new data to that. Svelte handles interpolating between the data values according to the directions you give it.
Since the scales in LayerCake are all created based on the data, all you have to do is pass in a new value of the tweened object and everything will be calculated downstream from that.