@motionscript/charts 0.1.1-alpha.1 → 0.1.1-alpha.2
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/CHANGELOG.md +15 -0
- package/README.md +19 -8
- package/dist/bar-chart/bar-chart.d.ts +97 -65
- package/dist/bar-chart/bar-chart.d.ts.map +1 -1
- package/dist/bar-chart/bar-chart.js +9 -5
- package/dist/bar-chart/bar-chart.js.map +1 -1
- package/dist/bar-chart/chart-bars.d.ts +29 -5
- package/dist/bar-chart/chart-bars.d.ts.map +1 -1
- package/dist/bar-chart/chart-bars.js +33 -8
- package/dist/bar-chart/chart-bars.js.map +1 -1
- package/dist/bar-chart/shared.d.ts +9 -4
- package/dist/bar-chart/shared.d.ts.map +1 -1
- package/dist/bar-chart/shared.js +10 -5
- package/dist/bar-chart/shared.js.map +1 -1
- package/dist/browser/chunks/chunk-7XCRX6GE.js +2 -0
- package/dist/browser/chunks/chunk-7XCRX6GE.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/kit/cartesian.d.ts +6 -4
- package/dist/kit/cartesian.d.ts.map +1 -1
- package/dist/kit/cartesian.js +5 -3
- package/dist/kit/cartesian.js.map +1 -1
- package/dist/kit/style.d.ts +339 -76
- package/dist/kit/style.d.ts.map +1 -1
- package/dist/kit/style.js +196 -101
- package/dist/kit/style.js.map +1 -1
- package/dist/line-chart/line-chart.d.ts +81 -57
- package/dist/line-chart/line-chart.d.ts.map +1 -1
- package/dist/line-chart/line-chart.js +9 -7
- package/dist/line-chart/line-chart.js.map +1 -1
- package/dist/pie-chart/pie-chart.d.ts +43 -43
- package/dist/pie-chart/pie-chart.d.ts.map +1 -1
- package/dist/pie-chart/pie-chart.js +2 -1
- package/dist/pie-chart/pie-chart.js.map +1 -1
- package/dist/pie-chart/shared.d.ts +15 -8
- package/dist/pie-chart/shared.d.ts.map +1 -1
- package/dist/pie-chart/shared.js +21 -20
- package/dist/pie-chart/shared.js.map +1 -1
- package/dist/radar-chart/index.d.ts +1 -1
- package/dist/radar-chart/index.d.ts.map +1 -1
- package/dist/radar-chart/index.js +1 -1
- package/dist/radar-chart/index.js.map +1 -1
- package/dist/radar-chart/radar-chart.d.ts +37 -43
- package/dist/radar-chart/radar-chart.d.ts.map +1 -1
- package/dist/radar-chart/radar-chart.js +12 -12
- package/dist/radar-chart/radar-chart.js.map +1 -1
- package/dist/radar-chart/radar-grid.d.ts +7 -1
- package/dist/radar-chart/radar-grid.d.ts.map +1 -1
- package/dist/radar-chart/radar-grid.js +17 -15
- package/dist/radar-chart/radar-grid.js.map +1 -1
- package/dist/radar-chart/shared.d.ts +7 -2
- package/dist/radar-chart/shared.d.ts.map +1 -1
- package/dist/radar-chart/shared.js +6 -0
- package/dist/radar-chart/shared.js.map +1 -1
- package/dist/radial-chart/radial-chart.d.ts +37 -43
- package/dist/radial-chart/radial-chart.d.ts.map +1 -1
- package/dist/radial-chart/radial-chart.js +2 -1
- package/dist/radial-chart/radial-chart.js.map +1 -1
- package/dist/radial-chart/shared.d.ts +13 -9
- package/dist/radial-chart/shared.d.ts.map +1 -1
- package/dist/radial-chart/shared.js +15 -16
- package/dist/radial-chart/shared.js.map +1 -1
- package/package.json +4 -4
- package/src/bar-chart/bar-chart.ts +17 -6
- package/src/bar-chart/chart-bars.ts +48 -9
- package/src/bar-chart/shared.ts +20 -5
- package/src/kit/cartesian.ts +10 -7
- package/src/kit/style.ts +214 -118
- package/src/line-chart/line-chart.ts +14 -8
- package/src/pie-chart/pie-chart.ts +3 -1
- package/src/pie-chart/shared.ts +30 -22
- package/src/radar-chart/index.ts +1 -1
- package/src/radar-chart/radar-chart.ts +16 -13
- package/src/radar-chart/radar-grid.ts +18 -13
- package/src/radar-chart/shared.ts +9 -2
- package/src/radial-chart/radial-chart.ts +3 -1
- package/src/radial-chart/shared.ts +30 -18
- package/dist/browser/chunks/chunk-R3Q5EE6E.js +0 -2
- package/dist/browser/chunks/chunk-R3Q5EE6E.js.map +0 -7
package/dist/kit/style.d.ts
CHANGED
|
@@ -2,30 +2,50 @@
|
|
|
2
2
|
* The chart family's style: one `style` entry per chart, built from the groups
|
|
3
3
|
* below, so a look saved off one chart lays onto any other (a field the other
|
|
4
4
|
* chart does not draw is dropped). A chart spreads the shared groups and adds a
|
|
5
|
-
* `marks` group of its own.
|
|
5
|
+
* `marks` group of its own. Every run of text a chart draws is its own
|
|
6
|
+
* `Types.typography` field, so axis labels, titles, values and the legend are
|
|
7
|
+
* each set the way a text node is.
|
|
6
8
|
*/
|
|
7
9
|
import { type Fill, type StrokeResolved, type Stroke as _Stroke, type StyleInput, type TextStyle, type FillResolved as _FillResolved, type Type as _Type } from "@motionscript/sdk";
|
|
8
10
|
import type { AxisConfig, ChartSeries, LegendConfig } from "./shared.js";
|
|
9
|
-
/** The style family every chart shares;
|
|
11
|
+
/** The style family every chart shares; the built-in presets are written for it. */
|
|
10
12
|
export declare const CHART_STYLE_FAMILY = "chart";
|
|
11
|
-
/** The out-of-the-box series
|
|
13
|
+
/** The out-of-the-box series fills, cycled by series (or row) index. */
|
|
12
14
|
export declare const CHART_PALETTE_DEFAULT: readonly ["#4f8cff", "#2fbf8f", "#f5a524", "#e5547a", "#9b6cf0"];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
/** The default ink of values, legend captions and centre text, on the dark stage. */
|
|
16
|
+
export declare const CHART_FOREGROUND = "#f4f4f5";
|
|
17
|
+
/** The default ink of axis markers, axis captions and spoke labels. */
|
|
18
|
+
export declare const CHART_MUTED = "#a1a1aa";
|
|
19
|
+
export declare const CHART_SERIES: {
|
|
20
|
+
/** A fill per series (a pie's or radial's per row), cycled; each may stack several paints. */
|
|
21
|
+
seriesFills: _Type<Fill[], _FillResolved[][], false>;
|
|
22
|
+
};
|
|
23
|
+
export declare const CHART_BACKGROUND: {
|
|
24
|
+
/** Behind the whole chart, legend and axes included; none by default, so the chart reads against the stage. */
|
|
25
|
+
background: _Type<Fill, _FillResolved[], false>;
|
|
26
|
+
};
|
|
27
|
+
export declare const GRID_BACKGROUND: {
|
|
28
|
+
/** Behind the plot only, under the grid lines; none by default. */
|
|
29
|
+
gridBackground: _Type<Fill, _FillResolved[], false>;
|
|
30
|
+
/** Behind the whole chart, legend and axes included; none by default, so the chart reads against the stage. */
|
|
21
31
|
background: _Type<Fill, _FillResolved[], false>;
|
|
22
32
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
/** The legend's captions, which every chart with a legend draws. */
|
|
34
|
+
export declare const LEGEND_TEXT: {
|
|
35
|
+
legendText: _Type<TextStyle, TextStyle, false>;
|
|
36
|
+
};
|
|
37
|
+
export declare const CARTESIAN_TEXT: {
|
|
38
|
+
legendText: _Type<TextStyle, TextStyle, false>;
|
|
39
|
+
/** The markers under the plot: categories on a column chart, values on a horizontal bar chart. */
|
|
40
|
+
xLabelText: _Type<TextStyle, TextStyle, false>;
|
|
41
|
+
/** The caption under the plot. */
|
|
42
|
+
xTitleText: _Type<TextStyle, TextStyle, false>;
|
|
43
|
+
/** The markers beside the plot. */
|
|
44
|
+
yLabelText: _Type<TextStyle, TextStyle, false>;
|
|
45
|
+
/** The caption beside the plot, turned on its side. */
|
|
46
|
+
yTitleText: _Type<TextStyle, TextStyle, false>;
|
|
47
|
+
/** The figures printed by the marks. */
|
|
48
|
+
valueText: _Type<TextStyle, TextStyle, false>;
|
|
29
49
|
};
|
|
30
50
|
export declare const CARTESIAN_GRID: {
|
|
31
51
|
/** The lines along the value ticks of a column chart (one per tick); empty draws none. */
|
|
@@ -46,44 +66,63 @@ export declare const CHART_LEGEND: {
|
|
|
46
66
|
legend: _Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
47
67
|
swatch: _Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
48
68
|
};
|
|
49
|
-
/** The type fields, and the two text colours: what every text helper reads. */
|
|
50
|
-
export interface ChartTextStyle {
|
|
51
|
-
readonly foreground: Fill;
|
|
52
|
-
readonly muted: Fill;
|
|
53
|
-
readonly fontFamily: string;
|
|
54
|
-
readonly fontSize: number;
|
|
55
|
-
readonly fontWeight: number;
|
|
56
|
-
}
|
|
57
69
|
/** The fields every chart's style resolves, whichever groups it spreads. */
|
|
58
|
-
export interface ChartStyleBase
|
|
59
|
-
readonly
|
|
70
|
+
export interface ChartStyleBase {
|
|
71
|
+
readonly seriesFills: readonly Fill[];
|
|
60
72
|
readonly background: Fill;
|
|
73
|
+
readonly legendText: TextStyle;
|
|
61
74
|
readonly legend: LegendPosition;
|
|
62
75
|
readonly swatch: LegendSwatch;
|
|
63
76
|
}
|
|
64
|
-
/** The cartesian
|
|
77
|
+
/** The cartesian fields, for the line and bar charts. */
|
|
65
78
|
export interface CartesianStyle extends ChartStyleBase {
|
|
79
|
+
readonly gridBackground: Fill;
|
|
80
|
+
readonly xLabelText: TextStyle;
|
|
81
|
+
readonly xTitleText: TextStyle;
|
|
82
|
+
readonly yLabelText: TextStyle;
|
|
83
|
+
readonly yTitleText: TextStyle;
|
|
84
|
+
readonly valueText: TextStyle;
|
|
66
85
|
readonly horizontalGrid: StrokeResolved[];
|
|
67
86
|
readonly verticalGrid: StrokeResolved[];
|
|
68
87
|
readonly axisStroke: StrokeResolved[];
|
|
69
88
|
readonly showXAxis: boolean;
|
|
70
89
|
readonly showYAxis: boolean;
|
|
71
90
|
}
|
|
72
|
-
/** The
|
|
73
|
-
declare const
|
|
91
|
+
/** The fields a preset restates so its rules and text read on its background (a chart keeps those it draws). */
|
|
92
|
+
declare const _PRESET_FIELDS: {
|
|
93
|
+
labelText: _Type<TextStyle, TextStyle, false>;
|
|
94
|
+
centerText: _Type<TextStyle, TextStyle, false>;
|
|
95
|
+
spokeText: _Type<TextStyle, TextStyle, false>;
|
|
74
96
|
horizontalGrid: _Type<_Stroke, StrokeResolved[], false>;
|
|
75
97
|
gridStroke: _Type<_Stroke, StrokeResolved[], false>;
|
|
76
98
|
spokeStroke: _Type<_Stroke, StrokeResolved[], false>;
|
|
77
99
|
track: _Type<Fill, _FillResolved[], false>;
|
|
100
|
+
legendText: _Type<TextStyle, TextStyle, false>;
|
|
101
|
+
/** The markers under the plot: categories on a column chart, values on a horizontal bar chart. */
|
|
102
|
+
xLabelText: _Type<TextStyle, TextStyle, false>;
|
|
103
|
+
/** The caption under the plot. */
|
|
104
|
+
xTitleText: _Type<TextStyle, TextStyle, false>;
|
|
105
|
+
/** The markers beside the plot. */
|
|
106
|
+
yLabelText: _Type<TextStyle, TextStyle, false>;
|
|
107
|
+
/** The caption beside the plot, turned on its side. */
|
|
108
|
+
yTitleText: _Type<TextStyle, TextStyle, false>;
|
|
109
|
+
/** The figures printed by the marks. */
|
|
110
|
+
valueText: _Type<TextStyle, TextStyle, false>;
|
|
111
|
+
/** Behind the plot only, under the grid lines; none by default. */
|
|
112
|
+
gridBackground: _Type<Fill, _FillResolved[], false>;
|
|
113
|
+
/** Behind the whole chart, legend and axes included; none by default, so the chart reads against the stage. */
|
|
114
|
+
background: _Type<Fill, _FillResolved[], false>;
|
|
115
|
+
/** A fill per series (a pie's or radial's per row), cycled; each may stack several paints. */
|
|
116
|
+
seriesFills: _Type<Fill[], _FillResolved[][], false>;
|
|
78
117
|
};
|
|
79
118
|
/** A preset's fields: any chart's, so one preset dresses every chart. */
|
|
80
|
-
export type ChartStylePreset = StyleInput<typeof
|
|
119
|
+
export type ChartStylePreset = StyleInput<typeof _PRESET_FIELDS>;
|
|
81
120
|
/** Ready-made looks, each stating every colour so applying one replaces the last. */
|
|
82
121
|
export declare const CHART_STYLE_PRESETS: {
|
|
83
122
|
midnight: {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
123
|
+
track: string;
|
|
124
|
+
background: never[];
|
|
125
|
+
gridBackground: never[];
|
|
87
126
|
horizontalGrid: {
|
|
88
127
|
weight: number;
|
|
89
128
|
fill: string;
|
|
@@ -96,13 +135,38 @@ export declare const CHART_STYLE_PRESETS: {
|
|
|
96
135
|
weight: number;
|
|
97
136
|
fill: string;
|
|
98
137
|
};
|
|
99
|
-
|
|
100
|
-
|
|
138
|
+
xLabelText: {
|
|
139
|
+
fill: string;
|
|
140
|
+
};
|
|
141
|
+
xTitleText: {
|
|
142
|
+
fill: string;
|
|
143
|
+
};
|
|
144
|
+
yLabelText: {
|
|
145
|
+
fill: string;
|
|
146
|
+
};
|
|
147
|
+
yTitleText: {
|
|
148
|
+
fill: string;
|
|
149
|
+
};
|
|
150
|
+
valueText: {
|
|
151
|
+
fill: string;
|
|
152
|
+
};
|
|
153
|
+
legendText: {
|
|
154
|
+
fill: string;
|
|
155
|
+
};
|
|
156
|
+
labelText: {
|
|
157
|
+
fill: string;
|
|
158
|
+
};
|
|
159
|
+
centerText: {
|
|
160
|
+
fill: string;
|
|
161
|
+
};
|
|
162
|
+
spokeText: {
|
|
163
|
+
fill: string;
|
|
164
|
+
};
|
|
165
|
+
seriesFills: ("#4f8cff" | "#2fbf8f" | "#f5a524" | "#e5547a" | "#9b6cf0")[];
|
|
101
166
|
};
|
|
102
167
|
paper: {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
muted: string;
|
|
168
|
+
background: string;
|
|
169
|
+
gridBackground: never[];
|
|
106
170
|
horizontalGrid: {
|
|
107
171
|
weight: number;
|
|
108
172
|
fill: string;
|
|
@@ -116,12 +180,38 @@ export declare const CHART_STYLE_PRESETS: {
|
|
|
116
180
|
fill: string;
|
|
117
181
|
};
|
|
118
182
|
track: string;
|
|
119
|
-
|
|
183
|
+
xLabelText: {
|
|
184
|
+
fill: string;
|
|
185
|
+
};
|
|
186
|
+
xTitleText: {
|
|
187
|
+
fill: string;
|
|
188
|
+
};
|
|
189
|
+
yLabelText: {
|
|
190
|
+
fill: string;
|
|
191
|
+
};
|
|
192
|
+
yTitleText: {
|
|
193
|
+
fill: string;
|
|
194
|
+
};
|
|
195
|
+
valueText: {
|
|
196
|
+
fill: string;
|
|
197
|
+
};
|
|
198
|
+
legendText: {
|
|
199
|
+
fill: string;
|
|
200
|
+
};
|
|
201
|
+
labelText: {
|
|
202
|
+
fill: string;
|
|
203
|
+
};
|
|
204
|
+
centerText: {
|
|
205
|
+
fill: string;
|
|
206
|
+
};
|
|
207
|
+
spokeText: {
|
|
208
|
+
fill: string;
|
|
209
|
+
};
|
|
210
|
+
seriesFills: string[];
|
|
120
211
|
};
|
|
121
212
|
ember: {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
muted: string;
|
|
213
|
+
background: string;
|
|
214
|
+
gridBackground: never[];
|
|
125
215
|
horizontalGrid: {
|
|
126
216
|
weight: number;
|
|
127
217
|
fill: string;
|
|
@@ -135,12 +225,38 @@ export declare const CHART_STYLE_PRESETS: {
|
|
|
135
225
|
fill: string;
|
|
136
226
|
};
|
|
137
227
|
track: string;
|
|
138
|
-
|
|
228
|
+
xLabelText: {
|
|
229
|
+
fill: string;
|
|
230
|
+
};
|
|
231
|
+
xTitleText: {
|
|
232
|
+
fill: string;
|
|
233
|
+
};
|
|
234
|
+
yLabelText: {
|
|
235
|
+
fill: string;
|
|
236
|
+
};
|
|
237
|
+
yTitleText: {
|
|
238
|
+
fill: string;
|
|
239
|
+
};
|
|
240
|
+
valueText: {
|
|
241
|
+
fill: string;
|
|
242
|
+
};
|
|
243
|
+
legendText: {
|
|
244
|
+
fill: string;
|
|
245
|
+
};
|
|
246
|
+
labelText: {
|
|
247
|
+
fill: string;
|
|
248
|
+
};
|
|
249
|
+
centerText: {
|
|
250
|
+
fill: string;
|
|
251
|
+
};
|
|
252
|
+
spokeText: {
|
|
253
|
+
fill: string;
|
|
254
|
+
};
|
|
255
|
+
seriesFills: string[];
|
|
139
256
|
};
|
|
140
257
|
neon: {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
muted: string;
|
|
258
|
+
background: never[];
|
|
259
|
+
gridBackground: never[];
|
|
144
260
|
horizontalGrid: {
|
|
145
261
|
weight: number;
|
|
146
262
|
fill: string;
|
|
@@ -154,12 +270,38 @@ export declare const CHART_STYLE_PRESETS: {
|
|
|
154
270
|
fill: string;
|
|
155
271
|
};
|
|
156
272
|
track: string;
|
|
157
|
-
|
|
273
|
+
xLabelText: {
|
|
274
|
+
fill: string;
|
|
275
|
+
};
|
|
276
|
+
xTitleText: {
|
|
277
|
+
fill: string;
|
|
278
|
+
};
|
|
279
|
+
yLabelText: {
|
|
280
|
+
fill: string;
|
|
281
|
+
};
|
|
282
|
+
yTitleText: {
|
|
283
|
+
fill: string;
|
|
284
|
+
};
|
|
285
|
+
valueText: {
|
|
286
|
+
fill: string;
|
|
287
|
+
};
|
|
288
|
+
legendText: {
|
|
289
|
+
fill: string;
|
|
290
|
+
};
|
|
291
|
+
labelText: {
|
|
292
|
+
fill: string;
|
|
293
|
+
};
|
|
294
|
+
centerText: {
|
|
295
|
+
fill: string;
|
|
296
|
+
};
|
|
297
|
+
spokeText: {
|
|
298
|
+
fill: string;
|
|
299
|
+
};
|
|
300
|
+
seriesFills: string[];
|
|
158
301
|
};
|
|
159
302
|
ocean: {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
muted: string;
|
|
303
|
+
background: string;
|
|
304
|
+
gridBackground: never[];
|
|
163
305
|
horizontalGrid: {
|
|
164
306
|
weight: number;
|
|
165
307
|
fill: string;
|
|
@@ -173,12 +315,38 @@ export declare const CHART_STYLE_PRESETS: {
|
|
|
173
315
|
fill: string;
|
|
174
316
|
};
|
|
175
317
|
track: string;
|
|
176
|
-
|
|
318
|
+
xLabelText: {
|
|
319
|
+
fill: string;
|
|
320
|
+
};
|
|
321
|
+
xTitleText: {
|
|
322
|
+
fill: string;
|
|
323
|
+
};
|
|
324
|
+
yLabelText: {
|
|
325
|
+
fill: string;
|
|
326
|
+
};
|
|
327
|
+
yTitleText: {
|
|
328
|
+
fill: string;
|
|
329
|
+
};
|
|
330
|
+
valueText: {
|
|
331
|
+
fill: string;
|
|
332
|
+
};
|
|
333
|
+
legendText: {
|
|
334
|
+
fill: string;
|
|
335
|
+
};
|
|
336
|
+
labelText: {
|
|
337
|
+
fill: string;
|
|
338
|
+
};
|
|
339
|
+
centerText: {
|
|
340
|
+
fill: string;
|
|
341
|
+
};
|
|
342
|
+
spokeText: {
|
|
343
|
+
fill: string;
|
|
344
|
+
};
|
|
345
|
+
seriesFills: string[];
|
|
177
346
|
};
|
|
178
347
|
sunset: {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
muted: string;
|
|
348
|
+
background: never[];
|
|
349
|
+
gridBackground: never[];
|
|
182
350
|
horizontalGrid: {
|
|
183
351
|
weight: number;
|
|
184
352
|
fill: string;
|
|
@@ -192,12 +360,38 @@ export declare const CHART_STYLE_PRESETS: {
|
|
|
192
360
|
fill: string;
|
|
193
361
|
};
|
|
194
362
|
track: string;
|
|
195
|
-
|
|
363
|
+
xLabelText: {
|
|
364
|
+
fill: string;
|
|
365
|
+
};
|
|
366
|
+
xTitleText: {
|
|
367
|
+
fill: string;
|
|
368
|
+
};
|
|
369
|
+
yLabelText: {
|
|
370
|
+
fill: string;
|
|
371
|
+
};
|
|
372
|
+
yTitleText: {
|
|
373
|
+
fill: string;
|
|
374
|
+
};
|
|
375
|
+
valueText: {
|
|
376
|
+
fill: string;
|
|
377
|
+
};
|
|
378
|
+
legendText: {
|
|
379
|
+
fill: string;
|
|
380
|
+
};
|
|
381
|
+
labelText: {
|
|
382
|
+
fill: string;
|
|
383
|
+
};
|
|
384
|
+
centerText: {
|
|
385
|
+
fill: string;
|
|
386
|
+
};
|
|
387
|
+
spokeText: {
|
|
388
|
+
fill: string;
|
|
389
|
+
};
|
|
390
|
+
seriesFills: string[];
|
|
196
391
|
};
|
|
197
392
|
pastel: {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
muted: string;
|
|
393
|
+
background: never[];
|
|
394
|
+
gridBackground: never[];
|
|
201
395
|
horizontalGrid: {
|
|
202
396
|
weight: number;
|
|
203
397
|
fill: string;
|
|
@@ -211,12 +405,38 @@ export declare const CHART_STYLE_PRESETS: {
|
|
|
211
405
|
fill: string;
|
|
212
406
|
};
|
|
213
407
|
track: string;
|
|
214
|
-
|
|
408
|
+
xLabelText: {
|
|
409
|
+
fill: string;
|
|
410
|
+
};
|
|
411
|
+
xTitleText: {
|
|
412
|
+
fill: string;
|
|
413
|
+
};
|
|
414
|
+
yLabelText: {
|
|
415
|
+
fill: string;
|
|
416
|
+
};
|
|
417
|
+
yTitleText: {
|
|
418
|
+
fill: string;
|
|
419
|
+
};
|
|
420
|
+
valueText: {
|
|
421
|
+
fill: string;
|
|
422
|
+
};
|
|
423
|
+
legendText: {
|
|
424
|
+
fill: string;
|
|
425
|
+
};
|
|
426
|
+
labelText: {
|
|
427
|
+
fill: string;
|
|
428
|
+
};
|
|
429
|
+
centerText: {
|
|
430
|
+
fill: string;
|
|
431
|
+
};
|
|
432
|
+
spokeText: {
|
|
433
|
+
fill: string;
|
|
434
|
+
};
|
|
435
|
+
seriesFills: string[];
|
|
215
436
|
};
|
|
216
437
|
mono: {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
muted: string;
|
|
438
|
+
background: never[];
|
|
439
|
+
gridBackground: never[];
|
|
220
440
|
horizontalGrid: {
|
|
221
441
|
weight: number;
|
|
222
442
|
fill: string;
|
|
@@ -230,25 +450,68 @@ export declare const CHART_STYLE_PRESETS: {
|
|
|
230
450
|
fill: string;
|
|
231
451
|
};
|
|
232
452
|
track: string;
|
|
233
|
-
|
|
453
|
+
xLabelText: {
|
|
454
|
+
fill: string;
|
|
455
|
+
};
|
|
456
|
+
xTitleText: {
|
|
457
|
+
fill: string;
|
|
458
|
+
};
|
|
459
|
+
yLabelText: {
|
|
460
|
+
fill: string;
|
|
461
|
+
};
|
|
462
|
+
yTitleText: {
|
|
463
|
+
fill: string;
|
|
464
|
+
};
|
|
465
|
+
valueText: {
|
|
466
|
+
fill: string;
|
|
467
|
+
};
|
|
468
|
+
legendText: {
|
|
469
|
+
fill: string;
|
|
470
|
+
};
|
|
471
|
+
labelText: {
|
|
472
|
+
fill: string;
|
|
473
|
+
};
|
|
474
|
+
centerText: {
|
|
475
|
+
fill: string;
|
|
476
|
+
};
|
|
477
|
+
spokeText: {
|
|
478
|
+
fill: string;
|
|
479
|
+
};
|
|
480
|
+
seriesFills: string[];
|
|
234
481
|
};
|
|
235
482
|
};
|
|
236
|
-
/** Series `index`'s
|
|
237
|
-
export declare function paletteFill(style: Pick<ChartStyleBase, "
|
|
483
|
+
/** Series `index`'s fill: its own `fill`, else the style's series fills, cycled. */
|
|
484
|
+
export declare function paletteFill(style: Pick<ChartStyleBase, "seriesFills">, index: number, own?: Fill): Fill;
|
|
238
485
|
/** {@link paletteFill} for a series. */
|
|
239
|
-
export declare function seriesFill(style: Pick<ChartStyleBase, "
|
|
240
|
-
/**
|
|
241
|
-
export declare function
|
|
242
|
-
/**
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
486
|
+
export declare function seriesFill(style: Pick<ChartStyleBase, "seriesFills">, series: ChartSeries, index: number): Fill;
|
|
487
|
+
/** A text style's size in px; an autofit or unset size reads as `fallback`. */
|
|
488
|
+
export declare function sizeOf(text: TextStyle | undefined, fallback?: number): number;
|
|
489
|
+
/**
|
|
490
|
+
* `text` as a text node takes it, aligned where the chart puts it, with `over`
|
|
491
|
+
* laid on top. Unset keys are dropped: an `undefined` spread onto a node is a
|
|
492
|
+
* value, and an unset face must stay unset so the host's default applies.
|
|
493
|
+
*/
|
|
494
|
+
export declare function placedText(text: TextStyle, textAlign?: TextStyle["textAlign"], over?: TextStyle): TextStyle;
|
|
495
|
+
/** Axis markers on `axis`, aligned as that axis sets them. */
|
|
496
|
+
export declare function markerText(style: Pick<CartesianStyle, "xLabelText" | "yLabelText">, axis: "x" | "y"): TextStyle;
|
|
497
|
+
/** The figures printed by the marks. */
|
|
498
|
+
export declare function valueText(style: Pick<CartesianStyle, "valueText">, textAlign?: TextStyle["textAlign"]): TextStyle;
|
|
246
499
|
/**
|
|
247
500
|
* The kit axis parts' config from a style. `x` is the axis under the plot;
|
|
248
501
|
* its grid lines are vertical (one per x marker), the `y` axis's horizontal.
|
|
249
502
|
*/
|
|
250
|
-
export declare function axisConfigOf(style: Pick<CartesianStyle, "verticalGrid" | "horizontalGrid"
|
|
251
|
-
/** The kit legend's config: captions in
|
|
252
|
-
export declare function legendConfigOf(style:
|
|
503
|
+
export declare function axisConfigOf(style: Pick<CartesianStyle, "verticalGrid" | "horizontalGrid" | "xLabelText" | "xTitleText" | "yLabelText" | "yTitleText">, axis: "x" | "y"): AxisConfig;
|
|
504
|
+
/** The kit legend's config: captions in `legendText`, the swatch shaped by `swatch` and sized off the captions. */
|
|
505
|
+
export declare function legendConfigOf(style: Pick<ChartStyleBase, "swatch" | "legendText">): LegendConfig;
|
|
506
|
+
/** Which text a chart drew from the retired shared text fields. */
|
|
507
|
+
export type ChartTextLayout = "cartesian" | "pie" | "radar" | "radial";
|
|
508
|
+
/**
|
|
509
|
+
* The `style` entry's hook for documents written before every run of text got
|
|
510
|
+
* its own field (0.1.1-alpha.1): `barRadius` became `barCornerRadius`, `palette` became `seriesFills`; `foreground`,
|
|
511
|
+
* `muted` and the one `fontFamily`/`fontSize`/`fontWeight` became the text
|
|
512
|
+
* fields as each chart derived them; a cartesian or radar `background`, which
|
|
513
|
+
* painted the plot, became `gridBackground`. A current style comes back as is.
|
|
514
|
+
*/
|
|
515
|
+
export declare function migrateChartStyle(layout: ChartTextLayout): (value: unknown) => unknown;
|
|
253
516
|
export {};
|
|
254
517
|
//# sourceMappingURL=style.d.ts.map
|
package/dist/kit/style.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/kit/style.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"style.d.ts","source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