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

Function stackNormalize

docs/app/js/sanddance-app.js:130203–130210  ·  view source on GitHub ↗
(group, max, field, y0, y1)

Source from the content-addressed store, hash-verified

130201 }
130202}
130203function stackNormalize(group, max, field, y0, y1) {
130204 var scale = 1 / group.sum, last = 0, m = group.length, j = 0, v = 0, t;
130205 for(; j < m; ++j){
130206 t = group[j];
130207 t[y0] = last;
130208 t[y1] = last = scale * (v += Math.abs(field(t)));
130209 }
130210}
130211function stackZero(group, max, field, y0, y1) {
130212 var lastPos = 0, lastNeg = 0, m = group.length, j = 0, v, t;
130213 for(; j < m; ++j){

Callers

nothing calls this directly

Calls 1

fieldFunction · 0.70

Tested by

no test coverage detected