Open mukherjeea opened 8 years ago
Sorry, I was just not familiar enough with this part of the API. I would prefer if it respected group ordering, but the way it works right now is that you need to use the sortBy option of the post processing capability like so:
group.post().sortBy('value.sum', d3.descending).cap(3)()
I'll answer on StackOverflow as well.
Longer-term, I'd prefer that the post-processing respected group order by default, so I will consider making that change for a 1.0 release and therefore leave this issue open.
Thanks, Ethan
You'll need to create a fake group. There is an example in the dc.js FAQ: https://github.com/dc-js/dc.js/wiki/FAQ#fake-groups
Note that you could also use dc.js's ordering and capping capabilities rather than Reductio's. Up to you!
Cheers Ethan. I got it working. That's why I removed the comment here and added the comment on SO. I would be nice the have the feature as well because most of the time I'm guessing people would want to use it in charts. I don't know where it fits between dc.js and reductio but I think this might be pretty useful. Thanks again!
So, is it possible to add a fake group on a reductio-ned group?
Probably the solution is already given, but to me it is not clear. Assume
reducer = reductio();
// complicate filtering on reducer
group = reducer(group)
then just doing the following looks like a lost of functionality. Am I wrong?
group = remove_empty_bins(group)
Please don't ask new questions on old issues being used to track features. Open a question on Stackoverflow or a new issue here with a running example of your issue/question. Thanks!
crossfilter top
orders correctly.reductio post().cap(length)()
doesn't.