Allow additional map-type-specific properties and methods.
Ordered thematic layer stack (bottom → top).
ID of the wrapper container element.
Logical map height in pixels. 0 = auto (85% of width).
A function asked for the height (px) of the map at every build, e.g. to fill the window on a phone:
height(() => (compact ? window.innerHeight - 60 : undefined)). A result that is not a positive
number leaves the height automatic.
How the layout adapts to the room the map has. The room is the width of the map's container, not the
device: a map in a small iframe is as compact as one on a phone. 'auto' follows the container (and
rebuilds the map when it is resized across the breakpoint, 768 px); 'desktop' and 'compact' fix the
profile. The compact layout draws the map at its real size (readable text, bigger buttons), puts the
legends under the map, and lets a single finger scroll the page. See docs/responsive.md.
Where the legends go in the compact layout: 'below' the map (default), or 'keep' where legend() puts them.
Base URL used to fetch NUTS2JSON boundary geometries (and, for insets, whatever base URL is set on the owning map, unless overridden per-inset). Setting this on the top-level map also propagates it to all insets.
URL of the world boundaries topojson file used by geo('WORLD') maps. Not part of
Nuts2json (a separate, bundled eurostat-map asset), so it is independent of
nuts2jsonBaseURL. Setting this on the top-level map also propagates it to all insets.
Animate the map view to a position, using a smooth "glide" zoom. Takes the same {x, y, z}
as position(); omitted values keep their current value. Pass null to glide back to the
initial, unzoomed view. Does nothing before the map is built.
Optionaloptions: {Optionalduration?: numberAnimation length in ms. 0 jumps straight to the view.
Optionalease?: (t: number) => numberEasing function, t in [0, 1].
OptionalonEnd?: (map: MapInstance) => voidCalled once the animation has finished (not if it is interrupted by another zoom).
Map title.
Map subtitle.
Footnote text shown at the bottom of the map. Defaults to Credits, which reveals the boundary attribution on hover or focus.
Tooltip text for the footnote. The default Credits also shows boundary attribution.
Wrap footnote text at this many characters.
Get or set statistical data configuration.
map.stat() → returns the default stat configmap.stat(config) → sets the default stat configmap.stat('v1') → returns the stat config for key 'v1'map.stat('v1', config) → sets the stat config for key 'v1'Legacy compatibility overload for composition channels. Preferred: pass category fields directly inside config.
OptionalcategoryCodes: string[]OptionalcategoryLabels: string[]OptionalcategoryColors: string[]OptionaltotalCode: stringGet or set visual encodings that map named stats to visual variables.
Returns the stat name for an encoding channel, or fallback when unset.
Optionalfallback: stringReturns stat names for an encoding channel (stats or single stat).
Optionalfallback: string[]Returns the concrete statData key for a channel/category combination.
OptionalcategoryCode: stringOptionalfallbackStat: stringReturns the StatData source bound to a channel/category.
OptionalcategoryCode: stringOptionalfallbackStat: stringReturns unit text through encoding lookup.
OptionalcategoryCode: stringOptionalfallbackStat: stringForce-update the legend after data or style changes.
Get or set ranked bar chart configuration (choropleth-classified map types only). Pass false to remove it. Independent of the legend - has its own positioning and can render into an entirely different container/SVG to the legend's.
Force-update the ranked bar chart after data or style changes.
Get or set tooltip configuration.
D3 zoom translate extent (pan boundaries), as [[x0, y0], [x1, y1]].
Grid cartogram settings (shape, margins, cell padding, layout positions).
Inset map configurations. Pass a named preset string, or a custom array, or false to disable. Passing true is an alias for 'default'.
Position [x, y] of the box containing the default/named-preset insets layout.
Default D3 zoom scale extent for insets. null disables zoom on insets.
Show/hide the graticule (coordinate grid lines).
Show/hide the coastal margin shadow effect.
Light (white) borders: national, Kosovo, regional and disputed borders are drawn white, and
national borders lose their halo. Adds the em--borders-light class to the map svg and every
inset's; can be switched on an already-built map. Default false (dark borders).
Dark mode: dark sea and land fills, with region borders, coastlines and the Kosovo border
adjusted so they keep their hierarchy on the dark land. Titles, legends, labels and tooltips
are not restyled. Adds the em--dark class to the map svg and every inset's; can be switched
on an already-built map. Combines with lightBorders(). Default false.
Coastal margin appearance settings.
Show/hide placename labels loaded from the placenames layer.
Get or set label configuration for country names, statistical values, etc.
Annotation configuration, rendered via the d3-svg-annotation library.
annotations is an array of d3-svg-annotation annotation objects; each object's type
may be one of 'annotationLabel' (default), 'annotationCallout', 'annotationCalloutRect',
'annotationCalloutCircle', 'annotationXYThreshold', resolved to the matching d3-svg-annotation
function internally.
Scalebar configuration.
Scalebar visibility.
Scalebar position [x, y] in pixels.
Show the Eurostat logo.
Show the Eurostat ribbon banner.
Returns the D3 selection of the SVG element.
Remove a custom point location marker by id.
Remove all custom point location markers.
Get or replace all custom point location markers.
Redraw custom point location markers.
Custom geometry filtering function.
Grid cartogram enabled or disabled.
Toggle background map rendering (sea, country boundaries, etc.).
Shows or hides the background map on an already-built instance to match the current backgroundMap() value, without a full rebuild - draws it on demand if it wasn't already built. No-op for grid cartograms.
Minimap (globe inset showing current viewport) configuration.
Show/hide inset map toggle button. When enabled and no insets are configured, the map automatically uses insets('default').
Show/hide legend toggle button.
Filter function for placename labels.
Use a separate header section for titles.
Use a separate footer section for footnotes.
Padding between the map and footer in pixels.
Padding between the header and map in pixels.
Position adjustment for map title: [x, y]
Position adjustment for map subtitle: [x, y]
Position adjustment for footnote text: [x, y]
Position adjustment for Eurostat logo: [x, y]
Position adjustment for ribbon banner: [x, y]
Position adjustment for zoom buttons: [x, y]
Position adjustment for insets button: [x, y]
Position adjustment for legend button: [x, y]
Pointer hover color for NUTS regions.
Show the link to the remote Eurostat statistical dataset.
Pattern fill (hatching/dots/crosshatch) overlays for specific regions.
Dorling simulation settings.
Called when the user finishes a zoom gesture.
Called continuously while the user is zooming.
Called when the pointer enters a NUTS region.
Called when the pointer moves over a NUTS region.
Called when the pointer leaves a NUTS region.
Called when a NUTS region is clicked.
Callback fired once after the map has fully built (geo + stat data loaded). Receives the map instance as its only argument.
Re-fetches geo data and rebuilds map geometry.
Re-fetches all stat datasets and refreshes the map.
Re-applies classification and styling from currently loaded data.
Updates data classification (class breaks, thresholds).
Re-applies visual styling (colors, symbol sizes).
Recalculates header/footer layout and resizes the SVG.
Exports the map as a PNG file and triggers a browser download.
Optionalwidth: number
Output width in pixels. Defaults to SVG width.
Optionalheight: number
Output height in pixels. Defaults to SVG height.
Optionalfilename: string
Download filename without extension.
Sets map attributes from URL parameters. Supported params: w, h, x, y, z, s, lvl, time, proj, geo, ny, language, numberOfClasses
SVG filter/pattern definition function for fill patterns.
Returns a Map of region id -> projected [x, y] centroid coordinate pair.
Optionalref: string | numberOptionalconfig: Omit<LayerConfig, "legend" | "type"> & {Optionalconfig: LayerConfigGet or set legend configuration. Pass false to remove the legend.
Get or set legend configuration. Pass false to remove the legend.
Base fill color for regions with no statistical data.
Base fill color for regions with no statistical data.
Pie-specific rendering settings, independent of compositionSettings.
Optionaltype?: "ring" | "pie" | "flag" | "segment" | "radar" | "agepyramid" | "halftone"OptionalradarValueMode?: "share" | "absolute"Radar wedge radius mode: share within symbol (default) or absolute values across map.
OptionalminSize?: numberOptionalmaxSize?: numberOptionalstrokeFill?: stringOptionalstrokeWidth?: numberOptionalreverseOrder?: booleanOptionalorder?: string[]Category code order for composition rendering.
OptionalstripesOrientation?: numberOptionaloffsetAngle?: numberOptionalagePyramidHeightFactor?: numberOptionalotherColor?: stringOptionalotherText?: stringOptionaltype?: "ring" | "pie" | "flag" | "segment" | "radar" | "agepyramid" | "halftone"OptionalradarValueMode?: "share" | "absolute"Radar wedge radius mode: share within symbol (default) or absolute values across map.
OptionalminSize?: numberOptionalmaxSize?: numberOptionalstrokeFill?: stringOptionalstrokeWidth?: numberOptionalreverseOrder?: booleanOptionalorder?: string[]Category code order for composition rendering.
OptionalstripesOrientation?: numberOptionaloffsetAngle?: numberOptionalagePyramidHeightFactor?: numberOptionalotherColor?: stringOptionalotherText?: stringEnable Dorling cartogram layout for proportional symbol maps.
Enable Dorling cartogram layout for proportional symbol maps.
Config.
OptionalcategoryParameter: string
Category parameter.
OptionalcategoryCodes: string[]
Category codes.
OptionalcategoryLabels: string[]
Category labels.
OptionalcategoryColors: string[]
Category colors.
OptionaltotalCode: string
Total code.
Pie map type.