@motionscript/charts 0.0.0-stage → 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +201 -0
  3. package/dist/bar-chart/bar-chart.d.ts +286 -0
  4. package/dist/bar-chart/bar-chart.d.ts.map +1 -0
  5. package/dist/bar-chart/bar-chart.js +610 -0
  6. package/dist/bar-chart/bar-chart.js.map +1 -0
  7. package/dist/bar-chart/category-axis.d.ts +77 -0
  8. package/dist/bar-chart/category-axis.d.ts.map +1 -0
  9. package/dist/bar-chart/category-axis.js +141 -0
  10. package/dist/bar-chart/category-axis.js.map +1 -0
  11. package/dist/bar-chart/chart-bars.d.ts +149 -0
  12. package/dist/bar-chart/chart-bars.d.ts.map +1 -0
  13. package/dist/bar-chart/chart-bars.js +236 -0
  14. package/dist/bar-chart/chart-bars.js.map +1 -0
  15. package/dist/bar-chart/index.d.ts +16 -0
  16. package/dist/bar-chart/index.d.ts.map +1 -0
  17. package/dist/bar-chart/index.js +12 -0
  18. package/dist/bar-chart/index.js.map +1 -0
  19. package/dist/bar-chart/shared.d.ts +146 -0
  20. package/dist/bar-chart/shared.d.ts.map +1 -0
  21. package/dist/bar-chart/shared.js +182 -0
  22. package/dist/bar-chart/shared.js.map +1 -0
  23. package/dist/browser/chunks/chunk-ZMBOBHYL.js +2 -0
  24. package/dist/browser/chunks/chunk-ZMBOBHYL.js.map +7 -0
  25. package/dist/browser/index.js +2 -0
  26. package/dist/browser/index.js.map +7 -0
  27. package/dist/browser/kit.js +2 -0
  28. package/dist/browser/kit.js.map +7 -0
  29. package/dist/browser/manifest.json +12 -0
  30. package/dist/engine.d.ts +27 -0
  31. package/dist/engine.d.ts.map +1 -0
  32. package/dist/engine.js +27 -0
  33. package/dist/engine.js.map +1 -0
  34. package/dist/index.d.ts +6 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +6 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/kit/chart-border.d.ts +28 -0
  39. package/dist/kit/chart-border.d.ts.map +1 -0
  40. package/dist/kit/chart-border.js +45 -0
  41. package/dist/kit/chart-border.js.map +1 -0
  42. package/dist/kit/chart-canvas.d.ts +56 -0
  43. package/dist/kit/chart-canvas.d.ts.map +1 -0
  44. package/dist/kit/chart-canvas.js +125 -0
  45. package/dist/kit/chart-canvas.js.map +1 -0
  46. package/dist/kit/chart-legend.d.ts +126 -0
  47. package/dist/kit/chart-legend.d.ts.map +1 -0
  48. package/dist/kit/chart-legend.js +212 -0
  49. package/dist/kit/chart-legend.js.map +1 -0
  50. package/dist/kit/shared.d.ts +251 -0
  51. package/dist/kit/shared.d.ts.map +1 -0
  52. package/dist/kit/shared.js +401 -0
  53. package/dist/kit/shared.js.map +1 -0
  54. package/dist/kit/vertical-axis.d.ts +99 -0
  55. package/dist/kit/vertical-axis.d.ts.map +1 -0
  56. package/dist/kit/vertical-axis.js +176 -0
  57. package/dist/kit/vertical-axis.js.map +1 -0
  58. package/dist/line-chart/chart-line.d.ts +91 -0
  59. package/dist/line-chart/chart-line.d.ts.map +1 -0
  60. package/dist/line-chart/chart-line.js +156 -0
  61. package/dist/line-chart/chart-line.js.map +1 -0
  62. package/dist/line-chart/chart-region.d.ts +47 -0
  63. package/dist/line-chart/chart-region.d.ts.map +1 -0
  64. package/dist/line-chart/chart-region.js +101 -0
  65. package/dist/line-chart/chart-region.js.map +1 -0
  66. package/dist/line-chart/horizontal-axis.d.ts +85 -0
  67. package/dist/line-chart/horizontal-axis.d.ts.map +1 -0
  68. package/dist/line-chart/horizontal-axis.js +158 -0
  69. package/dist/line-chart/horizontal-axis.js.map +1 -0
  70. package/dist/line-chart/index.d.ts +22 -0
  71. package/dist/line-chart/index.d.ts.map +1 -0
  72. package/dist/line-chart/index.js +19 -0
  73. package/dist/line-chart/index.js.map +1 -0
  74. package/dist/line-chart/line-chart.d.ts +347 -0
  75. package/dist/line-chart/line-chart.d.ts.map +1 -0
  76. package/dist/line-chart/line-chart.js +701 -0
  77. package/dist/line-chart/line-chart.js.map +1 -0
  78. package/dist/line-chart/shared.d.ts +171 -0
  79. package/dist/line-chart/shared.d.ts.map +1 -0
  80. package/dist/line-chart/shared.js +270 -0
  81. package/dist/line-chart/shared.js.map +1 -0
  82. package/dist/line-chart/x-scale.d.ts +84 -0
  83. package/dist/line-chart/x-scale.d.ts.map +1 -0
  84. package/dist/line-chart/x-scale.js +302 -0
  85. package/dist/line-chart/x-scale.js.map +1 -0
  86. package/dist/nodes.d.ts +20 -0
  87. package/dist/nodes.d.ts.map +1 -0
  88. package/dist/nodes.js +20 -0
  89. package/dist/nodes.js.map +1 -0
  90. package/dist/pie-chart/index.d.ts +18 -0
  91. package/dist/pie-chart/index.d.ts.map +1 -0
  92. package/dist/pie-chart/index.js +14 -0
  93. package/dist/pie-chart/index.js.map +1 -0
  94. package/dist/pie-chart/pie-chart.d.ts +170 -0
  95. package/dist/pie-chart/pie-chart.d.ts.map +1 -0
  96. package/dist/pie-chart/pie-chart.js +291 -0
  97. package/dist/pie-chart/pie-chart.js.map +1 -0
  98. package/dist/pie-chart/pie-legend.d.ts +60 -0
  99. package/dist/pie-chart/pie-legend.d.ts.map +1 -0
  100. package/dist/pie-chart/pie-legend.js +131 -0
  101. package/dist/pie-chart/pie-legend.js.map +1 -0
  102. package/dist/pie-chart/pie-ring.d.ts +266 -0
  103. package/dist/pie-chart/pie-ring.d.ts.map +1 -0
  104. package/dist/pie-chart/pie-ring.js +708 -0
  105. package/dist/pie-chart/pie-ring.js.map +1 -0
  106. package/dist/pie-chart/shared.d.ts +210 -0
  107. package/dist/pie-chart/shared.d.ts.map +1 -0
  108. package/dist/pie-chart/shared.js +240 -0
  109. package/dist/pie-chart/shared.js.map +1 -0
  110. package/package.json +69 -3
  111. package/registry.json +23 -0
  112. package/src/bar-chart/bar-chart.ts +804 -0
  113. package/src/bar-chart/category-axis.ts +177 -0
  114. package/src/bar-chart/chart-bars.ts +310 -0
  115. package/src/bar-chart/index.ts +31 -0
  116. package/src/bar-chart/shared.ts +354 -0
  117. package/src/engine.ts +26 -0
  118. package/src/index.ts +5 -0
  119. package/src/kit/chart-border.ts +61 -0
  120. package/src/kit/chart-canvas.ts +157 -0
  121. package/src/kit/chart-legend.ts +250 -0
  122. package/src/kit/shared.ts +675 -0
  123. package/src/kit/vertical-axis.ts +224 -0
  124. package/src/line-chart/chart-line.ts +208 -0
  125. package/src/line-chart/chart-region.ts +135 -0
  126. package/src/line-chart/horizontal-axis.ts +202 -0
  127. package/src/line-chart/index.ts +39 -0
  128. package/src/line-chart/line-chart.ts +894 -0
  129. package/src/line-chart/shared.ts +459 -0
  130. package/src/line-chart/x-scale.ts +367 -0
  131. package/src/nodes.ts +20 -0
  132. package/src/pie-chart/index.ts +37 -0
  133. package/src/pie-chart/pie-chart.ts +374 -0
  134. package/src/pie-chart/pie-legend.ts +159 -0
  135. package/src/pie-chart/pie-ring.ts +903 -0
  136. package/src/pie-chart/shared.ts +490 -0
  137. package/README.md +0 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bar-chart.js","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACL,OAAO,EACP,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,EACP,QAAQ,GAOT,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,GAAG,EACH,iBAAiB,GAGlB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA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,CAAC,EAAE,CAAC,EAAE,CAAC;iDAe1F;AAQD;IADC,OAAO,EAAE;6CAiBT;AAzmBU,QAAQ;IAfpB,IAAI,CAAC;QACJ,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,MAAM;QACjB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE;YACN,QAAQ,EAAE,UAAU;YACpB,gBAAgB,EAAE,OAAO;YACzB,iBAAiB,EAAE,OAAO;YAC1B,eAAe,EAAE,IAAI;SACtB;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ;KACF,CAAC;GACW,QAAQ,CA+mBpB","sourcesContent":["import {\n command,\n node,\n Node2D,\n Rect,\n easeOut,\n property,\n type CommandArgs,\n type DataRecord,\n type Command,\n type EasingFunction,\n type NodeConfig,\n type Node2DProps,\n} from \"@motionscript/core\"\n\nimport { ChartBorder } from \"../kit/chart-border\"\nimport { ChartCanvas } from \"../kit/chart-canvas\"\nimport { ChartLegend } from \"../kit/chart-legend\"\nimport { VerticalAxis } from \"../kit/vertical-axis\"\nimport {\n clampUnit,\n formatMarker,\n lerpAxisDomain,\n markerValues,\n num,\n resolveAxisDomain,\n type AxisDomainConfig,\n type Range,\n} from \"../kit/shared\"\nimport { formatNumber } from \"@motionscript/core/component\"\nimport {\n drive,\n hold,\n sequence as sequenceOf,\n together,\n type Seekable,\n} from \"@motionscript/core/component\"\nimport { CategoryAxis } from \"./category-axis\"\nimport { ChartBars, type BarGeometry } from \"./chart-bars\"\nimport {\n DEFAULT_BAR_CHART_THEME,\n barCategories,\n barSpans,\n lerpBarChartTheme,\n resolveBarChartTheme,\n resolveBarFill,\n resolveBarScale,\n stackCapIndex,\n type BarChartConfig,\n type BarChartTheme,\n type BarSeries,\n} from \"./shared\"\n\nexport interface BarChartProps extends Node2DProps {\n /** One row per category — a plain record of field name to value. */\n data: DataRecord[]\n /**\n * Key into each row for its category caption, drawn beneath the baseline.\n * Named `categoryField` rather than `category` for the same reason the line\n * chart's is `xField`: it names a *column*, not a value.\n */\n categoryField: string\n /** One entry per bar series: which column it plots, its `label`, its `fill`. */\n series: BarSeries[]\n /**\n * When `true` every category's series stack into one column; when `false`\n * (the default) each series gets its own bar, grouped side by side within the\n * category's slot.\n */\n stacked?: boolean\n /** The value axis's domain: caption, scale range, and tick placement. */\n valueAxis?: AxisDomainConfig\n /** The category axis's domain. Only its `label` is read — the slots are the rows. */\n categoryAxis?: AxisDomainConfig\n /**\n * The chart's visual theme — bar palette and geometry, axis furniture, plot\n * panel paint, legend, value figures. Every branch is optional and deep-merged\n * onto {@link DEFAULT_BAR_CHART_THEME}.\n */\n theme?: BarChartTheme\n /** Whether the legend row below the plot is drawn at all. */\n showLegend?: boolean\n /** Whether each column prints the figure it plots. */\n showValues?: boolean\n}\n\n/**\n * Layout constants for the composition, all in px — the line chart's, so the two\n * sit at the same size in the same box and a scene can swap one for the other\n * without re-tuning its layout.\n */\n/** Left gutter reserved for the value axis markers. */\nconst Y_AXIS_GUTTER = 64\n/** Bottom gutter (within the chart area) reserved for the category captions. */\nconst X_AXIS_GUTTER = 40\n/** Height reserved below the chart area for the legend row. */\nconst LEGEND_GUTTER = 56\n/** Extra left/bottom room when an axis caption is shown. */\nconst Y_LABEL_GUTTER = 34\nconst X_LABEL_GUTTER = 30\n/** Headroom above the plot, so a column reaching the top marker isn't flush to it. */\nconst TOP_HEADROOM = 24\n/** Right gutter so the last slot isn't flush with the box edge. */\nconst RIGHT_GUTTER = 20\n\n/** How far the legend starts below its slot when it enters, in px. */\nconst LEGEND_SLIDE = 20\n\n/**\n * How {@link BarChart.enter} divides its duration between its three beats: the\n * axes arriving, the columns rising, and the legend coming up. Shares of the\n * whole, so they must sum to 1 — the entrance takes exactly the time it was\n * given, for the reason spelt out on `LineChart.enter`.\n */\n/**\n * The signals the bar chart's own commands move, as props types.\n *\n * Written out rather than reusing `BarChartProps` because these are signals of\n * the chart's own — how far the columns have risen, and which category is lit —\n * rather than part of what an author states about it. Same reason the line chart\n * types its `RegionState` separately.\n */\ntype CategorySpotlight = { spotlight: number | null; spotlightReveal: number }\ntype BarGrowth = { growth: number }\n\nconst AXES_SHARE = 0.35\nconst BARS_SHARE = 0.5\nconst LEGEND_SHARE = 0.15\n\n/**\n * A grouped or stacked bar chart, composed from independent parts rather than\n * one monolithic draw — the sibling of the {@link LineChart} family, built the\n * same way and out of several of the same pieces:\n *\n * - `ChartCanvas` — the plot panel with a horizontal grid, under everything.\n * - `VerticalAxis` — the numeric value markers, staggering in bottom-to-top.\n * - {@link CategoryAxis} — the row of names beneath the baseline, one per row of\n * the data, staggering in left-to-right.\n * - {@link ChartBars} (one per series) — that series' column in every category,\n * plus the figures printed on them.\n * - `ChartLegend` — a row of entries below the chart, one per series.\n *\n * The parts are laid out from this node's `layoutBounds` exactly as the line\n * chart's are: a left gutter for the value axis, a bottom gutter for the\n * captions, the plot filling what's left, and the legend row beneath the whole\n * thing. Every child's position and size is bound reactively, so the chart\n * re-flows if its box changes, and the bars read the same resolved scale the\n * axis does, so a column's end lands exactly on its marker.\n *\n * **Resting state is the finished chart** — the same bargain the line chart\n * makes: the studio paints a node's Initial state on a paused canvas, so a chart\n * that only appeared once a command had run would be edited blind. {@link enter}\n * arms every part back to its pre-entrance state before animating.\n *\n * **Zero is always on the scale** (see `barValueExtent`), and the columns\n * grow about it rather than about the plot floor, so a negative value draws\n * downward out of the same `growth` signal that draws a positive one up.\n *\n * Past the entrance, two things move the chart:\n * {@link showSeries}/{@link hideSeries}/{@link spotlightSeries} pick out a\n * *series* — and hiding one **reflows the group**, the remaining columns\n * widening into the space as it goes, rather than leaving a hole where it was —\n * while {@link spotlightCategory}/{@link clearCategory} pick out a *column of\n * the table*, dimming every other category and its caption with it.\n */\n@node({\n key: \"barChart\",\n parentKey: \"node\",\n forkable: true,\n layout: {\n children: \"freeform\",\n defaultWidthMode: \"fixed\",\n defaultHeightMode: \"fixed\",\n acceptsChildren: true,\n },\n seed: {\n width: 760,\n height: 460,\n },\n})\nexport class BarChart extends Node2D<BarChartProps> {\n @property({ default: () => [] as DataRecord[] }) declare data: DataRecord[]\n @property({ default: \"\" }) declare categoryField: string\n @property({ default: () => [] as BarSeries[] }) declare series: BarSeries[]\n @property({ default: false }) declare stacked: boolean\n /**\n * The value axis's domain (label/range/ticks), tweenable and mappable exactly\n * as the line chart's axes are: the mapper merges a partial input onto the\n * previous resolved domain and the tween interpolates numerically, so\n * `chart.to({ data: { valueAxis: { range: [0, 10] } }, duration: 1 })` smoothly\n * rescales every column. The axis *label* text is captured once at construction.\n */\n @property({\n default: {},\n mapper: resolveAxisDomain,\n tween: lerpAxisDomain,\n })\n declare valueAxis: AxisDomainConfig\n @property({\n default: {},\n mapper: resolveAxisDomain,\n tween: lerpAxisDomain,\n })\n declare categoryAxis: AxisDomainConfig\n @property({\n default: DEFAULT_BAR_CHART_THEME,\n mapper: resolveBarChartTheme,\n tween: lerpBarChartTheme,\n })\n declare theme: BarChartTheme\n\n /**\n * Global rise of every column in `[0, 1]`, measured about the baseline: 0\n * collapses them all onto it, 1 draws them at full length. Each\n * {@link ChartBars}' own `growth` is bound to this, so tweening this one\n * signal raises the whole chart in proportion.\n */\n @property({ default: 1 }) declare growth: number\n\n /**\n * How much of the slot each series currently claims, one entry per series.\n *\n * A *weight* rather than a boolean, because that is what makes hiding a series\n * an animation instead of a jump: the grouped columns divide the slot in\n * proportion to these, so tweening one to 0 has the remaining columns widen\n * into the space as it shrinks away, and a stacked segment's contribution to\n * the stack fades out with it. Seeded from each series' `enabled` field.\n */\n @property({ default: () => [] as number[] }) declare weights: number[]\n\n /**\n * The category currently spotlit, or `null` for none. Held as a plain reactive\n * value rather than a tweened one: the *choice* snaps, and the animation is\n * {@link spotlightReveal} dimming everything else.\n */\n @property({ default: null }) declare spotlight: number | null\n\n /** How far the category spotlight is drawn in, `[0, 1]`. */\n @property({ default: 0 }) declare spotlightReveal: number\n\n // ---- Part handles (built in the constructor) --------------------------\n private vAxis: VerticalAxis\n private cAxis: CategoryAxis\n private legend: ChartLegend | null = null\n private barSets: ChartBars[] = []\n\n /**\n * `this.theme` read back through its *resolved* shape — the same\n * loose-declared/resolved-stored idiom as a shape's `fill`/`stroke`, and as\n * the line chart's own theme.\n */\n private get resolvedTheme(): BarChartConfig {\n return this.theme as unknown as BarChartConfig\n }\n\n // ---- Derived scale ----------------------------------------------------\n\n /** Fallback marker count when the value axis states no ticks. */\n private static readonly DEFAULT_MARKERS = 5\n\n private get valueScale(): Range {\n const divisions =\n (this.valueAxis.ticks?.length ?? BarChart.DEFAULT_MARKERS) - 1\n return resolveBarScale(\n this.data,\n this.series,\n this.stacked,\n this.valueAxis.range,\n divisions\n )\n }\n\n /**\n * A value written down as this chart's value axis says — the axis ticks and\n * the figures printed on the columns both read through here, so the two\n * cannot disagree about what a number looks like.\n */\n private valueLabel(value: number): string {\n const pattern = this.valueAxis.format\n return pattern === undefined\n ? formatMarker(value)\n : formatNumber(value, pattern)\n }\n\n /** The value axis ticks: the explicit ones, else five across the scale. */\n private get resolvedMarkers(): number[] {\n return (\n this.valueAxis.ticks ??\n markerValues(this.valueScale, BarChart.DEFAULT_MARKERS - 1)\n )\n }\n\n // ---- Plot geometry, all derived from layoutBounds -----------------------\n\n private get hasValueLabel(): boolean {\n return this.valueAxis.label !== \"\"\n }\n private get hasCategoryLabel(): boolean {\n return this.categoryAxis.label !== \"\"\n }\n\n private get leftInset(): number {\n return Y_AXIS_GUTTER + (this.hasValueLabel ? Y_LABEL_GUTTER : 0)\n }\n private get bottomInset(): number {\n return X_AXIS_GUTTER + (this.hasCategoryLabel ? X_LABEL_GUTTER : 0)\n }\n\n /** The plot rectangle in node space: `{ left, right, top, bottom }` (y-up). */\n private plotBox(): {\n left: number\n right: number\n top: number\n bottom: number\n } {\n const W = this.layoutBounds.width\n const H = this.layoutBounds.height\n const areaTop = H / 2\n const areaBottom = -H / 2 + (this.legend ? LEGEND_GUTTER : 0)\n const left = -W / 2 + this.leftInset\n const right = W / 2 - RIGHT_GUTTER\n const top = areaTop - TOP_HEADROOM\n const bottom = areaBottom + this.bottomInset\n return { left, right, top, bottom }\n }\n\n /** Width and height of the plot, in px. */\n private plotSize(): { w: number; h: number } {\n const { left, right, top, bottom } = this.plotBox()\n return { w: right - left, h: top - bottom }\n }\n\n /** Map a value onto the plot's **centred** pixel space (origin at its centre, y-up). */\n private valueToY(value: number): number {\n const [min, max] = this.valueScale\n const { h } = this.plotSize()\n if (max <= min) return -h / 2\n return ((value - min) / (max - min) - 0.5) * h\n }\n\n /**\n * Pixel y of the line every column grows from.\n *\n * Zero, clamped onto the scale — so an author who *did* crop the axis to\n * `[40, 100]` gets columns rising from the plot floor rather than from a\n * baseline off the bottom of the panel.\n */\n private get baselinePx(): number {\n const [min, max] = this.valueScale\n return this.valueToY(Math.min(Math.max(0, min), max))\n }\n\n // ---- Slot geometry ----------------------------------------------------\n\n /** Width of one category's slot across the plot. */\n private get slotWidth(): number {\n const n = this.data.length\n return n > 0 ? this.plotSize().w / n : 0\n }\n\n /** Centre x of category `i`'s slot, in the plot's centred space. */\n private slotCenter(index: number): number {\n return -this.plotSize().w / 2 + this.slotWidth * (index + 0.5)\n }\n\n /** The part of a slot the columns fill — the rest is the channel between categories. */\n private get slotInner(): number {\n return this.slotWidth * clampUnit(this.resolvedTheme.bar.slotFill)\n }\n\n /** Series `i`'s live share of the slot; 0 once it has been hidden. */\n private weightAt(index: number): number {\n return Math.max(0, this.weights[index] ?? 1)\n }\n\n /** Total live share across the series — the slot's inner width divides by this. */\n private get totalWeight(): number {\n let sum = 0\n for (let i = 0; i < this.series.length; i++) sum += this.weightAt(i)\n return sum > 0 ? sum : 1\n }\n\n /** Live share of every series *before* `index`, for the grouped offset. */\n private weightBefore(index: number): number {\n let sum = 0\n for (let i = 0; i < index; i++) sum += this.weightAt(i)\n return sum\n }\n\n /**\n * Series `index`'s columns, mapped into the plot's centred pixel space.\n *\n * Both modes come out of one walk over the rows: a grouped series divides the\n * slot with its siblings and every column runs from zero, a stacked one takes\n * the whole slot and each column runs from the running total below it. The\n * live {@link weights} scale the grouped widths and the stacked contributions\n * alike, which is what lets `hideSeries` reflow rather than punch a hole.\n */\n private seriesBars(index: number): BarGeometry[] {\n const series = this.series[index]\n if (!series) return []\n const stacked = this.stacked\n const inner = this.slotInner\n const gap = this.resolvedTheme.bar.groupGap\n const unit = inner / this.totalWeight\n const weight = this.weightAt(index)\n\n return this.data.map((row, rowIndex) => {\n // The stack is built from the *live* contributions, so a series fading out\n // lowers the segments above it as it goes instead of dropping them by a\n // step when it finally switches off. A grouped row needs no such scaling —\n // there its weight moves the column's width, not its length.\n const spans = barSpans(\n stacked ? this.weightedRow(row) : row,\n this.series,\n stacked\n )\n const span = spans[index] ?? { from: 0, to: 0, value: 0 }\n const cap = stacked ? stackCapIndex(row, this.series) : index\n\n const slotLeft = this.slotCenter(rowIndex) - inner / 2\n const x = stacked\n ? this.slotCenter(rowIndex)\n : slotLeft + unit * this.weightBefore(index) + (unit * weight) / 2\n const width = stacked\n ? inner\n : Math.max(0, unit * weight - (this.series.length > 1 ? gap : 0))\n\n return {\n x,\n width,\n from: this.valueToY(span.from),\n to: this.valueToY(span.to),\n round: cap === index,\n // The figure printed is the row's own value, not the weighted one — a\n // series on its way out should not be seen counting down.\n value: num(row, series.field),\n }\n })\n }\n\n /**\n * `row` with each series' value scaled by that series' live {@link weights}\n * entry — what the stacked spans are measured from.\n */\n private weightedRow(row: DataRecord): DataRecord {\n const scaled: DataRecord = { ...row }\n this.series.forEach((s, i) => {\n const value = row[s.field]\n if (typeof value === \"number\") scaled[s.field] = value * this.weightAt(i)\n })\n return scaled\n }\n\n /**\n * How far each category is dimmed by the spotlight, one entry per row —\n * 1 while nothing is spotlit, falling to the theme's `dimOpacity` for every\n * category but the chosen one as the reveal climbs.\n */\n private categoryDims(): number[] {\n const focus = clampUnit(this.spotlightReveal)\n const dim = this.resolvedTheme.spotlight.dimOpacity\n const chosen = this.spotlight\n return this.data.map((_, i) =>\n focus <= 0 || chosen === i ? 1 : 1 - (1 - dim) * focus\n )\n }\n\n // ---- Build ------------------------------------------------------------\n\n constructor(props?: NodeConfig<BarChart, BarChartProps>) {\n super(props)\n\n // The whole chart is composed from plain props/`data` — no context needed,\n // so the parts are built here (super() applied the props above). Everything\n // a *leaf* reads live in `renderSelf` — each series' geometry, paint and\n // dim, the panel's fill, the border's stroke — is passed as a closure rather\n // than a snapshot, so `chart.to({ theme })` and\n // `chart.to({ valueAxis: { range } })` genuinely animate the drawn chart.\n const enabled = this.series.map((s) => s.enabled ?? true)\n this.weights = enabled.map((on) => (on ? 1 : 0))\n const showLegend = props?.showLegend !== false\n const showValues = props?.showValues === true\n\n this.vAxis = new VerticalAxis({\n range: () => this.valueScale,\n markers: () => this.resolvedMarkers,\n axis: () => this.resolvedTheme.yAxis,\n label: this.valueAxis.label ?? \"\",\n width: \"hug\",\n height: \"fill\",\n })\n this.vAxis.labelFor = (value) => this.valueLabel(value)\n\n this.cAxis = new CategoryAxis({\n categories: barCategories(this.data, this.categoryField),\n axis: () => this.resolvedTheme.xAxis,\n label: this.categoryAxis.label ?? \"\",\n dims: () => this.categoryDims(),\n width: \"fill\",\n height: \"hug\",\n })\n\n this.barSets = this.series.map(\n (s, i) =>\n new ChartBars({\n bars: () => this.seriesBars(i),\n baseline: () => this.baselinePx,\n fill: () => resolveBarFill(this.resolvedTheme.seriesFills, s, i),\n barStroke: () => this.resolvedTheme.bar.stroke,\n barShadow: () => this.resolvedTheme.bar.shadow,\n cornerRadius: () => this.resolvedTheme.bar.cornerRadius,\n growth: () => this.growth,\n dims: () => this.categoryDims(),\n showValues,\n valueStyle: this.resolvedTheme.valueStyle,\n enabled: enabled[i],\n })\n )\n // The figures on the columns are the same numbers the value axis ticks, so\n // they read through the same format.\n for (const set of this.barSets) set.labelFor = (value) => this.valueLabel(value)\n\n if (showLegend) {\n this.legend = new ChartLegend({\n series: this.series,\n swatches: () =>\n this.series.map((s, i) =>\n resolveBarFill(this.resolvedTheme.seriesFills, s, i)\n ),\n legend: () => this.resolvedTheme.legend,\n })\n }\n\n const plot = new Rect({\n clip: true,\n children: [\n new ChartCanvas({\n fill: () => this.resolvedTheme.plotArea.fill,\n shadow: () => this.resolvedTheme.plotArea.shadow,\n xGridStroke: () => this.resolvedTheme.xAxis.lineStyle,\n yGridStroke: () => this.resolvedTheme.yAxis.lineStyle,\n // No vertical rules: the horizontal axis is categorical, so there is\n // no numeric position along it for a grid line to mark. The channel\n // between slots does that job, and better.\n xMarkers: [],\n yMarkers: () => this.resolvedMarkers,\n xExtent: () => [0, 1] as Range,\n yExtent: () => this.valueScale,\n }),\n ...this.barSets,\n new ChartBorder({\n stroke: () => this.resolvedTheme.plotArea.stroke,\n }),\n ],\n })\n\n // Invisible twin of the value axis, reserving the same left gutter under the\n // plot so the category row starts at the plot's left edge rather than the\n // chart's — and so a caption lands under the columns it names.\n const gutterSpacer = new VerticalAxis({\n opacity: 0,\n range: () => this.valueScale,\n markers: () => this.resolvedMarkers,\n axis: () => this.resolvedTheme.yAxis,\n label: this.valueAxis.label ?? \"\",\n width: \"hug\",\n height: 0,\n })\n\n const below: Node2D[] = [this.cAxis]\n if (this.legend) below.push(this.legend)\n\n this.add(\n new Rect({ flow: \"vertical\",\n width: \"fill\",\n height: \"fill\",\n children: [\n new Rect({ flow: \"horizontal\",\n height: \"fill\",\n width: \"fill\",\n children: [this.vAxis, plot],\n }),\n new Rect({ flow: \"horizontal\",\n width: \"fill\",\n children: [\n gutterSpacer,\n new Rect({ flow: \"vertical\", width: \"fill\", gap: 20, children: below }),\n ],\n }),\n ],\n })\n )\n }\n\n // ---- Orchestrated entrance --------------------------------------------\n\n /**\n * Prime every part at its pre-entrance state — axis markers and captions\n * shifted and transparent, columns collapsed onto the baseline, legend dropped\n * and transparent.\n *\n * Called by {@link enter} before its first frame so nothing flashes ahead of\n * its beat. Idempotent, and public so a scene can hide a chart ahead of time\n * without starting the entrance.\n */\n arm(): void {\n this.vAxis.arm()\n this.cAxis.arm()\n this.growth = 0\n this.legend?.set({ opacity: 0, y: -LEGEND_SLIDE })\n }\n\n /**\n * Animate the whole chart in: the two axes stagger their markers and captions\n * in, the columns rise from the baseline, and the legend fades up last.\n *\n * `duration` is the **whole** entrance. The phases are shares of it, not\n * multiples — a command that declares 1.4 seconds has to take 1.4 seconds,\n * because that is the slot the timeline lays out for it, the length its\n * parallel siblings are timed against, and its contribution to the scene's own\n * duration.\n */\n @command()\n enter(args: CommandArgs<Record<string, never>> & { duration: number }): Seekable {\n const { duration } = args\n const easing = args.easing ?? easeOut()\n this.arm()\n\n return sequenceOf(\n together(\n this.vAxis.enter({ data: { slide: 24 }, duration: duration * AXES_SHARE, easing }),\n this.cAxis.enter({ data: { slide: 24 }, duration: duration * AXES_SHARE, easing })\n ),\n this.riseBars(duration * BARS_SHARE, easing),\n ...(this.legend\n ? [this.legend.to({ data: { opacity: 1, y: 0 }, duration: duration * LEGEND_SHARE, easing })]\n : [])\n )\n }\n\n /** Tween {@link growth} `0 → 1`, raising every column about the baseline. */\n private riseBars(\n duration: number,\n easing: EasingFunction\n ): Command<BarGrowth> {\n // No priming to 0 first: the value at `t` is a function of `t`, so a repeat\n // call re-raises by definition rather than by having reset something.\n return this.command<BarGrowth>((t) => ({ growth: t }), duration, easing)\n }\n\n /**\n * Show series `index`: bring its columns back, the group reflowing to make\n * room as they arrive, in lockstep with its legend entry growing in.\n */\n @command({ args: [{ key: \"seriesIndex\", kind: \"series\", default: 0, min: 0, step: 1 }] })\n showSeries(args: CommandArgs<{ seriesIndex: number }>): Seekable {\n const { seriesIndex = 0 } = args.data ?? {}\n return this.toggleSeries(seriesIndex, 1, args.duration ?? 0.35, args.easing ?? easeOut())\n }\n\n /**\n * Hide series `index`: its columns narrow away (or, stacked, sink out of the\n * stack) while the rest of the group widens into the space, its legend entry\n * shrinking beside them — the mirror of {@link showSeries}.\n */\n @command({ args: [{ key: \"seriesIndex\", kind: \"series\", default: 0, min: 0, step: 1 }] })\n hideSeries(args: CommandArgs<{ seriesIndex: number }>): Seekable {\n const { seriesIndex = 0 } = args.data ?? {}\n return this.toggleSeries(seriesIndex, 0, args.duration ?? 0.35, args.easing ?? easeOut())\n }\n\n /**\n * Move series `index`'s slot share to `target`, with its legend entry.\n *\n * One method for both directions, so the pair cannot drift apart. `enabled`\n * rides in the same value as the weight rather than being set before or after,\n * which is what makes arriving at a time backwards show what arriving forwards\n * does.\n */\n private toggleSeries(\n index: number,\n target: number,\n duration: number,\n easing: EasingFunction\n ): Seekable {\n const bars = this.barSets[index]\n if (!bars) return hold(duration)\n\n return together(\n this.tweenWeight(index, target, duration, easing),\n drive(duration, (t) => {\n const share = t >= 1 ? target : Math.max(target, 1 - t)\n bars.set({ enabled: target > 0 || share > 0 })\n }),\n ...(this.legend\n ? [\n target > 0\n ? this.legend.showSeries({ data: { index }, duration, easing })\n : this.legend.hideSeries({ data: { index }, duration, easing }),\n ]\n : [])\n )\n }\n\n /**\n * Fade out every other series — its columns **and its legend entry** — to\n * focus attention on `index`, which comes back to full. Nothing moves, so the\n * group doesn't reflow.\n */\n @command({ args: [{ key: \"seriesIndex\", kind: \"series\", default: 0, min: 0, step: 1 }] })\n spotlightSeries(args: CommandArgs<{ seriesIndex: number }>): Seekable {\n const { seriesIndex = 0 } = args.data ?? {}\n const duration = args.duration ?? 0.35\n const easing = args.easing ?? easeOut()\n const dim = this.resolvedTheme.spotlight.dimOpacity\n return together(\n ...this.barSets.map((bars, i) =>\n bars.to({ data: { opacity: i === seriesIndex ? 1 : dim }, duration, easing })\n ),\n ...(this.legend\n ? [this.legend.spotlightSeries({ data: { index: seriesIndex }, duration, easing })]\n : [])\n )\n }\n\n /** Ease series `index`'s slot share toward `target`, reflowing the group. */\n private tweenWeight(\n index: number,\n target: number,\n duration: number,\n easing: EasingFunction\n ): Seekable {\n // Read through `weightAt` rather than off the array, so a chart whose stored\n // weights are short (or absent) still tweens from the 1 it is drawing at.\n const from = this.series.map((_, i) => this.weightAt(i))\n const start = from[index] ?? 1\n if (start === target) return hold(duration)\n\n return drive(duration, (t) => {\n const next = [...from]\n next[index] = start + (target - start) * easing(t)\n this.weights = next\n })\n }\n\n // ---- Per-category ------------------------------------------------------\n\n /**\n * Spotlight one **category** — one column of the table rather than one series:\n * every other category's bars and its caption fade to the theme's\n * `dimOpacity`, and the chosen one stays full.\n *\n * The counterpart of the line chart's `spotlightRegion`, and the same shape of\n * thing: it picks out a slice of the plot without changing what is drawn.\n * Calling it while another category is already lit moves the focus directly —\n * only the dimming changes, so there is nothing to retract first.\n */\n @command({ args: [{ key: \"categoryIndex\", kind: \"number\", default: 0, min: 0, step: 1 }] })\n spotlightCategory(args: CommandArgs<{ categoryIndex: number }>): Command<CategorySpotlight> {\n const { categoryIndex = 0 } = args.data ?? {}\n const duration = args.duration ?? 0.4\n const easing = args.easing ?? easeOut()\n if (categoryIndex < 0 || categoryIndex >= this.data.length) return this.holdSpotlight(duration)\n const from = this.spotlightReveal\n // Which category is lit is part of the value, set from the first frame: the\n // focus moves directly, so unlike the line chart's region there is nothing to\n // retract before it.\n return this.command<CategorySpotlight>(\n (t) => ({ spotlight: categoryIndex, spotlightReveal: from + (1 - from) * t }),\n duration,\n easing\n )\n }\n\n /**\n * Drop the category spotlight, bringing every category back to full. A no-op\n * when nothing is lit — but it still takes its slot on the timeline, for the\n * reason `LineChart.clearRegion` does.\n */\n @command()\n clearCategory(args: CommandArgs<Record<string, never>>): Command<CategorySpotlight> {\n const duration = args.duration ?? 0.4\n const easing = args.easing ?? easeOut()\n const from = this.spotlightReveal\n if (from === 0) return this.holdSpotlight(duration)\n\n // The lit category is held until the fade lands — cleared at `t === 1` rather\n // than up front, or there would be nothing left to fade.\n return this.command<CategorySpotlight>(\n (t) =>\n t >= 1\n ? { spotlight: null, spotlightReveal: 0 }\n : { spotlightReveal: from * (1 - t) },\n duration,\n easing\n )\n }\n\n /** The no-op both of the above return — see {@link hold}. */\n private holdSpotlight(duration: number): Command<CategorySpotlight> {\n return this.command<CategorySpotlight>(() => ({}), duration)\n }\n}\n"]}
@@ -0,0 +1,77 @@
1
+ import { Node2D, type CommandArgs, type NodeConfig, type Node2DProps } from "@motionscript/core";
2
+ import { type AxisConfig } from "../kit/shared.js";
3
+ import { type Seekable } from "@motionscript/core/component";
4
+ export interface CategoryAxisProps extends Node2DProps {
5
+ /** One caption per category slot, left to right — the chart's rows, in order. */
6
+ categories: string[];
7
+ /** Caption/title text style and gutters — see {@link AxisConfig}. */
8
+ axis: AxisConfig;
9
+ /**
10
+ * Caption drawn centred in the gutter beneath the category row. Empty string
11
+ * (the default) hides it.
12
+ */
13
+ label: string;
14
+ /**
15
+ * Per-category opacity multiplier — how the chart's category spotlight reaches
16
+ * the captions, so the name under a dimmed column dims with it. Missing
17
+ * entries read as 1.
18
+ */
19
+ dims: number[];
20
+ }
21
+ /**
22
+ * The **categorical** horizontal axis of a {@link BarChart}: a row of
23
+ * {@link Text} captions, one per row of the data, each centred on its slot
24
+ * beneath the baseline.
25
+ *
26
+ * Not a variant of the line chart's `HorizontalAxis` and deliberately not
27
+ * folded into it: that axis places markers by *value* across a numeric range,
28
+ * this one divides its width into equal slots and centres a name in each. The
29
+ * two look alike on screen and share nothing underneath — one reads a scale,
30
+ * the other counts rows.
31
+ *
32
+ * The slot arithmetic is the same as the plot's, because this node is laid out
33
+ * to exactly the plot's width (the chart reserves the axis gutter with an
34
+ * invisible twin of the value axis, as the line chart does), so a caption lands
35
+ * under the columns it names without either side being told about the other.
36
+ *
37
+ * {@link enter} staggers the captions in left-to-right, each lifted a little
38
+ * above its slot and transparent; the resting state is the landed one, so a
39
+ * chart that is never told to enter still reads as finished.
40
+ */
41
+ export declare class CategoryAxis extends Node2D<CategoryAxisProps> {
42
+ categories: string[];
43
+ axis: AxisConfig;
44
+ label: string;
45
+ dims: number[];
46
+ /** One caption per category, ordered left → right, for the staggered enter. */
47
+ private captionNodes;
48
+ /** The axis title, or null when `label` is empty. */
49
+ private labelNode;
50
+ /** Centre x of slot `i`, in the node's centred space. */
51
+ private slotCenter;
52
+ constructor(props?: NodeConfig<CategoryAxis, CategoryAxisProps>);
53
+ /**
54
+ * Primes every caption (and the title) at its pre-entrance state: lifted above
55
+ * its slot and transparent. Idempotent, so the chart can arm its whole
56
+ * composition before the first frame is drawn.
57
+ */
58
+ arm(slide?: number): void;
59
+ /**
60
+ * Slide + fade every caption in from above, staggered left-to-right, then
61
+ * bring the title down behind them.
62
+ *
63
+ * `args.duration` is the **whole** entrance — the stagger and the title are
64
+ * carved out of it rather than added on top. See {@link enterBudget}.
65
+ *
66
+ * `args.data.stagger` is seconds between successive captions (derived when
67
+ * omitted); `args.data.slide` is the starting upward offset in px (node space
68
+ * is y-up, so a positive start slides *down* into place).
69
+ */
70
+ enter(args: CommandArgs<{
71
+ stagger?: number;
72
+ slide?: number;
73
+ }> & {
74
+ duration: number;
75
+ }): Seekable;
76
+ }
77
+ //# sourceMappingURL=category-axis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category-axis.d.ts","sourceRoot":"","sources":["../../src/bar-chart/category-axis.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAON,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAE/E,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,iFAAiF;IACjF,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,qEAAqE;IACrE,IAAI,EAAE,UAAU,CAAA;IAChB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAKD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,YAAa,SAAQ,MAAM,CAAC,iBAAiB,CAAC;IACJ,UAAU,EAAE,MAAM,EAAE,CAAA;IAC1B,IAAI,EAAE,UAAU,CAAA;IAC5B,KAAK,EAAE,MAAM,CAAA;IACK,IAAI,EAAE,MAAM,EAAE,CAAA;IAEnE,+EAA+E;IAC/E,OAAO,CAAC,YAAY,CAAa;IACjC,qDAAqD;IACrD,OAAO,CAAC,SAAS,CAAoB;IAErC,yDAAyD;IACzD,OAAO,CAAC,UAAU;gBAON,KAAK,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,iBAAiB,CAAC;IA6C/D;;;;OAIG;IACH,GAAG,CAAC,KAAK,SAAQ,GAAG,IAAI;IAKxB;;;;;;;;;;OAUG;IAEH,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,QAAQ;CA2BhG"}
@@ -0,0 +1,141 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { command, Node2D, Rect, Text, easeOut, property, insetsOps, textOps, } from "@motionscript/core";
8
+ import { DEFAULT_X_AXIS, clampUnit, enterBudget, } from "../kit/shared.js";
9
+ import { at, compose, hold } from "@motionscript/core/component";
10
+ /** How far a caption starts above its slot when it enters, in px. */
11
+ const SLIDE = 24;
12
+ /**
13
+ * The **categorical** horizontal axis of a {@link BarChart}: a row of
14
+ * {@link Text} captions, one per row of the data, each centred on its slot
15
+ * beneath the baseline.
16
+ *
17
+ * Not a variant of the line chart's `HorizontalAxis` and deliberately not
18
+ * folded into it: that axis places markers by *value* across a numeric range,
19
+ * this one divides its width into equal slots and centres a name in each. The
20
+ * two look alike on screen and share nothing underneath — one reads a scale,
21
+ * the other counts rows.
22
+ *
23
+ * The slot arithmetic is the same as the plot's, because this node is laid out
24
+ * to exactly the plot's width (the chart reserves the axis gutter with an
25
+ * invisible twin of the value axis, as the line chart does), so a caption lands
26
+ * under the columns it names without either side being told about the other.
27
+ *
28
+ * {@link enter} staggers the captions in left-to-right, each lifted a little
29
+ * above its slot and transparent; the resting state is the landed one, so a
30
+ * chart that is never told to enter still reads as finished.
31
+ */
32
+ export class CategoryAxis extends Node2D {
33
+ /** One caption per category, ordered left → right, for the staggered enter. */
34
+ captionNodes = [];
35
+ /** The axis title, or null when `label` is empty. */
36
+ labelNode = null;
37
+ /** Centre x of slot `i`, in the node's centred space. */
38
+ slotCenter(index) {
39
+ const n = this.categories.length;
40
+ if (n <= 0)
41
+ return 0;
42
+ const width = this.layoutBounds.width;
43
+ return -width / 2 + (width / n) * (index + 0.5);
44
+ }
45
+ constructor(props) {
46
+ super(props);
47
+ const tickPad = insetsOps.resolve(this.axis.tickPadding).top;
48
+ const titlePad = insetsOps.resolve(this.axis.titlePadding).top;
49
+ // Each caption sits in a hug box carrying the spotlight dim, so the
50
+ // entrance can animate the text's own opacity without the two fighting over
51
+ // one value — opacity multiplies down the tree, which is exactly the
52
+ // composition wanted here.
53
+ const slots = this.categories.map((caption, i) => {
54
+ const text = new Text({
55
+ ...textOps.styleProps(this.axis.labelStyle),
56
+ text: caption,
57
+ });
58
+ this.captionNodes.push(text);
59
+ return new Rect({
60
+ width: "hug",
61
+ height: "hug",
62
+ flow: "freeform",
63
+ opacity: () => clampUnit(this.dims[i] ?? 1),
64
+ x: () => this.slotCenter(i),
65
+ children: [text],
66
+ });
67
+ });
68
+ const children = [
69
+ new Rect({
70
+ width: "fill",
71
+ height: "hug",
72
+ padding: { top: tickPad },
73
+ children: slots,
74
+ }),
75
+ ];
76
+ if (this.label !== "") {
77
+ this.labelNode = new Text({
78
+ ...textOps.styleProps(this.axis.titleStyle),
79
+ text: this.label,
80
+ });
81
+ children.push(this.labelNode);
82
+ }
83
+ this.add(new Rect({ flow: "vertical", gap: titlePad, height: "hug", width: "fill", children }));
84
+ }
85
+ /**
86
+ * Primes every caption (and the title) at its pre-entrance state: lifted above
87
+ * its slot and transparent. Idempotent, so the chart can arm its whole
88
+ * composition before the first frame is drawn.
89
+ */
90
+ arm(slide = SLIDE) {
91
+ for (const caption of this.captionNodes)
92
+ caption.set({ opacity: 0, y: slide });
93
+ this.labelNode?.set({ opacity: 0, y: slide });
94
+ }
95
+ /**
96
+ * Slide + fade every caption in from above, staggered left-to-right, then
97
+ * bring the title down behind them.
98
+ *
99
+ * `args.duration` is the **whole** entrance — the stagger and the title are
100
+ * carved out of it rather than added on top. See {@link enterBudget}.
101
+ *
102
+ * `args.data.stagger` is seconds between successive captions (derived when
103
+ * omitted); `args.data.slide` is the starting upward offset in px (node space
104
+ * is y-up, so a positive start slides *down* into place).
105
+ */
106
+ enter(args) {
107
+ const { stagger, slide = SLIDE } = args.data ?? {};
108
+ const easing = args.easing ?? easeOut();
109
+ const nodes = this.captionNodes;
110
+ if (nodes.length === 0)
111
+ return hold(args.duration);
112
+ const { step, per, caption } = enterBudget(args.duration, nodes.length, this.labelNode !== null, stagger);
113
+ this.arm(slide);
114
+ // The stagger was `wait(i * step)` inside a generator, so its offsets only
115
+ // existed while it ran. They were always `i * step`; placed, the same
116
+ // entrance can be asked what it looks like partway through.
117
+ const lastCaptionEnds = (nodes.length - 1) * step + per;
118
+ return compose([
119
+ ...nodes.map((node, i) => at(i * step, node.to({ data: { opacity: 1, y: 0 }, duration: per, easing }))),
120
+ ...(this.labelNode
121
+ ? [at(lastCaptionEnds, this.labelNode.to({ data: { opacity: 1, y: 0 }, duration: caption, easing }))]
122
+ : []),
123
+ ]);
124
+ }
125
+ }
126
+ __decorate([
127
+ property({ default: () => [] })
128
+ ], CategoryAxis.prototype, "categories", void 0);
129
+ __decorate([
130
+ property({ default: DEFAULT_X_AXIS })
131
+ ], CategoryAxis.prototype, "axis", void 0);
132
+ __decorate([
133
+ property({ default: "" })
134
+ ], CategoryAxis.prototype, "label", void 0);
135
+ __decorate([
136
+ property({ default: () => [] })
137
+ ], CategoryAxis.prototype, "dims", void 0);
138
+ __decorate([
139
+ command()
140
+ ], CategoryAxis.prototype, "enter", null);
141
+ //# sourceMappingURL=category-axis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category-axis.js","sourceRoot":"","sources":["../../src/bar-chart/category-axis.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,OAAO,EACP,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,GAIR,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,cAAc,EACd,SAAS,EACT,WAAW,GAEZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAiB,MAAM,8BAA8B,CAAA;AAoB/E,qEAAqE;AACrE,MAAM,KAAK,GAAG,EAAE,CAAA;AAEhB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAyB;IAMzD,+EAA+E;IACvE,YAAY,GAAW,EAAE,CAAA;IACjC,qDAAqD;IAC7C,SAAS,GAAgB,IAAI,CAAA;IAErC,yDAAyD;IACjD,UAAU,CAAC,KAAa;QAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAA;QAChC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,CAAC,CAAA;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAA;QACrC,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,CAAA;IACjD,CAAC;IAED,YAA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esContent":["import {\n command,\n Node2D,\n Rect,\n Text,\n easeOut,\n property,\n insetsOps,\n textOps,\n type CommandArgs,\n type NodeConfig,\n type Node2DProps,\n} from \"@motionscript/core\"\n\nimport {\n DEFAULT_X_AXIS,\n clampUnit,\n enterBudget,\n type AxisConfig,\n} from \"../kit/shared\"\nimport { at, compose, hold, type Seekable } from \"@motionscript/core/component\"\n\nexport interface CategoryAxisProps extends Node2DProps {\n /** One caption per category slot, left to right — the chart's rows, in order. */\n categories: string[]\n /** Caption/title text style and gutters — see {@link AxisConfig}. */\n axis: AxisConfig\n /**\n * Caption drawn centred in the gutter beneath the category row. Empty string\n * (the default) hides it.\n */\n label: string\n /**\n * Per-category opacity multiplier — how the chart's category spotlight reaches\n * the captions, so the name under a dimmed column dims with it. Missing\n * entries read as 1.\n */\n dims: number[]\n}\n\n/** How far a caption starts above its slot when it enters, in px. */\nconst SLIDE = 24\n\n/**\n * The **categorical** horizontal axis of a {@link BarChart}: a row of\n * {@link Text} captions, one per row of the data, each centred on its slot\n * beneath the baseline.\n *\n * Not a variant of the line chart's `HorizontalAxis` and deliberately not\n * folded into it: that axis places markers by *value* across a numeric range,\n * this one divides its width into equal slots and centres a name in each. The\n * two look alike on screen and share nothing underneath — one reads a scale,\n * the other counts rows.\n *\n * The slot arithmetic is the same as the plot's, because this node is laid out\n * to exactly the plot's width (the chart reserves the axis gutter with an\n * invisible twin of the value axis, as the line chart does), so a caption lands\n * under the columns it names without either side being told about the other.\n *\n * {@link enter} staggers the captions in left-to-right, each lifted a little\n * above its slot and transparent; the resting state is the landed one, so a\n * chart that is never told to enter still reads as finished.\n */\nexport class CategoryAxis extends Node2D<CategoryAxisProps> {\n @property({ default: () => [] as string[] }) declare categories: string[]\n @property({ default: DEFAULT_X_AXIS }) declare axis: AxisConfig\n @property({ default: \"\" }) declare label: string\n @property({ default: () => [] as number[] }) declare dims: number[]\n\n /** One caption per category, ordered left → right, for the staggered enter. */\n private captionNodes: Text[] = []\n /** The axis title, or null when `label` is empty. */\n private labelNode: Text | null = null\n\n /** Centre x of slot `i`, in the node's centred space. */\n private slotCenter(index: number): number {\n const n = this.categories.length\n if (n <= 0) return 0\n const width = this.layoutBounds.width\n return -width / 2 + (width / n) * (index + 0.5)\n }\n\n constructor(props?: NodeConfig<CategoryAxis, CategoryAxisProps>) {\n super(props)\n\n const tickPad = insetsOps.resolve(this.axis.tickPadding).top\n const titlePad = insetsOps.resolve(this.axis.titlePadding).top\n\n // Each caption sits in a hug box carrying the spotlight dim, so the\n // entrance can animate the text's own opacity without the two fighting over\n // one value — opacity multiplies down the tree, which is exactly the\n // composition wanted here.\n const slots = this.categories.map((caption, i) => {\n const text = new Text({\n ...textOps.styleProps(this.axis.labelStyle),\n text: caption,\n })\n this.captionNodes.push(text)\n return new Rect({\n width: \"hug\",\n height: \"hug\",\n flow: \"freeform\",\n opacity: () => clampUnit(this.dims[i] ?? 1),\n x: () => this.slotCenter(i),\n children: [text],\n })\n })\n\n const children: Node2D[] = [\n new Rect({\n width: \"fill\",\n height: \"hug\",\n padding: { top: tickPad },\n children: slots,\n }),\n ]\n if (this.label !== \"\") {\n this.labelNode = new Text({\n ...textOps.styleProps(this.axis.titleStyle),\n text: this.label,\n })\n children.push(this.labelNode)\n }\n\n this.add(new Rect({ flow: \"vertical\", gap: titlePad, height: \"hug\", width: \"fill\", children }))\n }\n\n /**\n * Primes every caption (and the title) at its pre-entrance state: lifted above\n * its slot and transparent. Idempotent, so the chart can arm its whole\n * composition before the first frame is drawn.\n */\n arm(slide = SLIDE): void {\n for (const caption of this.captionNodes) caption.set({ opacity: 0, y: slide })\n this.labelNode?.set({ opacity: 0, y: slide })\n }\n\n /**\n * Slide + fade every caption in from above, staggered left-to-right, then\n * bring the title down behind them.\n *\n * `args.duration` is the **whole** entrance — the stagger and the title are\n * carved out of it rather than added on top. See {@link enterBudget}.\n *\n * `args.data.stagger` is seconds between successive captions (derived when\n * omitted); `args.data.slide` is the starting upward offset in px (node space\n * is y-up, so a positive start slides *down* into place).\n */\n @command()\n enter(args: CommandArgs<{ stagger?: number; slide?: number }> & { duration: number }): Seekable {\n const { stagger, slide = SLIDE } = args.data ?? {}\n const easing = args.easing ?? easeOut()\n const nodes = this.captionNodes\n if (nodes.length === 0) return hold(args.duration)\n const { step, per, caption } = enterBudget(\n args.duration,\n nodes.length,\n this.labelNode !== null,\n stagger\n )\n\n this.arm(slide)\n\n // The stagger was `wait(i * step)` inside a generator, so its offsets only\n // existed while it ran. They were always `i * step`; placed, the same\n // entrance can be asked what it looks like partway through.\n const lastCaptionEnds = (nodes.length - 1) * step + per\n return compose([\n ...nodes.map((node, i) =>\n at(i * step, node.to({ data: { opacity: 1, y: 0 }, duration: per, easing }))\n ),\n ...(this.labelNode\n ? [at(lastCaptionEnds, this.labelNode.to({ data: { opacity: 1, y: 0 }, duration: caption, easing }))]\n : []),\n ])\n }\n}\n"]}
@@ -0,0 +1,149 @@
1
+ import { type AssetScope, Node2D, type Command, type CommandArgs, type Fill, type NodeConfig, type Node2DProps, type RenderContext2D, type Shadow, type Stroke, type TextStyle } from "@motionscript/core";
2
+ import type { MarkerLabel } from "../kit/vertical-axis.js";
3
+ /**
4
+ * One drawn column, already mapped into the plot's **centred pixel space**
5
+ * (origin at the plot centre, y-up) by the parent {@link BarChart}.
6
+ *
7
+ * `from`/`to` are the two ends of the column rather than a base and a height,
8
+ * for the same reason {@link BarSpan} is a span: it is the one shape that fits a
9
+ * grouped bar, a stacked segment and a negative value without a special case.
10
+ */
11
+ export interface BarGeometry {
12
+ /** Centre x of the column. */
13
+ x: number;
14
+ /** Column width in px. */
15
+ width: number;
16
+ /** Pixel y of the column's base — the baseline when grouped, the running stack top when stacked. */
17
+ from: number;
18
+ /** Pixel y of its far end, at full {@link ChartBars.growth}. */
19
+ to: number;
20
+ /** Whether the far end takes the theme's corner radius (the stack's cap). */
21
+ round: boolean;
22
+ /** The value this column plots, for the figure printed on it. */
23
+ value: number;
24
+ }
25
+ export interface ChartBarsProps extends Node2DProps {
26
+ /** This series' columns, one per row of the chart's data. */
27
+ bars: BarGeometry[];
28
+ /** Pixel y of value 0 — where every column grows *from*. */
29
+ baseline: number;
30
+ /** Column paint — this series' own, or the theme palette's entry for its index. */
31
+ fill: Fill;
32
+ /** Optional outline on every column. */
33
+ barStroke: Stroke;
34
+ /** Optional drop shadow on every column. */
35
+ barShadow: Shadow;
36
+ /** Radius of the far-end corners, in px. */
37
+ cornerRadius: number;
38
+ /**
39
+ * Rise of every column in `[0, 1]`, measured **about the baseline**: 0
40
+ * collapses them all onto it, 1 draws them at full length.
41
+ *
42
+ * Scaling about the baseline rather than about each column's own base is what
43
+ * keeps a stack flush mid-animation — every segment's base and end travel by
44
+ * the same factor, so the segments stay stacked instead of the upper ones
45
+ * floating above the still-growing lower ones. It also means a negative
46
+ * column grows *down* out of the same signal.
47
+ */
48
+ growth: number;
49
+ /**
50
+ * Per-column opacity multiplier, by row index — how the chart's category
51
+ * spotlight reaches a single column without touching the series it belongs
52
+ * to. Missing entries read as 1.
53
+ */
54
+ dims: number[];
55
+ /** Whether the figure each column plots is printed on it. */
56
+ showValues: boolean;
57
+ /** Type style for those figures. */
58
+ valueStyle: TextStyle;
59
+ /**
60
+ * Whether this series draws at all — the wholesale switch behind
61
+ * `BarChart.showSeries`/`hideSeries`, alongside the slot weight that animates
62
+ * the reflow. Off skips the columns *and* their figures.
63
+ */
64
+ enabled: boolean;
65
+ }
66
+ /**
67
+ * One **series** of a {@link BarChart}, drawn as one command list: its column in
68
+ * every category, plus the figures printed on them.
69
+ *
70
+ * A node per series rather than a node per bar, deliberately — it is the same
71
+ * unit `ChartLine` is, which is what lets `showSeries`/`hideSeries`/
72
+ * `spotlightSeries` mean exactly the same thing on a bar chart as on a line
73
+ * chart: enable the node, or tween its opacity. The columns' *positions* come
74
+ * from the parent (it owns the slot arithmetic both modes share), so this part
75
+ * only has to know how to draw a span and grow it.
76
+ *
77
+ * The figures are real {@link Text} children rather than glyphs in the command
78
+ * list, so they take the theme's type style, are measured by the layout engine,
79
+ * and ride the node's own opacity — which is why hiding the series takes its
80
+ * figures with it for free.
81
+ */
82
+ export declare class ChartBars extends Node2D<ChartBarsProps> {
83
+ bars: BarGeometry[];
84
+ baseline: number;
85
+ fill: Fill;
86
+ barStroke: Stroke;
87
+ barShadow: Shadow;
88
+ cornerRadius: number;
89
+ growth: number;
90
+ dims: number[];
91
+ showValues: boolean;
92
+ valueStyle: TextStyle;
93
+ enabled: boolean;
94
+ /**
95
+ * How a column's figure is written down — the same seam the two axes carry,
96
+ * so a chart's value axis and the numbers printed on its bars can't end up
97
+ * saying `$1,200` in one place and `1200` in the other.
98
+ */
99
+ labelFor: MarkerLabel;
100
+ constructor(props?: NodeConfig<ChartBars, ChartBarsProps>);
101
+ /**
102
+ * How far column `i` is dimmed — the chart's category spotlight, and the
103
+ * series switch on top of it.
104
+ *
105
+ * The captions read this rather than being hidden by `renderSelf`'s guard:
106
+ * they are real child nodes, so a `return` in the draw pass would leave them
107
+ * on screen over a series that isn't there.
108
+ */
109
+ private dimAt;
110
+ /** The two ends of column `i` at the current {@link growth}. */
111
+ private endsAt;
112
+ /** The type size the figures are set at, guarding the autofit/unset cases. */
113
+ private get valueSize();
114
+ /**
115
+ * The figure printed on column `i`, or `""` where there is no room for it.
116
+ *
117
+ * Blanking the text rather than dropping the node keeps the caption list
118
+ * index-aligned with the columns, so a chart that rescales into more room
119
+ * simply starts printing again.
120
+ */
121
+ private captionAt;
122
+ /** Whether column `i`'s figure sits inside the column (a stacked segment) or past its end. */
123
+ private insideAt;
124
+ /** Where column `i`'s figure sits, in the node's centred y-up space. */
125
+ private captionY;
126
+ /**
127
+ * This node extends `Node2D` rather than `ShapeNode`, so nothing declares the
128
+ * paint props it carries — see {@link declarePaints}. The column stroke and
129
+ * shadow are named past the conventional slots, so they are passed explicitly.
130
+ */
131
+ declareAssets(assets: AssetScope): void;
132
+ protected renderSelf(ctx: RenderContext2D): void;
133
+ /**
134
+ * Raise every column from the baseline by tweening {@link growth} `0 → 1`.
135
+ *
136
+ * The mirror of `ChartLine.enter`: same signature, same contract that the
137
+ * resting state is the finished one, so the chart arms this back to 0 before
138
+ * animating rather than the node hiding itself at construction.
139
+ */
140
+ enter(args: CommandArgs<Record<string, never>> & {
141
+ duration: number;
142
+ }): Command<ChartBarsGrowth>;
143
+ }
144
+ /** The one signal {@link ChartBars.enter} moves. */
145
+ type ChartBarsGrowth = {
146
+ growth: number;
147
+ };
148
+ export {};
149
+ //# sourceMappingURL=chart-bars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-bars.d.ts","sourceRoot":"","sources":["../../src/bar-chart/chart-bars.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAEf,MAAM,EAQN,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,MAAM,EAEX,KAAK,MAAM,EAEX,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAA;AAG3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAIvD;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,CAAC,EAAE,MAAM,CAAA;IACT,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,oGAAoG;IACpG,IAAI,EAAE,MAAM,CAAA;IACZ,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAA;IACV,6EAA6E;IAC7E,KAAK,EAAE,OAAO,CAAA;IACd,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;CACd;AASD,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,6DAA6D;IAC7D,IAAI,EAAE,WAAW,EAAE,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAA;IAChB,mFAAmF;IACnF,IAAI,EAAE,IAAI,CAAA;IACV,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAA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