Skip to content

functionality to make sure the labels of the axis are announced to the screenreader in the correct order - #25

Open
tkranenburgrivm wants to merge 4 commits into
developfrom
feat/screenreader_label_announcement
Open

tkranenburgrivm wants to merge 4 commits into
developfrom
feat/screenreader_label_announcement

Conversation

@tkranenburgrivm

@tkranenburgrivm tkranenburgrivm commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@tkranenburgrivm tkranenburgrivm changed the title functionality to make sure the labels of the axis are announced to th… functionality to make sure the labels of the axis are announced to the screenreader in the correct order Oct 22, 2026
@tkranenburgrivm tkranenburgrivm self-assigned this Oct 22, 2026

@hypebright hypebright left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most comments are related to wording/documentation

Comment thread R/ro_e_sort_xaxis_labels.R Outdated
#' ro_e_sort_xaxis_labels()
#' }
#' @importFrom htmlwidgets onRender
ro_e_sort_xaxis_labels <- function(fig) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for #24

Comment thread R/ro_e_sort_xaxis_labels.R Resolved
Comment thread R/ro_e_sort_xaxis_labels.R Outdated
@@ -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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 |>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
image
But in the screenreader, they are announced like this:
image
So the x-axis is wrong, and the title is at the wrong place (hence the other PR), without those fixes

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants