D3 – How to turn rollup with multiple nestings into array?

  arrays, d3.js, javascript

In my data, I did the following rollup using D3:

datag = d3.rollup(kmeans_data, v => d3.sum(v,d=>d.value),d=>d.attribute,d=>d.label)

The output for this is a InternMap with InternMaps.
When my roullpup has only one filtering, I can turn it into an
array using something like:

[...datag].map(([attribute, value]) => ({ attribute, value }));

My question is how to do it if I have multiple nestings, since the code above only turns the first InternMap into an array, thus, I get an Array of InternMaps, instead of an Array of Arrays.

Source: Ask Javascript Questions