More Accessible Mermaid Charts
See original GitHub issue👋 it would be nice to work towards more accessible features now that this library is in much wider use. I think a couple of low hanging fruit items would be to include <title>
elements in the output svg and <description>
so that people creating charts can offer text explanations of the charts.
There is lots of other work too be done in this area, but this seems like a simple place to start.
Charts to be completed
:
- Pie Chart PR
- Flowchart PR
- Sequence diagram PR
- Class Diagram PR
- State Diagram PR
- Entity Relationship Diagram PR
- User Journey PR
- Gantt PR
- Requirement Diagram PR
UPDATE 2-22-2022 (Twosday):
Ok I have a pr open with a new accessibility function that can add a title and a description to a chart. I set it up for Pie charts as they already had a title.
I am probably a blocker on this issue since I have been dealing with a bunch of family things and do not want to prevent someone else from picking this up. Feel free to either merge my pr and then add other charts or start work in some other way. If you would like to merge my pr and something needs to be cleaned up I will happily do it. cc @knsv
Issue Analytics
- State:
- Created 2 years ago
- Reactions:36
- Comments:15 (5 by maintainers)
Top GitHub Comments
I want to add some more context to this issue.
Using the following flow chart:
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
<br>
elements in the text):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.
Separately, the answer options in dark mode (“Yes”, “No”, “JPG/PNG/GIF”, etc) all fail WCAG contrast checks. I did not check outside of dark mode. The Firefox accessibility inspector and dev tools identify these failures readily.
Finally, this sentence from the GitHub announcement reveals a complete misunderstanding of how screen readers parse content (they work fine with JS, but the raw MarkDown is just as meaningless as the text I pasted):
Some reference material for working on making the SVGs more accessible:
@bee-san I left a comment.
It is frustrating that the bug report was opened after another bug report covering the same issue was closed due to inactivity from the project maintainers. The person who closed it also locked it from follow-up comments or re-opening.
Bugs don’t stop being bugs because you ignore them. Though it was oddly marked as a feature enhancement instead of a bug.