Skip to content

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

Merged
merged 4 commits into from
Jan 18, 2022
Merged

Conversation

mbostock
Copy link
Member

Fixes #617.

@mbostock mbostock requested a review from Fil January 16, 2022 18:56
@mbostock mbostock requested a review from Fil January 17, 2022 04:48
Comment on lines 275 to 277
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)]);
Copy link
Contributor

@Fil Fil Jan 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)]);

Copy link
Contributor

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.)

Copy link
Member Author

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.

@Fil
Copy link
Contributor

Fil commented Jan 18, 2022

Note for the future: the locale (#384) should also apply to "Other".

@mbostock mbostock requested a review from Fil January 18, 2022 15:49
Copy link
Contributor

@Fil Fil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mbostock mbostock merged commit 556bcca into main Jan 18, 2022
@mbostock mbostock deleted the mbostock/standard-outputs branch January 18, 2022 16:48
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

Successfully merging this pull request may close these issues.

The bin and group transform could propagate the title channel, if any, by default
2 participants