ChartMap
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.
<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.
- modeTChartMapMode'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.
- defaultCountryFillTIntent | string'rgba(0,0,0,0.08)'
- Fill colour for countries absent from the dataset.
- borderColorTIntent | string'rgba(0,0,0,0.2)'
- Stroke colour applied to all country path outlines.
- Default stroke colour for flight-route arcs. Overridden per route via datum.color.
- nodeRadiusnumber4
- Radius in SVG pixels of the endpoint circles on each flight route.
- routeCurvaturenumber0.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.
- seriesrequisArray<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?}).
- categoriesArray<string>
- titlestring
- Optional title rendered above the map.
- subtitlestring
- Optional subtitle rendered below the title.
- showLegendbooleantrue
- Renders the inline choropleth gradient legend in the SVG.
- legendPositionTChartLegendPosition
- showTooltipbooleantrue
- Shows a tooltip on hover/focus of a country or route.
- animatedbooleantrue
- Fades data countries/routes in on first paint. Respects prefers-reduced-motion.
- animationDurationnumber600
- Entry animation duration in ms.
- colorSchemeArray<TIntent | string>
- aspectRatiostring
- CSS aspect-ratio shortcut. When set, overrides height.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- heightnumber | string
- Component height. Accepts a CSS length or a number (converted to px). Inherits from IDimensionProps.
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- bgColor
- Background colour applied to the chart root.
- fontSizeTFontSize
- fontWeightTFontWeight
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-clickIChartPoint, MouseEvent | KeyboardEvent
- Fired when the user clicks or keyboard-activates a country (choropleth) or a route (flight-routes).
- @legend-clickIChartSeries, number
- Fired when the user clicks a legend entry.
- @series-toggleIChartSeries, 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
Interactions clavier
| Touche | Action |
|---|---|
| Tab | Moves focus through interactive countries (choropleth) or routes (flight-routes). Non-data countries have tabindex="-1" and are skipped. |
| Enter / Space | Activates 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
Flight routes
Custom fills
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.
Chart
Universal chart component supporting bar, line, area, pie, donut, scatter and more.
ChartBullet
Bullet chart — compact KPI display with range bands, actual-value bar and target tick.
ChartHeatmap
Rectangular heatmap chart with colour-mix gradient cells.
ChartHoneycomb
Hexagonal tile-map chart for categorical or heatmap data.
ChartLegend
Standalone series-legend component shared by all chart families.