Dashboard
Places several different charts together as one dashboard: one title and subtitle above them, one legend for all of them, one download button that saves them all as one image, and a grid that sizes each chart. Where facet repeats one chart for each value of a key, a Dashboard combines charts of any kind.
Basic example
Section titled “Basic example”List the charts: each is a chart instance (new d3plus.BarChart().data(…)), or an object naming a chart class with the config to give it. Every chart keeps its own axes, tooltips, zoom, and keyboard navigation, and draws its own data. The charts are linked: hovering a country in one highlights it in the other, and a value takes the same color in both. The dashboard draws one legend, the treemap’s, in place of theirs; clicking an entry hides it in every chart.
Title of the axis.
Links 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 of by (a data key or accessor), which defaults to the chart's own id. A string is shorthand for {group}; set hover, active, highlight, legend, or color to false to stop sharing that behavior. Plots also share their zoom: zooming or panning one shows the same window of dates or values on the others (set zoom: false to keep a chart's zoom its own, or zoom: "overview" to make it the group's overview, which keeps its whole view and shows the others' window as a band you drag, with rangeSelector buttons at its top-right). Plots that share zoom and sit one above another on the page also line up their plots, the widest margins winning, so a date sits at the same x in each (align: false opts a chart out).
Placing charts
Section titled “Placing charts”layoutConfig sets the grid: columns and rows are a count, or each track’s size relative to the others ([2, 1] makes the first column twice as wide), and padding the space between charts (4 pixels by default). Charts fill the grid left to right, top to bottom; columnSpan and rowSpan stretch one over several cells, and column and row (from 0) pin it to one. Without columns, the dashboard picks the column count that draws its charts largest.
// Revenue for six countries in three regions, 2019–2024.
const countries = {
Brazil: "Americas",
Mexico: "Americas",
France: "Europe",
Germany: "Europe",
India: "Asia",
Japan: "Asia",
};
const data = Object.entries(countries).flatMap(([country, region], c) =>
[2019, 2020, 2021, 2022, 2023, 2024].map((year, y) => ({
country,
region,
year,
revenue: 20 + c * 6 + y * (c + 2),
})),
);
const latest = data.filter(d => d.year === 2024);
const config = {
title: "Revenue overview",
layoutConfig: {columns: [2, 1], rows: [1, 1], padding: 24},
charts: [
{
chart: "Treemap",
config: {
data: latest,
groupBy: ["region", "country"],
sum: "revenue",
title: "Share, 2024",
},
rowSpan: 2,
},
{
chart: "Donut",
config: {
data: latest,
groupBy: "region",
value: "revenue",
title: "By region",
},
},
{
chart: "BarChart",
config: {
data: latest,
groupBy: "country",
color: "region",
x: "country",
y: "revenue",
title: "By country",
},
},
],
};
An uneven layout
Section titled “An uneven layout”Spans and relative track sizes together make an uneven grid: here a wide area chart spans both columns of a row twice as tall as the one below it, which holds a donut and a bar chart side by side.
// Monthly visits by channel.
const channels = ["Search", "Social", "Email", "Direct"];
const months = [
"2025-01",
"2025-02",
"2025-03",
"2025-04",
"2025-05",
"2025-06",
];
const data = channels.flatMap((channel, c) =>
months.map((month, m) => ({
channel,
month,
visits: 1200 + c * 400 + m * (80 + c * 30),
})),
);
const june = data.filter(d => d.month === "2025-06");
const config = {
title: "Visits",
layoutConfig: {columns: [1, 1], rows: [2, 1]},
charts: [
{
chart: "StackedArea",
config: {data, groupBy: "channel", x: "month", y: "visits"},
columnSpan: 2,
},
{
chart: "Donut",
config: {data: june, groupBy: "channel", value: "visits"},
},
{
chart: "BarChart",
config: {
data: june,
groupBy: "channel",
x: "visits",
y: "channel",
discrete: "y",
},
},
],
};
Responsive layouts
Section titled “Responsive layouts”responsive breakpoints change the dashboard’s config with its width, like any chart’s: below 600 pixels this one stacks its charts in one column. sizeRatio sets the dashboard’s height from its width, two to one here, and taller in one column.
Keeps the chart's shape as its width changes: its width divided by its height, such as 16 / 9 or 1 for a square. Used when the chart has no height of its own, in place of the height of its container: the chart's height follows its width, and a container without a height of its own grows to hold it. In a container whose height is set (by CSS, a flex or grid layout, or a max-height) and lower than the ratio asks for, the chart takes the container's height and narrows to keep its ratio, centered with equal space on both sides (like object-fit: contain), and so do its loading and no-data messages. A chart with an explicit width centers inside that width instead, and otherwise takes its width ÷ ratio as its height. width keeps the full width (the container's, or the one you set) while the chart draws narrower, and responsive breakpoints match it; a breakpoint can change the ratio. Not to be confused with a Plot's aspectRatio, which sets the ratio of one unit on the y axis to one on the x axis inside the plot area.
Tiles above charts
Section titled “Tiles above charts”Any chart can take a cell, a KPI included: here a row of KPI tiles spans both columns above a line plot and a bar chart, in a row half as tall as theirs. Each chart names its own metric, so legend: false leaves the dashboard without a legend.
// Six months of three metrics.
const months = [
"2025-01",
"2025-02",
"2025-03",
"2025-04",
"2025-05",
"2025-06",
];
const series = {
Revenue: [182, 186, 191, 188, 197, 204],
Orders: [2410, 2380, 2460, 2520, 2490, 2610],
Visitors: [61, 64, 66, 63, 68, 71],
};
const data = Object.entries(series).flatMap(([metric, values]) =>
values.map((value, i) => ({metric, month: months[i], value})),
);
const config = {
title: "June at a glance",
// Each chart names its own metric, so no legend is needed.
legend: false,
layoutConfig: {columns: 2, rows: [1, 2]},
charts: [
{
chart: "KPI",
config: {data, groupBy: "metric", time: "month"},
columnSpan: 2,
},
{
chart: "LinePlot",
config: {
data: data.filter(d => d.metric === "Revenue"),
groupBy: "metric",
x: "month",
y: "value",
title: "Revenue",
},
},
{
chart: "BarChart",
config: {
data: data.filter(d => d.metric === "Orders"),
groupBy: "metric",
x: "month",
y: "value",
title: "Orders",
},
},
],
};
Small multiples in a cell
Section titled “Small multiples in a cell”A chart with facet draws its small multiples inside its cell: here a bar chart per region beside a donut of every region’s sales together.
// Quarterly sales by product in two regions.
const products = ["Basic", "Plus", "Pro"];
const data = ["North", "South"].flatMap((region, r) =>
products.flatMap((product, p) =>
["Q1", "Q2", "Q3", "Q4"].map((quarter, q) => ({
region,
product,
quarter,
sales: 20 + r * 8 + p * 6 + q * (3 + p),
})),
),
);
const config = {
title: "Sales by product",
layoutConfig: {columns: [2, 1]},
charts: [
// One panel per region.
{
chart: "BarChart",
config: {
data,
groupBy: "product",
x: "quarter",
y: "sales",
facet: "region",
},
},
{chart: "Donut", config: {data, groupBy: "product", value: "sales"}},
],
};
Lining up plot areas
Section titled “Lining up plot areas”Charts with axes that start or end on the same grid line have their plot areas lined up, so stacked charts read against one x axis and charts side by side share their top and bottom, however wide each one’s axis labels are. layoutConfig.align: false gives each chart its whole cell instead.
// Revenue and margin for six countries, 2019–2024.
const countries = ["Brazil", "Mexico", "France", "Germany", "India", "Japan"];
const data = countries.flatMap((country, c) =>
[2019, 2020, 2021, 2022, 2023, 2024].map((year, y) => ({
country,
year,
revenue: (20 + c * 6 + y * (c + 2)) * 1e6,
margin: 0.08 + c * 0.015 + y * 0.006,
})),
);
const config = {
title: "Revenue and margin",
layoutConfig: {columns: 1, align: true},
charts: [
{
chart: "LinePlot",
config: {
data,
groupBy: "country",
x: "year",
y: "revenue",
yConfig: {title: "Revenue"},
},
},
{
chart: "LinePlot",
config: {
data,
groupBy: "country",
x: "year",
y: "margin",
yConfig: {title: "Margin", tickFormat: d => `${Math.round(d * 100)}%`},
},
},
],
};
Linked charts
Section titled “Linked charts”Every chart in a dashboard joins one link group, whatever its type: hovering a country in the treemap, bar chart, or line plot highlights it in the other two, and the treemap’s search box (search: true in its config) lights its matches in all three.
Links 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 of by (a data key or accessor), which defaults to the chart's own id. A string is shorthand for {group}; set hover, active, highlight, legend, or color to false to stop sharing that behavior. Plots also share their zoom: zooming or panning one shows the same window of dates or values on the others (set zoom: false to keep a chart's zoom its own, or zoom: "overview" to make it the group's overview, which keeps its whole view and shows the others' window as a band you drag, with rangeSelector buttons at its top-right). Plots that share zoom and sit one above another on the page also line up their plots, the widest margins winning, so a date sits at the same x in each (align: false opts a chart out).
Sharing axes
Section titled “Sharing axes”layoutConfig.shareX gives the charts with axes whose columns overlap one x domain (a chart spanning two columns shares with the charts under both), labeled only on the charts with none of the others below them; shareY does the same for the y domain of charts whose rows overlap, labeled only on the charts with none of the others to their left. A domain a chart sets itself (xDomain or yDomain) becomes the shared one, merged with any other chart’s own. Charts whose axes differ in kind (categories beside numbers, dates beside numbers, a log scale beside a linear one) don’t share.
// Revenue and margin for six countries in two regions, 2019–2024.
const countries = {
Brazil: "Americas",
Mexico: "Americas",
Chile: "Americas",
France: "Europe",
Germany: "Europe",
Spain: "Europe",
};
const data = Object.entries(countries).flatMap(([country, region], c) =>
[2019, 2020, 2021, 2022, 2023, 2024].map((year, y) => ({
country,
region,
year,
revenue: 20 + c * 6 + y * (c + 2),
margin: 0.08 + c * 0.015 + y * 0.006,
})),
);
const americas = data.filter(d => d.region === "Americas");
const europe = data.filter(d => d.region === "Europe");
const chart = (rows, y, title) => ({
chart: "LinePlot",
config: {data: rows, groupBy: "country", x: "year", y, title},
});
const config = {
title: "Americas and Europe",
layoutConfig: {columns: 2, shareX: true, shareY: true},
// Each line is labeled, so no legend is needed.
legend: false,
charts: [
chart(americas, "revenue", "Americas"),
chart(europe, "revenue", "Europe"),
chart(americas, "margin"),
chart(europe, "margin"),
],
};
One legend
Section titled “One legend”The dashboard draws one legend for all of its charts, in place of theirs. Each entry is the value a chart colors by (its color, else its top groupBy level), shown once however many charts have it, so a bar chart colored by region and a treemap grouped by region share their entries. The legend is linked to every chart: clicking or hovering an entry hides, solos, or highlights it everywhere. Its swatches take the shapeConfig, legendConfig, legendTooltip, and shape the charts set, the earlier chart’s where two disagree, and the dashboard’s own over both. A chart colored by a colorScale keeps its colorScale as its key and is left out of the legend. legendChart keeps the legend to the charts it names (an index into charts, or a list of them). legend: false gives each chart its own legend back, and a chart whose config sets legend keeps its own.
// Revenue for six countries in three regions, 2019–2024.
const countries = {
Brazil: "Americas",
Mexico: "Americas",
France: "Europe",
Germany: "Europe",
India: "Asia",
Japan: "Asia",
};
const data = Object.entries(countries).flatMap(([country, region], c) =>
[2019, 2020, 2021, 2022, 2023, 2024].map((year, y) => ({
country,
region,
year,
revenue: 20 + c * 6 + y * (c + 2),
})),
);
const latest = data.filter(d => d.year === 2024);
const config = {
title: "Revenue by region",
legendPosition: "top",
charts: [
{
chart: "BarChart",
config: {
data: latest,
groupBy: "country",
color: "region",
x: "country",
y: "revenue",
},
},
{
chart: "StackedArea",
config: {
data,
groupBy: "region",
x: "year",
y: "revenue",
// Wide swatches, which the dashboard's legend takes.
legendConfig: {shapeConfig: {width: 24, height: 10}},
},
},
],
};
Charts grouped at different levels share one legend when they color by the same values: a pie grouped by region and a bar chart of countries colored by region both list Americas, Asia, and Europe, and clicking an entry hides the region’s slice and its countries’ bars.
// Revenue for six countries in three regions, 2024.
const countries = {
Brazil: "Americas",
Mexico: "Americas",
France: "Europe",
Germany: "Europe",
India: "Asia",
Japan: "Asia",
};
const data = Object.entries(countries).map(([country, region], c) => ({
country,
region,
revenue: 40 + c * 9,
}));
const config = {
title: "Revenue, 2024",
charts: [
// Grouped by region…
{chart: "Pie", config: {data, groupBy: "region", value: "revenue"}},
// …and by country, colored by region: one legend entry per region.
{
chart: "BarChart",
config: {
data,
groupBy: "country",
color: "region",
x: "country",
y: "revenue",
},
},
],
};
legendChart keeps the legend to the charts it names: here only the treemap’s regions, leaving out the bar chart’s products.
// Sales by region and by product, 2024.
const regions = ["North", "South", "East", "West"];
const products = ["Basic", "Plus", "Pro"];
const data = regions.flatMap((region, r) =>
products.map((product, p) => ({region, product, sales: 20 + r * 6 + p * 11})),
);
const config = {
title: "Sales, 2024",
// Only the first chart's entries: the regions.
legendChart: 0,
charts: [
{chart: "Treemap", config: {data, groupBy: "region", sum: "sales"}},
{
chart: "BarChart",
config: {data, groupBy: "product", x: "product", y: "sales"},
},
],
};
Shared config
Section titled “Shared config”Every chart takes the dashboard’s theme, locale, and renderer. chartConfig is config every chart gets after those and before its own, for what else they share, such as a tooltipConfig; by default it turns off each chart’s download, table view, search, and zoom buttons, since the dashboard’s download button saves them all. A chart’s own config wins over both. Set link to a group name to link the charts with others on the page, or to false to unlink them; a chart with a link of its own keeps it.
Links 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 of by (a data key or accessor), which defaults to the chart's own id. A string is shorthand for {group}; set hover, active, highlight, legend, or color to false to stop sharing that behavior. Plots also share their zoom: zooming or panning one shows the same window of dates or values on the others (set zoom: false to keep a chart's zoom its own, or zoom: "overview" to make it the group's overview, which keeps its whole view and shows the others' window as a band you drag, with rangeSelector buttons at its top-right). Plots that share zoom and sit one above another on the page also line up their plots, the widest margins winning, so a date sits at the same x in each (align: false opts a chart out).
Nesting dashboards
Section titled “Nesting dashboards”A chart in a dashboard can be another Dashboard, which lays its own charts out in its cell: here a pie beside a bar chart stacked over a line plot. The nested dashboard’s charts join the outer dashboard’s link group, and the outer legend lists their entries too, so the nested dashboard draws a legend only for entries the outer one doesn’t show, two or more like any legend (when the outer’s legendChart leaves it out, or its legend is off). Both legends list entries in the same order.
// Revenue for six countries in three regions, 2019–2024.
const countries = {
Brazil: "Americas",
Mexico: "Americas",
France: "Europe",
Germany: "Europe",
India: "Asia",
Japan: "Asia",
};
const data = Object.entries(countries).flatMap(([country, region], c) =>
[2019, 2020, 2021, 2022, 2023, 2024].map((year, y) => ({
country,
region,
year,
revenue: 20 + c * 6 + y * (c + 2),
})),
);
const latest = data.filter(d => d.year === 2024);
const config = {
title: "A dashboard in a dashboard",
layoutConfig: {columns: [1, 2]},
charts: [
{
chart: "Pie",
config: {
data: latest,
groupBy: "region",
value: "revenue",
},
},
{
chart: "Dashboard",
config: {
layoutConfig: {columns: 1},
charts: [
{
chart: "BarChart",
config: {
data: latest,
groupBy: "country",
color: "region",
x: "country",
y: "revenue",
},
},
{
chart: "LinePlot",
config: {
data,
groupBy: "country",
color: "region",
x: "year",
y: "revenue",
},
},
],
},
},
],
};
Configuration
import {Dashboard} from "@d3plus/core";
activenull|functionPredicate or null marking which data points are currently active.
aggsobjectCustom aggregation functions keyed by data property.
ariaHiddenbooleanDefaulttrueHides the SVG from assistive technology when true (
aria-hidden).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.chartConfigd3plusconfigDashboard: config applied to every chart in the dashboard (with
.config()), after the dashboard's ownrenderer,theme, andlocale(which every chart takes) and before each chart's ownconfig. Use it for what the charts share, such as atooltipConfig. Defaults to turning off each chart'ssaveControl,tableView,search, andzoomControlsbuttons: the dashboard's own download button saves every chart. Merged into the current config.chartsarray.<dashboardchart>Default[]Dashboard: the charts it draws, in reading order. Each is a chart instance (
new BarChart().data(…)), or an object placing one:{chart, config, column, row, columnSpan, rowSpan}, wherechartis an instance, a chart class, or a chart class's name ("BarChart") andconfigis applied to it. A chart without acolumnandrowtakes the first free cell that fits its span. The dashboard sizes, draws, and destroys its charts (setting each one'swidth,height,detectResize, anddetectVisible), links those without alinkof their own (seelink), and draws one legend for them (seelegendChart).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.colorstring|array.<string>The scale's colors: one color, expanded into a light→dark ramp, or an array of colors to step through.
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.
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"Discrete-axis key ("x" | "y") for charts that flip layout per axis.
durationnumberDefault600Animation duration in ms.
facetstring|false|functionSplits the chart into small multiples: one equally sized panel per distinct value of this data key or accessor, sharing one legend, color scale, title, and timeline.
falsedraws a single chart.facetConfigfacetconfigLayout and scale sharing for small multiples (see
facet):columns,rows,padding,sort,scales("shared"or"independent"),axes("outer"or"all", for both axes or per axis as{x, y}),title,titleConfig, andlayout(a map-shaped grid:"us-states","eu-countries","world-regions", or{[value]: [row, column]}).filterfalse|functionPredicate filtering which data points are included, or false to disable.
fontFamilystring|array.<string>Default["Inter","Helvetica Neue","HelveticaNeue","Helvetica","Arial","sans-serif"]Font family. Defaults to the chart's
fontFamily.groupBystring|array.<string>|function|array.<function>Default[null,null]Grouping key(s) or accessor function(s).
heightnumberOverall height of the visualization in pixels. Unset, the chart takes its container's height, or its width divided by
sizeRatio.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|null|functionPersistently emphasizes matching marks (keep color) and grays the rest.
hovernull|functionPredicate or null marking which data points are currently hovered.
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).labelconstoraccessorLabel text(s) per datum. False/undefined skips.
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)."auto"also moves it beside when a circle drawn over its own covers it, and keeps it inside when no side has room. - 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".labelSlidebooleanDefaulttrueCircles (Plot points, Network nodes, Geomap points): whether a label that fits neither inside its circle nor centered on a side of it slides along a side before it hides, clear of the other circles and labels (and, on a Network, crossing as few links as it can). It may also move a neighbor's label aside to make room.
falsekeeps each label centered on a side, or hides it. Defaults totrue.layoutConfigdashboardlayoutconfigDashboard: the grid its charts are placed on.
columnsandrowsset the track count, or each track's size relative to the others (columns: [2, 1]); the column count is chosen to draw the charts as large as possible by default.paddingis the space between charts (4by default), andalign(trueby default) lines up the plot areas of charts with axes that start or end on the same grid line.shareXgives the charts with axes whose columns overlap one x domain, labeled only where no sharing chart sits below, andshareYthe charts whose rows overlap one y domain, labeled only where no sharing chart sits to the left (bothfalseby default); a domain a chart sets itself becomes the shared one. Merged into the current config.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.legendChartunknownlegendConfigobjectConfiguration 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.
linklinkoptionDefaultd3plus-dashboard-1Links 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. Plots also share their zoom: zooming or panning one shows the same window of dates or values on the others (setzoom: falseto keep a chart's zoom its own, orzoom: "overview"to make it the group's overview, which keeps its whole view and shows the others' window as a band you drag, withrangeSelectorbuttons at its top-right). Plots that share zoom and sit one above another on the page also line up their plots, the widest margins winning, so a date sits at the same x in each (align: falseopts a chart out).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. While it shows, the zoom controls and the top-left controls (download, search, table view) are hidden; the back button stays, so a drill-down that left nothing to draw can still be undone. An open table view closes meanwhile, moving keyboard focus that was inside it to the chart, and reopens when data returns.
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 dashboard and every chart in it. The callback runs once every chart has drawn too.
responsivearray.<responsivebreakpoint>Swaps in other settings when the chart is narrow (or wide): a list of breakpoints, each a
minWidthand/ormaxWidthin pixels (both inclusive) and theconfigthe chart takes while its own width, not the window's, is in that range. Every matching entry merges over the chart's config in list order, so a later entry wins, and deep-merges config objects such asshapeConfigthe wayconfig()does. When the width leaves a range its settings are taken back off, restoring what was set before. Setting a key while a breakpoint holds it updates the value restored afterwards; the breakpoint keeps its own value until the width leaves its range. Checked on every render, including the ones a container resize starts. A breakpoint cannot setdata,select,width,height, orresponsive.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.
searchbooleanDefaultfalseShows 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|htmlelement|svgelement|nullWhere to mount the shape's DOM (CSS selector, element, or null).
selectMode"box"|"lasso"|falseDefaultfalseThe box and lasso selection tool a chart starts with:
"box"or"lasso", orfalse(the default) to start out panning. Whatever it starts with, the Box Select and Lasso Select items in the zoom controls' "More Controls" (⋯) menu switch between the tools, or back to panning when the one on is picked again (Brush Zoom turns selection off too), and changingselectModelater resets the tool.While a tool is on, a drag over the chart draws a box (or a freehand lasso) instead of panning, and releasing it selects the marks inside, which stay lit while the rest dim (as
activeOpacitydims them), the legend included. A bar or other rectangle is inside when any part of it is, every other mark (a point, a point of a line or area) when its center is, and a line or area stays lit while any of its points is selected. Shift + drag adds to the selection, a click on a mark selects it (Shift + click toggles it, and the chart's own click action, such as drilling down, waits until no select tool is on), and Escape or a click on no mark clears it. With small multiples, a drag selects within the panel it starts in. A wheel or pinch still zooms. Each selection fires the chart'sselectevent with the selected rows (viz.on("select", rows => …)), andselectionreads or sets the selection from code.selectStylerecordSVG attributes for the box or lasso a selection drag draws, such as
fill,fill-opacity,stroke, andstroke-dasharray.shape"line"|"rect"|"circle"The shape drawn at each tick:
"Line"(the default),"Rect", or"Circle".shapeConfigd3plusconfigConfiguration object with key/value pairs applied as method calls on each shape.
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 viapointSizeand Dorling or Demers cartograms viacartogramSize, 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.sizeRationumberKeeps the chart's shape as its width changes: its width divided by its height, such as
16 / 9or1for a square. Used when the chart has noheightof its own, in place of the height of its container: the chart's height follows its width, and a container without a height of its own grows to hold it. In a container whose height is set (by CSS, a flex or grid layout, or amax-height) and lower than the ratio asks for, the chart takes the container's height and narrows to keep its ratio, centered with equal space on both sides (likeobject-fit: contain), and so do its loading and no-data messages. A chart with an explicitwidthcenters inside that width instead, and otherwise takes its width ÷ ratio as its height.widthkeeps the full width (the container's, or the one you set) while the chart draws narrower, andresponsivebreakpoints match it; a breakpoint can change the ratio. Not to be confused with a Plot'saspectRatio, which sets the ratio of one unit on the y axis to one on the x axis inside the plot area.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>).tableViewbooleanDefaultfalseEnables 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. Itson,caution,off,sequential, andneutraltokens give way to the same keys set incolorDefaults, and set the defaults those keys would otherwise take. ItscolorScale.min,mid, andmaxare itsoff,neutral, andsequentialunless the theme sets them.thresholdnumberThreshold value for grouping small slices, as a share of the total (
0.05is 5%). On a stacked Plot (StackedArea, or an AreaPlot, BarChart, or LinePlot withstacked), the series whose summed value across every position is under that share of the whole chart's total merge into one series, labelled bythresholdNameand stacked on top. A bucket needs at least two items (a lone small item stays as itself), and its tooltips list the items it holds with their values. Off by default on Plot charts;0.0001(0.01%) elsewhere, as on Treemap. On WordCloud the bucket is drawn as one more word, sized by the summed value of the words it holds.thresholdKeyunknownthresholdNamestring|functionLabel for the threshold group, or a
(datum, index)accessor.timestringTime key for temporal data.
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.timelinebooleanDefaultfalseWhether to show the timeline component.
timelineConfigtimelineconfigConfiguration object for the timeline.
timelineDefaultunknowntimelinePaddingboolean|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.
titlestringTitle of the axis.
titleConfigrecordTitle configuration of the axis.
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.tooltipConfigtooltipconfigConfiguration for the tooltip component.
totalunknowntotalConfigrecordConfiguration 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. A string with numbered placeholders (
"{0} hidden") has them filled from the arguments after the locale, so each language can order its words naturally. 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.
zoombooleanDefaultfalseEnables 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.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-brush/select-box/select-lasso/zoom-moreclasses. 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,selectBox,selectLasso). 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 controls show in the chart's top-right corner: the zoom in, zoom out, and reset buttons, then a "More Controls" (⋯) menu with a Zoom section (Brush Zoom) and a Select section (the Box Select and Lasso Select tools, see
selectMode). An overview chart shows itsrangeSelectorbuttons to the left of the zoom buttons. While a tool is on, the menu button shows its icon. On a chart too narrow for every zoom button beside the top-left controls, the ones that don't fit move into the menu too.falsehides them (leaving an overview'srangeSelectorbuttons) 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.