@motionscript/charts 0.1.0-alpha.0 → 0.1.0-alpha.10

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 (152) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/NOTICE +49 -0
  3. package/README.md +99 -0
  4. package/dist/bar-chart/bar-chart.d.ts +133 -228
  5. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  6. package/dist/bar-chart/bar-chart.js +386 -565
  7. package/dist/bar-chart/bar-chart.js.map +1 -1
  8. package/dist/bar-chart/category-axis.d.ts +35 -41
  9. package/dist/bar-chart/category-axis.d.ts.map +1 -1
  10. package/dist/bar-chart/category-axis.js +93 -115
  11. package/dist/bar-chart/category-axis.js.map +1 -1
  12. package/dist/bar-chart/chart-bars.d.ts +50 -70
  13. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  14. package/dist/bar-chart/chart-bars.js +155 -210
  15. package/dist/bar-chart/chart-bars.js.map +1 -1
  16. package/dist/bar-chart/index.d.ts +2 -2
  17. package/dist/bar-chart/index.d.ts.map +1 -1
  18. package/dist/bar-chart/index.js +1 -1
  19. package/dist/bar-chart/index.js.map +1 -1
  20. package/dist/bar-chart/shared.d.ts +7 -7
  21. package/dist/bar-chart/shared.d.ts.map +1 -1
  22. package/dist/bar-chart/shared.js +7 -7
  23. package/dist/bar-chart/shared.js.map +1 -1
  24. package/dist/browser/chunks/chunk-TJNHLQGV.js +2 -0
  25. package/dist/browser/chunks/chunk-TJNHLQGV.js.map +7 -0
  26. package/dist/browser/index.js +1 -1
  27. package/dist/browser/index.js.map +3 -3
  28. package/dist/browser/kit.js +1 -1
  29. package/dist/browser/manifest.json +4 -3
  30. package/dist/engine.d.ts +10 -8
  31. package/dist/engine.d.ts.map +1 -1
  32. package/dist/engine.js +10 -8
  33. package/dist/engine.js.map +1 -1
  34. package/dist/kit/cartesian.d.ts +44 -0
  35. package/dist/kit/cartesian.d.ts.map +1 -0
  36. package/dist/kit/cartesian.js +59 -0
  37. package/dist/kit/cartesian.js.map +1 -0
  38. package/dist/kit/chart-border.d.ts +10 -11
  39. package/dist/kit/chart-border.d.ts.map +1 -1
  40. package/dist/kit/chart-border.js +15 -32
  41. package/dist/kit/chart-border.js.map +1 -1
  42. package/dist/kit/chart-canvas.d.ts +32 -21
  43. package/dist/kit/chart-canvas.d.ts.map +1 -1
  44. package/dist/kit/chart-canvas.js +33 -90
  45. package/dist/kit/chart-canvas.js.map +1 -1
  46. package/dist/kit/chart-legend.d.ts +123 -85
  47. package/dist/kit/chart-legend.d.ts.map +1 -1
  48. package/dist/kit/chart-legend.js +137 -186
  49. package/dist/kit/chart-legend.js.map +1 -1
  50. package/dist/kit/entries.d.ts +17 -0
  51. package/dist/kit/entries.d.ts.map +1 -0
  52. package/dist/kit/entries.js +19 -0
  53. package/dist/kit/entries.js.map +1 -0
  54. package/dist/kit/motion.d.ts +48 -0
  55. package/dist/kit/motion.d.ts.map +1 -0
  56. package/dist/kit/motion.js +63 -0
  57. package/dist/kit/motion.js.map +1 -0
  58. package/dist/kit/paints.d.ts +10 -0
  59. package/dist/kit/paints.d.ts.map +1 -0
  60. package/dist/kit/paints.js +12 -0
  61. package/dist/kit/paints.js.map +1 -0
  62. package/dist/kit/shared.d.ts +61 -10
  63. package/dist/kit/shared.d.ts.map +1 -1
  64. package/dist/kit/shared.js +108 -13
  65. package/dist/kit/shared.js.map +1 -1
  66. package/dist/kit/vertical-axis.d.ts +48 -61
  67. package/dist/kit/vertical-axis.d.ts.map +1 -1
  68. package/dist/kit/vertical-axis.js +97 -132
  69. package/dist/kit/vertical-axis.js.map +1 -1
  70. package/dist/line-chart/chart-line.d.ts +60 -77
  71. package/dist/line-chart/chart-line.d.ts.map +1 -1
  72. package/dist/line-chart/chart-line.js +100 -121
  73. package/dist/line-chart/chart-line.js.map +1 -1
  74. package/dist/line-chart/chart-region.d.ts +32 -33
  75. package/dist/line-chart/chart-region.d.ts.map +1 -1
  76. package/dist/line-chart/chart-region.js +31 -65
  77. package/dist/line-chart/chart-region.js.map +1 -1
  78. package/dist/line-chart/horizontal-axis.d.ts +58 -64
  79. package/dist/line-chart/horizontal-axis.d.ts.map +1 -1
  80. package/dist/line-chart/horizontal-axis.js +94 -123
  81. package/dist/line-chart/horizontal-axis.js.map +1 -1
  82. package/dist/line-chart/index.d.ts +3 -3
  83. package/dist/line-chart/index.d.ts.map +1 -1
  84. package/dist/line-chart/index.js +2 -2
  85. package/dist/line-chart/index.js.map +1 -1
  86. package/dist/line-chart/line-chart.d.ts +156 -303
  87. package/dist/line-chart/line-chart.d.ts.map +1 -1
  88. package/dist/line-chart/line-chart.js +410 -638
  89. package/dist/line-chart/line-chart.js.map +1 -1
  90. package/dist/line-chart/shared.d.ts +7 -7
  91. package/dist/line-chart/shared.d.ts.map +1 -1
  92. package/dist/line-chart/shared.js +23 -8
  93. package/dist/line-chart/shared.js.map +1 -1
  94. package/dist/line-chart/x-scale.d.ts +4 -11
  95. package/dist/line-chart/x-scale.d.ts.map +1 -1
  96. package/dist/line-chart/x-scale.js +16 -5
  97. package/dist/line-chart/x-scale.js.map +1 -1
  98. package/dist/nodes.d.ts +6 -9
  99. package/dist/nodes.d.ts.map +1 -1
  100. package/dist/nodes.js +7 -9
  101. package/dist/nodes.js.map +1 -1
  102. package/dist/pie-chart/index.d.ts +2 -2
  103. package/dist/pie-chart/index.d.ts.map +1 -1
  104. package/dist/pie-chart/index.js +1 -1
  105. package/dist/pie-chart/index.js.map +1 -1
  106. package/dist/pie-chart/pie-chart.d.ts +108 -126
  107. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  108. package/dist/pie-chart/pie-chart.js +202 -271
  109. package/dist/pie-chart/pie-chart.js.map +1 -1
  110. package/dist/pie-chart/pie-legend.d.ts +84 -31
  111. package/dist/pie-chart/pie-legend.d.ts.map +1 -1
  112. package/dist/pie-chart/pie-legend.js +93 -107
  113. package/dist/pie-chart/pie-legend.js.map +1 -1
  114. package/dist/pie-chart/pie-ring.d.ts +160 -122
  115. package/dist/pie-chart/pie-ring.d.ts.map +1 -1
  116. package/dist/pie-chart/pie-ring.js +333 -361
  117. package/dist/pie-chart/pie-ring.js.map +1 -1
  118. package/dist/pie-chart/shared.d.ts +12 -6
  119. package/dist/pie-chart/shared.d.ts.map +1 -1
  120. package/dist/pie-chart/shared.js +14 -8
  121. package/dist/pie-chart/shared.js.map +1 -1
  122. package/package.json +7 -4
  123. package/src/bar-chart/bar-chart.ts +424 -686
  124. package/src/bar-chart/category-axis.ts +96 -111
  125. package/src/bar-chart/chart-bars.ts +178 -201
  126. package/src/bar-chart/index.ts +2 -2
  127. package/src/bar-chart/shared.ts +7 -7
  128. package/src/engine.ts +10 -8
  129. package/src/kit/cartesian.ts +81 -0
  130. package/src/kit/chart-border.ts +23 -34
  131. package/src/kit/chart-canvas.ts +45 -80
  132. package/src/kit/chart-legend.ts +185 -206
  133. package/src/kit/entries.ts +20 -0
  134. package/src/kit/motion.ts +90 -0
  135. package/src/kit/paints.ts +15 -0
  136. package/src/kit/shared.ts +120 -13
  137. package/src/kit/vertical-axis.ts +111 -141
  138. package/src/line-chart/chart-line.ts +103 -155
  139. package/src/line-chart/chart-region.ts +36 -81
  140. package/src/line-chart/horizontal-axis.ts +102 -153
  141. package/src/line-chart/index.ts +3 -3
  142. package/src/line-chart/line-chart.ts +463 -759
  143. package/src/line-chart/shared.ts +22 -8
  144. package/src/line-chart/x-scale.ts +20 -5
  145. package/src/nodes.ts +8 -10
  146. package/src/pie-chart/index.ts +2 -2
  147. package/src/pie-chart/pie-chart.ts +225 -303
  148. package/src/pie-chart/pie-legend.ts +125 -115
  149. package/src/pie-chart/pie-ring.ts +388 -443
  150. package/src/pie-chart/shared.ts +14 -8
  151. package/dist/browser/chunks/chunk-ZMBOBHYL.js +0 -2
  152. package/dist/browser/chunks/chunk-ZMBOBHYL.js.map +0 -7
@@ -1,7 +1,6 @@
1
- import { Node2D, type CommandArgs, type DataRecord, type Command, type NodeConfig, type Node2DProps } from "@motionscript/core";
2
- import { type AxisDomainConfig } from "../kit/shared.js";
3
- import { type Seekable } from "@motionscript/core/component";
4
- import { type BarChartTheme, type BarSeries } from "./shared.js";
1
+ import { type DataRecord, type NodeOf, type Node2D, type Node2DProps } from "@motionscript/sdk";
2
+ import { type AxisDomainConfig, type Range } from "../kit/shared.js";
3
+ import { type BarChartConfig, type BarChartTheme, type BarSeries } from "./shared.js";
5
4
  export interface BarChartProps extends Node2DProps {
6
5
  /** One row per category — a plain record of field name to value. */
7
6
  data: DataRecord[];
@@ -34,253 +33,159 @@ export interface BarChartProps extends Node2DProps {
34
33
  /** Whether each column prints the figure it plots. */
35
34
  showValues?: boolean;
36
35
  }
37
- /**
38
- * How {@link BarChart.enter} divides its duration between its three beats: the
39
- * axes arriving, the columns rising, and the legend coming up. Shares of the
40
- * whole, so they must sum to 1 — the entrance takes exactly the time it was
41
- * given, for the reason spelt out on `LineChart.enter`.
42
- */
43
- /**
44
- * The signals the bar chart's own commands move, as props types.
45
- *
46
- * Written out rather than reusing `BarChartProps` because these are signals of
47
- * the chart's own — how far the columns have risen, and which category is lit —
48
- * rather than part of what an author states about it. Same reason the line chart
49
- * types its `RegionState` separately.
50
- */
51
- type CategorySpotlight = {
52
- spotlight: number | null;
53
- spotlightReveal: number;
36
+ /** What a bar chart plots, as its entries hold it. */
37
+ export interface BarChartValues {
38
+ readonly data: DataRecord[];
39
+ readonly series: BarSeries[];
40
+ readonly stacked: boolean;
41
+ readonly valueAxis: AxisDomainConfig;
42
+ }
43
+ /** The value axis's domain with its range and ticks resolved. */
44
+ export type BarChartDomain = AxisDomainConfig & {
45
+ readonly range: Range;
46
+ readonly ticks: number[];
54
47
  };
48
+ /** The value axis as a bar chart draws it now, an auto range or tick row read back as itself. */
49
+ export declare function barChartDomain(s: BarChartValues): BarChartDomain;
55
50
  /**
56
- * A grouped or stacked bar chart, composed from independent parts rather than
57
- * one monolithic draw — the sibling of the {@link LineChart} family, built the
58
- * same way and out of several of the same pieces:
51
+ * A grouped or stacked bar chart, the sibling of the line chart and built the
52
+ * same way, out of several of the same pieces:
59
53
  *
60
54
  * - `ChartCanvas` — the plot panel with a horizontal grid, under everything.
61
55
  * - `VerticalAxis` — the numeric value markers, staggering in bottom-to-top.
62
- * - {@link CategoryAxis} — the row of names beneath the baseline, one per row of
63
- * the data, staggering in left-to-right.
56
+ * - {@link CategoryAxis} — the row of names beneath the baseline, one per row.
64
57
  * - {@link ChartBars} (one per series) — that series' column in every category,
65
58
  * plus the figures printed on them.
66
59
  * - `ChartLegend` — a row of entries below the chart, one per series.
67
60
  *
68
- * The parts are laid out from this node's `layoutBounds` exactly as the line
69
- * chart's are: a left gutter for the value axis, a bottom gutter for the
70
- * captions, the plot filling what's left, and the legend row beneath the whole
71
- * thing. Every child's position and size is bound reactively, so the chart
72
- * re-flows if its box changes, and the bars read the same resolved scale the
73
- * axis does, so a column's end lands exactly on its marker.
74
- *
75
- * **Resting state is the finished chart** — the same bargain the line chart
76
- * makes: the studio paints a node's Initial state on a paused canvas, so a chart
77
- * that only appeared once a command had run would be edited blind. {@link enter}
78
- * arms every part back to its pre-entrance state before animating.
79
- *
80
- * **Zero is always on the scale** (see `barValueExtent`), and the columns
81
- * grow about it rather than about the plot floor, so a negative value draws
82
- * downward out of the same `growth` signal that draws a positive one up.
61
+ * Every part reads the chart's entries through bindings, and the columns map
62
+ * across the plot panel's own laid-out box, so a column's end lands exactly on
63
+ * its marker. **Zero is always on the scale**, and the columns grow about it, so
64
+ * a negative value draws downward out of the same `growth` signal.
83
65
  *
84
- * Past the entrance, two things move the chart:
85
- * {@link showSeries}/{@link hideSeries}/{@link spotlightSeries} pick out a
86
- * *series* — and hiding one **reflows the group**, the remaining columns
87
- * widening into the space as it goes, rather than leaving a hole where it was —
88
- * while {@link spotlightCategory}/{@link clearCategory} pick out a *column of
89
- * the table*, dimming every other category and its caption with it.
66
+ * **Resting state is the finished chart**; `enter` arms every part on its first
67
+ * frame. `showSeries`/`hideSeries`/`spotlightSeries` pick out a *series* (hiding
68
+ * one reflows the group), `spotlightCategory`/`clearCategory` a *column of the
69
+ * table*. A `to` of the value axis's `range` or `ticks` tweens from the domain
70
+ * as drawn, so an auto axis rescales the columns continuously.
90
71
  */
91
- export declare class BarChart extends Node2D<BarChartProps> {
92
- data: DataRecord[];
93
- categoryField: string;
94
- series: BarSeries[];
95
- stacked: boolean;
96
- /**
97
- * The value axis's domain (label/range/ticks), tweenable and mappable exactly
98
- * as the line chart's axes are: the mapper merges a partial input onto the
99
- * previous resolved domain and the tween interpolates numerically, so
100
- * `chart.to({ data: { valueAxis: { range: [0, 10] } }, duration: 1 })` smoothly
101
- * rescales every column. The axis *label* text is captured once at construction.
102
- */
103
- valueAxis: AxisDomainConfig;
104
- categoryAxis: AxisDomainConfig;
105
- theme: BarChartTheme;
72
+ export declare const BarChart: import("@motionscript/sdk").Component<"barChart", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
73
+ readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
74
+ readonly categoryField: "";
75
+ readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
76
+ readonly stacked: false;
77
+ readonly valueAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
78
+ readonly categoryAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
79
+ readonly theme: import("@motionscript/sdk").Type<BarChartTheme, BarChartConfig, false>;
106
80
  /**
107
81
  * Global rise of every column in `[0, 1]`, measured about the baseline: 0
108
- * collapses them all onto it, 1 draws them at full length. Each
109
- * {@link ChartBars}' own `growth` is bound to this, so tweening this one
110
- * signal raises the whole chart in proportion.
111
- */
112
- growth: number;
113
- /**
114
- * How much of the slot each series currently claims, one entry per series.
115
- *
116
- * A *weight* rather than a boolean, because that is what makes hiding a series
117
- * an animation instead of a jump: the grouped columns divide the slot in
118
- * proportion to these, so tweening one to 0 has the remaining columns widen
119
- * into the space as it shrinks away, and a stacked segment's contribution to
120
- * the stack fades out with it. Seeded from each series' `enabled` field.
82
+ * collapses them all onto it, 1 draws them at full length.
121
83
  */
122
- weights: number[];
84
+ readonly growth: 1;
123
85
  /**
124
- * The category currently spotlit, or `null` for none. Held as a plain reactive
125
- * value rather than a tweened one: the *choice* snaps, and the animation is
126
- * {@link spotlightReveal} dimming everything else.
86
+ * How much of the slot each series claims, one entry per series: a weight
87
+ * rather than a switch, so hiding one is the others widening into the space.
88
+ * Seeded from each series' `enabled`.
127
89
  */
128
- spotlight: number | null;
90
+ readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
91
+ /** The category spotlit, or `null` for none. The choice snaps; `spotlightReveal` is the animation. */
92
+ readonly spotlight: import("@motionscript/sdk").Type<number | null, number | null, false>;
129
93
  /** How far the category spotlight is drawn in, `[0, 1]`. */
130
- spotlightReveal: number;
131
- private vAxis;
132
- private cAxis;
133
- private legend;
134
- private barSets;
135
- /**
136
- * `this.theme` read back through its *resolved* shape — the same
137
- * loose-declared/resolved-stored idiom as a shape's `fill`/`stroke`, and as
138
- * the line chart's own theme.
139
- */
140
- private get resolvedTheme();
141
- /** Fallback marker count when the value axis states no ticks. */
142
- private static readonly DEFAULT_MARKERS;
143
- private get valueScale();
144
- /**
145
- * A value written down as this chart's value axis says — the axis ticks and
146
- * the figures printed on the columns both read through here, so the two
147
- * cannot disagree about what a number looks like.
148
- */
149
- private valueLabel;
150
- /** The value axis ticks: the explicit ones, else five across the scale. */
151
- private get resolvedMarkers();
152
- private get hasValueLabel();
153
- private get hasCategoryLabel();
154
- private get leftInset();
155
- private get bottomInset();
156
- /** The plot rectangle in node space: `{ left, right, top, bottom }` (y-up). */
157
- private plotBox;
158
- /** Width and height of the plot, in px. */
159
- private plotSize;
160
- /** Map a value onto the plot's **centred** pixel space (origin at its centre, y-up). */
161
- private valueToY;
162
- /**
163
- * Pixel y of the line every column grows from.
164
- *
165
- * Zero, clamped onto the scale — so an author who *did* crop the axis to
166
- * `[40, 100]` gets columns rising from the plot floor rather than from a
167
- * baseline off the bottom of the panel.
168
- */
169
- private get baselinePx();
170
- /** Width of one category's slot across the plot. */
171
- private get slotWidth();
172
- /** Centre x of category `i`'s slot, in the plot's centred space. */
173
- private slotCenter;
174
- /** The part of a slot the columns fill — the rest is the channel between categories. */
175
- private get slotInner();
176
- /** Series `i`'s live share of the slot; 0 once it has been hidden. */
177
- private weightAt;
178
- /** Total live share across the series — the slot's inner width divides by this. */
179
- private get totalWeight();
180
- /** Live share of every series *before* `index`, for the grouped offset. */
181
- private weightBefore;
182
- /**
183
- * Series `index`'s columns, mapped into the plot's centred pixel space.
184
- *
185
- * Both modes come out of one walk over the rows: a grouped series divides the
186
- * slot with its siblings and every column runs from zero, a stacked one takes
187
- * the whole slot and each column runs from the running total below it. The
188
- * live {@link weights} scale the grouped widths and the stacked contributions
189
- * alike, which is what lets `hideSeries` reflow rather than punch a hole.
190
- */
191
- private seriesBars;
192
- /**
193
- * `row` with each series' value scaled by that series' live {@link weights}
194
- * entry — what the stacked spans are measured from.
195
- */
196
- private weightedRow;
197
- /**
198
- * How far each category is dimmed by the spotlight, one entry per row —
199
- * 1 while nothing is spotlit, falling to the theme's `dimOpacity` for every
200
- * category but the chosen one as the reveal climbs.
201
- */
202
- private categoryDims;
203
- constructor(props?: NodeConfig<BarChart, BarChartProps>);
204
- /**
205
- * Prime every part at its pre-entrance state — axis markers and captions
206
- * shifted and transparent, columns collapsed onto the baseline, legend dropped
207
- * and transparent.
208
- *
209
- * Called by {@link enter} before its first frame so nothing flashes ahead of
210
- * its beat. Idempotent, and public so a scene can hide a chart ahead of time
211
- * without starting the entrance.
212
- */
213
- arm(): void;
214
- /**
215
- * Animate the whole chart in: the two axes stagger their markers and captions
216
- * in, the columns rise from the baseline, and the legend fades up last.
217
- *
218
- * `duration` is the **whole** entrance. The phases are shares of it, not
219
- * multiples — a command that declares 1.4 seconds has to take 1.4 seconds,
220
- * because that is the slot the timeline lays out for it, the length its
221
- * parallel siblings are timed against, and its contribution to the scene's own
222
- * duration.
223
- */
224
- enter(args: CommandArgs<Record<string, never>> & {
225
- duration: number;
226
- }): Seekable;
227
- /** Tween {@link growth} `0 → 1`, raising every column about the baseline. */
228
- private riseBars;
229
- /**
230
- * Show series `index`: bring its columns back, the group reflowing to make
231
- * room as they arrive, in lockstep with its legend entry growing in.
232
- */
233
- showSeries(args: CommandArgs<{
234
- seriesIndex: number;
235
- }>): Seekable;
236
- /**
237
- * Hide series `index`: its columns narrow away (or, stacked, sink out of the
238
- * stack) while the rest of the group widens into the space, its legend entry
239
- * shrinking beside them — the mirror of {@link showSeries}.
240
- */
241
- hideSeries(args: CommandArgs<{
242
- seriesIndex: number;
243
- }>): Seekable;
94
+ readonly spotlightReveal: 0;
95
+ /** Read as the chart is built: the legend is a part the chart builds or doesn't. */
96
+ readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
97
+ /** Read as the chart is built: whether each column prints the figure it plots. */
98
+ readonly showValues: import("@motionscript/sdk").Type<boolean, boolean, false>;
99
+ /** Whether each series' columns are drawn: on for every frame a show or hide covers, off once a hide lands. */
100
+ readonly showing: import("@motionscript/sdk").Type<boolean[], boolean[], false>;
101
+ }>, {
102
+ readonly enter: {};
103
+ readonly showSeries: {
104
+ readonly seriesIndex: import("@motionscript/sdk").Type<number, number, false>;
105
+ };
106
+ readonly hideSeries: {
107
+ readonly seriesIndex: import("@motionscript/sdk").Type<number, number, false>;
108
+ };
109
+ readonly spotlightSeries: {
110
+ readonly seriesIndex: import("@motionscript/sdk").Type<number, number, false>;
111
+ };
112
+ readonly spotlightCategory: {
113
+ readonly categoryIndex: import("@motionscript/sdk").Type<number, number, false>;
114
+ };
115
+ readonly clearCategory: {};
116
+ }, readonly [], Node2D<Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
117
+ readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
118
+ readonly categoryField: "";
119
+ readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
120
+ readonly stacked: false;
121
+ readonly valueAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
122
+ readonly categoryAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
123
+ readonly theme: import("@motionscript/sdk").Type<BarChartTheme, BarChartConfig, false>;
244
124
  /**
245
- * Move series `index`'s slot share to `target`, with its legend entry.
246
- *
247
- * One method for both directions, so the pair cannot drift apart. `enabled`
248
- * rides in the same value as the weight rather than being set before or after,
249
- * which is what makes arriving at a time backwards show what arriving forwards
250
- * does.
125
+ * Global rise of every column in `[0, 1]`, measured about the baseline: 0
126
+ * collapses them all onto it, 1 draws them at full length.
251
127
  */
252
- private toggleSeries;
128
+ readonly growth: 1;
253
129
  /**
254
- * Fade out every other series — its columns **and its legend entry** — to
255
- * focus attention on `index`, which comes back to full. Nothing moves, so the
256
- * group doesn't reflow.
130
+ * How much of the slot each series claims, one entry per series: a weight
131
+ * rather than a switch, so hiding one is the others widening into the space.
132
+ * Seeded from each series' `enabled`.
257
133
  */
258
- spotlightSeries(args: CommandArgs<{
259
- seriesIndex: number;
260
- }>): Seekable;
261
- /** Ease series `index`'s slot share toward `target`, reflowing the group. */
262
- private tweenWeight;
134
+ readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
135
+ /** The category spotlit, or `null` for none. The choice snaps; `spotlightReveal` is the animation. */
136
+ readonly spotlight: import("@motionscript/sdk").Type<number | null, number | null, false>;
137
+ /** How far the category spotlight is drawn in, `[0, 1]`. */
138
+ readonly spotlightReveal: 0;
139
+ /** Read as the chart is built: the legend is a part the chart builds or doesn't. */
140
+ readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
141
+ /** Read as the chart is built: whether each column prints the figure it plots. */
142
+ readonly showValues: import("@motionscript/sdk").Type<boolean, boolean, false>;
143
+ /** Whether each series' columns are drawn: on for every frame a show or hide covers, off once a hide lands. */
144
+ readonly showing: import("@motionscript/sdk").Type<boolean[], boolean[], false>;
145
+ }>, readonly [], import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
146
+ readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
147
+ readonly categoryField: "";
148
+ readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
149
+ readonly stacked: false;
150
+ readonly valueAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
151
+ readonly categoryAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
152
+ readonly theme: import("@motionscript/sdk").Type<BarChartTheme, BarChartConfig, false>;
263
153
  /**
264
- * Spotlight one **category** — one column of the table rather than one series:
265
- * every other category's bars and its caption fade to the theme's
266
- * `dimOpacity`, and the chosen one stays full.
267
- *
268
- * The counterpart of the line chart's `spotlightRegion`, and the same shape of
269
- * thing: it picks out a slice of the plot without changing what is drawn.
270
- * Calling it while another category is already lit moves the focus directly —
271
- * only the dimming changes, so there is nothing to retract first.
154
+ * Global rise of every column in `[0, 1]`, measured about the baseline: 0
155
+ * collapses them all onto it, 1 draws them at full length.
272
156
  */
273
- spotlightCategory(args: CommandArgs<{
274
- categoryIndex: number;
275
- }>): Command<CategorySpotlight>;
157
+ readonly growth: 1;
276
158
  /**
277
- * Drop the category spotlight, bringing every category back to full. A no-op
278
- * when nothing is lit — but it still takes its slot on the timeline, for the
279
- * reason `LineChart.clearRegion` does.
159
+ * How much of the slot each series claims, one entry per series: a weight
160
+ * rather than a switch, so hiding one is the others widening into the space.
161
+ * Seeded from each series' `enabled`.
280
162
  */
281
- clearCategory(args: CommandArgs<Record<string, never>>): Command<CategorySpotlight>;
282
- /** The no-op both of the above return — see {@link hold}. */
283
- private holdSpotlight;
284
- }
285
- export {};
163
+ readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
164
+ /** The category spotlit, or `null` for none. The choice snaps; `spotlightReveal` is the animation. */
165
+ readonly spotlight: import("@motionscript/sdk").Type<number | null, number | null, false>;
166
+ /** How far the category spotlight is drawn in, `[0, 1]`. */
167
+ readonly spotlightReveal: 0;
168
+ /** Read as the chart is built: the legend is a part the chart builds or doesn't. */
169
+ readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
170
+ /** Read as the chart is built: whether each column prints the figure it plots. */
171
+ readonly showValues: import("@motionscript/sdk").Type<boolean, boolean, false>;
172
+ /** Whether each series' columns are drawn: on for every frame a show or hide covers, off once a hide lands. */
173
+ readonly showing: import("@motionscript/sdk").Type<boolean[], boolean[], false>;
174
+ }>, {
175
+ readonly enter: {};
176
+ readonly showSeries: {
177
+ readonly seriesIndex: import("@motionscript/sdk").Type<number, number, false>;
178
+ };
179
+ readonly hideSeries: {
180
+ readonly seriesIndex: import("@motionscript/sdk").Type<number, number, false>;
181
+ };
182
+ readonly spotlightSeries: {
183
+ readonly seriesIndex: import("@motionscript/sdk").Type<number, number, false>;
184
+ };
185
+ readonly spotlightCategory: {
186
+ readonly categoryIndex: import("@motionscript/sdk").Type<number, number, false>;
187
+ };
188
+ readonly clearCategory: {};
189
+ }, Node2D<Node2DProps>>>>;
190
+ export type BarChart = NodeOf<typeof BarChart>;
286
191
  //# sourceMappingURL=bar-chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EAIN,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,OAAO,EAEZ,KAAK,UAAU,EACf,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAA;AAM3B,OAAO,EAOL,KAAK,gBAAgB,EAEtB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,8BAA8B,CAAA;AAGrC,OAAO,EAUL,KAAK,aAAa,EAClB,K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