Skip to content

movingWindow

The window of points averaged at index i of length sorted points, as [start, end] indices (inclusive), or null when the window would run past either end. A trailing window ends at i; a centered one starts floor(window / 2) points before it.

Parameters

import {movingWindow} from "@d3plus/math";
irequirednumber

The point's index.

lengthrequirednumber

The number of points.

windowrequirednumber

How many points the window spans.

centerbooleanDefault false

Whether the window is centered on the point.