Skip to content

Question : Do you have example how to make the chart animated ? #205

Answered by mhkeller
x4080 asked this question in Q&A
Discussion options

You must be logged in to vote

(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.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mhkeller
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #204 on May 23, 2024 23:16.