Repository navigation
functionality to make sure the labels of the axis are announced to the screenreader in the correct order - #25
tkranenburgrivm wants to merge 4 commits into
Conversation
…e screenreader in the correct order
hypebright
left a comment
There was a problem hiding this comment.
Most comments are related to wording/documentation
| #' ro_e_sort_xaxis_labels() | ||
| #' } | ||
| #' @importFrom htmlwidgets onRender | ||
| ro_e_sort_xaxis_labels <- function(fig) { |
There was a problem hiding this comment.
ro_e_theme(), ro_e_keyboard_nav(), ro_e_detect_axis_orientation() all use e instead of fig as argument name. fig is what ROvis.plotly is mainly using (and to make it even more inconsistent: ROvis.ggplot2 uses plot 😅). Ignoring the inconsistency across the suite (for now), I think e makes most sense here.
| @@ -0,0 +1,77 @@ | |||
|
|
|||
| #' Reorders x-axis label text nodes to match their left-to-right | |||
| #' (chronological) on-screen order, since echarts' anti-overlap label layout | |||
There was a problem hiding this comment.
minor: the word "chronological" only makes sense on a time axis right? If it's a category axis it's just as plain as "left to right". So perhaps say "left-to-right visual order"?
| #' \dontrun{ | ||
| #' library(echarts4r) | ||
| #' | ||
| #' mtcars |> |
There was a problem hiding this comment.
I think it makes more sense to add an example where category or time labels are clearly overlapping, so users can see immediately what the effect is with/without ro_e_sort_axis_labels
There was a problem hiding this comment.
Related to my earlier self-correction above: doesn't really matter if it's not designed to be used standalone. But still, for devs it would be nice to have a minimal example that shows immediately an effect.
There was a problem hiding this comment.
I think it makes more sense to add an example where category or time labels are clearly overlapping, so users can see immediately what the effect is with/without
ro_e_sort_axis_labels
Hi Veerle,
Good point. I can add this example.
This one from SPIN is showing visually no overlap.

But in the screenreader, they are announced like this:
![]()
So the x-axis is wrong, and the title is at the wrong place (hence the other PR), without those fixes
No description provided.