MCPcopy Create free account
hub / github.com/d3/d3-array / flatten

Function flatten

src/group.js:12–17  ·  view source on GitHub ↗
(groups, keys)

Source from the content-addressed store, hash-verified

10}
11
12function flatten(groups, keys) {
13 for (let i = 1, n = keys.length; i < n; ++i) {
14 groups = groups.flatMap(g => g.pop().map(([key, value]) => [...g, key, value]));
15 }
16 return groups;
17}
18
19export function flatGroup(values, ...keys) {
20 return flatten(groups(values, ...keys), keys);

Callers 2

flatGroupFunction · 0.70
flatRollupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…