@motionscript/charts 0.1.0 → 0.1.1-alpha.0

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 (145) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/bar-chart/bar-chart.d.ts +22 -93
  3. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  4. package/dist/bar-chart/bar-chart.js +48 -121
  5. package/dist/bar-chart/bar-chart.js.map +1 -1
  6. package/dist/bar-chart/category-axis.d.ts +11 -38
  7. package/dist/bar-chart/category-axis.d.ts.map +1 -1
  8. package/dist/bar-chart/category-axis.js +15 -38
  9. package/dist/bar-chart/category-axis.js.map +1 -1
  10. package/dist/bar-chart/chart-bars.d.ts +43 -74
  11. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  12. package/dist/bar-chart/chart-bars.js +31 -59
  13. package/dist/bar-chart/chart-bars.js.map +1 -1
  14. package/dist/bar-chart/index.d.ts +2 -10
  15. package/dist/bar-chart/index.d.ts.map +1 -1
  16. package/dist/bar-chart/index.js +0 -7
  17. package/dist/bar-chart/index.js.map +1 -1
  18. package/dist/bar-chart/shared.d.ts +27 -90
  19. package/dist/bar-chart/shared.d.ts.map +1 -1
  20. package/dist/bar-chart/shared.js +15 -54
  21. package/dist/bar-chart/shared.js.map +1 -1
  22. package/dist/browser/chunks/chunk-4SMRCU24.js +2 -0
  23. package/dist/browser/chunks/chunk-4SMRCU24.js.map +7 -0
  24. package/dist/browser/index.js +1 -1
  25. package/dist/browser/index.js.map +3 -3
  26. package/dist/browser/kit.js +1 -1
  27. package/dist/browser/manifest.json +1 -1
  28. package/dist/engine.d.ts +4 -16
  29. package/dist/engine.d.ts.map +1 -1
  30. package/dist/engine.js +4 -16
  31. package/dist/engine.js.map +1 -1
  32. package/dist/kit/cartesian.d.ts +8 -28
  33. package/dist/kit/cartesian.d.ts.map +1 -1
  34. package/dist/kit/cartesian.js +7 -19
  35. package/dist/kit/cartesian.js.map +1 -1
  36. package/dist/kit/chart-border.d.ts +9 -18
  37. package/dist/kit/chart-border.d.ts.map +1 -1
  38. package/dist/kit/chart-border.js +4 -9
  39. package/dist/kit/chart-border.js.map +1 -1
  40. package/dist/kit/chart-canvas.d.ts +25 -36
  41. package/dist/kit/chart-canvas.d.ts.map +1 -1
  42. package/dist/kit/chart-canvas.js +13 -13
  43. package/dist/kit/chart-canvas.js.map +1 -1
  44. package/dist/kit/chart-legend.d.ts +14 -61
  45. package/dist/kit/chart-legend.d.ts.map +1 -1
  46. package/dist/kit/chart-legend.js +17 -65
  47. package/dist/kit/chart-legend.js.map +1 -1
  48. package/dist/kit/entries.d.ts +2 -0
  49. package/dist/kit/entries.d.ts.map +1 -1
  50. package/dist/kit/entries.js +2 -0
  51. package/dist/kit/entries.js.map +1 -1
  52. package/dist/kit/motion.d.ts +11 -3
  53. package/dist/kit/motion.d.ts.map +1 -1
  54. package/dist/kit/motion.js +7 -1
  55. package/dist/kit/motion.js.map +1 -1
  56. package/dist/kit/shared.d.ts +60 -175
  57. package/dist/kit/shared.d.ts.map +1 -1
  58. package/dist/kit/shared.js +40 -157
  59. package/dist/kit/shared.js.map +1 -1
  60. package/dist/kit/vertical-axis.d.ts +16 -45
  61. package/dist/kit/vertical-axis.d.ts.map +1 -1
  62. package/dist/kit/vertical-axis.js +17 -42
  63. package/dist/kit/vertical-axis.js.map +1 -1
  64. package/dist/line-chart/chart-line.d.ts +16 -41
  65. package/dist/line-chart/chart-line.d.ts.map +1 -1
  66. package/dist/line-chart/chart-line.js +14 -43
  67. package/dist/line-chart/chart-line.js.map +1 -1
  68. package/dist/line-chart/chart-region.d.ts +14 -27
  69. package/dist/line-chart/chart-region.d.ts.map +1 -1
  70. package/dist/line-chart/chart-region.js +8 -22
  71. package/dist/line-chart/chart-region.js.map +1 -1
  72. package/dist/line-chart/horizontal-axis.d.ts +16 -43
  73. package/dist/line-chart/horizontal-axis.d.ts.map +1 -1
  74. package/dist/line-chart/horizontal-axis.js +13 -42
  75. package/dist/line-chart/horizontal-axis.js.map +1 -1
  76. package/dist/line-chart/index.d.ts +1 -13
  77. package/dist/line-chart/index.d.ts.map +1 -1
  78. package/dist/line-chart/index.js +0 -12
  79. package/dist/line-chart/index.js.map +1 -1
  80. package/dist/line-chart/line-chart.d.ts +23 -109
  81. package/dist/line-chart/line-chart.d.ts.map +1 -1
  82. package/dist/line-chart/line-chart.js +45 -141
  83. package/dist/line-chart/line-chart.js.map +1 -1
  84. package/dist/line-chart/shared.d.ts +33 -107
  85. package/dist/line-chart/shared.d.ts.map +1 -1
  86. package/dist/line-chart/shared.js +28 -81
  87. package/dist/line-chart/shared.js.map +1 -1
  88. package/dist/line-chart/x-scale.d.ts +14 -55
  89. package/dist/line-chart/x-scale.d.ts.map +1 -1
  90. package/dist/line-chart/x-scale.js +29 -111
  91. package/dist/line-chart/x-scale.js.map +1 -1
  92. package/dist/nodes.d.ts +0 -12
  93. package/dist/nodes.d.ts.map +1 -1
  94. package/dist/nodes.js +0 -12
  95. package/dist/nodes.js.map +1 -1
  96. package/dist/pie-chart/index.d.ts +1 -12
  97. package/dist/pie-chart/index.d.ts.map +1 -1
  98. package/dist/pie-chart/index.js +0 -9
  99. package/dist/pie-chart/index.js.map +1 -1
  100. package/dist/pie-chart/pie-chart.d.ts +37 -71
  101. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  102. package/dist/pie-chart/pie-chart.js +31 -65
  103. package/dist/pie-chart/pie-chart.js.map +1 -1
  104. package/dist/pie-chart/pie-legend.d.ts +11 -26
  105. package/dist/pie-chart/pie-legend.d.ts.map +1 -1
  106. package/dist/pie-chart/pie-legend.js +14 -39
  107. package/dist/pie-chart/pie-legend.js.map +1 -1
  108. package/dist/pie-chart/pie-ring.d.ts +50 -192
  109. package/dist/pie-chart/pie-ring.d.ts.map +1 -1
  110. package/dist/pie-chart/pie-ring.js +75 -247
  111. package/dist/pie-chart/pie-ring.js.map +1 -1
  112. package/dist/pie-chart/shared.d.ts +45 -131
  113. package/dist/pie-chart/shared.d.ts.map +1 -1
  114. package/dist/pie-chart/shared.js +29 -72
  115. package/dist/pie-chart/shared.js.map +1 -1
  116. package/package.json +4 -4
  117. package/src/bar-chart/bar-chart.ts +51 -165
  118. package/src/bar-chart/category-axis.ts +16 -57
  119. package/src/bar-chart/chart-bars.ts +43 -120
  120. package/src/bar-chart/index.ts +2 -10
  121. package/src/bar-chart/shared.ts +29 -97
  122. package/src/engine.ts +4 -16
  123. package/src/kit/cartesian.ts +11 -26
  124. package/src/kit/chart-border.ts +6 -20
  125. package/src/kit/chart-canvas.ts +15 -40
  126. package/src/kit/chart-legend.ts +17 -86
  127. package/src/kit/entries.ts +4 -1
  128. package/src/kit/motion.ts +11 -2
  129. package/src/kit/shared.ts +58 -219
  130. package/src/kit/vertical-axis.ts +18 -71
  131. package/src/line-chart/chart-line.ts +16 -44
  132. package/src/line-chart/chart-region.ts +10 -23
  133. package/src/line-chart/horizontal-axis.ts +13 -42
  134. package/src/line-chart/index.ts +1 -13
  135. package/src/line-chart/line-chart.ts +50 -184
  136. package/src/line-chart/shared.ts +51 -145
  137. package/src/line-chart/x-scale.ts +31 -121
  138. package/src/nodes.ts +0 -12
  139. package/src/pie-chart/index.ts +1 -12
  140. package/src/pie-chart/pie-chart.ts +34 -102
  141. package/src/pie-chart/pie-legend.ts +14 -55
  142. package/src/pie-chart/pie-ring.ts +80 -307
  143. package/src/pie-chart/shared.ts +50 -139
  144. package/dist/browser/chunks/chunk-TJNHLQGV.js +0 -2
  145. package/dist/browser/chunks/chunk-TJNHLQGV.js.map +0 -7
@@ -1,24 +1,13 @@
1
- import { Flow, Paint, Rect, Shapes, Text, Types, component2d, textOps, } from "@motionscript/sdk";
1
+ import { Flow, Paint, Rect, Shapes, Text, Types, clamp, component2d, textOps, } from "@motionscript/sdk";
2
2
  import { fresh } from "../kit/entries.js";
3
3
  import { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase } from "../kit/motion.js";
4
- import { DEFAULT_LEGEND, clampUnit, } from "../kit/shared.js";
5
- /** How far an entry starts to the right of its slot when it enters, in px. */
4
+ import { DEFAULT_LEGEND } from "../kit/shared.js";
6
5
  const SLIDE = 16;
7
6
  /**
8
- * The legend of a {@link PieChart}: a **vertical-flow column** of entries, one per
9
- * slice, each pairing the slice's caption with its colour swatch.
10
- *
11
- * A column rather than the cartesian charts' row, because it sits *beside* the
12
- * ring rather than beneath the plot — a pie is as tall as it is wide, so the
13
- * space it leaves over is a vertical strip. It is otherwise the same entry: the
14
- * swatch carries the colour, the caption reads in the legend's neutral ink, and
15
- * both take the shared {@link LegendConfig}.
16
- *
17
- * There is no show/hide here. A pie's marks are its *rows*, and a row that
18
- * shouldn't be in the chart shouldn't be in the table — removing one would
19
- * silently re-cut every other wedge's share, which is a different chart rather
20
- * than the same chart with something hidden. Selection is what a pie has
21
- * instead, and it arrives through {@link PieLegendProps.dims}.
7
+ * The legend of a {@link PieChart}: a column (it sits beside the ring, in the
8
+ * vertical strip it leaves) of caption-and-swatch entries, one per slice. No
9
+ * show/hide: removing a row would re-cut every other wedge's share. Selection
10
+ * arrives through `dims`.
22
11
  */
23
12
  export const PieLegend = component2d({
24
13
  key: "pieLegend",
@@ -26,13 +15,14 @@ export const PieLegend = component2d({
26
15
  ...Paint.state,
27
16
  ...Flow.state,
28
17
  ...Shapes.corners,
18
+ /** One entry per slice, in ring order. */
29
19
  slices: fresh(() => []),
30
20
  legend: Types.custom(DEFAULT_LEGEND),
21
+ /** Per-slice opacity multiplier, the signal that dims the ring, so an entry fades in step with its wedge. Missing reads as 1. */
31
22
  dims: fresh(() => []),
32
23
  arrivals: arrivalsEntry(),
33
24
  },
34
- // A column, for the reason `ChartLegend` gives for its row: a `Rect` given no
35
- // flow lays its children out `freeform`, every caption on top of the last.
25
+ // The flow must be stated: a `Rect` with none lays children out `freeform`, every caption on top of the last.
36
26
  defaults: {
37
27
  flow: "vertical",
38
28
  align: "centerLeft",
@@ -41,17 +31,14 @@ export const PieLegend = component2d({
41
31
  gap: (state) => state.legend.itemGap / 3,
42
32
  padding: (state) => state.legend.padding,
43
33
  },
44
- // One entry per slice, ordered top → bottom. The selection dim rides a wrapper
45
- // rather than the entry itself, so the entrance can animate the entry's own
46
- // opacity without the two fighting over one value — opacity multiplies down
47
- // the tree, which is exactly the composition wanted here.
34
+ // The selection dim rides a wrapper, so the entrance animates the entry's own opacity without the two fighting over one value.
48
35
  children: (state) => {
49
36
  const marker = state.legend.markerStyle;
50
37
  return state.slices.map((_, index) => Rect({
51
38
  width: "hug",
52
39
  height: "hug",
53
40
  flow: "freeform",
54
- opacity: () => clampUnit(state.dims[index] ?? 1),
41
+ opacity: () => clamp(state.dims[index] ?? 1, 0, 1),
55
42
  children: [
56
43
  Rect({
57
44
  flow: "horizontal",
@@ -81,28 +68,16 @@ export const PieLegend = component2d({
81
68
  },
82
69
  commands: {
83
70
  ...Paint.commands,
84
- /**
85
- * Every entry at its pre-entrance state, shifted right and transparent: what
86
- * a chart shows ahead of this legend's own beat in its entrance, since
87
- * `enter` arms the entries only on its first frame.
88
- */
71
+ /** Every entry shifted right and transparent: what a chart shows ahead of this legend's beat, since `enter` arms only on its first frame. */
89
72
  arm: (timeline, state) => timeline.animate(() => ({ arrivals: armed([...state.slices.keys()], { opacity: 0, shift: SLIDE }) })),
90
- /**
91
- * Slide + fade every entry in from the right, staggered top-to-bottom. Its
92
- * first frame arms them all: shifted right and transparent.
93
- *
94
- * The timeline's duration is the **whole** entrance: the stagger is carved
95
- * out of it rather than added on top, so the command takes exactly the time
96
- * the timeline laid out for it.
97
- */
73
+ /** Slide and fade entries in from the right, top to bottom. The duration is the whole entrance, the stagger carved out of it. */
98
74
  enter: (timeline, state) => {
99
75
  const count = state.slices.length;
100
76
  if (count === 0)
101
77
  return timeline.wait(timeline.duration);
102
78
  const from = { opacity: 0, shift: SLIDE };
103
79
  const arm = timeline.animate(() => ({ arrivals: armed([...state.slices.keys()], from) }));
104
- // Each gap is a fifth of an entry's own move, the rhythm the axes use;
105
- // solved for from the budget rather than added to it.
80
+ // Each gap is a fifth of an entry's move, the axes' rhythm, solved from the budget.
106
81
  const per = timeline.duration / (1 + Math.max(0, count - 1) / 5);
107
82
  const step = per / 5;
108
83
  const ease = frameEase(timeline);
@@ -1 +1 @@
1
- {"version":3,"file":"pie-legend.js","sourceRoot":"","sources":["../../src/pie-chart/pie-legend.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,WAAW,EACX,OAAO,GAqBR,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAgB,MAAM,eAAe,CAAA;AACxG,OAAO,EACL,cAAc,EACd,SAAS,GAEV,MAAM,eAAe,CAAA;AAetB,8EAA8E;AAC9E,MAAM,KAAK,GAAG,EAAE,CAAA;AAEhB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;IACnC,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE;QACL,GAAG,KAAK,CAAC,KAAK;QACd,GAAG,IAAI,CAAC,KAAK;QACb,GAAG,MAAM,CAAC,OAAO;QACjB,MAAM,EAAE,KAAK,CAAa,GAAG,EAAE,CAAC,EAAE,CAAC;QACnC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAe,cAAc,CAAC;QAClD,IAAI,EAAE,KAAK,CAAW,GAAG,EAAE,CAAC,EAAE,CAAC;QAC/B,QAAQ,EAAE,aAAa,EAAE;KAC1B;IACD,8EAA8E;IAC9E,2EAA2E;IAC3E,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,CAAC,KAAK,EA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textOps,\n type NodeOf,\n type RectProps,\n // Named so the column's emitted type reaches the Rect surface it spreads through the sdk, not core.\n type Alignment as _Alignment,\n type CornerRadiusResolved as _CornerRadiusResolved,\n type CornerStyleResolved as _CornerStyleResolved,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type RectCornerRadius as _RectCornerRadius,\n type RectCornerStyle as _RectCornerStyle,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n type Vector2 as _Vector2,\n} from \"@motionscript/sdk\"\n\nimport { fresh } from \"../kit/entries\"\nimport { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase, type Arrival } from \"../kit/motion\"\nimport {\n DEFAULT_LEGEND,\n clampUnit,\n type LegendConfig,\n} from \"../kit/shared\"\nimport type { PieSlice } from \"./shared\"\n\nexport interface PieLegendProps extends RectProps {\n /** One entry per slice, in ring order. */\n slices: PieSlice[]\n /** Padding, caption style, gaps, and swatch geometry — see {@link LegendConfig}. */\n legend: LegendConfig\n /**\n * Per-slice opacity multiplier, by index — the same signal that dims the ring,\n * so an entry fades in step with the wedge it names. Missing entries read as 1.\n */\n dims: number[]\n}\n\n/** How far an entry starts to the right of its slot when it enters, in px. */\nconst SLIDE = 16\n\n/**\n * The legend of a {@link PieChart}: a **vertical-flow column** of entries, one per\n * slice, each pairing the slice's caption with its colour swatch.\n *\n * A column rather than the cartesian charts' row, because it sits *beside* the\n * ring rather than beneath the plot — a pie is as tall as it is wide, so the\n * space it leaves over is a vertical strip. It is otherwise the same entry: the\n * swatch carries the colour, the caption reads in the legend's neutral ink, and\n * both take the shared {@link LegendConfig}.\n *\n * There is no show/hide here. A pie's marks are its *rows*, and a row that\n * shouldn't be in the chart shouldn't be in the table — removing one would\n * silently re-cut every other wedge's share, which is a different chart rather\n * than the same chart with something hidden. Selection is what a pie has\n * instead, and it arrives through {@link PieLegendProps.dims}.\n */\nexport const PieLegend = component2d({\n key: \"pieLegend\",\n state: {\n ...Paint.state,\n ...Flow.state,\n ...Shapes.corners,\n slices: fresh<PieSlice[]>(() => []),\n legend: Types.custom<LegendConfig>(DEFAULT_LEGEND),\n dims: fresh<number[]>(() => []),\n arrivals: arrivalsEntry(),\n },\n // A column, for the reason `ChartLegend` gives for its row: a `Rect` given no\n // flow lays its children out `freeform`, every caption on top of the last.\n defaults: {\n flow: \"vertical\",\n align: \"centerLeft\",\n width: \"hug\",\n height: \"hug\",\n gap: (state) => state.legend.itemGap / 3,\n padding: (state) => state.legend.padding,\n },\n // One entry per slice, ordered top → bottom. The selection dim rides a wrapper\n // rather than the entry itself, so the entrance can animate the entry's own\n // opacity without the two fighting over one value — opacity multiplies down\n // the tree, which is exactly the composition wanted here.\n children: (state) => {\n const marker = state.legend.markerStyle\n return state.slices.map((_, index) =>\n Rect({\n width: \"hug\",\n height: \"hug\",\n flow: \"freeform\",\n opacity: () => clampUnit(state.dims[index] ?? 1),\n children: [\n Rect({\n flow: \"horizontal\",\n gap: 12,\n align: \"center\",\n width: \"hug\",\n height: \"hug\",\n opacity: () => arrivalOf(state.arrivals, index).opacity,\n x: () => arrivalOf(state.arrivals, index).shift,\n children: [\n Rect({\n width: marker.height,\n height: marker.height,\n cornerRadius: marker.borderRadius,\n fill: () => state.slices[index]?.fill ?? \"white\",\n stroke: marker.stroke,\n shadow: marker.shadow,\n }),\n Text({\n ...textOps.styleProps(state.legend.textStyle),\n text: () => state.slices[index]?.category ?? \"\",\n }),\n ],\n }),\n ],\n })\n )\n },\n commands: {\n ...Paint.commands,\n /**\n * Every entry at its pre-entrance state, shifted right and transparent: what\n * a chart shows ahead of this legend's own beat in its entrance, since\n * `enter` arms the entries only on its first frame.\n */\n arm: (timeline, state) =>\n timeline.animate(() => ({ arrivals: armed([...state.slices.keys()], { opacity: 0, shift: SLIDE }) })),\n /**\n * Slide + fade every entry in from the right, staggered top-to-bottom. Its\n * first frame arms them all: shifted right and transparent.\n *\n * The timeline's duration is the **whole** entrance: the stagger is carved\n * out of it rather than added on top, so the command takes exactly the time\n * the timeline laid out for it.\n */\n enter: (timeline, state) => {\n const count = state.slices.length\n if (count === 0) return timeline.wait(timeline.duration)\n const from: Arrival = { opacity: 0, shift: SLIDE }\n const arm = timeline.animate(() => ({ arrivals: armed([...state.slices.keys()], from) }))\n // Each gap is a fifth of an entry's own move, the rhythm the axes use;\n // solved for from the budget rather than added to it.\n const per = timeline.duration / (1 + Math.max(0, count - 1) / 5)\n const step = per / 5\n const ease = frameEase(timeline)\n const entries = state.slices.map((_, i) => ({ at: i * step, duration: per, piece: arrival(timeline, i, from, ease) }))\n return timeline.together([arm, beats(timeline, entries)])\n },\n },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.rect(ctx.size, state)),\n})\n\nexport type PieLegend = NodeOf<typeof PieLegend>\n"]}
1
+ {"version":3,"file":"pie-legend.js","sourceRoot":"","sources":["../../src/pie-chart/pie-legend.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,GAoBR,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAgB,MAAM,eAAe,CAAA;AACxG,OAAO,EAAE,cAAc,EAAqB,MAAM,eAAe,CAAA;AAGjE,MAAM,KAAK,GAAG,EAAE,CAAA;AAEhB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;IACnC,GAAG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EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnG,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvF,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;CAC7E,CAAC,CAAA","sourcesContent":["import {\n Flow,\n Paint,\n Rect,\n Shapes,\n Text,\n Types,\n clamp,\n component2d,\n textOps,\n type NodeOf,\n // Named so the column's emitted type reaches the Rect surface it spreads through the sdk, not core.\n type Alignment as _Alignment,\n type CornerRadiusResolved as _CornerRadiusResolved,\n type CornerStyleResolved as _CornerStyleResolved,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type RectCornerRadius as _RectCornerRadius,\n type RectCornerStyle as _RectCornerStyle,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n type Vector2 as _Vector2,\n} from \"@motionscript/sdk\"\n\nimport { fresh } from \"../kit/entries\"\nimport { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase, type Arrival } from \"../kit/motion\"\nimport { DEFAULT_LEGEND, type LegendConfig } from \"../kit/shared\"\nimport type { PieSlice } from \"./shared\"\n\nconst SLIDE = 16\n\n/**\n * The legend of a {@link PieChart}: a column (it sits beside the ring, in the\n * vertical strip it leaves) of caption-and-swatch entries, one per slice. No\n * show/hide: removing a row would re-cut every other wedge's share. Selection\n * arrives through `dims`.\n */\nexport const PieLegend = component2d({\n key: \"pieLegend\",\n state: {\n ...Paint.state,\n ...Flow.state,\n ...Shapes.corners,\n /** One entry per slice, in ring order. */\n slices: fresh<PieSlice[]>(() => []),\n legend: Types.custom<LegendConfig>(DEFAULT_LEGEND),\n /** Per-slice opacity multiplier, the signal that dims the ring, so an entry fades in step with its wedge. Missing reads as 1. */\n dims: fresh<number[]>(() => []),\n arrivals: arrivalsEntry(),\n },\n // The flow must be stated: a `Rect` with none lays children out `freeform`, every caption on top of the last.\n defaults: {\n flow: \"vertical\",\n align: \"centerLeft\",\n width: \"hug\",\n height: \"hug\",\n gap: (state) => state.legend.itemGap / 3,\n padding: (state) => state.legend.padding,\n },\n // The selection dim rides a wrapper, so the entrance animates the entry's own opacity without the two fighting over one value.\n children: (state) => {\n const marker = state.legend.markerStyle\n return state.slices.map((_, index) =>\n Rect({\n width: \"hug\",\n height: \"hug\",\n flow: \"freeform\",\n opacity: () => clamp(state.dims[index] ?? 1, 0, 1),\n children: [\n Rect({\n flow: \"horizontal\",\n gap: 12,\n align: \"center\",\n width: \"hug\",\n height: \"hug\",\n opacity: () => arrivalOf(state.arrivals, index).opacity,\n x: () => arrivalOf(state.arrivals, index).shift,\n children: [\n Rect({\n width: marker.height,\n height: marker.height,\n cornerRadius: marker.borderRadius,\n fill: () => state.slices[index]?.fill ?? \"white\",\n stroke: marker.stroke,\n shadow: marker.shadow,\n }),\n Text({\n ...textOps.styleProps(state.legend.textStyle),\n text: () => state.slices[index]?.category ?? \"\",\n }),\n ],\n }),\n ],\n })\n )\n },\n commands: {\n ...Paint.commands,\n /** Every entry shifted right and transparent: what a chart shows ahead of this legend's beat, since `enter` arms only on its first frame. */\n arm: (timeline, state) =>\n timeline.animate(() => ({ arrivals: armed([...state.slices.keys()], { opacity: 0, shift: SLIDE }) })),\n /** Slide and fade entries in from the right, top to bottom. The duration is the whole entrance, the stagger carved out of it. */\n enter: (timeline, state) => {\n const count = state.slices.length\n if (count === 0) return timeline.wait(timeline.duration)\n const from: Arrival = { opacity: 0, shift: SLIDE }\n const arm = timeline.animate(() => ({ arrivals: armed([...state.slices.keys()], from) }))\n // Each gap is a fifth of an entry's move, the axes' rhythm, solved from the budget.\n const per = timeline.duration / (1 + Math.max(0, count - 1) / 5)\n const step = per / 5\n const ease = frameEase(timeline)\n const entries = state.slices.map((_, i) => ({ at: i * step, duration: per, piece: arrival(timeline, i, from, ease) }))\n return timeline.together([arm, beats(timeline, entries)])\n },\n },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.rect(ctx.size, state)),\n})\n\nexport type PieLegend = NodeOf<typeof PieLegend>\n"]}
@@ -1,69 +1,14 @@
1
- import { type FillResolved, type NodeOf, type Node2D, type Node2DProps, type Vector2 } from "@motionscript/sdk";
1
+ import { type FillResolved, type NodeOf, type Node2D, type Node2DProps as _Node2DProps, type Vector2 } from "@motionscript/sdk";
2
2
  import { type CenterConfig, type LabelConfig, type PieArc, type PieLabelMode, type PieLabelPlacement, type PieSlice, type RingConfig } from "./shared.js";
3
- export interface PieRingProps extends Node2DProps {
4
- /** One entry per slice: its `category`, `value` and `fill`. */
5
- slices: PieSlice[];
6
- /** Ring geometry and paint — gap, hole, start angle, selection growth. */
7
- ring: RingConfig;
8
- /** How the labels are set, and the leader lines that point at them. */
9
- label: LabelConfig;
10
- /**
11
- * How the hole's summary is set.
12
- *
13
- * Named `centerStyle` rather than `center` because every node already has a
14
- * `center` — the anchor its position is measured from.
15
- */
16
- centerStyle: CenterConfig;
17
- /** What the labels say, or `"none"` to drop them entirely. */
18
- labelMode: PieLabelMode;
19
- /** Where the labels sit: inside their wedge, outside on a leader, or nowhere. */
20
- labelPlacement: PieLabelPlacement;
21
- /**
22
- * Sweep of the ring in `[0, 1]`: 0 draws nothing, 1 the full circle. The
23
- * wedges grow around clockwise from the ring's `startAngle` as this rises.
24
- */
25
- growth: number;
26
- /**
27
- * Fade of the leader lines and labels in `[0, 1]`, held separate from
28
- * {@link growth} so they arrive *after* the ring has swept in.
29
- */
30
- labelReveal: number;
31
- /**
32
- * How far each slice is currently pushed out of the ring, `0`–`1` per index.
33
- * Owned by the chart, so the ring and the legend read one signal.
34
- */
35
- pops: number[];
36
- /** Opacity everything *unselected* falls back to while any slice is selected. */
37
- dimOpacity: number;
38
- /**
39
- * Text set in the middle of the ring's hole — the largest uninterrupted area
40
- * the chart owns, and on a donut otherwise empty. A one-line summary there
41
- * routinely does more work than the whole ring around it. Empty (the default)
42
- * leaves the hole clear; ignored when there is no hole.
43
- */
44
- centerLabel: string;
45
- /** Smaller second line under {@link centerLabel}. Empty (the default) drops it. */
46
- centerCaption: string;
47
- /**
48
- * Fade of the hole's summary in `[0, 1]`. Its own signal, untouched by the
49
- * ring's entrance — a hole label is usually a *conclusion*, so a scene that
50
- * wants it to land on a later beat sets this to 0 and calls
51
- * `PieChart.revealCenter` when it gets there.
52
- */
53
- centerReveal: number;
54
- }
55
- /** Where one slice's label sits and the polyline that points at it. */
56
3
  interface LabelPlacement {
57
- /** Index of the slice. */
58
4
  index: number;
59
- /** Which side of the ring the label sits on: +1 right, −1 left. */
5
+ /** +1 right, -1 left. */
60
6
  side: 1 | -1;
61
- /** Leader polyline: wedge edge → elbow → label. */
7
+ /** Wedge edge, elbow, label. */
62
8
  leader: Vector2[];
63
- /** Point the label's inner edge is pinned to. */
9
+ /** Where the label's inner edge is pinned. */
64
10
  text: Vector2;
65
11
  }
66
- /** What the ring's geometry reads off its entries. */
67
12
  interface RingState {
68
13
  readonly slices: PieSlice[];
69
14
  readonly ring: RingConfig;
@@ -76,12 +21,7 @@ interface RingState {
76
21
  readonly centerLabel: string;
77
22
  readonly centerCaption: string;
78
23
  }
79
- /**
80
- * The ring's geometry for one box: every radius, gutter and label position,
81
- * derived from the entries and the size the ring was laid out at, and asked
82
- * afresh wherever it is read — the drawing, and the labels' bound positions
83
- * and sizes alike, so the two cannot disagree.
84
- */
24
+ /** Every radius, gutter and label position for one box, derived afresh wherever read so the drawing and the labels' bound positions cannot disagree. */
85
25
  export declare class RingGeometry {
86
26
  private readonly s;
87
27
  private readonly box;
@@ -89,164 +29,64 @@ export declare class RingGeometry {
89
29
  readonly width: number;
90
30
  readonly height: number;
91
31
  });
92
- /** The drawn slices' angular spans, re-read every frame so a value tween re-cuts them. */
32
+ /** Re-read every frame so a value tween re-cuts them. */
93
33
  get arcs(): PieArc[];
94
- /** Whether any slice is labelled on a leader — the only thing that costs a gutter. */
34
+ /** Leader labels are the only thing that costs a gutter. */
95
35
  get hasLeaderLabels(): boolean;
96
36
  /**
97
- * How wide a horizontal label centred in slice `arc`'s band can run before it
98
- * leaves the wedge, in px.
99
- *
100
- * Two things bound it, and which one binds depends entirely on where the wedge
101
- * sits. Stepping sideways from the label's centre moves you *radially* by
102
- * `dx·sin(mid)` and *tangentially* by `dx·cos(mid)`, so a wedge at 3 o'clock is
103
- * limited by the band's thickness (its label runs straight across the band)
104
- * while a wedge at 12 o'clock is limited by its own arc (its label runs along
105
- * the band, which is much roomier). Taking the smaller of the two is what stops
106
- * a label overflowing the ring on one chart and being pointlessly shrunk on the
107
- * next.
108
- *
109
- * Measured off the *unpopped* radius, so a slice growing out of the ring
110
- * doesn't resize its own text mid-animation.
37
+ * Px a horizontal label centred in `arc`'s band can run before leaving the
38
+ * wedge: bound by the band's thickness near 3 o'clock, by its arc near 12.
39
+ * Measured off the unpopped radius, so a slice growing out of the ring does not
40
+ * resize its own text mid-animation.
111
41
  */
112
42
  insideRoom(arc: PieArc): number;
113
43
  /** Widest line, in glyphs at the leading line's size, an inside label runs to. */
114
44
  insideGlyphs(arc: PieArc): number;
115
- /**
116
- * Font size of an inside label's leading line: what the theme asked for,
117
- * shrunk if that wouldn't fit inside its wedge. **One size across every inside
118
- * label** — the smallest any of them needs — because labels at mismatched
119
- * sizes read as a mistake rather than as emphasis.
120
- *
121
- * So the theme's `insideStyle.fontSize` is an upper bound, not a promise: ask
122
- * for the size the chart wants and the ring keeps it legal.
123
- */
45
+ /** The theme's `insideStyle.fontSize` shrunk to fit, an upper bound. One size across every inside label (the smallest any needs): mismatched sizes read as a mistake. */
124
46
  get insideFont(): number;
125
- /**
126
- * Font size of the hole's summary: the configured size, capped so it still
127
- * fits across the hole. The cap matters because the hole's radius derives from
128
- * the box, so a chart that reflows smaller would otherwise push its summary out
129
- * through the ring.
130
- */
47
+ /** The configured size capped to fit across the hole, which derives from the box: a smaller reflow would otherwise push the summary through the ring. */
131
48
  get centerFont(): number;
132
- /** Rim radius of a fully selected slice as a multiple of the ring's, clamped sane. */
49
+ /** Rim radius of a fully selected slice as a multiple of the ring's. */
133
50
  get growFactor(): number;
134
- /** How far past the ring's rim a fully selected slice reaches, in px. */
135
51
  get maxPop(): number;
136
- /** Height of one **leader** label block, in px — the unit those columns are spaced by. */
52
+ /** Height of one leader label block, the unit the columns are spaced by. Inside labels cost no vertical reserve. */
137
53
  get labelRowHeight(): number;
138
- /** Widest line, in glyphs, that a leader label for slice `index` can run to. */
54
+ /** Widest line in glyphs a leader label for slice `index` runs to. */
139
55
  captionGlyphs(index: number): number;
140
- /**
141
- * Horizontal room reserved on each side for the leaders and their labels, in
142
- * px — measured **per side**, from the slices that actually leader out that
143
- * way. A ring whose labels are all inside reserves nothing and draws bigger.
144
- *
145
- * Excludes the ring's own selection-growth allowance, which scales with the
146
- * radius and so is divided out in {@link outerRadius} instead.
147
- */
56
+ /** Room reserved per side for leaders and labels, from the slices that leader out that way. Excludes selection growth, which scales with the radius and is divided out in {@link outerRadius}. */
148
57
  get labelGutters(): {
149
58
  left: number;
150
59
  right: number;
151
60
  };
152
- /**
153
- * How far the ring's centre sits from the node's, in px. Zero while the
154
- * gutters match; when the labels all fall one way it slides the ring into the
155
- * empty half so the ring-plus-labels group stays centred in the box instead of
156
- * the ring sitting dead centre with a bald patch beside it.
157
- */
61
+ /** Slides the ring into the empty half when labels all fall one way, keeping the ring-plus-labels group centred. */
158
62
  get centerX(): number;
159
- /**
160
- * Radius of the ring's outer edge, fitted to whatever the label gutters leave.
161
- * A fully selected slice reaches `radius × growFactor`, so the room has to
162
- * cover that — hence the divisor, which keeps even the grown slice inside the
163
- * box (and holds the ring the same size whether or not anything is selected).
164
- */
63
+ /** Fitted to what the gutters leave. The divisor keeps a fully selected slice (`radius * growFactor`) inside the box, and the ring one size whether or not anything is selected. */
165
64
  get outerRadius(): number;
166
- /** Radius of the hole in the middle: a fraction of the outer radius, or explicit px. */
167
65
  get holeRadius(): number;
168
- /** Radius of the circle every leader elbows on, clear of even a popped-out slice. */
66
+ /** The circle every leader elbows on, clear of even a popped-out slice. */
169
67
  get elbowRadius(): number;
170
- /** How far slice `index` is currently pushed out, in `[0, 1]`. */
171
68
  popOf(index: number): number;
172
- /** Radius of slice `index`'s outer edge, its selection growth included. */
173
69
  anchorRadius(index: number): number;
174
- /**
175
- * Radius an inside label sits at on slice `index`: halfway across the band on a
176
- * donut, and further out than halfway on a solid pie, where "halfway" would
177
- * crowd the point every wedge converges on. Rides the slice's own pop, so an
178
- * inside label travels out with the wedge it belongs to.
179
- */
70
+ /** Halfway across the band on a donut, further out on a solid pie, where halfway would crowd the point the wedges converge on. Rides the slice's pop. */
180
71
  bandMidRadius(index: number): number;
181
- /** The point slice `index`'s inside label is centred on. */
182
72
  insideAnchor(index: number): Vector2;
183
- /**
184
- * How selected the ring is overall, in `[0, 1]` — the most-grown slice. Rides
185
- * the same tween the pops do, so the dim below arrives with the growth rather
186
- * than needing an animation of its own.
187
- */
73
+ /** The most-grown slice, so the dim in {@link sliceOpacity} rides the pops' tween. */
188
74
  get selectionStrength(): number;
189
- /**
190
- * Opacity slice `index` (and its leader and label) is drawn at: full while
191
- * nothing is selected, falling toward `dimOpacity` in proportion to how
192
- * selected the *rest* of the ring is. A slice that's selected itself stays at
193
- * full — the two factors cancel.
194
- */
75
+ /** Opacity of slice `index` with its leader and label. */
195
76
  sliceOpacity(index: number): number;
196
- /** Slice `index`'s share of the ring as its label reads it, off the live values. */
197
77
  percentText(index: number): string;
198
- /**
199
- * Where every leader label sits and how its leader gets there. Labels are split
200
- * into a right and a left column by their slice's bisector, each column is
201
- * spread so nothing overlaps (and nothing leaves the box), and each leader is
202
- * then built as wedge edge → elbow → label. The elbow rides the leader circle at
203
- * the label's *settled* y, which keeps the final run horizontal and the whole
204
- * polyline outside the ring however far the label was nudged.
205
- */
78
+ /** Labels split into left and right columns by their slice's bisector, each spread so nothing overlaps or leaves the box, then a leader built to each. */
206
79
  placements(): LabelPlacement[];
207
- /** This frame's placement for slice `index`, or `undefined` if it isn't leadered. */
208
80
  placementFor(index: number): LabelPlacement | undefined;
209
81
  }
210
- /** Each slice's fill, resolved. */
211
82
  export declare function ringFills(slices: readonly PieSlice[]): FillResolved[][];
212
83
  /**
213
- * The ring itself: one wedge per {@link PieSlice}, sized by its share of the
214
- * total, swept clockwise from the theme's `startAngle` with a `gap` of clear
215
- * space between neighbours — a *constant-width* channel, the same at the hole as
216
- * at the rim (see {@link wedgePath}). A **selected** slice reaches further out
217
- * while its hole edge stays put — so it reads as that band swelling out of the
218
- * ring rather than breaking off it — and the rest of the ring dims behind it,
219
- * leaders and labels included.
220
- *
221
- * This is the only part of the chart family that draws a path: the wedges are
222
- * filled {@link PathBuilder} polygons approximating each arc, and the leaders are
223
- * stroked polylines — both in the node's centred, y-up space, so neither depends
224
- * on SVG arc-sweep conventions. The **labels are real {@link Text} nodes**
225
- * (stacked in a hug vertical flow and pinned by their inner edge), so no
226
- * glyph-width guesswork decides where a caption starts.
227
- *
228
- * ### Label placement
229
- * Each label sits either **inside** its wedge or **outside** on a leader.
230
- *
231
- * An inside label is centred on its slice's band and leads with the number, the
232
- * caption set small underneath — inside a wedge the reader already knows which
233
- * slice they're on, so the magnitude is the thing being read. It costs no gutter
234
- * and no eye round-trip, so a ring labelled that way draws considerably bigger in
235
- * the same box.
236
- *
237
- * A leader label sits outside on the end of a polyline that lifts off its wedge,
238
- * elbows, and runs horizontally into the text. Labels are split into a left and a
239
- * right column by which way their slice's bisector points, and each column is
240
- * de-conflicted independently (see {@link relaxLabels}): a label takes the spot
241
- * nearest its wedge that still clears its neighbour, and the column is squeezed
242
- * to fit the node's height rather than spilling out of it. The elbow then rides on
243
- * a circle just outside the ring **at the label's settled y**, so the run into the
244
- * text is always horizontal and a nudged label never drags its leader back across
245
- * the ring.
246
- *
247
- * Only the sides that actually carry a leader reserve a gutter, and the ring's
248
- * centre slides into whatever the other side left over — so a ring whose slices
249
- * all leader one way doesn't leave a bald patch on the other.
84
+ * The ring: one wedge per {@link PieSlice} swept clockwise from `startAngle`,
85
+ * with a constant-width `gap` (see {@link wedgePath}). A selected slice swells
86
+ * out while its hole edge stays put, and the rest dims, leaders and labels
87
+ * included. The only path-drawing part of the chart family; labels are real
88
+ * {@link Text} nodes, so no glyph-width guesswork places a caption. Only the
89
+ * sides that carry a leader reserve a gutter, and the ring slides into the rest.
250
90
  */
251
91
  export declare const PieRing: import("@motionscript/sdk").Component<"pieRing", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
252
92
  readonly slices: import("@motionscript/sdk").Type<PieSlice[], PieSlice[], false>;
@@ -255,30 +95,42 @@ export declare const PieRing: import("@motionscript/sdk").Component<"pieRing", i
255
95
  readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
256
96
  readonly labelMode: import("@motionscript/sdk").Type<PieLabelMode, PieLabelMode, false>;
257
97
  readonly labelPlacement: import("@motionscript/sdk").Type<PieLabelPlacement, PieLabelPlacement, false>;
98
+ /** Sweep `[0, 1]`: the wedges grow clockwise from `startAngle` as it rises. */
258
99
  readonly growth: 1;
100
+ /** Fade of leaders and labels, separate from `growth` so they arrive after the sweep. */
259
101
  readonly labelReveal: 1;
102
+ /** Per-slice pop `[0, 1]`, owned by the chart so the ring and legend read one signal. */
260
103
  readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
104
+ /** Opacity everything unselected falls back to while any slice is selected. */
261
105
  readonly dimOpacity: number;
106
+ /** Empty leaves the hole clear; ignored when there is no hole. */
262
107
  readonly centerLabel: "";
263
108
  readonly centerCaption: "";
109
+ /** The hole's summary fade, untouched by the entrance: a scene that wants the conclusion on a later beat sets 0 and calls `revealCenter`. */
264
110
  readonly centerReveal: 1;
265
111
  }>, {
266
112
  readonly sweep: unknown;
267
113
  readonly revealLabels: unknown;
268
114
  readonly revealCenter: unknown;
269
- }, null, Node2D<Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
115
+ }, null, Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
270
116
  readonly slices: import("@motionscript/sdk").Type<PieSlice[], PieSlice[], false>;
271
117
  readonly ring: import("@motionscript/sdk").Type<RingConfig, RingConfig, false>;
272
118
  readonly label: import("@motionscript/sdk").Type<LabelConfig, LabelConfig, false>;
273
119
  readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
274
120
  readonly labelMode: import("@motionscript/sdk").Type<PieLabelMode, PieLabelMode, false>;
275
121
  readonly labelPlacement: import("@motionscript/sdk").Type<PieLabelPlacement, PieLabelPlacement, false>;
122
+ /** Sweep `[0, 1]`: the wedges grow clockwise from `startAngle` as it rises. */
276
123
  readonly growth: 1;
124
+ /** Fade of leaders and labels, separate from `growth` so they arrive after the sweep. */
277
125
  readonly labelReveal: 1;
126
+ /** Per-slice pop `[0, 1]`, owned by the chart so the ring and legend read one signal. */
278
127
  readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
128
+ /** Opacity everything unselected falls back to while any slice is selected. */
279
129
  readonly dimOpacity: number;
130
+ /** Empty leaves the hole clear; ignored when there is no hole. */
280
131
  readonly centerLabel: "";
281
132
  readonly centerCaption: "";
133
+ /** The hole's summary fade, untouched by the entrance: a scene that wants the conclusion on a later beat sets 0 and calls `revealCenter`. */
282
134
  readonly centerReveal: 1;
283
135
  }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
284
136
  readonly slices: import("@motionscript/sdk").Type<PieSlice[], PieSlice[], false>;
@@ -287,18 +139,24 @@ export declare const PieRing: import("@motionscript/sdk").Component<"pieRing", i
287
139
  readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
288
140
  readonly labelMode: import("@motionscript/sdk").Type<PieLabelMode, PieLabelMode, false>;
289
141
  readonly labelPlacement: import("@motionscript/sdk").Type<PieLabelPlacement, PieLabelPlacement, false>;
142
+ /** Sweep `[0, 1]`: the wedges grow clockwise from `startAngle` as it rises. */
290
143
  readonly growth: 1;
144
+ /** Fade of leaders and labels, separate from `growth` so they arrive after the sweep. */
291
145
  readonly labelReveal: 1;
146
+ /** Per-slice pop `[0, 1]`, owned by the chart so the ring and legend read one signal. */
292
147
  readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
148
+ /** Opacity everything unselected falls back to while any slice is selected. */
293
149
  readonly dimOpacity: number;
150
+ /** Empty leaves the hole clear; ignored when there is no hole. */
294
151
  readonly centerLabel: "";
295
152
  readonly centerCaption: "";
153
+ /** The hole's summary fade, untouched by the entrance: a scene that wants the conclusion on a later beat sets 0 and calls `revealCenter`. */
296
154
  readonly centerReveal: 1;
297
155
  }>, {
298
156
  readonly sweep: unknown;
299
157
  readonly revealLabels: unknown;
300
158
  readonly revealCenter: unknown;
301
- }, Node2D<Node2DProps>>>>;
159
+ }, Node2D<_Node2DProps>>>>;
302
160
  export type PieRing = NodeOf<typeof PieRing>;
303
161
  export {};
304
162
  //# sourceMappingURL=pie-ring.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pie-ring.d.ts","sourceRoot":"","sources":["../../src/pie-chart/pie-ring.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,WAAW,EAEhB,KA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