@motionscript/charts 0.1.1-alpha.0 → 0.1.1-alpha.1
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 +19 -0
- package/README.md +98 -28
- package/dist/bar-chart/bar-chart.d.ts +233 -39
- package/dist/bar-chart/bar-chart.d.ts.map +1 -1
- package/dist/bar-chart/bar-chart.js +215 -171
- package/dist/bar-chart/bar-chart.js.map +1 -1
- package/dist/bar-chart/category-axis.d.ts +12 -7
- package/dist/bar-chart/category-axis.d.ts.map +1 -1
- package/dist/bar-chart/category-axis.js +56 -42
- package/dist/bar-chart/category-axis.js.map +1 -1
- package/dist/bar-chart/chart-bars.d.ts +52 -52
- package/dist/bar-chart/chart-bars.d.ts.map +1 -1
- package/dist/bar-chart/chart-bars.js +80 -89
- package/dist/bar-chart/chart-bars.js.map +1 -1
- package/dist/bar-chart/index.d.ts +4 -4
- package/dist/bar-chart/index.d.ts.map +1 -1
- package/dist/bar-chart/index.js +2 -2
- package/dist/bar-chart/index.js.map +1 -1
- package/dist/bar-chart/shared.d.ts +36 -65
- package/dist/bar-chart/shared.d.ts.map +1 -1
- package/dist/bar-chart/shared.js +68 -117
- package/dist/bar-chart/shared.js.map +1 -1
- package/dist/browser/chunks/chunk-R3Q5EE6E.js +2 -0
- package/dist/browser/chunks/chunk-R3Q5EE6E.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/engine.d.ts +5 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +5 -2
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/kit/cartesian.d.ts +49 -15
- package/dist/kit/cartesian.d.ts.map +1 -1
- package/dist/kit/cartesian.js +79 -29
- package/dist/kit/cartesian.js.map +1 -1
- package/dist/kit/chart-canvas.d.ts +32 -24
- package/dist/kit/chart-canvas.d.ts.map +1 -1
- package/dist/kit/chart-canvas.js +52 -46
- package/dist/kit/chart-canvas.js.map +1 -1
- package/dist/kit/chart-legend.d.ts +8 -4
- package/dist/kit/chart-legend.d.ts.map +1 -1
- package/dist/kit/chart-legend.js +30 -20
- package/dist/kit/chart-legend.js.map +1 -1
- package/dist/{line-chart → kit}/horizontal-axis.d.ts +31 -6
- package/dist/kit/horizontal-axis.d.ts.map +1 -0
- package/dist/{line-chart → kit}/horizontal-axis.js +23 -24
- package/dist/kit/horizontal-axis.js.map +1 -0
- package/dist/kit/motion.d.ts +5 -0
- package/dist/kit/motion.d.ts.map +1 -1
- package/dist/kit/motion.js +8 -0
- package/dist/kit/motion.js.map +1 -1
- package/dist/{pie-chart → kit}/pie-legend.d.ts +3 -3
- package/dist/kit/pie-legend.d.ts.map +1 -0
- package/dist/{pie-chart → kit}/pie-legend.js +11 -10
- package/dist/kit/pie-legend.js.map +1 -0
- package/dist/kit/polar.d.ts +31 -0
- package/dist/kit/polar.d.ts.map +1 -0
- package/dist/kit/polar.js +33 -0
- package/dist/kit/polar.js.map +1 -0
- package/dist/kit/shared.d.ts +11 -50
- package/dist/kit/shared.d.ts.map +1 -1
- package/dist/kit/shared.js +58 -141
- package/dist/kit/shared.js.map +1 -1
- package/dist/kit/style.d.ts +254 -0
- package/dist/kit/style.d.ts.map +1 -0
- package/dist/kit/style.js +197 -0
- package/dist/kit/style.js.map +1 -0
- package/dist/kit/vertical-axis.d.ts +22 -2
- package/dist/kit/vertical-axis.d.ts.map +1 -1
- package/dist/kit/vertical-axis.js +56 -43
- package/dist/kit/vertical-axis.js.map +1 -1
- package/dist/line-chart/chart-line.d.ts +95 -3
- package/dist/line-chart/chart-line.d.ts.map +1 -1
- package/dist/line-chart/chart-line.js +165 -53
- package/dist/line-chart/chart-line.js.map +1 -1
- package/dist/line-chart/chart-region.d.ts +1 -1
- package/dist/line-chart/chart-region.d.ts.map +1 -1
- package/dist/line-chart/chart-region.js +7 -8
- package/dist/line-chart/chart-region.js.map +1 -1
- package/dist/line-chart/index.d.ts +5 -6
- package/dist/line-chart/index.d.ts.map +1 -1
- package/dist/line-chart/index.js +3 -4
- package/dist/line-chart/index.js.map +1 -1
- package/dist/line-chart/line-chart.d.ts +257 -18
- package/dist/line-chart/line-chart.d.ts.map +1 -1
- package/dist/line-chart/line-chart.js +282 -134
- package/dist/line-chart/line-chart.js.map +1 -1
- package/dist/line-chart/shared.d.ts +51 -34
- package/dist/line-chart/shared.d.ts.map +1 -1
- package/dist/line-chart/shared.js +175 -83
- package/dist/line-chart/shared.js.map +1 -1
- package/dist/line-chart/x-scale.d.ts +2 -0
- package/dist/line-chart/x-scale.d.ts.map +1 -1
- package/dist/line-chart/x-scale.js +15 -0
- package/dist/line-chart/x-scale.js.map +1 -1
- package/dist/nodes.d.ts +3 -1
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +9 -1
- package/dist/nodes.js.map +1 -1
- package/dist/pie-chart/index.d.ts +2 -3
- package/dist/pie-chart/index.d.ts.map +1 -1
- package/dist/pie-chart/index.js +1 -2
- package/dist/pie-chart/index.js.map +1 -1
- package/dist/pie-chart/pie-chart.d.ts +114 -18
- package/dist/pie-chart/pie-chart.d.ts.map +1 -1
- package/dist/pie-chart/pie-chart.js +37 -24
- package/dist/pie-chart/pie-chart.js.map +1 -1
- package/dist/pie-chart/pie-ring.d.ts +16 -5
- package/dist/pie-chart/pie-ring.d.ts.map +1 -1
- package/dist/pie-chart/pie-ring.js +89 -55
- package/dist/pie-chart/pie-ring.js.map +1 -1
- package/dist/pie-chart/shared.d.ts +53 -61
- package/dist/pie-chart/shared.d.ts.map +1 -1
- package/dist/pie-chart/shared.js +41 -121
- package/dist/pie-chart/shared.js.map +1 -1
- package/dist/radar-chart/index.d.ts +5 -0
- package/dist/radar-chart/index.d.ts.map +1 -0
- package/dist/radar-chart/index.js +5 -0
- package/dist/radar-chart/index.js.map +1 -0
- package/dist/radar-chart/radar-chart.d.ts +218 -0
- package/dist/radar-chart/radar-chart.d.ts.map +1 -0
- package/dist/radar-chart/radar-chart.js +224 -0
- package/dist/radar-chart/radar-chart.js.map +1 -0
- package/dist/radar-chart/radar-grid.d.ts +43 -0
- package/dist/radar-chart/radar-grid.d.ts.map +1 -0
- package/dist/radar-chart/radar-grid.js +61 -0
- package/dist/radar-chart/radar-grid.js.map +1 -0
- package/dist/radar-chart/radar-series.d.ts +59 -0
- package/dist/radar-chart/radar-series.d.ts.map +1 -0
- package/dist/radar-chart/radar-series.js +71 -0
- package/dist/radar-chart/radar-series.js.map +1 -0
- package/dist/radar-chart/shared.d.ts +73 -0
- package/dist/radar-chart/shared.d.ts.map +1 -0
- package/dist/radar-chart/shared.js +123 -0
- package/dist/radar-chart/shared.js.map +1 -0
- package/dist/radial-chart/index.d.ts +6 -0
- package/dist/radial-chart/index.d.ts.map +1 -0
- package/dist/radial-chart/index.js +4 -0
- package/dist/radial-chart/index.js.map +1 -0
- package/dist/radial-chart/radial-chart.d.ts +216 -0
- package/dist/radial-chart/radial-chart.d.ts.map +1 -0
- package/dist/radial-chart/radial-chart.js +174 -0
- package/dist/radial-chart/radial-chart.js.map +1 -0
- package/dist/radial-chart/radial-rings.d.ts +121 -0
- package/dist/radial-chart/radial-rings.d.ts.map +1 -0
- package/dist/radial-chart/radial-rings.js +273 -0
- package/dist/radial-chart/radial-rings.js.map +1 -0
- package/dist/radial-chart/shared.d.ts +73 -0
- package/dist/radial-chart/shared.d.ts.map +1 -0
- package/dist/radial-chart/shared.js +79 -0
- package/dist/radial-chart/shared.js.map +1 -0
- package/package.json +4 -4
- package/registry.json +21 -6
- package/src/bar-chart/bar-chart.ts +252 -179
- package/src/bar-chart/category-axis.ts +46 -40
- package/src/bar-chart/chart-bars.ts +97 -117
- package/src/bar-chart/index.ts +7 -10
- package/src/bar-chart/shared.ts +78 -238
- package/src/engine.ts +5 -2
- package/src/index.ts +2 -0
- package/src/kit/cartesian.ts +118 -40
- package/src/kit/chart-canvas.ts +49 -54
- package/src/kit/chart-legend.ts +28 -20
- package/src/kit/horizontal-axis.ts +114 -0
- package/src/kit/motion.ts +7 -0
- package/src/{pie-chart → kit}/pie-legend.ts +12 -11
- package/src/kit/polar.ts +54 -0
- package/src/kit/shared.ts +55 -277
- package/src/kit/style.ts +257 -0
- package/src/kit/vertical-axis.ts +67 -48
- package/src/line-chart/chart-line.ts +176 -54
- package/src/line-chart/chart-region.ts +6 -10
- package/src/line-chart/index.ts +14 -10
- package/src/line-chart/line-chart.ts +347 -151
- package/src/line-chart/shared.ts +193 -174
- package/src/line-chart/x-scale.ts +13 -0
- package/src/nodes.ts +9 -1
- package/src/pie-chart/index.ts +2 -23
- package/src/pie-chart/pie-chart.ts +52 -35
- package/src/pie-chart/pie-ring.ts +92 -71
- package/src/pie-chart/shared.ts +68 -266
- package/src/radar-chart/index.ts +4 -0
- package/src/radar-chart/radar-chart.ts +287 -0
- package/src/radar-chart/radar-grid.ts +78 -0
- package/src/radar-chart/radar-series.ts +88 -0
- package/src/radar-chart/shared.ts +146 -0
- package/src/radial-chart/index.ts +5 -0
- package/src/radial-chart/radial-chart.ts +210 -0
- package/src/radial-chart/radial-rings.ts +328 -0
- package/src/radial-chart/shared.ts +114 -0
- package/dist/browser/chunks/chunk-4SMRCU24.js +0 -2
- package/dist/browser/chunks/chunk-4SMRCU24.js.map +0 -7
- package/dist/kit/chart-border.d.ts +0 -18
- package/dist/kit/chart-border.d.ts.map +0 -1
- package/dist/kit/chart-border.js +0 -23
- package/dist/kit/chart-border.js.map +0 -1
- package/dist/line-chart/horizontal-axis.d.ts.map +0 -1
- package/dist/line-chart/horizontal-axis.js.map +0 -1
- package/dist/pie-chart/pie-legend.d.ts.map +0 -1
- package/dist/pie-chart/pie-legend.js.map +0 -1
- package/src/kit/chart-border.ts +0 -36
- package/src/line-chart/horizontal-axis.ts +0 -122
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { type DataRecord, type NodeOf, type Node2D, type Node2DProps as _Node2DProps, type Fill as _Fill, type FillResolved as _FillResolved } from "@motionscript/sdk";
|
|
2
|
+
import { type RadialStyle } from "./shared.js";
|
|
3
|
+
export interface RadialChartValues {
|
|
4
|
+
readonly data: DataRecord[];
|
|
5
|
+
readonly categoryField: string;
|
|
6
|
+
readonly valueField: string;
|
|
7
|
+
readonly max: number;
|
|
8
|
+
readonly style: RadialStyle;
|
|
9
|
+
readonly pops: number[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A radial bar chart: one concentric ring per row, the first row outermost,
|
|
13
|
+
* each an arc from `startAngle` sweeping `value / max` of `sweep` degrees.
|
|
14
|
+
* Rows are the marks and none can be hidden; `selectRing` thickens a ring and
|
|
15
|
+
* dims the rest.
|
|
16
|
+
*/
|
|
17
|
+
export declare const RadialChart: import("@motionscript/sdk").Component<"radialChart", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
18
|
+
readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
|
|
19
|
+
/** Ring caption, used on the ring labels and the legend. */
|
|
20
|
+
readonly categoryField: "";
|
|
21
|
+
/** Ring magnitude: the arc's share of the full sweep. */
|
|
22
|
+
readonly valueField: "";
|
|
23
|
+
/** The value a full sweep stands for. 0 lets the largest value fill its ring. */
|
|
24
|
+
readonly max: import("@motionscript/sdk").Type<number, number, false>;
|
|
25
|
+
readonly style: import("@motionscript/sdk").Type<import("@motionscript/sdk").StyleInput<{
|
|
26
|
+
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
27
|
+
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
28
|
+
} & {
|
|
29
|
+
fontFamily: import("@motionscript/sdk").Type<string, string, false>;
|
|
30
|
+
fontSize: import("@motionscript/sdk").Type<number, number, false>;
|
|
31
|
+
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
32
|
+
} & {
|
|
33
|
+
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
34
|
+
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
35
|
+
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
36
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
37
|
+
} & {
|
|
38
|
+
innerRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
39
|
+
ringGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
40
|
+
sweep: import("@motionscript/sdk").Type<number, number, false>;
|
|
41
|
+
startAngle: import("@motionscript/sdk").Type<number, number, false>;
|
|
42
|
+
track: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
43
|
+
roundCaps: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
44
|
+
} & {
|
|
45
|
+
ringLabels: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
46
|
+
}>, import("@motionscript/sdk").StyleValues<{
|
|
47
|
+
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
48
|
+
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
49
|
+
} & {
|
|
50
|
+
fontFamily: import("@motionscript/sdk").Type<string, string, false>;
|
|
51
|
+
fontSize: import("@motionscript/sdk").Type<number, number, false>;
|
|
52
|
+
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
53
|
+
} & {
|
|
54
|
+
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
55
|
+
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
56
|
+
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
57
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
58
|
+
} & {
|
|
59
|
+
innerRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
60
|
+
ringGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
61
|
+
sweep: import("@motionscript/sdk").Type<number, number, false>;
|
|
62
|
+
startAngle: import("@motionscript/sdk").Type<number, number, false>;
|
|
63
|
+
track: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
64
|
+
roundCaps: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
65
|
+
} & {
|
|
66
|
+
ringLabels: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
67
|
+
}>, false>;
|
|
68
|
+
/** Gap between the rings and the legend, in px. */
|
|
69
|
+
readonly gap: 40;
|
|
70
|
+
/** Text set in the centre hole. */
|
|
71
|
+
readonly centerLabel: "";
|
|
72
|
+
/** Smaller second line under `centerLabel`. */
|
|
73
|
+
readonly centerCaption: "";
|
|
74
|
+
/** How far each ring is emphasised, `0`-`1` per index. Here because the rings and the legend both read it. */
|
|
75
|
+
readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
76
|
+
/** Read as the chart is built: whether the centre summary is drawn at rest. A scene that wants it to land later sets `false` and runs `revealCenter`. */
|
|
77
|
+
readonly showCenter: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
78
|
+
}>, {
|
|
79
|
+
readonly enter: {};
|
|
80
|
+
readonly revealCenter: {};
|
|
81
|
+
readonly selectRing: {
|
|
82
|
+
readonly ringIndex: import("@motionscript/sdk").Type<number, number, false>;
|
|
83
|
+
};
|
|
84
|
+
readonly clearSelection: {};
|
|
85
|
+
}, readonly [], Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
86
|
+
readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
|
|
87
|
+
/** Ring caption, used on the ring labels and the legend. */
|
|
88
|
+
readonly categoryField: "";
|
|
89
|
+
/** Ring magnitude: the arc's share of the full sweep. */
|
|
90
|
+
readonly valueField: "";
|
|
91
|
+
/** The value a full sweep stands for. 0 lets the largest value fill its ring. */
|
|
92
|
+
readonly max: import("@motionscript/sdk").Type<number, number, false>;
|
|
93
|
+
readonly style: import("@motionscript/sdk").Type<import("@motionscript/sdk").StyleInput<{
|
|
94
|
+
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
95
|
+
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
96
|
+
} & {
|
|
97
|
+
fontFamily: import("@motionscript/sdk").Type<string, string, false>;
|
|
98
|
+
fontSize: import("@motionscript/sdk").Type<number, number, false>;
|
|
99
|
+
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
100
|
+
} & {
|
|
101
|
+
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
102
|
+
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
103
|
+
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
104
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
105
|
+
} & {
|
|
106
|
+
innerRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
107
|
+
ringGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
108
|
+
sweep: import("@motionscript/sdk").Type<number, number, false>;
|
|
109
|
+
startAngle: import("@motionscript/sdk").Type<number, number, false>;
|
|
110
|
+
track: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
111
|
+
roundCaps: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
112
|
+
} & {
|
|
113
|
+
ringLabels: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
114
|
+
}>, import("@motionscript/sdk").StyleValues<{
|
|
115
|
+
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
116
|
+
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
117
|
+
} & {
|
|
118
|
+
fontFamily: import("@motionscript/sdk").Type<string, string, false>;
|
|
119
|
+
fontSize: import("@motionscript/sdk").Type<number, number, false>;
|
|
120
|
+
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
121
|
+
} & {
|
|
122
|
+
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
123
|
+
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
124
|
+
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
125
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
126
|
+
} & {
|
|
127
|
+
innerRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
128
|
+
ringGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
129
|
+
sweep: import("@motionscript/sdk").Type<number, number, false>;
|
|
130
|
+
startAngle: import("@motionscript/sdk").Type<number, number, false>;
|
|
131
|
+
track: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
132
|
+
roundCaps: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
133
|
+
} & {
|
|
134
|
+
ringLabels: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
135
|
+
}>, false>;
|
|
136
|
+
/** Gap between the rings and the legend, in px. */
|
|
137
|
+
readonly gap: 40;
|
|
138
|
+
/** Text set in the centre hole. */
|
|
139
|
+
readonly centerLabel: "";
|
|
140
|
+
/** Smaller second line under `centerLabel`. */
|
|
141
|
+
readonly centerCaption: "";
|
|
142
|
+
/** How far each ring is emphasised, `0`-`1` per index. Here because the rings and the legend both read it. */
|
|
143
|
+
readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
144
|
+
/** Read as the chart is built: whether the centre summary is drawn at rest. A scene that wants it to land later sets `false` and runs `revealCenter`. */
|
|
145
|
+
readonly showCenter: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
146
|
+
}>, readonly [], import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
147
|
+
readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
|
|
148
|
+
/** Ring caption, used on the ring labels and the legend. */
|
|
149
|
+
readonly categoryField: "";
|
|
150
|
+
/** Ring magnitude: the arc's share of the full sweep. */
|
|
151
|
+
readonly valueField: "";
|
|
152
|
+
/** The value a full sweep stands for. 0 lets the largest value fill its ring. */
|
|
153
|
+
readonly max: import("@motionscript/sdk").Type<number, number, false>;
|
|
154
|
+
readonly style: import("@motionscript/sdk").Type<import("@motionscript/sdk").StyleInput<{
|
|
155
|
+
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
156
|
+
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
157
|
+
} & {
|
|
158
|
+
fontFamily: import("@motionscript/sdk").Type<string, string, false>;
|
|
159
|
+
fontSize: import("@motionscript/sdk").Type<number, number, false>;
|
|
160
|
+
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
161
|
+
} & {
|
|
162
|
+
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
163
|
+
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
164
|
+
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
165
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
166
|
+
} & {
|
|
167
|
+
innerRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
168
|
+
ringGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
169
|
+
sweep: import("@motionscript/sdk").Type<number, number, false>;
|
|
170
|
+
startAngle: import("@motionscript/sdk").Type<number, number, false>;
|
|
171
|
+
track: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
172
|
+
roundCaps: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
173
|
+
} & {
|
|
174
|
+
ringLabels: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
175
|
+
}>, import("@motionscript/sdk").StyleValues<{
|
|
176
|
+
legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
|
|
177
|
+
swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
|
|
178
|
+
} & {
|
|
179
|
+
fontFamily: import("@motionscript/sdk").Type<string, string, false>;
|
|
180
|
+
fontSize: import("@motionscript/sdk").Type<number, number, false>;
|
|
181
|
+
fontWeight: import("@motionscript/sdk").Type<number, number, false>;
|
|
182
|
+
} & {
|
|
183
|
+
palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
|
|
184
|
+
foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
185
|
+
muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
186
|
+
background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
187
|
+
} & {
|
|
188
|
+
innerRadius: import("@motionscript/sdk").Type<number, number, false>;
|
|
189
|
+
ringGap: import("@motionscript/sdk").Type<number, number, false>;
|
|
190
|
+
sweep: import("@motionscript/sdk").Type<number, number, false>;
|
|
191
|
+
startAngle: import("@motionscript/sdk").Type<number, number, false>;
|
|
192
|
+
track: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
193
|
+
roundCaps: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
194
|
+
} & {
|
|
195
|
+
ringLabels: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
196
|
+
}>, false>;
|
|
197
|
+
/** Gap between the rings and the legend, in px. */
|
|
198
|
+
readonly gap: 40;
|
|
199
|
+
/** Text set in the centre hole. */
|
|
200
|
+
readonly centerLabel: "";
|
|
201
|
+
/** Smaller second line under `centerLabel`. */
|
|
202
|
+
readonly centerCaption: "";
|
|
203
|
+
/** How far each ring is emphasised, `0`-`1` per index. Here because the rings and the legend both read it. */
|
|
204
|
+
readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
205
|
+
/** Read as the chart is built: whether the centre summary is drawn at rest. A scene that wants it to land later sets `false` and runs `revealCenter`. */
|
|
206
|
+
readonly showCenter: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
207
|
+
}>, {
|
|
208
|
+
readonly enter: {};
|
|
209
|
+
readonly revealCenter: {};
|
|
210
|
+
readonly selectRing: {
|
|
211
|
+
readonly ringIndex: import("@motionscript/sdk").Type<number, number, false>;
|
|
212
|
+
};
|
|
213
|
+
readonly clearSelection: {};
|
|
214
|
+
}, Node2D<_Node2DProps>>>>;
|
|
215
|
+
export type RadialChart = NodeOf<typeof RadialChart>;
|
|
216
|
+
//# sourceMappingURL=radial-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radial-chart.d.ts","sourceRoot":"","sources":["../../src/radial-chart/radial-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EACf,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,IAAI,IAAI,KAAK,EAClB,KAAK,YAAY,IAAI,aAAa,EACnC,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EAQL,KAAK,WAAW,EACjB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,CAAA;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CACxB;AAwCD;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;IAIpB,4DAA4D;;IAE5D,yDAAyD;;IAEzD,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGjF,mDAAmD;;IAEnD,mCAAmC;;IAEnC,+CAA+C;;IAE/C,8GAA8G;;IAE9G,yJAAyJ;;;;;;;;;;;IAfzJ,4DAA4D;;IAE5D,yDAAyD;;IAEzD,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGjF,mDAAmD;;IAEnD,mCAAmC;;IAEnC,+CAA+C;;IAE/C,8GAA8G;;IAE9G,yJAAyJ;;;;IAfzJ,4DAA4D;;IAE5D,yDAAyD;;IAEzD,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGjF,mDAAmD;;IAEnD,mCAAmC;;IAEnC,+CAA+C;;IAE/C,8GAA8G;;IAE9G,yJAAyJ;;;;;;;;;0BAsG3J,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Rect, Types, clamp, component2d, easeOut, } from "@motionscript/sdk";
|
|
2
|
+
import { SERIES_ARG, asParts, fresh } from "../kit/entries.js";
|
|
3
|
+
import { beats } from "../kit/motion.js";
|
|
4
|
+
import { CHART_STYLE_FAMILY, CHART_STYLE_PRESETS } from "../kit/style.js";
|
|
5
|
+
import { PieLegend } from "../kit/pie-legend.js";
|
|
6
|
+
import { PIE_SPOTLIGHT_DIM, selectionFade } from "../kit/polar.js";
|
|
7
|
+
import { RadialRings } from "./radial-rings.js";
|
|
8
|
+
import { RADIAL_STYLE_GROUPS, centerOf, legendOf, marksOf, resolveRadialRows, ringLabelOf, } from "./shared.js";
|
|
9
|
+
/** How `enter` divides its duration: rings sweeping in, then captions and legend together. Sums to 1. */
|
|
10
|
+
const SWEEP_SHARE = 0.7;
|
|
11
|
+
const LABEL_SHARE = 0.3;
|
|
12
|
+
function rowsOf(s) {
|
|
13
|
+
return resolveRadialRows(s.data, s.categoryField, s.valueField, s.style);
|
|
14
|
+
}
|
|
15
|
+
function popAt(s, index) {
|
|
16
|
+
return clamp(s.pops[index] ?? 0, 0, 1);
|
|
17
|
+
}
|
|
18
|
+
/** Per-row opacity for the legend: 1 while nothing is selected and for the selected ring, falling toward the dim for the rest. */
|
|
19
|
+
function ringDims(s) {
|
|
20
|
+
let focus = 0;
|
|
21
|
+
for (let i = 0; i < s.data.length; i++)
|
|
22
|
+
focus = Math.max(focus, popAt(s, i));
|
|
23
|
+
return s.data.map((_, i) => selectionFade(focus, RING_DIM, popAt(s, i)));
|
|
24
|
+
}
|
|
25
|
+
const RING_DIM = Math.max(PIE_SPOTLIGHT_DIM, 0.25);
|
|
26
|
+
function popping(timeline, s, pop) {
|
|
27
|
+
const from = s.data.map((_, i) => popAt(s, i));
|
|
28
|
+
const targets = s.data.map((_, i) => clamp(pop(i), 0, 1));
|
|
29
|
+
if (from.every((value, i) => value === targets[i]))
|
|
30
|
+
return timeline.wait(timeline.duration);
|
|
31
|
+
return timeline.animate((t) => ({ pops: from.map((value, i) => value + (targets[i] - value) * t) }));
|
|
32
|
+
}
|
|
33
|
+
/** The rings and legend among the children; the last row is the one the chart built. */
|
|
34
|
+
function partsOf(children) {
|
|
35
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
36
|
+
const row = children[i];
|
|
37
|
+
const rings = Rect.is(row) ? row.children.find(RadialRings.is) : undefined;
|
|
38
|
+
if (rings)
|
|
39
|
+
return { rings, legend: row.children.find(PieLegend.is) ?? null };
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A radial bar chart: one concentric ring per row, the first row outermost,
|
|
45
|
+
* each an arc from `startAngle` sweeping `value / max` of `sweep` degrees.
|
|
46
|
+
* Rows are the marks and none can be hidden; `selectRing` thickens a ring and
|
|
47
|
+
* dims the rest.
|
|
48
|
+
*/
|
|
49
|
+
export const RadialChart = component2d({
|
|
50
|
+
key: "radialChart",
|
|
51
|
+
state: {
|
|
52
|
+
data: fresh(() => [], { kind: "dataset" }),
|
|
53
|
+
/** Ring caption, used on the ring labels and the legend. */
|
|
54
|
+
categoryField: "",
|
|
55
|
+
/** Ring magnitude: the arc's share of the full sweep. */
|
|
56
|
+
valueField: "",
|
|
57
|
+
/** The value a full sweep stands for. 0 lets the largest value fill its ring. */
|
|
58
|
+
max: Types.number(0, { min: 0, step: 1 }),
|
|
59
|
+
style: Types.style(CHART_STYLE_FAMILY, RADIAL_STYLE_GROUPS, { presets: CHART_STYLE_PRESETS }),
|
|
60
|
+
/** Gap between the rings and the legend, in px. */
|
|
61
|
+
gap: 40,
|
|
62
|
+
/** Text set in the centre hole. */
|
|
63
|
+
centerLabel: "",
|
|
64
|
+
/** Smaller second line under `centerLabel`. */
|
|
65
|
+
centerCaption: "",
|
|
66
|
+
/** How far each ring is emphasised, `0`-`1` per index. Here because the rings and the legend both read it. */
|
|
67
|
+
pops: fresh(() => []),
|
|
68
|
+
/** Read as the chart is built: whether the centre summary is drawn at rest. A scene that wants it to land later sets `false` and runs `revealCenter`. */
|
|
69
|
+
showCenter: Types.boolean(true, { animatable: false }),
|
|
70
|
+
},
|
|
71
|
+
defaults: {
|
|
72
|
+
width: "fill",
|
|
73
|
+
height: "fill",
|
|
74
|
+
pops: (state) => state.data.map(() => 0),
|
|
75
|
+
},
|
|
76
|
+
allowedChildren: [],
|
|
77
|
+
children: (state) => {
|
|
78
|
+
const style = () => state.style;
|
|
79
|
+
const rows = () => rowsOf(state);
|
|
80
|
+
const parts = [
|
|
81
|
+
new RadialRings({
|
|
82
|
+
width: "fill",
|
|
83
|
+
height: "fill",
|
|
84
|
+
rows,
|
|
85
|
+
max: () => state.max,
|
|
86
|
+
marks: () => marksOf(style()),
|
|
87
|
+
label: () => ringLabelOf(style()),
|
|
88
|
+
centerStyle: () => centerOf(style()),
|
|
89
|
+
trackFill: () => style().track,
|
|
90
|
+
ringLabels: () => style().ringLabels,
|
|
91
|
+
pops: () => state.pops,
|
|
92
|
+
dimOpacity: RING_DIM,
|
|
93
|
+
centerLabel: state.centerLabel,
|
|
94
|
+
centerCaption: state.centerCaption,
|
|
95
|
+
centerReveal: state.showCenter === false ? 0 : 1,
|
|
96
|
+
}),
|
|
97
|
+
];
|
|
98
|
+
const position = state.style.legend;
|
|
99
|
+
if (position !== "none") {
|
|
100
|
+
const side = position === "right";
|
|
101
|
+
const config = legendOf(state.style);
|
|
102
|
+
const legend = new PieLegend({
|
|
103
|
+
slices: rows,
|
|
104
|
+
legend: () => legendOf(style()),
|
|
105
|
+
dims: () => ringDims(state),
|
|
106
|
+
flow: side ? "vertical" : "horizontal",
|
|
107
|
+
align: "center",
|
|
108
|
+
gap: side ? config.itemGap / 3 : config.itemGap,
|
|
109
|
+
padding: 0,
|
|
110
|
+
});
|
|
111
|
+
if (position === "top")
|
|
112
|
+
parts.unshift(legend);
|
|
113
|
+
else
|
|
114
|
+
parts.push(legend);
|
|
115
|
+
}
|
|
116
|
+
const row = new Rect({
|
|
117
|
+
flow: position === "right" || position === "none" ? "horizontal" : "vertical",
|
|
118
|
+
width: "fill",
|
|
119
|
+
height: "fill",
|
|
120
|
+
gap: state.gap,
|
|
121
|
+
padding: 24,
|
|
122
|
+
align: "center",
|
|
123
|
+
fill: () => state.style.background,
|
|
124
|
+
children: parts,
|
|
125
|
+
});
|
|
126
|
+
return asParts([row]);
|
|
127
|
+
},
|
|
128
|
+
commands: {
|
|
129
|
+
/** Rings sweep in from `startAngle`, outer ring first, then captions fade up and the legend staggers in. `duration` is the whole entrance; the centre summary keeps its own signal. */
|
|
130
|
+
enter: {
|
|
131
|
+
args: {},
|
|
132
|
+
entrance: true,
|
|
133
|
+
easing: easeOut(),
|
|
134
|
+
run: (timeline, _state, children) => {
|
|
135
|
+
const parts = partsOf(children);
|
|
136
|
+
if (!parts)
|
|
137
|
+
return timeline.wait(timeline.duration);
|
|
138
|
+
const { rings, legend } = parts;
|
|
139
|
+
const sweep = timeline.duration * SWEEP_SHARE;
|
|
140
|
+
const labels = timeline.duration * LABEL_SHARE;
|
|
141
|
+
const at0 = (piece) => ({ at: 0, duration: 0, piece });
|
|
142
|
+
return beats(timeline, [
|
|
143
|
+
at0(rings.to({ growth: 0, labelReveal: 0 })),
|
|
144
|
+
...(legend ? [at0(legend.run("arm"))] : []),
|
|
145
|
+
{ at: 0, duration: sweep, piece: rings.run("sweep") },
|
|
146
|
+
{ at: sweep, duration: labels, piece: rings.run("revealLabels") },
|
|
147
|
+
...(legend ? [{ at: sweep, duration: labels, piece: legend.run("enter") }] : []),
|
|
148
|
+
]);
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
/** Fade the centre summary up. Not part of `enter`: it is usually the conclusion, which a scene lands on its own beat. */
|
|
152
|
+
revealCenter: {
|
|
153
|
+
args: {},
|
|
154
|
+
easing: easeOut(),
|
|
155
|
+
run: (timeline, _state, children) => partsOf(children)?.rings.run("revealCenter") ?? timeline.wait(timeline.duration),
|
|
156
|
+
},
|
|
157
|
+
/** Thicken ring `ringIndex` and dim the rest, leaving any other selected ring where it is. */
|
|
158
|
+
selectRing: {
|
|
159
|
+
args: { ringIndex: SERIES_ARG },
|
|
160
|
+
easing: easeOut(),
|
|
161
|
+
run: (timeline, state) => {
|
|
162
|
+
const index = timeline.args.ringIndex;
|
|
163
|
+
return popping(timeline, state, (i) => (i === index ? 1 : popAt(state, i)));
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
/** Settle every ring and bring the whole chart back to full. */
|
|
167
|
+
clearSelection: {
|
|
168
|
+
args: {},
|
|
169
|
+
easing: easeOut(),
|
|
170
|
+
run: (timeline, state) => popping(timeline, state, () => 0),
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
//# sourceMappingURL=radial-chart.js.map
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,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SAC5D;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 // 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 Fill as _Fill,\n type FillResolved as _FillResolved,\n} from \"@motionscript/sdk\"\n\nimport { SERIES_ARG, asParts, fresh } from \"../kit/entries\"\nimport { beats, type AnyTimeline, type Beat } from \"../kit/motion\"\nimport { CHART_STYLE_FAMILY, CHART_STYLE_PRESETS } from \"../kit/style\"\nimport { PieLegend } from \"../kit/pie-legend\"\nimport { PIE_SPOTLIGHT_DIM, selectionFade } from \"../kit/polar\"\nimport { RadialRings } from \"./radial-rings\"\nimport {\n RADIAL_STYLE_GROUPS,\n centerOf,\n legendOf,\n marksOf,\n resolveRadialRows,\n ringLabelOf,\n type RadialRow,\n type RadialStyle,\n} from \"./shared\"\n\nexport interface RadialChartValues {\n readonly data: DataRecord[]\n readonly categoryField: string\n readonly valueField: string\n readonly max: number\n readonly style: RadialStyle\n readonly pops: number[]\n}\n\n/** How `enter` divides its duration: rings sweeping in, then captions and legend together. Sums to 1. */\nconst SWEEP_SHARE = 0.7\nconst LABEL_SHARE = 0.3\n\nfunction rowsOf(s: RadialChartValues): RadialRow[] {\n return resolveRadialRows(s.data, s.categoryField, s.valueField, s.style)\n}\n\nfunction popAt(s: RadialChartValues, index: number): number {\n return clamp(s.pops[index] ?? 0, 0, 1)\n}\n\n/** Per-row opacity for the legend: 1 while nothing is selected and for the selected ring, falling toward the dim for the rest. */\nfunction ringDims(s: RadialChartValues): number[] {\n let focus = 0\n for (let i = 0; i < s.data.length; i++) focus = Math.max(focus, popAt(s, i))\n return s.data.map((_, i) => selectionFade(focus, RING_DIM, popAt(s, i)))\n}\n\nconst RING_DIM = Math.max(PIE_SPOTLIGHT_DIM, 0.25)\n\nfunction popping(timeline: AnyTimeline, s: RadialChartValues, pop: (index: number) => number) {\n const from = s.data.map((_, i) => popAt(s, i))\n const targets = s.data.map((_, i) => clamp(pop(i), 0, 1))\n if (from.every((value, i) => value === targets[i])) return timeline.wait(timeline.duration)\n return timeline.animate((t) => ({ pops: from.map((value, i) => value + (targets[i] - value) * t) }))\n}\n\n/** The rings and legend among the children; the last row is the one the chart built. */\nfunction partsOf(children: readonly ChildView[]) {\n for (let i = children.length - 1; i >= 0; i--) {\n const row = children[i]\n const rings = Rect.is(row) ? row.children.find(RadialRings.is) : undefined\n if (rings) return { rings, legend: row.children.find(PieLegend.is) ?? null }\n }\n return null\n}\n\n/**\n * A radial bar chart: one concentric ring per row, the first row outermost,\n * each an arc from `startAngle` sweeping `value / max` of `sweep` degrees.\n * Rows are the marks and none can be hidden; `selectRing` thickens a ring and\n * dims the rest.\n */\nexport const RadialChart = component2d({\n key: \"radialChart\",\n state: {\n data: fresh<DataRecord[]>(() => [], { kind: \"dataset\" }),\n /** Ring caption, used on the ring labels and the legend. */\n categoryField: \"\",\n /** Ring magnitude: the arc's share of the full sweep. */\n valueField: \"\",\n /** The value a full sweep stands for. 0 lets the largest value fill its ring. */\n max: Types.number(0, { min: 0, step: 1 }),\n style: Types.style(CHART_STYLE_FAMILY, RADIAL_STYLE_GROUPS, { presets: CHART_STYLE_PRESETS }),\n /** Gap between the rings and the legend, in px. */\n gap: 40,\n /** Text set in the centre hole. */\n centerLabel: \"\",\n /** Smaller second line under `centerLabel`. */\n centerCaption: \"\",\n /** How far each ring is emphasised, `0`-`1` per index. Here because the rings and the legend both read it. */\n pops: fresh<number[]>(() => []),\n /** Read as the chart is built: whether the centre summary is drawn at rest. A scene that wants it to land later sets `false` and runs `revealCenter`. */\n showCenter: Types.boolean(true, { animatable: false }),\n },\n defaults: {\n width: \"fill\",\n height: \"fill\",\n pops: (state) => state.data.map(() => 0),\n },\n allowedChildren: [],\n children: (state) => {\n const style = () => state.style\n const rows = () => rowsOf(state)\n const parts: Node2D[] = [\n new RadialRings({\n width: \"fill\",\n height: \"fill\",\n rows,\n max: () => state.max,\n marks: () => marksOf(style()),\n label: () => ringLabelOf(style()),\n centerStyle: () => centerOf(style()),\n trackFill: () => style().track,\n ringLabels: () => style().ringLabels,\n pops: () => state.pops,\n dimOpacity: RING_DIM,\n centerLabel: state.centerLabel,\n centerCaption: state.centerCaption,\n centerReveal: state.showCenter === false ? 0 : 1,\n }) as unknown as Node2D,\n ]\n const position = state.style.legend\n if (position !== \"none\") {\n const side = position === \"right\"\n const config = legendOf(state.style)\n const legend = new PieLegend({\n slices: rows,\n legend: () => legendOf(style()),\n dims: () => ringDims(state),\n flow: side ? \"vertical\" : \"horizontal\",\n align: \"center\",\n gap: side ? config.itemGap / 3 : config.itemGap,\n padding: 0,\n }) as unknown as Node2D\n if (position === \"top\") parts.unshift(legend)\n else parts.push(legend)\n }\n const row = new Rect({\n flow: position === \"right\" || position === \"none\" ? \"horizontal\" : \"vertical\",\n width: \"fill\",\n height: \"fill\",\n gap: state.gap,\n padding: 24,\n align: \"center\",\n fill: () => state.style.background,\n children: parts,\n })\n return asParts([row as unknown as Node2D])\n },\n commands: {\n /** Rings sweep in from `startAngle`, outer ring first, then captions fade up and the legend staggers in. `duration` is the whole entrance; the centre summary keeps its own signal. */\n enter: {\n args: {},\n entrance: true,\n easing: easeOut(),\n run: (timeline, _state, children) => {\n const parts = partsOf(children)\n if (!parts) return timeline.wait(timeline.duration)\n const { rings, legend } = parts\n const sweep = timeline.duration * SWEEP_SHARE\n const labels = timeline.duration * LABEL_SHARE\n const at0 = (piece: Beat[\"piece\"]): Beat => ({ at: 0, duration: 0, piece })\n return beats(timeline, [\n at0(rings.to({ growth: 0, labelReveal: 0 })),\n ...(legend ? [at0(legend.run(\"arm\"))] : []),\n { at: 0, duration: sweep, piece: rings.run(\"sweep\") },\n { at: sweep, duration: labels, piece: rings.run(\"revealLabels\") },\n ...(legend ? [{ at: sweep, duration: labels, piece: legend.run(\"enter\") }] : []),\n ])\n },\n },\n /** Fade the centre summary up. Not part of `enter`: it is usually the conclusion, which a scene lands on its own beat. */\n revealCenter: {\n args: {},\n easing: easeOut(),\n run: (timeline, _state, children) => partsOf(children)?.rings.run(\"revealCenter\") ?? timeline.wait(timeline.duration),\n },\n /** Thicken ring `ringIndex` and dim the rest, leaving any other selected ring where it is. */\n selectRing: {\n args: { ringIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.ringIndex\n return popping(timeline, state, (i) => (i === index ? 1 : popAt(state, i)))\n },\n },\n /** Settle every ring and bring the whole chart back to full. */\n clearSelection: {\n args: {},\n easing: easeOut(),\n run: (timeline, state) => popping(timeline, state, () => 0),\n },\n },\n})\n\nexport type RadialChart = NodeOf<typeof RadialChart>\n"]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { PathBuilder, type NodeOf, type Node2D, type Node2DProps as _Node2DProps, type Fill as _Fill, type FillResolved as _FillResolved, type TextStyle, type Vector2 } from "@motionscript/sdk";
|
|
2
|
+
import { type CenterConfig } from "../kit/polar.js";
|
|
3
|
+
import { type RadialMarks, type RadialRow } from "./shared.js";
|
|
4
|
+
interface RingsState {
|
|
5
|
+
readonly rows: RadialRow[];
|
|
6
|
+
readonly max: number;
|
|
7
|
+
readonly marks: RadialMarks;
|
|
8
|
+
readonly label: TextStyle;
|
|
9
|
+
readonly centerStyle: CenterConfig;
|
|
10
|
+
readonly ringLabels: boolean;
|
|
11
|
+
readonly pops: readonly number[];
|
|
12
|
+
readonly dimOpacity: number;
|
|
13
|
+
readonly centerLabel: string;
|
|
14
|
+
readonly centerCaption: string;
|
|
15
|
+
}
|
|
16
|
+
/** Every radius and angle for one box, derived wherever read so the drawing and the labels cannot disagree. */
|
|
17
|
+
export declare class RadialGeometry {
|
|
18
|
+
private readonly s;
|
|
19
|
+
private readonly box;
|
|
20
|
+
constructor(s: RingsState, box: {
|
|
21
|
+
readonly width: number;
|
|
22
|
+
readonly height: number;
|
|
23
|
+
});
|
|
24
|
+
get count(): number;
|
|
25
|
+
get outerRadius(): number;
|
|
26
|
+
get holeRadius(): number;
|
|
27
|
+
/** Radial depth of one ring. */
|
|
28
|
+
get thickness(): number;
|
|
29
|
+
/** Rim of ring `index`; ring 0 is the outermost. */
|
|
30
|
+
ringOuter(index: number): number;
|
|
31
|
+
ringMid(index: number): number;
|
|
32
|
+
get fractions(): number[];
|
|
33
|
+
get startRad(): number;
|
|
34
|
+
get sweepRad(): number;
|
|
35
|
+
popOf(index: number): number;
|
|
36
|
+
get selectionStrength(): number;
|
|
37
|
+
ringOpacity(index: number): number;
|
|
38
|
+
/** How far ring `index`'s sweep has come at entrance progress `growth`: rings start in turn, outer first. */
|
|
39
|
+
progress(index: number, growth: number): number;
|
|
40
|
+
get labelFont(): number;
|
|
41
|
+
/** Where ring `index`'s caption is pinned: just behind its start, reading away from the sweep. */
|
|
42
|
+
labelAnchor(index: number): {
|
|
43
|
+
at: Vector2;
|
|
44
|
+
side: 1 | -1;
|
|
45
|
+
};
|
|
46
|
+
get centerFont(): number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* An arc band between `rIn` and `rOut` over `a0`..`a1` (radians clockwise from
|
|
50
|
+
* 12 o'clock), the ends squared or capped with half circles. A band shorter
|
|
51
|
+
* than its caps is two overlapping caps, which fill as a pill.
|
|
52
|
+
*/
|
|
53
|
+
export declare function bandPath(a0: number, a1: number, rIn: number, rOut: number, round: boolean): PathBuilder;
|
|
54
|
+
/**
|
|
55
|
+
* The rings: row `i` is the `i`-th ring from the outside, an arc from
|
|
56
|
+
* `startAngle` whose sweep is `value / max` of the full sweep, over an
|
|
57
|
+
* optional full-sweep track. A selected ring thickens and the rest dims.
|
|
58
|
+
*/
|
|
59
|
+
export declare const RadialRings: import("@motionscript/sdk").Component<"radialRings", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
60
|
+
readonly rows: import("@motionscript/sdk").Type<import("../index.js").PieSlice[], import("../index.js").PieSlice[], false>;
|
|
61
|
+
readonly max: 0;
|
|
62
|
+
readonly marks: import("@motionscript/sdk").Type<RadialMarks, RadialMarks, false>;
|
|
63
|
+
readonly label: import("@motionscript/sdk").Type<TextStyle, TextStyle, false>;
|
|
64
|
+
readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
|
|
65
|
+
/** The empty-ring colour drawn under each arc. */
|
|
66
|
+
readonly trackFill: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
67
|
+
readonly ringLabels: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
68
|
+
/** Entrance progress `[0, 1]`: rings sweep in turn. */
|
|
69
|
+
readonly growth: 1;
|
|
70
|
+
readonly labelReveal: 1;
|
|
71
|
+
readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
72
|
+
readonly dimOpacity: 0.25;
|
|
73
|
+
readonly centerLabel: "";
|
|
74
|
+
readonly centerCaption: "";
|
|
75
|
+
readonly centerReveal: 1;
|
|
76
|
+
}>, {
|
|
77
|
+
readonly sweep: unknown;
|
|
78
|
+
readonly revealLabels: unknown;
|
|
79
|
+
readonly revealCenter: unknown;
|
|
80
|
+
}, null, Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
81
|
+
readonly rows: import("@motionscript/sdk").Type<import("../index.js").PieSlice[], import("../index.js").PieSlice[], false>;
|
|
82
|
+
readonly max: 0;
|
|
83
|
+
readonly marks: import("@motionscript/sdk").Type<RadialMarks, RadialMarks, false>;
|
|
84
|
+
readonly label: import("@motionscript/sdk").Type<TextStyle, TextStyle, false>;
|
|
85
|
+
readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
|
|
86
|
+
/** The empty-ring colour drawn under each arc. */
|
|
87
|
+
readonly trackFill: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
88
|
+
readonly ringLabels: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
89
|
+
/** Entrance progress `[0, 1]`: rings sweep in turn. */
|
|
90
|
+
readonly growth: 1;
|
|
91
|
+
readonly labelReveal: 1;
|
|
92
|
+
readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
93
|
+
readonly dimOpacity: 0.25;
|
|
94
|
+
readonly centerLabel: "";
|
|
95
|
+
readonly centerCaption: "";
|
|
96
|
+
readonly centerReveal: 1;
|
|
97
|
+
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
98
|
+
readonly rows: import("@motionscript/sdk").Type<import("../index.js").PieSlice[], import("../index.js").PieSlice[], false>;
|
|
99
|
+
readonly max: 0;
|
|
100
|
+
readonly marks: import("@motionscript/sdk").Type<RadialMarks, RadialMarks, false>;
|
|
101
|
+
readonly label: import("@motionscript/sdk").Type<TextStyle, TextStyle, false>;
|
|
102
|
+
readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
|
|
103
|
+
/** The empty-ring colour drawn under each arc. */
|
|
104
|
+
readonly trackFill: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
|
|
105
|
+
readonly ringLabels: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
106
|
+
/** Entrance progress `[0, 1]`: rings sweep in turn. */
|
|
107
|
+
readonly growth: 1;
|
|
108
|
+
readonly labelReveal: 1;
|
|
109
|
+
readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
110
|
+
readonly dimOpacity: 0.25;
|
|
111
|
+
readonly centerLabel: "";
|
|
112
|
+
readonly centerCaption: "";
|
|
113
|
+
readonly centerReveal: 1;
|
|
114
|
+
}>, {
|
|
115
|
+
readonly sweep: unknown;
|
|
116
|
+
readonly revealLabels: unknown;
|
|
117
|
+
readonly revealCenter: unknown;
|
|
118
|
+
}, Node2D<_Node2DProps>>>>;
|
|
119
|
+
export type RadialRings = NodeOf<typeof RadialRings>;
|
|
120
|
+
export {};
|
|
121
|
+
//# sourceMappingURL=radial-rings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radial-rings.d.ts","sourceRoot":"","sources":["../../src/radial-chart/radial-rings.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAQX,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,IAAI,IAAI,KAAK,EAClB,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,SAAS,EACd,KAAK,OAAO,EACb,MAAM,mBAAmB,CAAA;AAK1B,OAAO,EAA4C,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAmB,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAoB5E,UAAU,UAAU;IAClB,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,CAAA;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAA;IAClC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAMD,+GAA+G;AAC/G,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClB,OAAO,CAAC,QAAQ,CAAC,GAAG;gBADH,CAAC,EAAE,UAAU,EACb,GAAG,EAAE;QAAE,QA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