Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot.movingAverage could generalize to other rolling aggregations. #189

Closed
mbostock opened this issue Mar 4, 2021 · 7 comments
Closed
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

mbostock commented Mar 4, 2021

E.g., https://www.rdocumentation.org/packages/zoo/versions/1.8-8/topics/rollmean (mean, max, min, median, sum).

@mbostock mbostock added the enhancement New feature or request label Mar 4, 2021
@Fil
Copy link
Contributor

Fil commented Mar 4, 2021

and array-blur (which has the advantage of keeping the full domain)

@Fil
Copy link
Contributor

Fil commented Mar 4, 2021

Geometric moving average, exponential moving average… are also in use. Since we don't want to cover every statistical corner, it'd be nice to have an entry point which would feed the (z and facet selected) series into a user-defined algorithm.

@mbostock
Copy link
Member Author

mbostock commented Mar 4, 2021

I was thinking we should add d3.rollmean, d3.rollmin, d3.rollmax etc. to d3-array, and then consume them here?

@Fil
Copy link
Contributor

Fil commented Mar 4, 2021

Yes I think it's the correct move. I realize that I'm often using the exponential moving average (though I just discovered yesterday it was called like this). Keeping just one value + a half-life multiplier is very powerful.

@mbostock
Copy link
Member Author

mbostock commented Mar 4, 2021

Yes, that would be great too! 👍

@Fil
Copy link
Contributor

Fil commented Mar 5, 2021

moving the issue to d3/d3-array#192 ; for Plot we just need to write a generic entry point (and keep the basic rollmean baked in, probably?)

@mbostock
Copy link
Member Author

Added in #245.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants