import { Config } from '../dimension/models/config.models'; import { AttributeMap } from '../model/models/attribute-map.models'; import { Item } from '../model/models/item.models'; import { CurrencyTools, Legend } from '../model/models/legend.models'; import { ViewAggregation } from '../view/models/aggregation.models'; import { ViewRequirements } from './models/view-requirements.models'; /** * Builds the legend and determines the view aggregation strategy for a given configuration. * For single-select/lifecycle fields the legend is derived from the specification's value definitions; * for numeric/cost fields the full dataset is scanned to derive value ranges. * * This is step 1 of the two-step colouring process. Pass the returned `legend` and * `viewAggregation` to {@link applyViewToItem} in step 2. * * @param data - The full set of normalised fact sheets (needed to derive numeric ranges) * @param config - Configuration with `clustering` and `view` settings * @param adjustedViewAggregation - Optional override replacing the aggregation defined in the view spec * @param currencyTools - Optional currency formatting/conversion tools (required for cost-type fields) * @returns `ViewRequirements` containing `legend` (lookup map), `legendItems` (display list), and `viewAggregation` */ export declare function computeLegendAndViewAggregation(data: AttributeMap[], config: Config, adjustedViewAggregation?: ViewAggregation, currencyTools?: CurrencyTools): ViewRequirements; /** * Assigns a colour/view-index to a single fact sheet based on the legend and view configuration. * This is step 2 of the two-step colouring process (after {@link computeLegendAndViewAggregation}). * * When no legend or view is configured, returns a null-view item (viewIndex -1, no colour). * * @param attributes - A single normalised fact sheet (`AttributeMap`) * @param clusterIds - The cluster ID tuples this fact sheet belongs to (extracted from `Cluster.id`) * @param config - Configuration with `clustering` and `view` settings * @param legend - The legend lookup map from `ViewRequirements.legend` (or null if no view) * @param viewAggregation - The aggregation strategy from `ViewRequirements.viewAggregation` * @returns An `Item` with `viewIndex`, `viewValue`, `color`, and the original `attributes` */ export declare function applyViewToItem(attributes: AttributeMap, clusterIds: string[][], config: Config, legend: Legend | null, viewAggregation: ViewAggregation | undefined): Item;