plouc / nivo

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries
https://nivo.rocks
MIT License
13.08k stars 1.02k forks source link

Improve accessibility for assistive technologies #1847

Closed iManu closed 2 years ago

iManu commented 2 years ago

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

If we consider that graphs are most of time data in primitive tables there is probably a simple way to optimise accessibility in a row:

Could you made possible to generate a hidden (like "sr-only" css hide technique) table for each type of graphs when possible, and set a aria-hidden="true" attribute on main graphs container ?

Describe alternatives you've considered

Additional context

This work could be inspirational for you : https://myaccessible.website/blog/highcharts/data-chart-table-accessibility-highcharts


(With love from an ancient front dev at Fullsix/Ekino 😄 actually a11y referent guy for Scaleway UI)

Best regards

plouc commented 2 years ago

I definitely agree that tabular representations of graphs are a real good and functional alternative, but embedding this in the lib would add a lot of complexity IMHO, then you need to support CSS, potential extra classes, handle sizing, scrolling...

Having the ability to download the data could be simpler, but still broaden the responsibilities of the lib, which is mainly for data visualization. Also while figuring out a common tabular format for a bar chart might be relatively straightforward, it can be quite challenging when dealing with hierarchical data, sankey or chord diagrams...

Another thing I'm considering here is time, unfortunately a limited resource, especially to work on side projects, that's why I'm a bit reluctant to add such features. There's already plenty of work to do to reach a v1, such as completing the migration to TypeScript, completely replacing react-motion with react-spring, removing recompose for good and improving the documentation.

The features I've recently added were made for the upcoming state of CSS survey results, in order to try to improve a11y (although I'm fully aware it's still far from complete 😅), where we implemented data tables, but outside of the lib.

It's probably not the answer you were looking for, but I'm afraid I cannot help with this at the moment.

Happy to see nivo being integrated in another design system!

iManu commented 2 years ago

Thank you for the reactivity.

I would like to specify that the table is visually hidden, so there is no style or scroll behaviors to take in charge, it is pure only html table for screen readers and other assistive user-agent.

We are all in the same case, resources are a must have I totally agree. I hope this little seed I planted today is going to grow in your or the contributors mind for the future.

We try to be as much as possible valid with accessibility recommandation in our design system. I guess the charts could be augmented by our side or through a PR at nivo that we could perhaps submit ? Despite everything we continue to dig solutions ;)