ChartMap

Data Display
stable

World map chart with two rendering modes: choropleth (country shapes coloured by value gradient) and flight-routes (curved Bezier arcs between country centroid pairs). Built on a 1000 × 500 SVG Mercator projection.

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamChartMapSchematic of the ChartMap component with 7 numbered internal parts. __header (title + subtitle) 0 500 1 2 3 4 5 6 7 ③ choropleth fill = color-mix; ⑤ Bezier arc (flight-routes); ④ no-data fill = defaultCountryFill
Anatomy of <origam-chart-map> — 7 internal parts. SVG canvas: 1000 × 500 Mercator projection. Two modes: choropleth gradient or flight-route Bezier arcs.
1.origam-chart-map
Root element. CSS grid: header / body areas. role="figure" + aria-label from title.
2.origam-chart__map-backdrop
rendering all country elements. Built from WORLD_GEOGRAPHIC_DATA projected to 1000 × 500 via Mercator.
3.origam-chart__map-country--has-data
BEM modifier for countries with data. cursor: pointer + brightness filter on hover. tabindex="0" + role="button".
4.origam-chart__map-country (no data)
Countries absent from the dataset. Fill = defaultCountryFill. cursor: default, not focusable.
5.origam-chart__map-route
Quadratic Bezier arc in flight-routes mode (M x1,y1 Q cx,cy x2,y2). Stroke width driven by log(value + 1) × 1.5.
6.origam-chart__map-node
Endpoint circles on each route, deduplicated. pointer-events: none.
7.origam-chart__map-gradient-legend
Inline SVG gradient bar with min/max labels. Bottom-left corner of the SVG. Visible when showLegend=true and mode=choropleth.

API

Props

All props accepted by this component, with their type, default value and description.

mode
TChartMapMode
'choropleth'
Rendering mode. 'choropleth' = country shapes filled by value gradient. 'flight-routes' = curved arcs between country centroid pairs.
colorRange
[TIntent | string, TIntent | string]
['info', 'danger']
Gradient endpoints for choropleth mode. First = min value colour; second = max value colour.
defaultCountryFill
TIntent | string
'rgba(0,0,0,0.08)'
Fill colour for countries absent from the dataset.
borderColor
TIntent | string
'rgba(0,0,0,0.2)'
Stroke colour applied to all country path outlines.
lineColor
'primary'
Default stroke colour for flight-route arcs. Overridden per route via datum.color.
nodeRadius
number
4
Radius in SVG pixels of the endpoint circles on each flight route.
routeCurvature
number
0.3
Bezier control-point offset as a fraction of the chord length [0..1]. 0 = straight line; 0.3 = gentle arc (default).
yAxisFormat
(value: number) => string
Value formatter used in tooltips and the choropleth gradient legend min/max labels.
series
required
Array<IChartSeries>
—
Data series — only series[0] is consumed. Choropleth: data items are IChartMapChoroplethDatum ({code, value, name?}). Flight-routes: items are IChartMapRouteDatum ({from, to, value?, color?}).
categories
Array<string>
title
string
Optional title rendered above the map.
subtitle
string
Optional subtitle rendered below the title.
showLegend
boolean
true
Renders the inline choropleth gradient legend in the SVG.
legendPosition
TChartLegendPosition
showTooltip
boolean
true
Shows a tooltip on hover/focus of a country or route.
animated
boolean
true
Fades data countries/routes in on first paint. Respects prefers-reduced-motion.
animationDuration
number
600
Entry animation duration in ms.
colorScheme
Array<TIntent | string>
aspectRatio
string
CSS aspect-ratio shortcut. When set, overrides height.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
height
number | string
Component height. Accepts a CSS length or a number (converted to px). Inherits from IDimensionProps.
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
rounded
boolean | number | string | TRounded | null | undefined
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
elevation
TElevation
bgColor
Background colour applied to the chart root.
fontSize
TFontSize
fontWeight
TFontWeight

API

Slots

Content slots exposed by this component.

#tooltip
Replaces the default tooltip body for a hovered country or route.
#empty
Shown when series is empty or has no renderable data.
#title
Replaces the default title/subtitle block.

API

Emits

Events emitted by this component.

@point-click
IChartPoint, MouseEvent | KeyboardEvent
Fired when the user clicks or keyboard-activates a country (choropleth) or a route (flight-routes).
@legend-click
IChartSeries, number
Fired when the user clicks a legend entry.
@series-toggle
IChartSeries, boolean
Fired after a legend click with the intended next visibility value.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Gap between header and body areas.
Internal padding of the chart root.
Background colour of the chart root.
Entry animation duration. Driven by animationDuration prop.
Stroke width of all country path outlines.
Font size of min/max labels on the gradient legend.
Fill colour of gradient legend labels.
Font size of the chart title.
Font weight of the chart title.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

figure
img
button

Keyboard interactions

Keyboard interactions
KeyAction
TabMoves focus through interactive countries (choropleth) or routes (flight-routes). Non-data countries have tabindex="-1" and are skipped.
Enter / SpaceActivates the focused country or route, firing the point-click emit.

Notes

  • Root has role="figure" with aria-label from the title prop (falls back to "map chart").
  • The SVG carries role="img" with a <title> and <desc> listing mode-specific counts (N countries or N routes).
  • Choropleth: each data country has aria-label "name: value". Non-data countries carry just the code as label.
  • Flight-routes: each arc has aria-label "FROM to TO: value".
  • Entry animations are disabled via @media (prefers-reduced-motion: reduce).

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Choropleth map

vue

Flight routes

vue

Custom fills

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.