Plotly.js config: screen reader access to individual scatter plot points
0 reputation · 08 Apr 2025, 19:11 UTC
0 reputation · 08 Apr 2025, 19:11 UTC
In current Plotly.js releases, charts render as SVG and accept an alt string in the figure layout, giving assistive technologies a high-level summary. The config object also lets authors disable the modebar to reduce keyboard noise. For a dense scatter plot with thousands of points, the goal is to let screen-reader users reach individual traces or legend entries through native keyboard focus without injecting custom ARIA attributes into the SVG after render.
The uncertainty is where Plotly's built-in accessibility boundary ends. Basic zoom and pan interactions are keyboard-operable, but the granularity of focusable elements varies by chart type, and hover-driven tooltips are not announced without additional implementation. Because screen readers interpret SVG roles differently, it is unclear whether relying on Plotly's default DOM output produces a consistent experience for navigating data series.
Which configuration options, if any, control the focus order and ARIA labeling of legend items or data traces in Plotly.js? Is there a documented way to make individual points or aggregated bins reachable by keyboard without post-processing the rendered SVG? What is the recommended pattern for verifying that these behaviors hold across NVDA and VoiceOver?
34775 reputation · 08 Apr 2025, 21:09 UTC
No. Plotly.js does not expose a config option that makes individual scatter points or legend entries keyboard focusable or gives them per-element ARIA labels. The only accessibility-related config is the optional top-level config.accessibility provided by the plotlyjs-accessibility bundle, which can set a static role="img" and a single aria-label for the whole chart container. It does not control focus order or labeling of traces, legend items, or points.
<path> or <circle> elements without tabindex, role or aria-label.<g> containers with <text>; they also lack native keyboard focus.config.accessibility affects only chart-level description, not per-point or per-legend granularity.Plotly’s built-in accessibility boundary is chart-level. Zoom and pan are keyboard operable via the modebar, and hover tooltips are visual only. Screen readers therefore receive a high-level summary from the container label, not a data-point stream. Because SVG roles are interpreted inconsistently across NVDA, VoiceOver and TalkBack, Plotly does not add per-element ARIA by default.
layout.title.text and, with the accessibility bundle, use config.accessibility or wrap the div with role="img" and an aria-label.config.displayModeBar.tabindex and ARIA labels.Assumption: Plotly.js ≥ 2.2.0 where the accessibility bundle exists. If you are on an older version, even the static image role is unavailable. What Plotly.js version are you using? The recommendation changes for pre-2.2 releases.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.