import { Coloring } from '../../model/models/coloring.models'; import { ClusterSortConfig } from '../../sort/models/cluster-config.models'; /** * The grouping configuration for a dimension. * Tells the library how to bucket fact sheets when this dimension is chosen as a clustering axis. * `StringAttribute` handles single/multi-value string fields; `StringListAttribute` handles array-typed fields. * `LocationAttribute` handles LOCATION fields by bucketing fact sheets into a 3-level * geographic hierarchy: continent (L1) → country (L2) → city (L3). */ export declare type ClusterConfig = StringAttributeClusterConfig | StringListAttributeClusterConfig | LocationAttributeClusterConfig; export declare enum ClusterStrategyType { StringAttribute = "string", StringListAttribute = "stringList", LocationAttribute = "location" } export interface StringListAttributeClusterConfig { strategy: ClusterStrategyType.StringListAttribute; attribute: string; multiplicity?: MultiplicityClusterConfig; color: ClusterColorConfig; label: ClusterLabelConfig; sort: ClusterSortConfig; } /** * Clusters fact sheets by a LOCATION field using a 3-level geographic hierarchy: * - L1: continent (derived from country code via a built-in mapping) * - L2: country * - L3: city * * The `level` controls which tier of the hierarchy is used as the cluster key. * A fact sheet with no location value maps to the n/a bucket. */ export interface LocationAttributeClusterConfig { strategy: ClusterStrategyType.LocationAttribute; attribute: string; level: LocationClusterLevel; sort: ClusterSortConfig; } /** * The level of the geographic hierarchy to cluster by. * - `continent` — L1: groups all fact sheets in the same continent together * - `country` — L2: groups by country name * - `city` — L3: groups by city name (falls back to n/a when city is absent) */ export declare type LocationClusterLevel = 'continent' | 'country' | 'city'; export interface StringAttributeClusterConfig { strategy: ClusterStrategyType.StringAttribute; attribute: string; multiplicity: MultiplicityClusterConfig; color?: ClusterColorConfig; label?: ClusterLabelConfig; sort?: ClusterSortConfig; } export declare type MultiplicityClusterConfig = SingleMultiplicityClusterConfig | MultiMultiplicityClusterConfig | LifecycleClusterConfig; export interface SingleMultiplicityClusterConfig { type: 'single'; } export interface LifecycleClusterConfig { type: 'lifecycle'; } export interface MultiMultiplicityClusterConfig { type: 'multi'; constrainingAttributes?: string[]; } export declare type ClusterColorConfig = FixedClusterColor | LookupClusterColor; export interface FixedClusterColor { type: 'fixed'; color: Coloring; } export interface LookupClusterColor { type: 'lookup'; colors: Record; } export declare type ClusterLabelConfig = LookupClusterLabel; export interface LookupClusterLabel { type: 'lookup'; labels: Record; }