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

How to animate color change? #59

Open
bingomanatee opened this issue Aug 13, 2022 · 1 comment
Open

How to animate color change? #59

bingomanatee opened this issue Aug 13, 2022 · 1 comment

Comments

@bingomanatee
Copy link

I want to be able to animate color change over time. My use case is polyhexes, but in general - how can you change the color/props of the graph without (the force method) running new data through your model? the new data approach seems to re-create the geometry - and for the record it is also flawed; for instance I filtered countries to European continents, then changed the data to Asian ones, and the only way I could get that to work was to re-create the entire globe.

you have a great visualizer, but its a shame that rendering data over time is not a native predicted feature of this component.

@vasturiano
Copy link
Owner

@bingomanatee you can just invoke the method hexPolygonColor every time you want to change the color logic associated with the hexes. That should be a light-weight enough change and doesn't trigger a geometry re-computation.

Additionally, if you want to animate it, you just need to invoke it repeatedly inside your own tween function.

Make sure to use the latest version of the module as I've just pushed a patch that further optimizes color changes in this layer.

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