Closed sarahfossheim closed 2 years ago
Looks good to me! I have some ideas to streamline the design a bit, but I think it's a great starting point.
Btw from an accessibility point of view is it easy to discover that the table exists with a screen reader? Because it's not even in the DOM, if I'm not mistaken? Should we have it in the DOM all the time and just hide it with CSS maybe? Or is that not necessary?
Also should I merge this now or wait?
@SachaG There's a table/viz switch before the table, when picking table it becomes accessible in the dom, so I don't think it's necessary to visually hide it. I can add a reference to it in the alt text / captions for the graphs as well maybe?
Want to fix a few translations first, afterwards good to merge from my end if it looks fine to you.
OK sounds good then, just let me know when it's ready :)
Each visualisation now has two options: graph or table view.
BlockViewSelector.js
added in the section header, and switches between viewsTable.js
takes in an array of tables and renders them.table.title
: optional, if present it gets added as a subtitletable.headings
: array of column headings ({id, label}
)table.rows
: array with the data for the rows ({id, label}
). For each row, the code will loop over the headings and try to find the datapoint with the same id. The first cell of each row is a row header.! This relies on a couple of new translations :)