-
Notifications
You must be signed in to change notification settings - Fork 188
flatRollup #197
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
flatRollup #197
Conversation
|
flatRollup seems fine, but not sure I understand the use case for flatGroupSort? That would require array equality to be useful, which JavaScript doesn’t support (even with InternMap). |
|
With flatGroupSort(data, d => d.a, d => d.b) the idea is to be able to enumerate the keys in a rolled-up order, in particular to focus on the n most populated groups. When I need to group on two dimensions I'll join them with a joined key: d => |
|
But you could sort the result of d3.flatGroup, no? |
|
Sure! |
|
I am onboard with flatRollup but I would not like to ship flatGroupSort and lexicographic (at least not yet) since I’m not sure it’s a justified addition. |
* lexicographic order * flatGroup, flatRollup * flatGroupSort * exports * remove flatGroupSort, lexicographic Co-authored-by: Mike Bostock <mbostock@gmail.com>
* flatGroup * flatRollup (#197) * lexicographic order * flatGroup, flatRollup * flatGroupSort * exports * remove flatGroupSort, lexicographic Co-authored-by: Mike Bostock <mbostock@gmail.com> * extract tests * Update README Co-authored-by: Philippe Rivière <fil@rezo.net>
Added flatRollup and tests, then got carried away and added flatGroupSort, which implies we needed a lexicographic comparator for arrays. Maybe that's too much, but it's easy to trim down.