Closed PavelVanecek closed 2 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.60%. Comparing base (
49dd104
) to head (9245a77
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Tagging @julianna-langston as well, I think she has two accounts
With one difference, aria role. This uses region the other charts use application, which one is correct?
The chart should have 1 role, role="application"
. It should be at the top, in whatever is the container of the chart.
When it comes to role
s, the only thing we care about is what a screen reader thinks about it. When a screen reader sees role="application"
, it knows that thing, and all of its descendants, are interactive. In other words, we use role="application"
because it makes the element interactive.
Now, our charts are only interactive sometimes. If accessibilityLayer={false}
(current default, won't be default in 3.x) and there's a <Tooltip />
, then it's interactive. Otherwise, it's not interactive. In that case, philosophically it'd be better to have role="img"
at the container level, but I think that'll be difficult to implement, and the impact to a user is minimal.
Let me know if you'd like me to elaborate on how exactly role="application"
works for screen readers.
Thank you @julianna-langston , I made the change in new PR.
I think it would be valuable to have chart behaviour from a11y point of view written down in a wiki in the repository, and we would use it twice:
Description
I want to use hooks and dispatch here later so it has to be a functional component.
There are charts that are not using generateCategoricalChart, and they have almost the same component and could reuse this one too. With one difference, aria role. This uses
region
the other charts useapplication
, which one is correct? @julianna-ciq what would be the correct labelling? I was studying the spec but as far as I can tell, neither is a good fit for interactive charts.Related Issue
https://github.com/recharts/recharts/discussions/3717
Motivation and Context
Use redux instead of element cloning.
How Has This Been Tested?
npm test
Screenshots (if appropriate):
Types of changes
Checklist: