/** * Internal ChartEx model and serializer for Excel 2016+ chart families. * * **Not a public package API.** Authors use `Worksheet.addChart` with a * ChartEx layout on `ChartType` (e.g. `ChartType.Funnel`). Authoring mirrors * classic chart value ranges (`categoryLabels` / `values` / `dataRange`). * OOXML `cx:strDim` / `cx:numDim` dimensions are compiled here for * serialization only. * * Package materialize (via `charts.ts`) writes the ChartEx part, `chartEx` * relationship, and drawing `graphicFrame` (`a:graphicData` uri = chartex ns * + CT_RelId `chart`). * * OOXML source: [MS-ODRAWXML] §2.1.5 ChartEx part, §2.24.1.1 chart element * (CT_RelId), §5.22 CT_ChartSpace / CT_ChartData / CT_Series. */ /** * ChartEx series layout string tokens ([MS-ODRAWXML] ST_SeriesLayout). * Public authoring uses the same keys on `ChartType` (`ChartType.Funnel`, …). * Values must stay identical to those tokens. */ export declare type ChartExLayoutValue = 'boxWhisker' | 'funnel' | 'paretoLine' | 'sunburst' | 'treemap' | 'waterfall'; /** True when `value` is a supported ChartEx layout token. */ export declare function isChartExType(value: unknown): value is ChartExLayoutValue; /** * Input for a ChartEx part supplying its layout, title, and data (used by * `addChart` / package materialize). * * Supply either: * - `dataRange` (optional `isSeriesInRows` / `sheetName`), or * - `categoryLabels` + `values` formulas, or * - cached `categories` + `valuePoints` literals. * * TreeMap and Sunburst accept multiple category level formulas (or a multi-column * `dataRange` whose trailing column is the size measure). * * @private */ export interface ChartExOptions { /** The chart layout to create, such as waterfall, funnel, or treemap. */ readonly type: ChartExLayoutValue; readonly title?: string; /** * The cell reference providing category labels, or several references * for hierarchy-based charts like treemap and sunburst (outermost level * first). */ readonly categoryLabels?: string | ReadonlyArray; /** * The cell reference providing each point's value, or its size for * treemap and sunburst charts. */ readonly values?: string; /** * The source data range for the whole chart, including headers, such as * `A1:C4` or `Sheet1!A1:C4`. */ readonly dataRange?: string; /** * When `true`, each row of the source range becomes one series; when * `false` (the default), each column does. */ readonly isSeriesInRows?: boolean; /** * The sheet assumed for ranges and references that don't name one. * Defaults to `Sheet1`. */ readonly sheetName?: string; /** The number format applied to the chart's numeric values. */ readonly formatCode?: string; /** * Category labels to store directly in the chart instead of referencing * cells: one array for a single level, or nested arrays for a hierarchy. * Cannot be combined with `categoryLabels` or `dataRange`. */ readonly categories?: ReadonlyArray | ReadonlyArray<(ReadonlyArray)>; /** * Optional names for the stored category levels, in the same order as * `categories`. */ readonly categoryNames?: ReadonlyArray; /** * Numeric values to store directly in the chart instead of referencing * cells, in point order. Cannot be combined with `values` or `dataRange`. */ readonly valuePoints?: ReadonlyArray; } /** * Represents an advanced chart, such as a waterfall, funnel, or treemap, * created from worksheet data. */ export interface ChartEx { /** The chart's layout, such as waterfall, funnel, or treemap. */ readonly type: ChartExLayoutValue; /** The text shown in the chart's title, if any. */ readonly title: string | undefined; /** * The cell references that provide the category labels, from the * outermost level inward, when the categories come from cells. */ readonly categoryLabels: ReadonlyArray | undefined; /** * The cell reference that provides each point's value or size, when the * values come from cells. */ readonly values: string | undefined; /** The source data range the chart was created from, when provided. */ readonly dataRange: string | undefined; /** * When `true`, the source range's rows were treated as series rather * than its columns. */ readonly isSeriesInRows: boolean; /** The number format applied to the chart's numeric values. */ readonly formatCode: string | undefined; /** * The category labels stored directly in the chart, one array per * hierarchy level, when they were supplied as values rather than cell * references. */ readonly categories: ReadonlyArray<(ReadonlyArray)> | undefined; /** Optional names for the stored category levels, in the same order. */ readonly categoryNames: ReadonlyArray | undefined; /** * The numeric values stored directly in the chart, in point order, when * they were supplied as values rather than cell references. */ readonly valuePoints: ReadonlyArray | undefined; } /** Internal ChartEx package metadata used only during serialization. */ interface ChartExPackageOptions { readonly version?: string; readonly featureList?: string; } /** * Creates an advanced chart model, such as a waterfall, funnel, or treemap, * from a cell range or cached values. * * Compiles author input into OOXML dimensions used by {@link serializeChartEx}. * Formulas are not evaluated. Prefer * `sheet.addChart(ChartType.*, row, column, width, height, data, values?)` * for public authoring — this helper is package-internal. * * @param options ChartEx layout, title, and value/range or cached data. * @returns An internal ChartEx model for serialization / clone. * @private */ export declare function createChartEx(options: ChartExOptions): ChartEx; /** * Serialize a detached ChartEx model as a `cx:chartSpace` part. * Package-level only — not re-exported from the public barrel. * * @param chart Detached ChartEx model from {@link createChartEx}. * @param packageOptions Optional OOXML `version` / `featureList` (defaults `16.0` / empty). * @returns The complete ChartEx XML part. Formulas are not evaluated. */ export declare function serializeChartEx(chart: ChartEx, packageOptions?: ChartExPackageOptions): string; /** * Deep-copy a detached ChartEx model without shared mutable arrays. * Package-level only — not re-exported from the public barrel. */ export declare function cloneChartEx(chart: ChartEx): ChartEx; export {};