Skip to content

feat(bullet): rebuild the Bullet Chart on ECharts#42225

Merged
rusackas merged 12 commits into
remove-legacy-viz-pipelinefrom
echarts-bullet
Jul 21, 2026
Merged

feat(bullet): rebuild the Bullet Chart on ECharts#42225
rusackas merged 12 commits into
remove-legacy-viz-pipelinefrom
echarts-bullet

Conversation

@rusackas

Copy link
Copy Markdown
Member

SUMMARY

Stacked on #41714. Rebuilds the Bullet Chart as an ECharts composition so the last-but-one nvd3 chart comes off that library, leaving Time-series Period Pivot as the only nvd3 renderer.

The composition mirrors d3-bullet semantics: nested qualitative range bands (markArea, largest threshold painted first so smaller bands nest on top, shaded with the theme fill tokens), the measure as a thin primary-color bar, triangle point markers as a scatter series, and marker lines via markLine with their labels. Control names and their comma-separated value semantics (ranges, range_labels, markers, marker_labels, marker_lines, marker_line_labels) match the legacy chart exactly and the viz_type stays bullet, so saved charts keep working with no DB migration. A shared y_axis_format control is added for number formatting (the legacy chart had no format control).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshots to follow from the ephemeral env.

TESTING INSTRUCTIONS

  • npx jest plugins/plugin-chart-echarts/test/Bullet/ — buildQuery + transformProps coverage (bands ordering, markers, marker lines, legacy 110% default band, empty-result safety).
  • Manual: open a saved Bullet chart or build one against birth_names (e.g. sum__num with ranges 100000,200000,300000).

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

@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.

@dosubot dosubot Bot added the viz:charts:echarts Related to Echarts label Jul 20, 2026
Comment thread superset-frontend/plugins/plugin-chart-echarts/test/Bullet/transformProps.test.ts Outdated
@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 684a97e
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a5eb0d629390c0007f4d3fb
😎 Deploy Preview https://deploy-preview-42225--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.

Comment thread superset-frontend/plugins/plugin-chart-echarts/src/Bullet/transformProps.ts Outdated
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.11111% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.50%. Comparing base (059eabe) to head (684a97e).

Files with missing lines Patch % Lines
.../plugin-chart-echarts/src/Bullet/EchartsBullet.tsx 0.00% 4 Missing ⚠️
...s/plugin-chart-echarts/src/Bullet/controlPanel.tsx 25.00% 3 Missing ⚠️
.../plugin-chart-echarts/src/Bullet/transformProps.ts 95.65% 2 Missing ⚠️
...d/plugins/plugin-chart-echarts/src/Bullet/index.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                     @@
##           remove-legacy-viz-pipeline   #42225   +/-   ##
===========================================================
  Coverage                       65.50%   65.50%           
===========================================================
  Files                            2786     2792    +6     
  Lines                          155137   155209   +72     
  Branches                        35675    35692   +17     
===========================================================
+ Hits                           101617   101677   +60     
- Misses                          51633    51645   +12     
  Partials                         1887     1887           
Flag Coverage Δ
javascript 71.20% <86.11%> (+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.

Comment thread superset-frontend/plugins/plugin-chart-echarts/src/Bullet/transformProps.ts Outdated
@rusackas rusackas added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Jul 20, 2026
@github-actions github-actions Bot added 🎪 6518be3 🚦 building and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for fbf2126

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

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 684a97e

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 684a97e

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

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 38d59fb

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 26a72de

claude and others added 10 commits July 20, 2026 17:19
Replace the nvd3 bullet renderer with an ECharts composition: nested
qualitative range bands via markArea (largest threshold painted first so
smaller bands nest on top, using the theme fill tokens), the measure as a
thin primary-color bar, triangle point markers as a scatter series, and
marker lines via markLine with their labels. Control names and semantics
(comma-separated ranges/markers/marker lines plus labels) match the legacy
chart exactly, and the viz_type stays `bullet`, so saved charts keep
working with no migration. Adds a shared y_axis_format control for number
formatting and registers the new plugin in MainPreset in place of the nvd3
one, leaving Time-series Period Pivot as the sole nvd3 chart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Verified via GitHub Actions pre-commit run that only prettier/oxlint
flagged this file; the local Type-Checking/stylelint hooks fail here
only due to this worktree lacking built package lib/ artifacts, which
CI's own run shows as Skipped for this fileset.

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

markerLabelOf() resolved labels via indexOf(value), so duplicate marker
or marker-line values collapsed onto the first matching label. Resolve
by position instead. Also route the tooltip HTML strings (which embed
user-configured metric/marker labels) through sanitizeHtml(), matching
the convention already used by tooltipHtml() elsewhere in this plugin
package, to avoid a stored-XSS vector via chart label text.

Verified locally: Type-Checking passes once the composite build
artifacts are present (this worktree normally lacks them for new
Bullet source files); stylelint fails here only due to a missing
postcss-styled-syntax module in the local npx cache, unrelated to
this diff (no css-in-js files touched).

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

When every plotted value is identical (e.g. an empty result measuring 0)
the x-axis min and max coincided, producing a zero-width domain. Widen the
domain by one unit (or 10% of the magnitude) in that case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Marker-line labels render inside the plot instead of clipping at the
chart edge; the legend is dropped entirely since a single-measure chart
gains nothing from it and it collided with the x-axis labels; range
labels now surface inside their band's right edge; the triangle markers
sit below the measure bar pointing up at their value instead of hiding
inside it. Control descriptions spell out the comma-separated
numeric/text expectations with examples, and each label control only
appears once its paired values control has content.

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

Tokenizing is lenient instead of throwing: the controls re-render on every
keystroke, so partial input like a trailing comma must not error the chart
(or leave it stuck in the error state). Empty and non-numeric tokens are
dropped. The marker offset is computed in pixels from the chart height
since a percentage offset of the symbol size lands inside a tall measure
bar. Range labels, which markArea labels never rendered, now surface as
lines on the measure bar's tooltip.

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

Hovering the thin bar precisely was the only way to see the range labels;
the tooltip now triggers on the axis so hovering anywhere shows the
measure, labeled ranges, markers and marker lines together. Control
changes no longer animate elements in from the bottom.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The combined axis tooltip is replaced with per-item hovers: the bar shows
the measure, markers show their own label and value, and each range
threshold gets an invisible hover target carrying its label (markArea is
not reliably hoverable). A Show labels control prints marker and range
labels directly on the chart and disables tooltips entirely.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 26340c0

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 38d59fb

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

Every range, marker and marker line is now its own named series (marker
lines as empty line series carrying a markLine), so the new Show legend
control lists them all as always-visible entries whose clicks natively
toggle the corresponding element. Show labels remains independent, and
per-item tooltips are unchanged.

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 caa31e3

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for caa31e3

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

A new optional Dimensions control renders one bullet row per group value
on a shared value axis: the y-axis lists the group labels, the measure
bar becomes one bar per row, and the range bands, markers and marker
lines automatically span every row so all rows share the same settings.
Marker offsets scale to the per-row band height, and grouped bar
tooltips name their row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants