Closed saschanaz closed 1 year ago
Is there a useful tool with which we can create a diagram, make it accessible, and maintain it?
https://github.com/mermaid-js/mermaid is known, but not sure what's the best way to make the resulting SVG accessible.
Perhaps that's something @whatwg/a11y has experience with?
It is possible to make SVG screen reader accessible using ARIA but only to a limited degree. Essentially if the diagram can be represented as a table or lists it's achievable. It does mean having to write the SVG from scratch though, so it has the structure to support the necessary ARIA roles.
More information:
For this diagram though, my suggestion is to treat the SVG like a standard image with a text description. Either pull the .svg file into an <img>
element, or if you embed the <svg>
element directly, then:
<svg role="img aria-label="Text description here">...</svg>
Indeed, I agree with @LJWatson that this SVG would be better served with a text description instead of trying to add the ARIA bits into the SVG. If used alongside that original paragraph, then the accessible name can identify it as a visualization of that paragraph. On its own, this chart would require more than an aria-label
can convey.
While Mermaid has made some strides, its output is a far way from being fully accessible.
In that case maybe it can also use aria-describedby
since my intention here is to add an image to an existing textual description.
Thanks! That sounds reasonable. SVG will have to be optimized through https://jakearchibald.github.io/svgomg/ as well and I guess we want to store the text input to Mermaid in a comment somewhere.
In that case maybe it can also use
aria-describedby
since my intention here is to add an image to an existing textual description.
Whatever approach you use, remember that both aria-label
and aria-describedby
are announced as flat text strings. While aria-label
values are flat text strings already, aria-describedby
can point to lists and tables and such, but will still only be announced as flat text.
Thanks for pointing that out! MDN suggests aria-details
, is it also for a paragraph with links?
The aria-details
property can maybe do what you want, but understand its support is mixed (what I consider poor). In other words do not rely on it unless you are prepared to test it across all targeted browser/SR combinations.
Using just a plain text reference is fine. It will also benefit more than SR users (think coga users, zoom users, sighted SR users who get even more impatient with the extra announcements, etc).
This is concise, but I think an image can help further to make it easier to understand. Something like: