Skip to content

Ordinal opacity scales #2284

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

Open
mbostock opened this issue Feb 20, 2025 · 0 comments · May be fixed by #2285
Open

Ordinal opacity scales #2284

mbostock opened this issue Feb 20, 2025 · 0 comments · May be fixed by #2285
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

We support ordinal color scales:

Image
Plot.legend({color: {type: "ordinal", domain: d3.range(10)}})

But trying to do the same with an opacity scale results in an error:

Error: ordinal opacity scales are not supported
Plot.legend({opacity: {type: "ordinal", domain: d3.range(10)}})

I see no reason we couldn’t support ordinal opacity scales by dividing the range interval [0, 1] equally based on the cardinality of the domain.

Image
@mbostock mbostock added the enhancement New feature or request label Feb 20, 2025
@mbostock mbostock linked a pull request Feb 20, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant