@motionscript/charts 0.1.0-alpha.5 → 0.1.0-alpha.7

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 (146) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +30 -16
  3. package/dist/bar-chart/bar-chart.d.ts +133 -242
  4. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  5. package/dist/bar-chart/bar-chart.js +378 -569
  6. package/dist/bar-chart/bar-chart.js.map +1 -1
  7. package/dist/bar-chart/category-axis.d.ts +35 -41
  8. package/dist/bar-chart/category-axis.d.ts.map +1 -1
  9. package/dist/bar-chart/category-axis.js +93 -115
  10. package/dist/bar-chart/category-axis.js.map +1 -1
  11. package/dist/bar-chart/chart-bars.d.ts +50 -70
  12. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  13. package/dist/bar-chart/chart-bars.js +156 -210
  14. package/dist/bar-chart/chart-bars.js.map +1 -1
  15. package/dist/bar-chart/index.d.ts +2 -2
  16. package/dist/bar-chart/index.d.ts.map +1 -1
  17. package/dist/bar-chart/index.js +1 -1
  18. package/dist/bar-chart/index.js.map +1 -1
  19. package/dist/bar-chart/shared.d.ts +3 -3
  20. package/dist/bar-chart/shared.d.ts.map +1 -1
  21. package/dist/bar-chart/shared.js +3 -3
  22. package/dist/bar-chart/shared.js.map +1 -1
  23. package/dist/browser/chunks/chunk-XROBIRQK.js +2 -0
  24. package/dist/browser/chunks/chunk-XROBIRQK.js.map +7 -0
  25. package/dist/browser/index.js +1 -1
  26. package/dist/browser/index.js.map +3 -3
  27. package/dist/browser/kit.js +1 -1
  28. package/dist/browser/manifest.json +1 -1
  29. package/dist/engine.d.ts +8 -6
  30. package/dist/engine.d.ts.map +1 -1
  31. package/dist/engine.js +8 -6
  32. package/dist/engine.js.map +1 -1
  33. package/dist/kit/cartesian.d.ts +44 -0
  34. package/dist/kit/cartesian.d.ts.map +1 -0
  35. package/dist/kit/cartesian.js +59 -0
  36. package/dist/kit/cartesian.js.map +1 -0
  37. package/dist/kit/chart-border.d.ts +10 -11
  38. package/dist/kit/chart-border.d.ts.map +1 -1
  39. package/dist/kit/chart-border.js +15 -32
  40. package/dist/kit/chart-border.js.map +1 -1
  41. package/dist/kit/chart-canvas.d.ts +32 -21
  42. package/dist/kit/chart-canvas.d.ts.map +1 -1
  43. package/dist/kit/chart-canvas.js +33 -90
  44. package/dist/kit/chart-canvas.js.map +1 -1
  45. package/dist/kit/chart-legend.d.ts +123 -64
  46. package/dist/kit/chart-legend.d.ts.map +1 -1
  47. package/dist/kit/chart-legend.js +129 -154
  48. package/dist/kit/chart-legend.js.map +1 -1
  49. package/dist/kit/entries.d.ts +17 -0
  50. package/dist/kit/entries.d.ts.map +1 -0
  51. package/dist/kit/entries.js +19 -0
  52. package/dist/kit/entries.js.map +1 -0
  53. package/dist/kit/motion.d.ts +48 -0
  54. package/dist/kit/motion.d.ts.map +1 -0
  55. package/dist/kit/motion.js +63 -0
  56. package/dist/kit/motion.js.map +1 -0
  57. package/dist/kit/paints.d.ts +10 -0
  58. package/dist/kit/paints.d.ts.map +1 -0
  59. package/dist/kit/paints.js +12 -0
  60. package/dist/kit/paints.js.map +1 -0
  61. package/dist/kit/shared.d.ts +31 -3
  62. package/dist/kit/shared.d.ts.map +1 -1
  63. package/dist/kit/shared.js +42 -3
  64. package/dist/kit/shared.js.map +1 -1
  65. package/dist/kit/vertical-axis.d.ts +48 -61
  66. package/dist/kit/vertical-axis.d.ts.map +1 -1
  67. package/dist/kit/vertical-axis.js +97 -132
  68. package/dist/kit/vertical-axis.js.map +1 -1
  69. package/dist/line-chart/chart-line.d.ts +60 -77
  70. package/dist/line-chart/chart-line.d.ts.map +1 -1
  71. package/dist/line-chart/chart-line.js +100 -121
  72. package/dist/line-chart/chart-line.js.map +1 -1
  73. package/dist/line-chart/chart-region.d.ts +32 -33
  74. package/dist/line-chart/chart-region.d.ts.map +1 -1
  75. package/dist/line-chart/chart-region.js +31 -65
  76. package/dist/line-chart/chart-region.js.map +1 -1
  77. package/dist/line-chart/horizontal-axis.d.ts +58 -64
  78. package/dist/line-chart/horizontal-axis.d.ts.map +1 -1
  79. package/dist/line-chart/horizontal-axis.js +94 -123
  80. package/dist/line-chart/horizontal-axis.js.map +1 -1
  81. package/dist/line-chart/index.d.ts +2 -2
  82. package/dist/line-chart/index.d.ts.map +1 -1
  83. package/dist/line-chart/index.js +1 -1
  84. package/dist/line-chart/index.js.map +1 -1
  85. package/dist/line-chart/line-chart.d.ts +156 -319
  86. package/dist/line-chart/line-chart.d.ts.map +1 -1
  87. package/dist/line-chart/line-chart.js +403 -663
  88. package/dist/line-chart/line-chart.js.map +1 -1
  89. package/dist/line-chart/shared.d.ts +3 -3
  90. package/dist/line-chart/shared.d.ts.map +1 -1
  91. package/dist/line-chart/shared.js +3 -3
  92. package/dist/line-chart/shared.js.map +1 -1
  93. package/dist/nodes.d.ts +6 -9
  94. package/dist/nodes.d.ts.map +1 -1
  95. package/dist/nodes.js +7 -9
  96. package/dist/nodes.js.map +1 -1
  97. package/dist/pie-chart/index.d.ts +2 -2
  98. package/dist/pie-chart/index.d.ts.map +1 -1
  99. package/dist/pie-chart/index.js +1 -1
  100. package/dist/pie-chart/index.js.map +1 -1
  101. package/dist/pie-chart/pie-chart.d.ts +108 -132
  102. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  103. package/dist/pie-chart/pie-chart.js +200 -271
  104. package/dist/pie-chart/pie-chart.js.map +1 -1
  105. package/dist/pie-chart/pie-legend.d.ts +84 -31
  106. package/dist/pie-chart/pie-legend.d.ts.map +1 -1
  107. package/dist/pie-chart/pie-legend.js +93 -107
  108. package/dist/pie-chart/pie-legend.js.map +1 -1
  109. package/dist/pie-chart/pie-ring.d.ts +160 -131
  110. package/dist/pie-chart/pie-ring.d.ts.map +1 -1
  111. package/dist/pie-chart/pie-ring.js +333 -391
  112. package/dist/pie-chart/pie-ring.js.map +1 -1
  113. package/dist/pie-chart/shared.d.ts +2 -2
  114. package/dist/pie-chart/shared.d.ts.map +1 -1
  115. package/dist/pie-chart/shared.js +2 -2
  116. package/dist/pie-chart/shared.js.map +1 -1
  117. package/package.json +4 -4
  118. package/src/bar-chart/bar-chart.ts +415 -701
  119. package/src/bar-chart/category-axis.ts +95 -110
  120. package/src/bar-chart/chart-bars.ts +178 -200
  121. package/src/bar-chart/index.ts +2 -2
  122. package/src/bar-chart/shared.ts +3 -3
  123. package/src/engine.ts +8 -6
  124. package/src/kit/cartesian.ts +81 -0
  125. package/src/kit/chart-border.ts +22 -33
  126. package/src/kit/chart-canvas.ts +44 -79
  127. package/src/kit/chart-legend.ts +173 -189
  128. package/src/kit/entries.ts +20 -0
  129. package/src/kit/motion.ts +90 -0
  130. package/src/kit/paints.ts +15 -0
  131. package/src/kit/shared.ts +52 -3
  132. package/src/kit/vertical-axis.ts +110 -140
  133. package/src/line-chart/chart-line.ts +102 -154
  134. package/src/line-chart/chart-region.ts +35 -80
  135. package/src/line-chart/horizontal-axis.ts +101 -152
  136. package/src/line-chart/index.ts +2 -2
  137. package/src/line-chart/line-chart.ts +449 -825
  138. package/src/line-chart/shared.ts +3 -3
  139. package/src/nodes.ts +8 -10
  140. package/src/pie-chart/index.ts +2 -2
  141. package/src/pie-chart/pie-chart.ts +221 -311
  142. package/src/pie-chart/pie-legend.ts +124 -114
  143. package/src/pie-chart/pie-ring.ts +386 -473
  144. package/src/pie-chart/shared.ts +2 -2
  145. package/dist/browser/chunks/chunk-5ZPBV6BU.js +0 -2
  146. package/dist/browser/chunks/chunk-5ZPBV6BU.js.map +0 -7
@@ -1,14 +1,14 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { command, Node2D, Rect, RotatedBox, Text, easeOut, property, insetsOps, textOps, } from "@motionscript/sdk";
1
+ import { Rect, RotatedBox, Text, Types, component2d, insetsOps, textOps, } from "@motionscript/sdk";
2
+ import { asParts, fresh } from "./entries.js";
3
+ import { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase } from "./motion.js";
8
4
  import { DEFAULT_Y_AXIS, enterBudget, formatMarker, } from "./shared.js";
9
- import { at, compose } from "@motionscript/sdk/component";
10
5
  /** How far a marker starts to the right of its slot when it enters, in px. */
11
6
  const SLIDE = 24;
7
+ /** What a marker's caption reads: the one listed for its value, else its bare reading. */
8
+ export function markerCaption(s, value) {
9
+ const index = s.markers.indexOf(value);
10
+ return (index >= 0 ? s.captions[index] : undefined) ?? formatMarker(value);
11
+ }
12
12
  /**
13
13
  * The numeric vertical axis shared by the cartesian charts: a **column of
14
14
  * {@link Text} nodes**, one per marker value, running top-to-bottom (highest
@@ -22,62 +22,53 @@ const SLIDE = 24;
22
22
  * tweens `range`/`markers` live. Only the marker **count** is fixed at
23
23
  * construction.
24
24
  *
25
- * {@link enter} staggers them in **bottom-to-top**: each marker starts pushed a
25
+ * `enter` staggers them in **bottom-to-top**: each marker starts pushed a
26
26
  * little to the right and transparent, then fades and slides left into place.
27
27
  * The resting state is the landed one, so a chart that is never told to enter
28
28
  * still reads as a finished chart.
29
29
  */
30
- export class VerticalAxis extends Node2D {
31
- /**
32
- * How a tick value is captioned. Defaults to the bare numeric reading; a
33
- * chart with a number format on this axis replaces it (see `number-format`).
34
- *
35
- * A plain field rather than a `@property`, for the reason the horizontal
36
- * axis's twin spells out: it is a policy, not a value, and there is nothing
37
- * to tween between two formatters.
38
- */
39
- labelFor = formatMarker;
40
- /** One text node per marker, ordered top → bottom, for the staggered enter. */
41
- markerNodes = [];
42
- /** The caption node, or null when `label` is empty. Entered after the markers. */
43
- labelNode = null;
44
- /** The live tick values, top → bottom (highest first) — re-read every frame. */
45
- get sortedMarkers() {
46
- return [...this.markers].sort((a, b) => b - a);
47
- }
48
- /**
49
- * Tick `i`'s value, or `undefined` once the live `markers` list is shorter
50
- * than the column of text nodes built for it — a slot with no value renders as
51
- * empty text rather than repeating its neighbour.
52
- */
53
- valueAt(index) {
54
- return this.sortedMarkers[index];
55
- }
56
- /** Tick `i`'s fraction across the live `range`, 0 at the bottom edge. */
57
- fracAt(index) {
58
- const v = this.valueAt(index);
59
- if (v === undefined)
60
- return 0;
61
- const [min, max] = this.range;
62
- return max <= min ? 0 : (v - min) / (max - min);
63
- }
64
- constructor(props) {
65
- super(props);
66
- // Composed from plain props (range/markers/label) — no context needed, so
67
- // it's built here. super() applied the props, so the reads below resolve.
68
- const tickPad = insetsOps.resolve(this.axis.tickPadding).right;
69
- const titlePad = insetsOps.resolve(this.axis.titlePadding).right;
70
- this.markerNodes = this.markers.map((_, i) => {
30
+ export const VerticalAxis = component2d({
31
+ key: "verticalAxis",
32
+ state: {
33
+ range: fresh(() => [0, 1]),
34
+ markers: fresh(() => []),
35
+ captions: fresh(() => []),
36
+ axis: Types.custom(DEFAULT_Y_AXIS),
37
+ label: "",
38
+ arrivals: arrivalsEntry(),
39
+ },
40
+ // A plain node filled its parent; one made of its markers would hug them.
41
+ defaults: { width: "fill", height: "fill" },
42
+ children: (state) => {
43
+ // Composed from plain entries (range/markers/label), so it's built once here.
44
+ const tickPad = insetsOps.resolve(state.axis.tickPadding).right;
45
+ const titlePad = insetsOps.resolve(state.axis.titlePadding).right;
46
+ const row = [];
47
+ // The row's parent is the axis: its box is what the markers are placed in.
48
+ const box = () => row[0]?.parent?.layoutBounds ?? { width: 0, height: 0 };
49
+ /** The live tick values, top → bottom (highest first) — re-read every frame. */
50
+ const sorted = () => [...state.markers].sort((a, b) => b - a);
51
+ /** Tick `i`'s fraction across the live `range`, 0 at the bottom edge. */
52
+ const fracAt = (value) => {
53
+ if (value === undefined)
54
+ return 0;
55
+ const [min, max] = state.range;
56
+ return max <= min ? 0 : (value - min) / (max - min);
57
+ };
58
+ // One text node per marker, ordered top → bottom. A slot with no value (the
59
+ // live list is shorter than the column built for it) renders as empty text
60
+ // rather than repeating its neighbour.
61
+ const markers = state.markers.map((_, i) => {
71
62
  const marker = new Text({
72
- ...textOps.styleProps(this.axis.labelStyle),
63
+ ...textOps.styleProps(state.axis.labelStyle),
73
64
  text: () => {
74
- const v = this.valueAt(i);
75
- return v === undefined ? "" : this.labelFor(v);
65
+ const value = sorted()[i];
66
+ return value === undefined ? "" : markerCaption(state, value);
76
67
  },
77
68
  y: () => {
78
69
  // Node2D space is y-up, so the fraction runs from the bottom.
79
- const height = this.layoutBounds.height;
80
- const centred = (this.fracAt(i) - 0.5) * height;
70
+ const height = box().height;
71
+ const centred = (fracAt(sorted()[i]) - 0.5) * height;
81
72
  // Held inside the axis's top edge — the backstop for a chart whose
82
73
  // headroom is smaller than its marker text is tall, which a theme with
83
74
  // much larger markers can arrange. Only the top, because what lies
@@ -85,92 +76,66 @@ export class VerticalAxis extends Node2D {
85
76
  const limit = height / 2 - marker.layoutBounds.height / 2;
86
77
  return Math.min(centred, limit);
87
78
  },
79
+ opacity: () => arrivalOf(state.arrivals, i).opacity,
80
+ x: () => arrivalOf(state.arrivals, i).shift,
88
81
  });
89
82
  return marker;
90
83
  });
91
84
  const children = [];
92
- if (this.label !== "") {
93
- this.labelNode = new Text({
94
- ...textOps.styleProps(this.axis.titleStyle),
95
- text: this.label,
96
- });
85
+ if (state.label !== "") {
97
86
  // Node2D space is y-up and rotation is clockwise, so -90° reads bottom-to-top.
98
87
  children.push(new RotatedBox({
99
88
  angle: -90,
100
89
  width: "hug",
101
90
  height: "hug",
102
- children: this.labelNode,
91
+ children: new Text({
92
+ ...textOps.styleProps(state.axis.titleStyle),
93
+ text: state.label,
94
+ opacity: () => arrivalOf(state.arrivals, "label").opacity,
95
+ x: () => arrivalOf(state.arrivals, "label").shift,
96
+ }),
103
97
  }));
104
98
  }
105
- children.push(new Rect({
106
- height: "fill",
107
- width: "hug",
108
- padding: { right: tickPad },
109
- children: this.markerNodes,
110
- }));
111
- this.add(new Rect({ flow: "horizontal", gap: titlePad, children }));
112
- }
113
- /**
114
- * Primes every marker (and the caption) at its pre-entrance state: shifted
115
- * right and transparent. Idempotent, and separate from {@link enter} so the
116
- * chart can arm its whole composition before the first frame is drawn.
117
- */
118
- arm(slide = SLIDE) {
119
- for (const marker of this.markerNodes)
120
- marker.set({ opacity: 0, x: slide });
121
- this.labelNode?.set({ opacity: 0, x: slide });
122
- }
123
- /**
124
- * Stagger the markers in bottom to top, then slide the caption in from the
125
- * right after them.
126
- *
127
- * A {@link Seekable} rather than a generator — see the note on the horizontal
128
- * axis's `enter`. The offsets were always static; expressing them as `wait`
129
- * inside a generator is what made them reachable only by running it.
130
- *
131
- * `args.duration` is the **whole** entrance, not one marker's slide: the
132
- * stagger and the caption are carved out of it rather than added on top. See
133
- * {@link enterBudget} for why that distinction matters here.
134
- *
135
- * `args.data.stagger` is seconds between successive markers (derived when
136
- * omitted); `args.data.slide` is the starting rightward offset in px.
137
- */
138
- enter(args) {
139
- const { stagger, slide = SLIDE } = args.data ?? {};
140
- const easing = args.easing ?? easeOut();
141
- const nodes = this.markerNodes;
142
- if (nodes.length === 0)
143
- return compose([]);
144
- const { step, per, caption } = enterBudget(args.duration, nodes.length, this.labelNode !== null, stagger);
145
- this.arm(slide);
146
- // Bottom marker leads: markerNodes is top → bottom, so walk it in reverse.
147
- const markers = nodes.map((node, i) => {
148
- const order = nodes.length - 1 - i; // bottom-most = 0
149
- return at(order * step, node.to({ data: { opacity: 1, x: 0 }, duration: per, easing }));
150
- });
151
- const lastMarkerEnds = (nodes.length - 1) * step + per;
152
- // Once every marker has landed, the caption slides in from the right.
153
- return compose([
154
- ...markers,
155
- ...(this.labelNode
156
- ? [at(lastMarkerEnds, this.labelNode.to({ data: { opacity: 1, x: 0 }, duration: caption, easing }))]
157
- : []),
158
- ]);
159
- }
160
- }
161
- __decorate([
162
- property({ default: () => [0, 1] })
163
- ], VerticalAxis.prototype, "range", void 0);
164
- __decorate([
165
- property({ default: () => [] })
166
- ], VerticalAxis.prototype, "markers", void 0);
167
- __decorate([
168
- property({ default: DEFAULT_Y_AXIS })
169
- ], VerticalAxis.prototype, "axis", void 0);
170
- __decorate([
171
- property({ default: "" })
172
- ], VerticalAxis.prototype, "label", void 0);
173
- __decorate([
174
- command()
175
- ], VerticalAxis.prototype, "enter", null);
99
+ children.push(new Rect({ height: "fill", width: "hug", padding: { right: tickPad }, children: markers }));
100
+ row.push(new Rect({ flow: "horizontal", gap: titlePad, children }));
101
+ return asParts(row);
102
+ },
103
+ commands: {
104
+ /**
105
+ * Stagger the markers in bottom to top, then slide the caption in from the
106
+ * right after them. Its first frame arms them all: shifted right by `slide`
107
+ * and transparent.
108
+ *
109
+ * The timeline's duration is the **whole** entrance, not one marker's slide:
110
+ * the stagger and the caption are carved out of it rather than added on top.
111
+ * See {@link enterBudget} for why that distinction matters here.
112
+ *
113
+ * `stagger` is seconds between successive markers (derived when omitted);
114
+ * `slide` is the starting rightward offset in px.
115
+ */
116
+ enter: {
117
+ args: {
118
+ stagger: Types.custom(undefined),
119
+ slide: Types.number(SLIDE),
120
+ },
121
+ run: (timeline, state) => {
122
+ const { stagger, slide } = timeline.args;
123
+ const count = state.markers.length;
124
+ const captioned = state.label !== "";
125
+ const from = { opacity: 0, shift: slide };
126
+ const keys = [...state.markers.keys(), ...(captioned ? ["label"] : [])];
127
+ const arm = timeline.animate(() => ({ arrivals: armed(keys, from) }));
128
+ if (count === 0)
129
+ return arm;
130
+ const { step, per, caption } = enterBudget(timeline.duration, count, captioned, stagger);
131
+ const ease = frameEase(timeline);
132
+ // Bottom marker leads: the column is top → bottom, so walk it in reverse.
133
+ const markers = state.markers.map((_, i) => ({ at: (count - 1 - i) * step, duration: per, piece: arrival(timeline, i, from, ease) }));
134
+ // Once every marker has landed, the caption slides in from the right.
135
+ const label = captioned ? [{ at: (count - 1) * step + per, duration: caption, piece: arrival(timeline, "label", from, ease) }] : [];
136
+ return timeline.together([arm, beats(timeline, [...markers, ...label])]);
137
+ },
138
+ },
139
+ },
140
+ });
176
141
  //# sourceMappingURL=vertical-axis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vertical-axis.js","sourceRoot":"","sources":["../../src/kit/vertical-axis.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,OAAO,EACP,MAAM,EACN,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,GAIR,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,GAGb,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,EAAE,EAAE,OAAO,EAAiB,MAAM,6BAA6B,CAAA;AAqBxE,8EAA8E;AAC9E,MAAM,KAAK,GAAG,EAAE,CAAA;AAKhB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAyB;IAMzD;;;;;;;OAOG;IACH,QAAQ,GAAgB,YAAY,CAAA;IAEpC,+EAA+E;IACvE,WAAW,GAAW,EAAE,CAAA;IAChC,kFAAkF;IAC1E,SAAS,GAAgB,IAAI,CAAA;IAErC,gFAAgF;IAChF,IAAY,aAAa;QACvB,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAChD,CAAC;IAED;;;;OAIG;IACK,OAAO,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;IAED,yEAAyE;IACjE,MAAM,CAAC,KAAa;QAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC7B,IAAI,CAAC,KAAK,SAAS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GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAA;QAEtD,sEAAsE;QACtE,OAAO,OAAO,CAAC;YACb,GAAG,OAAO;YACV,GAAG,CAAC,IAAI,CAAC,SAAS;gBAChB,CAAC,CAAC,CAAC,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;gBACpG,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAA;IACJ,CAAC;CACF;AA3JuD;IAArD,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAU,EAAE,CAAC;2CAAqB;AACb;IAApD,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAc,EAAE,CAAC;6CAA0B;AACvB;IAA9C,QAAQ,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;0CAAyB;AAC5B;IAAlC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;2CAAsB;AA2HhD;IADC,OAAO,EAAE;yCA6BT","sourcesContent":["import {\r\n command,\r\n Node2D,\r\n Rect,\r\n RotatedBox,\r\n Text,\r\n easeOut,\r\n property,\r\n insetsOps,\r\n textOps,\r\n type CommandArgs,\r\n type NodeConfig,\r\n type Node2DProps,\r\n} from \"@motionscript/sdk\"\r\n\r\nimport {\r\n DEFAULT_Y_AXIS,\r\n enterBudget,\r\n formatMarker,\r\n type AxisConfig,\r\n type Range,\r\n} from \"./shared\"\r\nimport { at, compose, type Seekable } from \"@motionscript/sdk/component\"\r\n\r\nexport interface VerticalAxisProps extends Node2DProps {\r\n /** `[min, max]` of the vertical scale the markers are positioned within. */\r\n range: Range\r\n /**\r\n * Tick values (in data units) to draw up the axis, each placed by its fraction\r\n * across {@link VerticalAxisProps.range}. Need not be evenly spaced or include\r\n * the ends.\r\n */\r\n markers: number[]\r\n /** Marker/caption text style, grid stroke, and gutters — see {@link AxisConfig}. */\r\n axis: AxisConfig\r\n /**\r\n * Rotated caption drawn in the gutter to the left of the marker column. Empty\r\n * string (the default) hides it — no caption node is built and no label gutter\r\n * is reserved.\r\n */\r\n label: string\r\n}\r\n\r\n/** How far a marker starts to the right of its slot when it enters, in px. */\r\nconst SLIDE = 24\r\n\r\n/** How a tick value is captioned — see {@link VerticalAxis.labelFor}. */\r\nexport type MarkerLabel = (value: number) => string\r\n\r\n/**\r\n * The numeric vertical axis shared by the cartesian charts: a **column of\r\n * {@link Text} nodes**, one per marker value, running top-to-bottom (highest\r\n * value at the top). Pure layout — no `Graphics` — so the markers are real text\r\n * nodes the scene can measure, restyle, or animate individually.\r\n *\r\n * Each marker is positioned so its centre lands exactly on its value's fraction\r\n * across `range` within the axis's filled height, so unevenly-spaced markers\r\n * land where their values fall. Both the caption and the position are *bound*,\r\n * not snapshotted: a chart that rescales its axes (see `LineChart.zoomTo`)\r\n * tweens `range`/`markers` live. Only the marker **count** is fixed at\r\n * construction.\r\n *\r\n * {@link enter} staggers them in **bottom-to-top**: each marker starts pushed a\r\n * little to the right and transparent, then fades and slides left into place.\r\n * The resting state is the landed one, so a chart that is never told to enter\r\n * still reads as a finished chart.\r\n */\r\nexport class VerticalAxis extends Node2D<VerticalAxisProps> {\r\n @property({ default: () => [0, 1] as Range }) declare range: Range\r\n @property({ default: () => [] as number[] }) declare markers: number[]\r\n @property({ default: DEFAULT_Y_AXIS }) declare axis: AxisConfig\r\n @property({ default: \"\" }) declare label: string\r\n\r\n /**\r\n * How a tick value is captioned. Defaults to the bare numeric reading; a\r\n * chart with a number format on this axis replaces it (see `number-format`).\r\n *\r\n * A plain field rather than a `@property`, for the reason the horizontal\r\n * axis's twin spells out: it is a policy, not a value, and there is nothing\r\n * to tween between two formatters.\r\n */\r\n labelFor: MarkerLabel = formatMarker\r\n\r\n /** One text node per marker, ordered top → bottom, for the staggered enter. */\r\n private markerNodes: Text[] = []\r\n /** The caption node, or null when `label` is empty. Entered after the markers. */\r\n private labelNode: Text | null = null\r\n\r\n /** The live tick values, top → bottom (highest first) — re-read every frame. */\r\n private get sortedMarkers(): number[] {\r\n return [...this.markers].sort((a, b) => b - a)\r\n }\r\n\r\n /**\r\n * Tick `i`'s value, or `undefined` once the live `markers` list is shorter\r\n * than the column of text nodes built for it — a slot with no value renders as\r\n * empty text rather than repeating its neighbour.\r\n */\r\n private valueAt(index: number): number | undefined {\r\n return this.sortedMarkers[index]\r\n }\r\n\r\n /** Tick `i`'s fraction across the live `range`, 0 at the bottom edge. */\r\n private fracAt(index: number): number {\r\n const v = this.valueAt(index)\r\n if (v === undefined) return 0\r\n const [min, max] = this.range\r\n return max <= min ? 0 : (v - min) / (max - min)\r\n }\r\n\r\n constructor(props?: NodeConfig<VerticalAxis, VerticalAxisProps>) {\r\n super(props)\r\n\r\n // Composed from plain props (range/markers/label) — no context needed, so\r\n // it's built here. super() applied the props, so the reads below resolve.\r\n const tickPad = insetsOps.resolve(this.axis.tickPadding).right\r\n const titlePad = insetsOps.resolve(this.axis.titlePadding).right\r\n\r\n this.markerNodes = this.markers.map((_, i) => {\r\n const marker: Text = new Text({\r\n ...textOps.styleProps(this.axis.labelStyle),\r\n text: () => {\r\n const v = this.valueAt(i)\r\n return v === undefined ? \"\" : this.labelFor(v)\r\n },\r\n y: () => {\r\n // Node2D space is y-up, so the fraction runs from the bottom.\r\n const height = this.layoutBounds.height\r\n const centred = (this.fracAt(i) - 0.5) * height\r\n // Held inside the axis's top edge — the backstop for a chart whose\r\n // headroom is smaller than its marker text is tall, which a theme with\r\n // much larger markers can arrange. Only the top, because what lies\r\n // below the axis is the chart's own horizontal axis and legend.\r\n const limit = height / 2 - marker.layoutBounds.height / 2\r\n return Math.min(centred, limit)\r\n },\r\n })\r\n return marker\r\n })\r\n\r\n const children: Node2D[] = []\r\n if (this.label !== \"\") {\r\n this.labelNode = new Text({\r\n ...textOps.styleProps(this.axis.titleStyle),\r\n text: this.label,\r\n })\r\n // Node2D space is y-up and rotation is clockwise, so -90° reads bottom-to-top.\r\n children.push(\r\n new RotatedBox({\r\n angle: -90,\r\n width: \"hug\",\r\n height: \"hug\",\r\n children: this.labelNode,\r\n })\r\n )\r\n }\r\n children.push(\r\n new Rect({\r\n height: \"fill\",\r\n width: \"hug\",\r\n padding: { right: tickPad },\r\n children: this.markerNodes,\r\n })\r\n )\r\n\r\n this.add(new Rect({ flow: \"horizontal\", gap: titlePad, children }))\r\n }\r\n\r\n /**\r\n * Primes every marker (and the caption) at its pre-entrance state: shifted\r\n * right and transparent. Idempotent, and separate from {@link enter} so the\r\n * chart can arm its whole composition before the first frame is drawn.\r\n */\r\n arm(slide = SLIDE): void {\r\n for (const marker of this.markerNodes) marker.set({ opacity: 0, x: slide })\r\n this.labelNode?.set({ opacity: 0, x: slide })\r\n }\r\n\r\n /**\r\n * Stagger the markers in bottom to top, then slide the caption in from the\r\n * right after them.\r\n *\r\n * A {@link Seekable} rather than a generator — see the note on the horizontal\r\n * axis's `enter`. The offsets were always static; expressing them as `wait`\r\n * inside a generator is what made them reachable only by running it.\r\n *\r\n * `args.duration` is the **whole** entrance, not one marker's slide: the\r\n * stagger and the caption are carved out of it rather than added on top. See\r\n * {@link enterBudget} for why that distinction matters here.\r\n *\r\n * `args.data.stagger` is seconds between successive markers (derived when\r\n * omitted); `args.data.slide` is the starting rightward offset in px.\r\n */\r\n @command()\r\n enter(args: CommandArgs<{ stagger?: number; slide?: number }> & { duration: number }): Seekable {\r\n const { stagger, slide = SLIDE } = args.data ?? {}\r\n const easing = args.easing ?? easeOut()\r\n const nodes = this.markerNodes\r\n if (nodes.length === 0) return compose([])\r\n const { step, per, caption } = enterBudget(\r\n args.duration,\r\n nodes.length,\r\n this.labelNode !== null,\r\n stagger\r\n )\r\n\r\n this.arm(slide)\r\n\r\n // Bottom marker leads: markerNodes is top → bottom, so walk it in reverse.\r\n const markers = nodes.map((node, i) => {\r\n const order = nodes.length - 1 - i // bottom-most = 0\r\n return at(order * step, node.to({ data: { opacity: 1, x: 0 }, duration: per, easing }))\r\n })\r\n const lastMarkerEnds = (nodes.length - 1) * step + per\r\n\r\n // Once every marker has landed, the caption slides in from the right.\r\n return compose([\r\n ...markers,\r\n ...(this.labelNode\r\n ? [at(lastMarkerEnds, this.labelNode.to({ data: { opacity: 1, x: 0 }, duration: caption, easing }))]\r\n : []),\r\n ])\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"vertical-axis.js","sourceRoot":"","sources":["../../src/kit/vertical-axis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAO,GAIR,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAgB,MAAM,UAAU,CAAA;AACnG,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,GAGb,MAAM,UAAU,CAAA;AA2BjB,8EAA8E;AAC9E,MAAM,KAAK,GAAG,EAAE,CAAA;AAKhB,0FAA0F;AAC1F,MAAM,UAAU,aAAa,CAAC,CAAgF,EAAE,KAAa;IAC3H,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACtC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,CAAA;AAC5E,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;IACtC,G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EAAE,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;gBACrI,sEAAsE;gBACtE,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;gBACnI,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1E,CAAC;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import {\r\n Rect,\r\n RotatedBox,\r\n Text,\r\n Types,\r\n component2d,\r\n insetsOps,\r\n textOps,\r\n type NodeOf,\r\n type Node2D,\r\n type Node2DProps,\r\n} from \"@motionscript/sdk\"\r\n\r\nimport { asParts, fresh } from \"./entries\"\r\nimport { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase, type Arrival } from \"./motion\"\r\nimport {\r\n DEFAULT_Y_AXIS,\r\n enterBudget,\r\n formatMarker,\r\n type AxisConfig,\r\n type Range,\r\n} from \"./shared\"\r\n\r\nexport interface VerticalAxisProps extends Node2DProps {\r\n /** `[min, max]` of the vertical scale the markers are positioned within. */\r\n range: Range\r\n /**\r\n * Tick values (in data units) to draw up the axis, each placed by its fraction\r\n * across {@link VerticalAxisProps.range}. Need not be evenly spaced or include\r\n * the ends.\r\n */\r\n markers: number[]\r\n /**\r\n * How each marker is captioned, one per entry of `markers` and in its order.\r\n * Empty (the default), or short, captions a marker with its bare numeric\r\n * reading; a chart with a number format on this axis writes them through it.\r\n */\r\n captions: string[]\r\n /** Marker/caption text style, grid stroke, and gutters — see {@link AxisConfig}. */\r\n axis: AxisConfig\r\n /**\r\n * Rotated caption drawn in the gutter to the left of the marker column. Empty\r\n * string (the default) hides it — no caption node is built and no label gutter\r\n * is reserved.\r\n */\r\n label: string\r\n}\r\n\r\n/** How far a marker starts to the right of its slot when it enters, in px. */\r\nconst SLIDE = 24\r\n\r\n/** How a tick value is captioned — see {@link VerticalAxisProps.captions}. */\r\nexport type MarkerLabel = (value: number) => string\r\n\r\n/** What a marker's caption reads: the one listed for its value, else its bare reading. */\r\nexport function markerCaption(s: { readonly markers: readonly number[]; readonly captions: readonly string[] }, value: number): string {\r\n const index = s.markers.indexOf(value)\r\n return (index >= 0 ? s.captions[index] : undefined) ?? formatMarker(value)\r\n}\r\n\r\n/**\r\n * The numeric vertical axis shared by the cartesian charts: a **column of\r\n * {@link Text} nodes**, one per marker value, running top-to-bottom (highest\r\n * value at the top). Pure layout — no `Graphics` — so the markers are real text\r\n * nodes the scene can measure, restyle, or animate individually.\r\n *\r\n * Each marker is positioned so its centre lands exactly on its value's fraction\r\n * across `range` within the axis's filled height, so unevenly-spaced markers\r\n * land where their values fall. Both the caption and the position are *bound*,\r\n * not snapshotted: a chart that rescales its axes (see `LineChart.zoomTo`)\r\n * tweens `range`/`markers` live. Only the marker **count** is fixed at\r\n * construction.\r\n *\r\n * `enter` staggers them in **bottom-to-top**: each marker starts pushed a\r\n * little to the right and transparent, then fades and slides left into place.\r\n * The resting state is the landed one, so a chart that is never told to enter\r\n * still reads as a finished chart.\r\n */\r\nexport const VerticalAxis = component2d({\r\n key: \"verticalAxis\",\r\n state: {\r\n range: fresh<Range>(() => [0, 1]),\r\n markers: fresh<number[]>(() => []),\r\n captions: fresh<string[]>(() => []),\r\n axis: Types.custom<AxisConfig>(DEFAULT_Y_AXIS),\r\n label: \"\",\r\n arrivals: arrivalsEntry(),\r\n },\r\n // A plain node filled its parent; one made of its markers would hug them.\r\n defaults: { width: \"fill\", height: \"fill\" },\r\n children: (state) => {\r\n // Composed from plain entries (range/markers/label), so it's built once here.\r\n const tickPad = insetsOps.resolve(state.axis.tickPadding).right\r\n const titlePad = insetsOps.resolve(state.axis.titlePadding).right\r\n\r\n const row: Node2D[] = []\r\n // The row's parent is the axis: its box is what the markers are placed in.\r\n const box = () => (row[0]?.parent as Node2D | null | undefined)?.layoutBounds ?? { width: 0, height: 0 }\r\n /** The live tick values, top → bottom (highest first) — re-read every frame. */\r\n const sorted = () => [...state.markers].sort((a, b) => b - a)\r\n /** Tick `i`'s fraction across the live `range`, 0 at the bottom edge. */\r\n const fracAt = (value: number | undefined) => {\r\n if (value === undefined) return 0\r\n const [min, max] = state.range\r\n return max <= min ? 0 : (value - min) / (max - min)\r\n }\r\n\r\n // One text node per marker, ordered top → bottom. A slot with no value (the\r\n // live list is shorter than the column built for it) renders as empty text\r\n // rather than repeating its neighbour.\r\n const markers = state.markers.map((_, i) => {\r\n const marker: Node2D = new Text({\r\n ...textOps.styleProps(state.axis.labelStyle),\r\n text: () => {\r\n const value = sorted()[i]\r\n return value === undefined ? \"\" : markerCaption(state, value)\r\n },\r\n y: () => {\r\n // Node2D space is y-up, so the fraction runs from the bottom.\r\n const height = box().height\r\n const centred = (fracAt(sorted()[i]) - 0.5) * height\r\n // Held inside the axis's top edge — the backstop for a chart whose\r\n // headroom is smaller than its marker text is tall, which a theme with\r\n // much larger markers can arrange. Only the top, because what lies\r\n // below the axis is the chart's own horizontal axis and legend.\r\n const limit = height / 2 - marker.layoutBounds.height / 2\r\n return Math.min(centred, limit)\r\n },\r\n opacity: () => arrivalOf(state.arrivals, i).opacity,\r\n x: () => arrivalOf(state.arrivals, i).shift,\r\n })\r\n return marker\r\n })\r\n\r\n const children: Node2D[] = []\r\n if (state.label !== \"\") {\r\n // Node2D space is y-up and rotation is clockwise, so -90° reads bottom-to-top.\r\n children.push(\r\n new RotatedBox({\r\n angle: -90,\r\n width: \"hug\",\r\n height: \"hug\",\r\n children: new Text({\r\n ...textOps.styleProps(state.axis.titleStyle),\r\n text: state.label,\r\n opacity: () => arrivalOf(state.arrivals, \"label\").opacity,\r\n x: () => arrivalOf(state.arrivals, \"label\").shift,\r\n }),\r\n })\r\n )\r\n }\r\n children.push(new Rect({ height: \"fill\", width: \"hug\", padding: { right: tickPad }, children: markers }))\r\n row.push(new Rect({ flow: \"horizontal\", gap: titlePad, children }))\r\n return asParts(row)\r\n },\r\n commands: {\r\n /**\r\n * Stagger the markers in bottom to top, then slide the caption in from the\r\n * right after them. Its first frame arms them all: shifted right by `slide`\r\n * and transparent.\r\n *\r\n * The timeline's duration is the **whole** entrance, not one marker's slide:\r\n * the stagger and the caption are carved out of it rather than added on top.\r\n * See {@link enterBudget} for why that distinction matters here.\r\n *\r\n * `stagger` is seconds between successive markers (derived when omitted);\r\n * `slide` is the starting rightward offset in px.\r\n */\r\n enter: {\r\n args: {\r\n stagger: Types.custom<number | undefined>(undefined),\r\n slide: Types.number(SLIDE),\r\n },\r\n run: (timeline, state) => {\r\n const { stagger, slide } = timeline.args\r\n const count = state.markers.length\r\n const captioned = state.label !== \"\"\r\n const from: Arrival = { opacity: 0, shift: slide }\r\n const keys = [...state.markers.keys(), ...(captioned ? [\"label\"] : [])]\r\n const arm = timeline.animate(() => ({ arrivals: armed(keys, from) }))\r\n if (count === 0) return arm\r\n const { step, per, caption } = enterBudget(timeline.duration, count, captioned, stagger)\r\n const ease = frameEase(timeline)\r\n // Bottom marker leads: the column is top → bottom, so walk it in reverse.\r\n const markers = state.markers.map((_, i) => ({ at: (count - 1 - i) * step, duration: per, piece: arrival(timeline, i, from, ease) }))\r\n // Once every marker has landed, the caption slides in from the right.\r\n const label = captioned ? [{ at: (count - 1) * step + per, duration: caption, piece: arrival(timeline, \"label\", from, ease) }] : []\r\n return timeline.together([arm, beats(timeline, [...markers, ...label])])\r\n },\r\n },\r\n },\r\n})\r\n\r\nexport type VerticalAxis = NodeOf<typeof VerticalAxis>\r\n"]}
@@ -1,91 +1,74 @@
1
- import { type AssetScope, Node2D, type Command, type CommandArgs, type EasingFunction, type Node2DProps, type RenderContext2D, type Stroke, type Vector2 } from "@motionscript/sdk";
1
+ import { type NodeOf, type Node2D as _Node2D, type Stroke, type StrokeResolved, type Vector2 } from "@motionscript/sdk";
2
2
  import { type RegionBox } from "./shared.js";
3
- export interface ChartLineProps extends Node2DProps {
4
- /**
5
- * The series polyline, already mapped into this node's local pixel space
6
- * (origin at centre, y-up) by the parent {@link LineChart}. Ordered along x.
7
- */
8
- points: Vector2[];
9
- /** Line colour + weight (+ optional dash/cap/join) — the per-series stroke. */
10
- stroke: Stroke;
11
- /**
12
- * Reveal of the line in `[0, 1]`: 0 hides it, 1 traces it fully from its left
13
- * end to its right.
14
- *
15
- * Defaults to **1**, unlike the standalone chart this was ported from: in an
16
- * editor a node's resting state is what the paused editor canvas paints, so a
17
- * chart that only appeared once a command had run would edit blind. {@link
18
- * enter} drives it from 0 regardless of where it rests, so the animation is
19
- * unchanged.
20
- */
21
- progress: number;
22
- /**
23
- * Whether this line is drawn at all. `false` hides it outright — the switch
24
- * the chart flips alongside its legend's per-series toggle.
25
- */
26
- enabled: boolean;
27
- /**
28
- * A slice of the plot to spotlight, in this node's own pixel space. When set
29
- * to a real box, the stretches of the line *outside* it drop to
30
- * {@link ChartLineProps.dimOpacity} while the stretches inside stay full.
31
- */
32
- spotlight: RegionBox;
33
- /** Opacity the out-of-region stretches fade to. */
34
- dimOpacity: number;
35
- }
36
3
  /**
37
4
  * A single series line of a {@link LineChart}: one rounded polyline traced
38
5
  * through pre-mapped pixel `points`, drawn as one {@link Graphics2D} command list.
39
6
  * Sized and positioned by the parent, which shares the plot's coordinate frame.
40
7
  *
41
- * Two signals drive it: {@link ChartLineProps.progress} traces the line in
42
- * (animated by {@link enter}) and `enabled` shows or hides it wholesale.
8
+ * Two signals drive it: `progress` traces the line in
9
+ * (animated by `enter`) and `enabled` shows or hides it wholesale.
43
10
  */
44
- export declare class ChartLine extends Node2D<ChartLineProps> {
45
- points: Vector2[];
46
- stroke: Stroke;
47
- progress: number;
48
- enabled: boolean;
49
- spotlight: RegionBox;
50
- dimOpacity: number;
51
- /**
52
- * This node extends `Node2D` rather than `ShapeNode`, so nothing declares the
53
- * paint props it carries — see {@link declarePaints}.
54
- */
55
- declareAssets(assets: AssetScope): void;
56
- protected renderSelf(ctx: RenderContext2D): void;
11
+ export declare const ChartLine: import("@motionscript/sdk").Component<"chartLine", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
12
+ /** The series polyline, already mapped into this node's local pixel space (origin at centre, y-up) by the parent {@link LineChart}. Ordered along x. */
13
+ readonly points: import("@motionscript/sdk").Type<Vector2[], Vector2[], false>;
14
+ /** Line colour + weight (+ optional dash/cap/join) — the per-series stroke. */
15
+ readonly stroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
57
16
  /**
58
- * The prefix of `pts` revealed at fraction `p ∈ [0, 1]`, measuring the reveal
59
- * by *cumulative arc length* so the line traces at a steady pace regardless of
60
- * uneven point spacing. Returns the whole-point prefix plus one interpolated
61
- * point partway along the active segment.
17
+ * Reveal of the line in `[0, 1]`: 0 hides it, 1 traces it fully from its left
18
+ * end to its right. Defaults to 1, so the paused editor canvas paints the line;
19
+ * `enter` drives it from 0 regardless of where it rests.
62
20
  */
63
- private tracePoints;
21
+ readonly progress: 1;
22
+ /** Whether this line is drawn at all: the switch the chart flips alongside its legend's per-series toggle. */
23
+ readonly enabled: true;
24
+ /** A slice of the plot to spotlight, in this node's own pixel space: outside it the line drops to `dimOpacity`. */
25
+ readonly spotlight: import("@motionscript/sdk").Type<RegionBox, RegionBox, false>;
26
+ /** Opacity the out-of-region stretches fade to. */
27
+ readonly dimOpacity: 0.2;
28
+ }>, {
29
+ readonly enter: {
30
+ readonly from: import("@motionscript/sdk").Type<number, number, false>;
31
+ readonly to: import("@motionscript/sdk").Type<number, number, false>;
32
+ };
33
+ }, null, _Node2D<import("@motionscript/core").Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
34
+ /** The series polyline, already mapped into this node's local pixel space (origin at centre, y-up) by the parent {@link LineChart}. Ordered along x. */
35
+ readonly points: import("@motionscript/sdk").Type<Vector2[], Vector2[], false>;
36
+ /** Line colour + weight (+ optional dash/cap/join) — the per-series stroke. */
37
+ readonly stroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
64
38
  /**
65
- * Trace the line in from its left end to its right over `duration` seconds.
66
- * Drives `progress` `0 → 1`.
67
- *
68
- * A `Command` rather than a generator, so the trace can be *evaluated* at a
69
- * time instead of run to one — which is what lets a scene containing this
70
- * chart be scrubbed in constant time. It no longer needs to prime `progress`
71
- * to 0 first: the value at `t` is a function of `t`, so a repeat call re-traces
72
- * by definition rather than by having reset something.
39
+ * Reveal of the line in `[0, 1]`: 0 hides it, 1 traces it fully from its left
40
+ * end to its right. Defaults to 1, so the paused editor canvas paints the line;
41
+ * `enter` drives it from 0 regardless of where it rests.
73
42
  */
74
- enter(args: CommandArgs<Record<string, never>> & {
75
- duration: number;
76
- }): Command<ChartLineProps>;
43
+ readonly progress: 1;
44
+ /** Whether this line is drawn at all: the switch the chart flips alongside its legend's per-series toggle. */
45
+ readonly enabled: true;
46
+ /** A slice of the plot to spotlight, in this node's own pixel space: outside it the line drops to `dimOpacity`. */
47
+ readonly spotlight: import("@motionscript/sdk").Type<RegionBox, RegionBox, false>;
48
+ /** Opacity the out-of-region stretches fade to. */
49
+ readonly dimOpacity: 0.2;
50
+ }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
51
+ /** The series polyline, already mapped into this node's local pixel space (origin at centre, y-up) by the parent {@link LineChart}. Ordered along x. */
52
+ readonly points: import("@motionscript/sdk").Type<Vector2[], Vector2[], false>;
53
+ /** Line colour + weight (+ optional dash/cap/join) — the per-series stroke. */
54
+ readonly stroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
77
55
  /**
78
- * The trace, with both ends stated: `progress` runs `from` → `to`.
79
- *
80
- * What {@link LineChart.showSeries} and `hideSeries` are both made of — they
81
- * are the same motion in opposite directions, and expressing them as one thing
82
- * with endpoints is what stops the pair drifting apart.
83
- *
84
- * `enabled` rides along in the same value rather than being set before or after
85
- * the command. A line is drawable for every `t` the trace covers and undrawn
86
- * outside it, which is what makes arriving at a time backwards show what
87
- * arriving forwards does — a flag flipped by a side effect would not.
56
+ * Reveal of the line in `[0, 1]`: 0 hides it, 1 traces it fully from its left
57
+ * end to its right. Defaults to 1, so the paused editor canvas paints the line;
58
+ * `enter` drives it from 0 regardless of where it rests.
88
59
  */
89
- enterFrom(from: number, duration: number, easing?: EasingFunction, to?: number): Command<ChartLineProps>;
90
- }
60
+ readonly progress: 1;
61
+ /** Whether this line is drawn at all: the switch the chart flips alongside its legend's per-series toggle. */
62
+ readonly enabled: true;
63
+ /** A slice of the plot to spotlight, in this node's own pixel space: outside it the line drops to `dimOpacity`. */
64
+ readonly spotlight: import("@motionscript/sdk").Type<RegionBox, RegionBox, false>;
65
+ /** Opacity the out-of-region stretches fade to. */
66
+ readonly dimOpacity: 0.2;
67
+ }>, {
68
+ readonly enter: {
69
+ readonly from: import("@motionscript/sdk").Type<number, number, false>;
70
+ readonly to: import("@motionscript/sdk").Type<number, number, false>;
71
+ };
72
+ }, _Node2D<import("@motionscript/core").Node2DProps>>>>;
73
+ export type ChartLine = NodeOf<typeof ChartLine>;
91
74
  //# sourceMappingURL=chart-line.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-line.d.ts","sourceRoot":"","sources":["../../src/line-chart/chart-line.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EAEf,MAAM,EAKN,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB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