Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 docs/features/marks.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ All marks support the following style options:
* **strokeDashoffset** - the [stroke dash offset](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset) (typically in pixels)
* **opacity** - object opacity (a number between 0 and 1)
* **mixBlendMode** - the [blend mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) (*e.g.*, *multiply*)
* **imageFilter** - a CSS [filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) (*e.g.*, *blur(5px)*)
* **shapeRendering** - the [shape-rendering mode](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering) (*e.g.*, *crispEdges*)
* **paintOrder** - the [paint order](https://developer.mozilla.org/en-US/docs/Web/CSS/paint-order) (*e.g.*, *stroke*)
* **dx** - horizontal offset (in pixels; defaults to 0)
Expand Down
8 changes: 8 additions & 0 deletions src/mark.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ export interface MarkOptions {
*/
mixBlendMode?: string;

/**
* A CSS [filter][1]; a constant string used to adjust the rendering of
* images, such as *blur(5px)*.
*
* [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/filter
*/
imageFilter?: string;

/**
* The [paint-order][1]; a constant string specifying the order in which the
* **fill**, **stroke**, and any markers are drawn; defaults to *normal*,
Expand Down
3 changes: 3 additions & 0 deletions src/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function styles(
strokeDashoffset,
opacity,
mixBlendMode,
imageFilter,
paintOrder,
pointerEvents,
shapeRendering
Expand Down Expand Up @@ -135,6 +136,7 @@ export function styles(
mark.ariaHidden = string(ariaHidden);
mark.opacity = impliedNumber(copacity, 1);
mark.mixBlendMode = impliedString(mixBlendMode, "normal");
mark.imageFilter = impliedString(imageFilter, "none");
mark.paintOrder = impliedString(paintOrder, "normal");
mark.pointerEvents = impliedString(pointerEvents, "auto");
mark.shapeRendering = impliedString(shapeRendering, "auto");
Expand Down Expand Up @@ -368,6 +370,7 @@ export function applyIndirectStyles(selection, mark, dimensions, context) {
applyAttr(selection, "stroke-dasharray", mark.strokeDasharray);
applyAttr(selection, "stroke-dashoffset", mark.strokeDashoffset);
applyAttr(selection, "shape-rendering", mark.shapeRendering);
applyAttr(selection, "filter", mark.imageFilter);
applyAttr(selection, "paint-order", mark.paintOrder);
applyAttr(selection, "pointer-events", mark.pointerEvents);
}
Expand Down