@motionscript/charts 0.1.0-alpha.0 → 0.1.0-alpha.10

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 (152) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/NOTICE +49 -0
  3. package/README.md +99 -0
  4. package/dist/bar-chart/bar-chart.d.ts +133 -228
  5. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  6. package/dist/bar-chart/bar-chart.js +386 -565
  7. package/dist/bar-chart/bar-chart.js.map +1 -1
  8. package/dist/bar-chart/category-axis.d.ts +35 -41
  9. package/dist/bar-chart/category-axis.d.ts.map +1 -1
  10. package/dist/bar-chart/category-axis.js +93 -115
  11. package/dist/bar-chart/category-axis.js.map +1 -1
  12. package/dist/bar-chart/chart-bars.d.ts +50 -70
  13. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  14. package/dist/bar-chart/chart-bars.js +155 -210
  15. package/dist/bar-chart/chart-bars.js.map +1 -1
  16. package/dist/bar-chart/index.d.ts +2 -2
  17. package/dist/bar-chart/index.d.ts.map +1 -1
  18. package/dist/bar-chart/index.js +1 -1
  19. package/dist/bar-chart/index.js.map +1 -1
  20. package/dist/bar-chart/shared.d.ts +7 -7
  21. package/dist/bar-chart/shared.d.ts.map +1 -1
  22. package/dist/bar-chart/shared.js +7 -7
  23. package/dist/bar-chart/shared.js.map +1 -1
  24. package/dist/browser/chunks/chunk-TJNHLQGV.js +2 -0
  25. package/dist/browser/chunks/chunk-TJNHLQGV.js.map +7 -0
  26. package/dist/browser/index.js +1 -1
  27. package/dist/browser/index.js.map +3 -3
  28. package/dist/browser/kit.js +1 -1
  29. package/dist/browser/manifest.json +4 -3
  30. package/dist/engine.d.ts +10 -8
  31. package/dist/engine.d.ts.map +1 -1
  32. package/dist/engine.js +10 -8
  33. package/dist/engine.js.map +1 -1
  34. package/dist/kit/cartesian.d.ts +44 -0
  35. package/dist/kit/cartesian.d.ts.map +1 -0
  36. package/dist/kit/cartesian.js +59 -0
  37. package/dist/kit/cartesian.js.map +1 -0
  38. package/dist/kit/chart-border.d.ts +10 -11
  39. package/dist/kit/chart-border.d.ts.map +1 -1
  40. package/dist/kit/chart-border.js +15 -32
  41. package/dist/kit/chart-border.js.map +1 -1
  42. package/dist/kit/chart-canvas.d.ts +32 -21
  43. package/dist/kit/chart-canvas.d.ts.map +1 -1
  44. package/dist/kit/chart-canvas.js +33 -90
  45. package/dist/kit/chart-canvas.js.map +1 -1
  46. package/dist/kit/chart-legend.d.ts +123 -85
  47. package/dist/kit/chart-legend.d.ts.map +1 -1
  48. package/dist/kit/chart-legend.js +137 -186
  49. package/dist/kit/chart-legend.js.map +1 -1
  50. package/dist/kit/entries.d.ts +17 -0
  51. package/dist/kit/entries.d.ts.map +1 -0
  52. package/dist/kit/entries.js +19 -0
  53. package/dist/kit/entries.js.map +1 -0
  54. package/dist/kit/motion.d.ts +48 -0
  55. package/dist/kit/motion.d.ts.map +1 -0
  56. package/dist/kit/motion.js +63 -0
  57. package/dist/kit/motion.js.map +1 -0
  58. package/dist/kit/paints.d.ts +10 -0
  59. package/dist/kit/paints.d.ts.map +1 -0
  60. package/dist/kit/paints.js +12 -0
  61. package/dist/kit/paints.js.map +1 -0
  62. package/dist/kit/shared.d.ts +61 -10
  63. package/dist/kit/shared.d.ts.map +1 -1
  64. package/dist/kit/shared.js +108 -13
  65. package/dist/kit/shared.js.map +1 -1
  66. package/dist/kit/vertical-axis.d.ts +48 -61
  67. package/dist/kit/vertical-axis.d.ts.map +1 -1
  68. package/dist/kit/vertical-axis.js +97 -132
  69. package/dist/kit/vertical-axis.js.map +1 -1
  70. package/dist/line-chart/chart-line.d.ts +60 -77
  71. package/dist/line-chart/chart-line.d.ts.map +1 -1
  72. package/dist/line-chart/chart-line.js +100 -121
  73. package/dist/line-chart/chart-line.js.map +1 -1
  74. package/dist/line-chart/chart-region.d.ts +32 -33
  75. package/dist/line-chart/chart-region.d.ts.map +1 -1
  76. package/dist/line-chart/chart-region.js +31 -65
  77. package/dist/line-chart/chart-region.js.map +1 -1
  78. package/dist/line-chart/horizontal-axis.d.ts +58 -64
  79. package/dist/line-chart/horizontal-axis.d.ts.map +1 -1
  80. package/dist/line-chart/horizontal-axis.js +94 -123
  81. package/dist/line-chart/horizontal-axis.js.map +1 -1
  82. package/dist/line-chart/index.d.ts +3 -3
  83. package/dist/line-chart/index.d.ts.map +1 -1
  84. package/dist/line-chart/index.js +2 -2
  85. package/dist/line-chart/index.js.map +1 -1
  86. package/dist/line-chart/line-chart.d.ts +156 -303
  87. package/dist/line-chart/line-chart.d.ts.map +1 -1
  88. package/dist/line-chart/line-chart.js +410 -638
  89. package/dist/line-chart/line-chart.js.map +1 -1
  90. package/dist/line-chart/shared.d.ts +7 -7
  91. package/dist/line-chart/shared.d.ts.map +1 -1
  92. package/dist/line-chart/shared.js +23 -8
  93. package/dist/line-chart/shared.js.map +1 -1
  94. package/dist/line-chart/x-scale.d.ts +4 -11
  95. package/dist/line-chart/x-scale.d.ts.map +1 -1
  96. package/dist/line-chart/x-scale.js +16 -5
  97. package/dist/line-chart/x-scale.js.map +1 -1
  98. package/dist/nodes.d.ts +6 -9
  99. package/dist/nodes.d.ts.map +1 -1
  100. package/dist/nodes.js +7 -9
  101. package/dist/nodes.js.map +1 -1
  102. package/dist/pie-chart/index.d.ts +2 -2
  103. package/dist/pie-chart/index.d.ts.map +1 -1
  104. package/dist/pie-chart/index.js +1 -1
  105. package/dist/pie-chart/index.js.map +1 -1
  106. package/dist/pie-chart/pie-chart.d.ts +108 -126
  107. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  108. package/dist/pie-chart/pie-chart.js +202 -271
  109. package/dist/pie-chart/pie-chart.js.map +1 -1
  110. package/dist/pie-chart/pie-legend.d.ts +84 -31
  111. package/dist/pie-chart/pie-legend.d.ts.map +1 -1
  112. package/dist/pie-chart/pie-legend.js +93 -107
  113. package/dist/pie-chart/pie-legend.js.map +1 -1
  114. package/dist/pie-chart/pie-ring.d.ts +160 -122
  115. package/dist/pie-chart/pie-ring.d.ts.map +1 -1
  116. package/dist/pie-chart/pie-ring.js +333 -361
  117. package/dist/pie-chart/pie-ring.js.map +1 -1
  118. package/dist/pie-chart/shared.d.ts +12 -6
  119. package/dist/pie-chart/shared.d.ts.map +1 -1
  120. package/dist/pie-chart/shared.js +14 -8
  121. package/dist/pie-chart/shared.js.map +1 -1
  122. package/package.json +7 -4
  123. package/src/bar-chart/bar-chart.ts +424 -686
  124. package/src/bar-chart/category-axis.ts +96 -111
  125. package/src/bar-chart/chart-bars.ts +178 -201
  126. package/src/bar-chart/index.ts +2 -2
  127. package/src/bar-chart/shared.ts +7 -7
  128. package/src/engine.ts +10 -8
  129. package/src/kit/cartesian.ts +81 -0
  130. package/src/kit/chart-border.ts +23 -34
  131. package/src/kit/chart-canvas.ts +45 -80
  132. package/src/kit/chart-legend.ts +185 -206
  133. package/src/kit/entries.ts +20 -0
  134. package/src/kit/motion.ts +90 -0
  135. package/src/kit/paints.ts +15 -0
  136. package/src/kit/shared.ts +120 -13
  137. package/src/kit/vertical-axis.ts +111 -141
  138. package/src/line-chart/chart-line.ts +103 -155
  139. package/src/line-chart/chart-region.ts +36 -81
  140. package/src/line-chart/horizontal-axis.ts +102 -153
  141. package/src/line-chart/index.ts +3 -3
  142. package/src/line-chart/line-chart.ts +463 -759
  143. package/src/line-chart/shared.ts +22 -8
  144. package/src/line-chart/x-scale.ts +20 -5
  145. package/src/nodes.ts +8 -10
  146. package/src/pie-chart/index.ts +2 -2
  147. package/src/pie-chart/pie-chart.ts +225 -303
  148. package/src/pie-chart/pie-legend.ts +125 -115
  149. package/src/pie-chart/pie-ring.ts +388 -443
  150. package/src/pie-chart/shared.ts +14 -8
  151. package/dist/browser/chunks/chunk-ZMBOBHYL.js +0 -2
  152. package/dist/browser/chunks/chunk-ZMBOBHYL.js.map +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"chart-canvas.js","sourceRoot":"","sources":["../../src/kit/chart-canvas.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EAAE,CAAC,EAAc,EAAE,CAAC;6CAA2B;AAClB;IAApD,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAc,EAAE,CAAC;6CAA2B;AACjB;IAArD,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAU,EAAE,CAAC;4CAAuB;AACd;IAArD,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAU,EAAE,CAAC;4CAAuB","sourcesContent":["import {\n type AssetScope,\n Graphics2D,\n Node2D,\n fillOps,\n shadowOps,\n strokeOps,\n property,\n type Fill,\n type Node2DProps,\n type RenderContext2D,\n type Shadow,\n type Stroke,\n type StrokeResolved,\n} from \"@motionscript/core\"\n\nimport {\n DEFAULT_PLOT_AREA,\n DEFAULT_X_AXIS,\n DEFAULT_Y_AXIS,\n type Range,\n} from \"./shared\"\nimport { declarePaints } from \"@motionscript/core/component\"\n\nexport interface ChartCanvasProps extends Node2DProps {\n /** Fill of the plot panel behind the marks. */\n fill: Fill\n /** Drop shadow of the panel. Default none. */\n shadow: Shadow\n /** Stroke of the vertical grid lines (one per {@link xMarkers}). */\n xGridStroke: Stroke\n /** Stroke of the horizontal grid lines (one per {@link yMarkers}). */\n yGridStroke: Stroke\n /**\n * Data-unit x positions to draw a vertical grid line at — one per horizontal\n * axis marker, so a line lands under every marker regardless of spacing.\n * Positions at (or past) an {@link xExtent} edge coincide with the border and\n * are skipped. Pass an empty list for a chart whose horizontal axis is\n * categorical and so has no numeric position to rule at.\n */\n xMarkers: number[]\n /** Data-unit y positions to draw a horizontal grid line at. */\n yMarkers: number[]\n /** `[min, max]` of the horizontal scale — maps {@link xMarkers} into the panel. */\n xExtent: Range\n /** `[min, max]` of the vertical scale — maps {@link yMarkers} into the panel. */\n yExtent: Range\n}\n\n/**\n * The plot **backdrop** of a cartesian chart: a filled panel with a grid of\n * faint lines spanning both directions across it. Drawn as one {@link Graphics2D}\n * command list, sized from its allocated `layoutBounds` and centred on the node\n * origin.\n *\n * The thick frame is a **separate** {@link ChartBorder} node so it can be drawn\n * *over* the marks while this panel sits under them. Grid lines are placed from\n * the axis marker positions (in data units) mapped into the panel through\n * {@link ChartCanvasProps.xExtent}/`yExtent` — so each line lands under its\n * marker whether or not the markers are evenly spaced.\n */\nexport class ChartCanvas extends Node2D<ChartCanvasProps> {\n @property({\n default: DEFAULT_PLOT_AREA.fill,\n mapper: fillOps.resolve,\n tween: fillOps.lerp,\n })\n declare fill: Fill\n @property({\n default: DEFAULT_PLOT_AREA.shadow,\n mapper: shadowOps.resolve,\n tween: shadowOps.lerp,\n })\n declare shadow: Shadow\n @property({\n default: DEFAULT_X_AXIS.lineStyle,\n mapper: strokeOps.resolve,\n tween: strokeOps.lerp,\n })\n declare xGridStroke: Stroke\n @property({\n default: DEFAULT_Y_AXIS.lineStyle,\n mapper: strokeOps.resolve,\n tween: strokeOps.lerp,\n })\n declare yGridStroke: Stroke\n @property({ default: () => [] as number[] }) declare xMarkers: number[]\n @property({ default: () => [] as number[] }) declare yMarkers: number[]\n @property({ default: () => [0, 1] as Range }) declare xExtent: Range\n @property({ default: () => [0, 1] as Range }) declare yExtent: Range\n\n /**\n * This node extends `Node2D` rather than `ShapeNode`, so nothing declares the\n * paint props it carries — see {@link declarePaints}. The grid strokes are\n * named past the conventional slots, so they are passed explicitly.\n */\n override declareAssets(assets: AssetScope): void {\n super.declareAssets(assets)\n declarePaints(this, assets, {\n strokes: [this.xGridStroke as StrokeResolved[], this.yGridStroke as StrokeResolved[]],\n })\n }\n\n protected renderSelf(ctx: RenderContext2D): void {\n const W = this.layoutBounds.width\n const H = this.layoutBounds.height\n if (W <= 0 || H <= 0) return\n\n // Plot panel, centred on the origin (node space is y-up, origin centre).\n ctx.draw(\n new Graphics2D()\n .rect({ x: 0, y: 0, width: W, height: H })\n .shadow(this.shadow)\n .fill(this.fill)\n )\n\n const [xMin, xMax] = this.xExtent\n const [yMin, yMax] = this.yExtent\n // Fraction of a marker across its extent; guard a zero-width extent.\n const xFrac = (v: number) => (xMax <= xMin ? 0 : (v - xMin) / (xMax - xMin))\n const yFrac = (v: number) => (yMax <= yMin ? 0 : (v - yMin) / (yMax - yMin))\n // Skip markers landing on (or outside) the edges — they'd sit under the border.\n const interior = (f: number) => f > 1e-6 && f < 1 - 1e-6\n\n const xStroke = (this.xGridStroke as StrokeResolved[])[0]\n if (xStroke) {\n const xGrid = new Graphics2D()\n for (const v of this.xMarkers) {\n const f = xFrac(v)\n if (!interior(f)) continue\n xGrid.rect({\n x: -W / 2 + f * W,\n y: 0,\n width: xStroke.weight,\n height: H,\n })\n }\n ctx.draw(xGrid.fill(xStroke.fill))\n }\n\n const yStroke = (this.yGridStroke as StrokeResolved[])[0]\n if (yStroke) {\n const yGrid = new Graphics2D()\n for (const v of this.yMarkers) {\n const f = yFrac(v)\n if (!interior(f)) continue\n yGrid.rect({\n x: 0,\n y: -H / 2 + f * H,\n width: W,\n height: yStroke.weight,\n })\n }\n ctx.draw(yGrid.fill(yStroke.fill))\n }\n }\n}\n"]}
1
+ {"version":3,"file":"chart-canvas.js","sourceRoot":"","sources":["../../src/kit/chart-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,SAAS,GAWV,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,cAAc,GAEf,MAAM,UAAU,CAAA;AA2BjB,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,EAAE,CACtC,KAAK,CAAC,MAAM,CAA2B,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,CA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f,\n // Named so this component's emitted type reaches `Node2D` through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps,\n type Shadow,\n type ShadowResolved,\n type Stroke,\n type StrokeResolved,\n} from \"@motionscript/sdk\"\n\nimport { fresh } from \"./entries\"\nimport { loadPaints } from \"./paints\"\nimport {\n DEFAULT_PLOT_AREA,\n DEFAULT_X_AXIS,\n DEFAULT_Y_AXIS,\n type Range,\n} from \"./shared\"\n\nexport interface ChartCanvasProps extends Node2DProps {\n /** Fill of the plot panel behind the marks. */\n fill: Fill\n /** Drop shadow of the panel. Default none. */\n shadow: Shadow\n /** Stroke of the vertical grid lines (one per {@link xMarkers}). */\n xGridStroke: Stroke\n /** Stroke of the horizontal grid lines (one per {@link yMarkers}). */\n yGridStroke: Stroke\n /**\n * Data-unit x positions to draw a vertical grid line at — one per horizontal\n * axis marker, so a line lands under every marker regardless of spacing.\n * Positions at (or past) an {@link xExtent} edge coincide with the border and\n * are skipped. Pass an empty list for a chart whose horizontal axis is\n * categorical and so has no numeric position to rule at.\n */\n xMarkers: number[]\n /** Data-unit y positions to draw a horizontal grid line at. */\n yMarkers: number[]\n /** `[min, max]` of the horizontal scale — maps {@link xMarkers} into the panel. */\n xExtent: Range\n /** `[min, max]` of the vertical scale — maps {@link yMarkers} into the panel. */\n yExtent: Range\n}\n\nconst strokeEntry = (initial: Stroke) =>\n Types.custom<Stroke, StrokeResolved[]>(initial, { resolve: strokeOps.resolve, lerp: strokeOps.lerp })\n\n/**\n * The plot **backdrop** of a cartesian chart: a filled panel with a grid of\n * faint lines spanning both directions across it, sized from its box and centred\n * on its origin.\n *\n * The thick frame is a **separate** {@link ChartBorder} node so it can be drawn\n * *over* the marks while this panel sits under them. Grid lines are placed from\n * the axis marker positions (in data units) mapped into the panel through\n * {@link ChartCanvasProps.xExtent}/`yExtent` — so each line lands under its\n * marker whether or not the markers are evenly spaced.\n */\nexport const ChartCanvas = component2d({\n key: \"chartCanvas\",\n state: {\n fill: Types.custom<Fill, FillResolved[]>(DEFAULT_PLOT_AREA.fill, { resolve: fillOps.resolve, lerp: fillOps.lerp }),\n shadow: Types.custom<Shadow, ShadowResolved[]>(DEFAULT_PLOT_AREA.shadow, { resolve: shadowOps.resolve, lerp: shadowOps.lerp }),\n xGridStroke: strokeEntry(DEFAULT_X_AXIS.lineStyle),\n yGridStroke: strokeEntry(DEFAULT_Y_AXIS.lineStyle),\n xMarkers: fresh<number[]>(() => []),\n yMarkers: fresh<number[]>(() => []),\n xExtent: fresh<Range>(() => [0, 1]),\n yExtent: fresh<Range>(() => [0, 1]),\n },\n // The grid strokes are named past the conventional slots, so they are named here.\n load: (loader, state) =>\n loadPaints(loader, { fills: [state.fill], shadows: [state.shadow], strokes: [state.xGridStroke, state.yGridStroke] }),\n render: (ctx, state) => {\n const { width: W, height: H } = ctx.size\n if (W <= 0 || H <= 0) return\n\n // Plot panel, centred on the origin (node space is y-up, origin centre).\n ctx.draw(new Graphics2D().rect({ x: 0, y: 0, width: W, height: H }).shadow(state.shadow).fill(state.fill))\n\n const [xMin, xMax] = state.xExtent\n const [yMin, yMax] = state.yExtent\n // Fraction of a marker across its extent; guard a zero-width extent.\n const xFrac = (v: number) => (xMax <= xMin ? 0 : (v - xMin) / (xMax - xMin))\n const yFrac = (v: number) => (yMax <= yMin ? 0 : (v - yMin) / (yMax - yMin))\n // Skip markers landing on (or outside) the edges — they'd sit under the border.\n const interior = (f: number) => f > 1e-6 && f < 1 - 1e-6\n\n const xStroke = state.xGridStroke[0]\n if (xStroke) {\n const xGrid = new Graphics2D()\n for (const v of state.xMarkers) {\n const f = xFrac(v)\n if (!interior(f)) continue\n xGrid.rect({ x: -W / 2 + f * W, y: 0, width: xStroke.weight, height: H })\n }\n ctx.draw(xGrid.fill(xStroke.fill))\n }\n\n const yStroke = state.yGridStroke[0]\n if (yStroke) {\n const yGrid = new Graphics2D()\n for (const v of state.yMarkers) {\n const f = yFrac(v)\n if (!interior(f)) continue\n yGrid.rect({ x: 0, y: -H / 2 + f * H, width: W, height: yStroke.weight })\n }\n ctx.draw(yGrid.fill(yStroke.fill))\n }\n },\n})\n\nexport type ChartCanvas = NodeOf<typeof ChartCanvas>\n"]}
@@ -1,12 +1,11 @@
1
- import { Rect, type CommandArgs, type Fill, type NodeConfig, type RectProps } from "@motionscript/core";
2
- import { type Seekable } from "@motionscript/core/component";
1
+ import { type Fill, type NodeOf, type RectProps, type Alignment as _Alignment, type CornerRadiusResolved as _CornerRadiusResolved, type CornerStyleResolved as _CornerStyleResolved, type FillResolved as _FillResolved, type FlowMode as _FlowMode, type FlowResolved as _FlowResolved, type GapSize as _GapSize, type Node2D as _Node2D, type Node2DProps as _Node2DProps, type RectCornerRadius as _RectCornerRadius, type RectCornerStyle as _RectCornerStyle, type Shadow as _Shadow, type ShadowResolved as _ShadowResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved, type Vector2 as _Vector2 } from "@motionscript/sdk";
3
2
  import { type ChartSeries, type LegendConfig } from "./shared.js";
4
3
  export interface ChartLegendProps extends RectProps {
5
4
  /**
6
5
  * One entry per series: legend `label`, its `enabled` default, and — through
7
6
  * {@link ChartLegendProps.swatches} — the colour its chip is painted. A series
8
7
  * that starts enabled (the default) is added to the row up front; one that
9
- * starts `false` is hidden until a later {@link ChartLegend.showSeries}.
8
+ * starts `false` is hidden until a later `showSeries`.
10
9
  */
11
10
  series: ChartSeries[];
12
11
  /**
@@ -25,102 +24,141 @@ export interface ChartLegendProps extends RectProps {
25
24
  * with a rounded colour swatch; only the swatch carries the series colour, the
26
25
  * caption reads in the legend's neutral ink.
27
26
  *
28
- * {@link showSeries}/{@link hideSeries} flip a series on or off — showing one
29
- * adds its entry back into the row at its stable series position and grows it
30
- * in, hiding one shrinks it away and removes it. So the row only ever holds the
31
- * currently-enabled series, in series order, and closes the gap when one leaves.
27
+ * `showSeries`/`hideSeries` flip a series on or off — showing one grows its
28
+ * entry back in at its stable series position, hiding one shrinks it away. So
29
+ * the row only ever shows the currently-enabled series, in series order, and
30
+ * closes the gap when one leaves.
32
31
  *
33
32
  * This node *is* the row, so the parent places it (centred below the chart) and
34
33
  * it hugs its entries.
35
34
  */
36
- export declare class ChartLegend extends Rect {
37
- series: ChartSeries[];
38
- swatches: Fill[];
39
- legend: LegendConfig;
40
- /** One entry per series. **Every** entry is a child — see {@link reveal}. */
41
- private items;
35
+ export declare const ChartLegend: import("@motionscript/sdk").Component<"chartLegend", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
36
+ readonly series: import("@motionscript/sdk").Type<ChartSeries[], ChartSeries[], false>;
37
+ readonly swatches: import("@motionscript/sdk").Type<Fill[], Fill[], false>;
38
+ readonly legend: import("@motionscript/sdk").Type<LegendConfig, LegendConfig, false>;
42
39
  /**
43
40
  * How far each entry is shown, `0`–`1`. Drives its width, opacity and gap
44
41
  * together, so `0` is an entry that takes no room and `1` is one at its
45
42
  * natural size.
46
43
  *
47
- * This replaces adding and removing the entry from the row, which is what
48
- * `showSeries`/`hideSeries` used to do. That could not be a command: a command
49
- * is asked what it looks like at a time, and "is this node a child" is not a
50
- * value a time can produce — the tree either contains it or it doesn't, and
51
- * getting there means having run the add. Collapsed-but-present is the same
52
- * picture reached by a route that *is* a function of `t`.
53
- *
54
- * A plain array rather than reactive props because the count is the series
55
- * count, which is data. The entries' props are bound to it, so writing one
56
- * still moves the layout.
57
- */
58
- private reveal;
59
- /**
60
- * Each entry's natural width, last time it was fully shown.
61
- *
62
- * A collapse needs numeric endpoints — `lerpSizeInput` snaps between a token
63
- * and a number rather than interpolating — and `"hug"` is not a number until
64
- * something measures it. Refreshed on every frame an entry is at full reveal
65
- * (see {@link widthFor}), so it is current by the time a hide starts, and it
66
- * tracks a relabelled series or a restyled legend without being told.
67
- */
68
- private natural;
69
- constructor(props?: NodeConfig<ChartLegend, ChartLegendProps>);
70
- /**
71
- * An entry's width for its current reveal.
72
- *
73
- * `"hug"` at full reveal rather than the pinned number, so a shown entry stays
74
- * responsive to its own content; the number only takes over while it is
75
- * collapsing, which is the only time a token cannot express it.
76
- *
77
- * Records the natural width as a side effect, which is the honest place for it:
78
- * this runs inside a binding, so it is already reading the layout every frame,
79
- * and the value it wants is the one the layout just produced. It writes a plain
80
- * array rather than a signal, so nothing is invalidated by it.
44
+ * This replaces adding and removing the entry from the row: a command is
45
+ * asked what it looks like at a time, and "is this node a child" is not a
46
+ * value a time can produce. Collapsed-but-present is the same picture reached
47
+ * by a route that *is* a function of `t`.
81
48
  */
82
- private widthFor;
83
- /** One entry: the series caption beside its colour swatch. */
84
- private buildItem;
85
- /** True if series `index` is showing at all — see {@link reveal}. */
86
- isEnabled(index: number): boolean;
49
+ readonly reveal: import("@motionscript/sdk").Type<number[] | Readonly<Record<number, number>>, number[], false>;
50
+ readonly cornerRadius: import("@motionscript/sdk").Attribute<_RectCornerRadius, _CornerRadiusResolved>;
51
+ readonly cornerStyle: import("@motionscript/sdk").Attribute<_RectCornerStyle, _CornerStyleResolved>;
52
+ readonly flow: import("@motionscript/sdk").Type<_FlowMode, _FlowResolved, false>;
53
+ readonly gap: import("@motionscript/sdk").Type<_GapSize, _GapSize, false>;
54
+ readonly wrap: boolean;
55
+ readonly crossGap: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
56
+ readonly columns: import("@motionscript/sdk").Type<number, number, false>;
57
+ readonly align: import("@motionscript/sdk").Attribute<_Alignment, _Vector2>;
58
+ readonly fill: import("@motionscript/sdk").Attribute<Fill, _FillResolved[]>;
59
+ readonly stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
60
+ readonly shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
61
+ readonly overlay: import("@motionscript/sdk").Attribute<Fill, _FillResolved[]>;
62
+ readonly start: import("@motionscript/sdk").Type<number, number, false>;
63
+ readonly end: import("@motionscript/sdk").Type<number, number, false>;
64
+ }>, {
65
+ readonly showSeries: {
66
+ readonly index: import("@motionscript/sdk").Type<number, number, false>;
67
+ };
68
+ readonly hideSeries: {
69
+ readonly index: import("@motionscript/sdk").Type<number, number, false>;
70
+ };
71
+ readonly spotlightSeries: {
72
+ readonly index: import("@motionscript/sdk").Type<number, number, false>;
73
+ };
74
+ readonly fillTo: readonly ["fill"];
75
+ readonly strokeTo: readonly ["stroke"];
76
+ readonly shadowTo: readonly ["shadow"];
77
+ readonly overlayTo: readonly ["overlay"];
78
+ readonly progressTo: readonly ["start", "end"];
79
+ readonly flash: {
80
+ readonly portion: import("@motionscript/sdk").Type<number, number, false>;
81
+ };
82
+ }, null, _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
83
+ readonly series: import("@motionscript/sdk").Type<ChartSeries[], ChartSeries[], false>;
84
+ readonly swatches: import("@motionscript/sdk").Type<Fill[], Fill[], false>;
85
+ readonly legend: import("@motionscript/sdk").Type<LegendConfig, LegendConfig, false>;
87
86
  /**
88
- * Grow series `index`'s entry back in at its series-order position, the
89
- * siblings sliding over to make room.
90
- *
91
- * A reveal tween rather than an animated `addChildAt`. The entry never left —
92
- * see {@link reveal} — so there is no add to have happened, and the whole
93
- * thing is a function of `t`.
94
- */
95
- showSeries(args: CommandArgs<{
96
- index: number;
97
- }>): Seekable;
98
- /**
99
- * Shrink series `index`'s entry away, the gap closing behind it — the mirror
100
- * of {@link showSeries}.
101
- */
102
- hideSeries(args: CommandArgs<{
103
- index: number;
104
- }>): Seekable;
105
- /**
106
- * Ramp one entry's reveal to `target`.
87
+ * How far each entry is shown, `0`–`1`. Drives its width, opacity and gap
88
+ * together, so `0` is an entry that takes no room and `1` is one at its
89
+ * natural size.
107
90
  *
108
- * `from` is read when the command is built, which for a driven scene is with
109
- * the node in the state its own start time implies — so a hide that follows a
110
- * show starts where the show left it rather than at whatever the node happens
111
- * to hold now.
91
+ * This replaces adding and removing the entry from the row: a command is
92
+ * asked what it looks like at a time, and "is this node a child" is not a
93
+ * value a time can produce. Collapsed-but-present is the same picture reached
94
+ * by a route that *is* a function of `t`.
112
95
  */
113
- private revealTo;
96
+ readonly reveal: import("@motionscript/sdk").Type<number[] | Readonly<Record<number, number>>, number[], false>;
97
+ readonly cornerRadius: import("@motionscript/sdk").Attribute<_RectCornerRadius, _CornerRadiusResolved>;
98
+ readonly cornerStyle: import("@motionscript/sdk").Attribute<_RectCornerStyle, _CornerStyleResolved>;
99
+ readonly flow: import("@motionscript/sdk").Type<_FlowMode, _FlowResolved, false>;
100
+ readonly gap: import("@motionscript/sdk").Type<_GapSize, _GapSize, false>;
101
+ readonly wrap: boolean;
102
+ readonly crossGap: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
103
+ readonly columns: import("@motionscript/sdk").Type<number, number, false>;
104
+ readonly align: import("@motionscript/sdk").Attribute<_Alignment, _Vector2>;
105
+ readonly fill: import("@motionscript/sdk").Attribute<Fill, _FillResolved[]>;
106
+ readonly stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
107
+ readonly shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
108
+ readonly overlay: import("@motionscript/sdk").Attribute<Fill, _FillResolved[]>;
109
+ readonly start: import("@motionscript/sdk").Type<number, number, false>;
110
+ readonly end: import("@motionscript/sdk").Type<number, number, false>;
111
+ }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
112
+ readonly series: import("@motionscript/sdk").Type<ChartSeries[], ChartSeries[], false>;
113
+ readonly swatches: import("@motionscript/sdk").Type<Fill[], Fill[], false>;
114
+ readonly legend: import("@motionscript/sdk").Type<LegendConfig, LegendConfig, false>;
114
115
  /**
115
- * Dim every entry but series `index` to {@link SPOTLIGHT_DIM} and bring that
116
- * one back to full — the legend half of a chart's `spotlightSeries`. Entries
117
- * stay in place; only their opacity moves, so the row doesn't reflow.
116
+ * How far each entry is shown, `0`–`1`. Drives its width, opacity and gap
117
+ * together, so `0` is an entry that takes no room and `1` is one at its
118
+ * natural size.
118
119
  *
119
- * Only the currently-shown entries are touched — a hidden series' entry is
120
- * left as {@link hideSeries} left it.
120
+ * This replaces adding and removing the entry from the row: a command is
121
+ * asked what it looks like at a time, and "is this node a child" is not a
122
+ * value a time can produce. Collapsed-but-present is the same picture reached
123
+ * by a route that *is* a function of `t`.
121
124
  */
122
- spotlightSeries(args: CommandArgs<{
123
- index: number;
124
- }>): Seekable;
125
- }
125
+ readonly reveal: import("@motionscript/sdk").Type<number[] | Readonly<Record<number, number>>, number[], false>;
126
+ readonly cornerRadius: import("@motionscript/sdk").Attribute<_RectCornerRadius, _CornerRadiusResolved>;
127
+ readonly cornerStyle: import("@motionscript/sdk").Attribute<_RectCornerStyle, _CornerStyleResolved>;
128
+ readonly flow: import("@motionscript/sdk").Type<_FlowMode, _FlowResolved, false>;
129
+ readonly gap: import("@motionscript/sdk").Type<_GapSize, _GapSize, false>;
130
+ readonly wrap: boolean;
131
+ readonly crossGap: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
132
+ readonly columns: import("@motionscript/sdk").Type<number, number, false>;
133
+ readonly align: import("@motionscript/sdk").Attribute<_Alignment, _Vector2>;
134
+ readonly fill: import("@motionscript/sdk").Attribute<Fill, _FillResolved[]>;
135
+ readonly stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
136
+ readonly shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
137
+ readonly overlay: import("@motionscript/sdk").Attribute<Fill, _FillResolved[]>;
138
+ readonly start: import("@motionscript/sdk").Type<number, number, false>;
139
+ readonly end: import("@motionscript/sdk").Type<number, number, false>;
140
+ }>, {
141
+ readonly showSeries: {
142
+ readonly index: import("@motionscript/sdk").Type<number, number, false>;
143
+ };
144
+ readonly hideSeries: {
145
+ readonly index: import("@motionscript/sdk").Type<number, number, false>;
146
+ };
147
+ readonly spotlightSeries: {
148
+ readonly index: import("@motionscript/sdk").Type<number, number, false>;
149
+ };
150
+ readonly fillTo: readonly ["fill"];
151
+ readonly strokeTo: readonly ["stroke"];
152
+ readonly shadowTo: readonly ["shadow"];
153
+ readonly overlayTo: readonly ["overlay"];
154
+ readonly progressTo: readonly ["start", "end"];
155
+ readonly flash: {
156
+ readonly portion: import("@motionscript/sdk").Type<number, number, false>;
157
+ };
158
+ }, _Node2D<_Node2DProps>>>>;
159
+ /** Whether series `index` is showing at all on `legend`. */
160
+ export declare function legendShows(legend: {
161
+ readonly reveal: readonly number[];
162
+ }, index: number): boolean;
163
+ export type ChartLegend = NodeOf<typeof ChartLegend>;
126
164
  //# sourceMappingURL=chart-legend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-legend.d.ts","sourceRoot":"","sources":["../../src/kit/chart-legend.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAMJ,KAAK,WAAW,EAEhB,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAEnF,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD;;;;;OAKG;IACH,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB;;;;;OAKG;IACH,QAAQ,EAAE,IAAI,EAAE,CAAA;IAChB,oFAAoF;IACpF,MAAM,EAAE,YAAY,CAAA;CACrB;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAY,SAAQ,IAAI;IACuB,MAAM,EAAE,WAAW,EAAE,CAAA;IAC5B,QAAQ,EAAE,IAAI,EAAE,CAAA;IACpB,MAAM,EAAE,YAAY,CAAA;IAEnE,6EAA6E;IAC7E,OAAO,CAAC,KAAK,CAAa;IAC1B;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,MAAM,CAAe;IAC7B;;;;;;;;OAQG;IACH,OAAO,CAAC,OAAO,CAAe;gBAElB,KAAK,CAAC,EAA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