Skip to content

Geomap

Creates a geographical map with zooming, panning, image tiles, and the ability to layer choropleth paths and coordinate points.

Joins data to the topojson shapes via groupBy and fills each region by its colorScale value; colorScaleConfig’s tickFormat renders the legend ticks as percentages.

The map projection for the topojson and coordinate points: a projection function, or the name of one of the d3-geo projections or of geoAlbersUsaTerritories, geoMiller, geoRobinson and geoWinkel3 (e.g. "geoAlbersUsa"). Map tiles only line up with Mercator (the default), so any other projection turns tiles off.

Whether to draw map tiles behind the shapes, from tileUrl. On by default; a non-Mercator projection or projectionRotate turns it off.

Two fields given to colorScale color each region by both at once. Each variable is split into quantile bins (3 by default; colorScaleConfig.bivariateBuckets takes 2 to 4), and the pair of bins picks a color from a grid: Joshua Stevens’ blue–red scheme by default, where adult obesity rises toward red, physical inactivity toward blue, and both together toward the dark corner. The key turns the grid 45° into a diamond, each variable named along its lower edge. Hover a cell to highlight the states in it, or a state to light its cell and read both values in the tooltip. A state missing either value takes the no-data fill.

The map projection for the topojson and coordinate points: a projection function, or the name of one of the d3-geo projections or of geoAlbersUsaTerritories, geoMiller, geoRobinson and geoWinkel3 (e.g. "geoAlbersUsa"). Map tiles only line up with Mercator (the default), so any other projection turns tiles off.

Rather than shading regions, this drops a marker per datum: point returns each row’s [longitude, latitude], and pointSize scales the radius between pointSizeMin and pointSizeMax by dma_code.

pointSize

Accessor (or constant) for the value that sizes each coordinate point, scaled by pointSizeScale onto [pointSizeMin, pointSizeMax] pixels.

ƒ (function)

The smallest coordinate point radius, in pixels.

The largest coordinate point radius, in pixels.

links draws a line between two places for each row, along the great circle between them, so it follows the map’s projection. Each link’s source and target is a [longitude, latitude] pair or an id: a row with a coordinate point links from that point, and any other id (such as a topojson feature’s) from the centroid of its shape. linkSize sets each link’s width, scaled between linkSizeMin and linkSizeMax; linkCurve bows each link into an arc, to the left of its direction, so the flows each way between New York and London stay apart; and arrows points each one at its target. Links color by linkColor (here the color of the point they leave), take linkLabel text, which follows each arc, and show a “Source → Target” tooltip. They sit above the shapes and below the points, and pan and zoom with the map.

How far each link bows into an arc, as a share of the distance between its ends: 0 draws the plain great-circle path, and the default 0.2 lifts its middle by a fifth of that distance, to the left of the link's direction (a negative value bows to the right), so links running both ways between two places stay apart. On a flat map, a link whose great circle the projection cuts (across the antimeridian, or between "geoAlbersUsa"'s insets) is drawn on the screen between its two ends instead, bowed the same way, so it crosses the map rather than leaving by one edge. On a projection that clips to a circle (a globe, such as "geoOrthographic"), links follow the great circle without the lift, which would leave the sphere.

linkSize

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 at its ends, and its index in links.

ƒ (function)

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.

linkColor

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.

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.

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.

The map projection for the topojson and coordinate points: a projection function, or the name of one of the d3-geo projections or of geoAlbersUsaTerritories, geoMiller, geoRobinson and geoWinkel3 (e.g. "geoAlbersUsa"). Map tiles only line up with Mercator (the default), so any other projection turns tiles off.

A projection that clips to a circle, such as "geoOrthographic", draws a globe. Dragging it turns the globe under the pointer, keeping the place you grabbed beneath it, while the wheel, a pinch, and the zoom buttons zoom; the reset button turns it back to projectionRotate. From the keyboard, focus the chart and hold Shift with the arrow keys: each press turns the globe 10°, ← → bringing the land to the west or east into view and ↑ ↓ the land to the north or south, stopping at the poles. A press eases into place (instantly under reducedMotion), holding the keys keeps turning, and the plain arrow keys still move between points. Points on the far side are hidden, and links follow the shortest great circle, without linkCurve’s lift, so they stay on the sphere.

Selects which @d3plus/render backend paints the visible output. "svg" = SvgRenderer (default), "canvas" = CanvasRenderer. Boolean arguments both normalize to "svg".

linkBundle pulls links that run the same way near each other into shared corridors, so many flows between two regions read as one: here every flight from six European cities to seven North American ones gathers over the Atlantic and fans out at each end. It bundles the links between their projected ends, in place of linkCurve’s arc, and linkBundleConfig tunes it (see Network’s edge bundling). Only a flat map bundles: on a globe, and for a link the projection cuts (across the antimeridian, or between "geoAlbersUsa"’s insets), links keep their great-circle paths.

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.

The map projection for the topojson and coordinate points: a projection function, or the name of one of the d3-geo projections or of geoAlbersUsaTerritories, geoMiller, geoRobinson and geoWinkel3 (e.g. "geoAlbersUsa"). Map tiles only line up with Mercator (the default), so any other projection turns tiles off.

Any d3-geo projection name can be passed to projection; "geoMercator" gives the familiar cylindrical world view, while topojsonFilter drops Antarctica (id !== "010").

The map projection for the topojson and coordinate points: a projection function, or the name of one of the d3-geo projections or of geoAlbersUsaTerritories, geoMiller, geoRobinson and geoWinkel3 (e.g. "geoAlbersUsa"). Map tiles only line up with Mercator (the default), so any other projection turns tiles off.

An array of ids passed to topojsonFilter keeps only those features, so the map draws just the areas with data and zooms to fit them. For data that changes, pass a function over the features instead: const ids = new Set(data.map(d => d.id)), then topojsonFilter: f => ids.has(f.id).

const config = {
  data: [
    {id: "840", country: "United States", value: 10},
    {id: "124", country: "Canada", value: 4},
    {id: "484", country: "Mexico", value: 7},
    {id: "076", country: "Brazil", value: 9},
    {id: "032", country: "Argentina", value: 3},
  ],
  colorScale: "value",
  groupBy: "id",
  label: d => d.country,
  topojson: "/data/countries-110m.json",
  topojsonFilter: ["840", "124", "484", "076", "032"],
};

Point tileUrl at any XYZ tile server to swap the background imagery. noKeyTilesets lists every server that needs no account or API key: change the name in the code to try another. Esri’s Canvas layers are the default, Light Gray on a light page and Dark Gray on a dark one. The credit in the corner updates to match, and any other {z}/{x}/{y} template works too (Esri’s services order it {z}/{y}/{x}).

const esri = name =>
  `https://server.arcgisonline.com/ArcGIS/rest/services/${name}/MapServer/tile/{z}/{y}/{x}`;

const noKeyTilesets = [
  {
    name: "Esri Light Gray (default)",
    url: esri("Canvas/World_Light_Gray_Base"),
  },
  {
    name: "Esri Dark Gray (dark default)",
    url: esri("Canvas/World_Dark_Gray_Base"),
  },
  {name: "Esri Terrain", url: esri("World_Terrain_Base")},
  {name: "Esri Street Map", url: esri("World_Street_Map")},
  {name: "Esri Imagery", url: esri("World_Imagery")},
  {name: "Esri National Geographic", url: esri("NatGeo_World_Map")},
  {name: "OSM Standard", url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"},
  {
    name: "OSM Humanitarian",
    url: "https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",
  },
  {name: "OpenTopoMap", url: "https://tile.opentopomap.org/{z}/{x}/{y}.png"},
];

const config = {
  projection: "geoMercator",
  tileUrl: noKeyTilesets.find(t => t.name === "Esri Terrain").url,
};

tileUrl and ocean also accept a {light, dark} pair, and the defaults are one: Esri Light Gray Canvas on a light backdrop and Dark Gray Canvas on a dark one, with a matching ocean and no-data fill. Geomap reads the backdrop from the page (the nearest background color, or a dark color-scheme on a dark system) and redraws when it changes: switch this site between light and dark to see it.

const esri = name =>
  `https://server.arcgisonline.com/ArcGIS/rest/services/${name}/MapServer/tile/{z}/{y}/{x}`;

const noKeyTilesets = [
  {
    name: "Esri Light Gray (default)",
    url: esri("Canvas/World_Light_Gray_Base"),
  },
  {
    name: "Esri Dark Gray (dark default)",
    url: esri("Canvas/World_Dark_Gray_Base"),
  },
  {name: "Esri Terrain", url: esri("World_Terrain_Base")},
  {name: "Esri Street Map", url: esri("World_Street_Map")},
  {name: "Esri Imagery", url: esri("World_Imagery")},
  {name: "Esri National Geographic", url: esri("NatGeo_World_Map")},
  {name: "OSM Standard", url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"},
  {
    name: "OSM Humanitarian",
    url: "https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",
  },
  {name: "OpenTopoMap", url: "https://tile.opentopomap.org/{z}/{x}/{y}.png"},
];

const config = {
  projection: "geoMercator",
  // The default, spelled out: any two tile servers can be paired this way.
  tileUrl: {
    light: noKeyTilesets[0].url,
    dark: noKeyTilesets[1].url,
  },
  ocean: {light: "#d0cfd4", dark: "#222327"},
};

topojsonFill sets the color for shapes with no matching data (here light pink), so empty regions read differently from those on the colorScale.

The fill for topojson shapes that have no data (or no colorScale value): a CSS color or a function of the feature. Defaults to the theme's colorScale.missing when it sets one, else a quiet light gray, or its dark counterpart over a dark basemap.

Override the default color interpolation by passing an explicit ramp to colorScaleConfig’s color array — here red → orange → yellow → green → blue across the range.

// Illustrative shares of adults with diabetes, keyed by the two-digit
// FIPS codes the map's state features use as ids.
const data = [
  {id: "01", state: "Alabama", "Diabetes Prevalence": 0.148},
  {id: "02", state: "Alaska", "Diabetes Prevalence": 0.091},
  {id: "04", state: "Arizona", "Diabetes Prevalence": 0.112},
  {id: "05", state: "Arkansas", "Diabetes Prevalence": 0.141},
  {id: "06", state: "California", "Diabetes Prevalence": 0.104},
  {id: "08", state: "Colorado", "Diabetes Prevalence": 0.074},
  {id: "09", state: "Connecticut", "Diabetes Prevalence": 0.096},
  {id: "10", state: "Delaware", "Diabetes Prevalence": 0.124},
  {id: "11", state: "District of Columbia", "Diabetes Prevalence": 0.083},
  {id: "12", state: "Florida", "Diabetes Prevalence": 0.118},
  {id: "13", state: "Georgia", "Diabetes Prevalence": 0.127},
  {id: "15", state: "Hawaii", "Diabetes Prevalence": 0.098},
  {id: "16", state: "Idaho", "Diabetes Prevalence": 0.093},
  {id: "17", state: "Illinois", "Diabetes Prevalence": 0.109},
  {id: "18", state: "Indiana", "Diabetes Prevalence": 0.123},
  {id: "19", state: "Iowa", "Diabetes Prevalence": 0.106},
  {id: "20", state: "Kansas", "Diabetes Prevalence": 0.112},
  {id: "21", state: "Kentucky", "Diabetes Prevalence": 0.139},
  {id: "22", state: "Louisiana", "Diabetes Prevalence": 0.143},
  {id: "23", state: "Maine", "Diabetes Prevalence": 0.102},
  {id: "24", state: "Maryland", "Diabetes Prevalence": 0.113},
  {id: "25", state: "Massachusetts", "Diabetes Prevalence": 0.089},
  {id: "26", state: "Michigan", "Diabetes Prevalence": 0.119},
  {id: "27", state: "Minnesota", "Diabetes Prevalence": 0.087},
  {id: "28", state: "Mississippi", "Diabetes Prevalence": 0.156},
  {id: "29", state: "Missouri", "Diabetes Prevalence": 0.121},
  {id: "30", state: "Montana", "Diabetes Prevalence": 0.084},
  {id: "31", state: "Nebraska", "Diabetes Prevalence": 0.101},
  {id: "32", state: "Nevada", "Diabetes Prevalence": 0.108},
  {id: "33", state: "New Hampshire", "Diabetes Prevalence": 0.091},
  {id: "34", state: "New Jersey", "Diabetes Prevalence": 0.104},
  {id: "35", state: "New Mexico", "Diabetes Prevalence": 0.117},
  {id: "36", state: "New York", "Diabetes Prevalence": 0.107},
  {id: "37", state: "North Carolina", "Diabetes Prevalence": 0.122},
  {id: "38", state: "North Dakota", "Diabetes Prevalence": 0.094},
  {id: "39", state: "Ohio", "Diabetes Prevalence": 0.126},
  {id: "40", state: "Oklahoma", "Diabetes Prevalence": 0.137},
  {id: "41", state: "Oregon", "Diabetes Prevalence": 0.097},
  {id: "42", state: "Pennsylvania", "Diabetes Prevalence": 0.114},
  {id: "44", state: "Rhode Island", "Diabetes Prevalence": 0.103},
  {id: "45", state: "South Carolina", "Diabetes Prevalence": 0.131},
  {id: "46", state: "South Dakota", "Diabetes Prevalence": 0.099},
  {id: "47", state: "Tennessee", "Diabetes Prevalence": 0.134},
  {id: "48", state: "Texas", "Diabetes Prevalence": 0.124},
  {id: "49", state: "Utah", "Diabetes Prevalence": 0.078},
  {id: "50", state: "Vermont", "Diabetes Prevalence": 0.081},
  {id: "51", state: "Virginia", "Diabetes Prevalence": 0.111},
  {id: "53", state: "Washington", "Diabetes Prevalence": 0.092},
  {id: "54", state: "West Virginia", "Diabetes Prevalence": 0.153},
  {id: "55", state: "Wisconsin", "Diabetes Prevalence": 0.096},
  {id: "56", state: "Wyoming", "Diabetes Prevalence": 0.087},
];

const config = {
  data,
  groupBy: "id",
  label: d => d.state,
  colorScale: "Diabetes Prevalence",
  colorScaleConfig: {
    color: ["red", "orange", "yellow", "green", "blue"],
  },
  projection: "geoAlbersUsa",
  topojson: "/data/states-10m.json",
};

fitObject frames the initial view to a custom TopoJSON object; the two MultiPoint corners here define the bounding box the map zooms to fit.

const config = {
  fitObject: {
    type: "Topology",
    objects: {
      "custom-bounds": {
        type: "GeometryCollection",
        geometries: [
          {
            type: "MultiPoint",
            coordinates: [
              [-160, 70],
              [170, -55],
            ],
          },
        ],
      },
    },
  },
};

zoom: false turns off panning and scroll-to-zoom, locking the map at its initial extent.

Enables pan and zoom: the mouse wheel or a pinch (see zoomScroll), a drag (see zoomDrag), a double-click (see zoomDoubleClick), the zoom-control buttons (see zoomControls), and the zoomIn, zoomOut, zoomReset, and zoomBrush methods. On by default for every chart; false turns all of them off.

colorScalePosition: false hides the legend while regions stay shaded by colorScale — useful when the scale is documented elsewhere.

// Illustrative shares of adults with diabetes, keyed by the two-digit
// FIPS codes the map's state features use as ids.
const data = [
  {id: "01", state: "Alabama", "Diabetes Prevalence": 0.148},
  {id: "02", state: "Alaska", "Diabetes Prevalence": 0.091},
  {id: "04", state: "Arizona", "Diabetes Prevalence": 0.112},
  {id: "05", state: "Arkansas", "Diabetes Prevalence": 0.141},
  {id: "06", state: "California", "Diabetes Prevalence": 0.104},
  {id: "08", state: "Colorado", "Diabetes Prevalence": 0.074},
  {id: "09", state: "Connecticut", "Diabetes Prevalence": 0.096},
  {id: "10", state: "Delaware", "Diabetes Prevalence": 0.124},
  {id: "11", state: "District of Columbia", "Diabetes Prevalence": 0.083},
  {id: "12", state: "Florida", "Diabetes Prevalence": 0.118},
  {id: "13", state: "Georgia", "Diabetes Prevalence": 0.127},
  {id: "15", state: "Hawaii", "Diabetes Prevalence": 0.098},
  {id: "16", state: "Idaho", "Diabetes Prevalence": 0.093},
  {id: "17", state: "Illinois", "Diabetes Prevalence": 0.109},
  {id: "18", state: "Indiana", "Diabetes Prevalence": 0.123},
  {id: "19", state: "Iowa", "Diabetes Prevalence": 0.106},
  {id: "20", state: "Kansas", "Diabetes Prevalence": 0.112},
  {id: "21", state: "Kentucky", "Diabetes Prevalence": 0.139},
  {id: "22", state: "Louisiana", "Diabetes Prevalence": 0.143},
  {id: "23", state: "Maine", "Diabetes Prevalence": 0.102},
  {id: "24", state: "Maryland", "Diabetes Prevalence": 0.113},
  {id: "25", state: "Massachusetts", "Diabetes Prevalence": 0.089},
  {id: "26", state: "Michigan", "Diabetes Prevalence": 0.119},
  {id: "27", state: "Minnesota", "Diabetes Prevalence": 0.087},
  {id: "28", state: "Mississippi", "Diabetes Prevalence": 0.156},
  {id: "29", state: "Missouri", "Diabetes Prevalence": 0.121},
  {id: "30", state: "Montana", "Diabetes Prevalence": 0.084},
  {id: "31", state: "Nebraska", "Diabetes Prevalence": 0.101},
  {id: "32", state: "Nevada", "Diabetes Prevalence": 0.108},
  {id: "33", state: "New Hampshire", "Diabetes Prevalence": 0.091},
  {id: "34", state: "New Jersey", "Diabetes Prevalence": 0.104},
  {id: "35", state: "New Mexico", "Diabetes Prevalence": 0.117},
  {id: "36", state: "New York", "Diabetes Prevalence": 0.107},
  {id: "37", state: "North Carolina", "Diabetes Prevalence": 0.122},
  {id: "38", state: "North Dakota", "Diabetes Prevalence": 0.094},
  {id: "39", state: "Ohio", "Diabetes Prevalence": 0.126},
  {id: "40", state: "Oklahoma", "Diabetes Prevalence": 0.137},
  {id: "41", state: "Oregon", "Diabetes Prevalence": 0.097},
  {id: "42", state: "Pennsylvania", "Diabetes Prevalence": 0.114},
  {id: "44", state: "Rhode Island", "Diabetes Prevalence": 0.103},
  {id: "45", state: "South Carolina", "Diabetes Prevalence": 0.131},
  {id: "46", state: "South Dakota", "Diabetes Prevalence": 0.099},
  {id: "47", state: "Tennessee", "Diabetes Prevalence": 0.134},
  {id: "48", state: "Texas", "Diabetes Prevalence": 0.124},
  {id: "49", state: "Utah", "Diabetes Prevalence": 0.078},
  {id: "50", state: "Vermont", "Diabetes Prevalence": 0.081},
  {id: "51", state: "Virginia", "Diabetes Prevalence": 0.111},
  {id: "53", state: "Washington", "Diabetes Prevalence": 0.092},
  {id: "54", state: "West Virginia", "Diabetes Prevalence": 0.153},
  {id: "55", state: "Wisconsin", "Diabetes Prevalence": 0.096},
  {id: "56", state: "Wyoming", "Diabetes Prevalence": 0.087},
];

const config = {
  data,
  groupBy: "id",
  label: d => d.state,
  colorScale: "Diabetes Prevalence",
  colorScalePosition: false,
  projection: "geoAlbersUsa",
  topojson: "/data/states-10m.json",
};

The color scale normally auto-detects its type from the data; setting colorScaleConfig’s scale: "linear" forces a plain linear ramp instead of the automatic choice.

const config = {
  // Illustrative year-over-year growth in one country's exports to each
  // trading partner, keyed by the ISO 3166 numeric code the map's features use.
  data: [
    {id: "840", name: "United States", "Export Growth": 0.047},
    {id: "250", name: "France", "Export Growth": -0.013},
    {id: "156", name: "China", "Export Growth": 0.028},
    {id: "528", name: "Netherlands", "Export Growth": -0.021},
    {id: "826", name: "United Kingdom", "Export Growth": -0.043},
    {id: "380", name: "Italy", "Export Growth": -0.031},
    {id: "040", name: "Austria", "Export Growth": -0.009},
    {id: "616", name: "Poland", "Export Growth": 0.032},
    {id: "756", name: "Switzerland", "Export Growth": 0.054},
    {id: "056", name: "Belgium", "Export Growth": -0.028},
    {id: "724", name: "Spain", "Export Growth": -0.017},
    {id: "203", name: "Czechia", "Export Growth": -0.006},
    {id: "752", name: "Sweden", "Export Growth": -0.052},
    {id: "348", name: "Hungary", "Export Growth": 0.018},
    {id: "643", name: "Russia", "Export Growth": 0.011},
    {id: "392", name: "Japan", "Export Growth": 0.035},
    {id: "792", name: "Turkey", "Export Growth": -0.087},
    {id: "208", name: "Denmark", "Export Growth": 0.004},
    {id: "642", name: "Romania", "Export Growth": 0.029},
    {id: "703", name: "Slovakia", "Export Growth": 0.021},
    {id: "484", name: "Mexico", "Export Growth": 0.066},
    {id: "124", name: "Canada", "Export Growth": 0.038},
    {id: "076", name: "Brazil", "Export Growth": -0.048},
    {id: "356", name: "India", "Export Growth": -0.035},
    {id: "410", name: "South Korea", "Export Growth": -0.072},
    {id: "036", name: "Australia", "Export Growth": -0.059},
    {id: "578", name: "Norway", "Export Growth": -0.024},
    {id: "246", name: "Finland", "Export Growth": -0.033},
    {id: "620", name: "Portugal", "Export Growth": 0.015},
    {id: "710", name: "South Africa", "Export Growth": -0.091},
  ],
  groupBy: "id",
  label: d => d.name,
  colorScale: "Export Growth",
  colorScaleConfig: {
    scale: "linear",
  },
  projection: "geoMiller",
  topojson: "/data/countries-110m.json",
  topojsonFilter: d => d.id !== "010",
};

Set ocean: "transparent" and tiles: false to strip the water fill and background map tiles, leaving just the choropleth shapes.

Whether to draw map tiles behind the shapes, from tileUrl. On by default; a non-Mercator projection or projectionRotate turns it off.

The same choropleth painted with the Canvas backend (renderer: "canvas"). Geography, color scale, tooltips, and zoom all work; SVG remains the default.

Selects which @d3plus/render backend paints the visible output. "svg" = SvgRenderer (default), "canvas" = CanvasRenderer. Boolean arguments both normalize to "svg".

Motion trails aren’t just for scatter plots — Geomap coordinate points trail too, and are on by default. Press play: each storm track sweeps a tapering cone from its previous position to the next as the timeline advances, tracing its path across the map. Toggle renderer to compare the SVG and Canvas backends.

Selects which @d3plus/render backend paints the visible output. "svg" = SvgRenderer (default), "canvas" = CanvasRenderer. Boolean arguments both normalize to "svg".

Accessor function or string key for the time dimension of each data point.

Coordinate points sized by pointSize get a size legend in the corner, drawn with the same pointSizeScale as the points. The points scale with the map as you zoom in, so the legend keeps its circles the same size and relabels them: at 4× zoom, the largest circle represents a much smaller population than it does unzoomed.

pointSize

Accessor (or constant) for the value that sizes each coordinate point, scaled by pointSizeScale onto [pointSizeMin, pointSizeMax] pixels.

ƒ (function)

The smallest coordinate point radius, in pixels.

The largest coordinate point radius, in pixels.

The continuous d3-scale that sizes coordinate points from pointSize, by name (e.g. "sqrt").

A left or right colorScalePosition fits the scale between everything above and below the map (a title, a top legend, a timeline), and starts it below the control buttons in the corner on its side, so the buttons never cover the scale’s top label.

Accessor function or string for the visualization's title.

Configuration

import {Geomap} from "@d3plus/core";

Extends Viz.

activefalse | function

The active callback function for highlighting shapes.

aggsobject

Custom aggregation functions keyed by data property.

ariaHiddenbooleanDefault true

Hides the SVG from assistive technology when true (aria-hidden).

arrowSizenumber | function

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), held to 12 pixels on wide links but never under one and a half times the stroke, so the head stays wider than its line.

arrowsboolean | "target" | "source" | "both" | functionDefault 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.

attributionstring | booleanDefault false

Sets 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 | function

Overrides 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 via createRoot(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.

attributionStylerecord

CSS key/value pairs used to style the attribution text.

backControlClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the back button, alongside its fixed back-control class. Setting this automatically disables d3plus's built-in inline backControlStyle default (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 | false

An object containing CSS key/value pairs that is used to style the back button. Passing false will remove all default styling. Automatically skipped (as if false) once .backControlClassName(...) is set, unless you've explicitly customized this yourself.

cachebooleanDefault true

Whether the chart uses the data cache that every chart on the page shares for the files fetched by data, links, nodes, topojson, and fitObject, 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 to true; false fetches on every load. clearDataCache() from @d3plus/data empties the cache.

classNamestring | array.<string> | undefined

CSS 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 own tooltipConfig.className.

colorstring | false | function

Defines 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 groupBy levels (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.

colorDefaultscolordefaultsconfig

Overrides the default colors used when assigning fills from data and choosing legible text colors: dark and light (the text colors picked for contrast against a background), missing (null/undefined values), on/off (true/false values), sequential (the anchor hue for magnitude ramps), and scale (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.

colorOrdinalbooleanDefault false

Treat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues.

colorScalestring | [colorscalefield, colorscalefield] | false | function

Defines 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 (see colorScaleConfig.bivariateBuckets, bivariateColors, and bivariateLabels). A row missing either value gets no colorScale color.

colorScaleConfigobject

A pass-through to the config method of ColorScale.

colorScaleMaxSizenumberDefault 600

The maximum pixel size for drawing the color scale: width for horizontal scales and height for vertical scales.

colorScalePaddingboolean | function

Tells 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 | function

Defines which side of the visualization to anchor the color scale. Acceptable values are "auto" (the default), "top", "bottom", "left", "right", and false. "auto" lets the chart choose: inside the chart when it fits there (see legendInset), 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. A false value will cause the color scale to not be displayed, but will still color shapes based on the scale.

configd3plusconfig

Methods that correspond to the key/value pairs and returns this class.

datastring | array.&lt;datapoint&gt; | object

The 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, and json.

If your data URL needs specific headers to be set, an Object with a "url" and "headers" (or any other fetch request 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 sets dataFormat; calling it with only data keeps the current dataFormat.

To re-fetch a URL on an interval and redraw when its data changes, set dataPollingInterval; each poll runs dataFormat.

Defaults to an empty array ([]).

dataCutoffnumberDefault 100

Maximum number of data points to render before downsampling.

dataFormatfunction

Transforms data before it is drawn: receives the loaded file (or the Array passed as data) and returns the rows to draw, or a config object holding them as data (its other keys are applied to the chart). Also set by data(url, format).

dataPollingIntervalnumber | falseDefault false

When data comes 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, with detectVisible, the chart) is hidden, and a failed request keeps the last data. Only data is polled. Defaults to false (load once).

depthnumber

Active depth level for nested groupings.

detectResizebooleanDefault true

If 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 the window.onresize event and adjust it's dimensions accordingly.

detectResizeDelaynumberDefault 400

When resizing the browser window, this is the millisecond delay to trigger the resize event.

detectVisiblebooleanDefault true

Toggles 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.

detectVisibleIntervalnumberDefault 1000

The interval, in milliseconds, for checking if the visualization is visible on the page. When detectVisible defers 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.

detectVisibleUnloadbooleanDefault true

With detectVisible on, 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 set false to keep them. Defaults to true.

discrete"x" | "y" | "radius" | "angle"

Sets orientation of main category axis.

durationnumberDefault 600

Default duration of transitions, in milliseconds.

facetstring | false | function

Splits 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 false to draw a single chart. See facetConfig for the grid's layout and shared scales.

facetConfigfacetconfig

Configuration 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 (default 20). - 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) => string function for each panel's title, or false to hide panel titles. - titleConfig: TextBox config for the panel titles (fontSize, fontWeight, fontColor, textAnchor, padding, …).

filterfalse | function

Predicate filtering which data points are included, or false to disable.

fitFilterstring | string[] | ((feature: object) => boolean)

Limits which features the initial fit frames: a single feature id, an array of ids, or a filter function over the features of fitObject (or of topojson when no fitObject is set).

fitKeystring

The key of the object in fitObject (its objects map) to fit. Defaults to the first object.

fitObjectstring | object | falseDefault false

The topojson the initial projection fits its extent to (fitExtent): a topojson object, or a filepath or URL to load. An optional formatting function, passed as a second argument, receives the loaded data and returns the final topojson object. Defaults to topojson, or to the coordinate points when there is none.

fontFamilystring | array.&lt;string&gt;

The font family used throughout the visualization.

groupBystring | function | array.&lt;string | function&gt;

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.

heightnumber

Overall height of the visualization in pixels.

hiddenColorcsscolor | function

Defines the color used for legend shapes when the corresponding grouping is hidden from display (by clicking on the legend).

hiddenOpacitynumber | function

Defines the opacity used for legend labels when the corresponding grouping is hidden from display (by clicking on the legend).

highlightfalse | function

Persistently 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), highlight is a standing state that survives pointer movement. Pass false to clear it.

hoverfalse | function

The hover callback function for highlighting shapes on mouseover.

hoverDistancenumberDefault 20

How 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; 0 turns it off.

keyboardNavbooleanDefault true

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; false removes the Tab stop.

keyboardNavConfigkeyboardnavconfig

Styles the focus ring around the mark keyboard navigation has focused (see KeyboardNavConfig).

labelstring | false | accessorfn | array.&lt;string&gt;

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" | function

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".

legendboolean | function

Whether 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 groupBy level. It hides when the chart's own labels already name every entry (see labelPosition), 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. false hides it, true always shows it, and a (config, data) => boolean function decides.

legendConfigobject

Configuration object passed to the legend's config method.

legendFilterInvertboolean | function

Defines 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).

legendHistorybooleanDefault true

Whether legend clicks go on the chart's Back history, so Back undoes them along with drill-downs, in order. Defaults to true; false leaves them off, so Back only steps out of drill-downs.

legendInsetboolean | functionDefault true

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.

legendInsetConfigobject

Style 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), and padding (space kept between the box and the chart's marks and edges, 10).

legendPaddingboolean | function

Tells 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 | function

Defines which side of the visualization to anchor the legend. Expected values are "auto" (the default), "top", "bottom", "left", "right", and false to hide it. "auto" lets the chart choose: inside the chart when it fits there (see legendInset), 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.

legendSortfunction

Comparator 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.

legendTooltiptooltipconfig

Configuration object for the legend tooltip.

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.

linkBundlebooleanDefault false

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.

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), and smoothing (true).

linkColorfalse | "source" | "target" | string | functionDefault false

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.

linkCurvenumberDefault 0.2

How far each link bows into an arc, as a share of the distance between its ends: 0 draws the plain great-circle path, and the default 0.2 lifts its middle by a fifth of that distance, to the left of the link's direction (a negative value bows to the right), so links running both ways between two places stay apart. On a flat map, a link whose great circle the projection cuts (across the antimeridian, or between "geoAlbersUsa"'s insets) is drawn on the screen between its two ends instead, bowed the same way, so it crosses the map rather than leaving by one edge. On a projection that clips to a circle (a globe, such as "geoOrthographic"), links follow the great circle without the lift, which would leave the sphere.

linkLabelstring | 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.

linkLabelConfiglinklabelconfig

Styles 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 as fontColor, fontFamily, or fontWeight.

linkSizenumber | functionDefault 2

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 at its ends, and its index in links.

linkSizeMaxnumberDefault 10

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.

linkSizeMinnumberDefault 1

The thinnest link, in pixels, when linkSize values differ.

linkSizeScalestringDefault sqrt

The type of continuous d3-scale used to size links (e.g. "linear", "sqrt", "log").

Lines between places on the map, each drawn along the great circle between its two ends (lifted into an arc by linkCurve). Each link's source and target is a [longitude, latitude] coordinate, or the id of a row in the data (or of a topojson feature): a row with a coordinate point links from that point, and any other id from the centroid of its topojson shape. Accepts an array of links, or a URL/filepath to load them from. linksFormat transforms them; a function passed as a second argument sets it.

linksFormatfunction

Network, Rings, Sankey, Chord, ArcDiagram, and Geomap: transforms links before they are drawn. The function receives the loaded file (or the Array passed as links) and returns the links Array. It runs when the chart renders, whichever order links and linksFormat are set in, and setting it again re-runs it on the next render. Passing a formatter as the second argument of links(url, format) sets it, and setting links alone keeps it.

loadingHTMLstring | function

The 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.

loadingMessagebooleanDefault true

Toggles the visibility of the status message that is displayed when loading AJAX requests and displaying errors.

localestring | object

The 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 | booleanDefault rgba(0, 0, 0, 0.05)

The color of the mask displayed underneath the status message when loading AJAX requests and displaying errors. Set to false to turn off the mask completely.

messageStylerecord

Defines the CSS style properties for the status message that is displayed when loading AJAX requests and displaying errors.

minimapbooleanDefault true

Shows 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 zoom is enabled.

minimapClassNamestring

An 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-label classes. Setting this automatically disables d3plus's built-in inline minimapStyle/minimapViewportStyle/minimapViewportStyleActive/minimapLabelStyle defaults (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 | false

An object containing CSS key/value pairs that is used to style the minimap's zoom-level text label (e.g. "2x"). Passing false will remove all default styling. Automatically skipped (as if false) once .minimapClassName(...) is set, unless you've explicitly customized this yourself.

minimapStylerecord | false

An object containing CSS key/value pairs that is used to style the minimap's outer box (the full-scene overview). Passing false will remove all default styling. Automatically skipped (as if false) once .minimapClassName(...) is set, unless you've explicitly customized this yourself.

minimapViewportStylerecord | false

An object containing CSS key/value pairs that is used to style the minimap's draggable viewport box in its resting state. Passing false will remove all default styling. Automatically skipped (as if false) once .minimapClassName(...) is set, unless you've explicitly customized this yourself.

minimapViewportStyleActiverecord | false

An object containing CSS key/value pairs that is used to style the minimap's draggable viewport box while it's being dragged. Passing false will remove all default styling. Automatically skipped (as if false) once .minimapClassName(...) is set, unless you've explicitly customized this yourself.

noDataHTMLstring | function

The 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.

noDataMessagebooleanDefault false

Toggles the visibility of the status message that is displayed when no data is supplied to the visualization.

How many links a point's or shape'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.

oceanstring | {light: string, dark: string}Default {light: "#d0cfd4", dark: "#222327"}

The color behind the map's shapes and tiles: any CSS color (including "transparent"), or a {light, dark} pair chosen by the chart's backdrop. Defaults to the default basemap's own water colors, which mask the tiles while they load.

onstring

Event listener for the specified event typenames. Mirrors the core d3-selection behavior.

parentunknown

Parent config used by the wrapper.

pointnumber[] | functionDefault "point"

Accessor function for each data point's coordinates, as [longitude, latitude] (d3's coordinate order), or one coordinate for every point. Defaults to each row's point key. Rows with a coordinate are drawn as points; the rest are matched to topojson shapes. A point the projection clips (on the far side of a globe, or outside "geoAlbersUsa"'s insets) is not drawn.

pointLabelConfigpointlabelconfig

Fits and styles circle labels (see labelPosition): fontMin is the smallest font size a label may shrink to inside its circle before "auto" moves it beside the circle (default 10, the size of the chart's smallest text, its total); fontSize is the size of a label beside its circle (default 11); padding is the space between the circle's edge and that label (default 3). 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.

pointSizenumber | functionDefault 1

Accessor (or constant) for the value that sizes each coordinate point, scaled by pointSizeScale onto [pointSizeMin, pointSizeMax] pixels.

pointSizeMaxnumberDefault 10

The largest coordinate point radius, in pixels.

pointSizeMinnumberDefault 5

The smallest coordinate point radius, in pixels.

pointSizeScalestringDefault linear

The continuous d3-scale that sizes coordinate points from pointSize, by name (e.g. "sqrt").

projectionstring | functionDefault geoMercator()

The map projection for the topojson and coordinate points: a projection function, or the name of one of the d3-geo projections or of geoAlbersUsaTerritories, geoMiller, geoRobinson and geoWinkel3 (e.g. "geoAlbersUsa"). Map tiles only line up with Mercator (the default), so any other projection turns tiles off.

projectionPaddingnumber | stringDefault {top: 20, right: 20, bottom: 20, left: 20}

The outer padding between the edge of the visualization and the map's shapes: one number for every side, or a CSS-style string (e.g. "20px 0 10px").

projectionRotate[number, number] | [number, number, number]

Rotates the projection, as d3-geo's projection.rotate angles [lambda, phi, gamma] in degrees. Turns tiles off, since rotated tiles no longer line up. On a projection that clips to a circle (a globe, such as "geoOrthographic"), dragging the map turns the globe under the pointer instead of panning it (the wheel, a pinch, and the zoom buttons still zoom), Shift and the arrow keys turn it 10° of longitude or latitude a press while the chart has keyboard focus (stopping at the poles, and easing unless reducedMotion is on), and the zoom controls' reset turns it back to this rotation. Reads back the rotation set here, as the zoom transform isn't read back either; projection().rotate() reads the globe's current one.

reducedMotion"auto" | booleanDefault auto

Whether 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). true always draws without motion: shapes, axes, legends, zooms, and fades jump straight to their final state. false always animates. duration keeps the value you set either way.

renderfunction

Draws 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".

saveControlbooleanDefault true

Shows 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.

saveControlClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the download button, alongside the fixed save-control/save-toggle classes. Setting this automatically disables d3plus's built-in inline saveControlStyle/saveControlStyleActive/saveControlStyleHover defaults (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.

saveControlConfigsavecontrolconfig

Options for the download button: the saved file's filename, the formats it offers, the background painted behind the chart, a callback, and html-to-image options for PNG and JPG files.

saveControlMenuClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the download menu, alongside its fixed d3plus-save-menu class (each item has the fixed save-menu-item class). Setting this automatically disables d3plus's built-in inline saveControlMenuStyle/saveControlMenuItemStyle/saveControlMenuItemStyleHover defaults (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 | false

An object containing CSS key/value pairs that is used to style each item in the download menu. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlMenuClassName(...) is set, unless you've explicitly customized this yourself.

saveControlMenuItemStyleHoverrecord | false

An object containing CSS key/value pairs that is used to style the download menu item under the pointer or keyboard focus. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlMenuClassName(...) is set, unless you've explicitly customized this yourself.

saveControlMenuStylerecord | false

An object containing CSS key/value pairs that is used to style the download menu: its background, border, shadow, and spacing. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlMenuClassName(...) is set, unless you've explicitly customized this yourself.

saveControlStylerecord | false

An object containing CSS key/value pairs that is used to style the download button. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlClassName(...) is set, unless you've explicitly customized this yourself.

saveControlStyleActiverecord | false

An object containing CSS key/value pairs that is used to style the download button while its menu is open. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlClassName(...) is set, unless you've explicitly customized this yourself.

saveControlStyleHoverrecord | falseDefault false

An object containing CSS key/value pairs that is used to style the download button on hover. Passing false will remove all default styling. Automatically skipped (as if false) once .saveControlClassName(...) is set, unless you've explicitly customized this yourself.

scrollContainerstring | htmlelement | window

If using scroll or visibility detection, this method allow a custom override of the element to which the scroll detection function gets attached.

Shows a top-left search button that expands into an input; typing highlights shapes whose label matches. On by default for every chart.

searchAccessorfunction

Resolves 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.

searchControlClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the search toggle button and input, alongside their fixed search-control classes. Setting this automatically disables d3plus's built-in inline searchControlStyle/searchControlStyleActive/searchControlStyleHover defaults (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 | false

An object containing CSS key/value pairs that is used to style the search toggle button. Passing false will remove all default styling. Automatically skipped (as if false) once .searchControlClassName(...) is set, unless you've explicitly customized this yourself.

searchControlStyleActiverecord | false

An object containing CSS key/value pairs that is used to style the search toggle button while open. Passing false will remove all default styling. Automatically skipped (as if false) once .searchControlClassName(...) is set, unless you've explicitly customized this yourself.

searchControlStyleHoverrecord | falseDefault false

An object containing CSS key/value pairs that is used to style the search toggle button on hover. Passing false will remove all default styling. Automatically skipped (as if false) once .searchControlClassName(...) is set, unless you've explicitly customized this yourself.

selectstring | htmlelement

The 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.

shapeConfigd3plusconfig

Configuration object with key/value pairs applied as method calls on each shape.

sizeLegendboolean | function

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.

sizeLegendConfigsizelegendconfig

Configuration 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 the size key when size is set to a string), shapeConfig, lineConfig, labelConfig, titleConfig, padding, lineLength, and labelPadding.

sizeLegendPosition"right" | "bottom"Default right

Which 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.

subtitlestring | function

Accessor function or string for the visualization's subtitle.

subtitleConfigrecord

Configuration object for the subtitle.

subtitlePaddingboolean | function

Tells 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.

svgDescstring

Accessible description applied to the root SVG (<desc>).

svgTitlestring

Accessible title applied to the root SVG (<title>).

tableViewbooleanDefault true

Enables 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.

tableViewClassNamestring

An additional CSS class name (or space-separated list of class names) applied to the <table> element the table-view toggle renders, alongside the fixed d3plus-table-view-table class. Lets a host page style the data table with its own table styling (Tailwind, Bootstrap, a design system) via descendant selectors.

tableViewControlClassNamestring

An 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-toggle classes. Setting this automatically disables d3plus's built-in inline tableViewControlStyle/tableViewControlStyleActive/tableViewControlStyleHover defaults (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 | false

An object containing CSS key/value pairs that is used to style the table-view toggle button. Passing false will remove all default styling. Automatically skipped (as if false) once .tableViewControlClassName(...) is set, unless you've explicitly customized this yourself.

tableViewControlStyleActiverecord | false

An 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 false will remove all default styling. Automatically skipped (as if false) once .tableViewControlClassName(...) is set, unless you've explicitly customized this yourself.

tableViewControlStyleHoverrecord | falseDefault false

An object containing CSS key/value pairs that is used to style the table-view toggle button on hover. Passing false will remove all default styling. Automatically skipped (as if false) once .tableViewControlClassName(...) is set, unless you've explicitly customized this yourself.

tableViewDownloadbooleanDefault true

Whether the data table shows a "download CSV" button, exporting its full (sorted, unpaginated) rows. On by default.

tableViewPageSizenumber | falseDefault 50

The 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.

tableViewSortbooleanDefault true

Whether the data table's column headers are clickable to sort (toggling asc/desc). On by default.

themethemesettingDefault auto

The 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 its base preset, e.g. {base: "dark", background: "#123", accent: "#ffd43b"}. Colors set elsewhere in the config win over the theme.

thresholdnumber | function

The 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 | function

Accessor for the value used in the threshold algorithm. A stacked Plot defaults to its stacked value.

thresholdNamestring | function

Label for the threshold group, or a (datum, index) accessor.

tileUrlstring | {light: string, dark: string}

The tile URL template, with {x}, {y}, and {z} placeholders, or a {light, dark} pair of templates chosen by the chart's backdrop. Defaults to Esri's light and dark Canvas basemaps. The tile credit in attribution follows the active URL unless the attribution was set by hand.

tilesbooleanDefault true

Whether to draw map tiles behind the shapes, from tileUrl. On by default; a non-Mercator projection or projectionRotate turns it off.

timestring | false | function

Accessor function or string key for the time dimension of each data point.

timeFilterfalse | function

Predicate filtering which time slices are shown, or false to disable. With time set and no timeFilter, a chart starts on its latest period, or on timelineDefault/timelineConfig.selection; setting it starts the chart (and its timeline) on the periods it keeps. A viewer's pick on the timeline replaces it.

timelinebooleanDefault true

Whether to show the timeline component.

timelineConfigtimelineconfig

Configuration object for the timeline.

timelineDefaultstring | date | array.&lt;string | date&gt;

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 | function

Tells 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 | function

Accessor function or string for the visualization's title.

titleConfigrecord

CSS style configuration for the title.

titlePaddingboolean | function

Tells 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 | function

Whether to show tooltips, or a (datum, index, {depth, maxDepth, legend}) accessor deciding per mark and legend entry. depth is the groupBy level (from 0) the hovered item stands for and maxDepth the deepest level, so depth === maxDepth keeps tooltips to the deepest level; legend is true for a legend entry. Defaults to true.

tooltipConfigtooltipconfigDefault linkTooltipConfig(viz)

Configuration for the tooltip component.

topojsonstring | object | falseDefault false

The topojson to draw as geographic paths: a topojson object, or a filepath or URL to load. topojsonFormat transforms it; a function passed as a second argument sets it.

topojsonFillCssColor | functionDefault "#f5f5f3"

The fill for topojson shapes that have no data (or no colorScale value): a CSS color or a function of the feature. Defaults to the theme's colorScale.missing when it sets one, else a quiet light gray, or its dark counterpart over a dark basemap.

topojsonFilterstring | string[] | ((feature: object) => boolean)Default !["010"].includes(d.id as string)

Limits which topojson features are drawn: a single feature id or an array of ids keeps only those features, and a filter function keeps the features it returns true for. To draw only the areas that have data, filter on the ids in your data (e.g. const ids = new Set(data.map(d => d.id)); then f => ids.has(f.id)). Defaults to a filter that hides Antarctica (id "010").

topojsonFormatfunction

Geomap: transforms topojson before it is drawn. The function receives the loaded file (or the object passed as topojson) and returns the topojson to draw. It runs when the chart renders, whichever order topojson and topojsonFormat are set in, and setting it again re-runs it on the next render. Passing a formatter as the second argument of topojson(url, format) sets it, and setting topojson alone keeps it.

topojsonIdstring | functionDefault "id"

The accessor, or key, that reads each topojson feature's id, which is matched against each data point's id (its groupBy value) to join the data to the map.

topojsonKeystring

The key of the object in topojson (its objects map) to draw. Defaults to the first object.

totalstring | boolean | function

Accessor function or string key for the total value displayed in the visualization.

totalConfigrecord

Configuration object for the total bar.

totalFormatfunction

Formatter function for the value in the total bar.

totalPaddingboolean | function

Tells 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.

translatefunction

Defines 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.

widthnumber

Overall width of the visualization in pixels.

zoombooleanDefault true

Enables pan and zoom: the mouse wheel or a pinch (see zoomScroll), a drag (see zoomDrag), a double-click (see zoomDoubleClick), the zoom-control buttons (see zoomControls), and the zoomIn, zoomOut, zoomReset, and zoomBrush methods. On by default for every chart; false turns all of them off.

zoomBrushboolean

Turns 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 zoom is off or before the chart first renders.

zoomBrushHandleSizenumberDefault 1

The pixel stroke-width of the zoom brush area.

zoomBrushHandleStylerecord | false

An object containing CSS key/value pairs that is used to style the outer handle area of the zoom brush. Passing false will remove all default styling.

zoomBrushSelectionStylerecord | false

An object containing CSS key/value pairs that is used to style the inner selection area of the zoom brush. Passing false will remove all default styling.

zoomControlClassNamestring

An 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 classes. Setting this automatically disables d3plus's built-in inline zoomControlStyle/zoomControlStyleActive/zoomControlStyleHover defaults (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.

zoomControlIconspartial

Overrides 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 | false

An object containing CSS key/value pairs that is used to style each zoom control button (.zoom-in, .zoom-out, .zoom-reset, and .zoom-brush). Passing false will remove all default styling. Automatically skipped (as if false) once .zoomControlClassName(...) is set, unless you've explicitly customized this yourself.

zoomControlStyleActiverecord | false

An 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). Passing false will remove all default styling. Automatically skipped (as if false) once .zoomControlClassName(...) is set, unless you've explicitly customized this yourself.

zoomControlStyleHoverrecord | falseDefault false

An 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). Passing false will remove all default styling. Automatically skipped (as if false) once .zoomControlClassName(...) is set, unless you've explicitly customized this yourself.

zoomControlsbooleanDefault true

Whether the zoom-control buttons (zoom in, zoom out, reset, and brush) show in the chart's top-right corner. false hides 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's zoomIn, zoomOut, zoomReset, and zoomBrush methods let buttons of your own drive it. Defaults to true.

zoomDoubleClick"in" | "reset" | falseDefault in

What 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, and false does nothing.

zoomDrag"pan" | "brush"Default pan

What a mouse drag on the chart does. "pan" (the default) pans it (see zoomPan). "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".

zoomFactornumberDefault 2

Multiplier applied to programmatic zoom steps.

zoomMaxnumber

Maximum zoom scale factor. Defaults to the scale at which the smallest shape fills the chart area.

zoomPaddingnumberDefault 20

A 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.

zoomPanbooleanDefault true

Whether panning (drag) is enabled while zoomed.

zoomScrollboolean | "modifier"Default modifier

Whether 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. true zooms on any wheel; false never does.