@pixerate/editor 0.47.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/agent/index.cjs +248 -29
  2. package/dist/agent/index.cjs.map +1 -1
  3. package/dist/agent/index.d.cts +18 -6
  4. package/dist/agent/index.d.ts +18 -6
  5. package/dist/agent/index.js +228 -9
  6. package/dist/agent/index.js.map +1 -1
  7. package/dist/{builtins-xs7rK6ys.d.cts → builtins-1kqwLUnb.d.cts} +1 -1
  8. package/dist/{builtins-D2nMtw2W.d.ts → builtins-BKYlHH1s.d.ts} +1 -1
  9. package/dist/chart/index.cjs +216 -3541
  10. package/dist/chart/index.cjs.map +1 -1
  11. package/dist/chart/index.d.cts +4 -494
  12. package/dist/chart/index.d.ts +4 -494
  13. package/dist/chart/index.js +155 -3480
  14. package/dist/chart/index.js.map +1 -1
  15. package/dist/{chunk-5VXI5GED.js → chunk-2CJ3LPYQ.js} +3 -3
  16. package/dist/{chunk-TXXNBDQX.cjs → chunk-2Q46FKZK.cjs} +113 -34
  17. package/dist/chunk-2Q46FKZK.cjs.map +1 -0
  18. package/dist/chunk-3JNRQVTS.cjs +521 -0
  19. package/dist/chunk-3JNRQVTS.cjs.map +1 -0
  20. package/dist/chunk-5TWIN7ZJ.js +113 -0
  21. package/dist/chunk-5TWIN7ZJ.js.map +1 -0
  22. package/dist/{chunk-PQFAHT5O.js → chunk-DQPBQXKG.js} +27 -94
  23. package/dist/chunk-DQPBQXKG.js.map +1 -0
  24. package/dist/{chunk-ZFBBVGCI.js → chunk-EKYHKQPG.js} +243 -243
  25. package/dist/{chunk-ZFBBVGCI.js.map → chunk-EKYHKQPG.js.map} +1 -1
  26. package/dist/{chunk-J3R2OWOE.cjs → chunk-FEMIVHN3.cjs} +610 -15
  27. package/dist/chunk-FEMIVHN3.cjs.map +1 -0
  28. package/dist/{chunk-C3NWJE3K.js → chunk-GJBIVWB2.js} +11 -672
  29. package/dist/chunk-GJBIVWB2.js.map +1 -0
  30. package/dist/chunk-GTZXF4BI.cjs +3424 -0
  31. package/dist/chunk-GTZXF4BI.cjs.map +1 -0
  32. package/dist/chunk-JOX6MJW4.cjs +674 -0
  33. package/dist/chunk-JOX6MJW4.cjs.map +1 -0
  34. package/dist/{chunk-REAGGLXS.js → chunk-JQ3BB3E6.js} +2 -2
  35. package/dist/{chunk-H4PICYNL.cjs → chunk-LNKZPIQD.cjs} +113 -180
  36. package/dist/chunk-LNKZPIQD.cjs.map +1 -0
  37. package/dist/chunk-OV7UAKIY.js +674 -0
  38. package/dist/chunk-OV7UAKIY.js.map +1 -0
  39. package/dist/{chunk-TK2XZK6Z.js → chunk-QFTVLEVN.js} +596 -1
  40. package/dist/chunk-QFTVLEVN.js.map +1 -0
  41. package/dist/{chunk-KRGXUQ2Y.js → chunk-T6XU4B54.js} +82 -3
  42. package/dist/chunk-T6XU4B54.js.map +1 -0
  43. package/dist/chunk-TGBCBQFV.cjs +113 -0
  44. package/dist/chunk-TGBCBQFV.cjs.map +1 -0
  45. package/dist/{chunk-SQC26VQV.cjs → chunk-UN33YOXW.cjs} +191 -191
  46. package/dist/{chunk-SQC26VQV.cjs.map → chunk-UN33YOXW.cjs.map} +1 -1
  47. package/dist/chunk-WBOAXDKD.js +3424 -0
  48. package/dist/chunk-WBOAXDKD.js.map +1 -0
  49. package/dist/{chunk-LYGEEDNR.cjs → chunk-XP5IUZUO.cjs} +242 -242
  50. package/dist/chunk-XP5IUZUO.cjs.map +1 -0
  51. package/dist/{chunk-BBRK6MOI.cjs → chunk-YU4WQE5M.cjs} +100 -100
  52. package/dist/{chunk-BBRK6MOI.cjs.map → chunk-YU4WQE5M.cjs.map} +1 -1
  53. package/dist/commands/index.d.cts +1 -1
  54. package/dist/commands/index.d.ts +1 -1
  55. package/dist/controller-ChjCCMLl.d.cts +822 -0
  56. package/dist/controller-DtbEo3om.d.ts +822 -0
  57. package/dist/export/index.cjs +4 -2
  58. package/dist/export/index.cjs.map +1 -1
  59. package/dist/export/index.d.cts +5 -1
  60. package/dist/export/index.d.ts +5 -1
  61. package/dist/export/index.js +3 -1
  62. package/dist/extensions/index.cjs +33 -4
  63. package/dist/extensions/index.cjs.map +1 -1
  64. package/dist/extensions/index.d.cts +4 -2
  65. package/dist/extensions/index.d.ts +4 -2
  66. package/dist/extensions/index.js +32 -3
  67. package/dist/{index-QrqMmZ75.d.cts → index-DoHqT1mq.d.cts} +203 -7
  68. package/dist/{index-CSUCQYAH.d.ts → index-YLZ0fKqE.d.ts} +203 -7
  69. package/dist/index.cjs +39 -13
  70. package/dist/index.cjs.map +1 -1
  71. package/dist/index.d.cts +9 -7
  72. package/dist/index.d.ts +9 -7
  73. package/dist/index.js +33 -7
  74. package/dist/index.js.map +1 -1
  75. package/dist/spreadsheet/index.cjs +4 -4
  76. package/dist/spreadsheet/index.js +3 -3
  77. package/package.json +1 -1
  78. package/dist/chunk-C3NWJE3K.js.map +0 -1
  79. package/dist/chunk-H4PICYNL.cjs.map +0 -1
  80. package/dist/chunk-J3R2OWOE.cjs.map +0 -1
  81. package/dist/chunk-KRGXUQ2Y.js.map +0 -1
  82. package/dist/chunk-LYGEEDNR.cjs.map +0 -1
  83. package/dist/chunk-NEOO6QJD.cjs +0 -1182
  84. package/dist/chunk-NEOO6QJD.cjs.map +0 -1
  85. package/dist/chunk-PQFAHT5O.js.map +0 -1
  86. package/dist/chunk-TK2XZK6Z.js.map +0 -1
  87. package/dist/chunk-TXXNBDQX.cjs.map +0 -1
  88. package/dist/types-BVqWm3d1.d.cts +0 -320
  89. package/dist/types-BVqWm3d1.d.ts +0 -320
  90. /package/dist/{chunk-5VXI5GED.js.map → chunk-2CJ3LPYQ.js.map} +0 -0
  91. /package/dist/{chunk-REAGGLXS.js.map → chunk-JQ3BB3E6.js.map} +0 -0
@@ -0,0 +1,822 @@
1
+ import { H as HistoryManager } from './HistoryManager-DWSLd6Tf.js';
2
+
3
+ /**
4
+ * Chart kinds.
5
+ *
6
+ * - `bar`, `line`, `area` and `scatter` are cartesian: categories along one axis, values along
7
+ * the other, and series may mix them (a combo chart). A scatter chart whose series carry
8
+ * numeric `x` values plots them on a numeric x axis instead.
9
+ * - `bubble` plots `x`, `y` (the values) and `sizes` per series.
10
+ * - `pie` and `donut` draw the first visible series, one slice per category.
11
+ * - `radar` draws each series as a polygon over one spoke per category.
12
+ * - `waterfall` draws the first series as running increases and decreases.
13
+ * - `histogram` bins every value of the visible series; `box` draws one box and whiskers per series.
14
+ * - `funnel` and `treemap` draw the first series, one bar or rectangle per category.
15
+ */
16
+ type ChartType = 'bar' | 'line' | 'area' | 'scatter' | 'bubble' | 'pie' | 'donut' | 'radar' | 'waterfall' | 'histogram' | 'box' | 'funnel' | 'treemap';
17
+ /** How a series is drawn in a cartesian chart. */
18
+ type ChartSeriesType = 'bar' | 'line' | 'area' | 'scatter';
19
+ /** One data value; `null` is a gap (missing value). */
20
+ type ChartValue = number | null;
21
+ /** Point marker shapes for line, area and scatter series. */
22
+ type ChartMarker = 'circle' | 'square' | 'diamond' | 'triangle' | 'cross' | 'none';
23
+ /** Trendline fits (as in spreadsheets). */
24
+ type ChartTrendlineType = 'linear' | 'exponential' | 'logarithmic' | 'power' | 'polynomial' | 'moving-average';
25
+ interface ChartTrendline {
26
+ type: ChartTrendlineType;
27
+ /** Polynomial order, 2–6 (default 2). */
28
+ order?: number;
29
+ /** Moving-average period, 2 or more (default 2). */
30
+ period?: number;
31
+ /** Extend the line this many x units past the last point (default 0). */
32
+ forward?: number;
33
+ /** Extend the line this many x units before the first point (default 0). */
34
+ backward?: number;
35
+ /** Force the line through this y at x = 0 (linear, polynomial and exponential only). */
36
+ intercept?: number | null;
37
+ /** Write the fitted equation on the chart. */
38
+ showEquation?: boolean;
39
+ /** Write R² on the chart. */
40
+ showR2?: boolean;
41
+ /** Legend name (default: e.g. "Linear (Sales)"). */
42
+ name?: string;
43
+ /** CSS colour (default: the series colour). */
44
+ color?: string;
45
+ }
46
+ interface ChartSeries {
47
+ /** Stable id (unique within the chart). */
48
+ id: string;
49
+ name: string;
50
+ /** One value per category (the y values of a scatter or bubble chart). */
51
+ values: ChartValue[];
52
+ /** CSS colour (default: the palette colour for the series' position). */
53
+ color?: string;
54
+ /** Overrides the chart type for this series (cartesian charts only). */
55
+ type?: ChartSeriesType;
56
+ /** Hidden series keep their data but are not drawn or scaled. */
57
+ hidden?: boolean;
58
+ /** Plot against the secondary value axis (on the right). */
59
+ axis?: 'primary' | 'secondary';
60
+ /** Numeric x per category (scatter and bubble charts). */
61
+ x?: ChartValue[];
62
+ /** Bubble sizes per category (bubble charts; area is proportional to size). */
63
+ sizes?: ChartValue[];
64
+ /** Colour overrides per category (`null` keeps the series colour). */
65
+ pointColors?: (string | null)[];
66
+ /** Point marker (default: circles on lines when `points` is on). */
67
+ marker?: ChartMarker;
68
+ /** Line interpolation for this series (default: the chart's `curve`). */
69
+ curve?: ChartCurve;
70
+ /** Value labels for this series (default: the chart's `dataLabels`). */
71
+ dataLabels?: boolean;
72
+ /** How this series' data labels are written (default: the value axis format). */
73
+ format?: ChartNumberFormat;
74
+ /** Fitted lines drawn over the series. */
75
+ trendlines?: ChartTrendline[];
76
+ }
77
+ interface ChartNumberFormat {
78
+ /** `number` (default), `percent` (0.25 → 25%), `currency` or `compact` (1.2K). */
79
+ style?: 'number' | 'percent' | 'currency' | 'compact';
80
+ /** Fixed decimals (default: as many as the ticks need, up to 2). */
81
+ decimals?: number;
82
+ /** ISO currency code for `currency` (default `USD`). */
83
+ currency?: string;
84
+ prefix?: string;
85
+ suffix?: string;
86
+ /**
87
+ * A spreadsheet format code such as `#,##0.0,,"M"` or `0.0%;[Red]-0.0%`. When set it
88
+ * wins over the other fields. Supports sections (positive;negative;zero), digit
89
+ * placeholders, thousands separators and scaling, percent, scientific and literal text.
90
+ */
91
+ code?: string;
92
+ }
93
+ interface ChartAxis {
94
+ /** Draw the axis line, ticks and labels (default `true`). */
95
+ show: boolean;
96
+ title: string;
97
+ /** Fixed lower bound (default: from the data, including 0 for bars and areas). */
98
+ min: number | null;
99
+ /** Fixed upper bound (default: from the data). */
100
+ max: number | null;
101
+ /** Fixed distance between ticks (default: a round number from the plot size). */
102
+ step: number | null;
103
+ /** Grid lines at each tick (default: on for the value axis). */
104
+ gridlines: boolean;
105
+ /** How tick and data labels are written (value axes, and the x axis of scatter charts). */
106
+ format: ChartNumberFormat;
107
+ /**
108
+ * Category axis only: `date` reads the categories as dates (ISO `2024-03-01`, `2024-03`,
109
+ * `2024`), labels them with calendar steps that fit, and thins the rest.
110
+ */
111
+ kind?: 'category' | 'date';
112
+ }
113
+ type ChartLegendPosition = 'top' | 'bottom' | 'left' | 'right';
114
+ interface ChartLegend {
115
+ show: boolean;
116
+ position: ChartLegendPosition;
117
+ }
118
+ type ChartStacking = 'none' | 'stacked' | 'percent';
119
+ type ChartOrientation = 'vertical' | 'horizontal';
120
+ type ChartCurve = 'linear' | 'smooth' | 'step';
121
+ /** Where bar labels go: `auto` puts them outside, or centred on stacked segments, and drops ones that do not fit. */
122
+ type ChartLabelPosition = 'auto' | 'inside' | 'outside' | 'center';
123
+ /** A whole chart: data plus presentation. Plain JSON, safe to persist. */
124
+ interface ChartSpec {
125
+ version: 1;
126
+ type: ChartType;
127
+ title: string;
128
+ subtitle: string;
129
+ /** Category labels (the x axis, or pie slices). */
130
+ categories: string[];
131
+ series: ChartSeries[];
132
+ /** The category axis (or the numeric x axis of a scatter or bubble chart). */
133
+ xAxis: ChartAxis;
134
+ /** The value axis. */
135
+ yAxis: ChartAxis;
136
+ /** The secondary value axis, drawn on the right when a visible series uses it. */
137
+ yAxis2: ChartAxis;
138
+ legend: ChartLegend;
139
+ /** Stack bars and areas (`percent` scales each category to 100%). */
140
+ stacking: ChartStacking;
141
+ /** `horizontal` draws bars sideways (bar charts only). */
142
+ orientation: ChartOrientation;
143
+ /** Line and area interpolation. */
144
+ curve: ChartCurve;
145
+ /** Dots on line and area series. */
146
+ points: boolean;
147
+ /** Value labels on bars, points and slices. */
148
+ dataLabels: boolean;
149
+ /** Where bar value labels go. */
150
+ labelPosition: ChartLabelPosition;
151
+ /** Series colours in order (cycled through lighter and darker shades once used up). */
152
+ palette: string[];
153
+ /** Donut hole as a fraction of the radius (0–0.9). */
154
+ innerRadius: number;
155
+ /** Empty space between category groups, as a fraction of the category width (0–0.9). */
156
+ gapWidth: number;
157
+ /** How much bars in a group overlap, as a fraction of a bar's width (-1 to 1; negative is a gap). */
158
+ overlap: number;
159
+ /** Histogram bin count (`null`: √n, between 1 and 100). */
160
+ bins: number | null;
161
+ /** Waterfall: append a running-total bar (categories labelled "total" are always totals). */
162
+ showTotal: boolean;
163
+ }
164
+ /** What a click selects. */
165
+ type ChartSelection = {
166
+ kind: 'chart';
167
+ } | {
168
+ kind: 'title';
169
+ } | {
170
+ kind: 'subtitle';
171
+ } | {
172
+ kind: 'legend';
173
+ } | {
174
+ kind: 'axis';
175
+ axis: 'x' | 'y' | 'y2';
176
+ } | {
177
+ kind: 'series';
178
+ seriesId: string;
179
+ } | {
180
+ kind: 'point';
181
+ seriesId: string;
182
+ index: number;
183
+ } | {
184
+ kind: 'category';
185
+ index: number;
186
+ } | {
187
+ kind: 'trendline';
188
+ seriesId: string;
189
+ index: number;
190
+ };
191
+ /** Colours and type used to lay out a chart. Any CSS colour strings work. */
192
+ interface ChartTheme {
193
+ /** Fill behind the chart (`transparent` lets the page show through). */
194
+ background: string;
195
+ /** The page colour: slice separators and hollow points (set it when `background` is transparent). */
196
+ surface: string;
197
+ text: string;
198
+ mutedText: string;
199
+ grid: string;
200
+ axis: string;
201
+ /** Outline drawn around the selected mark. */
202
+ selection: string;
203
+ /** Waterfall increases. */
204
+ positive: string;
205
+ /** Waterfall decreases. */
206
+ negative: string;
207
+ fontFamily: string;
208
+ fontSize: number;
209
+ titleSize: number;
210
+ }
211
+ interface ChartRect {
212
+ x: number;
213
+ y: number;
214
+ width: number;
215
+ height: number;
216
+ }
217
+ /** What a mark is, for styling and tests. */
218
+ type ChartMarkRole = 'background' | 'title' | 'subtitle' | 'grid' | 'axis' | 'tick' | 'tick-label' | 'axis-title' | 'bar' | 'line' | 'area' | 'point' | 'slice' | 'cell' | 'box' | 'whisker' | 'outlier' | 'connector' | 'trendline' | 'trendline-label' | 'data-label' | 'legend-swatch' | 'legend-label' | 'drag-readout' | 'selection' | 'empty';
219
+ interface ChartMarkBase {
220
+ /** Unique within the scene (a stable key for frameworks). */
221
+ key: string;
222
+ role: ChartMarkRole;
223
+ /** What clicking this mark selects (none: not clickable). */
224
+ target?: ChartSelection;
225
+ /** Mark belongs to the current selection. */
226
+ selected?: boolean;
227
+ opacity?: number;
228
+ }
229
+ interface ChartRectMark extends ChartMarkBase {
230
+ kind: 'rect';
231
+ x: number;
232
+ y: number;
233
+ width: number;
234
+ height: number;
235
+ fill: string;
236
+ stroke?: string;
237
+ strokeWidth?: number;
238
+ radius?: number;
239
+ }
240
+ interface ChartPathMark extends ChartMarkBase {
241
+ kind: 'path';
242
+ d: string;
243
+ fill?: string;
244
+ stroke?: string;
245
+ strokeWidth?: number;
246
+ dash?: string;
247
+ }
248
+ interface ChartCircleMark extends ChartMarkBase {
249
+ kind: 'circle';
250
+ cx: number;
251
+ cy: number;
252
+ r: number;
253
+ fill: string;
254
+ stroke?: string;
255
+ strokeWidth?: number;
256
+ }
257
+ interface ChartLineMark extends ChartMarkBase {
258
+ kind: 'line';
259
+ x1: number;
260
+ y1: number;
261
+ x2: number;
262
+ y2: number;
263
+ stroke: string;
264
+ strokeWidth?: number;
265
+ dash?: string;
266
+ }
267
+ interface ChartTextMark extends ChartMarkBase {
268
+ kind: 'text';
269
+ x: number;
270
+ y: number;
271
+ text: string;
272
+ anchor: 'start' | 'middle' | 'end';
273
+ /** Vertical alignment of the text box to `y`. */
274
+ baseline: 'top' | 'middle' | 'bottom';
275
+ size: number;
276
+ weight?: number;
277
+ fill: string;
278
+ /** Degrees, around (x, y). */
279
+ rotate?: number;
280
+ }
281
+ type ChartMark = ChartRectMark | ChartPathMark | ChartCircleMark | ChartLineMark | ChartTextMark;
282
+ /** Maps between data values and scene pixels along one axis of the plot. */
283
+ interface ChartValueScale {
284
+ /** `y` for vertical charts, `x` for horizontal bars and the numeric x axis of scatter charts. */
285
+ axis: 'x' | 'y';
286
+ domain: [number, number];
287
+ range: [number, number];
288
+ ticks: number[];
289
+ }
290
+ /** Something the layout had to leave out or shorten, as a sentence (for agents and screen readers). */
291
+ interface ChartWarning {
292
+ code: 'labels-hidden' | 'labels-truncated' | 'legend-truncated' | 'points-decimated' | 'values-skipped' | 'data-labels-hidden' | 'type-fallback';
293
+ message: string;
294
+ }
295
+ /** A laid-out chart: drawing primitives in scene pixels, ready for SVG, canvas or anything else. */
296
+ interface ChartScene {
297
+ width: number;
298
+ height: number;
299
+ /** The plot area (inside the axes). Empty for pies. */
300
+ plot: ChartRect;
301
+ /** Draw in order. */
302
+ marks: ChartMark[];
303
+ /** The value scale of a cartesian chart (absent for pies and empty charts). */
304
+ valueScale?: ChartValueScale;
305
+ /** The secondary value scale, when a visible series uses it. */
306
+ valueScale2?: ChartValueScale;
307
+ /** The numeric x scale of a scatter or bubble chart with x values. */
308
+ xScale?: ChartValueScale;
309
+ /** Percent-stacked: values are shown as shares, so dragging is disabled. */
310
+ percent: boolean;
311
+ theme: ChartTheme;
312
+ /** What was left out or shortened (hidden labels, decimated lines, …). */
313
+ warnings: ChartWarning[];
314
+ }
315
+ interface ChartIssue {
316
+ path: string;
317
+ message: string;
318
+ /** 1-based source line, for text formats such as Mermaid. */
319
+ line?: number;
320
+ }
321
+
322
+ declare const CHART_TYPES: readonly ChartType[];
323
+ declare const CHART_MARKERS: readonly ChartMarker[];
324
+ declare const CHART_TRENDLINE_TYPES: readonly ChartTrendlineType[];
325
+ declare const CHART_LABEL_POSITIONS: readonly ChartLabelPosition[];
326
+ declare const CHART_AXIS_KINDS: readonly NonNullable<ChartAxis['kind']>[];
327
+ declare const CHART_SERIES_TYPES: readonly ChartSeriesType[];
328
+ declare const CHART_STACKINGS: readonly ChartStacking[];
329
+ declare const CHART_CURVES: readonly ChartCurve[];
330
+ declare const CHART_ORIENTATIONS: readonly ChartOrientation[];
331
+ declare const CHART_LEGEND_POSITIONS: readonly ChartLegendPosition[];
332
+ declare const CHART_NUMBER_STYLES: readonly NonNullable<ChartNumberFormat['style']>[];
333
+ /** Labels for pickers, shared by the React and Svelte components. */
334
+ declare const CHART_TYPE_LABELS: Readonly<Record<ChartType, string>>;
335
+ /** How a chart type is laid out. */
336
+ type ChartFamily = 'cartesian' | 'xy' | 'pie' | 'radar' | 'waterfall' | 'histogram' | 'box' | 'funnel' | 'treemap';
337
+ /** A colour-blind-friendly categorical palette (Okabe–Ito order, tuned for light and dark backgrounds). */
338
+ declare const DEFAULT_CHART_PALETTE: readonly string[];
339
+ declare const DEFAULT_CHART_THEME: ChartTheme;
340
+ /**
341
+ * A theme that reads the page's `--background`, `--foreground`, `--muted-foreground`,
342
+ * `--border` and `--primary` colour variables (full colours, as the other components'
343
+ * inline styles use them), with light fallbacks. The React and Svelte canvases use it.
344
+ */
345
+ declare const CSS_VARIABLE_CHART_THEME: ChartTheme;
346
+ /** Bar, line, area and scatter: categories (or numeric x) against values, series may mix. */
347
+ declare function isCartesianChart(type: ChartType): boolean;
348
+ /** Whether the chart plots series against a numeric x axis (bubble charts, and scatter charts with x values). */
349
+ declare function isXyChart(spec: Pick<ChartSpec, 'type' | 'series'>): boolean;
350
+ /** How a chart is laid out (see `ChartType`). */
351
+ declare function chartFamily(spec: Pick<ChartSpec, 'type' | 'series'>): ChartFamily;
352
+ /** Chart types whose legend lists categories (one colour per category) rather than series. */
353
+ declare function chartColorsByCategory(type: ChartType): boolean;
354
+ declare function defaultChartAxis(value: boolean): ChartAxis;
355
+ /** A complete spec with every default filled in. */
356
+ declare function createChartSpec(partial?: Partial<ChartSpec>): ChartSpec;
357
+ /** The colour a series is drawn with. */
358
+ declare function chartSeriesColor(spec: Pick<ChartSpec, 'palette' | 'series'>, seriesIndex: number): string;
359
+ /** The colour a pie slice is drawn with (by category). */
360
+ declare function chartSliceColor(spec: Pick<ChartSpec, 'palette'>, index: number): string;
361
+ /** The colour of one bar or point: its override, else the series colour. */
362
+ declare function chartPointColor(spec: Pick<ChartSpec, 'palette' | 'series'>, seriesIndex: number, index: number): string;
363
+ /** How a series is drawn in a cartesian chart. */
364
+ declare function chartSeriesType(spec: Pick<ChartSpec, 'type'>, series: ChartSeries): ChartSeriesType;
365
+ /** An id not used by any series (`series-1`, `series-2`, …). */
366
+ declare function uniqueChartSeriesId(series: readonly Pick<ChartSeries, 'id'>[], base?: string): string;
367
+ /**
368
+ * Reads a number the way people type it in a data grid: `1,234.5`, `12%` (→ 0.12),
369
+ * `$40`, `(3)` (→ -3). Blank → `null`. Returns `undefined` when it is not a number.
370
+ */
371
+ declare function parseChartValue(input: unknown): ChartValue | undefined;
372
+ declare function normalizeChartAxis(value: unknown, fallback: ChartAxis, path: string, issues?: ChartIssue[]): ChartAxis;
373
+ /** Values as numbers or nulls; bad entries become null and are reported. */
374
+ declare function normalizeChartValues(value: unknown, length: number | undefined, path: string, issues?: ChartIssue[]): ChartValue[];
375
+ /** Checks one trendline; `null` (reported) when it is unusable. */
376
+ declare function normalizeChartTrendline(value: unknown, path: string, issues?: ChartIssue[]): ChartTrendline | null;
377
+ /**
378
+ * Turns any input (a partial spec, saved JSON, an agent's arguments) into a complete,
379
+ * valid `ChartSpec`. Every value is checked; problems are reported as sentences in
380
+ * `issues` and replaced by defaults, so the result is always drawable. Series values are
381
+ * padded or trimmed to the number of categories.
382
+ */
383
+ declare function normalizeChartSpec(input: unknown): {
384
+ spec: ChartSpec;
385
+ issues: ChartIssue[];
386
+ };
387
+ /** A deep copy (specs are plain JSON). */
388
+ declare function cloneChartSpec(spec: ChartSpec): ChartSpec;
389
+ declare function cloneChartSeries(series: ChartSeries): ChartSeries;
390
+ interface ChartTableOptions {
391
+ /**
392
+ * `columns` (default): the first column holds categories and each other column is a
393
+ * series. `rows`: the first row holds categories and each other row is a series.
394
+ */
395
+ seriesIn?: 'columns' | 'rows';
396
+ /**
397
+ * The first row (or column for `rows`) holds series names (default `true`). `auto`: only
398
+ * when one of its value cells is not a number.
399
+ */
400
+ header?: boolean | 'auto';
401
+ /**
402
+ * Read the first column as numeric x values (scatter and bubble charts): every series gets
403
+ * them as `x`, and the categories are their labels.
404
+ */
405
+ xFromFirstColumn?: boolean;
406
+ }
407
+ interface ChartTableData {
408
+ categories: string[];
409
+ series: ChartSeries[];
410
+ issues: ChartIssue[];
411
+ }
412
+ /**
413
+ * Reads a grid of cells (from CSV, a spreadsheet range or the clipboard) as categories and
414
+ * series. Cells that are not numbers become gaps and are reported.
415
+ */
416
+ declare function chartDataFromTable(rows: ReadonlyArray<ReadonlyArray<unknown>>, options?: ChartTableOptions): ChartTableData;
417
+ /** The chart's data as a grid: a header row of series names, then one row per category. */
418
+ declare function chartDataToTable(spec: Pick<ChartSpec, 'categories' | 'series'>, options?: {
419
+ categoryHeader?: string;
420
+ }): (string | number | null)[][];
421
+ /** A colour input value (`#rrggbb`) for a CSS colour: `#abc` expands, non-hex colours show as black. */
422
+ declare function chartColorInputValue(color: string): string;
423
+
424
+ /**
425
+ * A fitted regression trendline. Exponential, logarithmic and power fits are linear fits of
426
+ * transformed data (`ln y ~ x`, `y ~ ln x`, `ln y ~ ln x`), as spreadsheets document them;
427
+ * points the transform cannot take (values ≤ 0) are skipped, and R² is for the transformed fit.
428
+ */
429
+ interface ChartTrendFit {
430
+ type: Exclude<ChartTrendlineType, 'moving-average'>;
431
+ /** Coefficients `c0…cd` of `Y = Σ cₖ·Xᵏ` in the transformed variables. */
432
+ coefficients: number[];
433
+ /** Coefficient of determination; `null` when undefined (all y equal). */
434
+ r2: number | null;
435
+ /** The equation as a label, e.g. `y = 0.5x² - 2x + 1` or `y = 3e^(0.2x)`. */
436
+ equation: string;
437
+ /** Number of points used. */
438
+ points: number;
439
+ /** The fitted y at `x`, or `null` outside the fit's domain (x ≤ 0 for log and power). */
440
+ evaluate(x: number): number | null;
441
+ }
442
+ /**
443
+ * Fits `trendline` to the points. Returns `null` for moving averages (see
444
+ * `chartMovingAverage`) and degenerate data: too few usable points, all x equal, or a
445
+ * singular system.
446
+ */
447
+ declare function fitChartTrendline(trendline: ChartTrendline, points: ReadonlyArray<readonly [number, number]>): ChartTrendFit | null;
448
+ /** A coefficient as trendline labels show it: up to four decimals, scientific when tiny or huge. */
449
+ declare function trendNumberText(v: number): string;
450
+ /**
451
+ * Moving average of `period` consecutive points in plotted order: point `i` (from
452
+ * `period - 1`) is `(xᵢ, mean(yᵢ₋ₚ₊₁ … yᵢ))`. Empty when there are fewer points than `period`.
453
+ */
454
+ declare function chartMovingAverage(points: ReadonlyArray<readonly [number, number]>, period: number): [number, number][];
455
+ /** The legend name spreadsheets give a trendline, e.g. `Linear (Sales)`. */
456
+ declare function chartTrendlineName(trendline: ChartTrendline, seriesName: string): string;
457
+ /** Whether trendlines can be drawn for this chart type and stacking (unstacked cartesian and xy charts). */
458
+ declare function chartSupportsTrendlines(type: string, stacking: string): boolean;
459
+
460
+ type ChartTextMeasure = (text: string, size: number, weight?: number) => number;
461
+ interface ChartLayoutOptions {
462
+ width: number;
463
+ height: number;
464
+ theme?: Partial<ChartTheme>;
465
+ /** Highlighted in the scene (selection outlines, `selected` flags). */
466
+ selection?: ChartSelection | null;
467
+ /** Text width in pixels (default: an estimate from the character count). */
468
+ measureText?: ChartTextMeasure;
469
+ /** Shown when there is nothing to draw (default "No data"). */
470
+ emptyMessage?: string;
471
+ /**
472
+ * Fixes the value axis to this range (over `yAxis.min` / `yAxis.max`). Canvases pass
473
+ * `ChartPointDrag.valueDomain` during a drag so the axis does not rescale under the pointer.
474
+ */
475
+ valueDomain?: {
476
+ min: number;
477
+ max: number;
478
+ } | null;
479
+ /** Fixes the secondary value axis the same way (`ChartPointDrag.valueDomain2`). */
480
+ valueDomain2?: {
481
+ min: number;
482
+ max: number;
483
+ } | null;
484
+ /** Fixes the numeric x axis of a scatter or bubble chart (`ChartPointDrag.xDomain`). */
485
+ xDomain?: {
486
+ min: number;
487
+ max: number;
488
+ } | null;
489
+ /** Shows the value of this point next to it (a `drag-readout` text mark, kept inside the plot). */
490
+ readout?: {
491
+ seriesId: string;
492
+ index: number;
493
+ } | null;
494
+ }
495
+ /** A DOM-free text width estimate (average glyph ≈ 0.56 em, bold ≈ 0.6 em). */
496
+ declare const estimateChartTextWidth: ChartTextMeasure;
497
+ /** Whether two selections point at the same thing. */
498
+ declare function sameChartSelection(a: ChartSelection | null | undefined, b: ChartSelection | null | undefined): boolean;
499
+ /**
500
+ * Black or white text for a label drawn on `fill` (#rgb, #rrggbb or rgb()), by perceived
501
+ * luminance (0.299 R + 0.587 G + 0.114 B). Unparseable colours (CSS variables) get white.
502
+ */
503
+ declare function contrastingTextColor(fill: string): string;
504
+
505
+ /** SVG `dominant-baseline` for a text mark's baseline (shared by every renderer). */
506
+ declare function chartTextBaseline(baseline: ChartTextMark['baseline']): 'hanging' | 'central' | 'text-after-edge';
507
+ /** SVG `transform` for a rotated text mark, if any. */
508
+ declare function chartTextTransform(mark: ChartTextMark): string | undefined;
509
+ interface ChartSvgOptions {
510
+ /** Leave out selection outlines (default `true`: exports show the chart only). */
511
+ hideSelection?: boolean;
512
+ /** Accessible title (default: the chart title). */
513
+ ariaLabel?: string;
514
+ /** A longer description written as `<desc>` (`chartToSvg` defaults to `describeChart`). */
515
+ description?: string;
516
+ }
517
+ /** Writes a laid-out scene as a standalone SVG document string. */
518
+ declare function chartSceneToSvg(scene: ChartScene, options?: ChartSvgOptions): string;
519
+ /** Lays out and writes a chart as SVG, e.g. for export or server rendering. */
520
+ declare function chartToSvg(spec: ChartSpec, options: Omit<ChartLayoutOptions, 'selection'> & ChartSvgOptions): string;
521
+ /** A ProseMirror / TipTap `DOMOutputSpec` array (kept structural so this module needs no TipTap types). */
522
+ type ChartDomSpec = [string, Record<string, string>, ...(ChartDomSpec | string)[]];
523
+ /**
524
+ * Writes a laid-out scene as a ProseMirror `DOMOutputSpec` (SVG-namespaced tags), so a
525
+ * TipTap node's `renderHTML` can draw a chart without parsing an SVG string. Same output
526
+ * as `chartSceneToSvg`.
527
+ */
528
+ declare function chartSceneToDomSpec(scene: ChartScene, options?: ChartSvgOptions & {
529
+ attrs?: Record<string, string>;
530
+ }): ChartDomSpec;
531
+
532
+ type ChartSparklineKind = 'line' | 'column' | 'win-loss';
533
+ interface ChartSparklineOptions {
534
+ kind?: ChartSparklineKind;
535
+ width: number;
536
+ height: number;
537
+ /** Line, positive column and win colour (default the first palette colour). */
538
+ color?: string;
539
+ /** Negative column and loss colour (default red). */
540
+ negativeColor?: string;
541
+ /** Dots on every line point (thinned past 500). */
542
+ markers?: boolean;
543
+ /** Highlight the highest and lowest point of a line (or column). */
544
+ highLow?: boolean;
545
+ /** Fixed value range (default: the data, including 0 for columns). */
546
+ min?: number;
547
+ max?: number;
548
+ }
549
+ /**
550
+ * Lays out a word-sized chart (a sparkline) as marks: a line broken at gaps, columns
551
+ * (negatives in `negativeColor`) or win/loss bars of equal height. Long lines are thinned past
552
+ * 4000 points. Returns a scene with no axes, legend or targets.
553
+ */
554
+ declare function layoutSparkline(values: readonly ChartValue[], options: ChartSparklineOptions): ChartScene;
555
+ /** A sparkline as a standalone SVG string (e.g. for an inline image in rich text). */
556
+ declare function sparklineToSvg(values: readonly ChartValue[], options: ChartSparklineOptions & {
557
+ ariaLabel?: string;
558
+ }): string;
559
+
560
+ interface ChartControllerOptions {
561
+ /** Starting chart (any partial or saved spec; problems are reported in `state.issues`). */
562
+ spec?: Partial<ChartSpec> | unknown;
563
+ /** History to record into, e.g. one shared with the rest of the app (default: a new one). */
564
+ history?: HistoryManager;
565
+ /** Called after the spec changes (edit, undo, redo, load). */
566
+ onChange?: (spec: Readonly<ChartSpec>) => void;
567
+ }
568
+ /** A snapshot of the controller. The same object is returned until something changes. */
569
+ interface ChartState {
570
+ spec: Readonly<ChartSpec>;
571
+ selection: ChartSelection | null;
572
+ /** The series the selection belongs to (a series, one of its points or one of its trendlines). */
573
+ selectedSeries: ChartSeries | null;
574
+ /** The category the selection belongs to (a category or a point). */
575
+ selectedIndex: number | null;
576
+ /** Problems from the last load or rejected edit, as sentences. */
577
+ issues: readonly ChartIssue[];
578
+ /** The gesture in progress (e.g. a bar drag), if any. */
579
+ gesture: string | null;
580
+ canUndo: boolean;
581
+ canRedo: boolean;
582
+ undoLabel: string;
583
+ redoLabel: string;
584
+ /** Bumped on every change. */
585
+ revision: number;
586
+ }
587
+ type ChartActionResult = {
588
+ ok: true;
589
+ } | {
590
+ ok: false;
591
+ message: string;
592
+ issues?: ChartIssue[];
593
+ };
594
+ /** Top-level fields with partial axes and legend. */
595
+ type ChartSpecPatch = Partial<Omit<ChartSpec, 'version' | 'xAxis' | 'yAxis' | 'yAxis2' | 'legend'>> & {
596
+ xAxis?: Partial<ChartAxis>;
597
+ yAxis?: Partial<ChartAxis>;
598
+ yAxis2?: Partial<ChartAxis>;
599
+ legend?: Partial<ChartLegend>;
600
+ };
601
+ interface ChartSeriesInput {
602
+ id?: string;
603
+ name?: string;
604
+ values?: readonly unknown[];
605
+ color?: string;
606
+ type?: ChartSeriesType;
607
+ hidden?: boolean;
608
+ axis?: 'primary' | 'secondary';
609
+ x?: readonly unknown[];
610
+ sizes?: readonly unknown[];
611
+ pointColors?: readonly (string | null)[];
612
+ marker?: ChartMarker;
613
+ curve?: ChartCurve;
614
+ dataLabels?: boolean;
615
+ format?: ChartNumberFormat;
616
+ trendlines?: readonly ChartTrendline[];
617
+ }
618
+ /** Changes to one series; `null` resets a field to the chart's default. */
619
+ interface ChartSeriesPatch {
620
+ name?: string;
621
+ /** `null` goes back to the palette colour. */
622
+ color?: string | null;
623
+ /** `null` follows the chart type. */
624
+ type?: ChartSeriesType | null;
625
+ hidden?: boolean;
626
+ axis?: 'primary' | 'secondary' | null;
627
+ x?: readonly unknown[] | null;
628
+ sizes?: readonly unknown[] | null;
629
+ pointColors?: readonly (string | null)[] | null;
630
+ marker?: ChartMarker | null;
631
+ curve?: ChartCurve | null;
632
+ dataLabels?: boolean | null;
633
+ format?: ChartNumberFormat | null;
634
+ }
635
+ interface ChartEditOptions {
636
+ /** Undo step label. */
637
+ label?: string;
638
+ }
639
+ /**
640
+ * Headless state for a chart editor: a validated `ChartSpec`, a selection, and undoable
641
+ * edits to data (values, series, categories, pasted grids, CSV) and presentation (type,
642
+ * titles, axes, legend, stacking, …). Drags merge into one undo step (`beginGesture`).
643
+ * `getState()` returns the same object until something changes, so it works with
644
+ * `useSyncExternalStore` and Svelte runes alike.
645
+ */
646
+ declare class ChartController {
647
+ readonly history: HistoryManager;
648
+ private spec;
649
+ private selection;
650
+ private issues;
651
+ private gestureKey;
652
+ private gestureCount;
653
+ private gestureStart;
654
+ private revision;
655
+ private applying;
656
+ private readonly onChange?;
657
+ private readonly listeners;
658
+ private unsubscribeHistory?;
659
+ private state;
660
+ constructor(options?: ChartControllerOptions);
661
+ private connect;
662
+ /** The current snapshot (stable until the next change). */
663
+ getState: () => ChartState;
664
+ /** Calls `listener` after every change. Returns an unsubscribe function. */
665
+ subscribe: (listener: (state: ChartState) => void) => (() => void);
666
+ /** The current spec (do not mutate; edit through the controller). */
667
+ getSpec(): Readonly<ChartSpec>;
668
+ getSeries(id: string): ChartSeries | undefined;
669
+ private computeState;
670
+ private notify;
671
+ /** Drops a selection that no longer points at anything. */
672
+ private validSelection;
673
+ private applySpec;
674
+ private commit;
675
+ private reject;
676
+ /** A copy of the spec with `edit` applied (series and categories copied as needed). */
677
+ private edited;
678
+ private unknownSeries;
679
+ private badIndex;
680
+ /**
681
+ * Changes any presentation or data fields as one undo step. All-or-nothing: if anything
682
+ * is invalid, nothing changes and every problem is returned (and shown in `state.issues`).
683
+ */
684
+ update(patch: ChartSpecPatch, options?: ChartEditOptions): ChartActionResult;
685
+ setType(type: ChartType): ChartActionResult;
686
+ setTitle(title: string): ChartActionResult;
687
+ setSubtitle(subtitle: string): ChartActionResult;
688
+ /** Changes the category (`x`), value (`y`) or secondary value (`y2`) axis. */
689
+ setAxis(axis: 'x' | 'y' | 'y2', patch: Partial<ChartAxis>): ChartActionResult;
690
+ /**
691
+ * Applies a named quick layout and / or colour scheme (see `CHART_LAYOUT_PRESETS` and
692
+ * `CHART_COLOR_SCHEMES`) as one undo step.
693
+ */
694
+ applyPreset(options: {
695
+ layout?: string;
696
+ colors?: string;
697
+ }): ChartActionResult;
698
+ setLegend(patch: Partial<ChartLegend>): ChartActionResult;
699
+ /**
700
+ * Replaces categories and / or series as one undo step. Values are validated and padded
701
+ * to the categories; all-or-nothing like `update`.
702
+ */
703
+ setData(data: {
704
+ categories?: readonly unknown[];
705
+ series?: readonly ChartSeriesInput[];
706
+ }, options?: ChartEditOptions): ChartActionResult;
707
+ /**
708
+ * Sets one value (numbers, numeric text such as `1,200` or `12%`, or blank for a gap).
709
+ * One undo step, or part of the current gesture.
710
+ */
711
+ setValue(seriesId: string, index: number, value: unknown, options?: ChartEditOptions): ChartActionResult;
712
+ /** Several values as one undo step (all-or-nothing). */
713
+ setValues(cells: readonly {
714
+ seriesId: string;
715
+ index: number;
716
+ value: unknown;
717
+ }[], options?: ChartEditOptions): ChartActionResult;
718
+ /** Adds a series (values padded to the categories) and selects it. Returns its id. */
719
+ addSeries(input?: ChartSeriesInput, options?: {
720
+ at?: number;
721
+ }): {
722
+ ok: true;
723
+ id: string;
724
+ } | {
725
+ ok: false;
726
+ message: string;
727
+ issues?: ChartIssue[];
728
+ };
729
+ removeSeries(id: string): ChartActionResult;
730
+ updateSeries(id: string, patch: ChartSeriesPatch): ChartActionResult;
731
+ toggleSeries(id: string): ChartActionResult;
732
+ /** Moves a series to position `to` (drawing and legend order). */
733
+ moveSeries(id: string, to: number): ChartActionResult;
734
+ /** Inserts a category (with gaps in every series) at `at` (default: the end). Returns its index. */
735
+ addCategory(label?: string, options?: {
736
+ at?: number;
737
+ }): {
738
+ ok: true;
739
+ index: number;
740
+ };
741
+ removeCategory(index: number): ChartActionResult;
742
+ renameCategory(index: number, label: string): ChartActionResult;
743
+ moveCategory(from: number, to: number): ChartActionResult;
744
+ /**
745
+ * Pastes a block of cells (TSV / CSV text or rows) into the data grid with its top-left at
746
+ * `row` (category index) and `column` (series index; `-1` is the category column). The
747
+ * grid grows to fit. Non-numeric value cells become gaps and are reported in `issues`.
748
+ */
749
+ pasteCells(row: number, column: number, cells: string | ReadonlyArray<ReadonlyArray<unknown>>): ChartActionResult & {
750
+ issues?: ChartIssue[];
751
+ };
752
+ /**
753
+ * Replaces the data with a grid of cells (see `chartDataFromTable`): one undo step. Series
754
+ * colours and types are kept by name.
755
+ */
756
+ importTable(rows: ReadonlyArray<ReadonlyArray<unknown>>, options?: ChartTableOptions): ChartActionResult & {
757
+ issues?: ChartIssue[];
758
+ };
759
+ /** Imports CSV (or TSV, detected by tabs) text; see `importTable`. */
760
+ importCsv(text: string, options?: ChartTableOptions & {
761
+ delimiter?: string;
762
+ }): ChartActionResult & {
763
+ issues?: ChartIssue[];
764
+ };
765
+ /** Adds a trendline to a series and selects it. Returns its index (and the fit, when it can be computed). */
766
+ addTrendline(seriesId: string, input: ChartTrendline): {
767
+ ok: true;
768
+ index: number;
769
+ fit: ChartTrendFit | null;
770
+ } | {
771
+ ok: false;
772
+ message: string;
773
+ issues?: ChartIssue[];
774
+ };
775
+ /** Changes a trendline (all-or-nothing). */
776
+ updateTrendline(seriesId: string, index: number, patch: Partial<ChartTrendline>): ChartActionResult;
777
+ removeTrendline(seriesId: string, index: number): ChartActionResult;
778
+ /** The points a series' trendlines are fitted to: (x, y) with x = 1, 2, 3 … on category charts. */
779
+ trendlinePoints(seriesId: string): [number, number][];
780
+ /** The fitted coefficients, R² and equation of a trendline (null for moving averages or unfittable data). */
781
+ trendlineFit(seriesId: string, index: number): ChartTrendFit | null;
782
+ /** The moving-average points of a trendline (empty for other kinds). */
783
+ trendlineMovingAverage(seriesId: string, index: number): [number, number][];
784
+ /**
785
+ * Switches rows and columns: series become categories and categories become series (one
786
+ * undo step). Series colours, types and other per-series settings are dropped.
787
+ */
788
+ transpose(): ChartActionResult;
789
+ /** Selects a chart element (view state; not an undo step). */
790
+ select(selection: ChartSelection | null): void;
791
+ /**
792
+ * Deletes what is selected: a series or category is removed, a point becomes a gap, a
793
+ * title is cleared, the legend or an axis is hidden.
794
+ */
795
+ deleteSelection(): ChartActionResult;
796
+ /** Adds `delta` to a value (a gap counts as 0). */
797
+ nudgeValue(seriesId: string, index: number, delta: number): ChartActionResult;
798
+ /** Starts a continuous edit (a drag): every change until `endGesture()` is one undo step. */
799
+ beginGesture(key: string): void;
800
+ /**
801
+ * Cancels the gesture in progress (Escape during a drag): everything it changed is taken
802
+ * back and leaves no undo or redo step.
803
+ */
804
+ cancelGesture(): void;
805
+ endGesture(): void;
806
+ /** The spec, for saving (a copy). */
807
+ toJSON(): ChartSpec;
808
+ /**
809
+ * Replaces the chart without an undo step (e.g. when opening a document). Problems are
810
+ * fixed with defaults and reported in `state.issues` (and returned).
811
+ */
812
+ load(input: unknown, options?: {
813
+ clearHistory?: boolean;
814
+ }): ChartIssue[];
815
+ undo(): boolean;
816
+ redo(): boolean;
817
+ /** Stops listening to the history (reconnected by the next `subscribe`). */
818
+ destroy(): void;
819
+ }
820
+ declare function createChartController(options?: ChartControllerOptions): ChartController;
821
+
822
+ export { type ChartTableData as $, CHART_TYPES as A, CHART_TYPE_LABELS as B, type ChartNumberFormat as C, CSS_VARIABLE_CHART_THEME as D, type ChartActionResult as E, type ChartCircleMark as F, type ChartControllerOptions as G, type ChartCurve as H, type ChartDomSpec as I, type ChartEditOptions as J, type ChartFamily as K, type ChartLabelPosition as L, type ChartLegendPosition as M, type ChartLineMark as N, type ChartMark as O, type ChartMarkRole as P, type ChartMarker as Q, type ChartOrientation as R, type ChartPathMark as S, type ChartRectMark as T, type ChartSeriesInput as U, type ChartSeriesPatch as V, type ChartSeriesType as W, type ChartSparklineKind as X, type ChartSparklineOptions as Y, type ChartState as Z, type ChartSvgOptions as _, type ChartValue as a, type ChartTableOptions as a0, type ChartTextMark as a1, type ChartTextMeasure as a2, type ChartTheme as a3, type ChartTrendFit as a4, type ChartTrendline as a5, type ChartTrendlineType as a6, DEFAULT_CHART_PALETTE as a7, DEFAULT_CHART_THEME as a8, chartColorInputValue as a9, layoutSparkline as aA, normalizeChartAxis as aB, normalizeChartSpec as aC, normalizeChartTrendline as aD, normalizeChartValues as aE, parseChartValue as aF, sameChartSelection as aG, sparklineToSvg as aH, trendNumberText as aI, uniqueChartSeriesId as aJ, chartColorsByCategory as aa, chartDataFromTable as ab, chartDataToTable as ac, chartFamily as ad, chartMovingAverage as ae, chartPointColor as af, chartSceneToDomSpec as ag, chartSceneToSvg as ah, chartSeriesColor as ai, chartSeriesType as aj, chartSliceColor as ak, chartSupportsTrendlines as al, chartTextBaseline as am, chartTextTransform as an, chartToSvg as ao, chartTrendlineName as ap, cloneChartSeries as aq, cloneChartSpec as ar, contrastingTextColor as as, createChartController as at, createChartSpec as au, defaultChartAxis as av, estimateChartTextWidth as aw, fitChartTrendline as ax, isCartesianChart as ay, isXyChart as az, type ChartRect as b, type ChartScene as c, type ChartSpec as d, type ChartLayoutOptions as e, type ChartWarning as f, type ChartAxis as g, type ChartLegend as h, type ChartType as i, type ChartStacking as j, type ChartSeries as k, type ChartIssue as l, ChartController as m, type ChartValueScale as n, type ChartSelection as o, type ChartSpecPatch as p, CHART_AXIS_KINDS as q, CHART_CURVES as r, CHART_LABEL_POSITIONS as s, CHART_LEGEND_POSITIONS as t, CHART_MARKERS as u, CHART_NUMBER_STYLES as v, CHART_ORIENTATIONS as w, CHART_SERIES_TYPES as x, CHART_STACKINGS as y, CHART_TRENDLINE_TYPES as z };