Skip to content
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

preserve group input order #1959

Merged
merged 6 commits into from
Dec 27, 2023
Merged

preserve group input order #1959

merged 6 commits into from
Dec 27, 2023

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Dec 23, 2023

Fixes #1678. If we simply don’t sort the groups naturally by key, then the groups will be in input order and hence the sort option will generally work as expected.

I’ll need to fix a number of the tests that relied on the implicit sort. Done.

@mbostock mbostock requested a review from Fil December 23, 2023 17:54
Copy link
Member Author

Choose a reason for hiding this comment

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

This should probably use multiply blending so the appearance is not affected by order, but that makes it unacceptably slow. 😞

Copy link
Contributor

Choose a reason for hiding this comment

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

we could switch to computing the end color directly? challenge unrelated to this PR though :)

@mbostock mbostock marked this pull request as ready for review December 23, 2023 19:07
docs/transforms/group.md Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

we could switch to computing the end color directly? challenge unrelated to this PR though :)

@mbostock mbostock merged commit b5366f9 into main Dec 27, 2023
1 check passed
@mbostock mbostock deleted the mbostock/group-input-order branch December 27, 2023 19:24
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* preserve group input order

* sort: "z"; fix tests

* reduce z docs

* fix tests

* Update docs/transforms/group.md

Co-authored-by: Philippe Rivière <fil@rezo.net>

---------

Co-authored-by: Philippe Rivière <fil@rezo.net>
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 group transform always sorts groups naturally; should this be configurable?
2 participants