feat(rose): migrate rose chart to v1 chart data API - #41726
Conversation
The rose chart rode the full legacy nvd3 line engine, so its buildQuery attaches the equivalent post_processing pipeline (pivot, resample, rolling window, time compare, contribution, flatten) and requests time_offsets for time comparisons, keeping the pandas semantics server-side. transformProps then re-keys the flattened pivot records by timestamp with the legacy shape: metric dropped from grouped single-metric keys, time-shifted and comparison columns labeled with the legacy '<offset> offset' suffix, NaN collapsed to 0, series sorted by key. Legacy pre-shaped payloads pass through untouched. No DB migration needed: viz_type is unchanged and legacy granularity_sqla/time_range form data flows through extractExtras. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bito Automatic Review Skipped - Branch Excluded |
|
The flagged issue is correct. The superset-frontend/plugins/legacy-plugin-chart-rose/src/transformProps.ts |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## remove-legacy-viz-pipeline #41726 +/- ##
==============================================================
+ Coverage 64.08% 64.10% +0.01%
==============================================================
Files 2687 2689 +2
Lines 148467 148548 +81
Branches 34262 34289 +27
==============================================================
+ Hits 95147 95221 +74
- Misses 51558 51565 +7
Partials 1762 1762
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:
|
The legacy control emits 'absolute' where the v1 compare post-processing operation expects 'difference'; both buildQuery and the column-name mapping now normalize it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
SUMMARY
Tier 2 of #41714 (targets
remove-legacy-viz-pipeline): migrate the Nightingale Rose Chart (rose) offexplore_jsononto/api/v1/chart/data.Rose exposed the full legacy nvd3 line engine (resample, rolling windows, time comparison, contribution), so this migration leans on server-side
post_processingfor exact pandas semantics rather than re-implementing them in JS:buildQuery.tsattaches the pipelinepivot → resample → rolling → compare → contribution → flattenusing the shared@superset-ui/chart-controlsoperators (plus a small local contribution factory, since the legacy booleancontributioncontrol predatescontributionMode), and requeststime_offsetsfor time comparisons — the same approach the nvd3→ECharts migrations used.transformPropsre-keys the flattened pivot records into the legacy{timestamp: [{key, value, name, time}]}shape: metric dropped from grouped single-metric keys, time-shifted (m__1 week ago) and comparison (difference__m__m__1 week ago) columns mapped to the legacy"<offset> offset"suffix, NaN collapsed to 0, series sorted by key.useLegacyApi: trueremoved.viz_typeunchanged; legacygranularity_sqla/time_rangehandled byextractExtras.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No visual change — same renderer, same data shape, different endpoint.
TESTING INSTRUCTIONS
npm run test -- plugins/legacy-plugin-chart-rose— 9 Jest tests (post-processing pipeline composition incl. rolling/resample/contribution/compare, flattened-label parsing with escaped commas, offset/comparison key mapping, NaN→0, timestamp re-keying).POST /api/v1/chart/data; rendering identical.ADDITIONAL INFORMATION
🤖 Generated with Claude Code