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

Should auto-calculated ordinal domain return sorted? #147

Open
mhkeller opened this issue Sep 8, 2023 · 6 comments
Open

Should auto-calculated ordinal domain return sorted? #147

mhkeller opened this issue Sep 8, 2023 · 6 comments
Labels
awaiting-something-else Needs some other thing to happen before it can be done discussion Talk about implementation of different chart types. enhancement New feature or request

Comments

@mhkeller
Copy link
Owner

mhkeller commented Sep 8, 2023

Currently, if you set an accessor for x y or z and you pass in an ordinal scale, the domain will be calculated as unique elements, say, for a color scale. The order of these unique elements is just based on when they appear in the data. Should .sort() be called on them so that the appearance is more consistent?

This could be a potential breaking change for some charts.

@mhkeller mhkeller added enhancement New feature or request discussion Talk about implementation of different chart types. labels Sep 8, 2023
@mhkeller
Copy link
Owner Author

Yea I think this would be a good idea.

@mhkeller
Copy link
Owner Author

Implemented in 8.0.0

@mhkeller
Copy link
Owner Author

I'm re-opening this since some people have found this behavior surprising. Maybe better to turn this off by default. Any thoughts welcome

@mhkeller mhkeller added the awaiting-something-else Needs some other thing to happen before it can be done label May 24, 2024
@mhkeller
Copy link
Owner Author

@techniq @rgieseke @jtrim-ons any preference on this one?

@techniq
Copy link
Contributor

techniq commented May 24, 2024

I personally find it surprising, and while yDomain={[...new Set(data.map((d) => d.name))]} does work, I think reverting to the pre-8.0.0 state would be a better default IMO, but not major if you don't.

@rgieseke
Copy link
Contributor

I have no strong preference here, thanks for the heads-up!
Not sure if there is an example in the gallery which demonstrates this already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-something-else Needs some other thing to happen before it can be done discussion Talk about implementation of different chart types. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants