import { type IAttribute, type IAttributeOrMeasure, type IColorPalette, type INullableFilter, type ISortItem, type GeoLayerType as ModelGeoLayerType } from "@gooddata/sdk-model"; import { type IColorMapping, type ICustomTooltipConfig } from "@gooddata/sdk-ui-vis-commons"; /** * Layer types supported by GeoChart. * * @remarks * GeoChart supports two types of geographic layers: * - `"pushpin"` - Point data visualization using markers/pins * - `"area"` - Region visualization using filled polygons (choropleth maps) * * @public */ export type GeoLayerType = ModelGeoLayerType; /** * Per-layer configuration for GeoChart layers. * * @remarks * This config is intentionally limited to options that are meaningful on a per-layer basis. * It is **not** the same as {@link IGeoChartConfig} (which contains global/map-level settings). * * @public */ export interface IGeoLayerConfig { /** * Optional color palette override for this layer. */ colorPalette?: IColorPalette; /** * Optional custom color mappings override for this layer. */ colorMapping?: IColorMapping[]; /** * Optional custom tooltip configuration for this layer. * * @remarks * Each layer renders its own custom tooltip. When omitted, the layer has no * custom tooltip section (it does not inherit another layer's configuration). * * @alpha */ customTooltip?: ICustomTooltipConfig; } /** * Base interface for all geo layer configurations. * * @remarks * This interface defines the common properties shared by all layer types. * Each layer operates independently with its own data execution, allowing * different data sources, filters, and configurations per layer. * * @public */ export interface IGeoLayerBase { /** * Unique identifier for this layer. * * @remarks * Used internally to track layer state and for debugging purposes. * Each layer in a GeoChart must have a unique id. */ id: string; /** * Human-readable name for the layer. * * @remarks * Optional display name that may be shown in legends or tooltips. * If not provided, the layer id is used. */ name?: string; /** * Layer type discriminator. * * @remarks * Determines the rendering mode for this layer. * Use `"pushpin"` for point/marker data or `"area"` for region/polygon data. */ type: GeoLayerType; /** * Color measure or attribute for this layer. * * @remarks * When a measure is provided, colors are determined by the measure values * using a color scale (gradient). When an attribute is provided, colors * are assigned categorically based on attribute values. * * For pushpin layers, this affects the fill color of the markers. * For area layers, this affects the fill color of the regions. */ color?: IAttributeOrMeasure; /** * Segment attribute for categorization. * * @remarks * Groups data points by the specified attribute, creating separate * visual categories with distinct colors. When segmentBy is used, * a category legend is displayed. * * For pushpin layers, different segments get different marker colors. * For area layers, different segments get different fill colors. */ segmentBy?: IAttribute; /** * Optional per-layer configuration. * * @remarks * This config is intentionally limited to layer-scoped options only. * * @public */ config?: IGeoLayerConfig; /** * Filters specific to this layer. * * @remarks * Array of filters applied only to this layer's data execution. * * These filters are applied **before** any global/component-level filters (e.g. `GeoChart.filters`). * When both layer and global filters are provided, the global filters are applied *after* the layer * filters and therefore take precedence for filter types with “last wins” merge rules (for example * date filters for the same date dataset or measure value filters for the same measure). Other filter * types may accumulate according to SDK merge semantics. */ filters?: INullableFilter[]; /** * Sorting for this layer. * * @remarks * Defines how data points are sorted for this layer. * Sorting can affect tooltip display order and rendering priority. */ sortBy?: ISortItem[]; /** * Tooltip text attribute for this layer. * * @remarks * An attribute whose values are displayed in tooltips when hovering over * data points in this layer. If not provided, falls back to the unified * config's `tooltipText` setting. */ tooltipText?: IAttribute; } /** * Pushpin layer configuration. * * @remarks * A pushpin layer renders point data on the map as markers/pins. * It requires separate latitude and longitude attributes to specify geographic coordinates. * * Features: * - **Size scaling**: Use the `size` property to vary marker sizes based on a measure * - **Color coding**: Use the `color` property for measure-based gradients or attribute-based categories * - **Segmentation**: Use `segmentBy` to group markers by category with distinct colors * - **Clustering**: Configure point clustering in the chart config for better performance with many points * @public */ export interface IGeoLayerPushpin extends IGeoLayerBase { type: "pushpin"; /** * Latitude attribute. * * @remarks * An attribute containing latitude values (decimal degrees, -90 to 90). * Must be used together with `longitude`. */ latitude: IAttribute; /** * Longitude attribute. * * @remarks * An attribute containing longitude values (decimal degrees, -180 to 180). * Must be used together with `latitude`. */ longitude: IAttribute; /** * Size measure for pushpins. * * @remarks * When provided, marker sizes are scaled based on the measure values. * Larger values result in larger markers. The scaling range can be * configured via `config.points.minSize` and `config.points.maxSize`. * * If not provided, all markers are rendered at a uniform size. */ size?: IAttributeOrMeasure; /** * Additional measures displayed in pushpin tooltips. * * @remarks * When provided, these measures are displayed in tooltips without * affecting pushpin size or color. */ measures?: IAttributeOrMeasure[]; /** * Geo icon attribute for pushpins. * * @remarks * An attribute whose display form type is `GDC.geo.icon`. When provided * together with `shapeType: "iconByValue"`, each pushpin's icon is resolved * from the attribute value for that row. * * This attribute is required when `config.points.shapeType` is `"iconByValue"`. * If it is missing, the icon marker may not render. */ geoIcon?: IAttribute; } /** * Area layer configuration. * * @remarks * An area layer renders geographic regions (countries, states, provinces, etc.) * as filled polygons, creating a choropleth map visualization. * * The area attribute should reference a geographic attribute whose values * map to known geographic regions. The component uses geocoding to match * attribute values to geographic boundaries. * * Supported region types include: * - Countries (by name or ISO code) * - States/Provinces * - Administrative regions * - Custom geographic boundaries * * Features: * - **Color-coded regions**: Use the `color` property for data-driven fill colors * - **Segmentation**: Use `segmentBy` to categorize regions * - **Opacity control**: Configure fill opacity via chart config * @public */ export interface IGeoLayerArea extends IGeoLayerBase { type: "area"; /** * Geographic area attribute. * * @remarks * An attribute whose values represent geographic regions (countries, states, * provinces, etc.). The attribute values are geocoded to match geographic * boundaries for polygon rendering. * * For best results, use standardized region names or ISO codes that can * be reliably matched to geographic boundaries. */ area: IAttribute; } /** * Union type for all layer configurations. * * @remarks * Use this type when working with layers that could be either pushpin or area type. * Use the {@link isGeoLayerPushpin} and {@link isGeoLayerArea} type guards to * narrow the type in conditional logic. * @public */ export type IGeoLayer = IGeoLayerPushpin | IGeoLayerArea; /** * Type guard for pushpin layer. * * @remarks * Use this function to narrow an {@link IGeoLayer} to {@link IGeoLayerPushpin} * when you need to access pushpin-specific properties like `latitude`, * `longitude`, or `size`. * * @param layer - The layer to check * @returns true if the layer is a pushpin layer, false otherwise * @public */ export declare function isGeoLayerPushpin(layer: IGeoLayer): layer is IGeoLayerPushpin; /** * Type guard for area layer. * * @remarks * Use this function to narrow an {@link IGeoLayer} to {@link IGeoLayerArea} * when you need to access area-specific properties like `area`. * * @param layer - The layer to check * @returns true if the layer is an area layer, false otherwise * @public */ export declare function isGeoLayerArea(layer: IGeoLayer): layer is IGeoLayerArea; //# sourceMappingURL=index.d.ts.map