Skip to content

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)?

@mbostock mbostock force-pushed the fil/color-legend-opacity branch from ed7d07f to b7c3902 Compare April 1, 2023 02:21
@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 <[email protected]>
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

3 participants