Skip to content

Add d3.movingAverage as a native d3-array function #176

@rdmurphy

Description

@rdmurphy

I've borrowed the moving average function found in this notebook a few times now, and having just done it again 😁 it made me wonder if it belongs in d3-array proper? I feel like it has a similar vibe to d3.cumsum.

The only pause I have is whether there is an issue with its definition of what constitutes the "moving average." I think I know how to modify to be center-based ((N - 1) / 2 values on either side of V vs. V and N - 1 previous values), but don't know if alternative definitions would/should be on the d3-array namespace under different names or as options to pass to a d3.movingAverage itself.

Either way, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions