Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ All marks support the following style options:
* **strokeMiterlimit** - to limit the length of *miter* joins
* **strokeDasharray** - a comma-separated list of dash lengths (in pixels)
* **mixBlendMode** - the [blend mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) (*e.g.*, *multiply*)
* **shapeRendering** - the [shape-rendering mode](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering) (*e.g.*, *crispEdges*)

All marks support the following optional channels:

Expand Down
5 changes: 4 additions & 1 deletion src/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export function Style(mark, {
strokeLinecap,
strokeMiterlimit,
strokeDasharray,
mixBlendMode
mixBlendMode,
shapeRendering
} = {}) {
mark.fill = impliedString(fill, "currentColor");
mark.fillOpacity = impliedNumber(fillOpacity, 1);
Expand All @@ -24,6 +25,7 @@ export function Style(mark, {
mark.strokeMiterlimit = impliedNumber(strokeMiterlimit, 4);
mark.strokeDasharray = string(strokeDasharray);
mark.mixBlendMode = impliedString(mixBlendMode, "normal");
mark.shapeRendering = impliedString(shapeRendering, "auto");
}

export function applyIndirectStyles(selection, mark) {
Expand All @@ -36,6 +38,7 @@ export function applyIndirectStyles(selection, mark) {
applyAttr(selection, "stroke-linecap", mark.strokeLinecap);
applyAttr(selection, "stroke-miterlimit", mark.strokeMiterlimit);
applyAttr(selection, "stroke-dasharray", mark.strokeDasharray);
applyAttr(selection, "shape-rendering", mark.shapeRendering);
}

export function applyDirectStyles(selection, mark) {
Expand Down
Loading