@motionscript/charts 0.1.1-alpha.0 → 0.1.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +98 -28
  3. package/dist/bar-chart/bar-chart.d.ts +233 -39
  4. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  5. package/dist/bar-chart/bar-chart.js +215 -171
  6. package/dist/bar-chart/bar-chart.js.map +1 -1
  7. package/dist/bar-chart/category-axis.d.ts +12 -7
  8. package/dist/bar-chart/category-axis.d.ts.map +1 -1
  9. package/dist/bar-chart/category-axis.js +56 -42
  10. package/dist/bar-chart/category-axis.js.map +1 -1
  11. package/dist/bar-chart/chart-bars.d.ts +52 -52
  12. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  13. package/dist/bar-chart/chart-bars.js +80 -89
  14. package/dist/bar-chart/chart-bars.js.map +1 -1
  15. package/dist/bar-chart/index.d.ts +4 -4
  16. package/dist/bar-chart/index.d.ts.map +1 -1
  17. package/dist/bar-chart/index.js +2 -2
  18. package/dist/bar-chart/index.js.map +1 -1
  19. package/dist/bar-chart/shared.d.ts +36 -65
  20. package/dist/bar-chart/shared.d.ts.map +1 -1
  21. package/dist/bar-chart/shared.js +68 -117
  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 +5 -2
  30. package/dist/engine.d.ts.map +1 -1
  31. package/dist/engine.js +5 -2
  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 -15
  38. package/dist/kit/cartesian.d.ts.map +1 -1
  39. package/dist/kit/cartesian.js +79 -29
  40. package/dist/kit/cartesian.js.map +1 -1
  41. package/dist/kit/chart-canvas.d.ts +32 -24
  42. package/dist/kit/chart-canvas.d.ts.map +1 -1
  43. package/dist/kit/chart-canvas.js +52 -46
  44. package/dist/kit/chart-canvas.js.map +1 -1
  45. package/dist/kit/chart-legend.d.ts +8 -4
  46. package/dist/kit/chart-legend.d.ts.map +1 -1
  47. package/dist/kit/chart-legend.js +30 -20
  48. package/dist/kit/chart-legend.js.map +1 -1
  49. package/dist/{line-chart → kit}/horizontal-axis.d.ts +31 -6
  50. package/dist/kit/horizontal-axis.d.ts.map +1 -0
  51. package/dist/{line-chart → kit}/horizontal-axis.js +23 -24
  52. package/dist/kit/horizontal-axis.js.map +1 -0
  53. package/dist/kit/motion.d.ts +5 -0
  54. package/dist/kit/motion.d.ts.map +1 -1
  55. package/dist/kit/motion.js +8 -0
  56. package/dist/kit/motion.js.map +1 -1
  57. package/dist/{pie-chart → kit}/pie-legend.d.ts +3 -3
  58. package/dist/kit/pie-legend.d.ts.map +1 -0
  59. package/dist/{pie-chart → kit}/pie-legend.js +11 -10
  60. package/dist/kit/pie-legend.js.map +1 -0
  61. package/dist/kit/polar.d.ts +31 -0
  62. package/dist/kit/polar.d.ts.map +1 -0
  63. package/dist/kit/polar.js +33 -0
  64. package/dist/kit/polar.js.map +1 -0
  65. package/dist/kit/shared.d.ts +11 -50
  66. package/dist/kit/shared.d.ts.map +1 -1
  67. package/dist/kit/shared.js +58 -141
  68. package/dist/kit/shared.js.map +1 -1
  69. package/dist/kit/style.d.ts +254 -0
  70. package/dist/kit/style.d.ts.map +1 -0
  71. package/dist/kit/style.js +197 -0
  72. package/dist/kit/style.js.map +1 -0
  73. package/dist/kit/vertical-axis.d.ts +22 -2
  74. package/dist/kit/vertical-axis.d.ts.map +1 -1
  75. package/dist/kit/vertical-axis.js +56 -43
  76. package/dist/kit/vertical-axis.js.map +1 -1
  77. package/dist/line-chart/chart-line.d.ts +95 -3
  78. package/dist/line-chart/chart-line.d.ts.map +1 -1
  79. package/dist/line-chart/chart-line.js +165 -53
  80. package/dist/line-chart/chart-line.js.map +1 -1
  81. package/dist/line-chart/chart-region.d.ts +1 -1
  82. package/dist/line-chart/chart-region.d.ts.map +1 -1
  83. package/dist/line-chart/chart-region.js +7 -8
  84. package/dist/line-chart/chart-region.js.map +1 -1
  85. package/dist/line-chart/index.d.ts +5 -6
  86. package/dist/line-chart/index.d.ts.map +1 -1
  87. package/dist/line-chart/index.js +3 -4
  88. package/dist/line-chart/index.js.map +1 -1
  89. package/dist/line-chart/line-chart.d.ts +257 -18
  90. package/dist/line-chart/line-chart.d.ts.map +1 -1
  91. package/dist/line-chart/line-chart.js +282 -134
  92. package/dist/line-chart/line-chart.js.map +1 -1
  93. package/dist/line-chart/shared.d.ts +51 -34
  94. package/dist/line-chart/shared.d.ts.map +1 -1
  95. package/dist/line-chart/shared.js +175 -83
  96. package/dist/line-chart/shared.js.map +1 -1
  97. package/dist/line-chart/x-scale.d.ts +2 -0
  98. package/dist/line-chart/x-scale.d.ts.map +1 -1
  99. package/dist/line-chart/x-scale.js +15 -0
  100. package/dist/line-chart/x-scale.js.map +1 -1
  101. package/dist/nodes.d.ts +3 -1
  102. package/dist/nodes.d.ts.map +1 -1
  103. package/dist/nodes.js +9 -1
  104. package/dist/nodes.js.map +1 -1
  105. package/dist/pie-chart/index.d.ts +2 -3
  106. package/dist/pie-chart/index.d.ts.map +1 -1
  107. package/dist/pie-chart/index.js +1 -2
  108. package/dist/pie-chart/index.js.map +1 -1
  109. package/dist/pie-chart/pie-chart.d.ts +114 -18
  110. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  111. package/dist/pie-chart/pie-chart.js +37 -24
  112. package/dist/pie-chart/pie-chart.js.map +1 -1
  113. package/dist/pie-chart/pie-ring.d.ts +16 -5
  114. package/dist/pie-chart/pie-ring.d.ts.map +1 -1
  115. package/dist/pie-chart/pie-ring.js +89 -55
  116. package/dist/pie-chart/pie-ring.js.map +1 -1
  117. package/dist/pie-chart/shared.d.ts +53 -61
  118. package/dist/pie-chart/shared.d.ts.map +1 -1
  119. package/dist/pie-chart/shared.js +41 -121
  120. package/dist/pie-chart/shared.js.map +1 -1
  121. package/dist/radar-chart/index.d.ts +5 -0
  122. package/dist/radar-chart/index.d.ts.map +1 -0
  123. package/dist/radar-chart/index.js +5 -0
  124. package/dist/radar-chart/index.js.map +1 -0
  125. package/dist/radar-chart/radar-chart.d.ts +218 -0
  126. package/dist/radar-chart/radar-chart.d.ts.map +1 -0
  127. package/dist/radar-chart/radar-chart.js +224 -0
  128. package/dist/radar-chart/radar-chart.js.map +1 -0
  129. package/dist/radar-chart/radar-grid.d.ts +43 -0
  130. package/dist/radar-chart/radar-grid.d.ts.map +1 -0
  131. package/dist/radar-chart/radar-grid.js +61 -0
  132. package/dist/radar-chart/radar-grid.js.map +1 -0
  133. package/dist/radar-chart/radar-series.d.ts +59 -0
  134. package/dist/radar-chart/radar-series.d.ts.map +1 -0
  135. package/dist/radar-chart/radar-series.js +71 -0
  136. package/dist/radar-chart/radar-series.js.map +1 -0
  137. package/dist/radar-chart/shared.d.ts +73 -0
  138. package/dist/radar-chart/shared.d.ts.map +1 -0
  139. package/dist/radar-chart/shared.js +123 -0
  140. package/dist/radar-chart/shared.js.map +1 -0
  141. package/dist/radial-chart/index.d.ts +6 -0
  142. package/dist/radial-chart/index.d.ts.map +1 -0
  143. package/dist/radial-chart/index.js +4 -0
  144. package/dist/radial-chart/index.js.map +1 -0
  145. package/dist/radial-chart/radial-chart.d.ts +216 -0
  146. package/dist/radial-chart/radial-chart.d.ts.map +1 -0
  147. package/dist/radial-chart/radial-chart.js +174 -0
  148. package/dist/radial-chart/radial-chart.js.map +1 -0
  149. package/dist/radial-chart/radial-rings.d.ts +121 -0
  150. package/dist/radial-chart/radial-rings.d.ts.map +1 -0
  151. package/dist/radial-chart/radial-rings.js +273 -0
  152. package/dist/radial-chart/radial-rings.js.map +1 -0
  153. package/dist/radial-chart/shared.d.ts +73 -0
  154. package/dist/radial-chart/shared.d.ts.map +1 -0
  155. package/dist/radial-chart/shared.js +79 -0
  156. package/dist/radial-chart/shared.js.map +1 -0
  157. package/package.json +4 -4
  158. package/registry.json +21 -6
  159. package/src/bar-chart/bar-chart.ts +252 -179
  160. package/src/bar-chart/category-axis.ts +46 -40
  161. package/src/bar-chart/chart-bars.ts +97 -117
  162. package/src/bar-chart/index.ts +7 -10
  163. package/src/bar-chart/shared.ts +78 -238
  164. package/src/engine.ts +5 -2
  165. package/src/index.ts +2 -0
  166. package/src/kit/cartesian.ts +118 -40
  167. package/src/kit/chart-canvas.ts +49 -54
  168. package/src/kit/chart-legend.ts +28 -20
  169. package/src/kit/horizontal-axis.ts +114 -0
  170. package/src/kit/motion.ts +7 -0
  171. package/src/{pie-chart → kit}/pie-legend.ts +12 -11
  172. package/src/kit/polar.ts +54 -0
  173. package/src/kit/shared.ts +55 -277
  174. package/src/kit/style.ts +257 -0
  175. package/src/kit/vertical-axis.ts +67 -48
  176. package/src/line-chart/chart-line.ts +176 -54
  177. package/src/line-chart/chart-region.ts +6 -10
  178. package/src/line-chart/index.ts +14 -10
  179. package/src/line-chart/line-chart.ts +347 -151
  180. package/src/line-chart/shared.ts +193 -174
  181. package/src/line-chart/x-scale.ts +13 -0
  182. package/src/nodes.ts +9 -1
  183. package/src/pie-chart/index.ts +2 -23
  184. package/src/pie-chart/pie-chart.ts +52 -35
  185. package/src/pie-chart/pie-ring.ts +92 -71
  186. package/src/pie-chart/shared.ts +68 -266
  187. package/src/radar-chart/index.ts +4 -0
  188. package/src/radar-chart/radar-chart.ts +287 -0
  189. package/src/radar-chart/radar-grid.ts +78 -0
  190. package/src/radar-chart/radar-series.ts +88 -0
  191. package/src/radar-chart/shared.ts +146 -0
  192. package/src/radial-chart/index.ts +5 -0
  193. package/src/radial-chart/radial-chart.ts +210 -0
  194. package/src/radial-chart/radial-rings.ts +328 -0
  195. package/src/radial-chart/shared.ts +114 -0
  196. package/dist/browser/chunks/chunk-4SMRCU24.js +0 -2
  197. package/dist/browser/chunks/chunk-4SMRCU24.js.map +0 -7
  198. package/dist/kit/chart-border.d.ts +0 -18
  199. package/dist/kit/chart-border.d.ts.map +0 -1
  200. package/dist/kit/chart-border.js +0 -23
  201. package/dist/kit/chart-border.js.map +0 -1
  202. package/dist/line-chart/horizontal-axis.d.ts.map +0 -1
  203. package/dist/line-chart/horizontal-axis.js.map +0 -1
  204. package/dist/pie-chart/pie-legend.d.ts.map +0 -1
  205. package/dist/pie-chart/pie-legend.js.map +0 -1
  206. package/src/kit/chart-border.ts +0 -36
  207. package/src/line-chart/horizontal-axis.ts +0 -122
@@ -1 +1 @@
1
- {"version":3,"file":"chart-line.js","sourceRoot":"","sources":["../../src/line-chart/chart-line.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,WAAW,EACX,SAAS,GAQV,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,GAEV,MAAM,UAAU,CAAA;AAEjB,4IAA4I;AAC5I,SAAS,WAAW,CAAC,GAAc,EAAE,CAAS;IAC5C,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,GAAG,CAAA;IACxC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAA;IAErB,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,IAAI,CAAC,GAAG,CA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pB,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;YACzE,OAAM;QACR,CAAC;QAED,yLAAyL;QACzL,GAAG,CAAC,IAAI,CACN,IAAI,UAAU,EAAE;aACb,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;aAC/B,MAAM,CAAC,MAAM,CAAC;aACd,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CACvD,CAAA;QAED,6IAA6I;QAC7I,KAAK,MAAM,GAAG,IAAI,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;YAChD,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;QACzE,CAAC;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n Graphics2D,\n Types,\n component2d,\n strokeOps,\n type NodeOf,\n // Named so this component's emitted type reaches `Node2D` and its props through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Stroke,\n type StrokeResolved,\n type Vector2,\n} from \"@motionscript/sdk\"\n\nimport { fresh } from \"../kit/entries\"\nimport { frameEase } from \"../kit/motion\"\nimport { loadPaints } from \"../kit/paints\"\nimport { SPOTLIGHT_DIM } from \"../kit/shared\"\nimport {\n EMPTY_REGION_BOX,\n clipPolylineToBox,\n hasRegion,\n type RegionBox,\n} from \"./shared\"\n\n/** The prefix of `pts` revealed at fraction `p`, measured by cumulative arc length so the trace keeps a steady pace over uneven spacing. */\nfunction tracePoints(pts: Vector2[], p: number): Vector2[] {\n if (p >= 1 || pts.length < 2) return pts\n if (p <= 0) return []\n\n const segLen: number[] = []\n let total = 0\n for (let i = 1; i < pts.length; i++) {\n const d = Math.hypot(pts[i].x - pts[i - 1].x, pts[i].y - pts[i - 1].y)\n segLen.push(d)\n total += d\n }\n if (total === 0) return pts\n\n let target = total * p\n const out: Vector2[] = [pts[0]]\n for (let i = 0; i < segLen.length; i++) {\n if (target >= segLen[i]) {\n out.push(pts[i + 1])\n target -= segLen[i]\n } else {\n const t = segLen[i] === 0 ? 0 : target / segLen[i]\n out.push({\n x: pts[i].x + (pts[i + 1].x - pts[i].x) * t,\n y: pts[i].y + (pts[i + 1].y - pts[i].y) * t,\n })\n break\n }\n }\n return out\n}\n\n/** One series of a {@link LineChart}: a rounded polyline through pre-mapped pixel `points`, one {@link Graphics2D} command list. `progress` traces it in; `enabled` shows or hides it wholesale. */\nexport const ChartLine = component2d({\n key: \"chartLine\",\n state: {\n /** In this node's pixel space (origin at centre, y-up), mapped by the parent and ordered along x. */\n points: fresh<Vector2[]>(() => []),\n stroke: Types.custom<Stroke, StrokeResolved[]>([], { resolve: strokeOps.resolve, lerp: strokeOps.lerp }),\n /** Trace from the left end, `[0, 1]`. Rests at 1 so a paused editor canvas paints the line; `enter` drives it from 0. */\n progress: 1,\n /** Whether the line is drawn at all, flipped alongside its legend entry. */\n enabled: true,\n /** In this node's pixel space; outside it the line drops to `dimOpacity`. */\n spotlight: fresh<RegionBox>(() => EMPTY_REGION_BOX),\n dimOpacity: SPOTLIGHT_DIM,\n },\n load: (loader, state) => loadPaints(loader, { strokes: [state.stroke] }),\n commands: {\n /**\n * Trace the line from `from` to `to`; `showSeries`/`hideSeries` are this with\n * the ends stated. `enabled` rides along in the same value, so the line is\n * drawable for every `t` the trace covers and arriving backwards matches\n * arriving forwards.\n */\n enter: {\n args: { from: Types.number(0, { min: 0, max: 1 }), to: Types.number(1, { min: 0, max: 1 }) },\n run: (timeline) => {\n const { from, to } = timeline.args\n const ease = frameEase(timeline)\n return timeline.animate((t) => {\n const progress = from + (to - from) * ease(t)\n // Hidden only once fully retraced, so a hide does not vanish a frame early.\n return { progress, enabled: progress > 0 }\n })\n },\n },\n },\n render: (ctx, state) => {\n if (!state.enabled) return\n const pts = state.points\n if (pts.length < 2) return\n\n const p = Math.max(0, Math.min(1, state.progress))\n if (p <= 0) return\n\n const drawn = tracePoints(pts, p)\n if (drawn.length < 2) return\n const stroke = state.stroke\n const radius = (stroke[0]?.weight ?? 0) * 2\n\n const box = state.spotlight\n if (!hasRegion(box)) {\n ctx.draw(new Graphics2D().line({ points: drawn, radius }).stroke(stroke))\n return\n }\n\n // Dim the whole line, then redraw the stretches inside the region at full strength: the bright run keeps continuous geometry and round joins, and the boundary lands on the region edge.\n ctx.draw(\n new Graphics2D()\n .line({ points: drawn, radius })\n .stroke(stroke)\n .opacity(Math.max(0, Math.min(1, state.dimOpacity)))\n )\n\n // One `draw` per run: shapes chained before `stroke()` combine into one surface, and stroking a union of disjoint open paths paints nothing.\n for (const run of clipPolylineToBox(drawn, box)) {\n ctx.draw(new Graphics2D().line({ points: run, radius }).stroke(stroke))\n }\n },\n})\n\nexport type ChartLine = NodeOf<typeof ChartLine>\n"]}
1
+ {"version":3,"file":"chart-line.js","sourceRoot":"","sources":["../../src/line-chart/chart-line.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,GAYV,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAi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EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE;QAC/C,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE;KACjD,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import {\n Graphics2D,\n Types,\n clamp,\n component2d,\n fillOps,\n strokeOps,\n type Fill,\n type FillResolved,\n type NodeOf,\n // Named so this component's emitted type reaches `Node2D` and its props through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type PathCommand,\n type RenderContext,\n type Stroke,\n type StrokeResolved,\n type Vector2,\n} from \"@motionscript/sdk\"\n\nimport { fade } from \"../kit/cartesian\"\nimport { fresh } from \"../kit/entries\"\nimport { frameEase } from \"../kit/motion\"\nimport { loadPaints } from \"../kit/paints\"\nimport { SPOTLIGHT_DIM } from \"../kit/shared\"\nimport {\n EMPTY_REGION_BOX,\n clipPolygonToBox,\n clipPolylineToBox,\n cutAt,\n curvePoints,\n hasRegion,\n type LineCurve,\n type RegionBox,\n} from \"./shared\"\n\n/** The x a trace at `progress` has reached, across `points` ordered along x. */\nexport function traceX(points: readonly Vector2[], progress: number): number {\n if (points.length === 0) return 0\n const first = points[0].x\n const last = points[points.length - 1].x\n return progress >= 1 ? Infinity : first + (last - first) * progress\n}\n\n/** The drawn path at `progress`: the whole curve once traced, else the part left of the trace. */\nfunction traced(points: readonly Vector2[], curve: LineCurve, progress: number): Vector2[] {\n const path = curvePoints(points, curve)\n return progress >= 1 ? path : cutAt(path, traceX(points, progress))\n}\n\nconst curveEntry = () => Types.custom<LineCurve>(\"smooth\")\n\n/** A closed outline as path commands. */\nfunction outlineCommands(points: readonly Vector2[]): PathCommand[] {\n return [...points.map((p, i): PathCommand => ({ type: i === 0 ? \"M\" : \"L\", x: p.x, y: p.y })), { type: \"Z\" }]\n}\n\nfunction fillOutline(ctx: RenderContext, outline: readonly Vector2[], fill: FillResolved[], opacity: number): void {\n if (outline.length < 3 || opacity <= 0) return\n const { width, height } = ctx.size\n // A frame symmetric about the origin, so the outline draws where its points say rather than re-centred on itself.\n const centerBounds: [number, number, number, number] = [-width / 2, -height / 2, width / 2, height / 2]\n ctx.draw(new Graphics2D().path({ data: outlineCommands(outline), centerBounds }).fill(fill).opacity(opacity))\n}\n\n/**\n * One series of a {@link LineChart}: its line through pre-mapped pixel `points`,\n * shaped by `curve`, and a dot on each point. `progress` traces it in from the\n * left; `enabled` shows or hides it wholesale.\n */\nexport const ChartLine = component2d({\n key: \"chartLine\",\n state: {\n /** In this node's pixel space (origin at centre, y-up), mapped by the parent and ordered along x. */\n points: fresh<Vector2[]>(() => []),\n curve: curveEntry(),\n stroke: Types.custom<Stroke, StrokeResolved[]>([], { resolve: strokeOps.resolve, lerp: strokeOps.lerp }),\n /** A dot of `dotSize` on each point, in `dotFill`; none at size 0. */\n dotSize: 0,\n dotFill: Types.custom<Fill, FillResolved[]>([], { resolve: fillOps.resolve, lerp: fillOps.lerp }),\n /** Trace from the left end, `[0, 1]`. Rests at 1 so a paused editor canvas paints the line; `enter` drives it from 0. */\n progress: 1,\n /** Whether the line is drawn at all, flipped alongside its legend entry. */\n enabled: true,\n /** In this node's pixel space; outside it the line drops to `dimOpacity`. */\n spotlight: fresh<RegionBox>(() => EMPTY_REGION_BOX),\n dimOpacity: SPOTLIGHT_DIM,\n },\n load: (loader, state) => loadPaints(loader, { fills: [state.dotFill], strokes: [state.stroke] }),\n commands: {\n /**\n * Trace the line from `from` to `to`; `showSeries`/`hideSeries` are this with\n * the ends stated. `enabled` rides along in the same value, so the line is\n * drawable for every `t` the trace covers and arriving backwards matches\n * arriving forwards.\n */\n enter: {\n args: { from: Types.number(0, { min: 0, max: 1 }), to: Types.number(1, { min: 0, max: 1 }) },\n run: (timeline) => {\n const { from, to } = timeline.args\n const ease = frameEase(timeline)\n return timeline.animate((t) => {\n const progress = from + (to - from) * ease(t)\n // Hidden only once fully retraced, so a hide does not vanish a frame early.\n return { progress, enabled: progress > 0 }\n })\n },\n },\n /** Hold the line fully traced while its chart moves it, switched on throughout a show and off once a hide lands. */\n hold: {\n args: { shown: Types.boolean(true) },\n run: (timeline) => {\n const { shown } = timeline.args\n return timeline.animate((t) => ({ progress: 1, enabled: shown || t < 1 }), { eased: false })\n },\n },\n },\n render: (ctx, state) => {\n if (!state.enabled) return\n const pts = state.points\n const p = clamp(state.progress, 0, 1)\n if (pts.length === 0 || p <= 0) return\n\n const box = state.spotlight\n const lit = hasRegion(box)\n const dim = clamp(state.dimOpacity, 0, 1)\n const stroke = state.stroke\n const weight = stroke[0]?.weight ?? 0\n const drawn = traced(pts, state.curve, p)\n\n if (drawn.length >= 2 && weight > 0) {\n // Rounded corners only where the line has corners to round.\n const radius = state.curve === \"linear\" ? weight * 2 : 0\n ctx.draw(new Graphics2D().line({ points: drawn, radius }).stroke(stroke).opacity(lit ? dim : 1))\n // One `draw` per run: shapes chained before `stroke()` combine into one surface, and stroking a union of disjoint open paths paints nothing.\n if (lit) for (const run of clipPolylineToBox(drawn, box)) ctx.draw(new Graphics2D().line({ points: run, radius }).stroke(stroke))\n }\n\n const size = state.dotSize\n if (size <= 0) return\n const reach = traceX(pts, p)\n const bright = new Graphics2D()\n const dimmed = new Graphics2D()\n let brightAny = false\n let dimAny = false\n for (const pt of pts) {\n // A dot grows in as the trace passes it.\n const grown = reach === Infinity ? 1 : clamp((reach - pt.x) / (size * 2), 0, 1)\n if (grown <= 0) continue\n const inside = !lit || (pt.x >= box.left && pt.x <= box.right && pt.y >= box.bottom && pt.y <= box.top)\n ;(inside ? bright : dimmed).ellipse({ x: pt.x, y: pt.y, width: size * grown, height: size * grown })\n if (inside) brightAny = true\n else dimAny = true\n }\n if (dimAny) ctx.draw(dimmed.fill(state.dotFill).opacity(dim))\n if (brightAny) ctx.draw(bright.fill(state.dotFill))\n },\n})\n\nexport type ChartLine = NodeOf<typeof ChartLine>\n\n/**\n * The fill under one series of a {@link LineChart}: down to `base` (the series\n * below it in a stack) or, without one, to the `baseline`. Drawn by its own node\n * so every area sits under every line; the chart binds its trace, switch and\n * opacity to its line's, so the two move as one.\n */\nexport const ChartArea = component2d({\n key: \"chartArea\",\n state: {\n /** The series' points, as its line has them. */\n points: fresh<Vector2[]>(() => []),\n /** The line the area fills down to, at the same x positions; empty for the baseline. */\n base: fresh<Vector2[]>(() => []),\n /** Pixel y of the baseline. */\n baseline: 0,\n curve: curveEntry(),\n area: Types.custom<\"none\" | \"solid\" | \"gradient\">(\"solid\"),\n /** The series colour; the area paints it at `areaOpacity`, a gradient fading it out towards the bottom. */\n fill: Types.custom<Fill, FillResolved[]>([], { resolve: fillOps.resolve, lerp: fillOps.lerp }),\n areaOpacity: 0.4,\n progress: 1,\n enabled: true,\n spotlight: fresh<RegionBox>(() => EMPTY_REGION_BOX),\n dimOpacity: SPOTLIGHT_DIM,\n },\n load: (loader, state) => loadPaints(loader, { fills: [state.fill] }),\n render: (ctx, state) => {\n const pts = state.points\n const p = clamp(state.progress, 0, 1)\n if (!state.enabled || state.area === \"none\" || pts.length < 2 || p <= 0 || state.fill.length === 0) return\n const outlineAt = (progress: number) => {\n const top = traced(pts, state.curve, progress)\n if (top.length < 2) return []\n const base = state.base.length === pts.length\n ? traced(state.base, state.curve, progress)\n : [{ x: top[0].x, y: state.baseline }, { x: top[top.length - 1].x, y: state.baseline }]\n return [...top, ...[...base].reverse()]\n }\n // The gradient spans the whole area's height, so it holds still while the area traces in and across a spotlight's cut.\n const span = verticalSpan(outlineAt(1))\n const paint = (outline: readonly Vector2[], opacity: number) =>\n fillOutline(ctx, outline, areaFill(state.fill, state.area, state.areaOpacity, span, verticalSpan(outline)), opacity)\n const outline = outlineAt(p)\n const box = state.spotlight\n if (!hasRegion(box)) {\n paint(outline, 1)\n return\n }\n paint(outline, clamp(state.dimOpacity, 0, 1))\n paint(clipPolygonToBox(outline, box), 1)\n },\n})\n\ninterface Span {\n readonly top: number\n readonly bottom: number\n}\n\nfunction verticalSpan(points: readonly Vector2[]): Span {\n let top = -Infinity\n let bottom = Infinity\n for (const p of points) {\n if (p.y > top) top = p.y\n if (p.y < bottom) bottom = p.y\n }\n return { top, bottom }\n}\n\n/**\n * The area's paint for an outline spanning `own`: the series colour at\n * `opacity`, or for a gradient that colour fading to nearly nothing across\n * `whole`. A gradient maps onto the bounds of the shape it fills, so its ends\n * are placed in `own`'s unit box (y-up) at `whole`'s top and bottom.\n */\nexport function areaFill(colour: FillResolved[], area: \"none\" | \"solid\" | \"gradient\", opacity: number, whole: Span, own: Span): FillResolved[] {\n const top = colour[colour.length - 1]\n if (area !== \"gradient\" || top?.type !== \"solid\" || !(own.top > own.bottom)) return fade(colour, opacity) as FillResolved[]\n const [r, g, b, a] = top.color\n const middle = (own.top + own.bottom) / 2\n const half = (own.top - own.bottom) / 2\n return fillOps.resolve({\n type: \"linear-gradient\",\n colors: [[r, g, b, a * opacity], [r, g, b, a * opacity * 0.04]],\n start: { x: 0, y: (whole.top - middle) / half },\n end: { x: 0, y: (whole.bottom - middle) / half },\n })\n}\n\nexport type ChartArea = NodeOf<typeof ChartArea>\n"]}
@@ -3,7 +3,7 @@ import { type RegionBox } from "./shared.js";
3
3
  /**
4
4
  * The call-out of a {@link LineChart}: a washed rectangle with a dashed rule on
5
5
  * each bounded edge, drawn from the pre-mapped `box`. Dimming the series outside
6
- * is {@link ChartLine}'s job, clipped against the same box so the two agree on
6
+ * is the line's and area's job, clipped against the same box so they agree on
7
7
  * the boundary. An unbounded edge is the plot's own border, and a rule there
8
8
  * would assert a limit the author did not set.
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chart-region.d.ts","sourceRoot":"","sources":["../../src/line-chart/chart-region.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,MAAM,EAEX,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,MAAM,EACX,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAA;AAI1B,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,UAAU,CAAA;AAEjB;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;IAGpB,iHAAiH;;;;IAIjH,8FAA8F;;;IAJ9F,iHAAiH;;;;IAIjH,8FAA8F;;;IAJ9F,iHAAiH;;;;IAIjH,8FAA8F;;gCAmChG,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA"}
1
+ {"version":3,"file":"chart-region.d.ts","sourceRoot":"","sources":["../../src/line-chart/chart-region.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,MAAM,EAEX,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,MAAM,EACX,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAA;AAK1B,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,UAAU,CAAA;AAEjB;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;IAGpB,iHAAiH;;;;IAIjH,8FAA8F;;;IAJ9F,iHAAiH;;;;IAIjH,8FAA8F;;;IAJ9F,iHAAiH;;;;IAIjH,8FAA8F;;gCA+BhG,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA"}
@@ -1,11 +1,12 @@
1
1
  import { Graphics2D, Types, component2d, fillOps, strokeOps, } from "@motionscript/sdk";
2
+ import { rule } from "../kit/chart-canvas.js";
2
3
  import { fresh } from "../kit/entries.js";
3
4
  import { loadPaints } from "../kit/paints.js";
4
- import { DEFAULT_CHART_THEME, EMPTY_REGION_BOX, hasRegion, } from "./shared.js";
5
+ import { EMPTY_REGION_BOX, hasRegion, } from "./shared.js";
5
6
  /**
6
7
  * The call-out of a {@link LineChart}: a washed rectangle with a dashed rule on
7
8
  * each bounded edge, drawn from the pre-mapped `box`. Dimming the series outside
8
- * is {@link ChartLine}'s job, clipped against the same box so the two agree on
9
+ * is the line's and area's job, clipped against the same box so they agree on
9
10
  * the boundary. An unbounded edge is the plot's own border, and a rule there
10
11
  * would assert a limit the author did not set.
11
12
  */
@@ -14,8 +15,8 @@ export const ChartRegion = component2d({
14
15
  state: {
15
16
  /** In this node's pixel space (origin at centre, y-up), mapped by the parent. A degenerate box draws nothing. */
16
17
  box: fresh(() => EMPTY_REGION_BOX),
17
- stroke: Types.custom(DEFAULT_CHART_THEME.region.stroke, { resolve: strokeOps.resolve, lerp: strokeOps.lerp }),
18
- fill: Types.custom(DEFAULT_CHART_THEME.region.fill, { resolve: fillOps.resolve, lerp: fillOps.lerp }),
18
+ stroke: Types.custom({ weight: 2, fill: "white/70", dash: [14, 12], cap: "butt", align: "center" }, { resolve: strokeOps.resolve, lerp: strokeOps.lerp }),
19
+ fill: Types.custom("white/6", { resolve: fillOps.resolve, lerp: fillOps.lerp }),
19
20
  /** Driven by the chart's `regionReveal`, so the rules and the series' dimming move as one. */
20
21
  reveal: 0,
21
22
  },
@@ -36,17 +37,15 @@ export const ChartRegion = component2d({
36
37
  }
37
38
  if (state.stroke.length === 0)
38
39
  return;
39
- // One `draw` per rule: stroking a union of disjoint open paths paints nothing.
40
- const rule = (points) => ctx.draw(new Graphics2D().line({ points }).stroke(state.stroke).opacity(r));
41
40
  if (box.xBounded) {
42
41
  const half = (height / 2) * r;
43
42
  for (const x of [box.left, box.right])
44
- rule([{ x, y: cy - half }, { x, y: cy + half }]);
43
+ rule(ctx, { x, y: cy - half }, { x, y: cy + half }, state.stroke, r);
45
44
  }
46
45
  if (box.yBounded) {
47
46
  const half = (width / 2) * r;
48
47
  for (const y of [box.bottom, box.top])
49
- rule([{ x: cx - half, y }, { x: cx + half, y }]);
48
+ rule(ctx, { x: cx - half, y }, { x: cx + half, y }, state.stroke, r);
50
49
  }
51
50
  },
52
51
  });
@@ -1 +1 @@
1
-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GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;YAC7B,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC;gBAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAA;QACzF,CAAC;QACD,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;YAC5B,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC;gBAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QACzF,CAAC;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n Graphics2D,\n Types,\n component2d,\n fillOps,\n strokeOps,\n type Fill,\n type FillResolved,\n type NodeOf,\n // Named so this component's emitted type reaches `Node2D` and its props through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Stroke,\n type StrokeResolved,\n} from \"@motionscript/sdk\"\n\nimport { fresh } from \"../kit/entries\"\nimport { loadPaints } from \"../kit/paints\"\nimport {\n DEFAULT_CHART_THEME,\n EMPTY_REGION_BOX,\n hasRegion,\n type RegionBox,\n} from \"./shared\"\n\n/**\n * The call-out of a {@link LineChart}: a washed rectangle with a dashed rule on\n * each bounded edge, drawn from the pre-mapped `box`. Dimming the series outside\n * is {@link ChartLine}'s job, clipped against the same box so the two agree on\n * the boundary. An unbounded edge is the plot's own border, and a rule there\n * would assert a limit the author did not set.\n */\nexport const ChartRegion = component2d({\n key: \"chartRegion\",\n state: {\n /** In this node's pixel space (origin at centre, y-up), mapped by the parent. A degenerate box draws nothing. */\n box: fresh<RegionBox>(() => EMPTY_REGION_BOX),\n stroke: Types.custom<Stroke, StrokeResolved[]>(DEFAULT_CHART_THEME.region.stroke, { resolve: strokeOps.resolve, lerp: strokeOps.lerp }),\n fill: Types.custom<Fill, FillResolved[]>(DEFAULT_CHART_THEME.region.fill, { resolve: fillOps.resolve, lerp: fillOps.lerp }),\n /** Driven by the chart's `regionReveal`, so the rules and the series' dimming move as one. */\n reveal: 0,\n },\n load: (loader, state) => loadPaints(loader, { fills: [state.fill], strokes: [state.stroke] }),\n render: (ctx, state) => {\n const box = state.box\n if (!hasRegion(box)) return\n\n const r = Math.max(0, Math.min(1, state.reveal))\n if (r <= 0) return\n\n const width = box.right - box.left\n const height = box.top - box.bottom\n const cx = (box.left + box.right) / 2\n const cy = (box.bottom + box.top) / 2\n\n if (state.fill.length > 0) {\n ctx.draw(new Graphics2D().rect({ x: cx, y: cy, width, height }).fill(state.fill).opacity(r))\n }\n\n if (state.stroke.length === 0) return\n\n // One `draw` per rule: stroking a union of disjoint open paths paints nothing.\n const rule = (points: { x: number; y: number }[]) =>\n ctx.draw(new Graphics2D().line({ points }).stroke(state.stroke).opacity(r))\n\n if (box.xBounded) {\n const half = (height / 2) * r\n for (const x of [box.left, box.right]) rule([{ x, y: cy - half }, { x, y: cy + half }])\n }\n if (box.yBounded) {\n const half = (width / 2) * r\n for (const y of [box.bottom, box.top]) rule([{ x: cx - half, y }, { x: cx + half, y }])\n }\n },\n})\n\nexport type ChartRegion = NodeOf<typeof ChartRegion>\n"]}
1
+ {"version":3,"file":"chart-region.js","sourceRoot":"","sources":["../../src/line-chart/chart-region.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,GASV,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AA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QACD,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;YAC5B,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC;gBAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QAC7G,CAAC;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n Graphics2D,\n Types,\n component2d,\n fillOps,\n strokeOps,\n type Fill,\n type FillResolved,\n type NodeOf,\n // Named so this component's emitted type reaches `Node2D` and its props through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Stroke,\n type StrokeResolved,\n} from \"@motionscript/sdk\"\n\nimport { rule } from \"../kit/chart-canvas\"\nimport { fresh } from \"../kit/entries\"\nimport { loadPaints } from \"../kit/paints\"\nimport {\n EMPTY_REGION_BOX,\n hasRegion,\n type RegionBox,\n} from \"./shared\"\n\n/**\n * The call-out of a {@link LineChart}: a washed rectangle with a dashed rule on\n * each bounded edge, drawn from the pre-mapped `box`. Dimming the series outside\n * is the line's and area's job, clipped against the same box so they agree on\n * the boundary. An unbounded edge is the plot's own border, and a rule there\n * would assert a limit the author did not set.\n */\nexport const ChartRegion = component2d({\n key: \"chartRegion\",\n state: {\n /** In this node's pixel space (origin at centre, y-up), mapped by the parent. A degenerate box draws nothing. */\n box: fresh<RegionBox>(() => EMPTY_REGION_BOX),\n stroke: Types.custom<Stroke, StrokeResolved[]>({ weight: 2, fill: \"white/70\", dash: [14, 12], cap: \"butt\", align: \"center\" }, { resolve: strokeOps.resolve, lerp: strokeOps.lerp }),\n fill: Types.custom<Fill, FillResolved[]>(\"white/6\", { resolve: fillOps.resolve, lerp: fillOps.lerp }),\n /** Driven by the chart's `regionReveal`, so the rules and the series' dimming move as one. */\n reveal: 0,\n },\n load: (loader, state) => loadPaints(loader, { fills: [state.fill], strokes: [state.stroke] }),\n render: (ctx, state) => {\n const box = state.box\n if (!hasRegion(box)) return\n\n const r = Math.max(0, Math.min(1, state.reveal))\n if (r <= 0) return\n\n const width = box.right - box.left\n const height = box.top - box.bottom\n const cx = (box.left + box.right) / 2\n const cy = (box.bottom + box.top) / 2\n\n if (state.fill.length > 0) {\n ctx.draw(new Graphics2D().rect({ x: cx, y: cy, width, height }).fill(state.fill).opacity(r))\n }\n\n if (state.stroke.length === 0) return\n\n if (box.xBounded) {\n const half = (height / 2) * r\n for (const x of [box.left, box.right]) rule(ctx, { x, y: cy - half }, { x, y: cy + half }, state.stroke, r)\n }\n if (box.yBounded) {\n const half = (width / 2) * r\n for (const y of [box.bottom, box.top]) rule(ctx, { x: cx - half, y }, { x: cx + half, y }, state.stroke, r)\n }\n },\n})\n\nexport type ChartRegion = NodeOf<typeof ChartRegion>\n"]}
@@ -1,10 +1,9 @@
1
1
  export { LineChart, lineChartDomains } from "./line-chart.js";
2
- export type { LineChartDomains, LineChartValues } from "./line-chart.js";
2
+ export type { LineChartDomains, LineChartStyle, LineChartValues } from "./line-chart.js";
3
3
  export { ChartRegion } from "./chart-region.js";
4
- export { ChartLine } from "./chart-line.js";
5
- export { HorizontalAxis } from "./horizontal-axis.js";
6
- export { DEFAULT_CHART_THEME, EMPTY_REGION_BOX, clipPolylineToBox, hasRegion, lerpChartTheme, resolveChartTheme, resolveRegionBox, resolveYScale, seriesPoints, yExtent, } from "./shared.js";
7
- export type { ChartConfig, ChartTheme, LineSeries, PlotRegion, RegionBox, RegionConfig, } from "./shared.js";
8
- export { formatInstant, parseInstant, resolveXScale } from "./x-scale.js";
4
+ export { ChartArea, ChartLine, areaFill, traceX } from "./chart-line.js";
5
+ export { EMPTY_REGION_BOX, LINE_LABELS, LINE_MARKS, clipPolygonToBox, clipPolylineToBox, curvePoints, cutAt, hasRegion, resolveRegionBox, resolveYScale, seriesPoints, stackExtent, stackSeries, yExtent, } from "./shared.js";
6
+ export type { LineCurve, LineSeries, LineStack, PlotRegion, RegionBox, StackedSeries, } from "./shared.js";
7
+ export { EVERY_SAMPLE, formatInstant, parseInstant, resolveXScale } from "./x-scale.js";
9
8
  export type { XScale, XScaleKind } from "./x-scale.js";
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/line-chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC1D,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,OAAO,GACR,MAAM,UAAU,CAAA;AACjB,YAAY,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACtE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/line-chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC1D,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrE,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,SAAS,EAET,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,GACR,MAAM,UAAU,CAAA;AACjB,YAAY,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,GACd,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACpF,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA"}
@@ -1,7 +1,6 @@
1
1
  export { LineChart, lineChartDomains } from "./line-chart.js";
2
2
  export { ChartRegion } from "./chart-region.js";
3
- export { ChartLine } from "./chart-line.js";
4
- export { HorizontalAxis } from "./horizontal-axis.js";
5
- export { DEFAULT_CHART_THEME, EMPTY_REGION_BOX, clipPolylineToBox, hasRegion, lerpChartTheme, resolveChartTheme, resolveRegionBox, resolveYScale, seriesPoints, yExtent, } from "./shared.js";
6
- export { formatInstant, parseInstant, resolveXScale } from "./x-scale.js";
3
+ export { ChartArea, ChartLine, areaFill, traceX } from "./chart-line.js";
4
+ export { EMPTY_REGION_BOX, LINE_LABELS, LINE_MARKS, clipPolygonToBox, clipPolylineToBox, curvePoints, cutAt, hasRegion, resolveRegionBox, resolveYScale, seriesPoints, stackExtent, stackSeries, yExtent, } from "./shared.js";
5
+ export { EVERY_SAMPLE, formatInstant, parseInstant, resolveXScale } from "./x-scale.js";
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/line-chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,OAAO,GACR,MAAM,UAAU,CAAA;AASjB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA","sourcesContent":["export { LineChart, lineChartDomains } from \"./line-chart\"\nexport type { LineChartDomains, LineChartValues } from \"./line-chart\"\nexport { ChartRegion } from \"./chart-region\"\nexport { ChartLine } from \"./chart-line\"\nexport { HorizontalAxis } from \"./horizontal-axis\"\nexport {\n DEFAULT_CHART_THEME,\n EMPTY_REGION_BOX,\n clipPolylineToBox,\n hasRegion,\n lerpChartTheme,\n resolveChartTheme,\n resolveRegionBox,\n resolveYScale,\n seriesPoints,\n yExtent,\n} from \"./shared\"\nexport type {\n ChartConfig,\n ChartTheme,\n LineSeries,\n PlotRegion,\n RegionBox,\n RegionConfig,\n} from \"./shared\"\nexport { formatInstant, parseInstant, resolveXScale } from \"./x-scale\"\nexport type { XScale, XScaleKind } from \"./x-scale\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/line-chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrE,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,SAAS,EAET,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,GACR,MAAM,UAAU,CAAA;AASjB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA","sourcesContent":["export { LineChart, lineChartDomains } from \"./line-chart\"\nexport type { LineChartDomains, LineChartStyle, LineChartValues } from \"./line-chart\"\nexport { ChartRegion } from \"./chart-region\"\nexport { ChartArea, ChartLine, areaFill, traceX } from \"./chart-line\"\nexport {\n EMPTY_REGION_BOX,\n LINE_LABELS,\n LINE_MARKS,\n clipPolygonToBox,\n clipPolylineToBox,\n curvePoints,\n cutAt,\n hasRegion,\n\n resolveRegionBox,\n resolveYScale,\n seriesPoints,\n stackExtent,\n stackSeries,\n yExtent,\n} from \"./shared\"\nexport type {\n LineCurve,\n LineSeries,\n LineStack,\n PlotRegion,\n RegionBox,\n StackedSeries,\n} from \"./shared\"\nexport { EVERY_SAMPLE, formatInstant, parseInstant, resolveXScale } from \"./x-scale\"\nexport type { XScale, XScaleKind } from \"./x-scale\"\n"]}
@@ -1,6 +1,63 @@
1
- import { type DataRecord, type NodeOf, type Node2D, type Node2DProps as _Node2DProps } from "@motionscript/sdk";
1
+ import { type DataRecord, type NodeOf, type OutOf, type Node2D, type Node2DProps as _Node2DProps, type Fill as _Fill, type FillResolved as _FillResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved, type StyleInput as _StyleInput, type StyleValues as _StyleValues } from "@motionscript/sdk";
2
2
  import { type AxisDomainConfig, type ResolvedAxisDomain } from "../kit/shared.js";
3
- import { type ChartConfig, type ChartTheme, type LineSeries, type PlotRegion } from "./shared.js";
3
+ import { type LineSeries, type LineStack, type PlotRegion } from "./shared.js";
4
+ declare const LINE_STYLE: import("@motionscript/sdk").Type<_StyleInput<{
5
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
6
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
7
+ } & {
8
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
9
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
10
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
11
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
12
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
13
+ } & {
14
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
15
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
16
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
17
+ } & {
18
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
19
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
20
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
21
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
22
+ } & {
23
+ strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
24
+ curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
25
+ dots: import("@motionscript/sdk").Type<boolean, boolean, false>;
26
+ dotSize: import("@motionscript/sdk").Type<number, number, false>;
27
+ area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
28
+ areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
29
+ } & {
30
+ values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
31
+ }>, _StyleValues<{
32
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
33
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
34
+ } & {
35
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
36
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
37
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
38
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
39
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
40
+ } & {
41
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
42
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
43
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
44
+ } & {
45
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
46
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
47
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
48
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
49
+ } & {
50
+ strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
51
+ curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
52
+ dots: import("@motionscript/sdk").Type<boolean, boolean, false>;
53
+ dotSize: import("@motionscript/sdk").Type<number, number, false>;
54
+ area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
55
+ areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
56
+ } & {
57
+ values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
58
+ }>, false>;
59
+ /** A line chart's resolved style. */
60
+ export type LineChartStyle = OutOf<typeof LINE_STYLE>;
4
61
  /** Both axes' domains with their ranges and ticks resolved. */
5
62
  export interface LineChartDomains {
6
63
  readonly x: ResolvedAxisDomain;
@@ -11,16 +68,23 @@ export interface LineChartValues {
11
68
  readonly data: DataRecord[];
12
69
  readonly xField: string;
13
70
  readonly series: LineSeries[];
71
+ readonly stack: LineStack;
14
72
  readonly xAxis: AxisDomainConfig;
15
73
  readonly yAxis: AxisDomainConfig;
74
+ /** Each series' share of a stack, `1` when missing. */
75
+ readonly weights?: readonly number[];
76
+ /** An area must reach its baseline, so a chart with areas keeps zero on the scale. */
77
+ readonly style?: {
78
+ readonly area: string;
79
+ };
16
80
  }
17
81
  /** Both axes as drawn now. */
18
82
  export declare function lineChartDomains(s: LineChartValues): LineChartDomains;
19
83
  /**
20
- * A multi-series line chart composed of {@link ChartCanvas}, {@link VerticalAxis} /
21
- * {@link HorizontalAxis}, {@link ChartRegion}, one {@link ChartLine} per series and
22
- * {@link ChartLegend}. Every part reads the chart's entries through bindings and
23
- * maps against the plot panel's own laid-out box.
84
+ * A multi-series line or area chart composed of {@link ChartCanvas}, the value
85
+ * and x axes, {@link ChartRegion}, a {@link ChartArea} and a {@link ChartLine}
86
+ * per series, and {@link ChartLegend}. Every part reads the chart's entries
87
+ * through bindings and maps against the plot panel's own laid-out box.
24
88
  *
25
89
  * Resting state is the finished chart; `enter` arms every part on its first
26
90
  * frame. A `to` of an axis `range` or `ticks` tweens from the domain as drawn
@@ -30,17 +94,75 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
30
94
  readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
31
95
  readonly xField: "";
32
96
  readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
97
+ /** `stacked`: each series sits on the sum of those before it; `percent`: every row reads as shares of 100. */
98
+ readonly stack: import("@motionscript/sdk").Type<"none" | "percent" | "stacked", "none" | "percent" | "stacked", false>;
33
99
  readonly xAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
34
100
  readonly yAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
35
- readonly theme: import("@motionscript/sdk").Type<ChartTheme, ChartConfig, false>;
101
+ readonly style: import("@motionscript/sdk").Type<_StyleInput<{
102
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
103
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
104
+ } & {
105
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
106
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
107
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
108
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
109
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
110
+ } & {
111
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
112
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
113
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
114
+ } & {
115
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
116
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
117
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
118
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
119
+ } & {
120
+ strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
121
+ curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
122
+ dots: import("@motionscript/sdk").Type<boolean, boolean, false>;
123
+ dotSize: import("@motionscript/sdk").Type<number, number, false>;
124
+ area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
125
+ areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
126
+ } & {
127
+ values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
128
+ }>, _StyleValues<{
129
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
130
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
131
+ } & {
132
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
133
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
134
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
135
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
136
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
137
+ } & {
138
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
139
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
140
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
141
+ } & {
142
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
143
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
144
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
145
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
146
+ } & {
147
+ strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
148
+ curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
149
+ dots: import("@motionscript/sdk").Type<boolean, boolean, false>;
150
+ dotSize: import("@motionscript/sdk").Type<number, number, false>;
151
+ area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
152
+ areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
153
+ } & {
154
+ values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
155
+ }>, false>;
36
156
  /** The spotlit slice in data units, or `null`. The box snaps; {@link regionReveal} animates it. */
37
157
  readonly region: import("@motionscript/sdk").Type<PlotRegion | null, PlotRegion | null, false>;
38
- /** How far the `region` call-out is drawn in, `[0, 1]`: rules grow, wash fades up, out-of-region stretches fade to `region.dimOpacity`. */
158
+ /** How far the `region` call-out is drawn in, `[0, 1]`: rules grow, wash fades up, out-of-region stretches fade. */
39
159
  readonly regionReveal: 0;
40
- /** Read as the chart is built: the legend is a part the chart builds or doesn't. */
41
- readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
42
160
  /** The domain `zoomTo` first left, so `resetZoom` restores it, auto-derived ticks included. */
43
161
  readonly home: import("@motionscript/sdk").Type<LineChartDomains | null, LineChartDomains | null, false>;
162
+ /** Each series' share of a stack, seeded from `enabled`: a weight rather than a switch, so a hidden series sinks out. */
163
+ readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
164
+ /** Whether the plot clips its marks, from a zoom's first frame until a reset lands. */
165
+ readonly clipped: import("@motionscript/sdk").Type<boolean, boolean, true>;
44
166
  }>, {
45
167
  readonly enter: {};
46
168
  readonly spotlightRegion: {
@@ -64,32 +186,148 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
64
186
  readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
65
187
  readonly xField: "";
66
188
  readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
189
+ /** `stacked`: each series sits on the sum of those before it; `percent`: every row reads as shares of 100. */
190
+ readonly stack: import("@motionscript/sdk").Type<"none" | "percent" | "stacked", "none" | "percent" | "stacked", false>;
67
191
  readonly xAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
68
192
  readonly yAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
69
- readonly theme: import("@motionscript/sdk").Type<ChartTheme, ChartConfig, false>;
193
+ readonly style: import("@motionscript/sdk").Type<_StyleInput<{
194
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
195
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
196
+ } & {
197
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
198
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
199
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
200
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
201
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
202
+ } & {
203
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
204
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
205
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
206
+ } & {
207
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
208
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
209
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
210
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
211
+ } & {
212
+ strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
213
+ curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
214
+ dots: import("@motionscript/sdk").Type<boolean, boolean, false>;
215
+ dotSize: import("@motionscript/sdk").Type<number, number, false>;
216
+ area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
217
+ areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
218
+ } & {
219
+ values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
220
+ }>, _StyleValues<{
221
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
222
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
223
+ } & {
224
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
225
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
226
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
227
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
228
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
229
+ } & {
230
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
231
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
232
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
233
+ } & {
234
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
235
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
236
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
237
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
238
+ } & {
239
+ strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
240
+ curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
241
+ dots: import("@motionscript/sdk").Type<boolean, boolean, false>;
242
+ dotSize: import("@motionscript/sdk").Type<number, number, false>;
243
+ area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
244
+ areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
245
+ } & {
246
+ values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
247
+ }>, false>;
70
248
  /** The spotlit slice in data units, or `null`. The box snaps; {@link regionReveal} animates it. */
71
249
  readonly region: import("@motionscript/sdk").Type<PlotRegion | null, PlotRegion | null, false>;
72
- /** How far the `region` call-out is drawn in, `[0, 1]`: rules grow, wash fades up, out-of-region stretches fade to `region.dimOpacity`. */
250
+ /** How far the `region` call-out is drawn in, `[0, 1]`: rules grow, wash fades up, out-of-region stretches fade. */
73
251
  readonly regionReveal: 0;
74
- /** Read as the chart is built: the legend is a part the chart builds or doesn't. */
75
- readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
76
252
  /** The domain `zoomTo` first left, so `resetZoom` restores it, auto-derived ticks included. */
77
253
  readonly home: import("@motionscript/sdk").Type<LineChartDomains | null, LineChartDomains | null, false>;
254
+ /** Each series' share of a stack, seeded from `enabled`: a weight rather than a switch, so a hidden series sinks out. */
255
+ readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
256
+ /** Whether the plot clips its marks, from a zoom's first frame until a reset lands. */
257
+ readonly clipped: import("@motionscript/sdk").Type<boolean, boolean, true>;
78
258
  }>, readonly [], import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
79
259
  readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
80
260
  readonly xField: "";
81
261
  readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
262
+ /** `stacked`: each series sits on the sum of those before it; `percent`: every row reads as shares of 100. */
263
+ readonly stack: import("@motionscript/sdk").Type<"none" | "percent" | "stacked", "none" | "percent" | "stacked", false>;
82
264
  readonly xAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
83
265
  readonly yAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
84
- readonly theme: import("@motionscript/sdk").Type<ChartTheme, ChartConfig, false>;
266
+ readonly style: import("@motionscript/sdk").Type<_StyleInput<{
267
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
268
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
269
+ } & {
270
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
271
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
272
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
273
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
274
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
275
+ } & {
276
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
277
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
278
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
279
+ } & {
280
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
281
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
282
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
283
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
284
+ } & {
285
+ strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
286
+ curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
287
+ dots: import("@motionscript/sdk").Type<boolean, boolean, false>;
288
+ dotSize: import("@motionscript/sdk").Type<number, number, false>;
289
+ area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
290
+ areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
291
+ } & {
292
+ values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
293
+ }>, _StyleValues<{
294
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
295
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
296
+ } & {
297
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
298
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
299
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
300
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
301
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
302
+ } & {
303
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
304
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
305
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
306
+ } & {
307
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
308
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
309
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
310
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
311
+ } & {
312
+ strokeWidth: import("@motionscript/sdk").Type<number, number, false>;
313
+ curve: import("@motionscript/sdk").Type<"step" | "linear" | "smooth", "step" | "linear" | "smooth", false>;
314
+ dots: import("@motionscript/sdk").Type<boolean, boolean, false>;
315
+ dotSize: import("@motionscript/sdk").Type<number, number, false>;
316
+ area: import("@motionscript/sdk").Type<"none" | "solid" | "gradient", "none" | "solid" | "gradient", false>;
317
+ areaOpacity: import("@motionscript/sdk").Type<number, number, false>;
318
+ } & {
319
+ values: import("@motionscript/sdk").Type<"none" | "above" | "below", "none" | "above" | "below", false>;
320
+ }>, false>;
85
321
  /** The spotlit slice in data units, or `null`. The box snaps; {@link regionReveal} animates it. */
86
322
  readonly region: import("@motionscript/sdk").Type<PlotRegion | null, PlotRegion | null, false>;
87
- /** How far the `region` call-out is drawn in, `[0, 1]`: rules grow, wash fades up, out-of-region stretches fade to `region.dimOpacity`. */
323
+ /** How far the `region` call-out is drawn in, `[0, 1]`: rules grow, wash fades up, out-of-region stretches fade. */
88
324
  readonly regionReveal: 0;
89
- /** Read as the chart is built: the legend is a part the chart builds or doesn't. */
90
- readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
91
325
  /** The domain `zoomTo` first left, so `resetZoom` restores it, auto-derived ticks included. */
92
326
  readonly home: import("@motionscript/sdk").Type<LineChartDomains | null, LineChartDomains | null, false>;
327
+ /** Each series' share of a stack, seeded from `enabled`: a weight rather than a switch, so a hidden series sinks out. */
328
+ readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
329
+ /** Whether the plot clips its marks, from a zoom's first frame until a reset lands. */
330
+ readonly clipped: import("@motionscript/sdk").Type<boolean, boolean, true>;
93
331
  }>, {
94
332
  readonly enter: {};
95
333
  readonly spotlightRegion: {
@@ -111,4 +349,5 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
111
349
  };
112
350
  }, Node2D<_Node2DProps>>>>;
113
351
  export type LineChart = NodeOf<typeof LineChart>;
352
+ export {};
114
353
  //# sourceMappingURL=line-chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"line-chart.d.ts","sourceRoot":"","sources":["../../src/line-chart/line-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,UAAU,EACf,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,WAAW,IAAI,YAAY,EAGjC,MAAM,mBAAmB,CAAA;AAU1B,OAAO,EAWL,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAA;AAItB,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EAEhB,MAAM,UAAU,CAAA;AAGjB,+DAA+D;AAC/D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,CAAC,EAAE,kBAAkB,CAAA;IAC9B,QAAQ,CAAC,CAAC,EAAE,kBAAkB,CAAA;CAC/B;AAED,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,CAAA;IAC7B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAA;IAChC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAA;CACjC;AA4CD,8BAA8B;AAC9B,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,eAAe,GAAG,gBAAgB,CAYrE;AAoFD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS;;;;;;;IAUlB,mGAAmG;;IAEnG,2IAA2I;;IAE3I,oFAAoF;;IAEpF,+FAA+F;;;;;;;;;;;;;;;;;;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