View as Markdown

API reference: @salmonui/charts/geo-map

GeoMapLayercomponent

import { GeoMapLayer } from '@salmonui/charts/geo-map';
function GeoMapLayer<T = unknown>(_props: GeoMapLayer<T>): null;

interface GeoMapLayer<T = unknown> {
    readonly id?: string | undefined;
    readonly kind?: 'base' | 'overlay' | undefined;
    readonly name?: string | undefined;
    readonly shapes?: GeoJSON | undefined;
    readonly geometry?: 'geographic' | 'planar' | undefined;
    readonly data?: readonly T[] | undefined;
    readonly dataKey?: string | undefined;
    readonly shapeKey?: string | undefined;
    readonly color?: string | undefined;
    readonly palette?: readonly string[] | undefined;
    readonly colorScale?: GeoMapColorScale | undefined;
    readonly getShapeStyle?: ((ctx: GeoMapShapeContext<T>) => GeoMapStyle | undefined) | undefined;
    readonly markers?: GeoMapMarkers | readonly GeoMapMarkers[] | undefined;
    readonly bubbles?: GeoMapBubbles | undefined;
    readonly labels?: GeoMapLabels | boolean | undefined;
    readonly routes?: readonly GeoMapRoute[] | undefined;
    readonly polygons?: readonly GeoMapPolygon[] | undefined;
    readonly tiles?: GeoMapTiles | undefined;
}

A layer as a child of GeoMap (same fields as a layers entry). Renders nothing: GeoMap reads the props of its direct children.