Repository navigation
feat(charts): Once UI's own SVG chart renderer, recharts removed (3.0) - #378
Conversation
… horizontal bars (3.0) Step 1 of the 3.0 chart plan: the props the renderer swap keeps. - xKey names the x column (guessed before); series take label and format. - valueFormat (compact, percent, Intl options or a function) and locale write the value axis and tooltip; without them charts draw as 2.x did. The value axis widens to fit its longest label. - stack (true or "percent") on LineChart and BarChart; BarChart orientation="horizontal", with category labels sized to fit. - C8: date.onChange becomes date.onRangeChange; the codemod renames it in an inline date and reports one built elsewhere. - CurveType and ValueFormat types; curveType stays as a deprecated alias. - Fixes: PieChart gradient ids are scoped to each chart; with no series the x column is no longer drawn as a series; ticks find their row in a map instead of scanning the data. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
check-props lists inherited ChartProps rows on the mixin's table, so a component page describing xKey, valueFormat or locale is reported. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
The chart props now use CurveType (curveType stays as a deprecated alias), so the regenerated spec resolves CurveType, not curveType. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
…line up with the title A top-left legend was inset a fixed 80px, the old 64px axis plus 16, so a wider value axis (currency) or the category column of horizontal bars put it over the axis labels. Legend takes the axis width. Horizontal bars' category names start 20px in, where the title does, in one column. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
A DatePicker with no value showed this month, read from the clock while rendering. A page prerendered in one month and opened in the next drew a different month on the server and in the browser, and hydration failed (React #418). The docs check visits pages 25 hours after the build, so every PR's Docs build fails from 30 October 23:00 UTC to the end of the 31st. Without a date, Calendar and the range calendars start on a fixed month, hidden, and move to this month in an effect. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
LineChart, BarChart, LineBarChart and PieChart render through a shared CartesianPlot and a PiePlot instead of recharts. Their props are unchanged. - utils/scale.ts ports what the charts used from recharts and d3: nice and fixed-domain ticks, stacking (and percent stacking), bar slots, tick thinning, rounded bars, pie sectors and d3's curves. - The chart is in the server HTML: one SVG with a viewBox, drawn at 640x320 until a ResizeObserver measures the container. No lazy chunk, no fonts.ready wait, no MissingDependency fallback. - Tooltip (DataTooltip), crosshair and band hover, arrow keys / Home / End / Escape through the points, legend entries are buttons that hide a series or slice, and the mount animations are CSS that prefers-reduced-motion turns off. - Pie and LineBarChart legends list series in data order with their own colours; pie gradients are scoped per chart. - recharts leaves peerDependencies, peerDependenciesMeta, the lockfile, the spec generator and the agent rules. - The charts' own code is 13.1 KB gz (minified, React external) against recharts' 126 KB. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
The data setup page no longer asks for recharts, the curve and animation props describe the new renderer with d3's curve names, MIGRATING tells readers to uninstall recharts, and CHANGELOG [3.0.0] records the renderer and the removed peer. The streaming example starts from deterministic noise so its server and client HTML match. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
The renderer and the rebased base branch together leave two fewer Biome errors than the recorded baseline. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq # Conflicts: # CHANGELOG.md # apps/docs/src/content/data/lineChart.mdx # packages/core/src/__tests__/legend.interaction.test.tsx # packages/core/src/modules/data/BarChart.impl.tsx # packages/core/src/modules/data/Legend.tsx # packages/core/src/modules/data/LineBarChart.impl.tsx # packages/core/src/modules/data/LineChart.impl.tsx # packages/core/src/modules/data/PieChart.impl.tsx
|
The visual check flagged four shots, and all four are intended. Three are on Generated by Claude Code |
#377's summaries meet the renderer here. The impl files keep the renderer and hand their plot to ChartPlot; the wrappers wrap the impl in ChartA11y directly, with no lazy import left to suspend. The plot is now role="figure", not "img": the renderer put the legend's toggle buttons and the keyboard-focusable plot inside it, and an image's children are presentational (axe nested-interactive). The tests read the drawn text apart from the hidden summary table, and render with the LayoutProvider the tooltip needs now the SVG is in the first render. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
The base re-sorted core's peers with maplibre-gl first and bumped recharts; recharts stays removed. The curve and animation sections said the props were Recharts' own; they now say what the renderer does with them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
The renderer's code is now inside ./data, where recharts (126 KB gzipped) was an external peer the size gate never counted. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq # Conflicts: # CHANGELOG.md
|
"Build, typecheck and test" failed on 71a3ca3, but not because of this PR. All 4,034 tests passed. The run failed on one unhandled error: Generated by Claude Code |
…ore#390 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq # Conflicts: # packages/core/src/internal/sortable.ts
Requested by Lorant · project thread
Step 2 of the 3.0 chart plan (plan doc), for 3.0.0-beta.2 on 6 Nov. LineChart, BarChart, LineBarChart and PieChart now draw their own SVG, and their props stay the same as after #367.
What changes
utils/scale.ts,CartesianPlot.tsx(shared by Line, Bar and LineBar),PiePlot.tsxandChart.module.css.rechartsLoader.tsis deleted. The renderer places scales, stacks, d3's curves, ticks and bar slots the way recharts did.document.fonts.ready, and noMissingDependencyfallback. It draws at 640×320 until a ResizeObserver measures its container.prefers-reduced-motion.Bundle
The four charts' own code is 13.1 KB gzipped (38.6 KB minified, React external), plus 1.0 KB for
Chart.module.css. recharts alone was 126 KB gzipped.Checks
chart-renderer.test.tsx(scales, curves, stacking, SSR, legend toggle, keyboard).pnpm test:codemod450/450, docs typecheck andcheck:docsclean. The Biome error baseline drops from 121 to 118.#377 (Sparkline and summaries) touches the same impl files. Whichever of the two merges second takes the other's change.
Generated by Claude Code