View as Markdown

API reference: @salmonui/charts/geo-map

GeoMapMarkersinterface

import type { GeoMapMarkers } from '@salmonui/charts/geo-map';
interface GeoMapMarkers<T = unknown> {
    readonly id?: string | undefined;
    readonly data: readonly T[];
    readonly latitudeField?: string | undefined;
    readonly longitudeField?: string | undefined;
    readonly shape?: GeoMapMarkerShape | undefined;
    readonly size?: number | undefined;
    readonly sizeField?: string | undefined;
    readonly sizeRange?: readonly [
        number,
        number
    ] | undefined;
    readonly color?: string | undefined;
    readonly colorField?: string | undefined;
    readonly labelField?: string | undefined;
    readonly label?: string | undefined;
    readonly render?: ((ctx: GeoMapMarkerContext<T>) => unknown) | undefined;
    readonly getStyle?: ((ctx: GeoMapMarkerContext<T>) => GeoMapStyle | undefined) | undefined;
    readonly cluster?: boolean | {
        readonly cell?: number | undefined;
        readonly expand?: 'zoom' | 'spider' | 'none' | undefined;
        readonly render?: ((ctx: GeoMapClusterContext) => unknown) | undefined;
    } | undefined;
    readonly draggable?: boolean | undefined;
}
GeoMapMarkers members (16)
NameSignatureDescription
idoptionalreadonly id?: string | undefined;
datareadonly data: readonly T[];
latitudeFieldoptionalreadonly latitudeField?: string | undefined;
longitudeFieldoptionalreadonly longitudeField?: string | undefined;
shapeoptionalreadonly shape?: GeoMapMarkerShape | undefined;
sizeoptionalreadonly size?: number | undefined;

Marker size in px (default 12) or a field scaled into sizeRange.

sizeFieldoptionalreadonly sizeField?: string | undefined;
sizeRangeoptionalreadonly sizeRange?: readonly [ number, number ] | undefined;
coloroptionalreadonly color?: string | undefined;
colorFieldoptionalreadonly colorField?: string | undefined;

Field holding a data color per marker.

labelFieldoptionalreadonly labelField?: string | undefined;

Accessible and tooltip name.

labeloptionalreadonly label?: string | undefined;

Legend text of the group.

renderoptionalreadonly render?: ((ctx: GeoMapMarkerContext<T>) => unknown) | undefined;

Custom marker content (an image, an icon) centered on the position.

getStyleoptionalreadonly getStyle?: ((ctx: GeoMapMarkerContext<T>) => GeoMapStyle | undefined) | undefined;
clusteroptionalreadonly cluster?: boolean | { readonly cell?: number | undefined; readonly expand?: 'zoom' | 'spider' | 'none' | undefined; readonly render?: ((ctx: GeoMapClusterContext) => unknown) | undefined; } | undefined;

Grid clustering (recomputed per zoom level). A clicked cluster zooms in (expand: 'zoom', default), fans its markers out around it with connector lines ('spider', a second click or Escape closes it) or does nothing ('none').

draggableoptionalreadonly draggable?: boolean | undefined;

Markers move by pointer drag and by arrow keys on their focusable handle; onMarkerMove reports the drop.