-
Notifications
You must be signed in to change notification settings - Fork 795
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
feat: Add 'olli' renderer to generate accessible text structures for screen reader users #3580
Conversation
@jonathanzong Would you mind reviewing the JavaScript code? It's in an ugly Jinja template without syntax highlighting but maybe you notice something when skimming through it. It works in JupyterLab and VS Code so it can't be super wrong. I tested it with Mac VoiceOver and that worked fine but I have no experience with this. Example code you can use: import altair as alt
import pandas as pd
alt.renderers.enable("olli")
source = pd.DataFrame({
'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})
alt.Chart(source).mark_bar().encode(
x='a',
y='b'
) |
looks good to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a really interesting feature
Just had one question, since your js got the okay in #3580 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/vega/altair/pull/3580/files#r1750840828
Sounds good to me, thanks for this @binste
Co-authored-by: Dan Redding <125183946+dangotbanned@users.noreply.github.com>
Thank you both for the reviews! |
Closes #3575. A possible use case of this is that in a university course where Altair is used in a Jupyter notebook, with a single line of code,
alt.renderer.enable("olli")
, all charts in a notebook can be made accessible for screen reader users.I've tested this in JupyterLab and VS Code. In JupyterLab, all Olli controls worked, in VS Code, the following do not:
This might be an issue with how VS Code intercepts those key strokes. Might be configurable in VS Code but for now, I'm happy if it works in JupyterLab.