Skip to content

Commit 6052fa8

Browse files
authored
paint-order (#701)
1 parent 6c29fd9 commit 6052fa8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ All marks support the following style options:
624624
* **opacity** - object opacity (a number between 0 and 1)
625625
* **mixBlendMode** - the [blend mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) (*e.g.*, *multiply*)
626626
* **shapeRendering** - the [shape-rendering mode](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering) (*e.g.*, *crispEdges*)
627+
* **paintOrder** - the [paint order](https://developer.mozilla.org/en-US/docs/Web/CSS/paint-order) (*e.g.*, *stroke*)
627628
* **dx** - horizontal offset (in pixels; defaults to 0)
628629
* **dy** - vertical offset (in pixels; defaults to 0)
629630
* **target** - link target (e.g., “_blank” for a new window); for use with the **href** channel

src/style.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function styles(
2222
strokeDasharray,
2323
opacity,
2424
mixBlendMode,
25+
paintOrder,
2526
shapeRendering
2627
},
2728
channels,
@@ -96,6 +97,7 @@ export function styles(
9697
mark.target = string(target);
9798
mark.opacity = impliedNumber(copacity, 1);
9899
mark.mixBlendMode = impliedString(mixBlendMode, "normal");
100+
mark.paintOrder = impliedString(paintOrder, "normal");
99101
mark.shapeRendering = impliedString(shapeRendering, "auto");
100102

101103
return [
@@ -162,6 +164,7 @@ export function applyIndirectStyles(selection, mark) {
162164
applyAttr(selection, "stroke-miterlimit", mark.strokeMiterlimit);
163165
applyAttr(selection, "stroke-dasharray", mark.strokeDasharray);
164166
applyAttr(selection, "shape-rendering", mark.shapeRendering);
167+
applyAttr(selection, "paint-order", mark.paintOrder);
165168
}
166169

167170
export function applyDirectStyles(selection, mark) {

0 commit comments

Comments
 (0)