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

support for fillOpacity in swatch and ramp color legends #1407

Merged
merged 7 commits into from
Apr 1, 2023

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Mar 30, 2023

Note: I used fillOpacity and not opacity, for consistency with the symbol legends.

closes #1356

@Fil Fil requested a review from mbostock March 30, 2023 11:39
Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

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

The reason I suggested calling it opacity (and not fillOpacity) is that we use the color option for the opacity ramp legend. Also more practically, there is no possible stroke here, so we do not need to distinguish between fill and stroke, and opacity is shorter.

@Fil
Copy link
Contributor Author

Fil commented Mar 30, 2023

My code was really missing a few pieces :-(

Now, it's a bummer that we have to select opacity if there is no symbol, fillOpacity if the symbols are filled, and strokeOpacity if they are stroked. Maybe we could support opacity across the board (as well as strokeOpacity and fillOpacity)?

src/legends/swatches.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/legends/ramp.js Outdated Show resolved Hide resolved
src/legends/ramp.js Outdated Show resolved Hide resolved
@mbostock mbostock enabled auto-merge (squash) April 1, 2023 02:26
@mbostock mbostock merged commit 89657a1 into main Apr 1, 2023
@mbostock mbostock deleted the fil/color-legend-opacity branch April 1, 2023 02:27
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
…q#1407)

* support for fillOpacity in swatch and ramp color legends

closes observablehq#1356

* opacity

* fill opacity it is

* use fill-opacity

* minimize diff

* minimize diff; add default

* regenerate test snapshots

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
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.

color legend doesn't account for fillOpacity
2 participants