Repository navigation
feat(timeseries): percent-change rebasing with a draggable baseline - #42247
Conversation
|
Bito Automatic Review Skipped - Branch Excluded |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## remove-legacy-viz-pipeline #42247 +/- ##
==============================================================
- Coverage 65.50% 65.49% -0.02%
==============================================================
Files 2786 2787 +1
Lines 155137 155236 +99
Branches 35675 35711 +36
==============================================================
+ Hits 101617 101666 +49
- Misses 51633 51683 +50
Partials 1887 1887
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🎪 Showtime deployed environment on GHA for ab71b7a • Environment: http://18.236.179.233:8080 (admin/admin) |
65d2ea5 to
059eabe
Compare
|
🎪 Showtime deployed environment on GHA for b74b3eb • Environment: http://16.148.127.167:8080 (admin/admin) |
Restores the legacy nvd3 "Time-series Percent Change" view on the ECharts line chart. A new "Percent change" control rebases every series client-side to its percent change from the first point (y/y0 - 1, computed in transformProps like the nvd3 renderer did), with the y-axis and tooltips switching to percent formatting via the existing forcePercentFormatter path. A draggable vertical baseline is installed on the chart; dragging it re-indexes every series to the hovered point using the composable rebase identity (1+v)/(1+vk) - 1, so no re-query or raw-data retention is needed. MigrateCompareChart sets the flag, so saved compare charts regain their percent-change view instead of degrading to a plain line chart. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eline Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tuple points Only group elements accept children in the ECharts graphic API; the rect baseline crashed with 'e.add is not a function' when percent change was enabled. Non-tuple series points are filtered before destructuring. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…g zone The literal rgba(0, 0, 0, 0.02) fill tripped the custom-rules-frontend pre-commit lint (no literal colors). Swap it for theme.colorFillSecondary. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…, throttle drag updates Address three review findings on the percent-change draggable baseline: - snapToNearestX no longer coerces category-axis x values with Number(), which produced NaN and broke baseline positioning/snapping on non-temporal x-axes; it now validates the (already-snapped) category value against the known points instead. - the dragged baseline position is now persisted in a ref so effect reruns (resizes, other option changes) don't silently snap it back to the first point. - ondrag updates are coalesced to one setOption per animation frame instead of rebasing every series on every raw pointer-move event. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The handle spanned the full chart height, running through the legend and x-axis labels; it now uses the grid's actual rect, falling back to full height if the internal API is unavailable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🎪 Showtime deployed environment on GHA for e6b46b5 • Environment: http://52.89.216.10:8080 (admin/admin) |
SUMMARY
Stacked on #41714. Restores the functionality lost when saved "Time-series Percent Change" (
compare) charts were migrated to the ECharts line chart — including the draggable baseline the nvd3cumulativeLineChartwas known for.A new Percent change control on the Line chart rebases every series client-side to its percent change from the first point (
y / y0 − 1, computed intransformPropsexactly where the nvd3 renderer used to do it), and joins the existingforcePercentFormatterpath so the y-axis and tooltips format as percentages automatically. A draggable vertical baseline is installed on the plot (EChartsgraphic+convertFromPixel, snapped to the nearest data point); dragging re-indexes every series via the composable rebase identity(1+v)/(1+vk) − 1, so re-indexing needs no re-query and no raw-data retention.MigrateCompareChartnow sets the flag, so migrated compare charts come out rendering their percent-change view rather than degrading to a plain line chart — resolving theform_data_bak-fragility concern, since the intent is materialized in live form data.TESTING INSTRUCTIONS
npx jest plugins/plugin-chart-echarts/test/Timeseries/percentChange.test.ts— rebase math incl. baseline-zero, leading nulls, and the composability identity.pytest tests/unit_tests/migrations/viz/nvd3_compare_chart_to_echarts_test.py— migration sets the flag.birth_names(sum__numby state), tick Percent change, then drag the vertical baseline across the plot.ADDITIONAL INFORMATION
🤖 Generated with Claude Code