-
Notifications
You must be signed in to change notification settings - Fork 185
propagate title and href by default #674
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
Conversation
src/transforms/group.js
Outdated
const groups = sort(rollup(I, V => V.length, i => X[i]), second); | ||
const top = groups.slice(-5).reverse(); | ||
if (top.length < groups.length) top.push(["Other", sum(groups.slice(0, -5), second)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const groups = sort(rollup(I, V => V.length, i => X[i]), second); | |
const top = groups.slice(-5).reverse(); | |
if (top.length < groups.length) top.push(["Other", sum(groups.slice(0, -5), second)]); | |
const N = 5; | |
const groups = sort(rollup(I, V => V.length, i => X[i]), second); | |
const top = groups.slice(-N).reverse(); | |
if (top.length < groups.length) top.push([groups.length === N + 1 ? groups[N][0] : "Other", sum(groups.slice(0, -N), second)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(if there are exactly 6 groups we can use the 6th's name.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to show the number of other categories, as well as the number of constituent elements.
Note for the future: the locale (#384) should also apply to "Other". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes #617.