Repository navigation
feat(charts): accessible chart summaries and a Sparkline component (3.0) - #377
Merged
lorant-one merged 13 commits intoOct 31, 2026
Merged
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
Charts: each plot region is role="img", named by the title and a
plain-language summary of the data written in the chart's valueFormat and
locale ("Revenue and Cost, Jan to Dec. Revenue: highest 12,400 in Aug,
lowest 3,100 in Feb."; a pie: "Share by browser: Chrome 62%, ..."). The
data sits next to it, inside the card, as a visually hidden table (x values
as rows, a column per series label). `summary` replaces the generated text,
`aria-label` the whole name. While a chart loads, fails or is empty the
plot is no image, so its status is read.
The public shells (LineChart.tsx etc.) provide the description context from
their props; a renderer only hands its plot the rows it draws through
`<ChartPlot data={filteredData}>`, so the *.impl.tsx files change by an
import and the plot Row's opening and closing tag.
- utils/chartSummary.ts: chartSummary() and chartSummaryTable()
- ChartSummary: the hidden table, exported from /data
- Sparkline: pure-SVG trend line, area or bars (no recharts, renders on
the server), viewBox stretched with preserveAspectRatio="none" and a
non-scaling stroke; data as numbers or rows with valueKey, curve
(linear, natural, monotone, step), showLast, min/max, width/height
(a number is px), and a generated aria-label ("Trend from 120 to 340,
high 360"). Exported from /data and the root barrel.
- Catalog seed entries for both; catalog size budget 25,500 -> 25,800.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
- data/sparkline.mdx: usage, stat tile, table cell (a client example, since a Table cell is a function), bars, curves and range, rows with valueKey, accessibility and the PropsTable; listed in the Data-viz nav. - setup.mdx: the Accessibility section and the summary / aria-label rows. - CHANGELOG [3.0.0] Added: chart summaries and Sparkline. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
…3-0-chart-a11y-sparkline
…rates The chart's hidden summary table now writes the rows out on the server, and the example seeded them with Math.random, so the server and browser differed (React #418 on /data/lineChart). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
lorant-one
changed the base branch from
feat/3-0-chart-props
to
feat/3-0-breaking-cleanup
October 30, 2026 23:51
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq # Conflicts: # CHANGELOG.md # packages/core/src/modules/data/interfaces.ts
lorant-one
pushed a commit
that referenced
this pull request
Oct 31, 2026
#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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Lorant · project thread
Step 3 of the 3.0 chart plan (plan doc). It is stacked on #367, so this diff shows only this step. Once #367 merges, retarget it to
feat/3-0-breaking-cleanup.What changes
role="img") to screen readers. Its name is a generated summary, for example "Revenue in forints. Web shop and In store, Jan to May. Web shop: highest 1 950 000 Ft in May, lowest 1 240 000 Ft in Jan…". The summary is written with the chart's ownvalueFormatandlocale. A visually hidden data table sits next to the plot. While a chart is loading, empty or in error, the plot is not an image, so its status is read instead.summaryreplaces the generated text (the title stays in front), andaria-labelreplaces the whole name.ChartSummary(exported from/data) renders the hidden table.utils/chartSummary.tswrites the summary text.Sparkline: a server-rendered SVG with no recharts behind it. It takesvariant(line, area or bar),curve,showLast,min/max,valueKey,valueFormat,localeandaria-label. It is exported from/dataand from the root.Rowfor the internalChartPlot. The summary is wired in the public wrappers, so the renderer swap in beta.2 keeps it.Checks
chart-summary.test.tsx(text, hu-HU/HUF, table, roles, overrides, axe) andsparkline.test.tsx(SSR, curves, bars,showLast, sizing, axe).pnpm test:codemod: 450/450. Docs typecheck andcheck:docs: 0 problems.Known: the two live-streaming LineChart examples update their summary on every tick. Screen readers don't announce that change, but the hidden table re-renders each time.
Generated by Claude Code