Skip to content
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

Spaghetti code for implementing tween animations #5

Open
bothness opened this issue Nov 29, 2021 · 1 comment
Open

Spaghetti code for implementing tween animations #5

bothness opened this issue Nov 29, 2021 · 1 comment

Comments

@bothness
Copy link
Member

At the moment, the logic that allows for pretty animations is split between:

  1. A shared component called SetCoords, which has the logic for tweening the points for all different chart types.
  2. Chart-level tweening of the xDomain/yDomain to deal with axis/scale animations.
  3. Some logic in the SVG sub-components (eg. Bar.svelte) for picking up issues like marker width on barcode charts.

There is also some logic in SetCoords that deals with screen resize (no tweening) vs data change (tweening).

@henryjameslau
Copy link
Member

The setCoord stuff suffers from tweening having to between arrays of the same size so enter/exit of data causes problems. I saw this tweet and someone did it by having each data point as a component and having the tween inside the component. See this repl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants