movingAverage
Computes a rolling mean over points (ordered by x), with bands a set number of standard deviations either side of it (Bollinger bands). Points sharing an x value are first averaged into one, so the window counts distinct x values; non-finite pairs are ignored. Points without a full window (the first window − 1, or the ends of a centered window) have no average. With a span, each average takes the points within a stretch of x instead (see movingSpan), so gaps and uneven spacing average over the same length of x, and every point has one: where the stretch reaches past the data, it averages the points it holds so far (a lone point has a deviation of 0). Returns null when no point has an average.
Parameters
import {movingAverage} from "@d3plus/math";