@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.
Files changed (81) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +19 -8
  3. package/dist/bar-chart/bar-chart.d.ts +97 -65
  4. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  5. package/dist/bar-chart/bar-chart.js +9 -5
  6. package/dist/bar-chart/bar-chart.js.map +1 -1
  7. package/dist/bar-chart/chart-bars.d.ts +29 -5
  8. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  9. package/dist/bar-chart/chart-bars.js +33 -8
  10. package/dist/bar-chart/chart-bars.js.map +1 -1
  11. package/dist/bar-chart/shared.d.ts +9 -4
  12. package/dist/bar-chart/shared.d.ts.map +1 -1
  13. package/dist/bar-chart/shared.js +10 -5
  14. package/dist/bar-chart/shared.js.map +1 -1
  15. package/dist/browser/chunks/chunk-7XCRX6GE.js +2 -0
  16. package/dist/browser/chunks/chunk-7XCRX6GE.js.map +7 -0
  17. package/dist/browser/index.js +1 -1
  18. package/dist/browser/index.js.map +3 -3
  19. package/dist/browser/kit.js +1 -1
  20. package/dist/browser/manifest.json +1 -1
  21. package/dist/kit/cartesian.d.ts +6 -4
  22. package/dist/kit/cartesian.d.ts.map +1 -1
  23. package/dist/kit/cartesian.js +5 -3
  24. package/dist/kit/cartesian.js.map +1 -1
  25. package/dist/kit/style.d.ts +339 -76
  26. package/dist/kit/style.d.ts.map +1 -1
  27. package/dist/kit/style.js +196 -101
  28. package/dist/kit/style.js.map +1 -1
  29. package/dist/line-chart/line-chart.d.ts +81 -57
  30. package/dist/line-chart/line-chart.d.ts.map +1 -1
  31. package/dist/line-chart/line-chart.js +9 -7
  32. package/dist/line-chart/line-chart.js.map +1 -1
  33. package/dist/pie-chart/pie-chart.d.ts +43 -43
  34. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  35. package/dist/pie-chart/pie-chart.js +2 -1
  36. package/dist/pie-chart/pie-chart.js.map +1 -1
  37. package/dist/pie-chart/shared.d.ts +15 -8
  38. package/dist/pie-chart/shared.d.ts.map +1 -1
  39. package/dist/pie-chart/shared.js +21 -20
  40. package/dist/pie-chart/shared.js.map +1 -1
  41. package/dist/radar-chart/index.d.ts +1 -1
  42. package/dist/radar-chart/index.d.ts.map +1 -1
  43. package/dist/radar-chart/index.js +1 -1
  44. package/dist/radar-chart/index.js.map +1 -1
  45. package/dist/radar-chart/radar-chart.d.ts +37 -43
  46. package/dist/radar-chart/radar-chart.d.ts.map +1 -1
  47. package/dist/radar-chart/radar-chart.js +12 -12
  48. package/dist/radar-chart/radar-chart.js.map +1 -1
  49. package/dist/radar-chart/radar-grid.d.ts +7 -1
  50. package/dist/radar-chart/radar-grid.d.ts.map +1 -1
  51. package/dist/radar-chart/radar-grid.js +17 -15
  52. package/dist/radar-chart/radar-grid.js.map +1 -1
  53. package/dist/radar-chart/shared.d.ts +7 -2
  54. package/dist/radar-chart/shared.d.ts.map +1 -1
  55. package/dist/radar-chart/shared.js +6 -0
  56. package/dist/radar-chart/shared.js.map +1 -1
  57. package/dist/radial-chart/radial-chart.d.ts +37 -43
  58. package/dist/radial-chart/radial-chart.d.ts.map +1 -1
  59. package/dist/radial-chart/radial-chart.js +2 -1
  60. package/dist/radial-chart/radial-chart.js.map +1 -1
  61. package/dist/radial-chart/shared.d.ts +13 -9
  62. package/dist/radial-chart/shared.d.ts.map +1 -1
  63. package/dist/radial-chart/shared.js +15 -16
  64. package/dist/radial-chart/shared.js.map +1 -1
  65. package/package.json +4 -4
  66. package/src/bar-chart/bar-chart.ts +17 -6
  67. package/src/bar-chart/chart-bars.ts +48 -9
  68. package/src/bar-chart/shared.ts +20 -5
  69. package/src/kit/cartesian.ts +10 -7
  70. package/src/kit/style.ts +214 -118
  71. package/src/line-chart/line-chart.ts +14 -8
  72. package/src/pie-chart/pie-chart.ts +3 -1
  73. package/src/pie-chart/shared.ts +30 -22
  74. package/src/radar-chart/index.ts +1 -1
  75. package/src/radar-chart/radar-chart.ts +16 -13
  76. package/src/radar-chart/radar-grid.ts +18 -13
  77. package/src/radar-chart/shared.ts +9 -2
  78. package/src/radial-chart/radial-chart.ts +3 -1
  79. package/src/radial-chart/shared.ts +30 -18
  80. package/dist/browser/chunks/chunk-R3Q5EE6E.js +0 -2
  81. package/dist/browser/chunks/chunk-R3Q5EE6E.js.map +0 -7
@@ -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; a host keys saved styles by it. */
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 colours, cycled by series (or row) index. */
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
- export declare const CHART_COLORS: {
14
- /** A colour per series (a pie's or radial's per row), cycled. */
15
- palette: _Type<Fill[], _FillResolved[][], false>;
16
- /** Values, legend captions, centre text. */
17
- foreground: _Type<Fill, _FillResolved[], false>;
18
- /** Axis markers and captions, spoke labels. */
19
- muted: _Type<Fill, _FillResolved[], false>;
20
- /** Behind the plot; none by default, so the chart reads against the stage. */
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
- export declare const CHART_TEXT: {
24
- /** Empty: the scene's default face. */
25
- fontFamily: _Type<string, string, false>;
26
- /** Marker and legend size at 1080p; titles and values scale from it. */
27
- fontSize: _Type<number, number, false>;
28
- fontWeight: _Type<number, number, false>;
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 extends ChartTextStyle {
59
- readonly palette: readonly Fill[];
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 grid fields, for the line and bar charts. */
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 rule and track fields a preset restates so its rules read on its background (a chart keeps those it draws). */
73
- declare const _PRESET_RULES: {
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 CHART_COLORS & typeof CHART_TEXT & typeof _PRESET_RULES>;
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
- palette: ("#4f8cff" | "#2fbf8f" | "#f5a524" | "#e5547a" | "#9b6cf0")[];
85
- foreground: string;
86
- muted: string;
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
- track: string;
100
- background: never[];
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
- palette: string[];
104
- foreground: string;
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
- background: string;
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
- palette: string[];
123
- foreground: string;
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
- background: string;
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
- palette: string[];
142
- foreground: string;
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
- background: never[];
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
- palette: string[];
161
- foreground: string;
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
- background: string;
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
- palette: string[];
180
- foreground: string;
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
- background: never[];
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
- palette: string[];
199
- foreground: string;
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
- background: never[];
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
- palette: string[];
218
- foreground: string;
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
- background: never[];
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 colour: its own `fill`, else the palette's, cycled. */
237
- export declare function paletteFill(style: Pick<ChartStyleBase, "palette">, index: number, own?: Fill): Fill;
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, "palette">, series: ChartSeries, index: number): Fill;
240
- /** Axis markers, spoke labels: muted, at the base size. */
241
- export declare function markerText(style: ChartTextStyle, textAlign?: TextStyle["textAlign"]): TextStyle;
242
- /** Axis captions: muted, a step larger and heavier than the markers. */
243
- export declare function titleText(style: ChartTextStyle): TextStyle;
244
- /** Values on marks and legend captions: the foreground, at the base size. */
245
- export declare function valueText(style: ChartTextStyle, textAlign?: TextStyle["textAlign"]): TextStyle;
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"> & ChartTextStyle, axis: "x" | "y"): AxisConfig;
251
- /** The kit legend's config: captions in the foreground, the swatch shaped by `swatch`. */
252
- export declare function legendConfigOf(style: ChartTextStyle & Pick<ChartStyleBase, "swatch">): LegendConfig;
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
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/kit/style.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,MAAM,IAAI,OAAO,EACt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