Skip to content

feat(time-pivot): rebuild Time-series Period Pivot on ECharts#42245

Merged
rusackas merged 8 commits into
remove-legacy-viz-pipelinefrom
echarts-time-pivot
Jul 21, 2026
Merged

feat(time-pivot): rebuild Time-series Period Pivot on ECharts#42245
rusackas merged 8 commits into
remove-legacy-viz-pipelinefrom
echarts-time-pivot

Conversation

@rusackas

Copy link
Copy Markdown
Member

SUMMARY

Stacked on #41714, sibling to #42225. Rebuilds Time-series Period Pivot as an ECharts line chart, so once both land, nothing registers an nvd3 renderer and the preset-chart-nvd3 package can be deleted in a follow-up.

The hard part was already done by the v1 migration: the period-pivot reshape (transformData.ts, with the freq-anchored rollback arithmetic and its tests) moves over verbatim — only the render layer changes. Styling matches nvd3: the current period draws boldly in the picked color and paints on top, prior periods fade with their recency percentile. Control names and viz_type: time_pivot are unchanged, so saved charts keep working with no DB migration. nvd3-only pixel-margin and axis min/max toggles are dropped (ECharts lays those out automatically); ECharts tooltips/legend come for free.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshots to follow from the ephemeral env.

TESTING INSTRUCTIONS

  • npx jest plugins/plugin-chart-echarts/test/TimePivot/ — the carried-over rollback/reshape suite plus new transformProps coverage (series ordering, current-on-top fading, log scale, y-bounds, empty results).
  • Manual: build a Time-series Period Pivot on birth_names (sum__num, freq AS) — current year bold, prior years faded behind it.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

@dosubot dosubot Bot added change:frontend Requires changing the frontend viz:charts:echarts Related to Echarts viz:charts:timeseries Related to Timeseries labels Jul 20, 2026
@bito-code-review

bito-code-review Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at evan@preset.io.

@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit f373e98
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a5eb4e4e559c10008db2f99
😎 Deploy Preview https://deploy-preview-42245--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

Copy link
Copy Markdown
Contributor

The flagged security issue is correct. Using window.open without noopener and noreferrer exposes the application to reverse-tabnabbing, where the opened page can manipulate the original tab via window.opener.

To resolve this, update the tooltipOnClick handler to include the noopener and noreferrer features:

              tooltipOnClick: () => {
                window.open(
                  'https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases',
                  '_blank',
                  'noopener,noreferrer',
                );
              },

I have implemented this fix for the identified issue. As for other comments on this PR, there are no additional review comments in the provided pr_comments.csv file to address.

superset-frontend/plugins/plugin-chart-echarts/src/TimePivot/controlPanel.ts

tooltipOnClick: () => {
                window.open(
                  'https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases',
                  '_blank',
                  'noopener,noreferrer',
                );
              },

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.37500% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.50%. Comparing base (059eabe) to head (ed9d9d4).
⚠️ Report is 1 commits behind head on remove-legacy-viz-pipeline.

Files with missing lines Patch % Lines
...ugin-chart-echarts/src/TimePivot/transformProps.ts 68.33% 19 Missing ⚠️
...lugin-chart-echarts/src/TimePivot/transformData.ts 82.55% 15 Missing ⚠️
...n-chart-echarts/src/TimePivot/EchartsTimePivot.tsx 0.00% 4 Missing ⚠️
...plugin-chart-echarts/src/TimePivot/controlPanel.ts 33.33% 2 Missing ⚠️
...lugins/plugin-chart-echarts/src/TimePivot/index.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           remove-legacy-viz-pipeline   #42245    +/-   ##
============================================================
  Coverage                       65.50%   65.50%            
============================================================
  Files                            2786     2792     +6     
  Lines                          155137   155297   +160     
  Branches                        35675    35735    +60     
============================================================
+ Hits                           101617   101734   +117     
- Misses                          51633    51676    +43     
  Partials                         1887     1887            
Flag Coverage Δ
javascript 71.20% <74.37%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rusackas rusackas added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Jul 20, 2026
@github-actions github-actions Bot added 🎪 67753a7 🚦 building 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 67753a7

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 67753a7

Environment: http://16.144.30.21:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for a21a036

Environment: http://16.146.13.43:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@rusackas
rusackas force-pushed the remove-legacy-viz-pipeline branch from 65d2ea5 to 059eabe Compare July 20, 2026 23:12
@rusackas
rusackas requested review from geido and villebro as code owners July 20, 2026 23:12
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for ff3e0a2

Environment: http://44.248.0.4:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

claude and others added 7 commits July 20, 2026 16:52
Swap the nvd3 renderer for an ECharts line chart while reusing the
already-ported period-pivot reshape verbatim: transformData buckets
timestamps by the pandas-style freq offset, ranks periods most-recent
first and shifts priors onto the current period's time axis. Styling
matches nvd3 -- the current period draws boldly in the picked color and
on top, while prior periods fade with their recency percentile. Control
names and the viz_type stay the same, so saved charts keep working with
no migration; nvd3-only pixel-margin and axis-min/max toggles are
dropped since ECharts handles layout. The reshape tests move over
unchanged, with new transformProps coverage for series ordering, fading,
log scale, bounds and empty results.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rse-tabnabbing

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-axis format control

A line series with a single point renders nothing when symbols are hidden,
which made sparse pivots (yearly data over 52-week periods) look empty;
symbols now show for series with two or fewer points. The 40-plus period
legend adds little, so it defaults off while staying togglable. Adds the
x_axis_format control (D3 time formats, matching the legacy control name)
applied to the axis labels.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Prevents zero/negative metric values from producing a broken ECharts
log-scale y-axis, following the same pattern used in Timeseries.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…control

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 0c6ec5f

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for f373e98

A long daily history pivoted weekly overlays a hundred-plus series at
once; the new Number of periods control keeps only the N most recent,
clamped between 1 and the periods present in the data, with empty
keeping them all.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for ed9d9d4

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for f373e98

Environment: http://35.87.141.133:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 0c6ec5f

Environment: http://34.217.93.221:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend plugins size/XL viz:charts:echarts Related to Echarts viz:charts:timeseries Related to Timeseries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants