@pixerate/editor 0.54.0 → 0.56.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.
- package/dist/agent/index.cjs +24 -23
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.js +9 -8
- package/dist/agent/index.js.map +1 -1
- package/dist/animation/index.cjs +1 -1
- package/dist/animation/index.cjs.map +1 -1
- package/dist/animation/index.d.cts +2 -1
- package/dist/animation/index.d.ts +2 -1
- package/dist/animation/index.js +1 -1
- package/dist/animation-editor/index.cjs +2221 -0
- package/dist/animation-editor/index.cjs.map +1 -0
- package/dist/animation-editor/index.d.cts +1117 -0
- package/dist/animation-editor/index.d.ts +1117 -0
- package/dist/animation-editor/index.js +2221 -0
- package/dist/animation-editor/index.js.map +1 -0
- package/dist/bezier-BfwIbVTl.d.cts +548 -0
- package/dist/bezier-DYBvLgUH.d.ts +548 -0
- package/dist/canvas/index.cjs +2740 -580
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +402 -6
- package/dist/canvas/index.d.ts +402 -6
- package/dist/canvas/index.js +2735 -575
- package/dist/canvas/index.js.map +1 -1
- package/dist/chart/index.cjs +33 -31
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.d.cts +4 -2
- package/dist/chart/index.d.ts +4 -2
- package/dist/chart/index.js +21 -19
- package/dist/chart/index.js.map +1 -1
- package/dist/{chunk-C3JHII3M.cjs → chunk-3I6V7PI4.cjs} +45 -45
- package/dist/{chunk-C3JHII3M.cjs.map → chunk-3I6V7PI4.cjs.map} +1 -1
- package/dist/{chunk-P43HUQRX.cjs → chunk-AHCENCU4.cjs} +12 -10
- package/dist/chunk-AHCENCU4.cjs.map +1 -0
- package/dist/{chunk-TO22LX34.js → chunk-GTMJ4Y3S.js} +2208 -2920
- package/dist/chunk-GTMJ4Y3S.js.map +1 -0
- package/dist/chunk-II77MLHN.cjs +11106 -0
- package/dist/chunk-II77MLHN.cjs.map +1 -0
- package/dist/{chunk-OIKYP7XC.js → chunk-LMUDHBWR.js} +2 -2
- package/dist/chunk-MLREO6J3.cjs +737 -0
- package/dist/chunk-MLREO6J3.cjs.map +1 -0
- package/dist/chunk-NONDTTH7.js +5979 -0
- package/dist/chunk-NONDTTH7.js.map +1 -0
- package/dist/{chunk-YNSK4MGT.cjs → chunk-O2UH7LZE.cjs} +1549 -2261
- package/dist/chunk-O2UH7LZE.cjs.map +1 -0
- package/dist/{chunk-VODBAO32.js → chunk-OEFCLWZ3.js} +4 -1425
- package/dist/chunk-OEFCLWZ3.js.map +1 -0
- package/dist/{chunk-NK3WL5TJ.cjs → chunk-P2CTDJNF.cjs} +27 -1448
- package/dist/chunk-P2CTDJNF.cjs.map +1 -0
- package/dist/chunk-TKPPIVW7.cjs +1443 -0
- package/dist/chunk-TKPPIVW7.cjs.map +1 -0
- package/dist/chunk-VWZB6BCY.js +737 -0
- package/dist/chunk-VWZB6BCY.js.map +1 -0
- package/dist/chunk-WJSCGBJ2.js +11106 -0
- package/dist/chunk-WJSCGBJ2.js.map +1 -0
- package/dist/{chunk-RIXTW3C4.js → chunk-WLVZ235X.js} +5 -3
- package/dist/{chunk-RIXTW3C4.js.map → chunk-WLVZ235X.js.map} +1 -1
- package/dist/chunk-XCXQDPID.cjs +5979 -0
- package/dist/chunk-XCXQDPID.cjs.map +1 -0
- package/dist/chunk-ZOH6X3VR.js +1443 -0
- package/dist/chunk-ZOH6X3VR.js.map +1 -0
- package/dist/color-E9pwm--w.d.cts +33 -0
- package/dist/color-E9pwm--w.d.ts +33 -0
- package/dist/commands/index.cjs +2 -2
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.js +3 -3
- package/dist/{controller-DscWQbjO.d.ts → controller-D2rj5umx.d.ts} +2 -362
- package/dist/{controller-CX0QfSv0.d.cts → controller-R2biKk_E.d.cts} +2 -362
- package/dist/diagram/index.cjs +1481 -50
- package/dist/diagram/index.cjs.map +1 -1
- package/dist/diagram/index.d.cts +1757 -15
- package/dist/diagram/index.d.ts +1757 -15
- package/dist/diagram/index.js +1469 -38
- package/dist/diagram/index.js.map +1 -1
- package/dist/extensions/index.cjs +5 -4
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +4 -3
- package/dist/extensions/index.d.ts +4 -3
- package/dist/extensions/index.js +4 -3
- package/dist/{index-DIWB6xMf.d.cts → index-BcHyG0Wq.d.cts} +2 -1
- package/dist/{index-CALDD35B.d.ts → index-CTCc3m3C.d.ts} +2 -1
- package/dist/index.cjs +10 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/pathfinder-BZL8aSu0.d.cts +469 -0
- package/dist/pathfinder-CNtsbCRK.d.ts +469 -0
- package/dist/{player-DSMjdgQ9.d.cts → player-Dg0FT0UI.d.cts} +1 -33
- package/dist/{player-DdfVrKWq.d.ts → player-W-5DX3Go.d.ts} +1 -33
- package/dist/svg-CLg2zqZA.d.cts +847 -0
- package/dist/svg-CPK82TtU.d.ts +847 -0
- package/dist/types-BRp-6zkY.d.cts +362 -0
- package/dist/types-BRp-6zkY.d.ts +362 -0
- package/dist/{types-BULrFyuQ.d.cts → types-DYkjhzdz.d.cts} +1 -1
- package/dist/{types-BULrFyuQ.d.ts → types-DYkjhzdz.d.ts} +1 -1
- package/dist/vector/index.cjs +1328 -6752
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +6 -846
- package/dist/vector/index.d.ts +6 -846
- package/dist/vector/index.js +645 -6069
- package/dist/vector/index.js.map +1 -1
- package/package.json +6 -1
- package/dist/chunk-H5K77C7Y.cjs +0 -3848
- package/dist/chunk-H5K77C7Y.cjs.map +0 -1
- package/dist/chunk-NK3WL5TJ.cjs.map +0 -1
- package/dist/chunk-P43HUQRX.cjs.map +0 -1
- package/dist/chunk-TO22LX34.js.map +0 -1
- package/dist/chunk-VODBAO32.js.map +0 -1
- package/dist/chunk-WWJNC7SX.js +0 -3848
- package/dist/chunk-WWJNC7SX.js.map +0 -1
- package/dist/chunk-YNSK4MGT.cjs.map +0 -1
- package/dist/pathfinder-B9xh_pCZ.d.ts +0 -1013
- package/dist/pathfinder-QdG70sr9.d.cts +0 -1013
- /package/dist/{chunk-OIKYP7XC.js.map → chunk-LMUDHBWR.js.map} +0 -0
|
@@ -1,366 +1,6 @@
|
|
|
1
|
+
import { C as ChartAxis, a as ChartCurve, b as ChartLabelPosition, c as ChartLegendPosition, d as ChartMarker, e as ChartNumberFormat, f as ChartOrientation, g as ChartSeriesType, h as ChartStacking, i as ChartTrendlineType, j as ChartType, k as ChartTheme, l as ChartSeries, m as ChartIssue, n as ChartSpec, o as ChartErrorBars, p as ChartTrendline, q as ChartValue, r as ChartSelection, s as ChartScene, t as ChartTextMark, u as ChartLegend } from './types-BRp-6zkY.cjs';
|
|
1
2
|
import { H as HistoryManager } from './HistoryManager-DeQQMBCj.cjs';
|
|
2
3
|
|
|
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
|
-
/** How error amounts are worked out (as in spreadsheets: Excel's `c:errValType`). */
|
|
47
|
-
type ChartErrorBarType = 'fixed' | 'percent' | 'stddev' | 'stderr' | 'custom';
|
|
48
|
-
/**
|
|
49
|
-
* Error bars on a series (Excel's `c:errBars`). Amounts are in data units and drawn from each
|
|
50
|
-
* point, except `stddev`, which is drawn around the series mean as Excel does.
|
|
51
|
-
*/
|
|
52
|
-
interface ChartErrorBars {
|
|
53
|
-
/**
|
|
54
|
-
* - `fixed`: the same amount at every point (`value`, default 1).
|
|
55
|
-
* - `percent`: `value` percent of each point's value (default 5).
|
|
56
|
-
* - `stddev`: `value` standard deviations of the series (default 1), around the series mean.
|
|
57
|
-
* - `stderr`: the standard error of the series (sample standard deviation / √n) at every point.
|
|
58
|
-
* - `custom`: per-point amounts from `plus` and `minus`.
|
|
59
|
-
*/
|
|
60
|
-
type: ChartErrorBarType;
|
|
61
|
-
/** The amount for `fixed`, `percent` and `stddev` (see `type` for defaults). */
|
|
62
|
-
value?: number;
|
|
63
|
-
/** Custom amounts above each point (0 or more; `null`: none). */
|
|
64
|
-
plus?: ChartValue[];
|
|
65
|
-
/** Custom amounts below each point (0 or more; `null`: none). Defaults to `plus`. */
|
|
66
|
-
minus?: ChartValue[];
|
|
67
|
-
/** Which way the bars go (default `both`). */
|
|
68
|
-
direction?: 'both' | 'plus' | 'minus';
|
|
69
|
-
/** Draw end caps (default `true`). */
|
|
70
|
-
cap?: boolean;
|
|
71
|
-
}
|
|
72
|
-
interface ChartSeries {
|
|
73
|
-
/** Stable id (unique within the chart). */
|
|
74
|
-
id: string;
|
|
75
|
-
name: string;
|
|
76
|
-
/** One value per category (the y values of a scatter or bubble chart). */
|
|
77
|
-
values: ChartValue[];
|
|
78
|
-
/** CSS colour (default: the palette colour for the series' position). */
|
|
79
|
-
color?: string;
|
|
80
|
-
/** Overrides the chart type for this series (cartesian charts only). */
|
|
81
|
-
type?: ChartSeriesType;
|
|
82
|
-
/** Hidden series keep their data but are not drawn or scaled. */
|
|
83
|
-
hidden?: boolean;
|
|
84
|
-
/** Plot against the secondary value axis (on the right). */
|
|
85
|
-
axis?: 'primary' | 'secondary';
|
|
86
|
-
/** Numeric x per category (scatter and bubble charts). */
|
|
87
|
-
x?: ChartValue[];
|
|
88
|
-
/** Bubble sizes per category (bubble charts; area is proportional to size). */
|
|
89
|
-
sizes?: ChartValue[];
|
|
90
|
-
/** Colour overrides per category (`null` keeps the series colour). */
|
|
91
|
-
pointColors?: (string | null)[];
|
|
92
|
-
/** Point marker (default: circles on lines when `points` is on). */
|
|
93
|
-
marker?: ChartMarker;
|
|
94
|
-
/** Line interpolation for this series (default: the chart's `curve`). */
|
|
95
|
-
curve?: ChartCurve;
|
|
96
|
-
/** Value labels for this series (default: the chart's `dataLabels`). */
|
|
97
|
-
dataLabels?: boolean;
|
|
98
|
-
/** How this series' data labels are written (default: the value axis format). */
|
|
99
|
-
format?: ChartNumberFormat;
|
|
100
|
-
/** Fitted lines drawn over the series. */
|
|
101
|
-
trendlines?: ChartTrendline[];
|
|
102
|
-
/** Error bars along the value axis (bar, line, area and scatter series). */
|
|
103
|
-
errorBars?: ChartErrorBars;
|
|
104
|
-
/** Error bars along the numeric x axis (scatter charts with x values). */
|
|
105
|
-
xErrorBars?: ChartErrorBars;
|
|
106
|
-
}
|
|
107
|
-
interface ChartNumberFormat {
|
|
108
|
-
/** `number` (default), `percent` (0.25 → 25%), `currency` or `compact` (1.2K). */
|
|
109
|
-
style?: 'number' | 'percent' | 'currency' | 'compact';
|
|
110
|
-
/** Fixed decimals (default: as many as the ticks need, up to 2). */
|
|
111
|
-
decimals?: number;
|
|
112
|
-
/** ISO currency code for `currency` (default `USD`). */
|
|
113
|
-
currency?: string;
|
|
114
|
-
prefix?: string;
|
|
115
|
-
suffix?: string;
|
|
116
|
-
/**
|
|
117
|
-
* A spreadsheet format code such as `#,##0.0,,"M"` or `0.0%;[Red]-0.0%`. When set it
|
|
118
|
-
* wins over the other fields. Supports sections (positive;negative;zero), digit
|
|
119
|
-
* placeholders, thousands separators and scaling, percent, scientific and literal text.
|
|
120
|
-
*/
|
|
121
|
-
code?: string;
|
|
122
|
-
}
|
|
123
|
-
interface ChartAxis {
|
|
124
|
-
/** Draw the axis line, ticks and labels (default `true`). */
|
|
125
|
-
show: boolean;
|
|
126
|
-
title: string;
|
|
127
|
-
/** Fixed lower bound (default: from the data, including 0 for bars and areas). */
|
|
128
|
-
min: number | null;
|
|
129
|
-
/** Fixed upper bound (default: from the data). */
|
|
130
|
-
max: number | null;
|
|
131
|
-
/** Fixed distance between ticks (default: a round number from the plot size). */
|
|
132
|
-
step: number | null;
|
|
133
|
-
/** Grid lines at each tick (default: on for the value axis). */
|
|
134
|
-
gridlines: boolean;
|
|
135
|
-
/** How tick and data labels are written (value axes, and the x axis of scatter charts). */
|
|
136
|
-
format: ChartNumberFormat;
|
|
137
|
-
/**
|
|
138
|
-
* Category axis only: `date` reads the categories as dates (ISO `2024-03-01`, `2024-03`,
|
|
139
|
-
* `2024`), labels them with calendar steps that fit, and thins the rest.
|
|
140
|
-
*/
|
|
141
|
-
kind?: 'category' | 'date';
|
|
142
|
-
/**
|
|
143
|
-
* Value axes (and the numeric x axis of scatter and bubble charts): `log` spaces ticks by
|
|
144
|
-
* powers of `logBase`. Values of 0 or less cannot be drawn and are skipped. Not allowed with
|
|
145
|
-
* percent stacking. Absent means `linear`.
|
|
146
|
-
*/
|
|
147
|
-
scale?: 'linear' | 'log';
|
|
148
|
-
/** Base of a logarithmic axis, 2–1000 (default 10). */
|
|
149
|
-
logBase?: number;
|
|
150
|
-
/** Run the axis the other way: values from the top down, or categories from right to left. */
|
|
151
|
-
reverse?: boolean;
|
|
152
|
-
}
|
|
153
|
-
type ChartLegendPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
154
|
-
interface ChartLegend {
|
|
155
|
-
show: boolean;
|
|
156
|
-
position: ChartLegendPosition;
|
|
157
|
-
}
|
|
158
|
-
type ChartStacking = 'none' | 'stacked' | 'percent';
|
|
159
|
-
type ChartOrientation = 'vertical' | 'horizontal';
|
|
160
|
-
type ChartCurve = 'linear' | 'smooth' | 'step';
|
|
161
|
-
/** Where bar labels go: `auto` puts them outside, or centred on stacked segments, and drops ones that do not fit. */
|
|
162
|
-
type ChartLabelPosition = 'auto' | 'inside' | 'outside' | 'center';
|
|
163
|
-
/** A whole chart: data plus presentation. Plain JSON, safe to persist. */
|
|
164
|
-
interface ChartSpec {
|
|
165
|
-
version: 1;
|
|
166
|
-
type: ChartType;
|
|
167
|
-
title: string;
|
|
168
|
-
subtitle: string;
|
|
169
|
-
/** Category labels (the x axis, or pie slices). */
|
|
170
|
-
categories: string[];
|
|
171
|
-
series: ChartSeries[];
|
|
172
|
-
/** The category axis (or the numeric x axis of a scatter or bubble chart). */
|
|
173
|
-
xAxis: ChartAxis;
|
|
174
|
-
/** The value axis. */
|
|
175
|
-
yAxis: ChartAxis;
|
|
176
|
-
/** The secondary value axis, drawn on the right when a visible series uses it. */
|
|
177
|
-
yAxis2: ChartAxis;
|
|
178
|
-
legend: ChartLegend;
|
|
179
|
-
/** Stack bars and areas (`percent` scales each category to 100%). */
|
|
180
|
-
stacking: ChartStacking;
|
|
181
|
-
/** `horizontal` draws bars sideways (bar charts only). */
|
|
182
|
-
orientation: ChartOrientation;
|
|
183
|
-
/** Line and area interpolation. */
|
|
184
|
-
curve: ChartCurve;
|
|
185
|
-
/** Dots on line and area series. */
|
|
186
|
-
points: boolean;
|
|
187
|
-
/** Value labels on bars, points and slices. */
|
|
188
|
-
dataLabels: boolean;
|
|
189
|
-
/** Where bar value labels go. */
|
|
190
|
-
labelPosition: ChartLabelPosition;
|
|
191
|
-
/** Series colours in order (cycled through lighter and darker shades once used up). */
|
|
192
|
-
palette: string[];
|
|
193
|
-
/** Donut hole as a fraction of the radius (0–0.9). */
|
|
194
|
-
innerRadius: number;
|
|
195
|
-
/** Empty space between category groups, as a fraction of the category width (0–0.9). */
|
|
196
|
-
gapWidth: number;
|
|
197
|
-
/** How much bars in a group overlap, as a fraction of a bar's width (-1 to 1; negative is a gap). */
|
|
198
|
-
overlap: number;
|
|
199
|
-
/** Histogram bin count (`null`: √n, between 1 and 100). */
|
|
200
|
-
bins: number | null;
|
|
201
|
-
/** Waterfall: append a running-total bar (categories labelled "total" are always totals). */
|
|
202
|
-
showTotal: boolean;
|
|
203
|
-
}
|
|
204
|
-
/** What a click selects. */
|
|
205
|
-
type ChartSelection = {
|
|
206
|
-
kind: 'chart';
|
|
207
|
-
} | {
|
|
208
|
-
kind: 'title';
|
|
209
|
-
} | {
|
|
210
|
-
kind: 'subtitle';
|
|
211
|
-
} | {
|
|
212
|
-
kind: 'legend';
|
|
213
|
-
} | {
|
|
214
|
-
kind: 'axis';
|
|
215
|
-
axis: 'x' | 'y' | 'y2';
|
|
216
|
-
} | {
|
|
217
|
-
kind: 'series';
|
|
218
|
-
seriesId: string;
|
|
219
|
-
} | {
|
|
220
|
-
kind: 'point';
|
|
221
|
-
seriesId: string;
|
|
222
|
-
index: number;
|
|
223
|
-
} | {
|
|
224
|
-
kind: 'category';
|
|
225
|
-
index: number;
|
|
226
|
-
} | {
|
|
227
|
-
kind: 'trendline';
|
|
228
|
-
seriesId: string;
|
|
229
|
-
index: number;
|
|
230
|
-
};
|
|
231
|
-
/** Colours and type used to lay out a chart. Any CSS colour strings work. */
|
|
232
|
-
interface ChartTheme {
|
|
233
|
-
/** Fill behind the chart (`transparent` lets the page show through). */
|
|
234
|
-
background: string;
|
|
235
|
-
/** The page colour: slice separators and hollow points (set it when `background` is transparent). */
|
|
236
|
-
surface: string;
|
|
237
|
-
text: string;
|
|
238
|
-
mutedText: string;
|
|
239
|
-
grid: string;
|
|
240
|
-
axis: string;
|
|
241
|
-
/** Outline drawn around the selected mark. */
|
|
242
|
-
selection: string;
|
|
243
|
-
/** Waterfall increases. */
|
|
244
|
-
positive: string;
|
|
245
|
-
/** Waterfall decreases. */
|
|
246
|
-
negative: string;
|
|
247
|
-
fontFamily: string;
|
|
248
|
-
fontSize: number;
|
|
249
|
-
titleSize: number;
|
|
250
|
-
}
|
|
251
|
-
interface ChartRect {
|
|
252
|
-
x: number;
|
|
253
|
-
y: number;
|
|
254
|
-
width: number;
|
|
255
|
-
height: number;
|
|
256
|
-
}
|
|
257
|
-
/** What a mark is, for styling and tests. */
|
|
258
|
-
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' | 'error-bar' | 'data-label' | 'legend-swatch' | 'legend-label' | 'drag-readout' | 'selection' | 'empty';
|
|
259
|
-
interface ChartMarkBase {
|
|
260
|
-
/** Unique within the scene (a stable key for frameworks). */
|
|
261
|
-
key: string;
|
|
262
|
-
role: ChartMarkRole;
|
|
263
|
-
/** What clicking this mark selects (none: not clickable). */
|
|
264
|
-
target?: ChartSelection;
|
|
265
|
-
/** Mark belongs to the current selection. */
|
|
266
|
-
selected?: boolean;
|
|
267
|
-
opacity?: number;
|
|
268
|
-
}
|
|
269
|
-
interface ChartRectMark extends ChartMarkBase {
|
|
270
|
-
kind: 'rect';
|
|
271
|
-
x: number;
|
|
272
|
-
y: number;
|
|
273
|
-
width: number;
|
|
274
|
-
height: number;
|
|
275
|
-
fill: string;
|
|
276
|
-
stroke?: string;
|
|
277
|
-
strokeWidth?: number;
|
|
278
|
-
radius?: number;
|
|
279
|
-
}
|
|
280
|
-
interface ChartPathMark extends ChartMarkBase {
|
|
281
|
-
kind: 'path';
|
|
282
|
-
d: string;
|
|
283
|
-
fill?: string;
|
|
284
|
-
stroke?: string;
|
|
285
|
-
strokeWidth?: number;
|
|
286
|
-
dash?: string;
|
|
287
|
-
}
|
|
288
|
-
interface ChartCircleMark extends ChartMarkBase {
|
|
289
|
-
kind: 'circle';
|
|
290
|
-
cx: number;
|
|
291
|
-
cy: number;
|
|
292
|
-
r: number;
|
|
293
|
-
fill: string;
|
|
294
|
-
stroke?: string;
|
|
295
|
-
strokeWidth?: number;
|
|
296
|
-
}
|
|
297
|
-
interface ChartLineMark extends ChartMarkBase {
|
|
298
|
-
kind: 'line';
|
|
299
|
-
x1: number;
|
|
300
|
-
y1: number;
|
|
301
|
-
x2: number;
|
|
302
|
-
y2: number;
|
|
303
|
-
stroke: string;
|
|
304
|
-
strokeWidth?: number;
|
|
305
|
-
dash?: string;
|
|
306
|
-
}
|
|
307
|
-
interface ChartTextMark extends ChartMarkBase {
|
|
308
|
-
kind: 'text';
|
|
309
|
-
x: number;
|
|
310
|
-
y: number;
|
|
311
|
-
text: string;
|
|
312
|
-
anchor: 'start' | 'middle' | 'end';
|
|
313
|
-
/** Vertical alignment of the text box to `y`. */
|
|
314
|
-
baseline: 'top' | 'middle' | 'bottom';
|
|
315
|
-
size: number;
|
|
316
|
-
weight?: number;
|
|
317
|
-
fill: string;
|
|
318
|
-
/** Degrees, around (x, y). */
|
|
319
|
-
rotate?: number;
|
|
320
|
-
}
|
|
321
|
-
type ChartMark = ChartRectMark | ChartPathMark | ChartCircleMark | ChartLineMark | ChartTextMark;
|
|
322
|
-
/** Maps between data values and scene pixels along one axis of the plot. */
|
|
323
|
-
interface ChartValueScale {
|
|
324
|
-
/** `y` for vertical charts, `x` for horizontal bars and the numeric x axis of scatter charts. */
|
|
325
|
-
axis: 'x' | 'y';
|
|
326
|
-
domain: [number, number];
|
|
327
|
-
range: [number, number];
|
|
328
|
-
ticks: number[];
|
|
329
|
-
/** Set when the axis is logarithmic: values map by their logarithm in this base. */
|
|
330
|
-
logBase?: number;
|
|
331
|
-
}
|
|
332
|
-
/** Something the layout had to leave out or shorten, as a sentence (for agents and screen readers). */
|
|
333
|
-
interface ChartWarning {
|
|
334
|
-
code: 'labels-hidden' | 'labels-truncated' | 'legend-truncated' | 'points-decimated' | 'values-skipped' | 'data-labels-hidden' | 'type-fallback';
|
|
335
|
-
message: string;
|
|
336
|
-
}
|
|
337
|
-
/** A laid-out chart: drawing primitives in scene pixels, ready for SVG, canvas or anything else. */
|
|
338
|
-
interface ChartScene {
|
|
339
|
-
width: number;
|
|
340
|
-
height: number;
|
|
341
|
-
/** The plot area (inside the axes). Empty for pies. */
|
|
342
|
-
plot: ChartRect;
|
|
343
|
-
/** Draw in order. */
|
|
344
|
-
marks: ChartMark[];
|
|
345
|
-
/** The value scale of a cartesian chart (absent for pies and empty charts). */
|
|
346
|
-
valueScale?: ChartValueScale;
|
|
347
|
-
/** The secondary value scale, when a visible series uses it. */
|
|
348
|
-
valueScale2?: ChartValueScale;
|
|
349
|
-
/** The numeric x scale of a scatter or bubble chart with x values. */
|
|
350
|
-
xScale?: ChartValueScale;
|
|
351
|
-
/** Percent-stacked: values are shown as shares, so dragging is disabled. */
|
|
352
|
-
percent: boolean;
|
|
353
|
-
theme: ChartTheme;
|
|
354
|
-
/** What was left out or shortened (hidden labels, decimated lines, …). */
|
|
355
|
-
warnings: ChartWarning[];
|
|
356
|
-
}
|
|
357
|
-
interface ChartIssue {
|
|
358
|
-
path: string;
|
|
359
|
-
message: string;
|
|
360
|
-
/** 1-based source line, for text formats such as Mermaid. */
|
|
361
|
-
line?: number;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
4
|
declare const CHART_TYPES: readonly ChartType[];
|
|
365
5
|
declare const CHART_MARKERS: readonly ChartMarker[];
|
|
366
6
|
declare const CHART_TRENDLINE_TYPES: readonly ChartTrendlineType[];
|
|
@@ -870,4 +510,4 @@ declare class ChartController {
|
|
|
870
510
|
}
|
|
871
511
|
declare function createChartController(options?: ChartControllerOptions): ChartController;
|
|
872
512
|
|
|
873
|
-
export {
|
|
513
|
+
export { contrastingTextColor as $, type ChartSvgOptions as A, type ChartTableData as B, type ChartLayoutOptions as C, type ChartTableOptions as D, type ChartTextMeasure as E, type ChartTrendFit as F, DEFAULT_CHART_PALETTE as G, DEFAULT_CHART_THEME as H, chartColorInputValue as I, chartColorsByCategory as J, chartDataFromTable as K, chartDataToTable as L, chartFamily as M, chartMovingAverage as N, chartPointColor as O, chartSceneToDomSpec as P, chartSceneToSvg as Q, chartSeriesColor as R, chartSeriesType as S, chartSliceColor as T, chartSupportsTrendlines as U, chartTextBaseline as V, chartTextTransform as W, chartToSvg as X, chartTrendlineName as Y, cloneChartSeries as Z, cloneChartSpec as _, ChartController as a, createChartController as a0, createChartSpec as a1, defaultChartAxis as a2, estimateChartTextWidth as a3, fitChartTrendline as a4, isCartesianChart as a5, isXyChart as a6, layoutSparkline as a7, normalizeChartAxis as a8, normalizeChartErrorBars as a9, normalizeChartSpec as aa, normalizeChartTrendline as ab, normalizeChartValues as ac, parseChartValue as ad, sameChartSelection as ae, sparklineToSvg as af, trendNumberText as ag, uniqueChartSeriesId as ah, type ChartSpecPatch as b, CHART_AXIS_KINDS as c, CHART_AXIS_SCALES as d, CHART_CURVES as e, CHART_LABEL_POSITIONS as f, CHART_LEGEND_POSITIONS as g, CHART_MARKERS as h, CHART_NUMBER_STYLES as i, CHART_ORIENTATIONS as j, CHART_SERIES_TYPES as k, CHART_STACKINGS as l, CHART_TRENDLINE_TYPES as m, CHART_TYPES as n, CHART_TYPE_LABELS as o, CSS_VARIABLE_CHART_THEME as p, type ChartActionResult as q, type ChartControllerOptions as r, type ChartDomSpec as s, type ChartEditOptions as t, type ChartFamily as u, type ChartSeriesInput as v, type ChartSeriesPatch as w, type ChartSparklineKind as x, type ChartSparklineOptions as y, type ChartState as z };
|