@motionscript/charts 0.1.1-alpha.1 → 0.1.1-alpha.3

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 +23 -0
  2. package/README.md +21 -12
  3. package/dist/bar-chart/bar-chart.d.ts +113 -81
  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 +10 -4
  12. package/dist/bar-chart/shared.d.ts.map +1 -1
  13. package/dist/bar-chart/shared.js +12 -5
  14. package/dist/bar-chart/shared.js.map +1 -1
  15. package/dist/browser/chunks/chunk-FJHNBNPQ.js +2 -0
  16. package/dist/browser/chunks/chunk-FJHNBNPQ.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 +344 -76
  26. package/dist/kit/style.d.ts.map +1 -1
  27. package/dist/kit/style.js +198 -101
  28. package/dist/kit/style.js.map +1 -1
  29. package/dist/line-chart/line-chart.d.ts +97 -73
  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/line-chart/shared.d.ts +2 -1
  34. package/dist/line-chart/shared.d.ts.map +1 -1
  35. package/dist/line-chart/shared.js +2 -0
  36. package/dist/line-chart/shared.js.map +1 -1
  37. package/dist/pie-chart/pie-chart.d.ts +43 -49
  38. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  39. package/dist/pie-chart/pie-chart.js +2 -1
  40. package/dist/pie-chart/pie-chart.js.map +1 -1
  41. package/dist/pie-chart/shared.d.ts +15 -10
  42. package/dist/pie-chart/shared.d.ts.map +1 -1
  43. package/dist/pie-chart/shared.js +18 -20
  44. package/dist/pie-chart/shared.js.map +1 -1
  45. package/dist/radar-chart/radar-chart.d.ts +37 -49
  46. package/dist/radar-chart/radar-chart.d.ts.map +1 -1
  47. package/dist/radar-chart/radar-chart.js +10 -11
  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 +4 -2
  54. package/dist/radar-chart/shared.d.ts.map +1 -1
  55. package/dist/radar-chart/shared.js +3 -0
  56. package/dist/radar-chart/shared.js.map +1 -1
  57. package/dist/radial-chart/radial-chart.d.ts +37 -49
  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 -11
  62. package/dist/radial-chart/shared.d.ts.map +1 -1
  63. package/dist/radial-chart/shared.js +12 -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 +23 -5
  69. package/src/kit/cartesian.ts +10 -7
  70. package/src/kit/style.ts +216 -118
  71. package/src/line-chart/line-chart.ts +14 -8
  72. package/src/line-chart/shared.ts +3 -1
  73. package/src/pie-chart/pie-chart.ts +3 -1
  74. package/src/pie-chart/shared.ts +26 -22
  75. package/src/radar-chart/radar-chart.ts +14 -13
  76. package/src/radar-chart/radar-grid.ts +18 -13
  77. package/src/radar-chart/shared.ts +5 -2
  78. package/src/radial-chart/radial-chart.ts +3 -1
  79. package/src/radial-chart/shared.ts +26 -18
  80. package/dist/browser/chunks/chunk-R3Q5EE6E.js +0 -2
  81. package/dist/browser/chunks/chunk-R3Q5EE6E.js.map +0 -7
@@ -1,24 +1,26 @@
1
- import { type DataRecord, type NodeOf, type OutOf, type Node2D, type Node2DProps as _Node2DProps, type Fill as _Fill, type FillResolved as _FillResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved, type StyleInput as _StyleInput, type StyleValues as _StyleValues } from "@motionscript/sdk";
1
+ import { type DataRecord, type NodeOf, type OutOf, type Node2D, type Node2DProps as _Node2DProps, type TextStyle as _TextStyle, type Fill as _Fill, type FillResolved as _FillResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved, type StyleInput as _StyleInput, type StyleValues as _StyleValues } from "@motionscript/sdk";
2
2
  import { type AxisDomainConfig, type ResolvedAxisDomain } from "../kit/shared.js";
3
3
  import { type LineSeries, type LineStack, type PlotRegion } from "./shared.js";
4
4
  declare const LINE_STYLE: import("@motionscript/sdk").Type<_StyleInput<{
5
+ gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
6
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
7
+ } & {
5
8
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
6
9
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
10
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
7
11
  } & {
8
12
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
9
13
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
14
+ } & {
15
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
16
+ } & {
10
17
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
11
18
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
19
+ xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
20
+ xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
12
21
  showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
13
- } & {
14
- fontFamily: import("@motionscript/sdk").Type<string, string, false>;
15
- fontSize: import("@motionscript/sdk").Type<number, number, false>;
16
- fontWeight: import("@motionscript/sdk").Type<number, number, false>;
17
- } & {
18
- palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
19
- foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
20
- muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
21
- background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
22
+ yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
23
+ yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
22
24
  } & {
23
25
  strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
24
26
  curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
@@ -27,25 +29,28 @@ declare const LINE_STYLE: import("@motionscript/sdk").Type<_StyleInput<{
27
29
  area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
28
30
  areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
29
31
  } & {
32
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
30
33
  values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
31
34
  }>, _StyleValues<{
35
+ gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
36
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
37
+ } & {
32
38
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
33
39
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
40
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
34
41
  } & {
35
42
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
36
43
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
44
+ } & {
45
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
46
+ } & {
37
47
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
38
48
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
49
+ xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
50
+ xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
39
51
  showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
40
- } & {
41
- fontFamily: import("@motionscript/sdk").Type<string, string, false>;
42
- fontSize: import("@motionscript/sdk").Type<number, number, false>;
43
- fontWeight: import("@motionscript/sdk").Type<number, number, false>;
44
- } & {
45
- palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
46
- foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
47
- muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
48
- background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
52
+ yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
53
+ yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
49
54
  } & {
50
55
  strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
51
56
  curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
@@ -54,6 +59,7 @@ declare const LINE_STYLE: import("@motionscript/sdk").Type<_StyleInput<{
54
59
  area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
55
60
  areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
56
61
  } & {
62
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
57
63
  values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
58
64
  }>, false>;
59
65
  /** A line chart's resolved style. */
@@ -99,23 +105,25 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
99
105
  readonly xAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
100
106
  readonly yAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
101
107
  readonly style: import("@motionscript/sdk").Type<_StyleInput<{
108
+ gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
109
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
110
+ } & {
102
111
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
103
112
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
113
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
104
114
  } & {
105
115
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
106
116
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
117
+ } & {
118
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
119
+ } & {
107
120
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
108
121
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
122
+ xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
123
+ xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
109
124
  showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
110
- } & {
111
- fontFamily: import("@motionscript/sdk").Type<string, string, false>;
112
- fontSize: import("@motionscript/sdk").Type<number, number, false>;
113
- fontWeight: import("@motionscript/sdk").Type<number, number, false>;
114
- } & {
115
- palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
116
- foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
117
- muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
118
- background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
125
+ yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
126
+ yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
119
127
  } & {
120
128
  strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
121
129
  curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
@@ -124,25 +132,28 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
124
132
  area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
125
133
  areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
126
134
  } & {
135
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
127
136
  values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
128
137
  }>, _StyleValues<{
138
+ gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
139
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
140
+ } & {
129
141
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
130
142
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
143
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
131
144
  } & {
132
145
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
133
146
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
147
+ } & {
148
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
149
+ } & {
134
150
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
135
151
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
152
+ xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
153
+ xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
136
154
  showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
137
- } & {
138
- fontFamily: import("@motionscript/sdk").Type<string, string, false>;
139
- fontSize: import("@motionscript/sdk").Type<number, number, false>;
140
- fontWeight: import("@motionscript/sdk").Type<number, number, false>;
141
- } & {
142
- palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
143
- foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
144
- muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
145
- background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
155
+ yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
156
+ yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
146
157
  } & {
147
158
  strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
148
159
  curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
@@ -151,6 +162,7 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
151
162
  area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
152
163
  areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
153
164
  } & {
165
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
154
166
  values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
155
167
  }>, false>;
156
168
  /** The spotlit slice in data units, or `null`. The box snaps; {@link regionReveal} animates it. */
@@ -191,23 +203,25 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
191
203
  readonly xAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
192
204
  readonly yAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
193
205
  readonly style: import("@motionscript/sdk").Type<_StyleInput<{
206
+ gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
207
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
208
+ } & {
194
209
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
195
210
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
211
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
196
212
  } & {
197
213
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
198
214
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
215
+ } & {
216
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
217
+ } & {
199
218
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
200
219
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
220
+ xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
221
+ xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
201
222
  showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
202
- } & {
203
- fontFamily: import("@motionscript/sdk").Type<string, string, false>;
204
- fontSize: import("@motionscript/sdk").Type<number, number, false>;
205
- fontWeight: import("@motionscript/sdk").Type<number, number, false>;
206
- } & {
207
- palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
208
- foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
209
- muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
210
- background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
223
+ yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
224
+ yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
211
225
  } & {
212
226
  strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
213
227
  curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
@@ -216,25 +230,28 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
216
230
  area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
217
231
  areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
218
232
  } & {
233
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
219
234
  values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
220
235
  }>, _StyleValues<{
236
+ gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
237
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
238
+ } & {
221
239
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
222
240
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
241
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
223
242
  } & {
224
243
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
225
244
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
245
+ } & {
246
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
247
+ } & {
226
248
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
227
249
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
250
+ xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
251
+ xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
228
252
  showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
229
- } & {
230
- fontFamily: import("@motionscript/sdk").Type<string, string, false>;
231
- fontSize: import("@motionscript/sdk").Type<number, number, false>;
232
- fontWeight: import("@motionscript/sdk").Type<number, number, false>;
233
- } & {
234
- palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
235
- foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
236
- muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
237
- background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
253
+ yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
254
+ yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
238
255
  } & {
239
256
  strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
240
257
  curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
@@ -243,6 +260,7 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
243
260
  area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
244
261
  areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
245
262
  } & {
263
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
246
264
  values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
247
265
  }>, false>;
248
266
  /** The spotlit slice in data units, or `null`. The box snaps; {@link regionReveal} animates it. */
@@ -264,23 +282,25 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
264
282
  readonly xAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
265
283
  readonly yAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
266
284
  readonly style: import("@motionscript/sdk").Type<_StyleInput<{
285
+ gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
286
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
287
+ } & {
267
288
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
268
289
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
290
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
269
291
  } & {
270
292
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
271
293
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
294
+ } & {
295
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
296
+ } & {
272
297
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
273
298
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
299
+ xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
300
+ xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
274
301
  showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
275
- } & {
276
- fontFamily: import("@motionscript/sdk").Type<string, string, false>;
277
- fontSize: import("@motionscript/sdk").Type<number, number, false>;
278
- fontWeight: import("@motionscript/sdk").Type<number, number, false>;
279
- } & {
280
- palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
281
- foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
282
- muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
283
- background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
302
+ yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
303
+ yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
284
304
  } & {
285
305
  strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
286
306
  curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
@@ -289,25 +309,28 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
289
309
  area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
290
310
  areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
291
311
  } & {
312
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
292
313
  values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
293
314
  }>, _StyleValues<{
315
+ gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
316
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
317
+ } & {
294
318
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
295
319
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
320
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
296
321
  } & {
297
322
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
298
323
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
324
+ } & {
325
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
326
+ } & {
299
327
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
300
328
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
329
+ xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
330
+ xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
301
331
  showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
302
- } & {
303
- fontFamily: import("@motionscript/sdk").Type<string, string, false>;
304
- fontSize: import("@motionscript/sdk").Type<number, number, false>;
305
- fontWeight: import("@motionscript/sdk").Type<number, number, false>;
306
- } & {
307
- palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
308
- foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
309
- muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
310
- background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
332
+ yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
333
+ yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
311
334
  } & {
312
335
  strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
313
336
  curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
@@ -316,6 +339,7 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
316
339
  area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
317
340
  areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
318
341
  } & {
342
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
319
343
  values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
320
344
  }>, false>;
321
345
  /** The spotlit slice in data units, or `null`. The box snaps; {@link regionReveal} animates it. */
@@ -1 +1 @@
1
- {"version":3,"file":"line-chart.d.ts","sourceRoot":"","sources":["../../src/line-chart/line-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,KAAK,EAEV,KAAK,MAAM,EACX,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,IAAI,IAAI,KAAK,EAClB,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EAEtC,KAAK,UAAU,IAAI,WAAW,EAC9B,KAAK,WAAW,IAAI,YAAY,EAEjC,MAAM,mBAAmB,CAAA;AAS1B,OAAO,EAWL,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAA;AAgBtB,OAAO,EAML,KAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK9G,mGAAmG;;IAEnG,oHAAoH;;IAEpH,+FAA+F;;IAE/F,yHAAyH;;IAEzH,uFAAuF;;;;;;;;;;;;;;;;;;;;;0BA0TzF,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -7,13 +7,13 @@ import { SERIES_ARG, asParts, fresh } from "../kit/entries.js";
7
7
  import { HorizontalAxis } from "../kit/horizontal-axis.js";
8
8
  import { DEFAULT_MARKERS, ENTER_SHARE, beats, legendAway } from "../kit/motion.js";
9
9
  import { SPOTLIGHT_DIM, formatMarker, lerpAxisDomain, lerpAxisEntry, markerStep, markerValues, niceRange, niceTicks, resolveAxisDomain, settleAxisDomain, } from "../kit/shared.js";
10
- import { CARTESIAN_GRID, CHART_COLORS, CHART_LEGEND, CHART_STYLE_FAMILY, CHART_STYLE_PRESETS, CHART_TEXT, axisConfigOf, legendConfigOf, seriesFill, valueText, } from "../kit/style.js";
10
+ import { CARTESIAN_GRID, CARTESIAN_AXES, CHART_LEGEND, CHART_SERIES, CHART_STYLE_FAMILY, CHART_STYLE_PRESETS, GRID_BACKGROUND, axisConfigOf, legendConfigOf, migrateChartStyle, seriesFill, sizeOf, valueText, } from "../kit/style.js";
11
11
  import { VerticalAxis, axisPads } from "../kit/vertical-axis.js";
12
12
  import { ChartArea, ChartLine, traceX } from "./chart-line.js";
13
13
  import { ChartRegion } from "./chart-region.js";
14
14
  import { LINE_LABELS, LINE_MARKS, resolveRegionBox, stackExtent, stackSeries, } from "./shared.js";
15
15
  import { resolveXScale } from "./x-scale.js";
16
- const LINE_STYLE = Types.style(CHART_STYLE_FAMILY, { colors: CHART_COLORS, text: CHART_TEXT, grid: CARTESIAN_GRID, marks: LINE_MARKS, labels: LINE_LABELS, legend: CHART_LEGEND }, { presets: CHART_STYLE_PRESETS });
16
+ const LINE_STYLE = Types.style(CHART_STYLE_FAMILY, { series: CHART_SERIES, background: GRID_BACKGROUND, grid: CARTESIAN_GRID, axes: CARTESIAN_AXES, marks: LINE_MARKS, labels: LINE_LABELS, legend: CHART_LEGEND }, { presets: CHART_STYLE_PRESETS });
17
17
  /** One argument, two controls: the commands take a `PlotRegion`, so the x and y spans a host draws are declared inside it. */
18
18
  const REGION_ARG = Types.custom(undefined, {
19
19
  kind: "region",
@@ -228,6 +228,7 @@ export const LineChart = component2d({
228
228
  height: "fill",
229
229
  weights: (state) => state.series.map((s) => ((s.enabled ?? true) ? 1 : 0)),
230
230
  },
231
+ migrate: { style: migrateChartStyle("cartesian") },
231
232
  allowedChildren: [],
232
233
  children: (state) => {
233
234
  const style = () => state.style;
@@ -317,7 +318,7 @@ export const LineChart = component2d({
317
318
  state.data.forEach((_row, k) => {
318
319
  const line = lines[i];
319
320
  const label = new Text({
320
- ...boundText(() => ({ ...valueText(style()), fontSize: Math.round(style().fontSize * 0.8) })),
321
+ ...boundText(() => valueText(style())),
321
322
  text: () => {
322
323
  const value = pixels(i).values[k];
323
324
  return value === undefined ? "" : yLabel(state, value, domains().y.ticks);
@@ -329,7 +330,7 @@ export const LineChart = component2d({
329
330
  },
330
331
  y: () => {
331
332
  const point = pixels(i).points[k];
332
- const clear = label.layoutBounds.height / 2 + (style().dots ? style().dotSize / 2 : style().strokeWidth / 2) + Math.round(style().fontSize * 0.25);
333
+ const clear = label.layoutBounds.height / 2 + (style().dots ? style().dotSize / 2 : style().strokeWidth / 2) + Math.round(sizeOf(style().valueText) * 0.25);
333
334
  return (point?.y ?? 0) + (below ? -clear : clear);
334
335
  },
335
336
  // In once the trace has passed its point.
@@ -358,7 +359,7 @@ export const LineChart = component2d({
358
359
  clip: () => state.clipped || overflows(state, domains()),
359
360
  children: [
360
361
  new ChartCanvas({
361
- fill: () => style().background,
362
+ fill: () => style().gridBackground,
362
363
  xGridStroke: () => style().verticalGrid,
363
364
  yGridStroke: () => style().horizontalGrid,
364
365
  xMarkers: () => domains().x.ticks,
@@ -372,8 +373,8 @@ export const LineChart = component2d({
372
373
  // Under the marks, so the highlight does not tint the stretch it picks out.
373
374
  new ChartRegion({
374
375
  box: spotlight,
375
- stroke: () => ({ weight: 2, fill: fade(style().foreground, 0.7), dash: [14, 12], cap: "butt", align: "center" }),
376
- fill: () => fade(style().foreground, 0.06),
376
+ stroke: () => ({ weight: 2, fill: fade(style().valueText.fill ?? "white", 0.7), dash: [14, 12], cap: "butt", align: "center" }),
377
+ fill: () => fade(style().valueText.fill ?? "white", 0.06),
377
378
  reveal: () => state.regionReveal,
378
379
  }),
379
380
  ...areas,
@@ -383,6 +384,7 @@ export const LineChart = component2d({
383
384
  });
384
385
  return asParts([
385
386
  cartesianFrame({
387
+ background: () => style().background,
386
388
  left: vAxis,
387
389
  ghost,
388
390
  plot,