I am trying to .cap(10) a crossfilter dimension group to having the 10 highest values and then a group for whatever is rest. However, I am struggling to find out how to what the group Others is actually containing.
Take this code:
const group = reductio().count(true)(dimension.group());
const result = group
.post()
.sortBy("value.count", (a, b) =>
b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN
)
.cap(10)();
This groups as I am expecting, but I need to know what the Others is actually grouping. Is there anyway I can get that in? I was hoping for a result like:
[
{
key: "Group1",
value: {
count: 123
keys: ["Group1"]
},
/* ... more groups like this */
{
key: "Others",
value: {
count: 3453
keys: ["Group10", "Group11", "Group12"]
}
]
If using .dataList(true) on reductio, the dataList array prop on Others is empty. I would love to use crossfilter alone and not rely on reductio, if possible.
I am trying to
.cap(10)
a crossfilter dimension group to having the 10 highest values and then a group for whatever is rest. However, I am struggling to find out how to what the groupOthers
is actually containing.Take this code:
This groups as I am expecting, but I need to know what the
Others
is actually grouping. Is there anyway I can get that in? I was hoping for a result like:If using
.dataList(true)
on reductio, thedataList
array prop onOthers
is empty. I would love to use crossfilter alone and not rely on reductio, if possible.