import type { ShapeProperties } from '../../drawing/dml/shape-properties'; import type { TextBody } from '../../drawing/dml/text'; /** Chartex layout discriminator. Lives on ``. */ export type CxLayoutId = 'clusteredColumn' | 'waterfall' | 'sunburst' | 'treemap' | 'boxWhisker' | 'pareto' | 'paretoLine' | 'regionMap' | 'funnel'; /** Numeric data point inside a chartex `` / `` level. */ export interface CxPoint { idx: number; v: string; } /** Numeric dimension (val / colorVal / size / x / y). */ export interface CxNumDim { kind: 'num'; /** Dimension role attribute (`val`, `colorVal`, `size`, `x`, `y`). */ type: string; /** Cell reference, e.g. `Sheet1!$A$1:$A$5`. */ f?: string; /** Optional `dir="col"|"row"` formula direction hint. */ dir?: 'col' | 'row'; ptCount?: number; pts: CxPoint[]; formatCode?: string; } /** String dimension (cat / colorStr). */ export interface CxStrDim { kind: 'str'; /** Dimension role attribute (`cat`, `colorStr`). */ type: string; f?: string; dir?: 'col' | 'row'; ptCount?: number; pts: CxPoint[]; formatCode?: string; } export type CxDim = CxNumDim | CxStrDim; /** Source data block, referenced by `` on series. */ export interface CxData { id: number; dims: CxDim[]; } /** External data linkage (rare — most charts inline the cache). */ export interface CxExternalData { rId: string; autoUpdate?: boolean; } export interface CxChartData { externalData?: CxExternalData; data: CxData[]; } /** Layout-properties union, keyed on the series' layoutId family. */ export type CxLayoutPr = { kind: 'waterfall'; subtotalIdx: number[]; } | { kind: 'binning'; binCountAuto?: boolean; binCount?: number; binSize?: number; intervalClosed?: 'r' | 'l'; underflow?: number; overflow?: number; } | { kind: 'parentLabel'; layout: 'overlapping' | 'banner' | 'none'; } | { kind: 'visibility'; meanLine?: boolean; meanMarker?: boolean; nonoutliers?: boolean; outliers?: boolean; quartileMethod?: 'exclusive' | 'inclusive'; } | { kind: 'region'; cultureLanguage?: string; cultureRegion?: string; projectionType?: 'automatic' | 'mercator' | 'miller' | 'albers'; regionLabelLayout?: 'none' | 'bestFit' | 'showAll'; }; export type CxDataLabelPos = 'ctr' | 'b' | 'l' | 'r' | 't' | 'inEnd' | 'outEnd' | 'inBase'; export interface CxDataLabels { pos?: CxDataLabelPos; visibility?: { seriesName?: boolean; categoryName?: boolean; value?: boolean; }; } export interface CxSeries { layoutId: CxLayoutId; hidden?: boolean; ownerIdx?: number; formatIdx?: number; axisIds?: number[]; /** Series text — typically a cell reference. */ tx?: { f?: string; v?: string; }; dataLabels?: CxDataLabels; /** Numeric id pointing into chartData.data. */ dataId?: number; layoutPr?: CxLayoutPr; /** Per-series shape properties (fill / line / effects). */ spPr?: ShapeProperties; /** Per-series default text properties. */ txPr?: TextBody; } export interface CxAxis { id: number; hidden?: boolean; /** Continuous (value) axis bounds. */ valScaling?: { min?: number; max?: number; }; /** Category-axis gap width %. */ catScalingGapWidth?: number; majorGridlines?: boolean; title?: CxTitle; /** Axis-line / tick formatting. */ spPr?: ShapeProperties; /** Tick-label text formatting. */ txPr?: TextBody; } export interface CxTitle { pos?: 't' | 'b' | 'l' | 'r'; align?: 'ctr' | 'l' | 'r'; overlay?: boolean; /** Plain text (rich runs not preserved at this layer). */ text?: string; /** Cell-reference text source. */ txDataRef?: string; /** Title chrome (frame fill / border). */ spPr?: ShapeProperties; /** Title text formatting. */ txPr?: TextBody; } export interface CxLegend { pos?: 't' | 'b' | 'l' | 'r' | 'tr'; align?: 'ctr' | 'l' | 'r'; overlay?: boolean; /** Legend chrome (frame fill / border). */ spPr?: ShapeProperties; /** Legend text formatting. */ txPr?: TextBody; } export interface CxPlotArea { series: CxSeries[]; axes: CxAxis[]; /** Plot-surface shape properties (background fill / border line). */ spPr?: ShapeProperties; } export interface CxChart { title?: CxTitle; plotArea: CxPlotArea; legend?: CxLegend; plotVisOnly?: boolean; dispBlanksAs?: 'span' | 'gap' | 'zero'; } /** Root model for a chartex `xl/charts/chartN.xml` part. */ export interface CxChartSpace { kind: 'cxChartSpace'; chartData: CxChartData; chart: CxChart; /** Chart-space level shape properties (overall frame). */ spPr?: ShapeProperties; /** Chart-space level default text properties. */ txPr?: TextBody; } export declare const makeCxNumDim: (opts: { type: string; f?: string; dir?: "col" | "row"; ptCount?: number; pts?: CxPoint[]; formatCode?: string; }) => CxNumDim; export declare const makeCxStrDim: (opts: { type: string; f?: string; dir?: "col" | "row"; ptCount?: number; pts?: CxPoint[]; formatCode?: string; }) => CxStrDim; export declare const makeCxData: (id: number, dims: CxDim[]) => CxData; export declare const makeCxSeries: (opts: { layoutId: CxLayoutId; dataId?: number; hidden?: boolean; ownerIdx?: number; formatIdx?: number; axisIds?: number[]; tx?: { f?: string; v?: string; }; dataLabels?: CxDataLabels; layoutPr?: CxLayoutPr; spPr?: ShapeProperties; txPr?: TextBody; }) => CxSeries; export declare const makeCxAxis: (opts: { id: number; hidden?: boolean; valScaling?: { min?: number; max?: number; }; catScalingGapWidth?: number; majorGridlines?: boolean; title?: CxTitle; spPr?: ShapeProperties; txPr?: TextBody; }) => CxAxis; export declare const makeCxChartSpace: (opts: { series: CxSeries[]; data?: CxData[]; axes?: CxAxis[]; title?: CxTitle; legend?: CxLegend; plotVisOnly?: boolean; dispBlanksAs?: CxChart["dispBlanksAs"]; externalData?: CxExternalData; plotAreaSpPr?: ShapeProperties; spPr?: ShapeProperties; txPr?: TextBody; }) => CxChartSpace; export declare const makeSunburstChart: (opts: { catRef?: string; valRef?: string; valFormatCode?: string; }) => CxChartSpace; export declare const makeTreemapChart: (opts: { catRef?: string; valRef?: string; parentLabelLayout?: "overlapping" | "banner" | "none"; }) => CxChartSpace; export declare const makeWaterfallChart: (opts: { catRef?: string; valRef?: string; subtotalIdx?: number[]; }) => CxChartSpace; export declare const makeHistogramChart: (opts: { valRef?: string; binCountAuto?: boolean; binCount?: number; binSize?: number; intervalClosed?: "r" | "l"; underflow?: number; overflow?: number; }) => CxChartSpace; export declare const makeParetoChart: (opts: { valRef?: string; catRef?: string; binCountAuto?: boolean; binCount?: number; binSize?: number; }) => CxChartSpace; export declare const makeFunnelChart: (opts: { catRef?: string; valRef?: string; }) => CxChartSpace; export declare const makeBoxWhiskerChart: (opts: { catRef?: string; valRef?: string; meanLine?: boolean; meanMarker?: boolean; outliers?: boolean; nonoutliers?: boolean; quartileMethod?: "exclusive" | "inclusive"; }) => CxChartSpace; export declare const makeRegionMapChart: (opts: { catRef?: string; valRef?: string; cultureLanguage?: string; cultureRegion?: string; projectionType?: "automatic" | "mercator" | "miller" | "albers"; regionLabelLayout?: "none" | "bestFit" | "showAll"; }) => CxChartSpace;