Network
Creates a network visualization based on a defined set of nodes and edges.
Basic example
Section titled “Basic example”Each node supplies its own x/y coordinates, so d3plus places nodes exactly rather than solving a layout for them.
const config = {
groupBy: "id",
nodes: [
{id: "alpha", x: 1, y: 1},
{id: "beta", x: 2, y: 1},
{id: "gamma", x: 1, y: 2},
{id: "epsilon", x: 3, y: 2},
{id: "zeta", x: 2.5, y: 1.5},
{id: "theta", x: 2, y: 2},
],
links: [
{source: 0, target: 1},
{source: 0, target: 2},
{source: 3, target: 4},
{source: 3, target: 5},
{source: 5, target: 0},
],
};
Force directed layout
Section titled “Force directed layout”Omitting x/y from the nodes lets a force simulation position them automatically—reach for this when connections matter but there’s no meaningful spatial layout.
const config = {
nodes: [
{id: "alpha"},
{id: "beta"},
{id: "gamma"},
{id: "epsilon"},
{id: "zeta"},
{id: "theta"},
],
links: [
{source: 0, target: 1, weight: 10},
{source: 0, target: 2, weight: 10},
{source: 3, target: 4, weight: 10},
{source: 3, target: 5, weight: 5},
{source: 5, target: 0, weight: 20},
{source: 2, target: 1, weight: 12},
{source: 4, target: 5, weight: 12},
],
linkSize: d => d.weight,
};
Clusters
Section titled “Clusters”A network with no colors of its own is colored by the clusters in it: groups of nodes linked more to each other than to the rest, found with the Louvain method and weighted by linkSize, so here the heaviest collaborations pull hardest. Each cluster is named after its most-connected node (“Fay cluster”). The legend lists the clusters largest first, even though this network has only nodes and no data, and clicking one zooms to it. At most clusterConfig.max clusters are kept (12 by default, so each gets its own palette color): while there are more, the smallest joins the cluster it shares the most link weight with, or the largest cluster when it has no links to another. Each name is also written inside its cluster, where it fits clear of the nodes and their labels, shrinking down to clusterConfig.labelConfig.fontMin (10px) before it is left off; the legend still names every cluster.
Clusters apply only while the chart’s color is its default. Setting color, colorScale, colorOrdinal, or a shapeConfig fill colors the nodes as configured instead, and so does more than one groupBy level. A network with fewer than two clusters of two or more nodes (no links, or one cluster holding everything) keeps one color per node, as does a node with no links. Set cluster to false to turn clustering off. linkColor: "source" colors each link like its source node’s cluster, and charts linked with link share the clusters’ colors when they share their names.
Network and ArcDiagram: colors each node by its cluster (found with the Louvain method, weighted by linkSize), named after its most-connected node and listed in the legend; clicking a cluster zooms to it. Applies only while the chart's color is its default. Defaults to true.
The thickness of each link: a pixel number used for every link, or an accessor function whose values are scaled between linkSizeMin and linkSizeMax (see linkSizeScale). The function receives each link, with source and target set to the data of the nodes at its ends, and its index in links.
ƒ (function)clusterConfig.label names each cluster: it receives the row of the cluster’s most-connected node, the cluster’s index (0 is the largest), and every member’s row. clusterConfig.labelConfig styles the names written on the chart (fontMax, fontMin, padding, and TextBox settings such as fontColor or fontWeight), or false leaves them to the legend.
const people = "Ada Ben Cleo Dev Eli Fay Gus Hana Ivo Jun Kai Lea Mo Nia Omar"
.split(" ")
.map(id => ({id}));
const pairs = [
["Ada", "Ben", 6],
["Ada", "Cleo", 4],
["Ben", "Cleo", 5],
["Ada", "Dev", 3],
["Cleo", "Dev", 2],
["Dev", "Eli", 4],
["Ben", "Eli", 2],
["Fay", "Gus", 7],
["Fay", "Hana", 5],
["Gus", "Hana", 3],
["Gus", "Ivo", 4],
["Hana", "Ivo", 2],
["Ivo", "Jun", 5],
["Fay", "Jun", 2],
["Kai", "Lea", 6],
["Kai", "Mo", 4],
["Lea", "Mo", 3],
["Mo", "Nia", 5],
["Lea", "Nia", 2],
["Nia", "Omar", 4],
["Kai", "Omar", 3],
["Eli", "Fay", 1],
["Jun", "Kai", 1],
["Omar", "Ada", 1],
];
const config = {
nodes: people,
links: pairs.map(([source, target, papers]) => ({source, target, papers})),
linkSize: d => d.papers,
clusterConfig: {
label: (d, i, members) => `${d.id}'s lab (${members.length})`,
labelConfig: {fontMax: 20, fontWeight: 400},
},
};
Data driven link size
Section titled “Data driven link size”linkSize takes an accessor returning each link’s weight, which d3plus runs through a square-root scale (linkSizeScale) to set stroke thickness—heavier links render thicker. The thinnest link is linkSizeMin pixels wide (1 by default) and the widest linkSizeMax, which defaults to half the smallest node’s radius so that even the heaviest links stay narrower than the nodes they join.
The thickness of each link: a pixel number used for every link, or an accessor function whose values are scaled between linkSizeMin and linkSizeMax (see linkSizeScale). The function receives each link, with source and target set to the data of the nodes at its ends, and its index in links.
ƒ (function)The thinnest link, in pixels, when linkSize values differ.
Network, Rings, and Geomap: the widest link, in pixels, when linkSize values differ. Network and Rings default to half the smallest node's radius (never thinner than linkSizeMin); Geomap defaults to 10. A linkSizeMin wider than a set linkSizeMax is held to it.
Directional arrows
Section titled “Directional arrows”arrows draws an arrowhead at the node boundary to show edge direction. Use "target", "source", "both", or a per-link accessor for bi-directional edges. arrowSize overrides the automatic size.
Draws arrowheads on the links: true (or "target") at each link's target end, "source" at its source end, "both", or false for none. Also accepts an accessor function returning one of those per link.
The arrowhead size in pixels, or an accessor function returning one per link. Defaults to three times the link's stroke width, at least 6 and at most 12 pixels, but never under 1.5 times the stroke width so the head stays wider than its line. The line stops inside the head.
Size legend
Section titled “Size legend”Sizing nodes with size adds a size legend. When there’s room it is drawn in the open space around the nodes (see legendInset), otherwise in the bottom-right corner. It is drawn with the chart’s own radius scale, which Network fits to the space between nodes. Zoom in and the circles keep their size while the labels change to the values those circles now represent on screen.
Sizes each node: a data key or an accessor function whose values are scaled between sizeMin and sizeMax (see sizeScale). When unset, every node is drawn at the same size.
The minimum pixel radius used when sizing nodes.
The maximum pixel radius used when sizing nodes. Defaults to half the distance between the two closest nodes.
Whether to display the size legend: a nested-circle key, in the chart's bottom-right corner, for charts that size their marks with a size accessor (bubble plots, Geomap points via pointSize, Network, Rings). By default it shows whenever marks are sized by more than one value, unless it would take up more than a third of the chart's width or height. Pass true to always show it, false to hide it, or a function that receives the resolved chart config, the radius scale, and the legend's measured {width, height, availableWidth, availableHeight}, and returns a boolean.
Legend inset
Section titled “Legend inset”A network gathered in the middle of a wide chart leaves its corners empty, so the legend is drawn in one of them, over a translucent box, instead of taking a margin. Zoom in and the nodes slide under the box while the legend stays readable. Set legendInset to false to keep the legend in its margin.
Whether the chart may draw a legend, size legend, or colorScale inside empty space around its marks (over a translucent box, see legendInsetConfig) instead of in a margin. Only a legend whose position is "auto" can move inside. Defaults to true; also accepts a function of the resolved config.
Label placement
Section titled “Label placement”A node’s label stays inside it when it fits there at a readable size (pointLabelConfig.fontMin, 10px by default). Otherwise it moves beside the node, on the side with the most open room, as long as it overlaps no other node or label; a label with no room is hidden, and the node’s tooltip still names it. Bigger nodes are labeled first. Set labelPosition to "inside" to keep every label inside its node, shrinking it to fit, or "outside" to put every label beside its node.
Where each shape's label goes: "auto", "along", "inside", or "outside", or a (d, i) => string accessor. "auto" picks whichever fits best per shape, and a label with no room is left out.
- Rings (Pie, Donut, Sunburst, Chord, RadialBar) and polar charts (Radar, PolarArea, RadialMatrix): "along" curves the name along its arc. "inside" keeps it straight; on a Pie or Donut, "outside" moves it beside the ring with a leader line. - Bars: inside or outside the bar. "auto" goes outside when the bar is short. Stacked bars always label inside. - Circles (Plot points, Network nodes, Geomap points): inside the circle, or beside it when it doesn't fit ("outside" always beside). - Stacked areas: "auto" and "along" run each name along its band; "inside" puts it in the band's largest box.
When every stacked area or RadialBar track is named along its shape, the default legend hides. Defaults to "auto".
Link tooltips
Section titled “Link tooltips”Hovering a link highlights it and the two nodes it connects, and its tooltip names them (“alpha → beta”) above the link’s own fields. Hovering a node lists its number of connections and, when linkSize gives the links different values, its strongest links with their values; nodeTooltipLinks sets how many (false for none). linkSize, link shapeConfig functions, and tooltip accessors all receive each link with source and target set to the data of its nodes, so here a link between two nodes in the same group draws darker. Click a link to focus and zoom to it and its nodes; click it again, or the background, to reset.
How many links a node's tooltip lists under its number of connections, strongest first: a number, or false for none. Defaults to 3 when the links differ in linkSize, and none otherwise.
Network measures
Section titled “Network measures”A node’s tooltip also lists where the node stands in the network:
- Degree: its number of links, in place of the “Connections” count. When the chart draws
arrows, it is split into “In-degree” (links pointing at the node) and “Out-degree” (links pointing away), and the other measures follow the arrows too. - Betweenness: the share of the shortest paths between every other pair of nodes that pass through it, from 0 to 1 (1 is the center of a star). Here Dev, Eli, and Fay score highest: every path between the two groups crosses them.
- Closeness: how near it is to the rest of the network, from 0 to 1 (1 is a node one link from every other). A node that can reach only part of a network scores lower in proportion, and a node with no links scores 0.
- Cluster: the name of its cluster, while clusters color the chart.
Betweenness and closeness compare every pair of nodes, so they are worked out a little at a time while the browser is idle after the chart draws, without holding up the page. A tooltip opened before they are ready shows “…” in their place, and fills in the values when they arrive. They are kept until the nodes or links change, and new nodes or links stop a calculation that is under way. On a network of a few thousand nodes they can take several seconds to arrive.
nodeTooltipStats picks the measures to list, as an Array of "degree", "betweenness", "closeness", and "cluster" in the order to list them, or false lists none (and the “Connections” count returns). Every link counts as one step; set nodeTooltipStatsConfig.weighted to true to count a strong link (by linkSize) as a shorter step than a weak one, so the shortest paths prefer the strongest links: a link half as strong as the strongest is two steps.
Draws arrowheads on the links: true (or "target") at each link's target end, "source" at its source end, "both", or false for none. Also accepts an accessor function returning one of those per link.
Link color
Section titled “Link color”linkColor colors each link. A key or accessor whose values are numbers colors the links on the chart’s colorScale, which then shows the links’ values beside the legend for the nodes’ colors. Strings are used as colors when they parse as one, or else as categories in the chart’s palette, the way color colors nodes. "source" or "target" colors each link like one of its nodes. Arrowheads take their link’s color. When the chart also sets colorScale for its nodes, nodes and links share that one scale. Because links are thin lines, a light theme’s ramp starts at a mid-tone rather than a near-white tint, so the lowest values still show (colorScaleConfig.ordinalRamp).
Colors each link: "source" or "target" takes that end node's color, and a key or accessor function reads a value from each link (receiving the link and its index in links). A number is colored on the chart's colorScale, which then shows the links' values; a string is a color when it parses as one, or else a category in the chart's palette. false (the default) draws every link in the theme's link gray.
"trips"Link labels
Section titled “Link labels”linkLabel writes a key or accessor’s value at the middle of each link, between the nodes it joins, on a pad of the chart’s background so it reads over the line. linkLabelConfig.rotate runs the text along each link ("along", the default, kept upright) or keeps it level ("horizontal"), and takes font settings such as fontSize and fontColor. On a curved link, a self-loop or a bundled edge (see Edge bundling), the text follows the curve over a pad that bends with it, cut short with an ellipsis where the curve has too little room. linkLabelConfig.minRadius sets the tightest bend a label follows, as a radius in ems (2 by default): a loop bending tighter keeps a straight label, which reads better than a few letters crowded around the turn. A label that would cover a node, a node’s label, or another link’s label is hidden, the thickest links’ labels kept first.
Text drawn at the middle of each link: a key or accessor function (receiving the link and its index in links). Numbers are abbreviated in the chart's locale. Labels that would cover a node or another label are hidden. Defaults to none.
Self-loops
Section titled “Self-loops”A link whose source and target are the same node draws as a loop outside the node, pointing into the widest gap between the node’s other links (or away from the middle of the network when it has none). Its thickness comes from linkSize, its label from linkLabel (at the loop’s far point), and arrows draws its arrowhead where it comes back into the node. Several loops on one node fan out side by side, the heaviest in the middle. A loop has the same tooltip, hover, click focus, and keyboard focus as any other link, and a node’s tooltip lists it as “↻ node”.
The thickness of each link: a pixel number used for every link, or an accessor function whose values are scaled between linkSizeMin and linkSizeMax (see linkSizeScale). The function receives each link, with source and target set to the data of the nodes at its ends, and its index in links.
ƒ (function)Text drawn at the middle of each link: a key or accessor function (receiving the link and its index in links). Numbers are abbreviated in the chart's locale. Labels that would cover a node or another label are hidden. Defaults to none.
ƒ (function)Draws arrowheads on the links: true (or "target") at each link's target end, "source" at its source end, "both", or false for none. Also accepts an accessor function returning one of those per link.
Edge bundling
Section titled “Edge bundling”linkBundle pulls links that run the same way near each other into shared curves that fan out at their ends, so the main flows between groups read through the clutter of a dense network. Two links bundle when they are close to parallel, of similar length, near each other, and alongside each other (force-directed edge bundling, after Holten and van Wijk). linkBundleConfig.strength sets how closely each link keeps to its bundle, from 0 (straight) to 1; compatibility sets how alike two links must be to bundle (lower bundles more); and cycles, iterations, and smoothing tune the simulation and the curve. Arrowheads, labels, tooltips, and click focus follow each curve, and a link from a node to itself keeps its loop. The bundling is worked out once per layout and reused while the chart zooms, pans, or is hovered.
Bundles the links: links running the same way near each other are drawn pulled together, so the main flows read through the clutter. Defaults to false.
Draws arrowheads on the links: true (or "target") at each link's target end, "source" at its source end, "both", or false for none. Also accepts an accessor function returning one of those per link.
Configuration
import {Network} from "@d3plus/core";
Extends Viz.
activefalse|functionThe active callback function for highlighting shapes.
aggsobjectCustom aggregation functions keyed by data property.
ariaHiddenbooleanDefaulttrueHides the SVG from assistive technology when true (
aria-hidden).arrowSizenumber|functionThe arrowhead size in pixels, or an accessor function returning one per link. Defaults to three times the link's stroke width, at least 6 and at most 12 pixels, but never under 1.5 times the stroke width so the head stays wider than its line. The line stops inside the head.
arrowsboolean|"target"|"source"|"both"|functionDefaultfalseDraws arrowheads on the links:
true(or"target") at each link's target end,"source"at its source end,"both", orfalsefor none. Also accepts an accessor function returning one of those per link.attributionstring|booleanDefaultfalseSets text to be shown positioned absolute on top of the visualization in the bottom-right corner. This is most often used in Geomaps to display the copyright of map tiles. The text is rendered as HTML, so any valid HTML string will render as expected (eg. anchor links work).
attributionIconstring|functionOverrides the "ⓘ" icon a long attribution collapses to (see
attribution), which otherwise renders as an inline SVG. Accepts an HTML string — used as the toggle button's content — or a mount function,(el: HTMLElement) => void | (() => void), called once with the button's reserved icon slot so a live component (a React tree viacreateRoot(el).render(...), or anything else imperative) can be mounted into it. A returned cleanup function runs right before that slot is discarded, which happens whenever the credit's markup regenerates (its text or theme changes), not just once per chart.attributionStylerecordCSS key/value pairs used to style the attribution text.
backControlClassNamestringAn additional CSS class name (or space-separated list of class names) applied to the back button, alongside its fixed
back-controlclass. Setting this automatically disables d3plus's built-in inlinebackControlStyledefault (as long as you haven't already customized it yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.backControlStylerecord|falseAn object containing CSS key/value pairs that is used to style the back button. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.backControlClassName(...)is set, unless you've explicitly customized this yourself.cachebooleanDefaulttrueWhether the chart uses the data cache that every chart on the page shares for the files fetched by
data,links,nodes,topojson, andfitObject, so charts loading the same URL share one request and loading it again, or changing a formatter, needs none. The cache uses up to about 50 MB of memory, dropping the least recently used files first. Defaults totrue;falsefetches on every load.clearDataCache()from@d3plus/dataempties the cache.classNamestring|array.<string>|undefinedCSS classes added to the outermost element this chart or component draws into, next to its fixed d3plus classes, so page CSS can target it: a chart's root
<svg class="d3plus-viz">(its<canvas>with the Canvas renderer) and a standalone component's<svg>. Takes a space-separated string or an array. A new value replaces the classes the previous one added; unset adds none. Tooltips take their owntooltipConfig.className.clusterbooleanDefaulttrueNetwork and ArcDiagram: colors each node by its cluster (found with the Louvain method, weighted by
linkSize), named after its most-connected node and listed in the legend; clicking a cluster zooms to it. Applies only while the chart's color is its default. Defaults totrue.clusterConfigclusterconfigDefault{}Network and ArcDiagram: names and styles the clusters (see
cluster).labelnames each cluster: it receives the row of the cluster's most-connected node, the cluster's index (0 is the largest), and every member's row.maxis the most clusters to keep (default12): while there are more, the smallest joins the cluster it shares the most link weight with, or the largest when it has none.labelConfigstyles the names a Network draws inside its clusters, orfalsedraws none.colorstring|false|functionDefines the main color to be used for each data point in a visualization. Can be either an accessor function or a string key to reference in each data point. If a color value is returned, it will be used as is. If a string is returned, a unique color will be assigned based on the string.
When the color is a category that isn't one of the
groupBylevels (for example, points grouped by"country"and colored by"region"), the legend shows one entry per category, labelled by the category. Clicking, shift+clicking, or hovering an entry hides, solos, or highlights every item in that category.colorDefaultscolordefaultsconfigOverrides the default colors used when assigning fills from data and choosing legible text colors:
darkandlight(the text colors picked for contrast against a background),missing(null/undefined values),on/off(true/falsevalues),sequential(the anchor hue for magnitude ramps), andscale(the categorical palette, given as a d3 ordinal scale or an array of colors). Keys are merged into the current defaults, and a Viz passes its overrides down to the shapes and components it draws.colorOrdinalbooleanDefaultfalseTreat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues.
colorScalestring|[colorscalefield, colorscalefield]|false|functionDefines the value to be used for a color scale. Can be either an accessor function or a string key to reference in each data point. Two of them (
["a", "b"]) make a bivariate scale: each variable is split into quantile bins, the pair of bins picks a color from a grid, and the key is that grid turned into a diamond (seecolorScaleConfig.bivariateBuckets,bivariateColors, andbivariateLabels). A row missing either value gets no colorScale color.colorScaleConfigobjectA pass-through to the config method of ColorScale.
colorScaleMaxSizenumberDefault600The maximum pixel size for drawing the color scale: width for horizontal scales and height for vertical scales.
colorScalePaddingboolean|functionTells the colorScale whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the colorScale appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
colorScalePositionfalse|panelposition|functionDefines which side of the visualization to anchor the color scale. Acceptable values are
"auto"(the default),"top","bottom","left","right", andfalse."auto"lets the chart choose: inside the chart when it fits there (seelegendInset), otherwise the right side of charts more than 1.5 times as wide as they are tall and the bottom of all others. Any other side keeps the color scale there. Afalsevalue will cause the color scale to not be displayed, but will still color shapes based on the scale.configd3plusconfigMethods that correspond to the key/value pairs and returns this class.
datastring|array.<datapoint>|objectThe primary data array used to draw the visualization. The value passed should be an Array of objects or a String representing a filepath or URL to be loaded. The following filetypes are supported:
csv,tsv,txt, andjson.If your data URL needs specific headers to be set, an Object with a "url" and "headers" (or any other
fetchrequest option) may also be passed. An Object with any other key is a data row, not a request.To transform the data before it is drawn (for example, a JSON API that returns its headers split from its values), set
dataFormat. Passing a formatter as a second argument to this method setsdataFormat; calling it with only data keeps the currentdataFormat.To re-fetch a URL on an interval and redraw when its data changes, set
dataPollingInterval; each poll runsdataFormat.Defaults to an empty array (
[]).dataCutoffnumberDefault100Maximum number of data points to render before downsampling.
dataFormatfunctionTransforms
databefore it is drawn: receives the loaded file (or the Array passed asdata) and returns the rows to draw, or a config object holding them asdata(its other keys are applied to the chart). Also set bydata(url, format).dataPollingIntervalnumber|falseDefaultfalseWhen
datacomes from a URL, re-fetches it every this many milliseconds and redraws when it changes, keeping hover, zoom, and legend state. Polling pauses while the tab (or, withdetectVisible, the chart) is hidden, and a failed request keeps the last data. Onlydatais polled. Defaults tofalse(load once).depthnumberActive depth level for nested groupings.
detectResizebooleanDefaulttrueIf the width and/or height of a Viz is not user-defined, it is determined by the size of it's parent element. When this method is set to
true, the Viz will listen for thewindow.onresizeevent and adjust it's dimensions accordingly.detectResizeDelaynumberDefault400When resizing the browser window, this is the millisecond delay to trigger the resize event.
detectVisiblebooleanDefaulttrueToggles whether or not the Viz should try to detect if it visible in the current viewport. When this method is set to
true, the Viz will only be rendered when it has entered the viewport either through scrolling or if it's display or visibility is changed.detectVisibleIntervalnumberDefault1000The interval, in milliseconds, for checking if the visualization is visible on the page. When
detectVisibledefers a render until the visualization scrolls into view, this is also how long it must stay in view before it renders, so visualizations scrolled past quickly are never drawn.detectVisibleUnloadbooleanDefaulttrueWith
detectVisibleon, releases the chart's DOM and scene while it is scrolled out of view and redraws it when it returns, keeping pages with many charts light. Data and config are kept; zoom and selection are not, so setfalseto keep them. Defaults totrue.discrete"x"|"y"|"radius"|"angle"Sets orientation of main category axis.
durationnumberDefault600Default duration of transitions, in milliseconds.
facetstring|false|functionSplits the chart into small multiples: a grid of equally sized panels, one per distinct value of this data key or accessor, each drawing the chart for that value's rows. The panels share one legend, color scale, title, and timeline, color each series the same way, and hover, tooltips, and legend clicks apply across all of them. Pass
falseto draw a single chart. SeefacetConfigfor the grid's layout and shared scales.facetConfigfacetconfigConfiguration for small multiples (see
facet), merged into the current config: -columns/rows: the grid's shape. Chosen by default to make the panels as large as the chart's shape allows. -padding: the space between panels, in pixels (default20). -sort: panel order —"ascending"(default),"descending","data"(first appearance), a comparator over facet values, or an Array of values. -scales:"shared"(default) gives every panel of a chart with axes the same x/y domains;"independent"fits each panel to its own rows. Funnel defaults to"independent"(each panel sized to its own widest stage);"shared"sizes every panel against the widest stage across all panels. PolarArea and RadialBar default to"independent"(each panel's rings and ticks fit its own values);"shared"gives every panel the same value domain. -axes: with shared scales,"outer"(default) labels the axes only along the grid's left and bottom edges;"all"labels every panel. An object sets each axis on its own, as in{x: "all", y: "outer"}: every panel labels its x axis, only the left column labels its y axis, and the panels' plot areas line up. BumpChart defaults to"all", and Marimekko labels its categories on every panel and its 0–100% share axis only along the outer edge, even with independent scales. -title: a(value, data) => stringfunction for each panel's title, orfalseto hide panel titles. -titleConfig: TextBox config for the panel titles (fontSize,fontWeight,fontColor,textAnchor,padding, …).filterfalse|functionPredicate filtering which data points are included, or false to disable.
fontFamilystring|array.<string>The font family used throughout the visualization.
groupBystring|function|array.<string|function>Defines the mapping between data and shape. The value can be a String matching a key in each data point (default is "id"), or an accessor Function that returns a unique value for each data point. Additionally, an Array of these values may be provided if the visualization supports nested hierarchies.
heightnumberOverall height of the visualization in pixels.
Defines the color used for legend shapes when the corresponding grouping is hidden from display (by clicking on the legend).
Defines the opacity used for legend labels when the corresponding grouping is hidden from display (by clicking on the legend).
highlightfalse|functionPersistently emphasizes the data points matching the given predicate: the matching marks keep their color while every other mark is de-emphasized to a neutral gray (the "emphasis" form — highlight one series, gray the rest). Unlike
hover/active(transient, opacity-based),highlightis a standing state that survives pointer movement. Passfalseto clear it.hoverfalse|functionThe hover callback function for highlighting shapes on mouseover.
hoverDistancenumberDefault20How close (px) the pointer must come to a point mark (scatter and bubble points, Network nodes, Geomap points, Radar dots) to hover it, so small points are easy to reach. Defaults to
20;0turns it off.Lets keyboard users move between the chart's marks: the chart is one Tab stop, the arrow keys move to the nearest mark in that direction, Home and End jump to the ends, Enter or Space click the focused mark, and Escape clears it. Defaults to
true;falseremoves the Tab stop.Styles the focus ring around the mark keyboard navigation has focused (see
KeyboardNavConfig).labelstring|false|accessorfn|array.<string>Accessor function, or a constant string applied to every data point's label (unlike
value/nodeId/etc., a string here is not treated as a per-datum object key — pass a function for that).labelPosition"auto"|"along"|"inside"|"outside"|functionWhere each shape's label goes:
"auto","along","inside", or"outside", or a(d, i) => stringaccessor."auto"picks whichever fits best per shape, and a label with no room is left out.- Rings (Pie, Donut, Sunburst, Chord, RadialBar) and polar charts (Radar, PolarArea, RadialMatrix):
"along"curves the name along its arc."inside"keeps it straight; on a Pie or Donut,"outside"moves it beside the ring with a leader line. - Bars: inside or outside the bar."auto"goes outside when the bar is short. Stacked bars always label inside. - Circles (Plot points, Network nodes, Geomap points): inside the circle, or beside it when it doesn't fit ("outside"always beside). - Stacked areas:"auto"and"along"run each name along its band;"inside"puts it in the band's largest box.When every stacked area or RadialBar track is named along its shape, the default legend hides. Defaults to
"auto".legendboolean|functionWhether to display the legend. By default it shows when it has more than one entry and each entry stands for a single group, or when entries are colored by a category that isn't a
groupBylevel. It hides when the chart's own labels already name every entry (seelabelPosition), or when every Circle, Rect, and Bar of a Plot shows its whole label as its legend entry would, and stays while a series is hidden or soloed.falsehides it,truealways shows it, and a(config, data) => booleanfunction decides.legendConfigobjectConfiguration object passed to the legend's config method.
legendFilterInvertboolean|functionDefines the click functionality of categorical legend squares. When set to false, clicking will hide that category and shift+clicking will solo that category. When set to true, clicking will solo that category and shift+clicking will hide that category. The Back button undoes each click (see
legendHistory).legendHistorybooleanDefaulttrueWhether legend clicks go on the chart's Back history, so Back undoes them along with drill-downs, in order. Defaults to
true;falseleaves them off, so Back only steps out of drill-downs.legendInsetboolean|functionDefaulttrueWhether the chart may draw a legend, size legend, or colorScale inside empty space around its marks (over a translucent box, see
legendInsetConfig) instead of in a margin. Only a legend whose position is"auto"can move inside. Defaults totrue; also accepts a function of the resolved config.legendInsetConfigobjectStyle of the box drawn behind a legend placed inside the chart (see
legendInset):fill(defaults to the chart's background color),fillOpacity(0.85),stroke(defaults to a faint contrasting line),strokeWidth(1),rx(corner radius, 4),margin(space between the box's edge and the legend, 6), andpadding(space kept between the box and the chart's marks and edges, 10).legendPaddingboolean|functionTells the legend whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the legend appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
legendPositionfalse|panelposition|functionDefines which side of the visualization to anchor the legend. Expected values are
"auto"(the default),"top","bottom","left","right", andfalseto hide it."auto"lets the chart choose: inside the chart when it fits there (seelegendInset), otherwise the right side of charts more than 1.5 times as wide as they are tall and the bottom of all others. Any other side keeps the legend there.legendSortfunctionComparator that orders the legend's entries. By default the legend reads in the order the chart draws: Treemap, Pack, Pie, Donut, Icicle, and Sunburst list their largest entries first; a stacked chart lists its series in stacking order, from the baseline outward (so the default
stackOrder,"descending", lists the largest first); Waffle and Waterfall follow their own order, and Network and ArcDiagram clusters come largest first; every other chart is alphabetical by label. A threshold group always comes last, whatever the sort.legendTooltiptooltipconfigConfiguration object for the legend tooltip.
linklinkoptionLinks this chart to every other chart with the same group name, so hovering,
active,highlight(including search), and legend hide/solo clicks in one are mirrored in the rest, and a value gets the same categorical color in every chart. Rows match across charts by the value ofby(a data key or accessor), which defaults to the chart's own id. A string is shorthand for{group}; sethover,active,highlight,legend, orcolortofalseto stop sharing that behavior.linkBundlebooleanDefaultfalseBundles the links: links running the same way near each other are drawn pulled together, so the main flows read through the clutter. Defaults to
false.linkBundleConfiglinkbundleconfigDefault{strength: 0.85, cycles: 6, iterations: 50, compatibility: 0.4, smoothing: true}Tunes
linkBundle:strength(0.85),cycles(6),iterations(50),compatibility(0.4), andsmoothing(true).linkColorfalse|"source"|"target"|string|functionDefaultfalseColors each link:
"source"or"target"takes that end node's color, and a key or accessor function reads a value from each link (receiving the link and its index inlinks). A number is colored on the chart's colorScale, which then shows the links' values; a string is a color when it parses as one, or else a category in the chart's palette.false(the default) draws every link in the theme's link gray.linkLabelstring|functionText drawn at the middle of each link: a key or accessor function (receiving the link and its index in
links). Numbers are abbreviated in the chart's locale. Labels that would cover a node or another label are hidden. Defaults to none.linkLabelConfiglinklabelconfigStyles the link labels:
rotate,"along"(the default) to run text along its link, kept upright, or"horizontal";fontSize(10);padding, the pad around the text (2);backgroundOpacity, the opacity of that pad in the chart's background color (0.85);minRadius, the tightest bend a curved label follows, as a radius in ems (2); and any other TextBox setting, such asfontColor,fontFamily, orfontWeight.linkSizenumber|functionDefault1The thickness of each link: a pixel number used for every link, or an accessor function whose values are scaled between
linkSizeMinandlinkSizeMax(seelinkSizeScale). The function receives each link, withsourceandtargetset to the data of the nodes at its ends, and its index inlinks.linkSizeMaxnumberNetwork, Rings, and Geomap: the widest link, in pixels, when
linkSizevalues differ. Network and Rings default to half the smallest node's radius (never thinner thanlinkSizeMin); Geomap defaults to10. AlinkSizeMinwider than a setlinkSizeMaxis held to it.linkSizeMinnumberDefault1The thinnest link, in pixels, when
linkSizevalues differ.linkSizeScalestringDefaultsqrtThe type of continuous d3-scale used to size links (e.g.
"linear","sqrt","log").linksobject[]|stringDefault[]The edges that connect the
nodes. Thesourceandtargetof each link refer to a node in one of three ways: its index in thenodesarray, the node object itself (matched by itsid), or a string matching the node'sid. A link whosesourceandtargetare the same node draws as a loop beside it.Accepts an array of links, or a URL/filepath string to load them from.
linksFormattransforms them; a function passed as a second argument sets it.linksFormatfunctionNetwork, Rings, Sankey, Chord, ArcDiagram, and Geomap: transforms
linksbefore they are drawn. The function receives the loaded file (or the Array passed aslinks) and returns the links Array. It runs when the chart renders, whichever orderlinksandlinksFormatare set in, and setting it again re-runs it on the next render. Passing a formatter as the second argument oflinks(url, format)sets it, and settinglinksalone keeps it.loadingHTMLstring|functionThe inner HTML of the status message displayed when loading AJAX requests and displaying errors. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.
loadingMessagebooleanDefaulttrueToggles the visibility of the status message that is displayed when loading AJAX requests and displaying errors.
localestring|objectThe locale used for all text and number formatting. Supports the locales defined in d3plus-format. The locale can be a complex Object, a locale code (like "en-US"), or a 2-digit language code (like "en"). If a 2-digit code is provided, the "findLocale" function is used to identify the most approximate locale.
messageMaskstring|booleanDefaultrgba(0, 0, 0, 0.05)The color of the mask displayed underneath the status message when loading AJAX requests and displaying errors. Set to
falseto turn off the mask completely.messageStylerecordDefines the CSS style properties for the status message that is displayed when loading AJAX requests and displaying errors.
minimapbooleanDefaulttrueShows a small overview + draggable-viewport minimap in the chart's top-right corner (beneath the zoom controls, when they show) once the chart is zoomed in. On by default whenever
zoomis enabled.minimapClassNamestringAn additional CSS class name (or space-separated list of class names) applied to the minimap's outer box, viewport box, and zoom-level label, alongside their fixed
d3plus-minimap/d3plus-minimap-viewport/d3plus-minimap-labelclasses. Setting this automatically disables d3plus's built-in inlineminimapStyle/minimapViewportStyle/minimapViewportStyleActive/minimapLabelStyledefaults (as long as you haven't already customized them yourself), so a host page's own styling applies through the cascade with no other configuration needed.minimapLabelStylerecord|falseAn object containing CSS key/value pairs that is used to style the minimap's zoom-level text label (e.g. "2x"). Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.minimapClassName(...)is set, unless you've explicitly customized this yourself.minimapStylerecord|falseAn object containing CSS key/value pairs that is used to style the minimap's outer box (the full-scene overview). Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.minimapClassName(...)is set, unless you've explicitly customized this yourself.minimapViewportStylerecord|falseAn object containing CSS key/value pairs that is used to style the minimap's draggable viewport box in its resting state. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.minimapClassName(...)is set, unless you've explicitly customized this yourself.minimapViewportStyleActiverecord|falseAn object containing CSS key/value pairs that is used to style the minimap's draggable viewport box while it's being dragged. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.minimapClassName(...)is set, unless you've explicitly customized this yourself.noDataHTMLstring|functionThe inner HTML of the status message displayed when no data is supplied to the visualization. Must be a valid HTML string or a function that, when passed this Viz instance, returns a valid HTML string.
noDataMessagebooleanDefaultfalseToggles the visibility of the status message that is displayed when no data is supplied to the visualization.
nodeGroupBystring|function|(string|function)[]Default[null]The key(s) or accessor(s) that identify each object passed to
nodes, one pergroupBydepth, used in place ofgroupByfor nodes that the data doesn't cover. Defaults to each node'sid.nodeTooltipLinksnumber|falseHow many links a node's tooltip lists under its number of connections, strongest first: a number, or
falsefor none. Defaults to 3 when the links differ inlinkSize, and none otherwise.nodeTooltipStatsboolean|string[]DefaulttrueThe network measures a node's tooltip lists:
truefor all of them,falsefor none, or an Array of"degree","betweenness","closeness", and"cluster", in the order to list them.nodeTooltipStatsConfig{weighted?: boolean}Default{}Settings for the network measures:
weightedcounts a strong link (bylinkSize, or Sankey'svalue) as a shorter step than a weak one for betweenness and closeness. Defaults to{weighted: false}, every link one step.nodesobject[]|stringDefault[]The nodes to draw. When empty, every data row is a node, linked or not, and so is every link end no data row stands for. Accepts an array of node objects, or a URL/filepath string to load them from.
nodesFormattransforms them; a function passed as a second argument sets it.nodesFormatfunctionNetwork, Rings, Sankey, Chord, and ArcDiagram: transforms
nodesbefore they are drawn. The function receives the loaded file (or the Array passed asnodes) and returns the nodes Array. It runs when the chart renders, whichever ordernodesandnodesFormatare set in, and setting it again re-runs it on the next render. Passing a formatter as the second argument ofnodes(url, format)sets it, and settingnodesalone keeps it.onstringEvent listener for the specified event typenames. Mirrors the core d3-selection behavior.
parentunknownParent config used by the wrapper.
pointLabelConfigpointlabelconfigFits and styles circle labels (see
labelPosition):fontMinis the smallest font size a label may shrink to inside its circle before"auto"moves it beside the circle (default10, the size of the chart's smallest text, its total);fontSizeis the size of a label beside its circle (default11);paddingis the space between the circle's edge and that label (default3). The other TextBox keys (fontColor,fontFamily,fontWeight,fontOpacity, …) style the labels beside their circles, which default to the chart's text color. Merged into the current config.reducedMotion"auto"|booleanDefaultautoWhether the chart animates.
"auto"(default) follows the viewer's OS setting, read from the(prefers-reduced-motion: reduce)media query at each draw (server-side rendering counts as not reduced).truealways draws without motion: shapes, axes, legends, zooms, and fades jump straight to their final state.falsealways animates.durationkeeps the value you set either way.renderfunctionDraws the visualization given the specified configuration. An error thrown while the chart draws (by an accessor in its config, say) is logged with
console.error, and the chart keeps what it last painted.rendererboolean|"svg"|"canvas"Selects which @d3plus/render backend paints the visible output.
"svg"= SvgRenderer (default),"canvas"= CanvasRenderer. Boolean arguments both normalize to"svg".saveControlbooleanDefaulttrueShows a top-left download button that saves the chart, as the reader sees it, as a PNG, SVG, or JPG file. On by default for every chart.
saveControlClassNamestringAn additional CSS class name (or space-separated list of class names) applied to the download button, alongside the fixed
save-control/save-toggleclasses. Setting this automatically disables d3plus's built-in inlinesaveControlStyle/saveControlStyleActive/saveControlStyleHoverdefaults (as long as you haven't already customized them yourself), so a host page's own button styling applies through the cascade with no other configuration needed.saveControlConfigsavecontrolconfigOptions for the download button: the saved file's
filename, theformatsit offers, thebackgroundpainted behind the chart, acallback, and html-to-image options for PNG and JPG files.saveControlMenuClassNamestringAn additional CSS class name (or space-separated list of class names) applied to the download menu, alongside its fixed
d3plus-save-menuclass (each item has the fixedsave-menu-itemclass). Setting this automatically disables d3plus's built-in inlinesaveControlMenuStyle/saveControlMenuItemStyle/saveControlMenuItemStyleHoverdefaults (as long as you haven't already customized them yourself), so a host page's own menu styling applies through the cascade. The menu's position and open/closed display stay inline.saveControlMenuItemStylerecord|falseAn object containing CSS key/value pairs that is used to style each item in the download menu. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.saveControlMenuClassName(...)is set, unless you've explicitly customized this yourself.saveControlMenuItemStyleHoverrecord|falseAn object containing CSS key/value pairs that is used to style the download menu item under the pointer or keyboard focus. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.saveControlMenuClassName(...)is set, unless you've explicitly customized this yourself.saveControlMenuStylerecord|falseAn object containing CSS key/value pairs that is used to style the download menu: its background, border, shadow, and spacing. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.saveControlMenuClassName(...)is set, unless you've explicitly customized this yourself.saveControlStylerecord|falseAn object containing CSS key/value pairs that is used to style the download button. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.saveControlClassName(...)is set, unless you've explicitly customized this yourself.saveControlStyleActiverecord|falseAn object containing CSS key/value pairs that is used to style the download button while its menu is open. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.saveControlClassName(...)is set, unless you've explicitly customized this yourself.saveControlStyleHoverrecord|falseDefaultfalseAn object containing CSS key/value pairs that is used to style the download button on hover. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.saveControlClassName(...)is set, unless you've explicitly customized this yourself.scrollContainerstring|htmlelement|windowIf using scroll or visibility detection, this method allow a custom override of the element to which the scroll detection function gets attached.
searchbooleanDefaulttrueShows a top-left search button that expands into an input; typing highlights shapes whose label matches. On by default for every chart.
searchAccessorfunctionResolves the string the search box matches its typed term against, for a given datum. Defaults to the mark's resolved on-screen label (
viz._drawLabel) — the same text the user reads on the chart. Override it to match against something else instead, e.g. a data field that isn't shown as the label.This is checked alongside, not instead of, every level of the datum's own groupBy hierarchy — searching a leaf's label also matches its ancestor group's cell/legend entry, and vice versa, regardless of this accessor's override.
searchControlClassNamestringAn additional CSS class name (or space-separated list of class names) applied to the search toggle button and input, alongside their fixed
search-controlclasses. Setting this automatically disables d3plus's built-in inlinesearchControlStyle/searchControlStyleActive/searchControlStyleHoverdefaults (as long as you haven't already customized them yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.searchControlStylerecord|falseAn object containing CSS key/value pairs that is used to style the search toggle button. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.searchControlClassName(...)is set, unless you've explicitly customized this yourself.searchControlStyleActiverecord|falseAn object containing CSS key/value pairs that is used to style the search toggle button while open. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.searchControlClassName(...)is set, unless you've explicitly customized this yourself.searchControlStyleHoverrecord|falseDefaultfalseAn object containing CSS key/value pairs that is used to style the search toggle button on hover. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.searchControlClassName(...)is set, unless you've explicitly customized this yourself.selectstring|htmlelementThe SVG container element as a d3 selector or DOM element. Defaults to
undefined.shapestring|functionDefault"Circle"Changes the primary shape used to represent each data point in a visualization. Not all visualizations support changing shapes, this method can be provided the String name of a D3plus shape class (for example, "Rect" or "Circle"), or an accessor Function that returns the String class name to be used for each individual data point.
shapeConfigd3plusconfigConfiguration object with key/value pairs applied as method calls on each shape.
sizestring|functionSizes each node: a data key or an accessor function whose values are scaled between
sizeMinandsizeMax(seesizeScale). When unset, every node is drawn at the same size.sizeLegendboolean|functionWhether to display the size legend: a nested-circle key, in the chart's bottom-right corner, for charts that size their marks with a
sizeaccessor (bubble plots, Geomap points viapointSize, Network, Rings). By default it shows whenever marks are sized by more than one value, unless it would take up more than a third of the chart's width or height. Passtrueto always show it,falseto hide it, or a function that receives the resolved chart config, the radius scale, and the legend's measured{width, height, availableWidth, availableHeight}, and returns a boolean.sizeLegendConfigsizelegendconfigConfiguration object passed to the size legend's config method:
values(an array of values to draw, or how many to pick),tickFormat,title(defaults to thesizekey whensizeis set to a string),shapeConfig,lineConfig,labelConfig,titleConfig,padding,lineLength, andlabelPadding.sizeLegendPosition"right"|"bottom"DefaultrightWhich margin the size legend claims in the chart's bottom-right corner.
"right"(the default) widens the right margin, so the chart keeps its full height and the legend sits at the bottom of the right column, below any right-side legend or colorScale."bottom"deepens the bottom margin instead, so the chart keeps its full width and any bottom legend or colorScale narrows to sit beside it.sizeMaxnumberThe maximum pixel radius used when sizing nodes. Defaults to half the distance between the two closest nodes.
sizeMinnumberDefault5The minimum pixel radius used when sizing nodes.
sizeScalestringDefaultsqrtThe type of continuous d3-scale used to size nodes (e.g.
"linear","sqrt","log").subtitlestring|functionAccessor function or string for the visualization's subtitle.
subtitleConfigrecordConfiguration object for the subtitle.
subtitlePaddingboolean|functionTells the subtitle whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the subtitle appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
svgDescstringAccessible description applied to the root SVG (
<desc>).svgTitlestringAccessible title applied to the root SVG (
<title>).tableViewbooleanDefaulttrueEnables the top-left table-view toggle button, which swaps the chart for a static, scrollable
<table>of its data. On by default for every chart.tableViewClassNamestringAn additional CSS class name (or space-separated list of class names) applied to the
<table>element the table-view toggle renders, alongside the fixedd3plus-table-view-tableclass. Lets a host page style the data table with its own table styling (Tailwind, Bootstrap, a design system) via descendant selectors.tableViewControlClassNamestringAn additional CSS class name (or space-separated list of class names) applied to the table-view toggle button, alongside the fixed
table-view-control/table-view-toggleclasses. Setting this automatically disables d3plus's built-in inlinetableViewControlStyle/tableViewControlStyleActive/tableViewControlStyleHoverdefaults (as long as you haven't already customized them yourself), so a host page's own button styling applies through the cascade with no other configuration needed.tableViewControlStylerecord|falseAn object containing CSS key/value pairs that is used to style the table-view toggle button. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.tableViewControlClassName(...)is set, unless you've explicitly customized this yourself.tableViewControlStyleActiverecord|falseAn object containing CSS key/value pairs that is used to style the table-view toggle button while it is active (showing the data table). Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.tableViewControlClassName(...)is set, unless you've explicitly customized this yourself.tableViewControlStyleHoverrecord|falseDefaultfalseAn object containing CSS key/value pairs that is used to style the table-view toggle button on hover. Passing
falsewill remove all default styling. Automatically skipped (as iffalse) once.tableViewControlClassName(...)is set, unless you've explicitly customized this yourself.tableViewDownloadbooleanDefaulttrueWhether the data table shows a "download CSV" button, exporting its full (sorted, unpaginated) rows. On by default.
tableViewPageSizenumber|falseDefault50The number of data-table rows shown per page while in table view. Set to
false(or any non-positive number) to disable pagination and show every row on one page.tableViewSortbooleanDefaulttrueWhether the data table's column headers are clickable to sort (toggling asc/desc). On by default.
themethemesettingDefaultautoThe chart's colors.
"auto"(the default) paints no background and follows the page, light or dark."light"and"dark"paint the theme's background and take every chrome color from it. An object overrides tokens on top of itsbasepreset, e.g.{base: "dark", background: "#123", accent: "#ffd43b"}. Colors set elsewhere in the config win over the theme.thresholdnumber|functionThe threshold value for bucketing small data points together, as a share of the total. On a stacked Plot, the series whose summed value across every position is under that share of the whole chart's total merge into one series, stacked on top. A bucket needs at least two items, and its tooltips list them. Off (
0) by default on Plot charts.thresholdKeystring|functionAccessor for the value used in the threshold algorithm. A stacked Plot defaults to its stacked value.
thresholdNamestring|functionLabel for the threshold group, or a
(datum, index)accessor.timestring|false|functionAccessor function or string key for the time dimension of each data point.
timeFilterfalse|functionPredicate filtering which time slices are shown, or false to disable. With
timeset and notimeFilter, a chart starts on its latest period, or ontimelineDefault/timelineConfig.selection; setting it starts the chart (and its timeline) on the periods it keeps. A viewer's pick on the timeline replaces it.timelinebooleanDefaulttrueWhether to show the timeline component.
timelineConfigtimelineconfigConfiguration object for the timeline.
timelineDefaultstring|date|array.<string|date>The starting time or range for the timeline, which the chart starts on too. Can be a single Date/String, or an Array of 2 values representing the min and max. A viewer's pick on the timeline replaces it.
timelinePaddingboolean|functionTells the timeline whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the timeline appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
titlestring|functionAccessor function or string for the visualization's title.
titleConfigrecordCSS style configuration for the title.
titlePaddingboolean|functionTells the title whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the title appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
tooltipboolean|functionWhether to show tooltips, or a
(datum, index, {depth, maxDepth, legend})accessor deciding per mark and legend entry.depthis thegroupBylevel (from 0) the hovered item stands for andmaxDepththe deepest level, sodepth === maxDepthkeeps tooltips to the deepest level;legendis true for a legend entry. Defaults totrue.tooltipConfigtooltipconfigDefaultlinkTooltipConfig(viz)Configuration for the tooltip component.
totalstring|boolean|functionAccessor function or string key for the total value displayed in the visualization.
totalConfigrecordConfiguration object for the total bar.
totalFormatfunctionFormatter function for the value in the total bar.
totalPaddingboolean|functionTells the total whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the total appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
translatefunctionDefines how informational text strings should be displayed. By default, this function will try to find the string in question (which is the first argument provided to this function) inside of an internally managed translation Object. If you'd like to override to use custom text, simply pass this method your own custom formatting function.
widthnumberOverall width of the visualization in pixels.
xstring|functionDefaultfunctionThe x position of each node: a key in the data or
nodes, or an accessor function. Defaults to"x". When any node has no x/y position, every node is placed by a force simulation instead.ystring|functionDefaultfunctionThe y position of each node: a key in the data or
nodes, or an accessor function. Defaults to"y". When any node has no x/y position, every node is placed by a force simulation instead.zoombooleanDefaulttrueEnables pan and zoom: the mouse wheel or a pinch (see
zoomScroll), a drag (seezoomDrag), a double-click (seezoomDoubleClick), the zoom-control buttons (seezoomControls), and thezoomIn,zoomOut,zoomReset, andzoomBrushmethods. On by default for every chart;falseturns all of them off.zoomBrushbooleanTurns brush mode on or off, as the brush button does: while it is on, a drag anywhere on the chart draws a box, and releasing zooms into the box and turns brush mode off again. With no argument, returns whether brush mode is on. Does nothing while
zoomis off or before the chart first renders.zoomBrushHandleSizenumberDefault1The pixel stroke-width of the zoom brush area.
zoomBrushHandleStylerecord|falseAn object containing CSS key/value pairs that is used to style the outer handle area of the zoom brush. Passing
falsewill remove all default styling.zoomBrushSelectionStylerecord|falseAn object containing CSS key/value pairs that is used to style the inner selection area of the zoom brush. Passing
falsewill remove all default styling.zoomControlClassNamestringAn additional CSS class name (or space-separated list of class names) applied to each zoom control button, alongside the fixed
zoom-control/zoom-in/zoom-out/zoom-reset/zoom-brushclasses. Setting this automatically disables d3plus's built-in inlinezoomControlStyle/zoomControlStyleActive/zoomControlStyleHoverdefaults (as long as you haven't already customized them yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.zoomControlIconspartialOverrides the zoom-control icons (
zoomIn,zoomOut,zoomReset,zoomBrush). Each value is an HTML string, or a mount function(el) => void | (() => void)called with the button's 12×12px icon slot (for a React tree, an<img>, …); a returned cleanup runs when the buttons redraw.zoomControlStylerecord|falseAn object containing CSS key/value pairs that is used to style each zoom control button (
.zoom-in,.zoom-out,.zoom-reset, and.zoom-brush). Passingfalsewill remove all default styling. Automatically skipped (as iffalse) once.zoomControlClassName(...)is set, unless you've explicitly customized this yourself.zoomControlStyleActiverecord|falseAn object containing CSS key/value pairs that is used to style each zoom control button when active (
.zoom-in,.zoom-out,.zoom-reset, and.zoom-brush). Passingfalsewill remove all default styling. Automatically skipped (as iffalse) once.zoomControlClassName(...)is set, unless you've explicitly customized this yourself.zoomControlStyleHoverrecord|falseDefaultfalseAn object containing CSS key/value pairs that is used to style each zoom control button on hover (
.zoom-in,.zoom-out,.zoom-reset, and.zoom-brush). Passingfalsewill remove all default styling. Automatically skipped (as iffalse) once.zoomControlClassName(...)is set, unless you've explicitly customized this yourself.zoomControlsbooleanDefaulttrueWhether the zoom-control buttons (zoom in, zoom out, reset, and brush) show in the chart's top-right corner.
falsehides them and gives the room they take back to the chart's title, legend, and other top content, while zooming stays on: the wheel, pinch, drag, and double-click gestures still work, and the chart'szoomIn,zoomOut,zoomReset, andzoomBrushmethods let buttons of your own drive it. Defaults totrue.zoomDoubleClick"in"|"reset"|falseDefaultinWhat a double-click on the chart does:
"in"(the default) doubles the zoom around the pointer (Shift + double-click halves it),"reset"returns to the chart's initial view, like the reset button, andfalsedoes nothing.zoomDrag"pan"|"brush"DefaultpanWhat a mouse drag on the chart does.
"pan"(the default) pans it (seezoomPan)."brush"draws a box and zooms into it on release, as the brush button does, without turning brush mode on: a click that doesn't drag still reaches the shape under it, and hovering still shows tooltips. Shift + drag pans in"brush"mode, and touch keeps panning and pinching as in"pan".zoomFactornumberDefault2Multiplier applied to programmatic zoom steps.
zoomMaxnumberMaximum zoom scale factor. Defaults to the scale at which the smallest shape fills the chart area.
zoomPaddingnumberDefault20A pixel value to be used to pad all sides of a zoomed area. A Plot's brushed box fills its plot without it, so its axes show the brushed range.
zoomPanbooleanDefaulttrueWhether panning (drag) is enabled while zoomed.
zoomScrollboolean|"modifier"DefaultmodifierWhether the mouse wheel (and one-finger touch) zooms.
"modifier"(the default) leaves page scrolling alone: only Ctrl/⌘ + wheel or a trackpad/two-finger pinch zooms, and one finger pans only once zoomed in.truezooms on any wheel;falsenever does.