Skip to content

chart fixes and facet clicks - #906

Merged
techniq merged 10 commits into
mainfrom
chart-fixes-and-facet-clicks
Aug 27, 2026
Merged

chart fixes and facet clicks#906
techniq merged 10 commits into
mainfrom
chart-fixes-and-facet-clicks

Conversation

@techniq

@techniq techniq commented Aug 25, 2026

Copy link
Copy Markdown
Owner
  • Fix chart freeze on empty explicit series, and stranded tooltip on pointer leave
  • Fail visual-regression runs loudly when the docs server is broken
  • Document reading the facet panel on click, and pass facet to the marks snippet

techniq and others added 3 commits August 25, 2026 15:50
…inter leave

`ChartState` gated implicit-series generation on `explicit && explicit.length > 0`,
so an explicitly-provided but empty `series` array fell through to deriving series
from registered marks — while the charts render their marks from the series. That
cycle has no fixed point and spins the main thread, so a chart whose series emptied
out while mounted (during a refetch, say) would lock the page rather than render as
empty. A non-empty array cut the cycle via the early return; `[]` didn't.

The test asserts at the `ChartState` level rather than by rendering, deliberately —
a rendering test would hang CI instead of failing.

`Tooltip` never re-armed the hide when `pointerEvents` is enabled: `TooltipContext`
is the only thing that schedules one, and its timer had already fired and been
blocked while the pointer was over the tooltip. Leaving it anywhere other than back
over the hit area stranded it on screen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The readiness probe hit `/`, which a dev server answers before it can render an
example, and `capture` recorded "nothing drawn" for every page without saying why.
A broken server therefore produced a snapshot of ~1000 errored entries — worse than
producing nothing, since `compare` has no baseline to diff an errored entry against
and every one of them turns into a silent pass from then on.

- probe a real example route, then smoke-test one capture before spending the ~40
  minutes a full run takes
- record the console error, page error, or HTTP status behind a failure, so a
  failure on a runner is diagnosable from the job log alone
- treat "rendered on a later pass" as a flake rather than a failure
- refuse to write a snapshot where more than 5% of examples failed, and report a
  baseline that far gone as unusable rather than as a check that passed

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…arks` snippet

The facets guide covered reading the panel while rendering but not while handling a
click, which is the question that actually comes up. Adds a `Clicks` section with
the three routes and two examples:

- from a row — `context.facet.x?.(data)`, which survives `fx` being a function
- from the panel — `facet` off the snippet, for a click on a panel's background,
  an annotation, or a panel with nothing in it
- from a pixel — `context.facet.panelAt`, also added to the `context.facet` table

`onTooltipClick` is what the first example uses, because the tooltip modes that
draw hit targets (`bounds`, `band`, `facet`, `voronoi`) put them above the marks —
a mark's own `onclick` and `Bars`' `onBarClick` never see the click there.

`marks` is typed as receiving `{ context, facet }`, but `BarChart`, `LineChart`,
`AreaChart` and `ScatterChart` each destructured only `context` and forwarded only
`context`, leaving `facet` undefined on exactly the charts most people reach for
while `aboveMarks` / `belowMarks` worked. No changeset — faceting is unreleased.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 20213d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
layerchart Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/layerchart@906

commit: 20213d6

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
layerchart ✅ Ready (View Log) Visit Preview 20213d6

…sion runs

`docs/static/stackblitz-files.json` is generated and gitignored, so a fresh checkout
has none. Every example route imports it transitively — `Example` pulls in
`stackblitz.remote`, which imports the JSON — so the docs server 500s on all of them.
`prebuild` generates it for a real build, but these workflows run a bare `vite dev`.

Previously invisible: the readiness probe hit `/`, which doesn't reach that import,
so the server looked healthy and every capture recorded "nothing drawn". The probe now
hits an example route and fails here instead. Takes ~0.6s.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Use-Case Scenarios

Core (7 changed)
Scenario Current New Change
🟡 core-canvas 229.36 KB
59.02 gz
230.33 KB
59.33 gz
+0.97 KB (+0.4%)
+0.30 gz (+0.5%)
🟡 core-line 225.55 KB
57.33 gz
226.33 KB
57.57 gz
+0.77 KB (+0.3%)
+0.23 gz (+0.4%)
🟡 core-scatter 220.00 KB
55.58 gz
220.78 KB
55.82 gz
+0.78 KB (+0.4%)
+0.24 gz (+0.4%)
🟡 core-geo 215.75 KB
55.20 gz
216.53 KB
55.43 gz
+0.78 KB (+0.4%)
+0.23 gz (+0.4%)
🟡 core-html 213.68 KB
54.31 gz
214.65 KB
54.61 gz
+0.97 KB (+0.5%)
+0.30 gz (+0.5%)
🟡 core 211.59 KB
53.74 gz
212.57 KB
54.03 gz
+0.97 KB (+0.5%)
+0.29 gz (+0.5%)
🟡 core-svg 211.59 KB
53.79 gz
212.56 KB
54.11 gz
+0.97 KB (+0.5%)
+0.32 gz (+0.6%)
Base (agnostic) (4 changed)
Scenario Current New Change
🟡 base-svg-agnostic 355.97 KB
82.34 gz
356.91 KB
82.62 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
🟡 base-canvas-agnostic 355.97 KB
82.34 gz
356.91 KB
82.62 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
🟡 base-html-agnostic 355.97 KB
82.34 gz
356.91 KB
82.62 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
🟡 base 355.97 KB
82.34 gz
356.91 KB
82.62 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
Base (layer-specific) (3 changed)
Scenario Current New Change
🟡 base-canvas 343.85 KB
80.05 gz
344.79 KB
80.38 gz
+0.94 KB (+0.3%)
+0.33 gz (+0.4%)
🟡 base-html 336.25 KB
77.74 gz
337.19 KB
78.05 gz
+0.94 KB (+0.3%)
+0.31 gz (+0.4%)
🟡 base-svg 334.17 KB
77.26 gz
335.10 KB
77.56 gz
+0.94 KB (+0.3%)
+0.30 gz (+0.4%)
Cartesian charts (27 changed)
Scenario Current New Change
🟡 PieChart 396.80 KB
90.98 gz
397.76 KB
91.27 gz
+0.96 KB (+0.2%)
+0.29 gz (+0.3%)
🟡 ArcChart 390.04 KB
89.77 gz
391.00 KB
90.10 gz
+0.96 KB (+0.2%)
+0.33 gz (+0.4%)
🟡 LineChart 383.18 KB
88.86 gz
384.18 KB
89.18 gz
+0.99 KB (+0.3%)
+0.32 gz (+0.4%)
🟡 PieChart-canvas 382.67 KB
88.49 gz
383.63 KB
88.83 gz
+0.96 KB (+0.3%)
+0.34 gz (+0.4%)
🟡 AreaChart 377.57 KB
86.90 gz
378.56 KB
87.19 gz
+0.99 KB (+0.3%)
+0.29 gz (+0.3%)
🟡 ArcChart-canvas 376.49 KB
87.21 gz
377.45 KB
87.56 gz
+0.96 KB (+0.3%)
+0.35 gz (+0.4%)
🟡 area-chart 373.28 KB
85.95 gz
374.21 KB
86.24 gz
+0.93 KB (+0.2%)
+0.29 gz (+0.3%)
🟡 PieChart-svg 373.00 KB
85.69 gz
373.96 KB
86.01 gz
+0.96 KB (+0.3%)
+0.32 gz (+0.4%)
🟡 line-chart-interactive 372.60 KB
85.94 gz
373.56 KB
86.20 gz
+0.96 KB (+0.3%)
+0.26 gz (+0.3%)
🟡 pie-chart 368.27 KB
84.87 gz
369.22 KB
85.17 gz
+0.94 KB (+0.3%)
+0.30 gz (+0.4%)
🟡 ArcChart-svg 366.82 KB
84.52 gz
367.78 KB
84.84 gz
+0.96 KB (+0.3%)
+0.32 gz (+0.4%)
🟡 BarChart 366.35 KB
84.40 gz
367.35 KB
84.70 gz
+1.00 KB (+0.3%)
+0.30 gz (+0.4%)
🟡 AreaChart-canvas 364.66 KB
84.41 gz
365.65 KB
84.74 gz
+1.00 KB (+0.3%)
+0.33 gz (+0.4%)
🟡 bar-chart 360.60 KB
83.19 gz
361.54 KB
83.47 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
🟡 ScatterChart 360.51 KB
83.28 gz
361.51 KB
83.64 gz
+1.00 KB (+0.3%)
+0.37 gz (+0.4%)
🟡 scatter-chart 357.06 KB
82.62 gz
357.99 KB
82.90 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
🟡 line-chart 356.47 KB
82.39 gz
357.41 KB
82.67 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
🟡 AreaChart-svg 354.99 KB
81.69 gz
355.99 KB
82.00 gz
+1.00 KB (+0.3%)
+0.31 gz (+0.4%)
🟡 BarChart-canvas 353.12 KB
81.96 gz
354.12 KB
82.30 gz
+1.00 KB (+0.3%)
+0.34 gz (+0.4%)
🟡 LineChart-canvas 350.36 KB
81.53 gz
351.36 KB
81.88 gz
+1.00 KB (+0.3%)
+0.35 gz (+0.4%)
🟡 ScatterChart-canvas 347.51 KB
80.79 gz
348.51 KB
81.16 gz
+1.00 KB (+0.3%)
+0.37 gz (+0.5%)
🟡 line-chart-canvas 343.88 KB
80.06 gz
344.81 KB
80.39 gz
+0.94 KB (+0.3%)
+0.33 gz (+0.4%)
🟡 BarChart-svg 343.46 KB
79.22 gz
344.46 KB
79.54 gz
+1.00 KB (+0.3%)
+0.32 gz (+0.4%)
🟡 LineChart-svg 340.69 KB
78.78 gz
341.69 KB
79.12 gz
+1.00 KB (+0.3%)
+0.35 gz (+0.4%)
🟡 ScatterChart-svg 337.84 KB
78.03 gz
338.84 KB
78.37 gz
+1.00 KB (+0.3%)
+0.35 gz (+0.4%)
🟡 line-chart-html 336.27 KB
77.75 gz
337.21 KB
78.07 gz
+0.94 KB (+0.3%)
+0.32 gz (+0.4%)
🟡 line-chart-svg 334.19 KB
77.27 gz
335.13 KB
77.57 gz
+0.94 KB (+0.3%)
+0.30 gz (+0.4%)
Geo (3 changed)
Scenario Current New Change
🟡 geo-full 430.55 KB
101.76 gz
431.48 KB
102.07 gz
+0.94 KB (+0.2%)
+0.31 gz (+0.3%)
🟡 geo-tiles 378.07 KB
87.88 gz
379.00 KB
88.16 gz
+0.94 KB (+0.2%)
+0.28 gz (+0.3%)
🟡 geo 372.95 KB
86.28 gz
373.89 KB
86.54 gz
+0.94 KB (+0.3%)
+0.26 gz (+0.3%)
Hierarchy (4 changed)
Scenario Current New Change
🟡 hierarchy-tree 366.74 KB
85.26 gz
367.68 KB
85.54 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
🟡 hierarchy-treemap 363.36 KB
84.40 gz
364.29 KB
84.68 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
🟡 hierarchy-pack 363.03 KB
84.41 gz
363.97 KB
84.66 gz
+0.94 KB (+0.3%)
+0.25 gz (+0.3%)
🟡 dodge 360.75 KB
83.75 gz
361.69 KB
84.03 gz
+0.94 KB (+0.3%)
+0.28 gz (+0.3%)
Graph / network (4 changed)
Scenario Current New Change
🟡 dagre 425.46 KB
101.33 gz
426.39 KB
101.64 gz
+0.94 KB (+0.2%)
+0.31 gz (+0.3%)
🟡 force 369.15 KB
86.12 gz
370.09 KB
86.37 gz
+0.94 KB (+0.3%)
+0.25 gz (+0.3%)
🟡 sankey 368.96 KB
85.57 gz
369.90 KB
85.88 gz
+0.94 KB (+0.3%)
+0.31 gz (+0.4%)
🟡 chord 365.66 KB
84.57 gz
366.59 KB
84.86 gz
+0.94 KB (+0.3%)
+0.29 gz (+0.3%)
Components (69 changed)
Scenario Current New Change
🟡 Labels 238.15 KB
58.81 gz
238.22 KB
58.83 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Labels.svg 215.69 KB
53.96 gz
215.76 KB
53.98 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Labels.canvas 209.14 KB
53.01 gz
209.22 KB
53.02 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Axis 201.83 KB
45.81 gz
201.91 KB
45.83 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 AnnotationPoint 190.65 KB
46.30 gz
190.73 KB
46.32 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Hull 186.24 KB
49.34 gz
186.32 KB
49.37 gz
+0.08 KB (+0.0%)
+0.03 gz (+0.1%)
🟡 Hull.svg 185.43 KB
49.46 gz
185.51 KB
49.48 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Hull.canvas 185.43 KB
49.42 gz
185.51 KB
49.44 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Voronoi 180.27 KB
47.54 gz
180.35 KB
47.57 gz
+0.08 KB (+0.0%)
+0.03 gz (+0.1%)
🟡 Voronoi.svg 178.25 KB
47.45 gz
178.33 KB
47.48 gz
+0.08 KB (+0.0%)
+0.03 gz (+0.1%)
🟡 Voronoi.canvas 177.27 KB
47.20 gz
177.35 KB
47.23 gz
+0.08 KB (+0.0%)
+0.03 gz (+0.1%)
🟡 Bars 173.56 KB
43.96 gz
173.64 KB
43.99 gz
+0.08 KB (+0.0%)
+0.03 gz (+0.1%)
🟡 Axis.svg 172.74 KB
39.79 gz
172.81 KB
39.81 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Axis.canvas 170.97 KB
39.76 gz
171.05 KB
39.78 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Labels.html 170.96 KB
42.83 gz
171.04 KB
42.85 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Bar 169.51 KB
43.28 gz
169.59 KB
43.31 gz
+0.08 KB (+0.0%)
+0.03 gz (+0.1%)
🟡 AnnotationPoint.svg 168.65 KB
41.65 gz
168.73 KB
41.67 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Axis.html 167.40 KB
38.49 gz
167.48 KB
38.51 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.1%)
🟡 Contour 165.91 KB
45.23 gz
165.99 KB
45.26 gz
+0.08 KB (+0.0%)
+0.03 gz (+0.1%)
🟡 AnnotationPoint.canvas 158.19 KB
39.59 gz
158.27 KB
39.61 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.0%)
🟡 Bars.svg 154.91 KB
39.40 gz
154.99 KB
39.43 gz
+0.08 KB (+0.0%)
+0.02 gz (+0.1%)
🟡 Bars.canvas 152.79 KB
39.83 gz
152.86 KB
39.85 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Contour.svg 152.78 KB
41.78 gz
152.86 KB
41.81 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Contour.canvas 152.39 KB
42.49 gz
152.47 KB
42.51 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Bar.svg 151.33 KB
38.75 gz
151.41 KB
38.78 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Tooltip 148.03 KB
35.82 gz
148.37 KB
35.92 gz
+0.34 KB (+0.2%)
+0.11 gz (+0.3%)
🟡 Bar.canvas 145.30 KB
38.10 gz
145.38 KB
38.12 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.0%)
🟡 Threshold 136.99 KB
33.20 gz
137.07 KB
33.23 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Violin 136.03 KB
31.87 gz
136.11 KB
31.91 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Density 135.01 KB
36.74 gz
135.09 KB
36.77 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Area 130.54 KB
32.02 gz
130.61 KB
32.05 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 BoxPlot 124.77 KB
26.28 gz
124.85 KB
26.31 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Raster 124.13 KB
33.53 gz
124.20 KB
33.56 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Threshold.svg 122.28 KB
29.22 gz
122.36 KB
29.24 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Density.svg 121.88 KB
33.29 gz
121.96 KB
33.31 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Density.canvas 121.49 KB
34.04 gz
121.56 KB
34.07 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Violin.svg 119.09 KB
27.95 gz
119.17 KB
27.97 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Raster.svg 118.17 KB
32.53 gz
118.25 KB
32.55 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Area.svg 117.22 KB
28.26 gz
117.30 KB
28.28 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Raster.html 117.18 KB
32.23 gz
117.26 KB
32.25 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Raster.canvas 116.50 KB
31.99 gz
116.57 KB
32.02 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Threshold.canvas 115.56 KB
28.32 gz
115.63 KB
28.34 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Spline 115.49 KB
29.52 gz
115.57 KB
29.55 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Violin.canvas 114.50 KB
27.97 gz
114.58 KB
27.99 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Area.canvas 111.43 KB
27.49 gz
111.51 KB
27.51 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Link 111.20 KB
28.23 gz
111.28 KB
28.26 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 BoxPlot.canvas 109.01 KB
23.42 gz
109.09 KB
23.43 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 BoxPlot.svg 106.67 KB
22.29 gz
106.75 KB
22.32 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Rule 106.23 KB
24.60 gz
106.31 KB
24.63 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Grid.svg 102.60 KB
22.59 gz
102.67 KB
22.61 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Spline.svg 102.41 KB
25.96 gz
102.49 KB
25.99 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Grid.html 99.30 KB
21.85 gz
99.38 KB
21.87 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Link.svg 97.98 KB
24.55 gz
98.05 KB
24.57 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Trail 97.87 KB
25.21 gz
97.95 KB
25.24 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Spline.canvas 96.62 KB
25.15 gz
96.70 KB
25.17 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Link.canvas 91.96 KB
23.93 gz
92.03 KB
23.96 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Rule.canvas 85.85 KB
20.84 gz
85.92 KB
20.86 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Trail.svg 84.79 KB
21.66 gz
84.86 KB
21.69 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Rule.svg 81.75 KB
19.22 gz
81.83 KB
19.24 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Trail.canvas 79.26 KB
21.13 gz
79.33 KB
21.15 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.1%)
🟡 Points 78.67 KB
19.71 gz
78.75 KB
19.74 gz
+0.08 KB (+0.1%)
+0.03 gz (+0.2%)
🟡 Rule.html 78.48 KB
18.58 gz
78.56 KB
18.60 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Points.canvas 73.28 KB
18.61 gz
73.36 KB
18.63 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Points.html 63.13 KB
15.35 gz
63.20 KB
15.37 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Points.svg 62.47 KB
15.16 gz
62.54 KB
15.18 gz
+0.08 KB (+0.1%)
+0.02 gz (+0.1%)
🟡 Highlight 47.38 KB
9.07 gz
47.52 KB
9.13 gz
+0.14 KB (+0.3%)
+0.07 gz (+0.7%)
🟡 Highlight.svg 37.32 KB
7.24 gz
37.47 KB
7.31 gz
+0.15 KB (+0.4%)
+0.07 gz (+1.0%)
🟡 Highlight.html 36.50 KB
7.26 gz
36.64 KB
7.33 gz
+0.14 KB (+0.4%)
+0.07 gz (+1.0%)
🟡 Highlight.canvas 34.74 KB
6.68 gz
34.88 KB
6.75 gz
+0.14 KB (+0.4%)
+0.07 gz (+1.0%)
Worst case (1 changed)
Scenario Current New Change
🟡 all 1035.76 KB
241.90 gz
1037.00 KB
242.25 gz
+1.23 KB (+0.1%)
+0.35 gz (+0.1%)

Understanding this report
  • Use-case scenarios measure the bundle cost of common chart configurations (e.g. a line chart with axes)
  • Individual components measure each component imported in isolation
  • Svelte runtime is excluded; sizes reflect layerchart + its dependencies (d3, etc.)
  • When multiple components share dependencies (e.g. d3-scale), the real-world cost is lower than the sum of individual sizes
  • Changes smaller than 10 bytes or 0.1% are considered insignificant

`dataCoords` centered on a band scale but not on the band-like width `xInterval` /
`yInterval` give a time scale, so `x="data"` / `y="data"` landed on the leading edge
of the bar rather than on the bar — off by half an interval. `Rect` already draws
the bar across `[scale(floor(v)), scale(offset(floor(v)))]` and `Axis` already
centers its ticks the same way; this brings the tooltip in line with both.

Centers on the interval the value falls in rather than on the value, so data that
isn't already on an interval boundary lands where its bar is. Band scales,
multi-value accessors (`x={['start', 'end']}`) and plain scales are untouched — the
new branch is reached only when an interval is set.

Measured against `Tooltip/multiple-tooltips-with-fixed-single-axis-scaleband`, the
one docs example that combines an interval with a data-anchored tooltip: both
tooltips now center at 516.0 against a bar center of 515.9, previously 500.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Hovering a chart whose `data` is nested — a `stack()`, one array per key, with the
rows it was built from passed as `flatData` — threw
`TypeError: Cannot read properties of undefined`, taking the whole chart down.
`Tooltip/stacked-area` is the docs example; the `<svelte:boundary>` around examples
is the only reason it read as an error card rather than a blank page.

Two problems in the `c`-grouped point path, both from 0a87ff0:

- it iterated `ctx.data`, so a nested chart handed the position accessors a series
  where they expect a row. `flatData` is what the tooltip resolves against and what
  the accessors are written for, so the two now agree by construction.
- it scaled a category's value as a scalar, so `y={[0, 1]}` — a stack's bands —
  became `NaN` and the browser dropped the point with a console error. A span has no
  single position, so those fall through to the series path, which already points
  each of the values.

Regression tests render the shape and hover it, with no boundary to swallow the
throw; both fail on the code before this change, and the second still fails with
only the `flatData` half applied.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@techniq
techniq merged commit 92eae33 into main Aug 27, 2026
10 checks passed
@techniq
techniq deleted the chart-fixes-and-facet-clicks branch August 27, 2026 11:11
@github-actions github-actions Bot mentioned this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant