ValyroUI Русская версия

Map Layer Story

Map story: each step toggles data layers and frames a region, no WebGL. Pro · Charts and analytics › Analysis and scenarios

A story told on a map: each step narrates, turns data layers on (shaded countries, highlights, points) and frames a region; the reader moves with the buttons, the step list or the keyboard. The map is plain SVG — no WebGL — with a text version of every layer and the attribution always in view.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add map-layer-story
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { MapLayerStory } from 'valyro-ui-pro';

Props

PropTypeDefault
layers *MapStoryLayer[]Data layers the steps turn on and off.
steps *MapStoryStep[]The story, in order: narration, layers and the region to frame.
stepnumberIndex of the current step.
defaultStepnumber0Initial step when uncontrolled. Default 0.
onStepChange(step: number) => voidCalled when the reader moves to another step.
attribution *ReactNodeMap credit, always visible: base map and data licences.
bounds[west: number, south: number, east: number, north: number]Region of the first frame when a step sets none: [west, south, east, north]. Default: the world.
textRowsnumber8Rows of the text version per layer before "and N more". Default 8.
loadingbooleanfalseThe data is loading: skeleton.
errorReactNodeLoading failed: shown instead of the story.
titleReactNodeHeading. Default: labels.title.
headingLevel2 | 3 | 4 | 53Level of the heading (default 3).
localestringBCP 47 locale for country names and numbers; defaults to the ThemeProvider's.
labelsPartial<MapLayerStoryLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Variance Explainer · Next: Calendar View · All Charts and analytics