MCPcopy Create free account
hub / github.com/microsoft/SandDance / processPartition

Function processPartition

docs/app/js/sanddance-app.js:119024–119044  ·  view source on GitHub ↗
(list, state, cmp, _)

Source from the content-addressed store, hash-verified

119022 }
119023});
119024function processPartition(list, state, cmp, _) {
119025 const sort = _.sort, range = sort && !_.ignorePeers, frame = _.frame || [
119026 null,
119027 0
119028 ], data = list.data(cmp), // use cmp for stable sort
119029 n = data.length, b = range ? (0, _d3Array.bisector)(sort) : null, w = {
119030 i0: 0,
119031 i1: 0,
119032 p0: 0,
119033 p1: 0,
119034 index: 0,
119035 data: data,
119036 compare: sort || (0, _vegaUtil.constant)(-1)
119037 };
119038 state.init();
119039 for(let i = 0; i < n; ++i){
119040 setWindow(w, frame, i, n);
119041 if (range) adjustRange(w, b);
119042 state.update(w, data[i]);
119043 }
119044}
119045function setWindow(w, f, i, n) {
119046 w.p0 = w.i0;
119047 w.p1 = w.i1;

Callers 1

transformFunction · 0.70

Calls 3

setWindowFunction · 0.70
adjustRangeFunction · 0.70
updateMethod · 0.45

Tested by

no test coverage detected