Hi everyone!
I would like to use Inputs.table()
to render array data within a ‘mapped’ (grouped?) data structure. Data started as a simple data, but I applied d3.group()
to see how many active projects I’ve got for each country in my portfolio:
data_grouped = d3.group(data, d => d.Country, d=> d.Status)
here’s the data I’d like to visualize:
Currently, I can achieve this by ‘flattening’ the mapped data using Array.from
, but because I have two levels of grouping, I have to do this twice:
nepal_active = Array.from(Array.from(data_grouped)[0][1])[0][1]
… Looking at this code, I imagine that there’s probably a better approach out there??
Here’s a notebook:
Thanks for sharing your insights!