/** * This package provides functions commonly used when building visualizations. * * @remarks * This package is mainly used internally by other `@gooddata/sdk-ui-*` packages, and we do not recommend using * it directly outside of GoodData because its API can change at any time. * * @packageDocumentation */ import { ContentRect } from 'react-measure'; import { DataViewFacade } from '@gooddata/sdk-ui'; import { IColor } from '@gooddata/sdk-model'; import { IColorAssignment } from '@gooddata/sdk-ui'; import { IColorPalette } from '@gooddata/sdk-model'; import { IColorPaletteItem } from '@gooddata/sdk-model'; import { IDataView } from '@gooddata/sdk-backend-spi'; import { IExecutionDefinition } from '@gooddata/sdk-model'; import { IExecutionFactory } from '@gooddata/sdk-backend-spi'; import { IHeaderPredicate } from '@gooddata/sdk-ui'; import { IMappingHeader } from '@gooddata/sdk-ui'; import { IMeasure } from '@gooddata/sdk-model'; import { IntlShape } from 'react-intl'; import { IPreparedExecution } from '@gooddata/sdk-backend-spi'; import { IRgbColorValue } from '@gooddata/sdk-model'; import { ISeparators } from '@gooddata/sdk-model'; import { ITheme } from '@gooddata/sdk-model'; import { JSX } from 'react/jsx-runtime'; import { NamedExoticComponent } from 'react'; import { ReactElement } from 'react'; import { Rect } from 'react-measure'; import { SVGAttributes } from 'react'; /** * @internal */ export declare class AttributeColorStrategy extends ColorStrategy { protected createColorAssignment(colorPalette: IColorPalette, colorMapping: IColorMapping[] | undefined, viewByAttribute: any, stackByAttribute: any, dv: DataViewFacade): ICreateColorAssignmentReturnValue; } /** * Lookup-key helpers shared by `buildLookupTable` and chart-family hover-time * key builders. Both sides must produce identical strings. * * Format: `${displayFormId}:${uri}` per attribute, joined by `|` after * lexicographic sort. The `displayFormId` is always the idRef identifier — * uriRef-backed display forms are skipped at the tooltip-execution-planning * step (in each chart family's adapter), so they never reach this key builder. * Name is omitted: the backend substitutes null/empty names with localized * strings only on the display side, so including them here causes * lookup-vs-hover mismatches on null/empty rows. */ /** * @internal */ export declare function buildKeySegment(displayFormId: string, uri: string): string; /** * Build a per-data-point lookup keyed by `${displayFormId}:${uri}` segments * (joined by `|`, sorted). Iteration is orientation-agnostic via slices/series. * Each reference is tagged with a {@link ResolvedReference} status; localized * placeholder strings are applied later, at the render site. * * @internal */ export declare function buildLookupTable(dataView: IDataView, meta: ITooltipExecutionMeta, separators?: ISeparators): Map; /** * Returns `null` when the content has no references or all references are * already in the chart (resolvable from drill data without a secondary call). * Otherwise returns the batched execution plus per-reference bundles for the * fan-out fallback (see {@link ITooltipExecution}). * * @internal */ export declare function buildTooltipExecution(executionFactory: IExecutionFactory, chartDefinition: IExecutionDefinition, tooltipContent: string, options?: IBuildTooltipExecutionOptions): ITooltipExecution | null; /** * Variant of {@link buildTooltipExecution} gated by the customTooltip config: this is the * canonical "should a tooltip execution exist at all" check (enabled + non-empty string * content), so call sites don't re-implement it. Returns `undefined` when the tooltip is * off, has no usable content, or {@link buildTooltipExecution} itself yields nothing. * * @internal */ export declare function buildTooltipExecutionFromConfig(executionFactory: IExecutionFactory, chartDefinition: IExecutionDefinition, customTooltip: ICustomTooltipConfig | undefined, options?: IBuildTooltipExecutionOptions): ITooltipExecution | undefined; /** * Builds the localized placeholder strings for the non-value reference states, * shared by every tooltip consumer (Highcharts, geo) so the wording and the * message ids live in one place. `intl` is optional — the Highcharts tooltip * formatter receives it optionally — and falls back to English. * * @internal */ export declare function buildTooltipLocalizedStrings(intl?: IntlShape): ITooltipLocalizedStrings; /** * @internal */ export declare type ButtonsOrientationType = "upDown" | "leftRight"; /** * @internal * Calculate widget height and font size for Kpi's and Headlines * when enableCompactSize is set to true. */ export declare function calculateHeadlineHeightFontSize(secondaryItem?: boolean, clientHeight?: number): { height: number | undefined; fontSize: number | undefined; }; /** * @public */ export declare type ChartFillType = "solid" | "pattern" | "outline"; /** * @internal */ export declare function ColorLegend({ title, data, format, numericSymbols, size, position }: IColorLegendProps): JSX.Element | null; /** * @internal */ export declare abstract class ColorStrategy implements IColorStrategy { protected palette: string[]; protected fullColorAssignment: IColorAssignment[]; protected outputColorAssignment: IColorAssignment[]; protected theme?: ITheme; protected referenceTheme?: ITheme; protected clusterTitle?: string; protected enableContrastSafeDerivedColors?: boolean; constructor(colorPalette: IColorPalette, colorMapping: IColorMapping[] | undefined, viewByAttribute: any, stackByAttribute: any, dv: DataViewFacade, theme?: ITheme, clusterTitle?: string, enableContrastSafeDerivedColors?: boolean, referenceTheme?: ITheme); getColorByIndex(index: number): string; getColorAssignment(): IColorAssignment[]; getFullColorAssignment(): IColorAssignment[]; protected createPalette(colorPalette: IColorPalette, colorAssignment: IColorAssignment[], _viewByAttribute: any, _stackByAttribute: any): string[]; protected abstract createColorAssignment(colorPalette: IColorPalette, colorMapping: IColorMapping[] | undefined, viewByAttribute: any, stackByAttribute: any, dv: DataViewFacade, clusterTitle?: string): ICreateColorAssignmentReturnValue; } /** * @internal */ export declare const ColorUtils: { getColorByGuid: typeof getColorByGuid; getColorMappingPredicate: typeof getColorMappingPredicate; }; /** * Merge order matters: in-chart values override external ones, because the * in-chart value is what the user already sees on the rendered point/feature. * If a tooltip references the same id from both, showing the external (fetched) * value would let it drift from what the chart pixel displays. * * @internal */ export declare function composeCustomTooltipSectionHtml(content: string, inChartValues: IResolvedReferenceValues, externalValues: IResolvedReferenceValues, localizedStrings: ITooltipLocalizedStrings): string; /** * Names of the custom (non built-in) point-shape symbols to register on the Highcharts renderer. * * @internal */ export declare const CUSTOM_POINT_SHAPES: string[]; /** * Placement of the custom tooltip section relative to the default tooltip content. * * @alpha */ export declare type CustomTooltipPlacement = "above" | "below" | "replace"; /** * @internal */ export declare const DEFAULT_LEGEND_CONFIG: { enabled: boolean; position: PositionType; }; /** * This function will mutate the incoming data view and replace headers with empty name with a fallback * string. This is so that we can show "(empty)" or similar strings in the UI. * * @param dataView - view to mutate * @param emptyHeaderString - value to use for empty strings * @deprecated try to avoid using this function and handle empty headers when displaying them * @public */ export declare function fixEmptyHeaderItems(dataView: IDataView, emptyHeaderString: string): void; /** * @internal */ export declare const FLUID_LEGEND_THRESHOLD = 768; /** * @internal */ export declare const FluidLegend: NamedExoticComponent; /** * @internal */ export declare function formatLegendLabel(value: number, format: string | undefined, diff: number, numericSymbols: string[]): string; /** * @internal */ export declare function getAttributeColorAssignment(attribute: any, colorPalette: IColorPalette, colorMapping: IColorMapping[] | undefined, dv: DataViewFacade): IColorAssignment[]; /** * @internal */ export declare function getColorByGuid(colorPalette: IColorPalette, guid: string, index: number): IRgbColorValue; /** * @internal */ export declare function getColorFromMapping(mappingHeader: IMappingHeader, colorMapping: IColorMapping[] | undefined, dv: DataViewFacade): IColor | undefined; /** * Creates new predicate for mapping colors to chart entities: * * - if attribute header, URI is expected to match testValue * - otherwise (attr or measure descriptor) expecting local identifier match * * @param testValue - right hand side to test against * @public */ export declare function getColorMappingPredicate(testValue: string): IHeaderPredicate; /** * @internal */ export declare function getColorPaletteFromColors(colors: string[]): IColorPalette; /** * Computes WCAG contrast ratio between two colors. * Accepts any web color supported by `getRgbFromWebColor` (hex, rgb/rgba, named colors). * * @internal */ export declare function getContrastRatio(colorA: string, colorB: string): number; /** * @internal * Provides responsive class for headline/kpi component based on its width and state of secondary item */ export declare const getHeadlineResponsiveClassName: (width: number | undefined, isShortened?: boolean | undefined) => string; /** * @internal */ export declare function getLegendDetails(legendPosition: PositionType, responsive: boolean | "autoPositionWithPopup", options: ILegendDetailOptions, respectLegendPosition?: boolean): ILegendDetails | null; /** * Source: * http://stackoverflow.com/questions/5560248/programmatically-lighten-or-darken-a-hex-color-or-rgb-and-blend-colors * * @internal */ export declare function getLighterColor(color: string, percent: number): string; /** * @internal */ export declare function getLighterColorFromRGB(color: IRgbColorValue, percent: number): IRgbColorValue; /** * Returns pattern fill by index. * * @param index - Index of pattern fill. When the index is a number, it returns a pattern matching * the index number of the pattern array. When the index is out of bounds, the pattern fill is repeated. * When the index is a pattern name, the matching pattern is returned. If the pattern is not found, * the first pattern is returned. * * @internal */ export declare function getPatternFill(index: number | PatternFillName): IPatternOptionsObject; /** * Returns pattern fill by index. When index is out of bounds, the pattern fill is repeated. * @param index - index of pattern fill * * @internal */ export declare function getPatternFillByIndex(index: number): IPatternOptionsObject; /** * Returns pattern fill by key. * @param name - name of a pattern fill * * @internal */ export declare function getPatternFillByName(name: PatternFillName): IPatternOptionsObject | undefined; /** * Returns a CSS `clip-path` polygon for a polygonal point shape (including the built-in triangles), * or `undefined` when the shape has no polygon geometry (circle/square/diamond) and is handled by * plain CSS elsewhere. * * @internal */ export declare function getPointShapeClipPath(pointShape: string | undefined): string | undefined; /** * Builds a Highcharts SVG marker path (array of path segments) for a custom point shape within the * bounding box defined by `x`, `y`, `width`, `height`. Returns `undefined` for unknown / built-in * shapes so callers can defer to Highcharts. * * @internal */ export declare function getPointShapeSvgPath(pointShape: string, x: number, y: number, width: number, height: number): Array> | undefined; /** * @internal */ export declare function getRgbFromWebColor(input: string): IRgbColorValue | null; /** * @internal */ export declare function getRgbString(color: IColorPaletteItem): string; /** * @internal */ export declare function getRgbStringFromRGB(color: IRgbColorValue): string; /** * Applies color properties preferences. If palette is specified and non-empty, it is returned. Otherwise * non-empty colors are transformed into a palette and returned. If all else fails, default color palette * is returned * * @internal */ export declare function getValidColorPalette(colors?: string[], colorPalette?: IColorPalette): IColorPalette; /** * @internal */ export declare function HeadlinePagination({ renderSecondaryItem, renderTertiaryItem, accessibilityConfig }: IHeadlinePaginationProps): JSX.Element; /** * @internal */ export declare const HeatmapLegend: NamedExoticComponent; /** * @internal */ export declare interface IBuildTooltipExecutionOptions { /** * LocalIdentifiers from `definition.attributes` to use as the row dimension, * in the desired order. Omit to use all attributes in definition order * (Highcharts default). Geo passes an explicit list to drop position attrs. */ slicingAttributeLocalIds?: readonly string[]; } /** * Chart fill config is used to customize the chart fill. * * @internal */ export declare interface IChartFillConfig { /** * Type of the chart fill. */ type?: ChartFillType; /** * Custom mapping of selected pattern fill by measure. * The value is map of measure local identifiers per pattern name. * The property is used when type == "pattern". * When insight has a measure that is not mapped, the pattern will be assigned according to the * measure index, the same way as if no measure would be mapped. */ measureToPatternName?: Record; } /** * @internal */ export declare interface IColorLegendItem { range: IRange; color: string; } /** * @internal */ export declare interface IColorLegendProps { data: IColorLegendItem[]; numericSymbols: string[]; position: string; size?: IColorLegendSize; format?: string; title?: string; } /** * @internal */ export declare type IColorLegendSize = "large" | "medium" | "small"; /** * @public */ export declare interface IColorMapping { /** * Optional stable identifier of the mapped item. * * @remarks * Consumers may use this to build stable fingerprints without depending on predicate function identity. * * @public */ id?: string; /** * Predicate function which will be called for each entity that will be charted. * * @remarks * If matched, the `color` will assigned to that entity when it is rendered (be it as a bar, column, point, slice etc) */ predicate: IHeaderPredicate; /** * Color to assign. * * @remarks * It is possible to assign color from colorPalette or provide custom color as RGB code. */ color: IColor; } /** * @internal */ export declare interface IColorStrategy { getColorByIndex(index: number): string; getColorAssignment(): IColorAssignment[]; getFullColorAssignment(): IColorAssignment[]; } /** * @internal */ export declare interface ICreateColorAssignmentReturnValue { fullColorAssignment: IColorAssignment[]; outputColorAssignment?: IColorAssignment[]; } /** * Custom tooltip configuration. * * @remarks * Allows users to define a custom section in the visualization tooltip using Markdown * with metric/attribute references that resolve dynamically per hovered data point. * * @alpha */ export declare interface ICustomTooltipConfig { /** * Whether the custom tooltip is enabled. */ enabled?: boolean; /** * Markdown content for the custom tooltip section. * * @remarks * Supports a subset of Markdown: * * - Headings: `#` through `####` * - Bold (`**text**`), italic (`*text*`) * - Unordered lists (`- item`) and ordered lists (`1. item`) — not nested * - Images (`![alt](url)`) — `https:`, `http:`, and `data:image/...` URLs only * - Links (`[text](url)`) — `http(s)` URLs only; rendered as anchors opening in * a new tab. End-users can only reach them when the tooltip stays open long * enough to interact with (accessible/sticky Highcharts tooltips, geo popups). * - Horizontal rules (`---`) * - Backslash escapes (`\*`, `\_`, `\[`, `\!`, etc.) to render a metacharacter * as literal text instead of formatting * * Not supported: tables, code blocks, blockquotes, nested lists, raw HTML. * * Also accepts metric/attribute references (\{metric/id\}, \{label/id\}) * that resolve dynamically per hovered data point. Resolved values are * automatically backslash-escaped, so data containing markdown metacharacters * renders as literal text — no manual escaping is required. * * Use display-form identifiers (NOT parent attribute identifiers) inside * `{label/id}`. An attribute id renders correctly for attributes that are * already in the chart, but it cannot be fetched as a label for external * attributes — and a single such ref causes the secondary tooltip fetch * to fail backend-side, dropping every other external ref alongside it. * * @see https://www.gooddata.com/docs/cloud/create-visualizations/custom-tooltips/ */ content?: string; /** * Where to place the custom section relative to the default tooltip content. * * @defaultValue "above" */ placement?: CustomTooltipPlacement; } /** * @internal */ export declare interface IFluidLegendProps { containerWidth: number; series: IPushpinCategoryLegendItem[]; enableBorderRadius?: boolean | ItemBorderRadiusPredicate; onItemClick?(item: IPushpinCategoryLegendItem): void; chartFill?: ChartFillType; } /** * Category legend item for geo charts. * * @remarks * Represents a single item in the category legend, typically corresponding to * a segment value with its associated color and visibility state. * * @internal */ export declare interface IGeoCategoryLegendItem { type: string; name: string; uri: string; color?: string; legendIndex: number; isVisible: boolean; } /** * @internal */ export declare interface IGeoChartLegendData { colorData?: IColorLegendItem[]; sizeData?: number[]; } /** * @internal */ export declare type IGroupedSeries = IGroupedSeriesItem[]; /** * @internal */ export declare type IGroupedSeriesItem = ISeriesItem | ILegendGroup; /** * @internal */ export declare interface IHeadlinePaginationProps { renderSecondaryItem: () => ReactElement; renderTertiaryItem: () => ReactElement; accessibilityConfig?: { nextAriaLabel?: string; previousAriaLabel?: string; }; } /** * @internal */ export declare interface IHeatmapLegendItem { type: string; range: IRange; isVisible?: boolean; color: string; legendIndex: number; anomaly?: boolean; } /** * @internal */ export declare interface IHeatmapLegendProps { series: IHeatmapLegendItem[]; size: IColorLegendSize; format?: string; numericSymbols: string[]; position: string; title?: string; } /** * @internal */ export declare interface ILegendDetailOptions { contentRect?: ContentRect; showFluidLegend?: boolean; isHeatmap?: boolean; legendLabel?: string; } /** * @internal */ export declare interface ILegendDetails { name?: string; position: PositionType; maxRows?: number; renderPopUp?: boolean; } /** * @internal */ export declare type ILegendGroup = Omit & { type: typeof LEGEND_GROUP; items: ISeriesItem[]; }; /** * @internal */ export declare interface ILegendOptions { enabled: boolean; toggleEnabled: boolean; position: PositionType; format: string; items: LegendOptionsItemType[]; responsive?: boolean | "autoPositionWithPopup"; enableBorderRadius?: boolean | ItemBorderRadiusPredicate; seriesMapper?: (visibleSeries: any) => any; } /** * @internal */ export declare interface ILegendProps { legendLabel?: string; maximumRows?: number; responsive?: boolean | "autoPositionWithPopup"; legendItemsEnabled?: any[]; height?: number; position: string; heatmapLegend?: boolean; series: ISeriesItem[]; seriesMapper?: (visibleSeries: any) => any; format?: string; locale?: string; showFluidLegend?: boolean; enableBorderRadius?: boolean | ItemBorderRadiusPredicate; chartFill?: ChartFillType; onItemClick(item: ISeriesItem): void; validateOverHeight(legendClient: Rect): void; contentDimensions: { width: number; height: number; }; containerId?: string; } /** * @internal */ export declare interface IPagingProps { page: number; pagesCount: number; showNextPage(): void; showPrevPage(): void; buttonsOrientation?: ButtonsOrientationType; } /** * @internal */ export declare type IPatternFill = (typeof PATTERN_FILLS)[number]; /** * @internal */ export declare interface IPatternFillProps { patternFill: IPatternOptionsObject; } /** * @internal */ export declare interface IPatternObject { pattern: IPatternOptionsObject; } /** * @internal */ export declare interface IPatternOptionsObject { path: SVGAttributes; width: number; height: number; color?: string; opacity?: number; } /** * @internal */ export declare interface IPopUpLegendProps { series: ISeriesItem[]; onLegendItemClick: (item: ISeriesItem) => void; name?: string; maxRows?: number; enableBorderRadius?: boolean | ItemBorderRadiusPredicate; containerId: string; customComponent?: ReactElement | null; customComponentName?: string; chartFill?: ChartFillType; } /** * @deprecated Use IGeoCategoryLegendItem instead. * @internal */ export declare type IPushpinCategoryLegendItem = IGeoCategoryLegendItem; /** * @internal */ export declare interface IRange { from: number; to: number; } /** * Lookup of resolved reference statuses keyed by `metric/id` or `label/id`. * * @internal */ export declare interface IResolvedReferenceValues { [referenceKey: string]: ResolvedReference | undefined; } /** * @internal */ export declare function isCustomPalette(palette: IColorPalette): boolean; /** * @internal */ export declare type ISeriesItem = ISeriesItemMetric | ISeriesItemAxisIndicator | ISeriesItemSeparator; /** * @internal */ export declare type ISeriesItemAxisIndicator = { type: typeof LEGEND_AXIS_INDICATOR; data?: string[]; labelKey: string; }; /** * @internal */ export declare type ISeriesItemMetric = { type: string; isVisible?: boolean; name?: string; color?: string | IPatternObject; legendIndex: number; pointShape?: string; yAxis?: number; anomaly?: boolean; }; /** * @internal */ export declare type ISeriesItemSeparator = { type: typeof LEGEND_SEPARATOR; }; /** * @internal */ export declare function isLegendGroup(item: IGroupedSeriesItem): item is ILegendGroup; /** * Test whether the color is a pattern object. * @param color - tested color object * * @internal */ export declare function isPatternObject(color: string | IPatternObject | undefined): color is IPatternObject; /** * @internal */ export declare function isSeriesItemAxisIndicator(item: ISeriesItem): item is ISeriesItemAxisIndicator; /** * @internal */ export declare function isSeriesItemMetric(item: ISeriesItem): item is ISeriesItemMetric; /** * @internal */ export declare function isSeriesItemSeparator(item: ISeriesItem): item is ISeriesItemSeparator; /** * @internal */ export declare interface IStaticLegendProps { containerHeight: number; position: string; series: ISeriesItem[]; enableBorderRadius?: boolean | ItemBorderRadiusPredicate; shouldFillAvailableSpace?: boolean; label?: string; buttonOrientation?: ButtonsOrientationType; paginationHeight?: number; customComponent?: ReactElement | null; isLabelVisible?: boolean; onItemClick?(item: ISeriesItem): void; onPageChanged?: (page: number) => void; chartFill?: ChartFillType; } /** * @internal */ export declare function isValidMappedColor(colorItem: IColor | null | undefined, colorPalette: IColorPalette): boolean; /** * @internal */ export declare type ItemBorderRadiusPredicate = (item: any) => boolean; /** * A tooltip execution plan: one batched execution for all external references, * plus per-reference bundles used as an isolation fallback. When the batch * rejects (e.g. a single invalid reference 400s the whole AFM), the consumer * re-runs the per-reference bundles so one bad reference can't suppress the * rest. Both Highcharts and geo fan out this way. `perRef` is a thunk: the * bundles are built lazily, only when the batch fails, so the success path * pays nothing for it. * * @internal */ export declare interface ITooltipExecution { batch: ITooltipExecutionBundle; perRef: () => readonly ITooltipExecutionBundle[]; } /** * Prepared tooltip execution paired with the meta needed to interpret its result. * Carry them together — meta from one call mis-interprets results from another. * * @internal */ export declare interface ITooltipExecutionBundle { execution: IPreparedExecution; meta: ITooltipExecutionMeta; } /** * Maps used by `buildLookupTable` to interpret the execution result. * * @internal */ export declare interface ITooltipExecutionMeta { /** value localId → count localId, for "Multiple items" detection. */ labelCountMap: Record; /** tooltip metric localId → LDM measure identifier. */ measureIdMap: Record; /** label value localId → LDM label identifier. */ labelIdMap: Record; } /** * Localized placeholder strings for the non-value reference states. Built once * at the render site (where `intl` is available) and threaded into * `resolveReferences`, so reference resolution stays free of i18n concerns. * * @internal */ export declare interface ITooltipLocalizedStrings { readonly noData: string; readonly multipleItems: string; readonly noFetch: string; } /** * One tooltip execution plan paired with a caller-owned key and the context * that travels with the built lookup. * * @internal */ export declare interface ITooltipLookupExecutionEntry { key: string; execution: ITooltipExecution; context: TContext; } /** * Built lookup for one tooltip execution entry (per-entry fan-out, mirroring * the single-execution variant). * * @internal */ export declare interface ITooltipLookupExecutionResult { lookup: Map; context: TContext; } /** * @internal */ export declare function joinKeySegments(parts: readonly string[]): string; /** * Builds the `label/` lookup key for a label reference. See {@link metricKey}. * * @internal */ export declare const labelKey: (id: string) => string; /** * Maps a label/attribute display value to a {@link ResolvedReference} status: * `null` / `undefined` / empty string → empty ("No data"); otherwise the value. * Shared by every tooltip resolver so empty-value handling can't drift between * the in-chart and external paths. The count-based "multiple" case stays with * the caller (only the lookup builder knows the per-row count). * * @internal */ export declare function labelReference(value: string | number | null | undefined): ResolvedReference; /** * @internal */ export declare const Legend: NamedExoticComponent; /** * @internal */ export declare const LEGEND_AXIS_INDICATOR = "legendAxisIndicator"; /** * @internal */ export declare const LEGEND_GROUP = "legend-group"; /** * @internal */ export declare const LEGEND_SEPARATOR = "legendSeparator"; /** * @internal */ export declare type LegendOptionsItemType = ISeriesItemMetric | IHeatmapLegendItem; /** * @internal */ export declare const LegendPosition: { [name: string]: PositionType; }; /** * @internal */ export declare function markdownToHtml(markdown: string): string; /** * Maps a raw measure value to a {@link ResolvedReference} status: `null`/ * `undefined` → empty ("No data"); otherwise the formatted (or stringified) * value. Shared by every tooltip resolver so the value→status mapping has a * single home. Callers whose source can yield non-numeric / non-finite values * (e.g. geo feature payloads) normalize those to `null` before calling. * * @internal */ export declare function measureReference(rawValue: number | string | null | undefined, format: string | undefined, separators?: ISeparators): ResolvedReference; /** * Builds the `metric/` lookup key for a metric reference. A reference key * has exactly two shapes ({@link metricKey}, {@link labelKey}); keeping the * convention here makes it the single source for both the write sites and the * read in `resolveReferences` (which routes the parsed prefix through these * helpers rather than rebuilding the key). * * @internal */ export declare const metricKey: (id: string) => string; /** * @internal */ export declare function normalizeColorToRGB(color: string): string; /** * @internal */ export declare function Paging({ page, pagesCount, buttonsOrientation, showNextPage, showPrevPage }: IPagingProps): ReactElement; /** * @internal */ export declare function parseRGBColorCode(color: string): { R: number; G: number; B: number; }; /** * @internal */ export declare function parseRGBString(color: string): IRgbColorValue | null; /** * SVG patterns used in series.color.pattern Highcharts config. * * The array index matches the color palette index. * * The name is used in visualisation property that maps selected pattern to a metric, i.e., changing it is * considered a breaking change. * * When a pattern "strokeWidth" is undefined, \{ "stroke": "none", "fill": currentColor \} is assumed. * * @internal */ export declare const PATTERN_FILLS: { name: string; pattern: IPatternOptionsObject; }[]; /** * @internal */ export declare function PatternFill({ patternFill }: IPatternFillProps): JSX.Element; /** * @internal */ export declare type PatternFillName = (typeof PATTERN_FILLS)[number]["name"]; /** * Polygonal point-shape geometry shared by chart markers and legend icons. * * @remarks * Highcharts ships only five marker symbols ("circle", "square", "diamond", "triangle", * "triangle-down"). Any other symbol name handed to a marker silently falls back to "circle". * To support the full documented set of point shapes we describe each polygonal shape as a polygon * in a normalized 0..1 box (origin top-left, y pointing down) and derive both the Highcharts SVG * marker path and the legend CSS `clip-path` from the same geometry so chart markers and legend * icons always match. The built-in "triangle" and "triangle-down" are included for the legend * `clip-path` only — they are never registered as custom Highcharts symbols. * * @internal */ export declare const POINT_SHAPE_POLYGONS: Record>; /** * @internal */ export declare function PopUpLegend({ name, maxRows, enableBorderRadius, series, onLegendItemClick, containerId, customComponent, customComponentName, chartFill }: IPopUpLegendProps): JSX.Element; /** * TODO: rename * @internal */ export declare type PositionType = "left" | "right" | "top" | "bottom" | "auto"; /** * Resolution outcome for a single `{metric/id}` / `{label/id}` reference at a * data point. A discriminated union so the renderer maps each state to its own * localized message instead of collapsing them: `empty` → "(No data)", * `multiple` → "(Multiple items)". A reference that couldn't be resolved at all * is represented by *absence* from the lookup (`undefined`), which the renderer * maps to "(Data could not be retrieved)" — there is no explicit error variant. * * @internal */ export declare type ResolvedReference = { readonly kind: "value"; readonly text: string; } | { readonly kind: "empty"; } | { readonly kind: "multiple"; }; /** * Returns the LDM identifier the measure ultimately resolves to. * * - Simple measures: the identifier of the underlying catalog metric * - Derived measures (PoP, previous period): follows the chain to the master * - Arithmetic measures (and anything without an identifier ref): undefined * * @internal */ export declare function resolveMeasureLdmIdentifier(measure: IMeasure, allMeasures: IMeasure[]): string | undefined; /** * Substitutes `{metric/id}` and `{label/id}` references in markdown content * with resolved values from the lookup table. * * Substituted values come from data and may contain markdown metacharacters * (e.g., `*`, `_`, `[`). They are backslash-escaped so the downstream * markdown-to-HTML conversion renders them as literal text rather than as * unintended formatting. `markdownToHtml` understands the backslash escapes. * * @param content - Markdown content with reference placeholders * @param values - Lookup of `metric/id` and `label/id` keys to resolved statuses. * Keys must use a lowercase prefix; LDM identifiers are case-sensitive. * @param strings - Localized placeholders for the non-value states (no data, * multiple items, could-not-retrieve). * * @internal */ export declare function resolveReferences(content: string, values: IResolvedReferenceValues, strings: ITooltipLocalizedStrings): string; /** * @internal * Check if Kpi's and Headlines should display pagination according to widget height. */ export declare const shouldRenderPagination: (enableCompactSize: boolean, width: number, height: number) => boolean; /** * @internal */ export declare function shouldShowFluid(documentObj: Document): boolean; /** * @internal */ export declare const StaticLegend: NamedExoticComponent; /** * @internal */ export declare const SupportedLegendPositions: PositionType[]; /** * Single-execution variant for chart families that have one tooltip execution * per chart (e.g. Highcharts). Returns `undefined` while no execution is * provided or before the first result lands; consumers handle that as "no * external values". * * @internal */ export declare function useTooltipLookup(execution: ITooltipExecution | undefined, separators?: ISeparators): Map | undefined; /** * Multi-execution variant for chart families that key tooltip executions per * sub-target (e.g. geo per-layer). Each entry runs through the same batch → * per-reference fan-out as the single-execution variant. `context` travels with * the built lookup so downstream code needn't defensively check for it. * * @internal */ export declare function useTooltipLookupExecutions(entries: readonly ITooltipLookupExecutionEntry[], separators?: ISeparators): Map>; /** * Returns the value if it is non-empty or a fallback text. * * @param value - value to handle * @param emptyValueText - text to display if value is empty * @internal */ export declare function valueWithEmptyHandling(value: string | undefined | null, emptyValueText: string): string; export { }