rusackas opened a new pull request, #42247: URL: https://github.com/apache/superset/pull/42247
### 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 nvd3 `cumulativeLineChart` was 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 in `transformProps` exactly where the nvd3 renderer used to do it), and joins the existing `forcePercentFormatter` path so the y-axis and tooltips format as percentages automatically. A draggable vertical baseline is installed on the plot (ECharts `graphic` + `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. `MigrateCompareChart` now sets the flag, so migrated compare charts come out rendering their percent-change view rather than degrading to a plain line chart — resolving the `form_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. - Manual: Line chart on `birth_names` (`sum__num` by state), tick **Percent change**, then drag the vertical baseline across the plot. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [x] Changes UI - [ ] Includes DB Migration - [x] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
