@motionscript/charts 0.1.0-alpha.3 → 0.1.0-alpha.6
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.
- package/CHANGELOG.md +63 -0
- package/LICENSE +201 -201
- package/NOTICE +48 -0
- package/README.md +99 -0
- package/dist/bar-chart/bar-chart.d.ts +93 -231
- package/dist/bar-chart/bar-chart.d.ts.map +1 -1
- package/dist/bar-chart/bar-chart.js +378 -565
- package/dist/bar-chart/bar-chart.js.map +1 -1
- package/dist/bar-chart/category-axis.d.ts +24 -41
- package/dist/bar-chart/category-axis.d.ts.map +1 -1
- package/dist/bar-chart/category-axis.js +93 -115
- package/dist/bar-chart/category-axis.js.map +1 -1
- package/dist/bar-chart/chart-bars.d.ts +36 -70
- package/dist/bar-chart/chart-bars.d.ts.map +1 -1
- package/dist/bar-chart/chart-bars.js +156 -210
- package/dist/bar-chart/chart-bars.js.map +1 -1
- package/dist/bar-chart/index.d.ts +2 -2
- package/dist/bar-chart/index.d.ts.map +1 -1
- package/dist/bar-chart/index.js +1 -1
- package/dist/bar-chart/index.js.map +1 -1
- package/dist/bar-chart/shared.d.ts +6 -6
- package/dist/bar-chart/shared.d.ts.map +1 -1
- package/dist/bar-chart/shared.js +6 -6
- package/dist/bar-chart/shared.js.map +1 -1
- package/dist/browser/chunks/chunk-XROBIRQK.js +2 -0
- package/dist/browser/chunks/chunk-XROBIRQK.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +3 -2
- package/dist/engine.d.ts +8 -6
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +8 -6
- package/dist/engine.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kit/cartesian.d.ts +44 -0
- package/dist/kit/cartesian.d.ts.map +1 -0
- package/dist/kit/cartesian.js +59 -0
- package/dist/kit/cartesian.js.map +1 -0
- package/dist/kit/chart-border.d.ts +8 -11
- package/dist/kit/chart-border.d.ts.map +1 -1
- package/dist/kit/chart-border.js +15 -32
- package/dist/kit/chart-border.js.map +1 -1
- package/dist/kit/chart-canvas.d.ts +23 -21
- package/dist/kit/chart-canvas.d.ts.map +1 -1
- package/dist/kit/chart-canvas.js +33 -90
- package/dist/kit/chart-canvas.js.map +1 -1
- package/dist/kit/chart-legend.d.ts +79 -88
- package/dist/kit/chart-legend.d.ts.map +1 -1
- package/dist/kit/chart-legend.js +137 -186
- package/dist/kit/chart-legend.js.map +1 -1
- package/dist/kit/entries.d.ts +17 -0
- package/dist/kit/entries.d.ts.map +1 -0
- package/dist/kit/entries.js +19 -0
- package/dist/kit/entries.js.map +1 -0
- package/dist/kit/motion.d.ts +48 -0
- package/dist/kit/motion.d.ts.map +1 -0
- package/dist/kit/motion.js +63 -0
- package/dist/kit/motion.js.map +1 -0
- package/dist/kit/paints.d.ts +10 -0
- package/dist/kit/paints.d.ts.map +1 -0
- package/dist/kit/paints.js +12 -0
- package/dist/kit/paints.js.map +1 -0
- package/dist/kit/shared.d.ts +59 -8
- package/dist/kit/shared.d.ts.map +1 -1
- package/dist/kit/shared.js +105 -10
- package/dist/kit/shared.js.map +1 -1
- package/dist/kit/vertical-axis.d.ts +36 -61
- package/dist/kit/vertical-axis.d.ts.map +1 -1
- package/dist/kit/vertical-axis.js +97 -132
- package/dist/kit/vertical-axis.js.map +1 -1
- package/dist/line-chart/chart-line.d.ts +27 -53
- package/dist/line-chart/chart-line.d.ts.map +1 -1
- package/dist/line-chart/chart-line.js +89 -120
- package/dist/line-chart/chart-line.js.map +1 -1
- package/dist/line-chart/chart-region.d.ts +14 -14
- package/dist/line-chart/chart-region.d.ts.map +1 -1
- package/dist/line-chart/chart-region.js +26 -64
- package/dist/line-chart/chart-region.js.map +1 -1
- package/dist/line-chart/horizontal-axis.d.ts +32 -56
- package/dist/line-chart/horizontal-axis.d.ts.map +1 -1
- package/dist/line-chart/horizontal-axis.js +85 -123
- package/dist/line-chart/horizontal-axis.js.map +1 -1
- package/dist/line-chart/index.d.ts +2 -2
- package/dist/line-chart/index.d.ts.map +1 -1
- package/dist/line-chart/index.js +1 -1
- package/dist/line-chart/index.js.map +1 -1
- package/dist/line-chart/line-chart.d.ts +111 -311
- package/dist/line-chart/line-chart.d.ts.map +1 -1
- package/dist/line-chart/line-chart.js +403 -639
- package/dist/line-chart/line-chart.js.map +1 -1
- package/dist/line-chart/shared.d.ts +6 -6
- package/dist/line-chart/shared.d.ts.map +1 -1
- package/dist/line-chart/shared.js +22 -7
- package/dist/line-chart/shared.js.map +1 -1
- package/dist/line-chart/x-scale.d.ts +1 -1
- package/dist/line-chart/x-scale.js +1 -1
- package/dist/line-chart/x-scale.js.map +1 -1
- package/dist/nodes.d.ts +6 -9
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +7 -9
- package/dist/nodes.js.map +1 -1
- package/dist/pie-chart/index.d.ts +2 -2
- package/dist/pie-chart/index.d.ts.map +1 -1
- package/dist/pie-chart/index.js +1 -1
- package/dist/pie-chart/index.js.map +1 -1
- package/dist/pie-chart/pie-chart.d.ts +77 -134
- package/dist/pie-chart/pie-chart.d.ts.map +1 -1
- package/dist/pie-chart/pie-chart.js +199 -268
- package/dist/pie-chart/pie-chart.js.map +1 -1
- package/dist/pie-chart/pie-legend.d.ts +54 -31
- package/dist/pie-chart/pie-legend.d.ts.map +1 -1
- package/dist/pie-chart/pie-legend.js +93 -107
- package/dist/pie-chart/pie-legend.js.map +1 -1
- package/dist/pie-chart/pie-ring.d.ts +142 -122
- package/dist/pie-chart/pie-ring.d.ts.map +1 -1
- package/dist/pie-chart/pie-ring.js +333 -361
- package/dist/pie-chart/pie-ring.js.map +1 -1
- package/dist/pie-chart/shared.d.ts +3 -3
- package/dist/pie-chart/shared.js +3 -3
- package/dist/pie-chart/shared.js.map +1 -1
- package/package.json +6 -5
- package/registry.json +23 -23
- package/src/bar-chart/bar-chart.ts +534 -814
- package/src/bar-chart/category-axis.ts +162 -177
- package/src/bar-chart/chart-bars.ts +288 -310
- package/src/bar-chart/index.ts +31 -31
- package/src/bar-chart/shared.ts +354 -354
- package/src/engine.ts +28 -26
- package/src/index.ts +5 -5
- package/src/kit/cartesian.ts +81 -0
- package/src/kit/chart-border.ts +50 -61
- package/src/kit/chart-canvas.ts +122 -157
- package/src/kit/chart-legend.ts +229 -250
- package/src/kit/entries.ts +20 -0
- package/src/kit/motion.ts +90 -0
- package/src/kit/paints.ts +15 -0
- package/src/kit/shared.ts +782 -675
- package/src/kit/vertical-axis.ts +194 -224
- package/src/line-chart/chart-line.ts +181 -208
- package/src/line-chart/chart-region.ts +106 -135
- package/src/line-chart/horizontal-axis.ts +166 -202
- package/src/line-chart/index.ts +39 -39
- package/src/line-chart/line-chart.ts +585 -929
- package/src/line-chart/shared.ts +473 -459
- package/src/line-chart/x-scale.ts +367 -367
- package/src/nodes.ts +18 -20
- package/src/pie-chart/index.ts +37 -37
- package/src/pie-chart/pie-chart.ts +293 -381
- package/src/pie-chart/pie-legend.ts +169 -159
- package/src/pie-chart/pie-ring.ts +848 -903
- package/src/pie-chart/shared.ts +490 -490
- package/dist/browser/chunks/chunk-RMHQ6GYU.js +0 -2
- package/dist/browser/chunks/chunk-RMHQ6GYU.js.map +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type AxisDomainConfig } from "../kit/shared.js";
|
|
3
|
-
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";
|
|
4
4
|
export interface BarChartProps extends Node2DProps {
|
|
5
5
|
/** One row per category — a plain record of field name to value. */
|
|
6
6
|
data: DataRecord[];
|
|
@@ -33,253 +33,115 @@ export interface BarChartProps extends Node2DProps {
|
|
|
33
33
|
/** Whether each column prints the figure it plots. */
|
|
34
34
|
showValues?: boolean;
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* rather than part of what an author states about it. Same reason the line chart
|
|
48
|
-
* types its `RegionState` separately.
|
|
49
|
-
*/
|
|
50
|
-
type CategorySpotlight = {
|
|
51
|
-
spotlight: number | null;
|
|
52
|
-
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[];
|
|
53
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;
|
|
54
50
|
/**
|
|
55
|
-
* A grouped or stacked bar chart,
|
|
56
|
-
*
|
|
57
|
-
* 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:
|
|
58
53
|
*
|
|
59
54
|
* - `ChartCanvas` — the plot panel with a horizontal grid, under everything.
|
|
60
55
|
* - `VerticalAxis` — the numeric value markers, staggering in bottom-to-top.
|
|
61
|
-
* - {@link CategoryAxis} — the row of names beneath the baseline, one per row
|
|
62
|
-
* the data, staggering in left-to-right.
|
|
56
|
+
* - {@link CategoryAxis} — the row of names beneath the baseline, one per row.
|
|
63
57
|
* - {@link ChartBars} (one per series) — that series' column in every category,
|
|
64
58
|
* plus the figures printed on them.
|
|
65
59
|
* - `ChartLegend` — a row of entries below the chart, one per series.
|
|
66
60
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* re-flows if its box changes, and the bars read the same resolved scale the
|
|
72
|
-
* axis does, so a column's end lands exactly on its marker.
|
|
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.
|
|
73
65
|
*
|
|
74
|
-
* **Resting state is the finished chart
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* **Zero is always on the scale** (see `barValueExtent`), and the columns
|
|
80
|
-
* grow about it rather than about the plot floor, so a negative value draws
|
|
81
|
-
* downward out of the same `growth` signal that draws a positive one up.
|
|
82
|
-
*
|
|
83
|
-
* Past the entrance, two things move the chart:
|
|
84
|
-
* {@link showSeries}/{@link hideSeries}/{@link spotlightSeries} pick out a
|
|
85
|
-
* *series* — and hiding one **reflows the group**, the remaining columns
|
|
86
|
-
* widening into the space as it goes, rather than leaving a hole where it was —
|
|
87
|
-
* while {@link spotlightCategory}/{@link clearCategory} pick out a *column of
|
|
88
|
-
* 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.
|
|
89
71
|
*/
|
|
90
|
-
export declare
|
|
91
|
-
data: DataRecord[]
|
|
92
|
-
categoryField:
|
|
93
|
-
series:
|
|
94
|
-
stacked:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
* previous resolved domain and the tween interpolates numerically, so
|
|
99
|
-
* `chart.to({ data: { valueAxis: { range: [0, 10] } }, duration: 1 })` smoothly
|
|
100
|
-
* rescales every column. The axis *label* text is captured once at construction.
|
|
101
|
-
*/
|
|
102
|
-
valueAxis: AxisDomainConfig;
|
|
103
|
-
categoryAxis: AxisDomainConfig;
|
|
104
|
-
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>;
|
|
105
80
|
/**
|
|
106
81
|
* Global rise of every column in `[0, 1]`, measured about the baseline: 0
|
|
107
|
-
* collapses them all onto it, 1 draws them at full length.
|
|
108
|
-
* {@link ChartBars}' own `growth` is bound to this, so tweening this one
|
|
109
|
-
* signal raises the whole chart in proportion.
|
|
82
|
+
* collapses them all onto it, 1 draws them at full length.
|
|
110
83
|
*/
|
|
111
|
-
growth:
|
|
84
|
+
readonly growth: 1;
|
|
112
85
|
/**
|
|
113
|
-
* How much of the slot each series
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* an animation instead of a jump: the grouped columns divide the slot in
|
|
117
|
-
* proportion to these, so tweening one to 0 has the remaining columns widen
|
|
118
|
-
* into the space as it shrinks away, and a stacked segment's contribution to
|
|
119
|
-
* the stack fades out with it. Seeded from each series' `enabled` field.
|
|
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`.
|
|
120
89
|
*/
|
|
121
|
-
weights: number[]
|
|
122
|
-
/**
|
|
123
|
-
|
|
124
|
-
* value rather than a tweened one: the *choice* snaps, and the animation is
|
|
125
|
-
* {@link spotlightReveal} dimming everything else.
|
|
126
|
-
*/
|
|
127
|
-
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>;
|
|
128
93
|
/** How far the category spotlight is drawn in, `[0, 1]`. */
|
|
129
|
-
spotlightReveal:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
/** Map a value onto the plot's **centred** pixel space (origin at its centre, y-up). */
|
|
160
|
-
private valueToY;
|
|
161
|
-
/**
|
|
162
|
-
* Pixel y of the line every column grows from.
|
|
163
|
-
*
|
|
164
|
-
* Zero, clamped onto the scale — so an author who *did* crop the axis to
|
|
165
|
-
* `[40, 100]` gets columns rising from the plot floor rather than from a
|
|
166
|
-
* baseline off the bottom of the panel.
|
|
167
|
-
*/
|
|
168
|
-
private get baselinePx();
|
|
169
|
-
/** Width of one category's slot across the plot. */
|
|
170
|
-
private get slotWidth();
|
|
171
|
-
/** Centre x of category `i`'s slot, in the plot's centred space. */
|
|
172
|
-
private slotCenter;
|
|
173
|
-
/** The part of a slot the columns fill — the rest is the channel between categories. */
|
|
174
|
-
private get slotInner();
|
|
175
|
-
/** Series `i`'s live share of the slot; 0 once it has been hidden. */
|
|
176
|
-
private weightAt;
|
|
177
|
-
/** Total live share across the series — the slot's inner width divides by this. */
|
|
178
|
-
private get totalWeight();
|
|
179
|
-
/** Live share of every series *before* `index`, for the grouped offset. */
|
|
180
|
-
private weightBefore;
|
|
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
|
+
}, null, 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>;
|
|
181
124
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* Both modes come out of one walk over the rows: a grouped series divides the
|
|
185
|
-
* slot with its siblings and every column runs from zero, a stacked one takes
|
|
186
|
-
* the whole slot and each column runs from the running total below it. The
|
|
187
|
-
* live {@link weights} scale the grouped widths and the stacked contributions
|
|
188
|
-
* alike, which is what lets `hideSeries` reflow rather than punch a hole.
|
|
189
|
-
*/
|
|
190
|
-
private seriesBars;
|
|
191
|
-
/**
|
|
192
|
-
* `row` with each series' value scaled by that series' live {@link weights}
|
|
193
|
-
* entry — what the stacked spans are measured from.
|
|
194
|
-
*/
|
|
195
|
-
private weightedRow;
|
|
196
|
-
/**
|
|
197
|
-
* How far each category is dimmed by the spotlight, one entry per row —
|
|
198
|
-
* 1 while nothing is spotlit, falling to the theme's `dimOpacity` for every
|
|
199
|
-
* category but the chosen one as the reveal climbs.
|
|
200
|
-
*/
|
|
201
|
-
private categoryDims;
|
|
202
|
-
constructor(props?: NodeConfig<BarChart, BarChartProps>);
|
|
203
|
-
/**
|
|
204
|
-
* Prime every part at its pre-entrance state — axis markers and captions
|
|
205
|
-
* shifted and transparent, columns collapsed onto the baseline, legend dropped
|
|
206
|
-
* and transparent.
|
|
207
|
-
*
|
|
208
|
-
* Called by {@link enter} before its first frame so nothing flashes ahead of
|
|
209
|
-
* its beat. Idempotent, and public so a scene can hide a chart ahead of time
|
|
210
|
-
* without starting the entrance.
|
|
211
|
-
*/
|
|
212
|
-
arm(): void;
|
|
213
|
-
/**
|
|
214
|
-
* Animate the whole chart in: the two axes stagger their markers and captions
|
|
215
|
-
* in, the columns rise from the baseline, and the legend fades up last.
|
|
216
|
-
*
|
|
217
|
-
* `duration` is the **whole** entrance. The phases are shares of it, not
|
|
218
|
-
* multiples — a command that declares 1.4 seconds has to take 1.4 seconds,
|
|
219
|
-
* because that is the slot the timeline lays out for it, the length its
|
|
220
|
-
* parallel siblings are timed against, and its contribution to the scene's own
|
|
221
|
-
* duration.
|
|
222
|
-
*/
|
|
223
|
-
enter(args: CommandArgs<Record<string, never>> & {
|
|
224
|
-
duration: number;
|
|
225
|
-
}): Command<Record<string, never>>;
|
|
226
|
-
/** Tween {@link growth} `0 → 1`, raising every column about the baseline. */
|
|
227
|
-
private riseBars;
|
|
228
|
-
/**
|
|
229
|
-
* Show series `index`: bring its columns back, the group reflowing to make
|
|
230
|
-
* room as they arrive, in lockstep with its legend entry growing in.
|
|
231
|
-
*/
|
|
232
|
-
showSeries(args: CommandArgs<{
|
|
233
|
-
seriesIndex: number;
|
|
234
|
-
}>): Command<Record<string, never>>;
|
|
235
|
-
/**
|
|
236
|
-
* Hide series `index`: its columns narrow away (or, stacked, sink out of the
|
|
237
|
-
* stack) while the rest of the group widens into the space, its legend entry
|
|
238
|
-
* shrinking beside them — the mirror of {@link showSeries}.
|
|
239
|
-
*/
|
|
240
|
-
hideSeries(args: CommandArgs<{
|
|
241
|
-
seriesIndex: number;
|
|
242
|
-
}>): Command<Record<string, never>>;
|
|
243
|
-
/**
|
|
244
|
-
* Move series `index`'s slot share to `target`, with its legend entry.
|
|
245
|
-
*
|
|
246
|
-
* One method for both directions, so the pair cannot drift apart. `enabled`
|
|
247
|
-
* rides in the same value as the weight rather than being set before or after,
|
|
248
|
-
* which is what makes arriving at a time backwards show what arriving forwards
|
|
249
|
-
* does.
|
|
250
|
-
*/
|
|
251
|
-
private toggleSeries;
|
|
252
|
-
/**
|
|
253
|
-
* Fade out every other series — its columns **and its legend entry** — to
|
|
254
|
-
* focus attention on `index`, which comes back to full. Nothing moves, so the
|
|
255
|
-
* group doesn't reflow.
|
|
256
|
-
*/
|
|
257
|
-
spotlightSeries(args: CommandArgs<{
|
|
258
|
-
seriesIndex: number;
|
|
259
|
-
}>): Command<Record<string, never>>;
|
|
260
|
-
/** Ease series `index`'s slot share toward `target`, reflowing the group. */
|
|
261
|
-
private tweenWeight;
|
|
262
|
-
/**
|
|
263
|
-
* Spotlight one **category** — one column of the table rather than one series:
|
|
264
|
-
* every other category's bars and its caption fade to the theme's
|
|
265
|
-
* `dimOpacity`, and the chosen one stays full.
|
|
266
|
-
*
|
|
267
|
-
* The counterpart of the line chart's `spotlightRegion`, and the same shape of
|
|
268
|
-
* thing: it picks out a slice of the plot without changing what is drawn.
|
|
269
|
-
* Calling it while another category is already lit moves the focus directly —
|
|
270
|
-
* only the dimming changes, so there is nothing to retract first.
|
|
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.
|
|
271
127
|
*/
|
|
272
|
-
|
|
273
|
-
categoryIndex: number;
|
|
274
|
-
}>): Command<CategorySpotlight>;
|
|
128
|
+
readonly growth: 1;
|
|
275
129
|
/**
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
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`.
|
|
279
133
|
*/
|
|
280
|
-
|
|
281
|
-
/** The
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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
|
+
}>, null>>;
|
|
146
|
+
export type BarChart = NodeOf<typeof BarChart>;
|
|
285
147
|
//# 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,
|
|
1
|
+
{"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,UAAU,EAEf,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,WAAW,EAGjB,MAAM,mBAAmB,CAAA;AAU1B,OAAO,EAUL,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACX,MAAM,eAAe,CAAA;AAGtB,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,oEAAoE;IACpE,IAAI,EAAE,UAAU,EAAE,CAAA;IAClB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,gFAAgF;IAChF,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,yEAAyE;IACzE,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,qFAAqF;IACrF,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAA;CACrC;AAED,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAmCnG,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,GAAG,cAAc,CAEhE;AA8ID;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,QAAQ;;;;;;;;IAUjB;;;OAGG;;IAEH;;;;OAIG;;IAEH,sGAAsG;;IAEtG,4DAA4D;;IAE5D,oFAAoF;;IAEpF,kFAAkF;;IAElF,+GAA+G;;;;;;;;;;;;;;;;;;;;;;;;;IAnB/G;;;OAGG;;IAEH;;;;OAIG;;IAEH,sGAAsG;;IAEtG,4DAA4D;;IAE5D,oFAAoF;;IAEpF,kFAAkF;;IAElF,+GAA+G;;UA6MjH,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|