@motionscript/charts 0.1.0 → 0.1.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +98 -28
  3. package/dist/bar-chart/bar-chart.d.ts +242 -119
  4. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  5. package/dist/bar-chart/bar-chart.js +231 -260
  6. package/dist/bar-chart/bar-chart.js.map +1 -1
  7. package/dist/bar-chart/category-axis.d.ts +16 -38
  8. package/dist/bar-chart/category-axis.d.ts.map +1 -1
  9. package/dist/bar-chart/category-axis.js +59 -68
  10. package/dist/bar-chart/category-axis.js.map +1 -1
  11. package/dist/bar-chart/chart-bars.d.ts +60 -91
  12. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  13. package/dist/bar-chart/chart-bars.js +88 -125
  14. package/dist/bar-chart/chart-bars.js.map +1 -1
  15. package/dist/bar-chart/index.d.ts +5 -13
  16. package/dist/bar-chart/index.d.ts.map +1 -1
  17. package/dist/bar-chart/index.js +2 -9
  18. package/dist/bar-chart/index.js.map +1 -1
  19. package/dist/bar-chart/shared.d.ts +40 -132
  20. package/dist/bar-chart/shared.d.ts.map +1 -1
  21. package/dist/bar-chart/shared.js +70 -158
  22. package/dist/bar-chart/shared.js.map +1 -1
  23. package/dist/browser/chunks/chunk-R3Q5EE6E.js +2 -0
  24. package/dist/browser/chunks/chunk-R3Q5EE6E.js.map +7 -0
  25. package/dist/browser/index.js +1 -1
  26. package/dist/browser/index.js.map +4 -4
  27. package/dist/browser/kit.js +1 -1
  28. package/dist/browser/manifest.json +1 -1
  29. package/dist/engine.d.ts +8 -17
  30. package/dist/engine.d.ts.map +1 -1
  31. package/dist/engine.js +8 -17
  32. package/dist/engine.js.map +1 -1
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +2 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/kit/cartesian.d.ts +49 -35
  38. package/dist/kit/cartesian.d.ts.map +1 -1
  39. package/dist/kit/cartesian.js +80 -42
  40. package/dist/kit/cartesian.js.map +1 -1
  41. package/dist/kit/chart-canvas.d.ts +37 -40
  42. package/dist/kit/chart-canvas.d.ts.map +1 -1
  43. package/dist/kit/chart-canvas.js +53 -47
  44. package/dist/kit/chart-canvas.js.map +1 -1
  45. package/dist/kit/chart-legend.d.ts +16 -59
  46. package/dist/kit/chart-legend.d.ts.map +1 -1
  47. package/dist/kit/chart-legend.js +38 -76
  48. package/dist/kit/chart-legend.js.map +1 -1
  49. package/dist/kit/entries.d.ts +2 -0
  50. package/dist/kit/entries.d.ts.map +1 -1
  51. package/dist/kit/entries.js +2 -0
  52. package/dist/kit/entries.js.map +1 -1
  53. package/dist/kit/horizontal-axis.d.ts +77 -0
  54. package/dist/kit/horizontal-axis.d.ts.map +1 -0
  55. package/dist/kit/horizontal-axis.js +99 -0
  56. package/dist/kit/horizontal-axis.js.map +1 -0
  57. package/dist/kit/motion.d.ts +16 -3
  58. package/dist/kit/motion.d.ts.map +1 -1
  59. package/dist/kit/motion.js +15 -1
  60. package/dist/kit/motion.js.map +1 -1
  61. package/dist/{pie-chart → kit}/pie-legend.d.ts +14 -29
  62. package/dist/kit/pie-legend.d.ts.map +1 -0
  63. package/dist/kit/pie-legend.js +93 -0
  64. package/dist/kit/pie-legend.js.map +1 -0
  65. package/dist/kit/polar.d.ts +31 -0
  66. package/dist/kit/polar.d.ts.map +1 -0
  67. package/dist/kit/polar.js +33 -0
  68. package/dist/kit/polar.js.map +1 -0
  69. package/dist/kit/shared.d.ts +60 -214
  70. package/dist/kit/shared.d.ts.map +1 -1
  71. package/dist/kit/shared.js +91 -291
  72. package/dist/kit/shared.js.map +1 -1
  73. package/dist/kit/style.d.ts +254 -0
  74. package/dist/kit/style.d.ts.map +1 -0
  75. package/dist/kit/style.js +197 -0
  76. package/dist/kit/style.js.map +1 -0
  77. package/dist/kit/vertical-axis.d.ts +36 -45
  78. package/dist/kit/vertical-axis.d.ts.map +1 -1
  79. package/dist/kit/vertical-axis.js +69 -81
  80. package/dist/kit/vertical-axis.js.map +1 -1
  81. package/dist/line-chart/chart-line.d.ts +107 -40
  82. package/dist/line-chart/chart-line.d.ts.map +1 -1
  83. package/dist/line-chart/chart-line.js +172 -89
  84. package/dist/line-chart/chart-line.js.map +1 -1
  85. package/dist/line-chart/chart-region.d.ts +14 -27
  86. package/dist/line-chart/chart-region.d.ts.map +1 -1
  87. package/dist/line-chart/chart-region.js +13 -28
  88. package/dist/line-chart/chart-region.js.map +1 -1
  89. package/dist/line-chart/index.d.ts +5 -18
  90. package/dist/line-chart/index.d.ts.map +1 -1
  91. package/dist/line-chart/index.js +3 -16
  92. package/dist/line-chart/index.js.map +1 -1
  93. package/dist/line-chart/line-chart.d.ts +272 -119
  94. package/dist/line-chart/line-chart.d.ts.map +1 -1
  95. package/dist/line-chart/line-chart.js +309 -257
  96. package/dist/line-chart/line-chart.js.map +1 -1
  97. package/dist/line-chart/shared.d.ts +73 -130
  98. package/dist/line-chart/shared.d.ts.map +1 -1
  99. package/dist/line-chart/shared.js +195 -156
  100. package/dist/line-chart/shared.js.map +1 -1
  101. package/dist/line-chart/x-scale.d.ts +16 -55
  102. package/dist/line-chart/x-scale.d.ts.map +1 -1
  103. package/dist/line-chart/x-scale.js +44 -111
  104. package/dist/line-chart/x-scale.js.map +1 -1
  105. package/dist/nodes.d.ts +3 -13
  106. package/dist/nodes.d.ts.map +1 -1
  107. package/dist/nodes.js +9 -13
  108. package/dist/nodes.js.map +1 -1
  109. package/dist/pie-chart/index.d.ts +3 -15
  110. package/dist/pie-chart/index.d.ts.map +1 -1
  111. package/dist/pie-chart/index.js +1 -11
  112. package/dist/pie-chart/index.js.map +1 -1
  113. package/dist/pie-chart/pie-chart.d.ts +147 -85
  114. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  115. package/dist/pie-chart/pie-chart.js +65 -86
  116. package/dist/pie-chart/pie-chart.js.map +1 -1
  117. package/dist/pie-chart/pie-ring.d.ts +65 -196
  118. package/dist/pie-chart/pie-ring.d.ts.map +1 -1
  119. package/dist/pie-chart/pie-ring.js +154 -292
  120. package/dist/pie-chart/pie-ring.js.map +1 -1
  121. package/dist/pie-chart/shared.d.ts +78 -172
  122. package/dist/pie-chart/shared.d.ts.map +1 -1
  123. package/dist/pie-chart/shared.js +54 -177
  124. package/dist/pie-chart/shared.js.map +1 -1
  125. package/dist/radar-chart/index.d.ts +5 -0
  126. package/dist/radar-chart/index.d.ts.map +1 -0
  127. package/dist/radar-chart/index.js +5 -0
  128. package/dist/radar-chart/index.js.map +1 -0
  129. package/dist/radar-chart/radar-chart.d.ts +218 -0
  130. package/dist/radar-chart/radar-chart.d.ts.map +1 -0
  131. package/dist/radar-chart/radar-chart.js +224 -0
  132. package/dist/radar-chart/radar-chart.js.map +1 -0
  133. package/dist/radar-chart/radar-grid.d.ts +43 -0
  134. package/dist/radar-chart/radar-grid.d.ts.map +1 -0
  135. package/dist/radar-chart/radar-grid.js +61 -0
  136. package/dist/radar-chart/radar-grid.js.map +1 -0
  137. package/dist/radar-chart/radar-series.d.ts +59 -0
  138. package/dist/radar-chart/radar-series.d.ts.map +1 -0
  139. package/dist/radar-chart/radar-series.js +71 -0
  140. package/dist/radar-chart/radar-series.js.map +1 -0
  141. package/dist/radar-chart/shared.d.ts +73 -0
  142. package/dist/radar-chart/shared.d.ts.map +1 -0
  143. package/dist/radar-chart/shared.js +123 -0
  144. package/dist/radar-chart/shared.js.map +1 -0
  145. package/dist/radial-chart/index.d.ts +6 -0
  146. package/dist/radial-chart/index.d.ts.map +1 -0
  147. package/dist/radial-chart/index.js +4 -0
  148. package/dist/radial-chart/index.js.map +1 -0
  149. package/dist/radial-chart/radial-chart.d.ts +216 -0
  150. package/dist/radial-chart/radial-chart.d.ts.map +1 -0
  151. package/dist/radial-chart/radial-chart.js +174 -0
  152. package/dist/radial-chart/radial-chart.js.map +1 -0
  153. package/dist/radial-chart/radial-rings.d.ts +121 -0
  154. package/dist/radial-chart/radial-rings.d.ts.map +1 -0
  155. package/dist/radial-chart/radial-rings.js +273 -0
  156. package/dist/radial-chart/radial-rings.js.map +1 -0
  157. package/dist/radial-chart/shared.d.ts +73 -0
  158. package/dist/radial-chart/shared.d.ts.map +1 -0
  159. package/dist/radial-chart/shared.js +79 -0
  160. package/dist/radial-chart/shared.js.map +1 -0
  161. package/package.json +4 -4
  162. package/registry.json +21 -6
  163. package/src/bar-chart/bar-chart.ts +274 -315
  164. package/src/bar-chart/category-axis.ts +53 -88
  165. package/src/bar-chart/chart-bars.ts +108 -205
  166. package/src/bar-chart/index.ts +8 -19
  167. package/src/bar-chart/shared.ts +81 -309
  168. package/src/engine.ts +8 -17
  169. package/src/index.ts +2 -0
  170. package/src/kit/cartesian.ts +118 -55
  171. package/src/kit/chart-canvas.ts +50 -80
  172. package/src/kit/chart-legend.ts +36 -97
  173. package/src/kit/entries.ts +4 -1
  174. package/src/kit/horizontal-axis.ts +114 -0
  175. package/src/kit/motion.ts +18 -2
  176. package/src/{pie-chart → kit}/pie-legend.ts +25 -65
  177. package/src/kit/polar.ts +54 -0
  178. package/src/kit/shared.ts +104 -487
  179. package/src/kit/style.ts +257 -0
  180. package/src/kit/vertical-axis.ts +81 -115
  181. package/src/line-chart/chart-line.ts +185 -91
  182. package/src/line-chart/chart-region.ts +14 -31
  183. package/src/line-chart/index.ts +14 -22
  184. package/src/line-chart/line-chart.ts +377 -315
  185. package/src/line-chart/shared.ts +229 -304
  186. package/src/line-chart/x-scale.ts +44 -121
  187. package/src/nodes.ts +9 -13
  188. package/src/pie-chart/index.ts +3 -35
  189. package/src/pie-chart/pie-chart.ts +83 -134
  190. package/src/pie-chart/pie-ring.ts +162 -368
  191. package/src/pie-chart/shared.ts +92 -379
  192. package/src/radar-chart/index.ts +4 -0
  193. package/src/radar-chart/radar-chart.ts +287 -0
  194. package/src/radar-chart/radar-grid.ts +78 -0
  195. package/src/radar-chart/radar-series.ts +88 -0
  196. package/src/radar-chart/shared.ts +146 -0
  197. package/src/radial-chart/index.ts +5 -0
  198. package/src/radial-chart/radial-chart.ts +210 -0
  199. package/src/radial-chart/radial-rings.ts +328 -0
  200. package/src/radial-chart/shared.ts +114 -0
  201. package/dist/browser/chunks/chunk-TJNHLQGV.js +0 -2
  202. package/dist/browser/chunks/chunk-TJNHLQGV.js.map +0 -7
  203. package/dist/kit/chart-border.d.ts +0 -27
  204. package/dist/kit/chart-border.d.ts.map +0 -1
  205. package/dist/kit/chart-border.js +0 -28
  206. package/dist/kit/chart-border.js.map +0 -1
  207. package/dist/line-chart/horizontal-axis.d.ts +0 -79
  208. package/dist/line-chart/horizontal-axis.d.ts.map +0 -1
  209. package/dist/line-chart/horizontal-axis.js +0 -129
  210. package/dist/line-chart/horizontal-axis.js.map +0 -1
  211. package/dist/pie-chart/pie-legend.d.ts.map +0 -1
  212. package/dist/pie-chart/pie-legend.js +0 -117
  213. package/dist/pie-chart/pie-legend.js.map +0 -1
  214. package/src/kit/chart-border.ts +0 -50
  215. package/src/line-chart/horizontal-axis.ts +0 -151
@@ -1 +1 @@
1
- {"version":3,"file":"pie-chart.js","sourceRoot":"","sources":["../../src/pie-chart/pie-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,OAAO,GAQR,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAa,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,GAMjB,MAAM,UAAU,CAAA;AA4CjB;;;GAGG;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E,cAAc,EAAE;YACd,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,OAAO,EAAE;YACjB,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SAC5D;KACF;CACF,CAAC,CAAA","sourcesContent":["import {\n Rect,\n Types,\n component2d,\n easeOut,\n type ChildView,\n type DataRecord,\n type NodeOf,\n // Named so this component's emitted type reaches `Node2D` through the sdk, not core.\n type Node2D,\n type Node2DProps,\n type Timeline,\n} from \"@motionscript/sdk\"\n\nimport { asParts, fresh } from \"../kit/entries\"\nimport { beats, type Beat } from \"../kit/motion\"\nimport { clampUnit } from \"../kit/shared\"\nimport { PieLegend } from \"./pie-legend\"\nimport { PieRing } from \"./pie-ring\"\nimport {\n DEFAULT_PIE_CHART_THEME,\n lerpPieChartTheme,\n resolvePieChartTheme,\n resolvePieSlices,\n type PieChartConfig,\n type PieChartTheme,\n type PieLabelMode,\n type PieLabelPlacement,\n type PieSlice,\n} from \"./shared\"\n\nexport interface PieChartProps extends Node2DProps {\n /** One row per slice — a plain record of field name to value. */\n data: DataRecord[]\n /** Key into each row for its slice caption, used on the labels and the legend. */\n categoryField: string\n /** Key into each row for its slice magnitude — the wedge's share of the ring. */\n valueField: string\n /**\n * The chart's visual theme — slice palette, ring geometry, label and centre\n * type, legend. Every branch is optional and deep-merged onto\n * {@link DEFAULT_PIE_CHART_THEME}.\n */\n theme?: PieChartTheme\n /** What the ring's labels say. */\n labelMode?: PieLabelMode\n /** Where they sit: inside their wedge, outside on a leader, or nowhere. */\n labelPlacement?: PieLabelPlacement\n /** Whether the legend column beside the ring is drawn at all. */\n showLegend?: boolean\n /** Gap between the ring and the legend, in px. */\n gap?: number\n /** Text set in the ring's hole — see `revealCenter`. */\n centerLabel?: string\n /** Smaller second line under {@link centerLabel}. */\n centerCaption?: string\n /**\n * Whether the hole's summary is drawn at rest. `true` (the default) is the\n * plain answer; a scene that wants the conclusion to land on a later beat sets\n * this `false` and runs `revealCenter` when it gets there.\n */\n showCenter?: boolean\n}\n\n/** What the selection reads: the rows, how they are cut, and the pops the commands move. */\nexport interface PieChartValues {\n readonly data: DataRecord[]\n readonly categoryField: string\n readonly valueField: string\n readonly theme: PieChartConfig\n readonly pops: number[]\n}\n\n/**\n * How `enter` divides its duration: the wedges sweeping in, then the labels and\n * the legend arriving together. Shares of the whole, so they sum to 1.\n */\nconst SWEEP_SHARE = 0.65\nconst LABEL_SHARE = 0.35\n\nconst SLICE_ARG = Types.number(0, { min: 0, step: 1 })\n\n/** The slices the ring and the legend draw, resolved from the rows and the palette. */\nfunction slicesOf(s: PieChartValues): PieSlice[] {\n return resolvePieSlices(s.data, s.categoryField, s.valueField, s.theme.sliceFills)\n}\n\n/** How far slice `index` is pushed out, in `[0, 1]`. */\nfunction popAt(s: PieChartValues, index: number): number {\n return clampUnit(s.pops[index] ?? 0)\n}\n\n/** Whether slice `index` is grown out past the ring's rim: past half way, so a slice mid-swell is not yet counted. */\nexport function isSliceSelected(s: PieChartValues, index: number): boolean {\n return popAt(s, index) > 0.5\n}\n\n/**\n * How far each slice is dimmed by the selection, one entry per slice: 1 while\n * nothing is out, and for the selected slice itself; falling toward the theme's\n * `dimOpacity` for the rest in proportion to how far the selection has grown.\n */\nfunction sliceDims(s: PieChartValues): number[] {\n let focus = 0\n for (let i = 0; i < s.data.length; i++) focus = Math.max(focus, popAt(s, i))\n const dim = s.theme.spotlight.dimOpacity\n if (focus <= 0) return s.data.map(() => 1)\n return s.data.map((_, i) => 1 - (1 - clampUnit(dim)) * focus * (1 - popAt(s, i)))\n}\n\ntype AnyTimeline = Timeline<any, any>\n\n/**\n * Every slice's pop eased from where it is to what `pop` asks for. A move that\n * changes nothing still takes its slot, writing nothing.\n */\nfunction popping(timeline: AnyTimeline, s: PieChartValues, pop: (index: number) => number) {\n const from = s.data.map((_, i) => popAt(s, i))\n const targets = s.data.map((_, i) => clampUnit(pop(i)))\n if (from.every((value, i) => value === targets[i])) return timeline.wait(timeline.duration)\n return timeline.animate((t) => ({ pops: from.map((value, i) => value + (targets[i] - value) * t) }))\n}\n\n/** The ring and the legend, found through the chart's children: the last row of them is the one it built. */\nfunction partsOf(children: readonly ChildView[]) {\n for (let i = children.length - 1; i >= 0; i--) {\n const row = children[i]\n const ring = Rect.is(row) ? row.children.find(PieRing.is) : undefined\n if (ring) return { ring, legend: row.children.find(PieLegend.is) ?? null }\n }\n return null\n}\n\n/**\n * A pie or donut chart, composed from two parts laid out by a horizontal-flow\n * {@link Rect} — the ring filling whatever the hugging legend leaves, both\n * centred:\n *\n * - {@link PieRing} — the wedges, each sized by its share of the total, with its\n * label inside its own band or pinned outside on a leader line, and the\n * summary in the hole.\n * - {@link PieLegend} — a column of swatch-and-caption rows naming each slice.\n *\n * **One mark per row, not per column**: a pie's palette is indexed by row and\n * there is nothing to hide, since dropping a slice would re-cut every other\n * wedge. `selectSlice` and its siblings are what a pie has instead — a slice\n * swells out of the ring and everything else dims behind it.\n *\n * **Resting state is the finished chart**; `enter` arms every part on its first\n * frame. The one exception is the hole's summary, which a scene can hold back\n * with `showCenter: false`, because it is usually the chart's *conclusion*.\n */\nexport const PieChart = component2d({\n key: \"pieChart\",\n state: {\n data: fresh<DataRecord[]>(() => []),\n categoryField: \"\",\n valueField: \"\",\n theme: Types.custom<PieChartTheme, PieChartConfig>(DEFAULT_PIE_CHART_THEME, { resolve: resolvePieChartTheme, lerp: lerpPieChartTheme }),\n labelMode: Types.custom<PieLabelMode>(\"percent\"),\n labelPlacement: Types.custom<PieLabelPlacement>(\"leader\"),\n gap: 40,\n centerLabel: \"\",\n centerCaption: \"\",\n /**\n * How far each slice is pushed out of the ring, `0`–`1` per index. Held here\n * rather than on the ring because two parts read it: the wedges grow out by\n * it, and the legend entries dim by it. Seeded flush, one to a row.\n */\n pops: fresh<number[]>(() => []),\n /** Read as the chart is built: the legend is a part the chart builds or doesn't. */\n showLegend: Types.boolean(true, { animatable: false }),\n /** Read as the chart is built: whether the hole's summary is drawn at rest. */\n showCenter: Types.boolean(true, { animatable: false }),\n },\n defaults: {\n // Its parts fill it; a node made of them would hug them.\n width: \"fill\",\n height: \"fill\",\n pops: (state) => slicesOf(state).map(() => 0),\n },\n allowedChildren: [],\n // The slice *structure* (one label and one legend row per row) is read once;\n // the slices themselves, their paint and the selection are bound, so a theme\n // tween re-paints and a `set` of `data` re-cuts the wedges.\n children: (state) => {\n const theme = () => state.theme\n const slices = () => slicesOf(state)\n const parts: Node2D[] = [\n new PieRing({\n width: \"fill\",\n height: \"fill\",\n slices,\n ring: () => theme().ring,\n label: () => theme().label,\n centerStyle: () => theme().center,\n labelMode: state.labelMode,\n labelPlacement: state.labelPlacement,\n pops: () => state.pops,\n dimOpacity: () => theme().spotlight.dimOpacity,\n centerLabel: state.centerLabel,\n centerCaption: state.centerCaption,\n centerReveal: state.showCenter === false ? 0 : 1,\n }) as unknown as Node2D,\n ]\n if (state.showLegend !== false) {\n parts.push(\n new PieLegend({\n slices,\n legend: () => theme().legend,\n dims: () => sliceDims(state),\n // The column's spacing is the theme's as the chart was built, like the\n // entries' type and chips.\n gap: state.theme.legend.itemGap / 3,\n padding: state.theme.legend.padding,\n }) as unknown as Node2D\n )\n }\n const row = new Rect({ flow: \"horizontal\", width: \"fill\", height: \"fill\", gap: state.gap, align: \"center\", children: parts })\n return asParts([row as unknown as Node2D])\n },\n commands: {\n /**\n * Animate the whole chart in: the wedges sweep in clockwise from the theme's\n * `startAngle`, then the labels fade up and the legend staggers in together.\n * Its first frame arms the wedges, the labels and the legend; the hole's\n * summary keeps its own signal. `duration` is the **whole** entrance.\n */\n enter: {\n args: {},\n // Held from the chart's arrival, so it never shows finished ahead of its draw.\n entrance: true,\n easing: easeOut(),\n run: (timeline, _state, children) => {\n const parts = partsOf(children)\n if (!parts) return timeline.wait(timeline.duration)\n const { ring, legend } = parts\n const sweep = timeline.duration * SWEEP_SHARE\n const labels = timeline.duration * LABEL_SHARE\n const at0 = (piece: Beat[\"piece\"]): Beat => ({ at: 0, duration: 0, piece })\n return beats(timeline, [\n at0(ring.to({ growth: 0, labelReveal: 0 })),\n ...(legend ? [at0(legend.run(\"arm\"))] : []),\n { at: 0, duration: sweep, piece: ring.run(\"sweep\") },\n { at: sweep, duration: labels, piece: ring.run(\"revealLabels\") },\n ...(legend ? [{ at: sweep, duration: labels, piece: legend.run(\"enter\") }] : []),\n ])\n },\n },\n /**\n * Fade the hole's summary up. Held out of `enter` on purpose: what sits in a\n * donut's hole is usually the chart's conclusion, so the scene lands it on\n * its own beat. Pair it with `showCenter: false`.\n */\n revealCenter: {\n args: {},\n easing: easeOut(),\n run: (timeline, _state, children) => partsOf(children)?.ring.run(\"revealCenter\") ?? timeline.wait(timeline.duration),\n },\n /** Grow slice `index` out past the ring's rim and dim the rest, leaving any other selected slice where it is. */\n selectSlice: {\n args: { sliceIndex: SLICE_ARG },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.sliceIndex\n return popping(timeline, state, (i) => (i === index ? 1 : popAt(state, i)))\n },\n },\n /** Settle slice `index` back flush with the ring. */\n deselectSlice: {\n args: { sliceIndex: SLICE_ARG },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.sliceIndex\n return popping(timeline, state, (i) => (i === index ? 0 : popAt(state, i)))\n },\n },\n /** Move the focus to slice `index` alone, settling whatever else was out. */\n selectOnlySlice: {\n args: { sliceIndex: SLICE_ARG },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.sliceIndex\n return popping(timeline, state, (i) => (i === index ? 1 : 0))\n },\n },\n /** Settle every slice flush and bring the whole chart back to full. */\n clearSelection: {\n args: {},\n easing: easeOut(),\n run: (timeline, state) => popping(timeline, state, () => 0),\n },\n },\n})\n\nexport type PieChart = NodeOf<typeof PieChart>\n"]}
1
+ {"version":3,"file":"pie-chart.js","sourceRoot":"","sources":["../../src/pie-chart/pie-chart.ts"],"names":[],"mappings":"AAAA,OA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,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;YAC/B,MAAM,EAAE,OAAO,EAAE;YACjB,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;gBACvB,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAA;gBACtC,OAAO,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7E,CAAC;SACF;QACD,6EAA6E;QAC7E,eAAe,EAAE;YACf,IAAI,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;YAC/B,MAAM,EAAE,OAAO,EAAE;YACjB,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;gBACvB,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAA;gBACtC,OAAO,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/D,CAAC;SACF;QACD,uEAAuE;QACvE,cAAc,EAAE;YACd,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,OAAO,EAAE;YACjB,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SAC5D;KACF;CACF,CAAC,CAAA","sourcesContent":["import {\n Rect,\n Types,\n clamp,\n component2d,\n easeOut,\n type ChildView,\n type DataRecord,\n type NodeOf,\n // Named so this component's emitted type reaches `Node2D` and its props through the sdk, not core.\n type Node2D,\n type Node2DProps as _Node2DProps,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n} from \"@motionscript/sdk\"\n\nimport { asParts, fresh } from \"../kit/entries\"\nimport { beats, type AnyTimeline, type Beat } from \"../kit/motion\"\nimport { PieLegend } from \"../kit/pie-legend\"\nimport { PieRing } from \"./pie-ring\"\nimport { CHART_STYLE_FAMILY, CHART_STYLE_PRESETS, paletteFill } from \"../kit/style\"\nimport {\n PIE_SPOTLIGHT_DIM,\n PIE_STYLE_GROUPS,\n centerConfigOf,\n labelConfigOf,\n legendOf,\n resolvePieSlices,\n ringConfigOf,\n selectionFade,\n type PieLabelMode,\n type PieSlice,\n type PieStyle,\n} from \"./shared\"\n\nexport interface PieChartValues {\n readonly data: DataRecord[]\n readonly categoryField: string\n readonly valueField: string\n readonly style: PieStyle\n readonly pops: number[]\n}\n\n/** How `enter` divides its duration: wedges sweeping in, then labels and legend together. Sums to 1. */\nconst SWEEP_SHARE = 0.65\nconst LABEL_SHARE = 0.35\n\nconst SLICE_ARG = Types.number(0, { min: 0, step: 1 })\n\nfunction slicesOf(s: PieChartValues): PieSlice[] {\n return resolvePieSlices(\n s.data,\n s.categoryField,\n s.valueField,\n s.data.map((_, i) => paletteFill(s.style, i))\n )\n}\n\nfunction popAt(s: PieChartValues, index: number): number {\n return clamp(s.pops[index] ?? 0, 0, 1)\n}\n\n/** Whether slice `index` is past half way out, so a slice mid-swell is not yet counted. */\nexport function isSliceSelected(s: PieChartValues, index: number): boolean {\n return popAt(s, index) > 0.5\n}\n\n/** Per-slice opacity: 1 while nothing is out and for the selected slice, falling toward `dimOpacity` for the rest as the selection grows. */\nfunction sliceDims(s: PieChartValues): number[] {\n let focus = 0\n for (let i = 0; i < s.data.length; i++) focus = Math.max(focus, popAt(s, i))\n return s.data.map((_, i) => selectionFade(focus, PIE_SPOTLIGHT_DIM, popAt(s, i)))\n}\n\n/** Every slice's pop eased to what `pop` asks for. A move that changes nothing still takes its slot. */\nfunction popping(timeline: AnyTimeline, s: PieChartValues, pop: (index: number) => number) {\n const from = s.data.map((_, i) => popAt(s, i))\n const targets = s.data.map((_, i) => clamp(pop(i), 0, 1))\n if (from.every((value, i) => value === targets[i])) return timeline.wait(timeline.duration)\n return timeline.animate((t) => ({ pops: from.map((value, i) => value + (targets[i] - value) * t) }))\n}\n\n/** The ring and legend among the children; the last row is the one the chart built. */\nfunction partsOf(children: readonly ChildView[]) {\n for (let i = children.length - 1; i >= 0; i--) {\n const row = children[i]\n const ring = Rect.is(row) ? row.children.find(PieRing.is) : undefined\n if (ring) return { ring, legend: row.children.find(PieLegend.is) ?? null }\n }\n return null\n}\n\n/**\n * A pie or donut chart: a {@link PieRing} filling what the hugging {@link PieLegend}\n * leaves. One mark per row, not per column, and nothing to hide, since dropping\n * a slice would re-cut every other wedge; `selectSlice` and its siblings swell\n * a slice and dim the rest instead.\n *\n * Resting state is the finished chart, except the hole's summary, which\n * `showCenter: false` holds back for `revealCenter`.\n */\nexport const PieChart = component2d({\n key: \"pieChart\",\n state: {\n data: fresh<DataRecord[]>(() => [], { kind: \"dataset\" }),\n /** Slice caption, used on the labels and the legend. */\n categoryField: \"\",\n /** Slice magnitude: the wedge's share of the ring. */\n valueField: \"\",\n style: Types.style(CHART_STYLE_FAMILY, PIE_STYLE_GROUPS, { presets: CHART_STYLE_PRESETS }),\n /** What the ring's labels say. */\n labelMode: Types.custom<PieLabelMode>(\"percent\"),\n /** Gap between the ring and the legend, in px. */\n gap: 40,\n /** Text set in the ring's hole. */\n centerLabel: \"\",\n /** Smaller second line under `centerLabel`. */\n centerCaption: \"\",\n /** How far each slice is pushed out, `0`-`1` per index. Here, not on the ring, because the wedges and the legend both read it. */\n pops: fresh<number[]>(() => []),\n /** Read as the chart is built: whether the hole's summary is drawn at rest. A scene that wants it to land later sets `false` and runs `revealCenter`. */\n showCenter: Types.boolean(true, { animatable: false }),\n },\n defaults: {\n // A node made of parts that fill would otherwise hug them.\n width: \"fill\",\n height: \"fill\",\n pops: (state) => slicesOf(state).map(() => 0),\n },\n allowedChildren: [],\n // The structure (a label and legend row per row) is read once; slices, paint and selection are bound, so a theme tween re-paints and a `set` of `data` re-cuts.\n children: (state) => {\n const style = () => state.style\n const slices = () => slicesOf(state)\n const parts: Node2D[] = [\n new PieRing({\n width: \"fill\",\n height: \"fill\",\n slices,\n ring: () => ringConfigOf(style()),\n label: () => labelConfigOf(style()),\n centerStyle: () => centerConfigOf(style()),\n labelMode: state.labelMode,\n labelPlacement: state.style.labelPlacement,\n pops: () => state.pops,\n dimOpacity: PIE_SPOTLIGHT_DIM,\n centerLabel: state.centerLabel,\n centerCaption: state.centerCaption,\n centerReveal: state.showCenter === false ? 0 : 1,\n }) as unknown as Node2D,\n ]\n const position = state.style.legend\n if (position !== \"none\") {\n const side = position === \"right\"\n const legend = new PieLegend({\n slices,\n legend: () => legendOf(style()),\n dims: () => sliceDims(state),\n flow: side ? \"vertical\" : \"horizontal\",\n align: \"center\",\n // Spacing is fixed as built.\n gap: side ? legendOf(state.style).itemGap / 3 : legendOf(state.style).itemGap,\n padding: 0,\n }) as unknown as Node2D\n if (position === \"top\") parts.unshift(legend)\n else parts.push(legend)\n }\n const row = new Rect({\n flow: position === \"right\" || position === \"none\" ? \"horizontal\" : \"vertical\",\n width: \"fill\",\n height: \"fill\",\n gap: state.gap,\n padding: 24,\n align: \"center\",\n fill: () => state.style.background,\n children: parts,\n })\n return asParts([row as unknown as Node2D])\n },\n commands: {\n /** Wedges sweep in clockwise from `startAngle`, then labels fade up and the legend staggers in. `duration` is the whole entrance; the hole's summary keeps its own signal. */\n enter: {\n args: {},\n // Held from arrival, so it never shows finished ahead of its draw.\n entrance: true,\n easing: easeOut(),\n run: (timeline, _state, children) => {\n const parts = partsOf(children)\n if (!parts) return timeline.wait(timeline.duration)\n const { ring, legend } = parts\n const sweep = timeline.duration * SWEEP_SHARE\n const labels = timeline.duration * LABEL_SHARE\n const at0 = (piece: Beat[\"piece\"]): Beat => ({ at: 0, duration: 0, piece })\n return beats(timeline, [\n at0(ring.to({ growth: 0, labelReveal: 0 })),\n ...(legend ? [at0(legend.run(\"arm\"))] : []),\n { at: 0, duration: sweep, piece: ring.run(\"sweep\") },\n { at: sweep, duration: labels, piece: ring.run(\"revealLabels\") },\n ...(legend ? [{ at: sweep, duration: labels, piece: legend.run(\"enter\") }] : []),\n ])\n },\n },\n /** Fade the hole's summary up. Not part of `enter`: it is usually the conclusion, which a scene lands on its own beat. */\n revealCenter: {\n args: {},\n easing: easeOut(),\n run: (timeline, _state, children) => partsOf(children)?.ring.run(\"revealCenter\") ?? timeline.wait(timeline.duration),\n },\n /** Grow slice `index` out past the ring's rim and dim the rest, leaving any other selected slice where it is. */\n selectSlice: {\n args: { sliceIndex: SLICE_ARG },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.sliceIndex\n return popping(timeline, state, (i) => (i === index ? 1 : popAt(state, i)))\n },\n },\n /** Settle slice `index` back flush with the ring. */\n deselectSlice: {\n args: { sliceIndex: SLICE_ARG },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.sliceIndex\n return popping(timeline, state, (i) => (i === index ? 0 : popAt(state, i)))\n },\n },\n /** Move the focus to slice `index` alone, settling whatever else was out. */\n selectOnlySlice: {\n args: { sliceIndex: SLICE_ARG },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.sliceIndex\n return popping(timeline, state, (i) => (i === index ? 1 : 0))\n },\n },\n /** Settle every slice flush and bring the whole chart back to full. */\n clearSelection: {\n args: {},\n easing: easeOut(),\n run: (timeline, state) => popping(timeline, state, () => 0),\n },\n },\n})\n\nexport type PieChart = NodeOf<typeof PieChart>\n"]}
@@ -1,69 +1,26 @@
1
- import { type FillResolved, type NodeOf, type Node2D, type Node2DProps, type Vector2 } from "@motionscript/sdk";
1
+ import { PathBuilder, type Fill, 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. */
3
+ /** Black or white, whichever reads better on a solid `fill`; black for any other paint. */
4
+ export declare function onFill(fill: Fill): string;
56
5
  interface LabelPlacement {
57
- /** Index of the slice. */
58
6
  index: number;
59
- /** Which side of the ring the label sits on: +1 right, −1 left. */
7
+ /** +1 right, -1 left. */
60
8
  side: 1 | -1;
61
- /** Leader polyline: wedge edge → elbow → label. */
9
+ /** Wedge edge, elbow, label. */
62
10
  leader: Vector2[];
63
- /** Point the label's inner edge is pinned to. */
11
+ /** Where the label's inner edge is pinned. */
64
12
  text: Vector2;
65
13
  }
66
- /** What the ring's geometry reads off its entries. */
14
+ /**
15
+ * A wedge over `a0`..`a1` (radians clockwise from 12 o'clock) from `rInner` to
16
+ * `rOuter`, centred on `cx`; with `rInner <= 0` it closes at an apex pulled
17
+ * off the centre by the gap. `halfGap` is half the px gap to the neighbour,
18
+ * converted to an angle per radius so the channel keeps one width across the
19
+ * band; the inset is capped at the wedge's half-span so a sliver narrows to
20
+ * nothing rather than turning inside out. Corners are rounded by `corner` px
21
+ * (clamped to what the wedge can hold), except a pie's apex.
22
+ */
23
+ export declare function wedgePath(a0: number, a1: number, rInner: number, rOuter: number, halfGap: number, corner: number, cx: number): PathBuilder;
67
24
  interface RingState {
68
25
  readonly slices: PieSlice[];
69
26
  readonly ring: RingConfig;
@@ -76,12 +33,7 @@ interface RingState {
76
33
  readonly centerLabel: string;
77
34
  readonly centerCaption: string;
78
35
  }
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
- */
36
+ /** Every radius, gutter and label position for one box, derived afresh wherever read so the drawing and the labels' bound positions cannot disagree. */
85
37
  export declare class RingGeometry {
86
38
  private readonly s;
87
39
  private readonly box;
@@ -89,164 +41,63 @@ export declare class RingGeometry {
89
41
  readonly width: number;
90
42
  readonly height: number;
91
43
  });
92
- /** The drawn slices' angular spans, re-read every frame so a value tween re-cuts them. */
44
+ /** Re-read every frame so a value tween re-cuts them. */
93
45
  get arcs(): PieArc[];
94
- /** Whether any slice is labelled on a leader — the only thing that costs a gutter. */
46
+ /** Leader labels are the only thing that costs a gutter. */
95
47
  get hasLeaderLabels(): boolean;
96
48
  /**
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.
49
+ * Px a horizontal label centred in `arc`'s band can run before leaving the
50
+ * wedge: bound by the band's thickness near 3 o'clock, by its arc near 12.
51
+ * Measured off the unpopped radius, so a slice growing out of the ring does not
52
+ * resize its own text mid-animation.
111
53
  */
112
54
  insideRoom(arc: PieArc): number;
113
55
  /** Widest line, in glyphs at the leading line's size, an inside label runs to. */
114
56
  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
- */
57
+ /** 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
58
  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
- */
59
+ /** 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
60
  get centerFont(): number;
132
- /** Rim radius of a fully selected slice as a multiple of the ring's, clamped sane. */
61
+ /** Rim radius of a fully selected slice as a multiple of the ring's. */
133
62
  get growFactor(): number;
134
- /** How far past the ring's rim a fully selected slice reaches, in px. */
135
63
  get maxPop(): number;
136
- /** Height of one **leader** label block, in px — the unit those columns are spaced by. */
64
+ /** Height of one leader label block, the unit the columns are spaced by. Inside labels cost no vertical reserve. */
137
65
  get labelRowHeight(): number;
138
- /** Widest line, in glyphs, that a leader label for slice `index` can run to. */
66
+ /** Widest line in glyphs a leader label for slice `index` runs to. */
139
67
  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
- */
68
+ /** 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
69
  get labelGutters(): {
149
70
  left: number;
150
71
  right: number;
151
72
  };
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
- */
73
+ /** Slides the ring into the empty half when labels all fall one way, keeping the ring-plus-labels group centred. */
158
74
  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
- */
75
+ /** 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
76
  get outerRadius(): number;
166
- /** Radius of the hole in the middle: a fraction of the outer radius, or explicit px. */
167
77
  get holeRadius(): number;
168
- /** Radius of the circle every leader elbows on, clear of even a popped-out slice. */
78
+ /** The circle every leader elbows on, clear of even a popped-out slice. */
169
79
  get elbowRadius(): number;
170
- /** How far slice `index` is currently pushed out, in `[0, 1]`. */
171
80
  popOf(index: number): number;
172
- /** Radius of slice `index`'s outer edge, its selection growth included. */
173
81
  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
- */
82
+ /** 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
83
  bandMidRadius(index: number): number;
181
- /** The point slice `index`'s inside label is centred on. */
182
84
  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
- */
85
+ /** The most-grown slice, so the dim in {@link sliceOpacity} rides the pops' tween. */
188
86
  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
- */
87
+ /** Opacity of slice `index` with its leader and label. */
195
88
  sliceOpacity(index: number): number;
196
- /** Slice `index`'s share of the ring as its label reads it, off the live values. */
197
89
  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
- */
90
+ /** 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
91
  placements(): LabelPlacement[];
207
- /** This frame's placement for slice `index`, or `undefined` if it isn't leadered. */
208
92
  placementFor(index: number): LabelPlacement | undefined;
209
93
  }
210
- /** Each slice's fill, resolved. */
211
- export declare function ringFills(slices: readonly PieSlice[]): FillResolved[][];
212
94
  /**
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.
95
+ * The ring: one wedge per {@link PieSlice} swept clockwise from `startAngle`,
96
+ * with a constant-width `gap` (see {@link wedgePath}). A selected slice swells
97
+ * out while its hole edge stays put, and the rest dims, leaders and labels
98
+ * included. The only path-drawing part of the chart family; labels are real
99
+ * {@link Text} nodes, so no glyph-width guesswork places a caption. Only the
100
+ * sides that carry a leader reserve a gutter, and the ring slides into the rest.
250
101
  */
251
102
  export declare const PieRing: import("@motionscript/sdk").Component<"pieRing", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
252
103
  readonly slices: import("@motionscript/sdk").Type<PieSlice[], PieSlice[], false>;
@@ -255,30 +106,42 @@ export declare const PieRing: import("@motionscript/sdk").Component<"pieRing", i
255
106
  readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
256
107
  readonly labelMode: import("@motionscript/sdk").Type<PieLabelMode, PieLabelMode, false>;
257
108
  readonly labelPlacement: import("@motionscript/sdk").Type<PieLabelPlacement, PieLabelPlacement, false>;
109
+ /** Sweep `[0, 1]`: the wedges grow clockwise from `startAngle` as it rises. */
258
110
  readonly growth: 1;
111
+ /** Fade of leaders and labels, separate from `growth` so they arrive after the sweep. */
259
112
  readonly labelReveal: 1;
113
+ /** Per-slice pop `[0, 1]`, owned by the chart so the ring and legend read one signal. */
260
114
  readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
261
- readonly dimOpacity: number;
115
+ /** Opacity everything unselected falls back to while any slice is selected. */
116
+ readonly dimOpacity: 0.15;
117
+ /** Empty leaves the hole clear; ignored when there is no hole. */
262
118
  readonly centerLabel: "";
263
119
  readonly centerCaption: "";
120
+ /** 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
121
  readonly centerReveal: 1;
265
122
  }>, {
266
123
  readonly sweep: unknown;
267
124
  readonly revealLabels: unknown;
268
125
  readonly revealCenter: unknown;
269
- }, null, Node2D<Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
126
+ }, null, Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
270
127
  readonly slices: import("@motionscript/sdk").Type<PieSlice[], PieSlice[], false>;
271
128
  readonly ring: import("@motionscript/sdk").Type<RingConfig, RingConfig, false>;
272
129
  readonly label: import("@motionscript/sdk").Type<LabelConfig, LabelConfig, false>;
273
130
  readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
274
131
  readonly labelMode: import("@motionscript/sdk").Type<PieLabelMode, PieLabelMode, false>;
275
132
  readonly labelPlacement: import("@motionscript/sdk").Type<PieLabelPlacement, PieLabelPlacement, false>;
133
+ /** Sweep `[0, 1]`: the wedges grow clockwise from `startAngle` as it rises. */
276
134
  readonly growth: 1;
135
+ /** Fade of leaders and labels, separate from `growth` so they arrive after the sweep. */
277
136
  readonly labelReveal: 1;
137
+ /** Per-slice pop `[0, 1]`, owned by the chart so the ring and legend read one signal. */
278
138
  readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
279
- readonly dimOpacity: number;
139
+ /** Opacity everything unselected falls back to while any slice is selected. */
140
+ readonly dimOpacity: 0.15;
141
+ /** Empty leaves the hole clear; ignored when there is no hole. */
280
142
  readonly centerLabel: "";
281
143
  readonly centerCaption: "";
144
+ /** 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
145
  readonly centerReveal: 1;
283
146
  }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
284
147
  readonly slices: import("@motionscript/sdk").Type<PieSlice[], PieSlice[], false>;
@@ -287,18 +150,24 @@ export declare const PieRing: import("@motionscript/sdk").Component<"pieRing", i
287
150
  readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
288
151
  readonly labelMode: import("@motionscript/sdk").Type<PieLabelMode, PieLabelMode, false>;
289
152
  readonly labelPlacement: import("@motionscript/sdk").Type<PieLabelPlacement, PieLabelPlacement, false>;
153
+ /** Sweep `[0, 1]`: the wedges grow clockwise from `startAngle` as it rises. */
290
154
  readonly growth: 1;
155
+ /** Fade of leaders and labels, separate from `growth` so they arrive after the sweep. */
291
156
  readonly labelReveal: 1;
157
+ /** Per-slice pop `[0, 1]`, owned by the chart so the ring and legend read one signal. */
292
158
  readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
293
- readonly dimOpacity: number;
159
+ /** Opacity everything unselected falls back to while any slice is selected. */
160
+ readonly dimOpacity: 0.15;
161
+ /** Empty leaves the hole clear; ignored when there is no hole. */
294
162
  readonly centerLabel: "";
295
163
  readonly centerCaption: "";
164
+ /** 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
165
  readonly centerReveal: 1;
297
166
  }>, {
298
167
  readonly sweep: unknown;
299
168
  readonly revealLabels: unknown;
300
169
  readonly revealCenter: unknown;
301
- }, Node2D<Node2DProps>>>>;
170
+ }, Node2D<_Node2DProps>>>>;
302
171
  export type PieRing = NodeOf<typeof PieRing>;
303
172
  export {};
304
173
  //# 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,KAAK,OAAO,EACb,MAAM,mBAAmB,CAAA;AAM1B,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,UAAU,EAChB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,Y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