MCPcopy Index your code
hub / github.com/microsoft/SandDance / pivotKeys

Function pivotKeys

docs/app/js/sanddance-app.js:118139–118150  ·  view source on GitHub ↗
(key, limit, pulse)

Source from the content-addressed store, hash-verified

118137 return (0, _vegaUtil.accessor)((d)=>key(d) === k ? value(d) : NaN, fields, k + "");
118138} // Collect (and optionally limit) all unique pivot values.
118139function pivotKeys(key, limit, pulse) {
118140 const map = {}, list = [];
118141 pulse.visit(pulse.SOURCE, (t)=>{
118142 const k = key(t);
118143 if (!map[k]) {
118144 map[k] = 1;
118145 list.push(k);
118146 }
118147 });
118148 list.sort((0, _vegaUtil.ascending));
118149 return limit ? list.slice(0, limit) : list;
118150}
118151/**
118152 * Partitions pre-faceted data into tuple subflows.
118153 * @constructor

Callers 1

aggregateParamsFunction · 0.70

Calls 1

keyFunction · 0.70

Tested by

no test coverage detected