How to properly implement transition on data change? #186
-
Hi, thanks for this amazing library. I had question regarding the animation of chart on data change. Here is the code if you are interested: https://github.com/PixeledCode/svelte-pages/tree/main/src/routes/iom-charts/Bar Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorry I missed this. Instead of setting the width from inside the component, it is a better design to change your top-level items that get passed to the Edit: See this discussion for an example: #205 |
Beta Was this translation helpful? Give feedback.
Sorry I missed this. Instead of setting the width from inside the component, it is a better design to change your top-level items that get passed to the
<LayerCake>
component and then let everything in the chart update, similar to the small multiples example where it tweens the domain and everything else flows from there. If you are able to put a simplified version of your example in a svelte REPL it would be easier to debug a bit.Edit: See this discussion for an example: #205