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

Function groupSort

src/groupSort.js:5–10  ·  view source on GitHub ↗
(values, reduce, key)

Source from the content-addressed store, hash-verified

3import sort from "./sort.js";
4
5export default function groupSort(values, reduce, key) {
6 return (reduce.length !== 2
7 ? sort(rollup(values, reduce, key), (([ak, av], [bk, bv]) => ascending(av, bv) || ascending(ak, bk)))
8 : sort(group(values, key), (([ak, av], [bk, bv]) => reduce(av, bv) || ascending(ak, bk))))
9 .map(([key]) => key);
10}

Callers 1

groupSort-test.jsFile · 0.90

Calls 5

rollupFunction · 0.90
sortFunction · 0.85
ascendingFunction · 0.85
groupFunction · 0.85
reduceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…