import type { ContextCallbackParams, DatumCallbackParams, HierarchyHighlightState, Styler } from '../../chart/callbackOptions'; import type { AgChartAutoSizedLabelOptions, AgChartAutoSizedSecondaryLabelOptions } from '../../chart/labelOptions'; import type { AgSeriesTooltip, AgSeriesTooltipRendererParams } from '../../chart/tooltipOptions'; import type { ContextDefault, CssColor, DatumDefault, Opacity, PixelSize, Ratio } from '../../chart/types'; import type { AgColorScale, AgColorType, FillOptions, StrokeOptions, TextOptions, TextOrSegments } from '../cartesian/commonOptions'; import type { AgBaseSeriesOptions, AgBaseSeriesThemeableOptions } from '../seriesOptions'; export type AgSunburstHighlightState = HierarchyHighlightState; export interface AgSunburstSeriesTooltipRendererParams extends AgSeriesTooltipRendererParams, AgSunburstSeriesOptionsKeys, AgSunburstSeriesOptionsNames, AgSunburstSeriesStyle { /** The depth of the datum in the hierarchy. */ depth: number; } export interface AgSunburstSeriesHighlightStyle extends AgSunburstSeriesStyle { /** Opacity to apply to the sector its labels. */ opacity?: Opacity; } export interface AgSunburstSeriesHighlightOptions { /** * Whether highlighting is enabled. * * Default: `true` */ enabled?: boolean; /** Style for nodes within the hovered branch. */ highlightedBranch?: AgSunburstSeriesHighlightStyle; /** Style for the directly hovered node. */ highlightedItem?: AgSunburstSeriesHighlightStyle; /** Style for other nodes within the hovered branch. */ unhighlightedItem?: AgSunburstSeriesHighlightStyle; /** Style for nodes outside of the hovered branch. */ unhighlightedBranch?: AgSunburstSeriesHighlightStyle; } export interface AgSunburstInnerLabel extends TextOptions { /** The text to show in the inner label. */ text: TextOrSegments; /** The spacing in pixels before and after the inner label. */ spacing?: PixelSize; } export interface AgSunburstInnerLabelThemeOptions extends Omit { } export interface AgSunburstInnerCircle { /** The fill for the inner circle. A colour string, or an object for a gradient, pattern, or image fill. */ fill: AgColorType; /** The opacity of the fill for the inner circle. */ fillOpacity?: Opacity; } export interface AgSunburstSeriesThemeableOptions extends Omit, 'highlight' | 'showInLegend'> { /** Options for the label in a sector. */ label?: AgChartAutoSizedLabelOptions, TContext>; /** Options for a secondary, smaller label in a sector - displayed under the primary label. */ secondaryLabel?: AgChartAutoSizedSecondaryLabelOptions, TContext>; /** Apply rounded corners to each sector. */ cornerRadius?: PixelSize; /** The ratio of the inner radius of the series. Carves a hole at the centre of the series. */ innerRadiusRatio?: Ratio; /** The size in pixels of the hole carved at the centre of the series, measured outwards from the centre. Must be greater than zero, and is added to any hole `innerRadiusRatio` carves. It is not capped: a value that reaches the series radius leaves the sectors no room, so nothing is rendered. */ innerRadiusSize?: PixelSize; /** Configuration for the area at the centre of the series. Has no effect unless `innerRadiusRatio` or `innerRadiusSize` is set. */ innerCircle?: AgSunburstInnerCircle; /** Configuration for the labels at the centre of the series. Has no effect unless `innerRadiusRatio` or `innerRadiusSize` is set. */ innerLabels?: AgSunburstInnerLabelThemeOptions; /** Spacing between the sectors. */ sectorSpacing?: PixelSize; /** Minimum distance between text and the edges of the sectors. */ padding?: PixelSize; /** The colours to cycle through for the fills of the sectors. An array of colour strings, or fill objects for gradients, patterns, or images. */ fills?: AgColorType[]; /** The colours to cycle through for the strokes of the sectors. */ strokes?: CssColor[]; /** The opacity of the fill for the sectors. */ fillOpacity?: Opacity; /** The opacity of the stroke for the sectors. */ strokeOpacity?: Opacity; /** The width in pixels of the stroke for the sectors. */ strokeWidth?: PixelSize; /** Configuration for colour scale with fills, domain, and mode. */ colorScale?: AgColorScale; /** Series-specific tooltip configuration. */ tooltip?: AgSeriesTooltip>; /** A callback function for adjusting the styles of a particular Sunburst sector based on the input parameters. */ itemStyler?: Styler, AgSunburstSeriesStyle>; /** Highlight configuration for the series. */ highlight?: AgSunburstSeriesHighlightOptions; } export interface AgSunburstSeriesOptions extends Omit, 'highlight' | 'highlightStyle' | 'showInLegend' | 'selection' | 'focusIndex'>, AgSunburstSeriesOptionsKeys, AgSunburstSeriesOptionsNames, Omit, 'innerLabels'> { /** Configuration for the Sunburst Series. */ type: 'sunburst'; /** Configuration for the labels at the centre of the series. Has no effect unless `innerRadiusRatio` or `innerRadiusSize` is set. */ innerLabels?: AgSunburstInnerLabel[]; } export interface AgSunburstSeriesOptionsKeys { /** The name of the node key containing the label. */ labelKey?: string; /** The name of the node key containing a secondary label. */ secondaryLabelKey?: string; /** The name of the node key containing the children. Defaults to `children`. */ childrenKey?: string; /** The name of the node key containing the size value. */ sizeKey?: string; /** The name of the node key containing the colour value. This value (along with `colorScale` config) will be used to determine the segment colour. */ colorKey?: string; } export interface AgSunburstSeriesOptionsNames { /** 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; } /** The parameters of the Sunburst series formatter function */ export interface AgSunburstSeriesItemStylerParams extends DatumCallbackParams, ContextCallbackParams, AgSunburstSeriesOptionsKeys, Required { /** The depth of the datum in the hierarchy. */ depth: number; } export interface AgSunburstSeriesLabelFormatterParams<_TDatum = DatumDefault> extends AgSunburstSeriesOptionsKeys, AgSunburstSeriesOptionsNames { /** The depth of the datum in the hierarchy. */ depth: number; } /** The formatted style of a Sunburst sector. */ export interface AgSunburstSeriesStyle extends FillOptions, StrokeOptions { }