@motionscript/charts 0.1.1-alpha.2 → 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 (63) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +7 -9
  3. package/dist/bar-chart/bar-chart.d.ts +48 -48
  4. package/dist/bar-chart/bar-chart.js +2 -2
  5. package/dist/bar-chart/bar-chart.js.map +1 -1
  6. package/dist/bar-chart/shared.d.ts +2 -1
  7. package/dist/bar-chart/shared.d.ts.map +1 -1
  8. package/dist/bar-chart/shared.js +2 -0
  9. package/dist/bar-chart/shared.js.map +1 -1
  10. package/dist/browser/chunks/chunk-FJHNBNPQ.js +2 -0
  11. package/dist/browser/chunks/chunk-FJHNBNPQ.js.map +7 -0
  12. package/dist/browser/index.js +1 -1
  13. package/dist/browser/index.js.map +3 -3
  14. package/dist/browser/kit.js +1 -1
  15. package/dist/browser/manifest.json +1 -1
  16. package/dist/kit/style.d.ts +25 -20
  17. package/dist/kit/style.d.ts.map +1 -1
  18. package/dist/kit/style.js +20 -18
  19. package/dist/kit/style.js.map +1 -1
  20. package/dist/line-chart/line-chart.d.ts +48 -48
  21. package/dist/line-chart/line-chart.js +2 -2
  22. package/dist/line-chart/line-chart.js.map +1 -1
  23. package/dist/line-chart/shared.d.ts +2 -1
  24. package/dist/line-chart/shared.d.ts.map +1 -1
  25. package/dist/line-chart/shared.js +2 -0
  26. package/dist/line-chart/shared.js.map +1 -1
  27. package/dist/pie-chart/pie-chart.d.ts +18 -24
  28. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  29. package/dist/pie-chart/shared.d.ts +7 -9
  30. package/dist/pie-chart/shared.d.ts.map +1 -1
  31. package/dist/pie-chart/shared.js +7 -10
  32. package/dist/pie-chart/shared.js.map +1 -1
  33. package/dist/radar-chart/index.d.ts +1 -1
  34. package/dist/radar-chart/index.d.ts.map +1 -1
  35. package/dist/radar-chart/index.js +1 -1
  36. package/dist/radar-chart/index.js.map +1 -1
  37. package/dist/radar-chart/radar-chart.d.ts +6 -12
  38. package/dist/radar-chart/radar-chart.d.ts.map +1 -1
  39. package/dist/radar-chart/radar-chart.js +1 -2
  40. package/dist/radar-chart/radar-chart.js.map +1 -1
  41. package/dist/radar-chart/shared.d.ts +2 -5
  42. package/dist/radar-chart/shared.d.ts.map +1 -1
  43. package/dist/radar-chart/shared.js +3 -6
  44. package/dist/radar-chart/shared.js.map +1 -1
  45. package/dist/radial-chart/radial-chart.d.ts +12 -18
  46. package/dist/radial-chart/radial-chart.d.ts.map +1 -1
  47. package/dist/radial-chart/shared.d.ts +5 -7
  48. package/dist/radial-chart/shared.d.ts.map +1 -1
  49. package/dist/radial-chart/shared.js +5 -8
  50. package/dist/radial-chart/shared.js.map +1 -1
  51. package/package.json +4 -4
  52. package/src/bar-chart/bar-chart.ts +2 -2
  53. package/src/bar-chart/shared.ts +3 -0
  54. package/src/kit/style.ts +21 -19
  55. package/src/line-chart/line-chart.ts +2 -2
  56. package/src/line-chart/shared.ts +3 -1
  57. package/src/pie-chart/shared.ts +6 -10
  58. package/src/radar-chart/index.ts +1 -1
  59. package/src/radar-chart/radar-chart.ts +0 -2
  60. package/src/radar-chart/shared.ts +3 -7
  61. package/src/radial-chart/shared.ts +4 -8
  62. package/dist/browser/chunks/chunk-7XCRX6GE.js +0 -2
  63. package/dist/browser/chunks/chunk-7XCRX6GE.js.map +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @motionscript/charts
2
2
 
3
+ ## 0.1.1-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 2291209: **Breaking:** a chart's text fields sit in the style group of the part they label, so a host draws each beside it rather than in one text section: axis text in a new `axes` group with `axisStroke`, `showXAxis` and `showYAxis` (which leave `grid`), `valueText` (and a pie's or radial's other labels) in `labels`, `legendText` in `legend`, a radar's `spokeText` in `grid`. The kit exports `CARTESIAN_AXES` and `VALUE_TEXT` in place of `CARTESIAN_TEXT` and `LEGEND_TEXT` (`CHART_LEGEND` now holds `legendText`), and the radar's `RADAR_TEXT` is folded into `RADAR_GRID`.
8
+
9
+ Migration: no stored document is affected; field names and values are unchanged. Code that spread `CARTESIAN_TEXT`, `LEGEND_TEXT` or `RADAR_TEXT` into a style spreads `CARTESIAN_AXES`, `VALUE_TEXT`, `CHART_LEGEND` or `RADAR_GRID` instead.
10
+
3
11
  ## 0.1.1-alpha.2
4
12
 
5
13
  ### Patch Changes
package/README.md CHANGED
@@ -40,7 +40,7 @@ is out.
40
40
 
41
41
  The style kit exports `CHART_STYLE_FAMILY` (`"chart"`), `CHART_STYLE_PRESETS`,
42
42
  `CHART_PALETTE_DEFAULT`, the shared field groups (`CHART_SERIES`,
43
- `CHART_BACKGROUND`, `GRID_BACKGROUND`, `CARTESIAN_TEXT`, `LEGEND_TEXT`,
43
+ `CHART_BACKGROUND`, `GRID_BACKGROUND`, `CARTESIAN_AXES`, `VALUE_TEXT`,
44
44
  `CARTESIAN_GRID`, `CHART_LEGEND`) and `migrateChartStyle`, each chart's
45
45
  `migrate` hook for styles written before 0.1.1-alpha.2.
46
46
 
@@ -73,15 +73,13 @@ flat (`state.style.xLabelText`):
73
73
  |---|---|---|
74
74
  | series | `seriesFills`: a fill per series (per row on a pie or radial), cycled; each may stack paints | every chart |
75
75
  | background | `background` (the whole chart), `gridBackground` (the plot, under the grid) | every chart; `gridBackground` on line, bar, radar |
76
- | text | `xLabelText`, `xTitleText`, `yLabelText`, `yTitleText`, `valueText`, `legendText` | line, bar |
77
- | text | `labelText`, `valueText`, `centerText`, `legendText` | pie |
78
- | text | `spokeText`, `legendText` (radar); `labelText`, `centerText`, `legendText` (radial) | radar, radial |
79
- | grid | `horizontalGrid` (a 2px `white/15` stroke), `verticalGrid` (none), `axisStroke` (none), `showXAxis`, `showYAxis` | line, bar |
80
- | grid | `gridShape`, `gridLevels`, `gridStroke` (rings), `spokeStroke` (spokes), `spokeLabels` | radar |
76
+ | grid | `horizontalGrid` (a 2px `white/15` stroke), `verticalGrid` (none) | line, bar |
77
+ | axes | `axisStroke` (none), `showXAxis`, `xLabelText`, `xTitleText`, `showYAxis`, `yLabelText`, `yTitleText` | line, bar |
78
+ | grid | `gridShape`, `gridLevels`, `gridStroke` (rings), `spokeStroke` (spokes), `spokeLabels`, `spokeText` | radar |
81
79
  | marks | the chart's own: `strokeWidth`, `curve`, `dots`, `area`, `barCornerRadius`, `barCornerStyle`, `innerRadius`, `sweep`, ... | every chart |
82
- | labels | `values` (line, bar), `labelPlacement` (pie), `ringLabels` (radial) | |
80
+ | labels | `values` and `valueText` (line, bar); `labelPlacement`, `labelText`, `valueText`, `centerText` (pie); `ringLabels`, `labelText`, `centerText` (radial) | |
83
81
 
84
- Every run of text is a `Types.typography` field (face, size, weight, style,
82
+ Every run of text is a `Types.typography` field in the group of the part it labels (face, size, weight, style,
85
83
  spacing, paint), so each is set like a text node; a partial (`{ fill }`) keeps the
86
84
  rest of the field's default. The chart places and aligns the text itself.
87
85
  `barCornerRadius` and `barCornerStyle` read as for a bar standing up: the top
@@ -91,7 +89,7 @@ A line is a stroke and an area is a fill: `horizontalGrid`, `verticalGrid`, `axi
91
89
  and `spokeStroke` are `Types.stroke` entries (weight, colour, dash and caps; empty draws
92
90
  nothing), and a radial's `track` is a `Types.fill` (empty draws no track). A series' `label`
93
91
  is optional; the legend shows `label || field`.
94
- | legend | `legend` (`bottom`, `top`, `right`, `none`), `swatch` (`square`, `circle`, `line`) | every chart |
92
+ | legend | `legend` (`bottom`, `top`, `right`, `none`), `swatch` (`square`, `circle`, `line`), `legendText` | every chart |
95
93
 
96
94
  A chart takes only the fields it draws. A style is a partial laid over the chart's
97
95
  previous style, and a key the chart does not have is dropped, so one style dresses
@@ -7,27 +7,27 @@ declare const BAR_STYLE: import("@motionscript/sdk").Type<_StyleInput<{
7
7
  } & {
8
8
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
9
9
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
10
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
10
11
  } & {
11
12
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
12
13
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
14
+ } & {
15
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
16
+ } & {
13
17
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
14
18
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
15
- showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
16
- } & {
17
- legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
18
19
  xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
19
20
  xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
21
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
20
22
  yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
21
23
  yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
22
- valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
23
- } & {
24
- seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
25
24
  } & {
26
25
  barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
27
26
  barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
28
27
  barWidth: import("@motionscript/sdk").Type<number, number, false>;
29
28
  barGap: import("@motionscript/sdk").Type<number, number, false>;
30
29
  } & {
30
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
31
31
  values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
32
32
  }>, _StyleValues<{
33
33
  gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
@@ -35,27 +35,27 @@ declare const BAR_STYLE: import("@motionscript/sdk").Type<_StyleInput<{
35
35
  } & {
36
36
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
37
37
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
38
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
38
39
  } & {
39
40
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
40
41
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
42
+ } & {
43
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
44
+ } & {
41
45
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
42
46
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
43
- showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
44
- } & {
45
- legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
46
47
  xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
47
48
  xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
49
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
48
50
  yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
49
51
  yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
50
- valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
51
- } & {
52
- seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
53
52
  } & {
54
53
  barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
55
54
  barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
56
55
  barWidth: import("@motionscript/sdk").Type<number, number, false>;
57
56
  barGap: import("@motionscript/sdk").Type<number, number, false>;
58
57
  } & {
58
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
59
59
  values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
60
60
  }>, false>;
61
61
  /** A bar chart's resolved style. */
@@ -98,27 +98,27 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
98
98
  } & {
99
99
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
100
100
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
101
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
101
102
  } & {
102
103
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
103
104
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
105
+ } & {
106
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
107
+ } & {
104
108
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
105
109
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
106
- showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
107
- } & {
108
- legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
109
110
  xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
110
111
  xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
112
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
111
113
  yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
112
114
  yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
113
- valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
114
- } & {
115
- seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
116
115
  } & {
117
116
  barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
118
117
  barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
119
118
  barWidth: import("@motionscript/sdk").Type<number, number, false>;
120
119
  barGap: import("@motionscript/sdk").Type<number, number, false>;
121
120
  } & {
121
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
122
122
  values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
123
123
  }>, _StyleValues<{
124
124
  gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
@@ -126,27 +126,27 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
126
126
  } & {
127
127
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
128
128
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
129
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
129
130
  } & {
130
131
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
131
132
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
133
+ } & {
134
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
135
+ } & {
132
136
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
133
137
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
134
- showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
135
- } & {
136
- legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
137
138
  xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
138
139
  xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
140
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
139
141
  yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
140
142
  yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
141
- valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
142
- } & {
143
- seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
144
143
  } & {
145
144
  barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
146
145
  barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
147
146
  barWidth: import("@motionscript/sdk").Type<number, number, false>;
148
147
  barGap: import("@motionscript/sdk").Type<number, number, false>;
149
148
  } & {
149
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
150
150
  values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
151
151
  }>, false>;
152
152
  /** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */
@@ -189,27 +189,27 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
189
189
  } & {
190
190
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
191
191
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
192
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
192
193
  } & {
193
194
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
194
195
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
196
+ } & {
197
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
198
+ } & {
195
199
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
196
200
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
197
- showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
198
- } & {
199
- legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
200
201
  xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
201
202
  xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
203
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
202
204
  yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
203
205
  yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
204
- valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
205
- } & {
206
- seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
207
206
  } & {
208
207
  barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
209
208
  barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
210
209
  barWidth: import("@motionscript/sdk").Type<number, number, false>;
211
210
  barGap: import("@motionscript/sdk").Type<number, number, false>;
212
211
  } & {
212
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
213
213
  values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
214
214
  }>, _StyleValues<{
215
215
  gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
@@ -217,27 +217,27 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
217
217
  } & {
218
218
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
219
219
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
220
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
220
221
  } & {
221
222
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
222
223
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
224
+ } & {
225
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
226
+ } & {
223
227
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
224
228
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
225
- showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
226
- } & {
227
- legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
228
229
  xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
229
230
  xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
231
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
230
232
  yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
231
233
  yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
232
- valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
233
- } & {
234
- seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
235
234
  } & {
236
235
  barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
237
236
  barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
238
237
  barWidth: import("@motionscript/sdk").Type<number, number, false>;
239
238
  barGap: import("@motionscript/sdk").Type<number, number, false>;
240
239
  } & {
240
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
241
241
  values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
242
242
  }>, false>;
243
243
  /** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */
@@ -265,27 +265,27 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
265
265
  } & {
266
266
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
267
267
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
268
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
268
269
  } & {
269
270
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
270
271
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
272
+ } & {
273
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
274
+ } & {
271
275
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
272
276
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
273
- showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
274
- } & {
275
- legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
276
277
  xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
277
278
  xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
279
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
278
280
  yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
279
281
  yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
280
- valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
281
- } & {
282
- seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
283
282
  } & {
284
283
  barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
285
284
  barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
286
285
  barWidth: import("@motionscript/sdk").Type<number, number, false>;
287
286
  barGap: import("@motionscript/sdk").Type<number, number, false>;
288
287
  } & {
288
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
289
289
  values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
290
290
  }>, _StyleValues<{
291
291
  gridBackground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
@@ -293,27 +293,27 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
293
293
  } & {
294
294
  legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
295
295
  swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
296
+ legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
296
297
  } & {
297
298
  horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
298
299
  verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
300
+ } & {
301
+ seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
302
+ } & {
299
303
  axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
300
304
  showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
301
- showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
302
- } & {
303
- legendText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
304
305
  xLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
305
306
  xTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
307
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
306
308
  yLabelText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
307
309
  yTitleText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
308
- valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
309
- } & {
310
- seriesFills: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
311
310
  } & {
312
311
  barCornerRadius: import("@motionscript/sdk").Type<_RectCornerRadius, _CornerRadiusResolved, false>;
313
312
  barCornerStyle: import("@motionscript/sdk").Type<_RectCornerStyle, _CornerStyleResolved, false>;
314
313
  barWidth: import("@motionscript/sdk").Type<number, number, false>;
315
314
  barGap: import("@motionscript/sdk").Type<number, number, false>;
316
315
  } & {
316
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
317
317
  values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
318
318
  }>, false>;
319
319
  /** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */
@@ -7,12 +7,12 @@ 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, niceTicks, num, resolveAxisDomain, settleAxisDomain, } from "../kit/shared.js";
10
- import { CARTESIAN_GRID, CARTESIAN_TEXT, CHART_LEGEND, CHART_SERIES, CHART_STYLE_FAMILY, CHART_STYLE_PRESETS, GRID_BACKGROUND, axisConfigOf, migrateChartStyle, 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, migrateChartStyle, legendConfigOf, seriesFill, valueText, } from "../kit/style.js";
11
11
  import { VerticalAxis, axisPads } from "../kit/vertical-axis.js";
12
12
  import { CategoryAxis, slotCentre } from "./category-axis.js";
13
13
  import { ChartBars } from "./chart-bars.js";
14
14
  import { BAR_LABELS, BAR_MARKS, barCategories, barSpans, resolveBarScale, } from "./shared.js";
15
- const BAR_STYLE = Types.style(CHART_STYLE_FAMILY, { series: CHART_SERIES, background: GRID_BACKGROUND, text: CARTESIAN_TEXT, grid: CARTESIAN_GRID, marks: BAR_MARKS, labels: BAR_LABELS, legend: CHART_LEGEND }, { presets: CHART_STYLE_PRESETS });
15
+ const BAR_STYLE = Types.style(CHART_STYLE_FAMILY, { series: CHART_SERIES, background: GRID_BACKGROUND, grid: CARTESIAN_GRID, axes: CARTESIAN_AXES, marks: BAR_MARKS, labels: BAR_LABELS, legend: CHART_LEGEND }, { presets: CHART_STYLE_PRESETS });
16
16
  function drawnValue(s, domain) {
17
17
  const divisions = (domain.ticks?.length ?? DEFAULT_MARKERS) - 1;
18
18
  const range = resolveBarScale(s.data, s.series, s.stack, domain.range, divisions);
@@ -1 +1 @@
1
- {"version":3,"file":"bar-chart.js","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,GAoBR,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACrH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAA+B,MAAM,eAAe,CAAA;AAC5G,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,UAAU,EACV,YAAY,EACZ,SAAS,EACT,GAAG,EACH,iBAAiB,EACjB,gBAAgB,GAIjB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,SAAS,GACV,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,YAAY,E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AAE,CAAC,CAAC,CAAA;YAC1I,CAAC;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import {\n Rect,\n Types,\n clamp,\n component2d,\n easeOut,\n type ChildView,\n type DataRecord,\n type NodeOf,\n type OutOf,\n // Named so this component's emitted type reaches `Node2D` and its props through the sdk, not core.\n type Node2D,\n type Node2DProps as _Node2DProps,\n type TextStyle as _TextStyle,\n type CornerRadiusResolved as _CornerRadiusResolved,\n type CornerStyleResolved as _CornerStyleResolved,\n type RectCornerRadius as _RectCornerRadius,\n type RectCornerStyle as _RectCornerStyle,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n type Size2D,\n type StyleInput as _StyleInput,\n type StyleValues as _StyleValues,\n} from \"@motionscript/sdk\"\nimport { formatNumber } from \"@motionscript/sdk/component\"\n\nimport { cartesianFrame, chartViews, columnGhost, frameGap, headroom, laidOutSize, overhang } from \"../kit/cartesian\"\nimport { ChartCanvas } from \"../kit/chart-canvas\"\nimport { ChartLegend } from \"../kit/chart-legend\"\nimport { SERIES_ARG, asParts, fresh } from \"../kit/entries\"\nimport { HorizontalAxis } from \"../kit/horizontal-axis\"\nimport { DEFAULT_MARKERS, ENTER_SHARE, beats, legendAway, type AnyTimeline, type Beat } from \"../kit/motion\"\nimport {\n SPOTLIGHT_DIM,\n formatMarker,\n lerpAxisDomain,\n lerpAxisEntry,\n markerStep,\n markerValues,\n niceTicks,\n num,\n resolveAxisDomain,\n settleAxisDomain,\n type AxisDomainConfig,\n type Range,\n type ResolvedAxisDomain,\n} from \"../kit/shared\"\nimport {\n CARTESIAN_GRID,\n CARTESIAN_TEXT,\n CHART_LEGEND,\n CHART_SERIES,\n CHART_STYLE_FAMILY,\n CHART_STYLE_PRESETS,\n GRID_BACKGROUND,\n axisConfigOf,\n migrateChartStyle,\n legendConfigOf,\n seriesFill,\n valueText,\n} from \"../kit/style\"\nimport { VerticalAxis, axisPads } from \"../kit/vertical-axis\"\nimport { CategoryAxis, slotCentre } from \"./category-axis\"\nimport { ChartBars, type BarGeometry } from \"./chart-bars\"\nimport {\n BAR_LABELS,\n BAR_MARKS,\n barCategories,\n barSpans,\n resolveBarScale,\n type BarOrientation,\n type BarSeries,\n type BarStack,\n} from \"./shared\"\n\nconst BAR_STYLE = Types.style(\n CHART_STYLE_FAMILY,\n { series: CHART_SERIES, background: GRID_BACKGROUND, text: CARTESIAN_TEXT, grid: CARTESIAN_GRID, marks: BAR_MARKS, labels: BAR_LABELS, legend: CHART_LEGEND },\n { presets: CHART_STYLE_PRESETS }\n)\n\n/** A bar chart's resolved style. */\nexport type BarChartStyle = OutOf<typeof BAR_STYLE>\n\n/** What a bar chart plots, as its entries hold it. */\nexport interface BarChartValues {\n readonly data: DataRecord[]\n readonly series: BarSeries[]\n readonly stack: BarStack\n readonly valueAxis: AxisDomainConfig\n}\n\n/** The value axis's domain with its range and ticks resolved. */\nexport type BarChartDomain = ResolvedAxisDomain\n\ninterface BarState extends BarChartValues {\n readonly categoryField: string\n readonly orientation: BarOrientation\n readonly style: BarChartStyle\n readonly weights: number[]\n readonly showing: boolean[]\n readonly spotlight: number | null\n readonly spotlightReveal: number\n}\n\nfunction drawnValue(s: BarChartValues, domain: AxisDomainConfig): AxisDomainConfig {\n const divisions = (domain.ticks?.length ?? DEFAULT_MARKERS) - 1\n const range = resolveBarScale(s.data, s.series, s.stack, domain.range, divisions)\n const even = domain.range !== undefined || s.stack === \"percent\"\n return { ...domain, range, ticks: domain.ticks ?? (even ? markerValues(range, DEFAULT_MARKERS - 1) : niceTicks(range, DEFAULT_MARKERS - 1)) }\n}\n\n/** The last domain worked out from each data array, and what it was read from. */\nconst domainsDrawn = new WeakMap<DataRecord[], { readonly key: readonly unknown[]; readonly domain: BarChartDomain }>()\n\n/** The value axis as drawn now. A series being hidden keeps its room, so the ticks hold still while it goes. */\nexport function barChartDomain(s: BarChartValues): BarChartDomain {\n const key = [s.series, s.stack, s.valueAxis]\n const kept = domainsDrawn.get(s.data)\n if (kept && kept.key.every((value, i) => value === key[i])) return kept.domain\n const domain = settleAxisDomain(s.valueAxis, (d) => drawnValue(s, d)) as BarChartDomain\n domainsDrawn.set(s.data, { key, domain })\n return domain\n}\n\n/** Ticks and the figures printed by bars both read through here, so they cannot disagree about how a number looks. */\nfunction valueLabel(s: BarChartValues, domain: BarChartDomain, value: number): string {\n const pattern = s.valueAxis.format\n if (pattern !== undefined) return formatNumber(value, pattern)\n const text = formatMarker(value, markerStep(domain.ticks))\n return s.stack === \"percent\" ? `${text}%` : text\n}\n\n/** A value along the value axis, a run of `length` px centred on 0. */\nfunction valueToPx(domain: BarChartDomain, length: number, value: number): number {\n const [min, max] = domain.range\n if (max === min) return -length / 2\n return ((value - min) / (max - min) - 0.5) * length\n}\n\n/** Where bars grow from: zero held on the scale, so a cropped axis grows them from the plot's edge. */\nfunction baselineValue(domain: BarChartDomain): number {\n const [lo, hi] = domain.range\n return clamp(0, Math.min(lo, hi), Math.max(lo, hi))\n}\n\nfunction weightAt(s: { readonly weights: readonly number[] }, index: number): number {\n return Math.max(0, s.weights[index] ?? 1)\n}\n\n/** The plot's run along the value axis and across the categories. */\nfunction runs(s: BarState, plot: Size2D): { along: number; across: number } {\n return s.orientation === \"horizontal\" ? { along: plot.width, across: plot.height } : { along: plot.height, across: plot.width }\n}\n\n/** Category `row`'s slot centre across the plot: left to right, or top to bottom. */\nfunction slotAt(s: BarState, row: number, across: number): number {\n const centre = slotCentre(row, s.data.length, across)\n return s.orientation === \"horizontal\" ? -centre : centre\n}\n\n/**\n * Series `index`'s bars in centred pixel space. Side by side, a series divides\n * the slot with its siblings by live weight; stacked, it takes the whole slot\n * and its weight scales its length, so hiding a series reflows rather than\n * punching a hole.\n */\nfunction seriesBars(s: BarState, index: number, plot: Size2D): BarGeometry[] {\n const series = s.series[index]\n if (!series) return []\n const domain = barChartDomain(s)\n const { along, across } = runs(s, plot)\n const n = s.data.length\n const slot = n > 0 ? across / n : 0\n const inner = slot * clamp(s.style.barWidth, 0, 1)\n const stacked = s.stack !== \"none\"\n let total = 0\n for (let i = 0; i < s.series.length; i++) total += weightAt(s, i)\n const unit = inner / (total > 0 ? total : 1)\n const weight = weightAt(s, index)\n let before = 0\n for (let i = 0; i < index; i++) before += weightAt(s, i)\n const gap = s.series.length > 1 ? s.style.barGap : 0\n const values = s.style.values\n\n return s.data.map((row, rowIndex) => {\n // Built from live contributions, so a fading series lowers the segments beyond it.\n const spans = barSpans(row, s.series, s.stack, s.weights)\n const span = spans[index] ?? { from: 0, to: 0, value: 0, outer: false }\n const centre = slotAt(s, rowIndex, across)\n const offset = -inner / 2 + unit * before + (unit * weight) / 2\n let caption = \"\"\n if (values !== \"none\" && span.value !== 0) {\n if (!stacked || values === \"inside\" || s.stack === \"percent\") caption = valueLabel(s, domain, stacked ? span.value : num(row, series.field))\n else if (span.outer) caption = valueLabel(s, domain, span.to)\n }\n return {\n center: stacked ? centre : centre + (s.orientation === \"horizontal\" ? -offset : offset),\n thickness: stacked ? inner : Math.max(0, unit * weight - gap),\n from: valueToPx(domain, along, span.from),\n to: valueToPx(domain, along, span.to),\n round: span.outer,\n grounded: !stacked || span.from === 0,\n caption,\n }\n })\n}\n\n/** Per-row opacity: 1 while nothing is spotlit, falling to {@link SPOTLIGHT_DIM} for all but the chosen category. */\nfunction categoryDims(s: BarState): number[] {\n const focus = clamp(s.spotlightReveal, 0, 1)\n const chosen = s.spotlight\n return s.data.map((_, i) => (focus <= 0 || chosen === i ? 1 : 1 - (1 - SPOTLIGHT_DIM) * focus))\n}\n\n/** The parts a bar chart's commands drive, found through its children. */\nfunction partsOf(children: readonly ChildView[]) {\n const views = chartViews(children)\n return {\n valueAxis: views.find((view) => VerticalAxis.is(view) || HorizontalAxis.is(view)) ?? null,\n categoryAxis: views.find(CategoryAxis.is) ?? null,\n bars: views.filter(ChartBars.is),\n legend: views.find(ChartLegend.is) ?? null,\n }\n}\n\n/**\n * Move series `index`'s share to `target` with its legend entry. Its bars stay\n * drawn for every frame the move covers and switch off only once a hide has\n * landed, so arriving at a time backwards matches arriving forwards.\n */\nfunction toggling(timeline: AnyTimeline, state: BarState, children: readonly ChildView[], index: number, target: number) {\n const parts = partsOf(children)\n if (!parts.bars[index]) return timeline.wait(timeline.duration)\n const from = state.series.map((_, i) => weightAt(state, i))\n const start = from[index] ?? 1\n const showing = state.series.map((s, i) => state.showing[i] ?? (s.enabled ?? true))\n return timeline.together([\n timeline.animate((t) => {\n const weights = [...from]\n weights[index] = start + (target - start) * timeline.ease(t)\n const shown = [...showing]\n shown[index] = target > 0 || t < 1\n return { weights, showing: shown }\n }, { eased: false }),\n ...(parts.legend ? [parts.legend.run(target > 0 ? \"showSeries\" : \"hideSeries\", { index })] : []),\n ])\n}\n\n/**\n * A bar chart, vertical or horizontal, its series side by side, stacked, or\n * stacked as shares of 100. Built like the line chart from `ChartCanvas`, a\n * value axis, a {@link CategoryAxis}, one {@link ChartBars} per series and\n * `ChartLegend`. Zero is always on the scale and bars grow about it, so a\n * negative value draws the other way from the same `growth` signal.\n *\n * Resting state is the finished chart; `enter` arms every part on its first\n * frame. A `to` of the value axis's `range` or `ticks` tweens from the domain as\n * drawn, so an auto axis rescales the bars continuously.\n */\nexport const BarChart = component2d({\n key: \"barChart\",\n state: {\n data: fresh<DataRecord[]>(() => [], { kind: \"dataset\" }),\n // Names a column, not a value, like the line chart's `xField`.\n categoryField: \"\",\n series: fresh<BarSeries[]>(() => [], { kind: \"series\" }),\n /** `vertical`: columns rise from a row of categories; `horizontal`: bars grow right from a column of them. */\n orientation: Types.oneOf([\"vertical\", \"horizontal\"] as const, { animatable: false }),\n /** `stacked`: each series sits on the sum of those before it; `percent`: every category reads as shares of 100. */\n stack: Types.oneOf([\"none\", \"stacked\", \"percent\"] as const),\n valueAxis: Types.custom<AxisDomainConfig>({}, { resolve: resolveAxisDomain, lerp: lerpAxisEntry }),\n categoryAxis: Types.custom<AxisDomainConfig>({}, { resolve: resolveAxisDomain, lerp: lerpAxisDomain }),\n style: BAR_STYLE,\n /** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */\n growth: 1,\n /** The category spotlit, or `null`. The choice snaps; `spotlightReveal` animates it. */\n spotlight: Types.custom<number | null>(null),\n spotlightReveal: 0,\n /** Each series' share of the slot, seeded from `enabled`: a weight rather than a switch, so hiding one widens the others. */\n weights: Types.custom<number[]>([], { private: true }),\n /** Whether each series' bars are drawn: on for every frame a show or hide covers, off once a hide lands. */\n showing: Types.custom<boolean[]>([], { private: true }),\n },\n defaults: {\n // A node made of parts that fill would otherwise hug them.\n width: \"fill\",\n height: \"fill\",\n weights: (state) => state.series.map((s) => ((s.enabled ?? true) ? 1 : 0)),\n showing: (state) => state.series.map((s) => s.enabled ?? true),\n },\n migrate: { style: migrateChartStyle(\"cartesian\") },\n allowedChildren: [],\n children: (state) => {\n const style = () => state.style\n const domain = () => barChartDomain(state)\n let plot: Node2D | undefined\n const plotSize = () => laidOutSize(plot)\n const built = state.style\n const horizontal = state.orientation === \"horizontal\"\n const categories = barCategories(state.data, state.categoryField)\n const valueConfig = () => axisConfigOf(style(), horizontal ? \"x\" : \"y\")\n const categoryConfig = () => axisConfigOf(style(), horizontal ? \"y\" : \"x\")\n const valueCaptions = () => {\n const d = domain()\n return d.ticks.map((value) => valueLabel(state, d, value))\n }\n const showValue = horizontal ? built.showXAxis : built.showYAxis\n const showCategory = horizontal ? built.showYAxis : built.showXAxis\n\n const valueAxis = showValue\n ? (horizontal\n ? new HorizontalAxis({\n range: () => domain().range,\n markers: () => domain().ticks,\n captions: valueCaptions,\n axis: valueConfig,\n label: state.valueAxis.label ?? \"\",\n overhang: () => ({ left: overhang(style()), right: overhang(style()) }),\n width: \"fill\",\n height: \"hug\",\n })\n : new VerticalAxis({\n range: () => domain().range,\n markers: () => domain().ticks,\n captions: valueCaptions,\n axis: valueConfig,\n label: state.valueAxis.label ?? \"\",\n width: \"hug\",\n height: \"fill\",\n })) as unknown as Node2D\n : undefined\n\n const categoryAxis = showCategory\n ? (new CategoryAxis({\n categories,\n axis: categoryConfig,\n label: state.categoryAxis.label ?? \"\",\n orientation: horizontal ? \"vertical\" : \"horizontal\",\n dims: () => categoryDims(state),\n width: horizontal ? \"hug\" : \"fill\",\n height: horizontal ? \"fill\" : \"hug\",\n }) as unknown as Node2D)\n : undefined\n\n const left = horizontal ? categoryAxis : valueAxis\n const bottom = horizontal ? valueAxis : categoryAxis\n const leftConfig = horizontal ? categoryConfig : valueConfig\n const ghost = left && bottom\n ? columnGhost({\n captions: horizontal ? () => categories : valueCaptions,\n count: horizontal ? categories.length : barChartDomain(state).ticks.length,\n text: () => leftConfig().labelStyle,\n title: (horizontal ? state.categoryAxis.label : state.valueAxis.label) ?? \"\",\n titleText: () => leftConfig().titleStyle,\n tickPad: () => axisPads(leftConfig(), \"right\").tick,\n titlePad: () => axisPads(leftConfig(), \"right\").title,\n })\n : undefined\n\n const barSets = state.series.map(\n (s, i) =>\n new ChartBars({\n bars: () => seriesBars(state, i, plotSize()),\n baseline: () => valueToPx(domain(), runs(state, plotSize()).along, baselineValue(domain())),\n horizontal,\n fill: () => seriesFill(style(), s, i),\n cornerRadius: () => style().barCornerRadius,\n cornerStyle: () => style().barCornerStyle,\n growth: () => state.growth,\n dims: () => categoryDims(state),\n // A figure past a stack's end prints the stack's total; a percent stack has none worth printing, so prints its shares inside.\n values: () => (built.values === \"end\" && state.stack === \"percent\" ? \"inside\" : built.values),\n valueStyle: () => valueText(style()),\n enabled: () => state.showing[i] ?? (s.enabled ?? true),\n }) as unknown as Node2D\n )\n\n const legendAt = built.legend\n const legend = legendAt !== \"none\"\n ? (new ChartLegend({\n series: state.series,\n swatches: () => state.series.map((s, i) => seriesFill(style(), s, i)),\n legend: () => legendConfigOf(style()),\n flow: legendAt === \"right\" ? \"vertical\" : \"horizontal\",\n }) as unknown as Node2D)\n : undefined\n\n const n = state.data.length\n // Category lines fall between the slots, never through a bar.\n const boundaries = () => Array.from({ length: Math.max(0, n - 1) }, (_, i) => i + 1)\n const slots = (): Range => [0, Math.max(1, n)]\n plot = new Rect({\n children: [\n new ChartCanvas({\n fill: () => style().gridBackground,\n xGridStroke: () => style().verticalGrid,\n yGridStroke: () => style().horizontalGrid,\n xMarkers: horizontal ? () => domain().ticks : boundaries,\n yMarkers: horizontal ? boundaries : () => domain().ticks,\n xExtent: horizontal ? () => domain().range : slots,\n yExtent: horizontal ? slots : () => domain().range,\n axisStroke: () => style().axisStroke,\n xAxisAt: () => (horizontal ? 0 : baselineValue(domain())),\n yAxisAt: () => (horizontal ? baselineValue(domain()) : 0),\n }),\n ...barSets,\n ],\n }) as unknown as Node2D\n\n return asParts([\n cartesianFrame({\n background: () => style().background,\n left,\n ghost,\n plot,\n bottom,\n legend,\n legendAt,\n gap: () => frameGap(style()),\n padding: () => ({\n top: headroom(style()),\n right: horizontal && bottom ? overhang(style()) : 0,\n left: horizontal && bottom && !left ? overhang(style()) : 0,\n bottom: 0,\n }),\n }),\n ])\n },\n commands: {\n /** Axes stagger in, bars rise from the baseline, the legend fades up last. `duration` is the whole entrance. */\n enter: {\n args: {},\n // Held from arrival, so it never shows finished ahead of its draw.\n entrance: true,\n easing: easeOut(),\n run: (timeline, state, children) => {\n const parts = partsOf(children)\n const duration = timeline.duration\n const axes = duration * ENTER_SHARE.axes\n const rise = duration * ENTER_SHARE.marks\n const { legend } = parts\n const at0 = (piece: Beat[\"piece\"]): Beat => ({ at: 0, duration: 0, piece })\n return beats(timeline, [\n at0(timeline.animate(() => ({ growth: 0 }))),\n ...(legend ? [at0(legend.to({ opacity: 0, ...legendAway(state.style.legend) }))] : []),\n ...(parts.valueAxis ? [{ at: 0, duration: axes, piece: parts.valueAxis.run(\"enter\", { slide: 24 }) }] : []),\n ...(parts.categoryAxis ? [{ at: 0, duration: axes, piece: parts.categoryAxis.run(\"enter\", { slide: 24 }) }] : []),\n // No priming to 0 first: the value at `t` is a function of `t`.\n { at: axes, duration: rise, piece: timeline.animate((t) => ({ growth: t })) },\n ...(legend ? [{ at: axes + rise, duration: duration * ENTER_SHARE.legend, piece: legend.to({ opacity: 1, x: 0, y: 0 }) }] : []),\n ])\n },\n },\n /** Bring series `index` back, the group reflowing to make room, with its legend entry. */\n showSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => toggling(timeline, state, children, timeline.args.seriesIndex, 1),\n },\n /** The mirror of `showSeries`: bars narrow away (stacked, sink out) while the rest widen into the space. */\n hideSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => toggling(timeline, state, children, timeline.args.seriesIndex, 0),\n },\n /** Fade every other series, bars and legend entry, to focus on `index`. Nothing moves, so the group does not reflow. */\n spotlightSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, _state, children) => {\n const parts = partsOf(children)\n const index = timeline.args.seriesIndex\n return timeline.together([\n ...parts.bars.map((bars, i) => bars.to({ opacity: i === index ? 1 : SPOTLIGHT_DIM })),\n ...(parts.legend ? [parts.legend.run(\"spotlightSeries\", { index })] : []),\n timeline.wait(timeline.duration),\n ])\n },\n },\n /**\n * Fade every other category's bars and caption to {@link SPOTLIGHT_DIM}. While\n * another is lit the focus moves directly. A missing category takes its slot\n * and changes nothing.\n */\n spotlightCategory: {\n args: { categoryIndex: Types.number(0, { min: 0, step: 1 }) },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.categoryIndex\n if (index < 0 || index >= state.data.length) return timeline.wait(timeline.duration)\n const from = state.spotlightReveal\n return timeline.animate((t) => ({ spotlight: index, spotlightReveal: from + (1 - from) * t }))\n },\n },\n /** Every category back to full; the lit one is held until the fade lands. A no-op when nothing is lit, which still takes its slot. */\n clearCategory: {\n args: {},\n easing: easeOut(),\n run: (timeline, state) => {\n const from = state.spotlightReveal\n if (from === 0) return timeline.wait(timeline.duration)\n const lit = state.spotlight\n return timeline.animate((t) => (t >= 1 ? { spotlight: null, spotlightReveal: 0 } : { spotlight: lit, spotlightReveal: from * (1 - t) }))\n },\n },\n },\n})\n\nexport type BarChart = NodeOf<typeof BarChart>\n"]}
1
+ {"version":3,"file":"bar-chart.js","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,GAoBR,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACrH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAA+B,MAAM,eAAe,CAAA;AAC5G,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,UAAU,EACV,YAAY,EACZ,SAAS,EACT,GAAG,EACH,iBAAiB,EACjB,gBAAgB,GAIjB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,SAAS,GACV,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAoB,MAAM,cAAc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,\n Types,\n clamp,\n component2d,\n easeOut,\n type ChildView,\n type DataRecord,\n type NodeOf,\n type OutOf,\n // Named so this component's emitted type reaches `Node2D` and its props through the sdk, not core.\n type Node2D,\n type Node2DProps as _Node2DProps,\n type TextStyle as _TextStyle,\n type CornerRadiusResolved as _CornerRadiusResolved,\n type CornerStyleResolved as _CornerStyleResolved,\n type RectCornerRadius as _RectCornerRadius,\n type RectCornerStyle as _RectCornerStyle,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n type Size2D,\n type StyleInput as _StyleInput,\n type StyleValues as _StyleValues,\n} from \"@motionscript/sdk\"\nimport { formatNumber } from \"@motionscript/sdk/component\"\n\nimport { cartesianFrame, chartViews, columnGhost, frameGap, headroom, laidOutSize, overhang } from \"../kit/cartesian\"\nimport { ChartCanvas } from \"../kit/chart-canvas\"\nimport { ChartLegend } from \"../kit/chart-legend\"\nimport { SERIES_ARG, asParts, fresh } from \"../kit/entries\"\nimport { HorizontalAxis } from \"../kit/horizontal-axis\"\nimport { DEFAULT_MARKERS, ENTER_SHARE, beats, legendAway, type AnyTimeline, type Beat } from \"../kit/motion\"\nimport {\n SPOTLIGHT_DIM,\n formatMarker,\n lerpAxisDomain,\n lerpAxisEntry,\n markerStep,\n markerValues,\n niceTicks,\n num,\n resolveAxisDomain,\n settleAxisDomain,\n type AxisDomainConfig,\n type Range,\n type ResolvedAxisDomain,\n} from \"../kit/shared\"\nimport {\n CARTESIAN_GRID,\n CARTESIAN_AXES,\n CHART_LEGEND,\n CHART_SERIES,\n CHART_STYLE_FAMILY,\n CHART_STYLE_PRESETS,\n GRID_BACKGROUND,\n axisConfigOf,\n migrateChartStyle,\n legendConfigOf,\n seriesFill,\n valueText,\n} from \"../kit/style\"\nimport { VerticalAxis, axisPads } from \"../kit/vertical-axis\"\nimport { CategoryAxis, slotCentre } from \"./category-axis\"\nimport { ChartBars, type BarGeometry } from \"./chart-bars\"\nimport {\n BAR_LABELS,\n BAR_MARKS,\n barCategories,\n barSpans,\n resolveBarScale,\n type BarOrientation,\n type BarSeries,\n type BarStack,\n} from \"./shared\"\n\nconst BAR_STYLE = Types.style(\n CHART_STYLE_FAMILY,\n { series: CHART_SERIES, background: GRID_BACKGROUND, grid: CARTESIAN_GRID, axes: CARTESIAN_AXES, marks: BAR_MARKS, labels: BAR_LABELS, legend: CHART_LEGEND },\n { presets: CHART_STYLE_PRESETS }\n)\n\n/** A bar chart's resolved style. */\nexport type BarChartStyle = OutOf<typeof BAR_STYLE>\n\n/** What a bar chart plots, as its entries hold it. */\nexport interface BarChartValues {\n readonly data: DataRecord[]\n readonly series: BarSeries[]\n readonly stack: BarStack\n readonly valueAxis: AxisDomainConfig\n}\n\n/** The value axis's domain with its range and ticks resolved. */\nexport type BarChartDomain = ResolvedAxisDomain\n\ninterface BarState extends BarChartValues {\n readonly categoryField: string\n readonly orientation: BarOrientation\n readonly style: BarChartStyle\n readonly weights: number[]\n readonly showing: boolean[]\n readonly spotlight: number | null\n readonly spotlightReveal: number\n}\n\nfunction drawnValue(s: BarChartValues, domain: AxisDomainConfig): AxisDomainConfig {\n const divisions = (domain.ticks?.length ?? DEFAULT_MARKERS) - 1\n const range = resolveBarScale(s.data, s.series, s.stack, domain.range, divisions)\n const even = domain.range !== undefined || s.stack === \"percent\"\n return { ...domain, range, ticks: domain.ticks ?? (even ? markerValues(range, DEFAULT_MARKERS - 1) : niceTicks(range, DEFAULT_MARKERS - 1)) }\n}\n\n/** The last domain worked out from each data array, and what it was read from. */\nconst domainsDrawn = new WeakMap<DataRecord[], { readonly key: readonly unknown[]; readonly domain: BarChartDomain }>()\n\n/** The value axis as drawn now. A series being hidden keeps its room, so the ticks hold still while it goes. */\nexport function barChartDomain(s: BarChartValues): BarChartDomain {\n const key = [s.series, s.stack, s.valueAxis]\n const kept = domainsDrawn.get(s.data)\n if (kept && kept.key.every((value, i) => value === key[i])) return kept.domain\n const domain = settleAxisDomain(s.valueAxis, (d) => drawnValue(s, d)) as BarChartDomain\n domainsDrawn.set(s.data, { key, domain })\n return domain\n}\n\n/** Ticks and the figures printed by bars both read through here, so they cannot disagree about how a number looks. */\nfunction valueLabel(s: BarChartValues, domain: BarChartDomain, value: number): string {\n const pattern = s.valueAxis.format\n if (pattern !== undefined) return formatNumber(value, pattern)\n const text = formatMarker(value, markerStep(domain.ticks))\n return s.stack === \"percent\" ? `${text}%` : text\n}\n\n/** A value along the value axis, a run of `length` px centred on 0. */\nfunction valueToPx(domain: BarChartDomain, length: number, value: number): number {\n const [min, max] = domain.range\n if (max === min) return -length / 2\n return ((value - min) / (max - min) - 0.5) * length\n}\n\n/** Where bars grow from: zero held on the scale, so a cropped axis grows them from the plot's edge. */\nfunction baselineValue(domain: BarChartDomain): number {\n const [lo, hi] = domain.range\n return clamp(0, Math.min(lo, hi), Math.max(lo, hi))\n}\n\nfunction weightAt(s: { readonly weights: readonly number[] }, index: number): number {\n return Math.max(0, s.weights[index] ?? 1)\n}\n\n/** The plot's run along the value axis and across the categories. */\nfunction runs(s: BarState, plot: Size2D): { along: number; across: number } {\n return s.orientation === \"horizontal\" ? { along: plot.width, across: plot.height } : { along: plot.height, across: plot.width }\n}\n\n/** Category `row`'s slot centre across the plot: left to right, or top to bottom. */\nfunction slotAt(s: BarState, row: number, across: number): number {\n const centre = slotCentre(row, s.data.length, across)\n return s.orientation === \"horizontal\" ? -centre : centre\n}\n\n/**\n * Series `index`'s bars in centred pixel space. Side by side, a series divides\n * the slot with its siblings by live weight; stacked, it takes the whole slot\n * and its weight scales its length, so hiding a series reflows rather than\n * punching a hole.\n */\nfunction seriesBars(s: BarState, index: number, plot: Size2D): BarGeometry[] {\n const series = s.series[index]\n if (!series) return []\n const domain = barChartDomain(s)\n const { along, across } = runs(s, plot)\n const n = s.data.length\n const slot = n > 0 ? across / n : 0\n const inner = slot * clamp(s.style.barWidth, 0, 1)\n const stacked = s.stack !== \"none\"\n let total = 0\n for (let i = 0; i < s.series.length; i++) total += weightAt(s, i)\n const unit = inner / (total > 0 ? total : 1)\n const weight = weightAt(s, index)\n let before = 0\n for (let i = 0; i < index; i++) before += weightAt(s, i)\n const gap = s.series.length > 1 ? s.style.barGap : 0\n const values = s.style.values\n\n return s.data.map((row, rowIndex) => {\n // Built from live contributions, so a fading series lowers the segments beyond it.\n const spans = barSpans(row, s.series, s.stack, s.weights)\n const span = spans[index] ?? { from: 0, to: 0, value: 0, outer: false }\n const centre = slotAt(s, rowIndex, across)\n const offset = -inner / 2 + unit * before + (unit * weight) / 2\n let caption = \"\"\n if (values !== \"none\" && span.value !== 0) {\n if (!stacked || values === \"inside\" || s.stack === \"percent\") caption = valueLabel(s, domain, stacked ? span.value : num(row, series.field))\n else if (span.outer) caption = valueLabel(s, domain, span.to)\n }\n return {\n center: stacked ? centre : centre + (s.orientation === \"horizontal\" ? -offset : offset),\n thickness: stacked ? inner : Math.max(0, unit * weight - gap),\n from: valueToPx(domain, along, span.from),\n to: valueToPx(domain, along, span.to),\n round: span.outer,\n grounded: !stacked || span.from === 0,\n caption,\n }\n })\n}\n\n/** Per-row opacity: 1 while nothing is spotlit, falling to {@link SPOTLIGHT_DIM} for all but the chosen category. */\nfunction categoryDims(s: BarState): number[] {\n const focus = clamp(s.spotlightReveal, 0, 1)\n const chosen = s.spotlight\n return s.data.map((_, i) => (focus <= 0 || chosen === i ? 1 : 1 - (1 - SPOTLIGHT_DIM) * focus))\n}\n\n/** The parts a bar chart's commands drive, found through its children. */\nfunction partsOf(children: readonly ChildView[]) {\n const views = chartViews(children)\n return {\n valueAxis: views.find((view) => VerticalAxis.is(view) || HorizontalAxis.is(view)) ?? null,\n categoryAxis: views.find(CategoryAxis.is) ?? null,\n bars: views.filter(ChartBars.is),\n legend: views.find(ChartLegend.is) ?? null,\n }\n}\n\n/**\n * Move series `index`'s share to `target` with its legend entry. Its bars stay\n * drawn for every frame the move covers and switch off only once a hide has\n * landed, so arriving at a time backwards matches arriving forwards.\n */\nfunction toggling(timeline: AnyTimeline, state: BarState, children: readonly ChildView[], index: number, target: number) {\n const parts = partsOf(children)\n if (!parts.bars[index]) return timeline.wait(timeline.duration)\n const from = state.series.map((_, i) => weightAt(state, i))\n const start = from[index] ?? 1\n const showing = state.series.map((s, i) => state.showing[i] ?? (s.enabled ?? true))\n return timeline.together([\n timeline.animate((t) => {\n const weights = [...from]\n weights[index] = start + (target - start) * timeline.ease(t)\n const shown = [...showing]\n shown[index] = target > 0 || t < 1\n return { weights, showing: shown }\n }, { eased: false }),\n ...(parts.legend ? [parts.legend.run(target > 0 ? \"showSeries\" : \"hideSeries\", { index })] : []),\n ])\n}\n\n/**\n * A bar chart, vertical or horizontal, its series side by side, stacked, or\n * stacked as shares of 100. Built like the line chart from `ChartCanvas`, a\n * value axis, a {@link CategoryAxis}, one {@link ChartBars} per series and\n * `ChartLegend`. Zero is always on the scale and bars grow about it, so a\n * negative value draws the other way from the same `growth` signal.\n *\n * Resting state is the finished chart; `enter` arms every part on its first\n * frame. A `to` of the value axis's `range` or `ticks` tweens from the domain as\n * drawn, so an auto axis rescales the bars continuously.\n */\nexport const BarChart = component2d({\n key: \"barChart\",\n state: {\n data: fresh<DataRecord[]>(() => [], { kind: \"dataset\" }),\n // Names a column, not a value, like the line chart's `xField`.\n categoryField: \"\",\n series: fresh<BarSeries[]>(() => [], { kind: \"series\" }),\n /** `vertical`: columns rise from a row of categories; `horizontal`: bars grow right from a column of them. */\n orientation: Types.oneOf([\"vertical\", \"horizontal\"] as const, { animatable: false }),\n /** `stacked`: each series sits on the sum of those before it; `percent`: every category reads as shares of 100. */\n stack: Types.oneOf([\"none\", \"stacked\", \"percent\"] as const),\n valueAxis: Types.custom<AxisDomainConfig>({}, { resolve: resolveAxisDomain, lerp: lerpAxisEntry }),\n categoryAxis: Types.custom<AxisDomainConfig>({}, { resolve: resolveAxisDomain, lerp: lerpAxisDomain }),\n style: BAR_STYLE,\n /** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */\n growth: 1,\n /** The category spotlit, or `null`. The choice snaps; `spotlightReveal` animates it. */\n spotlight: Types.custom<number | null>(null),\n spotlightReveal: 0,\n /** Each series' share of the slot, seeded from `enabled`: a weight rather than a switch, so hiding one widens the others. */\n weights: Types.custom<number[]>([], { private: true }),\n /** Whether each series' bars are drawn: on for every frame a show or hide covers, off once a hide lands. */\n showing: Types.custom<boolean[]>([], { private: true }),\n },\n defaults: {\n // A node made of parts that fill would otherwise hug them.\n width: \"fill\",\n height: \"fill\",\n weights: (state) => state.series.map((s) => ((s.enabled ?? true) ? 1 : 0)),\n showing: (state) => state.series.map((s) => s.enabled ?? true),\n },\n migrate: { style: migrateChartStyle(\"cartesian\") },\n allowedChildren: [],\n children: (state) => {\n const style = () => state.style\n const domain = () => barChartDomain(state)\n let plot: Node2D | undefined\n const plotSize = () => laidOutSize(plot)\n const built = state.style\n const horizontal = state.orientation === \"horizontal\"\n const categories = barCategories(state.data, state.categoryField)\n const valueConfig = () => axisConfigOf(style(), horizontal ? \"x\" : \"y\")\n const categoryConfig = () => axisConfigOf(style(), horizontal ? \"y\" : \"x\")\n const valueCaptions = () => {\n const d = domain()\n return d.ticks.map((value) => valueLabel(state, d, value))\n }\n const showValue = horizontal ? built.showXAxis : built.showYAxis\n const showCategory = horizontal ? built.showYAxis : built.showXAxis\n\n const valueAxis = showValue\n ? (horizontal\n ? new HorizontalAxis({\n range: () => domain().range,\n markers: () => domain().ticks,\n captions: valueCaptions,\n axis: valueConfig,\n label: state.valueAxis.label ?? \"\",\n overhang: () => ({ left: overhang(style()), right: overhang(style()) }),\n width: \"fill\",\n height: \"hug\",\n })\n : new VerticalAxis({\n range: () => domain().range,\n markers: () => domain().ticks,\n captions: valueCaptions,\n axis: valueConfig,\n label: state.valueAxis.label ?? \"\",\n width: \"hug\",\n height: \"fill\",\n })) as unknown as Node2D\n : undefined\n\n const categoryAxis = showCategory\n ? (new CategoryAxis({\n categories,\n axis: categoryConfig,\n label: state.categoryAxis.label ?? \"\",\n orientation: horizontal ? \"vertical\" : \"horizontal\",\n dims: () => categoryDims(state),\n width: horizontal ? \"hug\" : \"fill\",\n height: horizontal ? \"fill\" : \"hug\",\n }) as unknown as Node2D)\n : undefined\n\n const left = horizontal ? categoryAxis : valueAxis\n const bottom = horizontal ? valueAxis : categoryAxis\n const leftConfig = horizontal ? categoryConfig : valueConfig\n const ghost = left && bottom\n ? columnGhost({\n captions: horizontal ? () => categories : valueCaptions,\n count: horizontal ? categories.length : barChartDomain(state).ticks.length,\n text: () => leftConfig().labelStyle,\n title: (horizontal ? state.categoryAxis.label : state.valueAxis.label) ?? \"\",\n titleText: () => leftConfig().titleStyle,\n tickPad: () => axisPads(leftConfig(), \"right\").tick,\n titlePad: () => axisPads(leftConfig(), \"right\").title,\n })\n : undefined\n\n const barSets = state.series.map(\n (s, i) =>\n new ChartBars({\n bars: () => seriesBars(state, i, plotSize()),\n baseline: () => valueToPx(domain(), runs(state, plotSize()).along, baselineValue(domain())),\n horizontal,\n fill: () => seriesFill(style(), s, i),\n cornerRadius: () => style().barCornerRadius,\n cornerStyle: () => style().barCornerStyle,\n growth: () => state.growth,\n dims: () => categoryDims(state),\n // A figure past a stack's end prints the stack's total; a percent stack has none worth printing, so prints its shares inside.\n values: () => (built.values === \"end\" && state.stack === \"percent\" ? \"inside\" : built.values),\n valueStyle: () => valueText(style()),\n enabled: () => state.showing[i] ?? (s.enabled ?? true),\n }) as unknown as Node2D\n )\n\n const legendAt = built.legend\n const legend = legendAt !== \"none\"\n ? (new ChartLegend({\n series: state.series,\n swatches: () => state.series.map((s, i) => seriesFill(style(), s, i)),\n legend: () => legendConfigOf(style()),\n flow: legendAt === \"right\" ? \"vertical\" : \"horizontal\",\n }) as unknown as Node2D)\n : undefined\n\n const n = state.data.length\n // Category lines fall between the slots, never through a bar.\n const boundaries = () => Array.from({ length: Math.max(0, n - 1) }, (_, i) => i + 1)\n const slots = (): Range => [0, Math.max(1, n)]\n plot = new Rect({\n children: [\n new ChartCanvas({\n fill: () => style().gridBackground,\n xGridStroke: () => style().verticalGrid,\n yGridStroke: () => style().horizontalGrid,\n xMarkers: horizontal ? () => domain().ticks : boundaries,\n yMarkers: horizontal ? boundaries : () => domain().ticks,\n xExtent: horizontal ? () => domain().range : slots,\n yExtent: horizontal ? slots : () => domain().range,\n axisStroke: () => style().axisStroke,\n xAxisAt: () => (horizontal ? 0 : baselineValue(domain())),\n yAxisAt: () => (horizontal ? baselineValue(domain()) : 0),\n }),\n ...barSets,\n ],\n }) as unknown as Node2D\n\n return asParts([\n cartesianFrame({\n background: () => style().background,\n left,\n ghost,\n plot,\n bottom,\n legend,\n legendAt,\n gap: () => frameGap(style()),\n padding: () => ({\n top: headroom(style()),\n right: horizontal && bottom ? overhang(style()) : 0,\n left: horizontal && bottom && !left ? overhang(style()) : 0,\n bottom: 0,\n }),\n }),\n ])\n },\n commands: {\n /** Axes stagger in, bars rise from the baseline, the legend fades up last. `duration` is the whole entrance. */\n enter: {\n args: {},\n // Held from arrival, so it never shows finished ahead of its draw.\n entrance: true,\n easing: easeOut(),\n run: (timeline, state, children) => {\n const parts = partsOf(children)\n const duration = timeline.duration\n const axes = duration * ENTER_SHARE.axes\n const rise = duration * ENTER_SHARE.marks\n const { legend } = parts\n const at0 = (piece: Beat[\"piece\"]): Beat => ({ at: 0, duration: 0, piece })\n return beats(timeline, [\n at0(timeline.animate(() => ({ growth: 0 }))),\n ...(legend ? [at0(legend.to({ opacity: 0, ...legendAway(state.style.legend) }))] : []),\n ...(parts.valueAxis ? [{ at: 0, duration: axes, piece: parts.valueAxis.run(\"enter\", { slide: 24 }) }] : []),\n ...(parts.categoryAxis ? [{ at: 0, duration: axes, piece: parts.categoryAxis.run(\"enter\", { slide: 24 }) }] : []),\n // No priming to 0 first: the value at `t` is a function of `t`.\n { at: axes, duration: rise, piece: timeline.animate((t) => ({ growth: t })) },\n ...(legend ? [{ at: axes + rise, duration: duration * ENTER_SHARE.legend, piece: legend.to({ opacity: 1, x: 0, y: 0 }) }] : []),\n ])\n },\n },\n /** Bring series `index` back, the group reflowing to make room, with its legend entry. */\n showSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => toggling(timeline, state, children, timeline.args.seriesIndex, 1),\n },\n /** The mirror of `showSeries`: bars narrow away (stacked, sink out) while the rest widen into the space. */\n hideSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => toggling(timeline, state, children, timeline.args.seriesIndex, 0),\n },\n /** Fade every other series, bars and legend entry, to focus on `index`. Nothing moves, so the group does not reflow. */\n spotlightSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, _state, children) => {\n const parts = partsOf(children)\n const index = timeline.args.seriesIndex\n return timeline.together([\n ...parts.bars.map((bars, i) => bars.to({ opacity: i === index ? 1 : SPOTLIGHT_DIM })),\n ...(parts.legend ? [parts.legend.run(\"spotlightSeries\", { index })] : []),\n timeline.wait(timeline.duration),\n ])\n },\n },\n /**\n * Fade every other category's bars and caption to {@link SPOTLIGHT_DIM}. While\n * another is lit the focus moves directly. A missing category takes its slot\n * and changes nothing.\n */\n spotlightCategory: {\n args: { categoryIndex: Types.number(0, { min: 0, step: 1 }) },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.categoryIndex\n if (index < 0 || index >= state.data.length) return timeline.wait(timeline.duration)\n const from = state.spotlightReveal\n return timeline.animate((t) => ({ spotlight: index, spotlightReveal: from + (1 - from) * t }))\n },\n },\n /** Every category back to full; the lit one is held until the fade lands. A no-op when nothing is lit, which still takes its slot. */\n clearCategory: {\n args: {},\n easing: easeOut(),\n run: (timeline, state) => {\n const from = state.spotlightReveal\n if (from === 0) return timeline.wait(timeline.duration)\n const lit = state.spotlight\n return timeline.animate((t) => (t >= 1 ? { spotlight: null, spotlightReveal: 0 } : { spotlight: lit, spotlightReveal: from * (1 - t) }))\n },\n },\n },\n})\n\nexport type BarChart = NodeOf<typeof BarChart>\n"]}
@@ -1,4 +1,4 @@
1
- import { type DataRecord, type Fill, type CornerRadiusResolved as _CornerRadiusResolved, type CornerStyleResolved as _CornerStyleResolved, type RectCornerRadius as _RectCornerRadius, type RectCornerStyle as _RectCornerStyle } from "@motionscript/sdk";
1
+ import { type DataRecord, type Fill, type CornerRadiusResolved as _CornerRadiusResolved, type CornerStyleResolved as _CornerStyleResolved, type RectCornerRadius as _RectCornerRadius, type RectCornerStyle as _RectCornerStyle, type TextStyle as _TextStyle } from "@motionscript/sdk";
2
2
  import { type ChartSeries, type Range } from "../kit/shared.js";
3
3
  /** One bar per row, beside its siblings in the category slot or stacked on them: {@link ChartSeries} under the name for what it draws here. */
4
4
  export type BarSeries = ChartSeries;
@@ -53,6 +53,7 @@ export declare const BAR_MARKS: {
53
53
  barGap: import("@motionscript/sdk").Type<number, number, false>;
54
54
  };
55
55
  export declare const BAR_LABELS: {
56
+ valueText: import("@motionscript/sdk").Type<_TextStyle, _TextStyle, false>;
56
57
  /** Read as the chart is built: each bar's value past its end, inside it, or none. */
57
58
  values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
58
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/bar-chart/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,IAAI,EAET,KAAK,oBAAoB,IAAI,qBAAqB,EAClD,KAAK,mBAAmB,IAAI,oBAAoB,EAChD,KAAK,gBAAgB,IAAI,iBAAiB,EAC1C,KAAK,eAAe,IAAI,gBAAgB,EACzC,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAwB,KAAK,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAA;AAElF,+IAA+I;AAC/I,MAAM,MAAM,SAAS,GAAG,WAAW,CAAA;AAEnC,2FAA2F;AAC3F,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;AAErD,wFAAwF;AACxF,MAAM,M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AAK,CAUpI;AAED,2LAA2L;AAC3L,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAAE,EAClB,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,KAAK,GAAG,SAAS,EACxB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAC1B,KAAK,CAKP;AAED,gFAAgF;AAChF,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAQxC;AAED,sEAAsE;AACtE,eAAO,MAAM,SAAS;IACpB;;;;OAIG;;;IAGH,oFAAoF;;IAEpF,yDAAyD;;CAE1D,CAAA;AAED,eAAO,MAAM,UAAU;;IACrB,qFAAqF;;CAGtF,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { Types, fillOps, } from "@motionscript/sdk";
2
2
  import { niceRange, num, text } from "../kit/shared.js";
3
+ import { VALUE_TEXT } from "../kit/style.js";
3
4
  /**
4
5
  * One row's spans, in series order. Stacking keeps a running sum on each side
5
6
  * of zero, so a negative value stacks downward from the baseline rather than
@@ -95,5 +96,6 @@ export const BAR_MARKS = {
95
96
  export const BAR_LABELS = {
96
97
  /** Read as the chart is built: each bar's value past its end, inside it, or none. */
97
98
  values: Types.oneOf(["none", "end", "inside"], { animatable: false }),
99
+ ...VALUE_TEXT,
98
100
  };
99
101
  //# sourceMappingURL=shared.js.map