applyConfig
Merges the supplied config objects over a fresh {select: node} target and
applies the result via instance.config(). Shared by every d3plus framework
wrapper.
Basic example
Section titled “Basic example”What every framework wrapper does with the props it receives: merge the config objects left to right (later ones win, undefined entries are skipped) over {select: container}, then hand the result to the instance’s config().
import {applyConfig} from "@d3plus/dom";
applyConfig(viz, container, {width: 300, title: "Default title"}, undefined, {width: 400, legend: false});// viz.config({select: container, width: 400, title: "Default title", legend: false})Loader formatters
Section titled “Loader formatters”dataFormat, linksFormat, nodesFormat, and topojsonFormat are config keys
like any other, so they go through config() with the rest.
import {applyConfig} from "@d3plus/dom";
applyConfig(viz, container, {data: "/data/fruits.csv", dataFormat: rows => rows.slice(0, 3), groupBy: "name"});// viz.config({select: container, data: "/data/fruits.csv", dataFormat: rows => rows.slice(0, 3), groupBy: "name"})Parameters
import {applyConfig} from "@d3plus/dom";