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

Function updateInterval

docs/app/js/sanddance-app.js:119895–119905  ·  view source on GitHub ↗
(xv, i, interval)

Source from the content-addressed store, hash-verified

119893 return (x = 1 - x * x * x) * x * x;
119894} // advance sliding window interval of nearest neighbors
119895function updateInterval(xv, i, interval) {
119896 const val = xv[i];
119897 let left = interval[0], right = interval[1] + 1;
119898 if (right >= xv.length) return; // step right if distance to new right edge is <= distance to old left edge
119899 // step when distance is equal to ensure movement over duplicate x values
119900 while(i > left && xv[right] - val <= val - xv[left]){
119901 interval[0] = ++left;
119902 interval[1] = right;
119903 ++right;
119904 }
119905} // generate smoothed output points
119906// average points with repeated x values
119907function output(xv, yhat, ux, uy) {
119908 const n = xv.length, out = [];

Callers 1

loessFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected