import type { RichFormatter, Styler } from '../../chart/callbackOptions'; import type { AgCartesianAxisCrossAtPlacement, AgNumberAxisOptions, AgSeriesAreaBackgroundRegion, AgSeriesAreaBackgroundRegionLabel } from '../../chart/cartesianOptions'; import type { AgContextMenuOptions } from '../../chart/contextMenuOptions'; import type { AgNumericValue } from '../../chart/dataValues'; import type { AgErrorBarOptions } from '../../chart/errorBarOptions'; import type { AgChartLabelFormatterParams, AgChartLabelStyleOptions, AgChartLabelStylerParams } from '../../chart/labelOptions'; import type { AgSeriesTooltip } from '../../chart/tooltipOptions'; import type { DatumKey, PixelSize } from '../../chart/types'; import type { AgScatterSeriesItemStylerParams, AgScatterSeriesLabel, AgScatterSeriesLabelFormatterParams, AgScatterSeriesOptionsKeys, AgScatterSeriesOptionsNames, AgScatterSeriesThemeableOptions, AgScatterSeriesTooltipRendererParams } from '../../series/cartesian/scatterOptions'; import type { AgSeriesMarkerStyle } from '../../series/markerOptions'; export type AgQuadrantChartPresets = AgQuadrantPreset; export interface AgQuadrantPreset extends Omit, 'colorKey'>, Omit, Omit, 'colorScale' | 'errorBar' | 'itemStyler' | 'label' | 'showInLegend' | 'showInMiniChart' | 'title' | 'tooltip'> { /** Whether to move the axis lines so that they cross at the pivot. When `false`, the axes stay at the bottom and left of the chart. * * Default: `true` */ alignAxesToPivot?: boolean; /** Configuration for placement of axis titles and labels. */ axisPlacement?: AgQuadrantAxisPlacementOptions; /** Configuration for the context menu. */ contextMenu?: AgContextMenuOptions; /** Configuration for the Error Bars. */ errorBar?: AgErrorBarOptions; /** * Primary identifier for the series. This is provided as `seriesId` in user callbacks to differentiate multiple series, and is how `setSelection()` addresses the series. * * Default: `'quadrant'` */ id?: string; /** Function used to return formatting for individual markers, based on the supplied information.*/ itemStyler?: Styler, AgQuadrantRegionMarkerStyle>; /** Configuration for the labels shown on top of data points. */ label?: AgQuadrantLabelOptions; /** The data values at which the chart is divided into four regions. */ pivot?: AgQuadrantPivotOptions; /** Configuration for each of the four regions the pivot divides the chart into. */ regions?: AgQuadrantRegionsOptions; /** The key to use to retrieve size values from the data, used to control the size of the markers. */ sizeKey?: DatumKey; /** 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; /** Determines the smallest size a marker can be in pixels when `sizeKey` is present. Defaults to `size` when not set. */ minSize?: PixelSize; /** Determines the largest size a marker can be in pixels when `sizeKey` is present. */ maxSize?: PixelSize; /** Series-specific tooltip configuration. */ tooltip?: AgSeriesTooltip>; /** Configuration for the horizontal axis, which is always a number axis. Its ticks are hidden by default. */ xAxis?: AgQuadrantAxisOptions; /** Configuration for the vertical axis, which is always a number axis. Its ticks are hidden by default. */ yAxis?: AgQuadrantAxisOptions; } export interface AgQuadrantAxisPlacementOptions { /** * Whether the axis title is placed at the crossing point, or at the axis' `position` edge. * * Default: `'edge'` */ title?: AgCartesianAxisCrossAtPlacement; /** * Whether the axis labels are placed at the crossing point, or at the axis' `position` edge. * * Default: `'edge'` */ label?: AgCartesianAxisCrossAtPlacement; /** * Whether the crosshair label is placed at the crossing point, or at the axis' `position` edge. * * Default: `'edge'` */ crosshairLabel?: AgCartesianAxisCrossAtPlacement; } export interface AgQuadrantPivotOptions { /** The x-value at which the chart is divided into left and right regions. * * Default: `0` */ x?: AgNumericValue; /** The y-value at which the chart is divided into bottom and top regions. * * Default: `0` */ y?: AgNumericValue; } export interface AgQuadrantRegionsOptions { /** Configuration for labels shared across every region. */ label?: AgQuadrantRegionsLabelOptions; /** Configuration for the top left region. */ topLeft?: AgQuadrantRegionOptions; /** Configuration for the top right region. */ topRight?: AgQuadrantRegionOptions; /** Configuration for the bottom left region. */ bottomLeft?: AgQuadrantRegionOptions; /** Configuration for the bottom right region. */ bottomRight?: AgQuadrantRegionOptions; } export interface AgQuadrantRegionsLabelOptions extends Omit { /** The placement of the label within its region, resolved relative to the region so that a single value places all * four region labels symmetrically. * * Default: `'inside-outer-outer'` */ position?: AgQuadrantRegionLabelPosition; /** The distance in pixels between the label and the region edges its `position` places it against, moving it * away from those edges. * * Default: `10` */ spacing?: PixelSize; } export interface AgQuadrantRegionLabelOptions extends AgQuadrantRegionsLabelOptions { /** The text to show in the label. */ text?: string; /** The horizontal offset in pixels applied to this region's label, in addition to any offset `spacing` produces. * Unlike `position` and `spacing`, this is not resolved relative to the region: positive values always move the * label to the right. * * Default: `0` */ xOffset?: PixelSize; /** The vertical offset in pixels applied to this region's label, in addition to any offset `spacing` produces. * Unlike `position` and `spacing`, this is not resolved relative to the region: positive values always move the * label down. * * Default: `0` */ yOffset?: PixelSize; } /** A region label placement, in which `inner` is towards the pivot, `outer` is towards the edge of the series area, * and `center` is midway between them. * The first token of an `inside` placement places the label vertically, and the second horizontally. */ export type AgQuadrantRegionLabelPosition = 'outside-outer' | 'outside-center' | 'outside-inner' | 'inside-outer-outer' | 'inside-outer-center' | 'inside-outer-inner' | 'inside-center-outer' | 'inside-center' | 'inside-center-inner' | 'inside-inner-outer' | 'inside-inner-center' | 'inside-inner-inner'; export interface AgQuadrantRegionOptions extends Omit { /** Configuration for the label displayed with the region. */ label?: AgQuadrantRegionLabelOptions; /** Styling for the markers of the data points that fall within this region. When `fill` is omitted, markers use * the region's own `fill` at full opacity. */ marker?: AgQuadrantRegionMarkerStyle; } export interface AgQuadrantRegionMarkerStyle extends AgSeriesMarkerStyle { } export interface AgQuadrantAxisOptions extends Omit, 'crossAt' | 'crossLines' | 'keys' | 'reverse' | 'position' | 'type'> { } export interface AgQuadrantItemStylerParams extends AgScatterSeriesItemStylerParams { /** The region the marker falls in, determined by comparing its x- and y-values against the pivot. */ region: AgQuadrantRegion; } export interface AgQuadrantTooltipRendererParams extends AgScatterSeriesTooltipRendererParams { /** The region the marker falls in, determined by comparing its x- and y-values against the pivot. */ region: AgQuadrantRegion; /** The human-readable description of the size values, as supplied via `sizeName`, present when `sizeKey` is set. */ sizeName?: string; } export interface AgQuadrantLabelOptions extends Omit, 'formatter' | 'itemStyler'> { /** Whether to show the labels. Defaults to `true` when `labelKey` is set. */ enabled?: boolean; /** A custom formatting function used to convert data values into text for display by labels. */ formatter?: RichFormatter & AgQuadrantLabelFormatterParams>; /** Function used to style individual datum labels. */ itemStyler?: Styler & AgQuadrantLabelFormatterParams, AgChartLabelStyleOptions>; } export interface AgQuadrantLabelFormatterParams extends AgScatterSeriesLabelFormatterParams { /** The region the marker falls in, determined by comparing its x- and y-values against the pivot. */ region: AgQuadrantRegion; } export interface AgQuadrantContextMenuParams { /** * Either the region of the marker under the pointer, or the region the pointer falls in when there is no * marker. Undefined when the click cannot be placed in a region, such as on an axis label crossing the series * area. */ region?: AgQuadrantRegion; } export type AgQuadrantRegion = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';