View as Markdown

API reference: @salmonui/charts/geo-map

GeoMapLabelsinterface

import type { GeoMapLabels } from '@salmonui/charts/geo-map';
interface GeoMapLabels {
    readonly field?: string | undefined;
    readonly overflow?: 'none' | 'hide' | 'trim' | undefined;
    readonly overlap?: 'hide' | 'show' | undefined;
    readonly render?: ((ctx: {
        readonly key: string;
        readonly name: string;
        readonly text: string;
        readonly datum: unknown;
    }) => unknown) | undefined;
}
GeoMapLabels members (4)
NameSignatureDescription
fieldoptionalreadonly field?: string | undefined;

Field of the joined data row or of the feature properties (default the shape name).

overflowoptionalreadonly overflow?: 'none' | 'hide' | 'trim' | undefined;

'hide' drops labels wider than their shape, 'trim' shortens them with an ellipsis.

overlapoptionalreadonly overlap?: 'hide' | 'show' | undefined;

'hide' drops a label that overlaps an earlier one (default).

renderoptionalreadonly render?: ((ctx: { readonly key: string; readonly name: string; readonly text: string; readonly datum: unknown; }) => unknown) | undefined;

Custom label content centered on the shape (replaces the text).