@motionscript/charts 0.1.1-alpha.0 → 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 (207) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +109 -28
  3. package/dist/bar-chart/bar-chart.d.ts +265 -39
  4. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  5. package/dist/bar-chart/bar-chart.js +219 -171
  6. package/dist/bar-chart/bar-chart.js.map +1 -1
  7. package/dist/bar-chart/category-axis.d.ts +12 -7
  8. package/dist/bar-chart/category-axis.d.ts.map +1 -1
  9. package/dist/bar-chart/category-axis.js +56 -42
  10. package/dist/bar-chart/category-axis.js.map +1 -1
  11. package/dist/bar-chart/chart-bars.d.ts +76 -52
  12. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  13. package/dist/bar-chart/chart-bars.js +105 -89
  14. package/dist/bar-chart/chart-bars.js.map +1 -1
  15. package/dist/bar-chart/index.d.ts +4 -4
  16. package/dist/bar-chart/index.d.ts.map +1 -1
  17. package/dist/bar-chart/index.js +2 -2
  18. package/dist/bar-chart/index.js.map +1 -1
  19. package/dist/bar-chart/shared.d.ts +41 -65
  20. package/dist/bar-chart/shared.d.ts.map +1 -1
  21. package/dist/bar-chart/shared.js +73 -117
  22. package/dist/bar-chart/shared.js.map +1 -1
  23. package/dist/browser/chunks/chunk-7XCRX6GE.js +2 -0
  24. package/dist/browser/chunks/chunk-7XCRX6GE.js.map +7 -0
  25. package/dist/browser/index.js +1 -1
  26. package/dist/browser/index.js.map +4 -4
  27. package/dist/browser/kit.js +1 -1
  28. package/dist/browser/manifest.json +1 -1
  29. package/dist/engine.d.ts +5 -2
  30. package/dist/engine.d.ts.map +1 -1
  31. package/dist/engine.js +5 -2
  32. package/dist/engine.js.map +1 -1
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +2 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/kit/cartesian.d.ts +51 -15
  38. package/dist/kit/cartesian.d.ts.map +1 -1
  39. package/dist/kit/cartesian.js +81 -29
  40. package/dist/kit/cartesian.js.map +1 -1
  41. package/dist/kit/chart-canvas.d.ts +32 -24
  42. package/dist/kit/chart-canvas.d.ts.map +1 -1
  43. package/dist/kit/chart-canvas.js +52 -46
  44. package/dist/kit/chart-canvas.js.map +1 -1
  45. package/dist/kit/chart-legend.d.ts +8 -4
  46. package/dist/kit/chart-legend.d.ts.map +1 -1
  47. package/dist/kit/chart-legend.js +30 -20
  48. package/dist/kit/chart-legend.js.map +1 -1
  49. package/dist/{line-chart → kit}/horizontal-axis.d.ts +31 -6
  50. package/dist/kit/horizontal-axis.d.ts.map +1 -0
  51. package/dist/{line-chart → kit}/horizontal-axis.js +23 -24
  52. package/dist/kit/horizontal-axis.js.map +1 -0
  53. package/dist/kit/motion.d.ts +5 -0
  54. package/dist/kit/motion.d.ts.map +1 -1
  55. package/dist/kit/motion.js +8 -0
  56. package/dist/kit/motion.js.map +1 -1
  57. package/dist/{pie-chart → kit}/pie-legend.d.ts +3 -3
  58. package/dist/kit/pie-legend.d.ts.map +1 -0
  59. package/dist/{pie-chart → kit}/pie-legend.js +11 -10
  60. package/dist/kit/pie-legend.js.map +1 -0
  61. package/dist/kit/polar.d.ts +31 -0
  62. package/dist/kit/polar.d.ts.map +1 -0
  63. package/dist/kit/polar.js +33 -0
  64. package/dist/kit/polar.js.map +1 -0
  65. package/dist/kit/shared.d.ts +11 -50
  66. package/dist/kit/shared.d.ts.map +1 -1
  67. package/dist/kit/shared.js +58 -141
  68. package/dist/kit/shared.js.map +1 -1
  69. package/dist/kit/style.d.ts +517 -0
  70. package/dist/kit/style.d.ts.map +1 -0
  71. package/dist/kit/style.js +292 -0
  72. package/dist/kit/style.js.map +1 -0
  73. package/dist/kit/vertical-axis.d.ts +22 -2
  74. package/dist/kit/vertical-axis.d.ts.map +1 -1
  75. package/dist/kit/vertical-axis.js +56 -43
  76. package/dist/kit/vertical-axis.js.map +1 -1
  77. package/dist/line-chart/chart-line.d.ts +95 -3
  78. package/dist/line-chart/chart-line.d.ts.map +1 -1
  79. package/dist/line-chart/chart-line.js +165 -53
  80. package/dist/line-chart/chart-line.js.map +1 -1
  81. package/dist/line-chart/chart-region.d.ts +1 -1
  82. package/dist/line-chart/chart-region.d.ts.map +1 -1
  83. package/dist/line-chart/chart-region.js +7 -8
  84. package/dist/line-chart/chart-region.js.map +1 -1
  85. package/dist/line-chart/index.d.ts +5 -6
  86. package/dist/line-chart/index.d.ts.map +1 -1
  87. package/dist/line-chart/index.js +3 -4
  88. package/dist/line-chart/index.js.map +1 -1
  89. package/dist/line-chart/line-chart.d.ts +281 -18
  90. package/dist/line-chart/line-chart.d.ts.map +1 -1
  91. package/dist/line-chart/line-chart.js +284 -134
  92. package/dist/line-chart/line-chart.js.map +1 -1
  93. package/dist/line-chart/shared.d.ts +51 -34
  94. package/dist/line-chart/shared.d.ts.map +1 -1
  95. package/dist/line-chart/shared.js +175 -83
  96. package/dist/line-chart/shared.js.map +1 -1
  97. package/dist/line-chart/x-scale.d.ts +2 -0
  98. package/dist/line-chart/x-scale.d.ts.map +1 -1
  99. package/dist/line-chart/x-scale.js +15 -0
  100. package/dist/line-chart/x-scale.js.map +1 -1
  101. package/dist/nodes.d.ts +3 -1
  102. package/dist/nodes.d.ts.map +1 -1
  103. package/dist/nodes.js +9 -1
  104. package/dist/nodes.js.map +1 -1
  105. package/dist/pie-chart/index.d.ts +2 -3
  106. package/dist/pie-chart/index.d.ts.map +1 -1
  107. package/dist/pie-chart/index.js +1 -2
  108. package/dist/pie-chart/index.js.map +1 -1
  109. package/dist/pie-chart/pie-chart.d.ts +114 -18
  110. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  111. package/dist/pie-chart/pie-chart.js +38 -24
  112. package/dist/pie-chart/pie-chart.js.map +1 -1
  113. package/dist/pie-chart/pie-ring.d.ts +16 -5
  114. package/dist/pie-chart/pie-ring.d.ts.map +1 -1
  115. package/dist/pie-chart/pie-ring.js +89 -55
  116. package/dist/pie-chart/pie-ring.js.map +1 -1
  117. package/dist/pie-chart/shared.d.ts +61 -62
  118. package/dist/pie-chart/shared.d.ts.map +1 -1
  119. package/dist/pie-chart/shared.js +44 -123
  120. package/dist/pie-chart/shared.js.map +1 -1
  121. package/dist/radar-chart/index.d.ts +5 -0
  122. package/dist/radar-chart/index.d.ts.map +1 -0
  123. package/dist/radar-chart/index.js +5 -0
  124. package/dist/radar-chart/index.js.map +1 -0
  125. package/dist/radar-chart/radar-chart.d.ts +212 -0
  126. package/dist/radar-chart/radar-chart.d.ts.map +1 -0
  127. package/dist/radar-chart/radar-chart.js +224 -0
  128. package/dist/radar-chart/radar-chart.js.map +1 -0
  129. package/dist/radar-chart/radar-grid.d.ts +49 -0
  130. package/dist/radar-chart/radar-grid.d.ts.map +1 -0
  131. package/dist/radar-chart/radar-grid.js +63 -0
  132. package/dist/radar-chart/radar-grid.js.map +1 -0
  133. package/dist/radar-chart/radar-series.d.ts +59 -0
  134. package/dist/radar-chart/radar-series.d.ts.map +1 -0
  135. package/dist/radar-chart/radar-series.js +71 -0
  136. package/dist/radar-chart/radar-series.js.map +1 -0
  137. package/dist/radar-chart/shared.d.ts +78 -0
  138. package/dist/radar-chart/shared.d.ts.map +1 -0
  139. package/dist/radar-chart/shared.js +129 -0
  140. package/dist/radar-chart/shared.js.map +1 -0
  141. package/dist/radial-chart/index.d.ts +6 -0
  142. package/dist/radial-chart/index.d.ts.map +1 -0
  143. package/dist/radial-chart/index.js +4 -0
  144. package/dist/radial-chart/index.js.map +1 -0
  145. package/dist/radial-chart/radial-chart.d.ts +210 -0
  146. package/dist/radial-chart/radial-chart.d.ts.map +1 -0
  147. package/dist/radial-chart/radial-chart.js +175 -0
  148. package/dist/radial-chart/radial-chart.js.map +1 -0
  149. package/dist/radial-chart/radial-rings.d.ts +121 -0
  150. package/dist/radial-chart/radial-rings.d.ts.map +1 -0
  151. package/dist/radial-chart/radial-rings.js +273 -0
  152. package/dist/radial-chart/radial-rings.js.map +1 -0
  153. package/dist/radial-chart/shared.d.ts +77 -0
  154. package/dist/radial-chart/shared.d.ts.map +1 -0
  155. package/dist/radial-chart/shared.js +78 -0
  156. package/dist/radial-chart/shared.js.map +1 -0
  157. package/package.json +4 -4
  158. package/registry.json +21 -6
  159. package/src/bar-chart/bar-chart.ts +263 -179
  160. package/src/bar-chart/category-axis.ts +46 -40
  161. package/src/bar-chart/chart-bars.ts +136 -117
  162. package/src/bar-chart/index.ts +7 -10
  163. package/src/bar-chart/shared.ts +88 -233
  164. package/src/engine.ts +5 -2
  165. package/src/index.ts +2 -0
  166. package/src/kit/cartesian.ts +121 -40
  167. package/src/kit/chart-canvas.ts +49 -54
  168. package/src/kit/chart-legend.ts +28 -20
  169. package/src/kit/horizontal-axis.ts +114 -0
  170. package/src/kit/motion.ts +7 -0
  171. package/src/{pie-chart → kit}/pie-legend.ts +12 -11
  172. package/src/kit/polar.ts +54 -0
  173. package/src/kit/shared.ts +55 -277
  174. package/src/kit/style.ts +353 -0
  175. package/src/kit/vertical-axis.ts +67 -48
  176. package/src/line-chart/chart-line.ts +176 -54
  177. package/src/line-chart/chart-region.ts +6 -10
  178. package/src/line-chart/index.ts +14 -10
  179. package/src/line-chart/line-chart.ts +353 -151
  180. package/src/line-chart/shared.ts +193 -174
  181. package/src/line-chart/x-scale.ts +13 -0
  182. package/src/nodes.ts +9 -1
  183. package/src/pie-chart/index.ts +2 -23
  184. package/src/pie-chart/pie-chart.ts +54 -35
  185. package/src/pie-chart/pie-ring.ts +92 -71
  186. package/src/pie-chart/shared.ts +80 -270
  187. package/src/radar-chart/index.ts +4 -0
  188. package/src/radar-chart/radar-chart.ts +290 -0
  189. package/src/radar-chart/radar-grid.ts +83 -0
  190. package/src/radar-chart/radar-series.ts +88 -0
  191. package/src/radar-chart/shared.ts +153 -0
  192. package/src/radial-chart/index.ts +5 -0
  193. package/src/radial-chart/radial-chart.ts +212 -0
  194. package/src/radial-chart/radial-rings.ts +328 -0
  195. package/src/radial-chart/shared.ts +126 -0
  196. package/dist/browser/chunks/chunk-4SMRCU24.js +0 -2
  197. package/dist/browser/chunks/chunk-4SMRCU24.js.map +0 -7
  198. package/dist/kit/chart-border.d.ts +0 -18
  199. package/dist/kit/chart-border.d.ts.map +0 -1
  200. package/dist/kit/chart-border.js +0 -23
  201. package/dist/kit/chart-border.js.map +0 -1
  202. package/dist/line-chart/horizontal-axis.d.ts.map +0 -1
  203. package/dist/line-chart/horizontal-axis.js.map +0 -1
  204. package/dist/pie-chart/pie-legend.d.ts.map +0 -1
  205. package/dist/pie-chart/pie-legend.js.map +0 -1
  206. package/src/kit/chart-border.ts +0 -36
  207. package/src/line-chart/horizontal-axis.ts +0 -122
@@ -0,0 +1,517 @@
1
+ /**
2
+ * The chart family's style: one `style` entry per chart, built from the groups
3
+ * below, so a look saved off one chart lays onto any other (a field the other
4
+ * chart does not draw is dropped). A chart spreads the shared groups and adds a
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.
8
+ */
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";
10
+ import type { AxisConfig, ChartSeries, LegendConfig } from "./shared.js";
11
+ /** The style family every chart shares; the built-in presets are written for it. */
12
+ export declare const CHART_STYLE_FAMILY = "chart";
13
+ /** The out-of-the-box series fills, cycled by series (or row) index. */
14
+ export declare const CHART_PALETTE_DEFAULT: readonly ["#4f8cff", "#2fbf8f", "#f5a524", "#e5547a", "#9b6cf0"];
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. */
31
+ background: _Type<Fill, _FillResolved[], false>;
32
+ };
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>;
49
+ };
50
+ export declare const CARTESIAN_GRID: {
51
+ /** The lines along the value ticks of a column chart (one per tick); empty draws none. */
52
+ horizontalGrid: _Type<_Stroke, StrokeResolved[], false>;
53
+ /** The lines under the category markers; empty draws none. */
54
+ verticalGrid: _Type<_Stroke, StrokeResolved[], false>;
55
+ /** The baseline and the value-axis rule; empty draws none. */
56
+ axisStroke: _Type<_Stroke, StrokeResolved[], false>;
57
+ /** Read as the chart is built: whether the category (x) axis row is drawn. */
58
+ showXAxis: _Type<boolean, boolean, false>;
59
+ /** Read as the chart is built: whether the value (y) axis column is drawn. */
60
+ showYAxis: _Type<boolean, boolean, false>;
61
+ };
62
+ export type LegendPosition = "bottom" | "top" | "right" | "none";
63
+ export type LegendSwatch = "square" | "circle" | "line";
64
+ export declare const CHART_LEGEND: {
65
+ /** Read as the chart is built: where the legend sits, or `none`. */
66
+ legend: _Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
67
+ swatch: _Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
68
+ };
69
+ /** The fields every chart's style resolves, whichever groups it spreads. */
70
+ export interface ChartStyleBase {
71
+ readonly seriesFills: readonly Fill[];
72
+ readonly background: Fill;
73
+ readonly legendText: TextStyle;
74
+ readonly legend: LegendPosition;
75
+ readonly swatch: LegendSwatch;
76
+ }
77
+ /** The cartesian fields, for the line and bar charts. */
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;
85
+ readonly horizontalGrid: StrokeResolved[];
86
+ readonly verticalGrid: StrokeResolved[];
87
+ readonly axisStroke: StrokeResolved[];
88
+ readonly showXAxis: boolean;
89
+ readonly showYAxis: boolean;
90
+ }
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>;
96
+ horizontalGrid: _Type<_Stroke, StrokeResolved[], false>;
97
+ gridStroke: _Type<_Stroke, StrokeResolved[], false>;
98
+ spokeStroke: _Type<_Stroke, StrokeResolved[], false>;
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>;
117
+ };
118
+ /** A preset's fields: any chart's, so one preset dresses every chart. */
119
+ export type ChartStylePreset = StyleInput<typeof _PRESET_FIELDS>;
120
+ /** Ready-made looks, each stating every colour so applying one replaces the last. */
121
+ export declare const CHART_STYLE_PRESETS: {
122
+ midnight: {
123
+ track: string;
124
+ background: never[];
125
+ gridBackground: never[];
126
+ horizontalGrid: {
127
+ weight: number;
128
+ fill: string;
129
+ };
130
+ gridStroke: {
131
+ weight: number;
132
+ fill: string;
133
+ };
134
+ spokeStroke: {
135
+ weight: number;
136
+ fill: string;
137
+ };
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")[];
166
+ };
167
+ paper: {
168
+ background: string;
169
+ gridBackground: never[];
170
+ horizontalGrid: {
171
+ weight: number;
172
+ fill: string;
173
+ };
174
+ gridStroke: {
175
+ weight: number;
176
+ fill: string;
177
+ };
178
+ spokeStroke: {
179
+ weight: number;
180
+ fill: string;
181
+ };
182
+ track: 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[];
211
+ };
212
+ ember: {
213
+ background: string;
214
+ gridBackground: never[];
215
+ horizontalGrid: {
216
+ weight: number;
217
+ fill: string;
218
+ };
219
+ gridStroke: {
220
+ weight: number;
221
+ fill: string;
222
+ };
223
+ spokeStroke: {
224
+ weight: number;
225
+ fill: string;
226
+ };
227
+ track: 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[];
256
+ };
257
+ neon: {
258
+ background: never[];
259
+ gridBackground: never[];
260
+ horizontalGrid: {
261
+ weight: number;
262
+ fill: string;
263
+ };
264
+ gridStroke: {
265
+ weight: number;
266
+ fill: string;
267
+ };
268
+ spokeStroke: {
269
+ weight: number;
270
+ fill: string;
271
+ };
272
+ track: string;
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[];
301
+ };
302
+ ocean: {
303
+ background: string;
304
+ gridBackground: never[];
305
+ horizontalGrid: {
306
+ weight: number;
307
+ fill: string;
308
+ };
309
+ gridStroke: {
310
+ weight: number;
311
+ fill: string;
312
+ };
313
+ spokeStroke: {
314
+ weight: number;
315
+ fill: string;
316
+ };
317
+ track: 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[];
346
+ };
347
+ sunset: {
348
+ background: never[];
349
+ gridBackground: never[];
350
+ horizontalGrid: {
351
+ weight: number;
352
+ fill: string;
353
+ };
354
+ gridStroke: {
355
+ weight: number;
356
+ fill: string;
357
+ };
358
+ spokeStroke: {
359
+ weight: number;
360
+ fill: string;
361
+ };
362
+ track: string;
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[];
391
+ };
392
+ pastel: {
393
+ background: never[];
394
+ gridBackground: never[];
395
+ horizontalGrid: {
396
+ weight: number;
397
+ fill: string;
398
+ };
399
+ gridStroke: {
400
+ weight: number;
401
+ fill: string;
402
+ };
403
+ spokeStroke: {
404
+ weight: number;
405
+ fill: string;
406
+ };
407
+ track: string;
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[];
436
+ };
437
+ mono: {
438
+ background: never[];
439
+ gridBackground: never[];
440
+ horizontalGrid: {
441
+ weight: number;
442
+ fill: string;
443
+ };
444
+ gridStroke: {
445
+ weight: number;
446
+ fill: string;
447
+ };
448
+ spokeStroke: {
449
+ weight: number;
450
+ fill: string;
451
+ };
452
+ track: string;
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[];
481
+ };
482
+ };
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;
485
+ /** {@link paletteFill} for a series. */
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;
499
+ /**
500
+ * The kit axis parts' config from a style. `x` is the axis under the plot;
501
+ * its grid lines are vertical (one per x marker), the `y` axis's horizontal.
502
+ */
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;
516
+ export {};
517
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../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