import type { ContextCallbackParams, DatumCallbackParams, HighlightState, Styler } from '../../chart/callbackOptions'; import type { AgChartLabelOptions } from '../../chart/labelOptions'; import type { AgSeriesTooltip, AgSeriesTooltipRendererParams } from '../../chart/tooltipOptions'; import type { ContextDefault, DatumDefault, DatumKey, GeoJSON, Opacity, PixelSize } from '../../chart/types'; import type { AgColorScale, LineDashOptions, StrokeOptions } from '../cartesian/commonOptions'; import type { AgBaseSeriesOptions, AgBaseSeriesThemeableOptions, AgMultiSeriesHighlightOptions } from '../seriesOptions'; export type AgMapLineSeriesTooltipRendererParams = AgSeriesTooltipRendererParams & AgMapLineSeriesOptionsKeys & AgMapLineSeriesOptionsNames & AgMapLineSeriesStyle; export type AgMapLineSeriesStyle = StrokeOptions & LineDashOptions; export type AgMapLineSeriesLabel = AgChartLabelOptions, TContext>; export type AgMapLineSeriesLabelFormatterParams = AgMapLineSeriesOptionsKeys & AgMapLineSeriesOptionsNames; export type AgMapLineSeriesItemStylerParams = DatumCallbackParams & ContextCallbackParams & AgMapLineSeriesOptionsKeys & Required; export interface AgMapLineSeriesOptionsKeys { /** The name of the node key containing the id value. */ idKey?: DatumKey; /** The key to use to retrieve size values from the data, used to control the width of the stroke. */ sizeKey?: DatumKey; /** The name of the node key containing the colour value. This value (along with `colorScale` config) will be used to determine the colour of the stroke. */ colorKey?: DatumKey; /** The key to use to retrieve values from the data to use as labels on top of lines. */ labelKey?: DatumKey; } export interface AgMapLineSeriesOptionsNames { /** A human-readable description of the id-values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters. */ idName?: string; /** A human-readable description of the size values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters. */ sizeName?: string; /** A human-readable description of the colour values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters. */ colorName?: string; /** A human-readable description of the label values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters. */ labelName?: string; } export interface AgMapLineSeriesThemeableOptions extends AgMapLineSeriesStyle, Omit, 'highlightStyle' | 'highlight'> { /** Determines the largest width a stroke can be in pixels. */ maxStrokeWidth?: PixelSize; /** Explicitly specifies the extent of the domain for series `sizeKey`. */ sizeDomain?: number[]; /** Configuration for the labels shown on top of the line. */ label?: AgMapLineSeriesLabel; /** Series-specific tooltip configuration. */ tooltip?: AgSeriesTooltip>; /** A callback function for adjusting the styles of a particular Map line based on the input parameters. */ itemStyler?: Styler, AgMapLineSeriesStyle>; /** Configuration for colour scale with fills, domain, and mode. */ colorScale?: AgColorScale; /** Configuration for highlighting when a series or legend item is hovered over. */ highlight?: AgMultiSeriesHighlightOptions; } export interface AgMapLineHighlightStyleOptions extends StrokeOptions, LineDashOptions { /** The opacity of the whole series (line, fill, labels and markers, if any) */ opacity?: Opacity; } export interface AgMapLineSeriesOptions extends Omit, 'highlightStyle' | 'highlight'>, AgMapLineSeriesOptionsKeys, AgMapLineSeriesOptionsNames, AgMapLineSeriesThemeableOptions { /** Configuration for the Map Line Series. */ type: 'map-line'; /** GeoJSON data. */ topology?: GeoJSON; /** * The property to reference in the topology to match up with data. * * Default: `name` */ topologyIdKey?: string; /** The title to use for the series. */ title?: string; /** * The text to display in the legend for this series. * If multiple series share this value, they will be merged for the legend toggle behaviour. */ legendItemName?: string; }