d3/d3-array

d3.flatGroup

mbostock opened this issue · 0 comments

Like array.flatMap, but for d3.group. For example d3.flatGroup(data, fa, fb) would return [[keya1, keyb1, values], [keya2, keyb2, values], …]. Useful for simple iteration…

for (const [species, sex, group] of d3.flatGroup(penguins, d => d.species, d => d.sex)) {
  
}

Maybe there would be a d3.flatRollup too.