Choropleth
Examples
API Reference
Types come from the public API. A dash indicates no default is documented here.
ChoroplethChart props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
key | KeepAliveKey<K, Ends> | undefined | '' | The child's identity among its parent's children of one component, or a kept child's among its author's. The empty string by default. |
onEmit | Show type((events: { readonly _tag: "HoverChanged"; readonly index: number | null; } | { readonly _tag: "TransformChanged"; readonly scale: number; readonly x: number; readonly y: number; readonly dragging: boolean; }) => NoInfer<Msg> | undefined) | { readonly HoverChanged: (event: { readonly _tag: "HoverChanged"; readonly index: number | null; }) => NoInfer<Msg> | undefined; readonly TransformChanged: (event: { readonly _tag: "TransformChanged"; readonly scale: number; readonly x: number; readonly y: number; readonly dragging: boolean; }) => NoInfer<Msg> | undefined; } | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.data | Show type{ readonly type: "FeatureCollection"; readonly features: readonly { readonly type: "Feature"; readonly properties: { readonly [x: string]: Schema.Json; readonly id?: string | number; readonly name?: string; } | null; readonly geometry: ChoroplethGeometry; readonly id?: string | number; }[]; } | Required | |
props.id | string | Required | |
props.scale | number | — | |
props.transform | { readonly scale: number; readonly x: number; readonly y: number; } | Varies
| |
props.translate | readonly [number, number] | — | |
props.center | readonly [number, number] | — | |
props.animationDuration | number | — | |
props.aspectRatio | string | '16 / 9' | |
props.margin | Show type{ readonly bottom?: number; readonly left?: number; readonly right?: number; readonly top?: number; } | — | |
props.className | string | — | |
props.ariaLabel | string | 'Choropleth chart' | |
props.tooltip | Show type{ readonly prefix?: string; readonly backgroundColor?: string; readonly className?: string; readonly locale?: string; readonly maximumFractionDigits?: number; readonly panelStyle?: { readonly [x: string]: string | number; }; readonly nameKey?: string; readonly valueKey?: string; readonly valueLabel?: string; readonly suffix?: string; } | — | |
props.ariaDescription | string | — | |
props.revealSignature | string | — | |
props.enterTransition | Show type{ readonly delay?: number; readonly duration?: number; readonly ease?: string | readonly number[] | readonly (string | readonly number[])[]; readonly type?: unknown; readonly stiffness?: number; readonly damping?: number; readonly mass?: number; readonly bounce?: number; } | — | |
props.zoomEnabled | boolean | — | |
props.initialZoom | { readonly scale: number; readonly x: number; readonly y: number; } | — | |
props.transformRevision | number | — | |
props.hoverRevision | number | — | |
props.hoveredIndex | number | null | null | |
props.feature | Show type{ readonly fill?: string; readonly stroke?: string; readonly strokeWidth?: number; readonly fadedOpacity?: number; readonly colors?: readonly string[]; readonly patterns?: readonly ChoroplethSvgResource[]; readonly patternIds?: readonly (string | null)[]; } | — | |
props.graticule | Show type{ readonly stroke?: string; readonly strokeWidth?: number; readonly step?: readonly [number, number]; } | {} | |
props.zoomMin | number | — | |
props.zoomMax | number | — |