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
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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.
- 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.
- seriesrequiredArray<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
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-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.
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
Keyboard interactions
| Key | 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).
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
Flight routes
Custom fills
Ecosystem
Family
Components from the same folder that share conventions and often compose together.
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.