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

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
requis
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

Emplacements de contenu exposés par ce composant.

#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

Événements émis par ce composant.

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

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

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

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

figure
img
button

Interactions clavier

Interactions clavier
ToucheAction
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).

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Choropleth map

vue

Flight routes

vue

Custom fills

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.