Repository navigation
keyboard accessibility according to SPIN - #14
tkranenburgrivm wants to merge 5 commits into
Conversation
|
@hypebright Hi Veerle, |
|
@tkranenburgrivm , nice work! Some remarks (specifically about integration):
How you could integrate it:
Other stuff I noticed (but didn't check in depth yet since this is still a draft):
|
…_nav_js), ro_e_keyboard_nav_legend can be used on both ro_e_them/ro_e_build legend and plain svg legend, tests and vignette update to include ro_e_keyboard_nav_legend
@hypebright Hi Veerle, thanks a lot for the feedback! |
|
Ok, since there's a lot of related work. My proposal (also for internal documentation and overview): Convention:
|
| Function | Does | Who uses it |
|---|---|---|
ro_e_standard() / ro_ply_standard() |
Theme + all accessibility features | Default, recommended for everyone |
ro_e_theme() / ro_ply_theme() |
Styling only | Charts *_standard() doesn't cover, or styling-only needs |
Everything else (keyboard navigation, screen reader fixes, cursor, toolbar, etc.) is internal and wired into *_standard().
Principles
- Accessible by default. Users get all accessibility features without thinking about it, by calling
*_standard(). Keeps it simple. As said, should be the default. - One feature = one switch (future work) We need an option to turn off some stuff. Features can be turned off with a logical argument, default
TRUE:ro_e_standard(e, palette = "categorical", # styling args are passed through to the theme keyboard_nav = TRUE, # axis + legend keyboard navigation screenreader_order = TRUE # title first + label order (#24, #25) )
- Same argument names across packages wherever a feature exists in both.
- Every *_theme() takes the chart and applies the styling to it directly, like ro_gg_theme(), ro_gt_theme() and ro_e_theme() already do.
- Docs lead with *_standard(). The *_theme() help page says it does not include accessibility features and points to *_standard().
- Combinations that don't work get an explicit warning. For example, renderer = "canvas" + screenreader_order = TRUE → cli_warn().
Overview per PR
ROvis.echarts #14 (this PR)
- Add ro_e_standard(): calls ro_e_theme() + keyboard navigation (a potential switch to turn off/on comes later)
- Make ro_e_keyboard_nav() internal (remove @export, add @Keywords internal)
- Keep ro_e_theme() exported, styling only
- Update the vignette to use ro_e_standard()
- NEWS entry
- Keep ro_e_announce_title_first() and ro_e_sort_xaxis_labels() internal
- Call them from ro_e_standard() (in the future with a potential screenreader_order switch)
- Rename the fig argument to e (package convention)
- Keep ro_ply_theme() exported, but as ro_ply_theme(fig, ...) that applies the styling directly, and drop ro_ply_add_theme()
- Unexporting the rest (cursor, dim, title, toolbar, legend, keyboard_nav_*) is good 👍
- Keep one vignette, built around ro_ply_standard(), instead of removing both
Future work: make keyboard navigation on by default (currently type = "none") and use the shared switch names
I think we should keep ro_*_theme exported, mainly because every ROvis package has a *_theme() (ro_gg_theme, ro_gt_theme, ro_dt_theme, ro_e_theme), it's good we can make a distinction between styling and accessibility feats, and not every chart will fit *_standard() (subplots, maps, ...), so styling-only still makes sense.
Does all of that makes sense? If so, I will open issues for the future work (on/off switch)
Totally agree! Do you think we should add the e_standard in this PR, or should it be a separate thing? |
Can be separate if you want to keep it smaller, but for my review it doesn’t matter since I reviewed the standalone functionality already. But yeah technically speaking the cleanest way is separate..🤓 |
No description provided.