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

apply aggregations to the groups returned by nest reducer #43

Open
eagor opened this issue Jun 29, 2016 · 3 comments
Open

apply aggregations to the groups returned by nest reducer #43

eagor opened this issue Jun 29, 2016 · 3 comments

Comments

@eagor
Copy link

eagor commented Jun 29, 2016

ie, nest() would return an array of objects like:

{
    key: <key>,
    value: {
        sum: 300
        avg: 100
    }
}
@esjewett
Copy link
Member

Thanks for the suggestion. Can you expand a bit on the use-case you have in mind for this? My confusion is because this data structure is very similar to the structure you get back without using nest, just using sum and avg. Thanks!

@eagor
Copy link
Author

eagor commented Jul 3, 2016

I'm using reductio to generate data for a grouped bar chart, displaying timeseries data. My dataset has properties Date and Type. I'm using Date as dimension key. Then for each group (where key is Date), I need to display sum separately for each type.
Currently I'm achieving it by using .nest(d => d.Type), and calculating aggregations manually for each sub-group (per Type).

@esjewett
Copy link
Member

esjewett commented Jul 4, 2016

Thanks for the explanation. That does make sense. I'll need to think a little bit about how to accomplish this, and don't have much time at the moment, but I'll see if I can come up with something. If you want to take a shot at it, feel free to send a pull request.

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

No branches or pull requests

2 participants