Smooth X+Y interpolation on data change (HighCharts-like morph animation) #1485
Closed
dmitry-stakhov
started this conversation in
Ideas
Replies: 1 comment
-
|
Hi! Thanks for the detailed write-up. There is no built-in functionality for interpolating x values during diff animations at the moment — only y values are interpolated, as you noted. It’s something we’d like to look into for a future release. In the meantime, subclassing the relevant components is, as usual, an option for achieving this on your end. Since this is a feature request rather than a usage question, I’m moving the discussion to the “Ideas” category. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What I'm trying to achieve
When switching between time periods (e.g., 3 months → 6 months), I'd like the chart to smoothly morph all points to their new positions — both X and Y — similar to how HighCharts'
redraw()works with its defaultplotOptions.series.animation.HighCharts matches points by index, so when the series length stays constant but represents a different date range, points visually compress/expand horizontally while shifting vertically.
Current behavior in Vico
Vico's diff animation (
animationSpec) only interpolates Y values. X positions jump instantly to their new layout. So when data changes with different X ranges, the chart "snaps" horizontally while smoothly animating vertically.My current workaround
I'm passing Y-only values (no explicit X) and ensuring a fixed point count via upsampling/downsampling. This makes Vico distribute points evenly across indices 0..N, so the X positions never change and the Y morph gives an acceptable result.
However, this loses the proportional time spacing — gaps between data points are no longer proportional to actual time intervals.
Question
Is there a way to make
CartesianChartHost's diff animation interpolate X positions as well? Or is there a recommended approach for achieving smooth horizontal + vertical morphing when the X range changes?If not currently supported, would this be something worth considering as a feature — perhaps a
CartesianLayerModeltransition mode that interpolates both axes?Environment
Beta Was this translation helpful? Give feedback.
All reactions