Accessibility
PieChart from @prepared911/ui/pie-chart.
label is required. It names the plot, a focusable region with role="application", and captions a data table that is visually hidden and in the accessibility tree: a row heading per slice and a cell with its value and share. The table renders on the server and in print and never depends on hover. description is read after the name. The painted slices, legend swatches and tooltip are aria-hidden; the table and the live announcements carry the content.
The plot is in the tab order. Once focused, Right and Down move to the next drawn slice and Left and Up to the previous one (Left and Right swap in right-to-left), stopping at the ends. Home and End jump to the first and last slice. Escape dismisses the tooltip. A hidden slice is skipped, because it is not drawn. Each move is announced through the live announcer as the slice label and its row, joined with the locale's list punctuation, and the focused slice is outlined.
Hovering a slice shows the tooltip and dims the other slices; no slice changes shape, so every join stays aligned. The hole of a donut and the area outside the circle pick nothing. A pie is read-only: it has no selection.
Legend entries are buttons with aria-pressed, pressed while the slice is shown. The text reads Label (NN%) or whatever formatLegendEntry returns, so the percentage is text and not color alone.
Slice colors come from Chroma's palette tokens, which clear 3:1 against every surface. The gap between slices is a cut in the shape, not a stroke, so it adds no color. Under forced-colors: active the chrome uses system colors and slices keep their colors, because they carry the data.
The entrance reveal, the tooltip glide and the dimming transition stop under prefers-reduced-motion. The chart is complete without them, and print turns the reveal off.