-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessibility: Screen readers doesn't announce any information on the connected nodes or direction of connection #2395
Comments
I want to add some more context to this issue. Using the following flow chart: flowchart TD;
A[Using a flow<br>chart in GitHub] --> B{Must it be<br>accessible?};
B -- No --> C[Wrong,<br>try again];
B -- Yes --> D{Into what format<br>does it render?};
D -- JPG/PNG/GIF --> E{Does it have<br>an `alt`?};
E -- No --> V[Wrong,<br>try again];
E -- Yes, and it<br>is lengthy --> V[Wrong,<br>try again];
E -- Yes, a<br>brief one --> F[Manually add<br>a plain text<br>description<br>of the chart.];
D -- SVG --> G{What `role`<br>does it have?};
G -- `none` --> N[Wrong,<br>try again];
G -- `table` --> N[Wrong,<br>try again];
G -- `grid` --> N[Wrong,<br>try again];
G -- `presentation` --> Y[Manually add<br>a plain text<br>description<br>of the chart.];
G -- `image` --> H{Does it have<br>an `aria-label`?};
H -- No --> P[Wrong,<br>try again];
H -- Yes, and<br>it is lengthy --> P[Wrong,<br>try again];
H -- Yes, a<br>brief one --> Z[Manually add<br>a plain text<br>description<br>of the chart.];
G -- `tree` --> I{Does it contain<br>any `treeitem`<br>roles for the<br>text nodes?};
I -- No --> R[Wrong,<br>try again];
I -- Yes --> J{Are they contained<br>in / owned by `group`<br>roles beyond the<br>first level?};
J -- No --> S[Wrong,<br>try again];
J -- Yes --> K{Have you<br>tested in<br>any screen<br>reader?};
K -- No --> T[Wrong,<br>try again];
K -- Yes --> L{Did it accurately<br>convey relationships<br>and structure from<br>the chart?};
L -- No --> U[Wrong,<br>try again];
L -- Yes --> M[You should write a<br>CSUN talk about it];
Screen readers announce it as nothing but unordered run-on text. There are no relationships, no structure, nothing to give context to the chart. It lacks necessary roles and properties as well. Here is the output directly from the speech viewer of JAWS 2021 with Chrome (the line breaks are from the
Here is output from the speech viewer of NVDA 2021.3 with Firefox (same about the line breaks):
The announcement is a bit different than what is shown here (every ` announces as "grav", for example). As you read the preceding text, I am sure you can understand how that conveys nothing of the meaning of the chart. Some of the reasons this is inaccessible:
As it stands, using a chart generated from mermaid-js almost guarantees the following WCAG violations.
I suspect 1.4.11 Non-Text Contrast, 1.4.12 Text Spacing, and 3.1.2 Language of Parts are at risk in some implementations as well. It looks like this bug was logged in 2019 as #1013 and closed with no PRs or other visible code changes. It never should have been closed. Microsoft's Fluid team attempted to address some of this in a PR: Add accessibility info to summary diagrams #3850, but that only addressed a flat structure. The example I embedded would not work with that structure. If it helps, this is the alternative text I wrote for the chart above:
As you can see, that is a bit verbose for a plain text description and lacks the nuance and structure you could represent with things like nested lists and clear descriptions of flow and relationship. |
While I strongly support this effort, the fact is that ARIA does not (yet) cover this kind of content very well. Still, there is much that could be added from today's ARIA which would improve the accessibility of mermaid content. ARIA roles and attributes such as We have the graphics-aria spec, which is a bare minimum for data viz. It offers three nameable roles
I do wonder: Why is mermaid not using this spec already? Another ARIA role I'd like to see used a whole lot more in mermaid is "group". Unlike the generic roles provided by default for Adding a meaningful semantic role such as "group" or "graphics-object" will get that element added to the accessibility tree. The names of these roles are very general, so naming will help manage expectations. For example, there (currently) is no ARIA role for "legend" but you can always do something like this: Datapoints may be associated with legend elements using I'd like to add that there is a discussion on the ARIA board about extending the graphics ARIA spec, to accommodate a wider set of dataviz 'primitives' - a proper ARIA spec for dataviz or infographic presentation. For example, we would like to see explicit semantics for Axis, Axis value, Datapoint, Legend and (most important of all) a reliable way to connect one element to another, independent of the DOM order (e.g. in a flowchart). I dearly hope that some of the folks here will join that discussion, contribute ideas, and perhaps gather insights which might be applied to mermaid. |
@amitkumariiit @aardrian @brennanyoung Can we start a discussion on this, perhaps in Discussions:Ideas ? I'd really like to work on improving accessibility in mermaid. (I'll start with #3626 as soon as PR #3684 is merged.) I think that more good, tangible ideas and goals can be developed. |
meanwhile (unless/until this is moved into a discussion).... Given the example flowchart, how could we show the possible sequence? Could In a simple example: How should the sequence for a choice and the options be represented? ex: flowchart TD
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
I think that if we can come up with some ideas for aria labels and sequencing (order), I can implement some ideas so we can see how they play out. |
Hi there, Yes, if Unfortunately it doesn't really do anything in any assistive tech except JAWS, and (worse still) the ARIA folks are threatening to deprecate the attribute because of poor usage stats. I am dismayed by this, because the real reason for those low stats is not that we don't need this feature, but that the spec is missing some important details that would make any implementation possible - as a result there's hardly any implementation in the wild. For example And then, what do we do with those IDs? Pull out the text nodes contained within and.. then how should they be represented by assistive tech? After that, what if we want to offer an affordance for 'returning' having flowed somewhere (e.g. the visit-footnote-and-return use case). And what if multiple arrows point to the same box? The possibility of one-to-many relationships complicate the concept of "back" . Presumably the browser or the assistive tech needs to maintain some kind of 'history' stack? No such expectations have been mapped out. If they had, we might have The other thing that worries me is that the suggested replacement, That said, if
If there is anyone here that believes that So, in general it is very difficult to offer "branching browsing affordances" for anything that goes against the standard DOM tree. As a result, some accessible dataviz experts such as Doug Schepers routinely use tab index as an affordance for data points, not because those points are supposed to be interactive, but because it's the only way to steer the AT flow from front end code. There is nothing corresponding to For now, the only other thing in the ARIA spec that comes anywhere near a directed graph connector is A flowchart choicebox might be imagined as a
(Flowchart nomenclature borrowed from https://en.wikipedia.org/wiki/Flowchart#Common_symbols ) BTW I support the idea of a broader discussion about a11y in mermaid, not all piggybacking on this one issue. |
I went ahead and created a discussion: #3689 . Thanks for your really complete and informative posts about all of this @brennanyoung . I'm going to try to put something together. I feel like I need to think about this more and do a bit more reading before commenting on the aria standard. (Though I am going to try to head towards doing that.) |
Looking at https://mermaid.js.org/config/accessibility.html Looks like SVG title and description are supported, which is good. However, more importantly would be critical to get the actual substance of the SVGs to be accessible. |
Describe the bug
Opening this new one as old one was closed. We checked on version 8.12.0 and its not fixed.
Accessibility: Screen readers doesn't announce any information on the connected nodes or direction of connection.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screen reader should announce more detailed information of the image ,there should be an alternative text provided describing the rendered svg.
Actual:
On navigating to the image using caps+arrow key , the narrator announces start and stop only , there is no information of it as a connected nodes or the direction of connection.
User Impact:
The screen reader users will not receive clear context about the image present on the screen.
Screenshots
If applicable, add screenshots to help explain your problem.
Code Sample
If applicable, add the code sample or a link to the live editor.
Desktop (please complete the following information):
OS: [Windows]
Browser [Edg/Chrome]
Version [NVDA/Narrator]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: