Skip to content

Commit b7c3902

Browse files
committed
use fill-opacity
1 parent b44cc55 commit b7c3902

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/legends/ramp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export function legendRamp(color, options) {
121121

122122
svg
123123
.append("g")
124-
.attr("opacity", opacity)
124+
.attr("fill-opacity", opacity)
125125
.selectAll()
126126
.data(range)
127127
.enter()
@@ -142,7 +142,7 @@ export function legendRamp(color, options) {
142142

143143
svg
144144
.append("g")
145-
.attr("opacity", opacity)
145+
.attr("fill-opacity", opacity)
146146
.selectAll()
147147
.data(domain)
148148
.enter()

src/legends/swatches.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export function legendSwatches(color, {opacity, ...options}) {
2222
selection
2323
.append("svg")
2424
.attr("fill", scale.scale)
25+
.attr("fill-opacity", maybeNumberChannel(opacity)[1])
2526
.append("rect")
2627
.attr("width", "100%")
27-
.attr("height", "100%")
28-
.attr("opacity", maybeNumberChannel(opacity)[1]),
28+
.attr("height", "100%"),
2929
(className) => `.${className}-swatch svg {
3030
width: var(--swatchWidth);
3131
height: var(--swatchHeight);

0 commit comments

Comments
 (0)