stylize
Applies each key/value in an object as a style.
Basic example
Section titled “Basic example”Applies every key of an object as an inline style on a d3 selection, one .style() call per entry, which is how a chart’s shapeConfig styles reach the drawn elements. Keys are CSS property names (stroke-width, not strokeWidth).
import {select} from "d3-selection";
import {stylize} from "@d3plus/dom";
stylize(select("rect"), {
fill: "#1c7ed6",
stroke: "#1864ab",
"stroke-width": 3,
opacity: 0.85,
});
Parameters
import {stylize} from "@d3plus/dom";