Skip to content

automatic opt-out of opacity scale #1310

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
Mar 7, 2023
Merged

automatic opt-out of opacity scale #1310

merged 4 commits into from
Mar 7, 2023

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Mar 2, 2023

Fixes #1308; adds automatic opt-out of opacity scale.
Fixes #1309; adds per-channel scale overrides for bin & group transform outputs.

@mbostock mbostock requested a review from Fil March 2, 2023 19:41
@mbostock mbostock marked this pull request as ready for review March 4, 2023 01:47
@mbostock
Copy link
Member Author

mbostock commented Mar 4, 2023

What do you think, @Fil? If you don’t think automatic opt-out of the opacity scale is a good idea, I could extract the fix for #1309 into a separate PR. I have mixed feelings about this because it feels like it’s more likely to get a false positive (false negative?) where numbers that happen to be in the interval [0, 1] are erroneously interpreted as literal opacities.

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.

It makes sense to me that we would consider values in [0, 1] as literal opacities—the risks and benefits are similar to what we do for colors, and it would be more consistent.

I'm going to change the markov-chain example back to "auto", because it's what I had in mind when I wrote it — even though it ended up scaled up by 1/0.8 :-)

Fil and others added 2 commits March 6, 2023 17:15
@net
Copy link

net commented May 17, 2023

Could we get this for just "opacity" (in addition to "strokeOpacity" and "fillOpacity")?

@Fil Fil mentioned this pull request May 17, 2023
@Fil
Copy link
Contributor

Fil commented May 17, 2023

good catch, @net! this is fixed now in main (issue #1570, merged PR #1571).

@net
Copy link

net commented May 17, 2023

@Fil awesome!

chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* automatic opt-out of opacity scale

* reducer scale overrides

* use 'auto' scaling for markov-chain (in this case, 'auto' is identity, since all the numbers are in [0.1, 0.8])

* shorter

---------

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
3 participants