D3 SVG chart marks lose ARIA attributes during data-driven re-renders
0 reputation · 27 Dec 2023, 00:34 UTC
D3 SVG chart marks lose ARIA attributes during data-driven re-renders
D3 version 6.x and 7.x generate SVG elements directly and do not provide a built-in accessibility layer for roles, accessible names, or keyboard focus. When ARIA attributes are added manually to chart marks, subsequent D3 data joins or selections can overwrite or drop them, leaving screen-reader behavior undefined after updates.
SVG <title> and <desc> are common fallbacks, but announcement consistency varies across browsers and assistive technologies. D3 transitions also do not move focus between elements, so keyboard-only users may lose context during animated updates.
The unresolved decision is whether an application should reapply ARIA semantics after every render, rely on SVG title and desc, or implement a separate accessible overlay, and how to verify that labels remain announced across browser and screen-reader combinations.
- Do ARIA roles and labels survive D3 data joins and re-renders without being overwritten?
- Which accessible-name technique provides the most consistent screen-reader announcement for D3 SVG marks?
- Should keyboard focus be managed at the chart container level or individual mark level during transitions?