@motionscript/charts 0.1.0-alpha.9 → 0.1.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/bar-chart/bar-chart.d.ts +22 -93
  3. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  4. package/dist/bar-chart/bar-chart.js +48 -121
  5. package/dist/bar-chart/bar-chart.js.map +1 -1
  6. package/dist/bar-chart/category-axis.d.ts +11 -38
  7. package/dist/bar-chart/category-axis.d.ts.map +1 -1
  8. package/dist/bar-chart/category-axis.js +15 -38
  9. package/dist/bar-chart/category-axis.js.map +1 -1
  10. package/dist/bar-chart/chart-bars.d.ts +43 -74
  11. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  12. package/dist/bar-chart/chart-bars.js +31 -59
  13. package/dist/bar-chart/chart-bars.js.map +1 -1
  14. package/dist/bar-chart/index.d.ts +2 -10
  15. package/dist/bar-chart/index.d.ts.map +1 -1
  16. package/dist/bar-chart/index.js +0 -7
  17. package/dist/bar-chart/index.js.map +1 -1
  18. package/dist/bar-chart/shared.d.ts +27 -90
  19. package/dist/bar-chart/shared.d.ts.map +1 -1
  20. package/dist/bar-chart/shared.js +15 -54
  21. package/dist/bar-chart/shared.js.map +1 -1
  22. package/dist/browser/chunks/chunk-4SMRCU24.js +2 -0
  23. package/dist/browser/chunks/chunk-4SMRCU24.js.map +7 -0
  24. package/dist/browser/index.js +1 -1
  25. package/dist/browser/index.js.map +3 -3
  26. package/dist/browser/kit.js +1 -1
  27. package/dist/browser/manifest.json +1 -1
  28. package/dist/engine.d.ts +4 -16
  29. package/dist/engine.d.ts.map +1 -1
  30. package/dist/engine.js +4 -16
  31. package/dist/engine.js.map +1 -1
  32. package/dist/kit/cartesian.d.ts +8 -28
  33. package/dist/kit/cartesian.d.ts.map +1 -1
  34. package/dist/kit/cartesian.js +7 -19
  35. package/dist/kit/cartesian.js.map +1 -1
  36. package/dist/kit/chart-border.d.ts +9 -18
  37. package/dist/kit/chart-border.d.ts.map +1 -1
  38. package/dist/kit/chart-border.js +4 -9
  39. package/dist/kit/chart-border.js.map +1 -1
  40. package/dist/kit/chart-canvas.d.ts +25 -36
  41. package/dist/kit/chart-canvas.d.ts.map +1 -1
  42. package/dist/kit/chart-canvas.js +13 -13
  43. package/dist/kit/chart-canvas.js.map +1 -1
  44. package/dist/kit/chart-legend.d.ts +14 -61
  45. package/dist/kit/chart-legend.d.ts.map +1 -1
  46. package/dist/kit/chart-legend.js +17 -65
  47. package/dist/kit/chart-legend.js.map +1 -1
  48. package/dist/kit/entries.d.ts +2 -0
  49. package/dist/kit/entries.d.ts.map +1 -1
  50. package/dist/kit/entries.js +2 -0
  51. package/dist/kit/entries.js.map +1 -1
  52. package/dist/kit/motion.d.ts +11 -3
  53. package/dist/kit/motion.d.ts.map +1 -1
  54. package/dist/kit/motion.js +7 -1
  55. package/dist/kit/motion.js.map +1 -1
  56. package/dist/kit/shared.d.ts +60 -175
  57. package/dist/kit/shared.d.ts.map +1 -1
  58. package/dist/kit/shared.js +40 -157
  59. package/dist/kit/shared.js.map +1 -1
  60. package/dist/kit/vertical-axis.d.ts +16 -45
  61. package/dist/kit/vertical-axis.d.ts.map +1 -1
  62. package/dist/kit/vertical-axis.js +17 -42
  63. package/dist/kit/vertical-axis.js.map +1 -1
  64. package/dist/line-chart/chart-line.d.ts +16 -41
  65. package/dist/line-chart/chart-line.d.ts.map +1 -1
  66. package/dist/line-chart/chart-line.js +14 -43
  67. package/dist/line-chart/chart-line.js.map +1 -1
  68. package/dist/line-chart/chart-region.d.ts +14 -27
  69. package/dist/line-chart/chart-region.d.ts.map +1 -1
  70. package/dist/line-chart/chart-region.js +8 -22
  71. package/dist/line-chart/chart-region.js.map +1 -1
  72. package/dist/line-chart/horizontal-axis.d.ts +16 -43
  73. package/dist/line-chart/horizontal-axis.d.ts.map +1 -1
  74. package/dist/line-chart/horizontal-axis.js +13 -42
  75. package/dist/line-chart/horizontal-axis.js.map +1 -1
  76. package/dist/line-chart/index.d.ts +1 -13
  77. package/dist/line-chart/index.d.ts.map +1 -1
  78. package/dist/line-chart/index.js +0 -12
  79. package/dist/line-chart/index.js.map +1 -1
  80. package/dist/line-chart/line-chart.d.ts +23 -109
  81. package/dist/line-chart/line-chart.d.ts.map +1 -1
  82. package/dist/line-chart/line-chart.js +45 -141
  83. package/dist/line-chart/line-chart.js.map +1 -1
  84. package/dist/line-chart/shared.d.ts +33 -107
  85. package/dist/line-chart/shared.d.ts.map +1 -1
  86. package/dist/line-chart/shared.js +28 -81
  87. package/dist/line-chart/shared.js.map +1 -1
  88. package/dist/line-chart/x-scale.d.ts +14 -55
  89. package/dist/line-chart/x-scale.d.ts.map +1 -1
  90. package/dist/line-chart/x-scale.js +29 -111
  91. package/dist/line-chart/x-scale.js.map +1 -1
  92. package/dist/nodes.d.ts +0 -12
  93. package/dist/nodes.d.ts.map +1 -1
  94. package/dist/nodes.js +0 -12
  95. package/dist/nodes.js.map +1 -1
  96. package/dist/pie-chart/index.d.ts +1 -12
  97. package/dist/pie-chart/index.d.ts.map +1 -1
  98. package/dist/pie-chart/index.js +0 -9
  99. package/dist/pie-chart/index.js.map +1 -1
  100. package/dist/pie-chart/pie-chart.d.ts +37 -71
  101. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  102. package/dist/pie-chart/pie-chart.js +31 -65
  103. package/dist/pie-chart/pie-chart.js.map +1 -1
  104. package/dist/pie-chart/pie-legend.d.ts +11 -26
  105. package/dist/pie-chart/pie-legend.d.ts.map +1 -1
  106. package/dist/pie-chart/pie-legend.js +14 -39
  107. package/dist/pie-chart/pie-legend.js.map +1 -1
  108. package/dist/pie-chart/pie-ring.d.ts +50 -192
  109. package/dist/pie-chart/pie-ring.d.ts.map +1 -1
  110. package/dist/pie-chart/pie-ring.js +75 -247
  111. package/dist/pie-chart/pie-ring.js.map +1 -1
  112. package/dist/pie-chart/shared.d.ts +45 -131
  113. package/dist/pie-chart/shared.d.ts.map +1 -1
  114. package/dist/pie-chart/shared.js +29 -72
  115. package/dist/pie-chart/shared.js.map +1 -1
  116. package/package.json +4 -4
  117. package/src/bar-chart/bar-chart.ts +51 -165
  118. package/src/bar-chart/category-axis.ts +16 -57
  119. package/src/bar-chart/chart-bars.ts +43 -120
  120. package/src/bar-chart/index.ts +2 -10
  121. package/src/bar-chart/shared.ts +29 -97
  122. package/src/engine.ts +4 -16
  123. package/src/kit/cartesian.ts +11 -26
  124. package/src/kit/chart-border.ts +6 -20
  125. package/src/kit/chart-canvas.ts +15 -40
  126. package/src/kit/chart-legend.ts +17 -86
  127. package/src/kit/entries.ts +4 -1
  128. package/src/kit/motion.ts +11 -2
  129. package/src/kit/shared.ts +58 -219
  130. package/src/kit/vertical-axis.ts +18 -71
  131. package/src/line-chart/chart-line.ts +16 -44
  132. package/src/line-chart/chart-region.ts +10 -23
  133. package/src/line-chart/horizontal-axis.ts +13 -42
  134. package/src/line-chart/index.ts +1 -13
  135. package/src/line-chart/line-chart.ts +50 -184
  136. package/src/line-chart/shared.ts +51 -145
  137. package/src/line-chart/x-scale.ts +31 -121
  138. package/src/nodes.ts +0 -12
  139. package/src/pie-chart/index.ts +1 -12
  140. package/src/pie-chart/pie-chart.ts +34 -102
  141. package/src/pie-chart/pie-legend.ts +14 -55
  142. package/src/pie-chart/pie-ring.ts +80 -307
  143. package/src/pie-chart/shared.ts +50 -139
  144. package/dist/browser/chunks/chunk-TJNHLQGV.js +0 -2
  145. package/dist/browser/chunks/chunk-TJNHLQGV.js.map +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"bar-chart.js","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,OAAO,GAUR,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE1D,OAAO,EAAE,cAAc,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E;gBACvB,MAAM,IAAI,GAAG,KAAK,CAAC,eAAe,CAAA;gBAClC,IAAI,IAAI,KAAK,CAAC;oBAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;gBACvD,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAA;gBAC3B,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAC1I,CAAC;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import {\n Rect,\n Types,\n component2d,\n easeOut,\n type ChildView,\n type DataRecord,\n type EntryOptions,\n type NodeOf,\n // Named so this component's emitted type reaches `Node2D` through the sdk, not core.\n type Node2D,\n type Node2DProps,\n type Size2D,\n type Timeline,\n} from \"@motionscript/sdk\"\nimport { formatNumber } from \"@motionscript/sdk/component\"\n\nimport { cartesianFrame, cartesianViews, laidOutSize } from \"../kit/cartesian\"\nimport { ChartBorder } from \"../kit/chart-border\"\nimport { ChartCanvas } from \"../kit/chart-canvas\"\nimport { ChartLegend } from \"../kit/chart-legend\"\nimport { asParts, fresh } from \"../kit/entries\"\nimport { beats, type Beat } from \"../kit/motion\"\nimport { VerticalAxis } from \"../kit/vertical-axis\"\nimport {\n clampUnit,\n formatMarker,\n lerpAxisDomain,\n lerpAxisEntry,\n markerStep,\n markerValues,\n num,\n resolveAxisDomain,\n settleAxisDomain,\n type AxisDomainConfig,\n type Range,\n} from \"../kit/shared\"\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/** What a bar chart plots, as its entries hold it. */\nexport interface BarChartValues {\n readonly data: DataRecord[]\n readonly series: BarSeries[]\n readonly stacked: boolean\n readonly valueAxis: AxisDomainConfig\n}\n\n/** The value axis's domain with its range and ticks resolved. */\nexport type BarChartDomain = AxisDomainConfig & { readonly range: Range; readonly ticks: number[] }\n\n/** The argument every per-series command takes: an index into `series`, offered by name. */\nconst SERIES_ARG = Types.custom<number, number, EntryOptions & { readonly min: number; readonly step: number }>(0, { kind: \"series\", min: 0, step: 1 })\n\n/** How far the legend starts below its slot when it enters, in px. */\nconst LEGEND_SLIDE = 20\n\n/** Fallback marker count when the value axis states no ticks. */\nconst DEFAULT_MARKERS = 5\n\n/**\n * How `enter` divides its duration between its three beats: the axes arriving,\n * the columns rising, and the legend coming up. Shares of the whole, so they\n * must sum to 1.\n */\nconst AXES_SHARE = 0.35\nconst BARS_SHARE = 0.5\nconst LEGEND_SHARE = 0.15\n\n/** What the geometry reads: what the chart plots, its theme and the signals its commands move. */\ninterface BarState extends BarChartValues {\n readonly theme: BarChartConfig\n readonly weights: number[]\n readonly spotlight: number | null\n readonly spotlightReveal: number\n}\n\n/** The value axis with its range and ticks resolved: the explicit ones, else five across the scale. */\nfunction drawnValue(s: BarChartValues, domain: AxisDomainConfig): AxisDomainConfig {\n const divisions = (domain.ticks?.length ?? DEFAULT_MARKERS) - 1\n const range = resolveBarScale(s.data, s.series, s.stacked, domain.range, divisions)\n return { ...domain, range, ticks: domain.ticks ?? markerValues(range, DEFAULT_MARKERS - 1) }\n}\n\n/** The last domain worked out from each data array, and what else it was read from. */\nconst domainsDrawn = new WeakMap<DataRecord[], Omit<BarChartValues, \"data\"> & { readonly domain: BarChartDomain }>()\n\n/** The value axis as a bar chart draws it now, an auto range or tick row read back as itself. */\nexport function barChartDomain(s: BarChartValues): BarChartDomain {\n const { data, series, stacked, valueAxis } = s\n const kept = domainsDrawn.get(data)\n if (kept && kept.series === series && kept.stacked === stacked && kept.valueAxis === valueAxis) return kept.domain\n const domain = settleAxisDomain(valueAxis, (d) => drawnValue(s, d)) as BarChartDomain\n domainsDrawn.set(data, { series, stacked, valueAxis, domain })\n return domain\n}\n\n/**\n * A value written down as this chart's value axis says: the ticks and the\n * figures printed on the columns both read through here, so the two cannot\n * disagree about what a number looks like.\n */\nfunction valueLabel(s: BarChartValues, domain: BarChartDomain, value: number): string {\n const pattern = s.valueAxis.format\n return pattern === undefined ? formatMarker(value, markerStep(domain.ticks)) : formatNumber(value, pattern)\n}\n\n/** A value on the plot's **centred** pixel space (origin at its centre, y-up). */\nfunction valueToY(domain: BarChartDomain, plot: Size2D, value: number): number {\n const [min, max] = domain.range\n if (max <= min) return -plot.height / 2\n return ((value - min) / (max - min) - 0.5) * plot.height\n}\n\n/**\n * Pixel y of the line every column grows from: zero clamped onto the scale, so\n * a cropped axis grows its columns from the plot floor.\n */\nfunction baselinePx(domain: BarChartDomain, plot: Size2D): number {\n const [min, max] = domain.range\n return valueToY(domain, plot, Math.min(Math.max(0, min), max))\n}\n\n/** Series `i`'s live share of the slot; 0 once it has been hidden. */\nfunction weightAt(s: BarState, index: number): number {\n return Math.max(0, s.weights[index] ?? 1)\n}\n\n/** `row` with each series' value scaled by its live weight: what the stacked spans are measured from. */\nfunction weightedRow(s: BarState, row: DataRecord): DataRecord {\n const scaled: DataRecord = { ...row }\n s.series.forEach((series, i) => {\n const value = row[series.field]\n if (typeof value === \"number\") scaled[series.field] = value * weightAt(s, i)\n })\n return scaled\n}\n\n/**\n * Series `index`'s columns, mapped into the plot's centred pixel space. A\n * grouped series divides the slot with its siblings by their live weights, a\n * stacked one takes the whole slot and runs from the running total below it,\n * so hiding a series reflows rather than punching a hole.\n */\nfunction seriesBars(s: BarState, index: number, plot: Size2D, captioned: boolean): BarGeometry[] {\n const series = s.series[index]\n if (!series) return []\n const domain = barChartDomain(s)\n const n = s.data.length\n const slotWidth = n > 0 ? plot.width / n : 0\n const slotCenter = (i: number) => -plot.width / 2 + slotWidth * (i + 0.5)\n const inner = slotWidth * clampUnit(s.theme.bar.slotFill)\n const gap = s.theme.bar.groupGap\n let total = 0\n for (let i = 0; i < s.series.length; i++) total += weightAt(s, i)\n const unit = inner / (total > 0 ? total : 1)\n const weight = weightAt(s, index)\n let before = 0\n for (let i = 0; i < index; i++) before += weightAt(s, i)\n\n return s.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.\n const spans = barSpans(s.stacked ? weightedRow(s, row) : row, s.series, s.stacked)\n const span = spans[index] ?? { from: 0, to: 0, value: 0 }\n const cap = s.stacked ? stackCapIndex(row, s.series) : index\n const slotLeft = slotCenter(rowIndex) - inner / 2\n const x = s.stacked ? slotCenter(rowIndex) : slotLeft + unit * before + (unit * weight) / 2\n const width = s.stacked ? inner : Math.max(0, unit * weight - (s.series.length > 1 ? gap : 0))\n // The figure printed is the row's own value, not the weighted one.\n const value = num(row, series.field)\n return {\n x,\n width,\n from: valueToY(domain, plot, span.from),\n to: valueToY(domain, plot, span.to),\n round: cap === index,\n value,\n ...(captioned && { caption: valueLabel(s, domain, value) }),\n }\n })\n}\n\n/**\n * How far each category is dimmed by the spotlight, one entry per row: 1 while\n * nothing is spotlit, falling to the theme's `dimOpacity` for every category but\n * the chosen one as the reveal climbs.\n */\nfunction categoryDims(s: BarState): number[] {\n const focus = clampUnit(s.spotlightReveal)\n const dim = s.theme.spotlight.dimOpacity\n const chosen = s.spotlight\n return s.data.map((_, i) => (focus <= 0 || chosen === i ? 1 : 1 - (1 - dim) * focus))\n}\n\ntype AnyTimeline = Timeline<any, any>\n\n/** The parts a bar chart's commands drive, found through its children. */\nfunction partsOf(children: readonly ChildView[]) {\n const frame = cartesianViews(children)\n if (!frame) return null\n const cAxis = frame.below.find(CategoryAxis.is)\n if (!VerticalAxis.is(frame.axis) || !cAxis) return null\n return {\n vAxis: frame.axis,\n cAxis,\n bars: frame.plot.filter(ChartBars.is),\n legend: frame.below.find(ChartLegend.is) ?? null,\n }\n}\n\n/**\n * Move series `index`'s slot share to `target` with its legend entry, the group\n * reflowing. Its columns are drawn for every frame the move covers, and switch\n * off only once a hide has landed, so arriving at a time backwards shows what\n * arriving forwards does.\n */\nfunction toggling(timeline: AnyTimeline, state: BarState & { readonly showing: boolean[] }, children: readonly ChildView[], index: number, target: number) {\n const parts = partsOf(children)\n if (!parts || !parts.bars[index]) return timeline.wait(timeline.duration)\n // Read through `weightAt`, so a chart whose stored weights are short still\n // tweens from the 1 it is drawing at.\n const from = state.series.map((_, i) => weightAt(state, i))\n const start = from[index] ?? 1\n const showing = state.series.map((s, i) => state.showing[i] ?? (s.enabled ?? true))\n return timeline.together([\n timeline.animate((t) => {\n const weights = [...from]\n weights[index] = start + (target - start) * timeline.ease(t)\n const shown = [...showing]\n shown[index] = target > 0 || t < 1\n return { weights, showing: shown }\n }, { eased: false }),\n ...(parts.legend ? [parts.legend.run(target > 0 ? \"showSeries\" : \"hideSeries\", { index })] : []),\n ])\n}\n\n/**\n * A grouped or stacked bar chart, the sibling of the line chart and built the\n * same way, 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.\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 * Every part reads the chart's entries through bindings, and the columns map\n * across the plot panel's own laid-out box, so a column's end lands exactly on\n * its marker. **Zero is always on the scale**, and the columns grow about it, so\n * a negative value draws downward out of the same `growth` signal.\n *\n * **Resting state is the finished chart**; `enter` arms every part on its first\n * frame. `showSeries`/`hideSeries`/`spotlightSeries` pick out a *series* (hiding\n * one reflows the group), `spotlightCategory`/`clearCategory` a *column of the\n * table*. A `to` of the value axis's `range` or `ticks` tweens from the domain\n * as drawn, so an auto axis rescales the columns continuously.\n */\nexport const BarChart = component2d({\n key: \"barChart\",\n state: {\n data: fresh<DataRecord[]>(() => []),\n categoryField: \"\",\n series: fresh<BarSeries[]>(() => []),\n stacked: false,\n valueAxis: Types.custom<AxisDomainConfig>({}, { resolve: resolveAxisDomain, lerp: lerpAxisEntry }),\n categoryAxis: Types.custom<AxisDomainConfig>({}, { resolve: resolveAxisDomain, lerp: lerpAxisDomain }),\n theme: Types.custom<BarChartTheme, BarChartConfig>(DEFAULT_BAR_CHART_THEME, { resolve: resolveBarChartTheme, lerp: lerpBarChartTheme }),\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.\n */\n growth: 1,\n /**\n * How much of the slot each series claims, one entry per series: a weight\n * rather than a switch, so hiding one is the others widening into the space.\n * Seeded from each series' `enabled`.\n */\n weights: fresh<number[]>(() => []),\n /** The category spotlit, or `null` for none. The choice snaps; `spotlightReveal` is the animation. */\n spotlight: Types.custom<number | null>(null),\n /** How far the category spotlight is drawn in, `[0, 1]`. */\n spotlightReveal: 0,\n /** Read as the chart is built: the legend is a part the chart builds or doesn't. */\n showLegend: Types.boolean(true, { animatable: false }),\n /** Read as the chart is built: whether each column prints the figure it plots. */\n showValues: Types.boolean(false, { animatable: false }),\n /** Whether each series' columns are drawn: on for every frame a show or hide covers, off once a hide lands. */\n showing: Types.custom<boolean[]>([], { private: true }),\n },\n defaults: {\n // Its parts fill it; a node made of them would hug them.\n width: \"fill\",\n height: \"fill\",\n weights: (state) => state.series.map((s) => ((s.enabled ?? true) ? 1 : 0)),\n showing: (state) => state.series.map((s) => s.enabled ?? true),\n },\n allowedChildren: [],\n children: (state) => {\n const theme = () => state.theme\n const domain = () => barChartDomain(state)\n let plot: Node2D | undefined\n // Before the panel is built or laid out it has no size, and the columns map onto nothing.\n const plotSize = () => laidOutSize(plot)\n const captioned = state.showValues === true\n\n const vAxis = new VerticalAxis({\n range: () => domain().range,\n markers: () => domain().ticks,\n captions: () => {\n const d = domain()\n return d.ticks.map((value) => valueLabel(state, d, value))\n },\n axis: () => theme().yAxis,\n label: state.valueAxis.label ?? \"\",\n width: \"hug\",\n height: \"fill\",\n })\n\n const cAxis = new CategoryAxis({\n categories: barCategories(state.data, state.categoryField),\n axis: () => theme().xAxis,\n label: state.categoryAxis.label ?? \"\",\n dims: () => categoryDims(state),\n width: \"fill\",\n height: \"hug\",\n }) as unknown as Node2D\n\n const barSets = state.series.map(\n (s, i) =>\n new ChartBars({\n bars: () => seriesBars(state, i, plotSize(), captioned),\n baseline: () => baselinePx(domain(), plotSize()),\n fill: () => resolveBarFill(theme().seriesFills, s, i),\n barStroke: () => theme().bar.stroke,\n barShadow: () => theme().bar.shadow,\n cornerRadius: () => theme().bar.cornerRadius,\n growth: () => state.growth,\n dims: () => categoryDims(state),\n showValues: captioned,\n valueStyle: state.theme.valueStyle,\n enabled: () => state.showing[i] ?? (s.enabled ?? true),\n }) as unknown as Node2D\n )\n\n const below: Node2D[] = [cAxis]\n if (state.showLegend !== false) {\n below.push(\n new ChartLegend({\n series: state.series,\n swatches: () => state.series.map((s, i) => resolveBarFill(theme().seriesFills, s, i)),\n legend: () => theme().legend,\n // The row's spacing is the theme's as the chart was built, like the\n // entries' type and chips: a theme tween re-paints the swatches only.\n gap: state.theme.legend.itemGap,\n padding: state.theme.legend.padding,\n }) as unknown as Node2D\n )\n }\n\n plot = new Rect({\n clip: true,\n children: [\n new ChartCanvas({\n fill: () => theme().plotArea.fill,\n shadow: () => theme().plotArea.shadow,\n xGridStroke: () => theme().xAxis.lineStyle,\n yGridStroke: () => theme().yAxis.lineStyle,\n // No vertical rules: the horizontal axis is categorical, so there is no\n // numeric position along it for a grid line to mark.\n xMarkers: [],\n yMarkers: () => domain().ticks,\n xExtent: () => [0, 1] as Range,\n yExtent: () => domain().range,\n }),\n ...barSets,\n new ChartBorder({ stroke: () => theme().plotArea.stroke }),\n ],\n }) as unknown as Node2D\n\n const gutter = new VerticalAxis({\n opacity: 0,\n range: () => domain().range,\n markers: () => domain().ticks,\n axis: () => theme().yAxis,\n label: state.valueAxis.label ?? \"\",\n width: \"hug\",\n height: 0,\n }) as unknown as Node2D\n\n return asParts([cartesianFrame({ axis: vAxis as unknown as Node2D, plot, gutter, below })])\n },\n commands: {\n /**\n * Animate the whole chart in: the two axes stagger their markers and\n * captions in, the columns rise from the baseline, and the legend fades up\n * last. Its first frame arms every part: markers and captions shifted and\n * transparent, columns collapsed, the legend dropped and transparent.\n * `duration` is the **whole** entrance; the beats are shares of it.\n */\n enter: {\n args: {},\n // Held from the chart's arrival, so it never shows finished ahead of its draw.\n entrance: true,\n easing: easeOut(),\n run: (timeline, _state, children) => {\n const parts = partsOf(children)\n if (!parts) return timeline.wait(timeline.duration)\n const duration = timeline.duration\n const axes = duration * AXES_SHARE\n const rise = duration * BARS_SHARE\n const { legend } = parts\n const at0 = (piece: Beat[\"piece\"]): Beat => ({ at: 0, duration: 0, piece })\n // Without a legend the beat is still its share of the whole.\n return beats(timeline, [\n at0(timeline.animate(() => ({ growth: 0 }))),\n ...(legend ? [at0(legend.to({ opacity: 0, y: -LEGEND_SLIDE }))] : []),\n { at: 0, duration: axes, piece: parts.vAxis.run(\"enter\", { slide: 24 }) },\n { at: 0, duration: axes, piece: parts.cAxis.run(\"enter\", { slide: 24 }) },\n // No priming to 0 first: the value at `t` is a function of `t`.\n { at: axes, duration: rise, piece: timeline.animate((t) => ({ growth: t })) },\n ...(legend ? [{ at: axes + rise, duration: duration * LEGEND_SHARE, piece: legend.to({ opacity: 1, y: 0 }) }] : []),\n ])\n },\n },\n /** Show series `index`: its columns come back, the group reflowing to make room, with its legend entry. */\n showSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => toggling(timeline, state, children, timeline.args.seriesIndex, 1),\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 — the mirror of\n * `showSeries`.\n */\n hideSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => toggling(timeline, state, children, timeline.args.seriesIndex, 0),\n },\n /**\n * Fade every other series — its columns **and its legend entry** — to focus\n * on `index`, which comes back to full. Nothing moves, so the group doesn't\n * reflow.\n */\n spotlightSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => {\n const parts = partsOf(children)\n if (!parts) return timeline.wait(timeline.duration)\n const index = timeline.args.seriesIndex\n const dim = state.theme.spotlight.dimOpacity\n return timeline.together([\n ...parts.bars.map((bars, i) => bars.to({ opacity: i === index ? 1 : dim })),\n ...(parts.legend ? [parts.legend.run(\"spotlightSeries\", { index })] : []),\n ])\n },\n },\n /**\n * Spotlight one **category**: every other category's columns and caption\n * fade to the theme's `dimOpacity`. Called while another is lit, the focus\n * moves directly: only the dimming changes, so nothing retracts first. A\n * category that is not there takes its slot and changes nothing.\n */\n spotlightCategory: {\n args: { categoryIndex: Types.number(0, { min: 0, step: 1 }) },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.categoryIndex\n if (index < 0 || index >= state.data.length) return timeline.wait(timeline.duration)\n const from = state.spotlightReveal\n return timeline.animate((t) => ({ spotlight: index, spotlightReveal: from + (1 - from) * t }))\n },\n },\n /**\n * Drop the category spotlight, every category back to full. The lit\n * category is held until the fade lands; a no-op when nothing is lit, which\n * still takes its slot.\n */\n clearCategory: {\n args: {},\n easing: easeOut(),\n run: (timeline, state) => {\n const from = state.spotlightReveal\n if (from === 0) return timeline.wait(timeline.duration)\n const lit = state.spotlight\n return timeline.animate((t) => (t >= 1 ? { spotlight: null, spotlightReveal: 0 } : { spotlight: lit, spotlightReveal: from * (1 - t) }))\n },\n },\n },\n})\n\nexport type BarChart = NodeOf<typeof BarChart>\n"]}
1
+ {"version":3,"file":"bar-chart.js","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,GAQR,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9E,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,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAA+B,MAAM,eAAe,CAAA;AAC9G,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,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F,MAAM,IAAI,GAAG,KAAK,CAAC,eAAe,CAAA;gBAClC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;YAChG,CAAC;SACF;QACD,sIAAsI;QACtI,aAAa,EAAE;YACb,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,OAAO,EAAE;YACjB,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;gBACvB,MAAM,IAAI,GAAG,KAAK,CAAC,eAAe,CAAA;gBAClC,IAAI,IAAI,KAAK,CAAC;oBAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;gBACvD,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAA;gBAC3B,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAC1I,CAAC;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import {\n Rect,\n Types,\n clamp,\n component2d,\n easeOut,\n type ChildView,\n type DataRecord,\n type NodeOf,\n // Named so this component's emitted type reaches `Node2D` and its props through the sdk, not core.\n type Node2D,\n type Node2DProps as _Node2DProps,\n type Size2D,\n} from \"@motionscript/sdk\"\nimport { formatNumber } from \"@motionscript/sdk/component\"\n\nimport { cartesianFrame, cartesianViews, laidOutSize } from \"../kit/cartesian\"\nimport { ChartBorder } from \"../kit/chart-border\"\nimport { ChartCanvas } from \"../kit/chart-canvas\"\nimport { ChartLegend } from \"../kit/chart-legend\"\nimport { SERIES_ARG, asParts, fresh } from \"../kit/entries\"\nimport { DEFAULT_MARKERS, ENTER_SHARE, LEGEND_SLIDE, beats, type AnyTimeline, type Beat } from \"../kit/motion\"\nimport { VerticalAxis } from \"../kit/vertical-axis\"\nimport {\n formatMarker,\n lerpAxisDomain,\n lerpAxisEntry,\n markerStep,\n markerValues,\n num,\n resolveAxisDomain,\n settleAxisDomain,\n type AxisDomainConfig,\n type Range,\n type ResolvedAxisDomain,\n} from \"../kit/shared\"\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\n/** What a bar chart plots, as its entries hold it. */\nexport interface BarChartValues {\n readonly data: DataRecord[]\n readonly series: BarSeries[]\n readonly stacked: boolean\n readonly valueAxis: AxisDomainConfig\n}\n\n/** The value axis's domain with its range and ticks resolved. */\nexport type BarChartDomain = ResolvedAxisDomain\n\ninterface BarState extends BarChartValues {\n readonly theme: BarChartConfig\n readonly weights: number[]\n readonly spotlight: number | null\n readonly spotlightReveal: number\n}\n\nfunction drawnValue(s: BarChartValues, domain: AxisDomainConfig): AxisDomainConfig {\n const divisions = (domain.ticks?.length ?? DEFAULT_MARKERS) - 1\n const range = resolveBarScale(s.data, s.series, s.stacked, domain.range, divisions)\n return { ...domain, range, ticks: domain.ticks ?? markerValues(range, DEFAULT_MARKERS - 1) }\n}\n\n/** The last domain worked out from each data array, and what it was read from. */\nconst domainsDrawn = new WeakMap<DataRecord[], Omit<BarChartValues, \"data\"> & { readonly domain: BarChartDomain }>()\n\n/** The value axis as drawn now. */\nexport function barChartDomain(s: BarChartValues): BarChartDomain {\n const { data, series, stacked, valueAxis } = s\n const kept = domainsDrawn.get(data)\n if (kept && kept.series === series && kept.stacked === stacked && kept.valueAxis === valueAxis) return kept.domain\n const domain = settleAxisDomain(valueAxis, (d) => drawnValue(s, d)) as BarChartDomain\n domainsDrawn.set(data, { series, stacked, valueAxis, domain })\n return domain\n}\n\n/** Ticks and the figures printed on columns both read through here, so they cannot disagree about how a number looks. */\nfunction valueLabel(s: BarChartValues, domain: BarChartDomain, value: number): string {\n const pattern = s.valueAxis.format\n return pattern === undefined ? formatMarker(value, markerStep(domain.ticks)) : formatNumber(value, pattern)\n}\n\n/** A value in the plot's centred pixel space (origin at its centre, y-up). */\nfunction valueToY(domain: BarChartDomain, plot: Size2D, value: number): number {\n const [min, max] = domain.range\n if (max <= min) return -plot.height / 2\n return ((value - min) / (max - min) - 0.5) * plot.height\n}\n\n/** Pixel y columns grow from: zero clamped onto the scale, so a cropped axis grows them from the plot floor. */\nfunction baselinePx(domain: BarChartDomain, plot: Size2D): number {\n const [min, max] = domain.range\n return valueToY(domain, plot, Math.min(Math.max(0, min), max))\n}\n\nfunction weightAt(s: BarState, index: number): number {\n return Math.max(0, s.weights[index] ?? 1)\n}\n\n/** `row` with each series' value scaled by its live weight, which stacked spans are measured from. */\nfunction weightedRow(s: BarState, row: DataRecord): DataRecord {\n const scaled: DataRecord = { ...row }\n s.series.forEach((series, i) => {\n const value = row[series.field]\n if (typeof value === \"number\") scaled[series.field] = value * weightAt(s, i)\n })\n return scaled\n}\n\n/**\n * Series `index`'s columns in centred pixel space. A grouped series divides the\n * slot with its siblings by live weight, a stacked one takes the whole slot, so\n * hiding a series reflows rather than punching a hole.\n */\nfunction seriesBars(s: BarState, index: number, plot: Size2D, captioned: boolean): BarGeometry[] {\n const series = s.series[index]\n if (!series) return []\n const domain = barChartDomain(s)\n const n = s.data.length\n const slotWidth = n > 0 ? plot.width / n : 0\n const slotCenter = (i: number) => -plot.width / 2 + slotWidth * (i + 0.5)\n const inner = slotWidth * clamp(s.theme.bar.slotFill, 0, 1)\n const gap = s.theme.bar.groupGap\n let total = 0\n for (let i = 0; i < s.series.length; i++) total += weightAt(s, i)\n const unit = inner / (total > 0 ? total : 1)\n const weight = weightAt(s, index)\n let before = 0\n for (let i = 0; i < index; i++) before += weightAt(s, i)\n\n return s.data.map((row, rowIndex) => {\n // Built from live contributions, so a fading series lowers the segments above it.\n const spans = barSpans(s.stacked ? weightedRow(s, row) : row, s.series, s.stacked)\n const span = spans[index] ?? { from: 0, to: 0, value: 0 }\n const cap = s.stacked ? stackCapIndex(row, s.series) : index\n const slotLeft = slotCenter(rowIndex) - inner / 2\n const x = s.stacked ? slotCenter(rowIndex) : slotLeft + unit * before + (unit * weight) / 2\n const width = s.stacked ? inner : Math.max(0, unit * weight - (s.series.length > 1 ? gap : 0))\n // The printed figure is the row's own value, not the weighted one.\n const value = num(row, series.field)\n return {\n x,\n width,\n from: valueToY(domain, plot, span.from),\n to: valueToY(domain, plot, span.to),\n round: cap === index,\n value,\n ...(captioned && { caption: valueLabel(s, domain, value) }),\n }\n })\n}\n\n/** Per-row opacity: 1 while nothing is spotlit, falling to the theme's `dimOpacity` for all but the chosen category. */\nfunction categoryDims(s: BarState): number[] {\n const focus = clamp(s.spotlightReveal, 0, 1)\n const dim = s.theme.spotlight.dimOpacity\n const chosen = s.spotlight\n return s.data.map((_, i) => (focus <= 0 || chosen === i ? 1 : 1 - (1 - dim) * focus))\n}\n\n/** The parts a bar chart's commands drive, found through its children. */\nfunction partsOf(children: readonly ChildView[]) {\n const frame = cartesianViews(children)\n if (!frame) return null\n const cAxis = frame.below.find(CategoryAxis.is)\n if (!VerticalAxis.is(frame.axis) || !cAxis) return null\n return {\n vAxis: frame.axis,\n cAxis,\n bars: frame.plot.filter(ChartBars.is),\n legend: frame.below.find(ChartLegend.is) ?? null,\n }\n}\n\n/**\n * Move series `index`'s slot share to `target` with its legend entry. Its\n * columns stay drawn for every frame the move covers and switch off only once a\n * hide has landed, so arriving at a time backwards matches arriving forwards.\n */\nfunction toggling(timeline: AnyTimeline, state: BarState & { readonly showing: boolean[] }, children: readonly ChildView[], index: number, target: number) {\n const parts = partsOf(children)\n if (!parts || !parts.bars[index]) return timeline.wait(timeline.duration)\n // Through `weightAt`, so short stored weights still tween from the 1 drawn.\n const from = state.series.map((_, i) => weightAt(state, i))\n const start = from[index] ?? 1\n const showing = state.series.map((s, i) => state.showing[i] ?? (s.enabled ?? true))\n return timeline.together([\n timeline.animate((t) => {\n const weights = [...from]\n weights[index] = start + (target - start) * timeline.ease(t)\n const shown = [...showing]\n shown[index] = target > 0 || t < 1\n return { weights, showing: shown }\n }, { eased: false }),\n ...(parts.legend ? [parts.legend.run(target > 0 ? \"showSeries\" : \"hideSeries\", { index })] : []),\n ])\n}\n\n/**\n * A grouped or stacked bar chart, built like the line chart from `ChartCanvas`,\n * `VerticalAxis`, {@link CategoryAxis}, one {@link ChartBars} per series and\n * `ChartLegend`. Zero is always on the scale and columns grow about it, so a\n * negative value draws downward from the same `growth` signal.\n *\n * Resting state is the finished chart; `enter` arms every part on its first\n * frame. A `to` of the value axis's `range` or `ticks` tweens from the domain as\n * drawn, so an auto axis rescales the columns continuously.\n */\nexport const BarChart = component2d({\n key: \"barChart\",\n state: {\n data: fresh<DataRecord[]>(() => []),\n // Names a column, not a value, like the line chart's `xField`.\n categoryField: \"\",\n series: fresh<BarSeries[]>(() => []),\n stacked: false,\n valueAxis: Types.custom<AxisDomainConfig>({}, { resolve: resolveAxisDomain, lerp: lerpAxisEntry }),\n categoryAxis: Types.custom<AxisDomainConfig>({}, { resolve: resolveAxisDomain, lerp: lerpAxisDomain }),\n theme: Types.custom<BarChartTheme, BarChartConfig>(DEFAULT_BAR_CHART_THEME, { resolve: resolveBarChartTheme, lerp: lerpBarChartTheme }),\n /** Rise of every column about the baseline, `[0, 1]`: 0 collapses them onto it. */\n growth: 1,\n /** Each series' share of the slot, seeded from `enabled`: a weight rather than a switch, so hiding one widens the others. */\n weights: fresh<number[]>(() => []),\n /** The category spotlit, or `null`. The choice snaps; `spotlightReveal` animates it. */\n spotlight: Types.custom<number | null>(null),\n spotlightReveal: 0,\n /** Read as the chart is built: the legend is a part the chart builds or doesn't. */\n showLegend: Types.boolean(true, { animatable: false }),\n /** Read as the chart is built: whether each column prints the figure it plots. */\n showValues: Types.boolean(false, { animatable: false }),\n /** Whether each series' columns are drawn: on for every frame a show or hide covers, off once a hide lands. */\n showing: Types.custom<boolean[]>([], { private: true }),\n },\n defaults: {\n // A node made of parts that fill would otherwise hug them.\n width: \"fill\",\n height: \"fill\",\n weights: (state) => state.series.map((s) => ((s.enabled ?? true) ? 1 : 0)),\n showing: (state) => state.series.map((s) => s.enabled ?? true),\n },\n allowedChildren: [],\n children: (state) => {\n const theme = () => state.theme\n const domain = () => barChartDomain(state)\n let plot: Node2D | undefined\n const plotSize = () => laidOutSize(plot)\n const captioned = state.showValues === true\n\n const vAxis = new VerticalAxis({\n range: () => domain().range,\n markers: () => domain().ticks,\n captions: () => {\n const d = domain()\n return d.ticks.map((value) => valueLabel(state, d, value))\n },\n axis: () => theme().yAxis,\n label: state.valueAxis.label ?? \"\",\n width: \"hug\",\n height: \"fill\",\n })\n\n const cAxis = new CategoryAxis({\n categories: barCategories(state.data, state.categoryField),\n axis: () => theme().xAxis,\n label: state.categoryAxis.label ?? \"\",\n dims: () => categoryDims(state),\n width: \"fill\",\n height: \"hug\",\n }) as unknown as Node2D\n\n const barSets = state.series.map(\n (s, i) =>\n new ChartBars({\n bars: () => seriesBars(state, i, plotSize(), captioned),\n baseline: () => baselinePx(domain(), plotSize()),\n fill: () => resolveBarFill(theme().seriesFills, s, i),\n barStroke: () => theme().bar.stroke,\n barShadow: () => theme().bar.shadow,\n cornerRadius: () => theme().bar.cornerRadius,\n growth: () => state.growth,\n dims: () => categoryDims(state),\n showValues: captioned,\n valueStyle: state.theme.valueStyle,\n enabled: () => state.showing[i] ?? (s.enabled ?? true),\n }) as unknown as Node2D\n )\n\n const below: Node2D[] = [cAxis]\n if (state.showLegend !== false) {\n below.push(\n new ChartLegend({\n series: state.series,\n swatches: () => state.series.map((s, i) => resolveBarFill(theme().seriesFills, s, i)),\n legend: () => theme().legend,\n // Spacing is fixed as built; a theme tween re-paints the swatches only.\n gap: state.theme.legend.itemGap,\n padding: state.theme.legend.padding,\n }) as unknown as Node2D\n )\n }\n\n plot = new Rect({\n clip: true,\n children: [\n new ChartCanvas({\n fill: () => theme().plotArea.fill,\n shadow: () => theme().plotArea.shadow,\n xGridStroke: () => theme().xAxis.lineStyle,\n yGridStroke: () => theme().yAxis.lineStyle,\n // Categorical x axis: no numeric position for a vertical rule to mark.\n xMarkers: [],\n yMarkers: () => domain().ticks,\n xExtent: () => [0, 1] as Range,\n yExtent: () => domain().range,\n }),\n ...barSets,\n new ChartBorder({ stroke: () => theme().plotArea.stroke }),\n ],\n }) as unknown as Node2D\n\n const gutter = new VerticalAxis({\n opacity: 0,\n range: () => domain().range,\n markers: () => domain().ticks,\n axis: () => theme().yAxis,\n label: state.valueAxis.label ?? \"\",\n width: \"hug\",\n height: 0,\n }) as unknown as Node2D\n\n return asParts([cartesianFrame({ axis: vAxis as unknown as Node2D, plot, gutter, below })])\n },\n commands: {\n /** Axes stagger in, columns rise from the baseline, the legend fades up last. `duration` is the whole entrance. */\n enter: {\n args: {},\n // Held from arrival, so it never shows finished ahead of its draw.\n entrance: true,\n easing: easeOut(),\n run: (timeline, _state, children) => {\n const parts = partsOf(children)\n if (!parts) return timeline.wait(timeline.duration)\n const duration = timeline.duration\n const axes = duration * ENTER_SHARE.axes\n const rise = duration * ENTER_SHARE.marks\n const { legend } = parts\n const at0 = (piece: Beat[\"piece\"]): Beat => ({ at: 0, duration: 0, piece })\n return beats(timeline, [\n at0(timeline.animate(() => ({ growth: 0 }))),\n ...(legend ? [at0(legend.to({ opacity: 0, y: -LEGEND_SLIDE }))] : []),\n { at: 0, duration: axes, piece: parts.vAxis.run(\"enter\", { slide: 24 }) },\n { at: 0, duration: axes, piece: parts.cAxis.run(\"enter\", { slide: 24 }) },\n // No priming to 0 first: the value at `t` is a function of `t`.\n { at: axes, duration: rise, piece: timeline.animate((t) => ({ growth: t })) },\n ...(legend ? [{ at: axes + rise, duration: duration * ENTER_SHARE.legend, piece: legend.to({ opacity: 1, y: 0 }) }] : []),\n ])\n },\n },\n /** Bring series `index` back, the group reflowing to make room, with its legend entry. */\n showSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => toggling(timeline, state, children, timeline.args.seriesIndex, 1),\n },\n /** The mirror of `showSeries`: columns narrow away (stacked, sink out) while the rest widen into the space. */\n hideSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => toggling(timeline, state, children, timeline.args.seriesIndex, 0),\n },\n /** Fade every other series, columns and legend entry, to focus on `index`. Nothing moves, so the group does not reflow. */\n spotlightSeries: {\n args: { seriesIndex: SERIES_ARG },\n easing: easeOut(),\n run: (timeline, state, children) => {\n const parts = partsOf(children)\n if (!parts) return timeline.wait(timeline.duration)\n const index = timeline.args.seriesIndex\n const dim = state.theme.spotlight.dimOpacity\n return timeline.together([\n ...parts.bars.map((bars, i) => bars.to({ opacity: i === index ? 1 : dim })),\n ...(parts.legend ? [parts.legend.run(\"spotlightSeries\", { index })] : []),\n ])\n },\n },\n /**\n * Fade every other category's columns and caption to `dimOpacity`. While\n * another is lit the focus moves directly. A missing category takes its slot\n * and changes nothing.\n */\n spotlightCategory: {\n args: { categoryIndex: Types.number(0, { min: 0, step: 1 }) },\n easing: easeOut(),\n run: (timeline, state) => {\n const index = timeline.args.categoryIndex\n if (index < 0 || index >= state.data.length) return timeline.wait(timeline.duration)\n const from = state.spotlightReveal\n return timeline.animate((t) => ({ spotlight: index, spotlightReveal: from + (1 - from) * t }))\n },\n },\n /** Every category back to full; the lit one is held until the fade lands. A no-op when nothing is lit, which still takes its slot. */\n clearCategory: {\n args: {},\n easing: easeOut(),\n run: (timeline, state) => {\n const from = state.spotlightReveal\n if (from === 0) return timeline.wait(timeline.duration)\n const lit = state.spotlight\n return timeline.animate((t) => (t >= 1 ? { spotlight: null, spotlightReveal: 0 } : { spotlight: lit, spotlightReveal: from * (1 - t) }))\n },\n },\n },\n})\n\nexport type BarChart = NodeOf<typeof BarChart>\n"]}
@@ -1,47 +1,18 @@
1
- import { type NodeOf, type Node2D, type Node2DProps } from "@motionscript/sdk";
1
+ import { type NodeOf, type Node2D, type Node2DProps as _Node2DProps } from "@motionscript/sdk";
2
2
  import { type Arrival } from "../kit/motion.js";
3
3
  import { type AxisConfig } from "../kit/shared.js";
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
4
  /**
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
- * `enter` staggers the captions in left-to-right, each lifted a little above
38
- * its slot and transparent; the resting state is the landed one, so a chart
39
- * that is never told to enter still reads as finished.
5
+ * The categorical axis of a {@link BarChart}: one {@link Text} caption per row,
6
+ * centred on its slot. Not folded into `HorizontalAxis`, which places markers by
7
+ * value on a scale; this divides its width into equal slots. It is laid out to
8
+ * exactly the plot's width, so each caption lands under its columns with neither
9
+ * side told about the other. The resting state is landed.
40
10
  */
41
11
  export declare const CategoryAxis: import("@motionscript/sdk").Component<"categoryAxis", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
42
12
  readonly categories: import("@motionscript/sdk").Type<string[], string[], false>;
43
13
  readonly axis: import("@motionscript/sdk").Type<AxisConfig, AxisConfig, false>;
44
14
  readonly label: "";
15
+ /** Per-category opacity multiplier, so the caption under a dimmed column dims with it. Missing reads as 1. */
45
16
  readonly dims: import("@motionscript/sdk").Type<number[], number[], false>;
46
17
  readonly arrivals: import("@motionscript/sdk").Type<Readonly<Record<string, Arrival>>, Readonly<Record<string, Arrival>>, false>;
47
18
  }>, {
@@ -49,16 +20,18 @@ export declare const CategoryAxis: import("@motionscript/sdk").Component<"catego
49
20
  readonly stagger: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
50
21
  readonly slide: import("@motionscript/sdk").Type<number, number, false>;
51
22
  };
52
- }, null, Node2D<Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
23
+ }, null, Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
53
24
  readonly categories: import("@motionscript/sdk").Type<string[], string[], false>;
54
25
  readonly axis: import("@motionscript/sdk").Type<AxisConfig, AxisConfig, false>;
55
26
  readonly label: "";
27
+ /** Per-category opacity multiplier, so the caption under a dimmed column dims with it. Missing reads as 1. */
56
28
  readonly dims: import("@motionscript/sdk").Type<number[], number[], false>;
57
29
  readonly arrivals: import("@motionscript/sdk").Type<Readonly<Record<string, Arrival>>, Readonly<Record<string, Arrival>>, false>;
58
30
  }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
59
31
  readonly categories: import("@motionscript/sdk").Type<string[], string[], false>;
60
32
  readonly axis: import("@motionscript/sdk").Type<AxisConfig, AxisConfig, false>;
61
33
  readonly label: "";
34
+ /** Per-category opacity multiplier, so the caption under a dimmed column dims with it. Missing reads as 1. */
62
35
  readonly dims: import("@motionscript/sdk").Type<number[], number[], false>;
63
36
  readonly arrivals: import("@motionscript/sdk").Type<Readonly<Record<string, Arrival>>, Readonly<Record<string, Arrival>>, false>;
64
37
  }>, {
@@ -66,6 +39,6 @@ export declare const CategoryAxis: import("@motionscript/sdk").Component<"catego
66
39
  readonly stagger: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
67
40
  readonly slide: import("@motionscript/sdk").Type<number, number, false>;
68
41
  };
69
- }, Node2D<Node2DProps>>>>;
42
+ }, Node2D<_Node2DProps>>>>;
70
43
  export type CategoryAxis = NodeOf<typeof CategoryAxis>;
71
44
  //# sourceMappingURL=category-axis.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"category-axis.d.ts","sourceRoot":"","sources":["../../src/bar-chart/category-axis.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA8D,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AACxG,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AAEtB,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,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAiGvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAA"}
1
+ {"version":3,"file":"category-axis.d.ts","sourceRoot":"","sources":["../../src/bar-chart/category-axis.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,WAAW,IAAI,YAAY,EACjC,MAAM,mBAAmB,CAAA;AAI1B,OAAO,EAA8D,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AACxG,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AAItB;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;;IAMrB,8GAA8G;;;;;;;;;;;;IAA9G,8GAA8G;;;;;;;IAA9G,8GAA8G;;;;;;;;0BAiFhH,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAA"}
@@ -1,28 +1,15 @@
1
- import { Rect, Text, Types, component2d, insetsOps, textOps, } from "@motionscript/sdk";
1
+ import { Rect, Text, Types, clamp, component2d, insetsOps, textOps, } from "@motionscript/sdk";
2
+ import { enterBudget } from "@motionscript/sdk/component";
2
3
  import { asParts, fresh } from "../kit/entries.js";
3
4
  import { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase } from "../kit/motion.js";
4
- import { DEFAULT_X_AXIS, clampUnit, enterBudget, } from "../kit/shared.js";
5
- /** How far a caption starts above its slot when it enters, in px. */
5
+ import { DEFAULT_X_AXIS, } from "../kit/shared.js";
6
6
  const SLIDE = 24;
7
7
  /**
8
- * The **categorical** horizontal axis of a {@link BarChart}: a row of
9
- * {@link Text} captions, one per row of the data, each centred on its slot
10
- * beneath the baseline.
11
- *
12
- * Not a variant of the line chart's `HorizontalAxis` and deliberately not
13
- * folded into it: that axis places markers by *value* across a numeric range,
14
- * this one divides its width into equal slots and centres a name in each. The
15
- * two look alike on screen and share nothing underneath — one reads a scale,
16
- * the other counts rows.
17
- *
18
- * The slot arithmetic is the same as the plot's, because this node is laid out
19
- * to exactly the plot's width (the chart reserves the axis gutter with an
20
- * invisible twin of the value axis, as the line chart does), so a caption lands
21
- * under the columns it names without either side being told about the other.
22
- *
23
- * `enter` staggers the captions in left-to-right, each lifted a little above
24
- * its slot and transparent; the resting state is the landed one, so a chart
25
- * that is never told to enter still reads as finished.
8
+ * The categorical axis of a {@link BarChart}: one {@link Text} caption per row,
9
+ * centred on its slot. Not folded into `HorizontalAxis`, which places markers by
10
+ * value on a scale; this divides its width into equal slots. It is laid out to
11
+ * exactly the plot's width, so each caption lands under its columns with neither
12
+ * side told about the other. The resting state is landed.
26
13
  */
27
14
  export const CategoryAxis = component2d({
28
15
  key: "categoryAxis",
@@ -30,10 +17,11 @@ export const CategoryAxis = component2d({
30
17
  categories: fresh(() => []),
31
18
  axis: Types.custom(DEFAULT_X_AXIS),
32
19
  label: "",
20
+ /** Per-category opacity multiplier, so the caption under a dimmed column dims with it. Missing reads as 1. */
33
21
  dims: fresh(() => []),
34
22
  arrivals: arrivalsEntry(),
35
23
  },
36
- // A plain node filled its parent; one made of its captions would hug them.
24
+ // A node made of captions would otherwise hug them.
37
25
  defaults: { width: "fill", height: "fill" },
38
26
  children: (state) => {
39
27
  const tickPad = insetsOps.resolve(state.axis.tickPadding).top;
@@ -41,22 +29,18 @@ export const CategoryAxis = component2d({
41
29
  const column = [];
42
30
  // The column's parent is the axis: its box is what the slots divide.
43
31
  const width = () => column[0]?.parent?.layoutBounds.width ?? 0;
44
- /** Centre x of slot `i`, in the node's centred space. */
45
32
  const slotCenter = (index) => {
46
33
  const n = state.categories.length;
47
34
  if (n <= 0)
48
35
  return 0;
49
36
  return -width() / 2 + (width() / n) * (index + 0.5);
50
37
  };
51
- // Each caption sits in a hug box carrying the spotlight dim, so the
52
- // entrance can animate the text's own opacity without the two fighting over
53
- // one value — opacity multiplies down the tree, which is exactly the
54
- // composition wanted here.
38
+ // The spotlight dim sits on a hug box around each caption, so the entrance animates the text's own opacity without the two fighting over one value.
55
39
  const slots = state.categories.map((caption, i) => new Rect({
56
40
  width: "hug",
57
41
  height: "hug",
58
42
  flow: "freeform",
59
- opacity: () => clampUnit(state.dims[i] ?? 1),
43
+ opacity: () => clamp(state.dims[i] ?? 1, 0, 1),
60
44
  x: () => slotCenter(i),
61
45
  children: [
62
46
  new Text({
@@ -81,16 +65,9 @@ export const CategoryAxis = component2d({
81
65
  },
82
66
  commands: {
83
67
  /**
84
- * Slide + fade every caption in from above, staggered left-to-right, then
85
- * bring the title down behind them. Its first frame arms them all: lifted
86
- * by `slide` and transparent.
87
- *
88
- * The timeline's duration is the **whole** entrance — the stagger and the
89
- * title are carved out of it rather than added on top. See {@link enterBudget}.
90
- *
91
- * `stagger` is seconds between successive captions (derived when omitted);
92
- * `slide` is the starting upward offset in px (node space is y-up, so a
93
- * positive start slides *down* into place).
68
+ * Slide and fade captions in left to right, then the title. The duration is
69
+ * the whole entrance ({@link enterBudget}). `stagger` is seconds between
70
+ * captions (derived when omitted); `slide` is the starting offset in px.
94
71
  */
95
72
  enter: {
96
73
  args: {
@@ -1 +1 @@
1
- {"version":3,"file":"category-axis.js","sourceRoot":"","sources":["../../src/bar-chart/category-axis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAO,GAIR,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAgB,MAAM,eAAe,CAAA;AACxG,OAAO,EACL,cAAc,EACd,SAAS,EACT,WAAW,GAEZ,MAAM,eAAe,CAAA;AAoBtB,qEAAqE;AACrE,MAAM,KAAK,GAAG,EAAE,CAAA;AAEhB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;IACtC,GAAG,EAAE,cAAc;IACn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I,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;gBACxF,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;gBAChC,MAAM,eAAe,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAA;gBAChD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;gBAC3H,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;gBAC1H,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC3E,CAAC;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import {\n Rect,\n Text,\n Types,\n component2d,\n insetsOps,\n textOps,\n type NodeOf,\n type Node2D,\n type Node2DProps,\n} from \"@motionscript/sdk\"\n\nimport { asParts, fresh } from \"../kit/entries\"\nimport { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase, type Arrival } from \"../kit/motion\"\nimport {\n DEFAULT_X_AXIS,\n clampUnit,\n enterBudget,\n type AxisConfig,\n} from \"../kit/shared\"\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 * `enter` staggers the captions in left-to-right, each lifted a little above\n * its slot and transparent; the resting state is the landed one, so a chart\n * that is never told to enter still reads as finished.\n */\nexport const CategoryAxis = component2d({\n key: \"categoryAxis\",\n state: {\n categories: fresh<string[]>(() => []),\n axis: Types.custom<AxisConfig>(DEFAULT_X_AXIS),\n label: \"\",\n dims: fresh<number[]>(() => []),\n arrivals: arrivalsEntry(),\n },\n // A plain node filled its parent; one made of its captions would hug them.\n defaults: { width: \"fill\", height: \"fill\" },\n children: (state) => {\n const tickPad = insetsOps.resolve(state.axis.tickPadding).top\n const titlePad = insetsOps.resolve(state.axis.titlePadding).top\n\n const column: Node2D[] = []\n // The column's parent is the axis: its box is what the slots divide.\n const width = () => (column[0]?.parent as Node2D | null | undefined)?.layoutBounds.width ?? 0\n /** Centre x of slot `i`, in the node's centred space. */\n const slotCenter = (index: number) => {\n const n = state.categories.length\n if (n <= 0) return 0\n return -width() / 2 + (width() / n) * (index + 0.5)\n }\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 = state.categories.map((caption, i) =>\n new Rect({\n width: \"hug\",\n height: \"hug\",\n flow: \"freeform\",\n opacity: () => clampUnit(state.dims[i] ?? 1),\n x: () => slotCenter(i),\n children: [\n new Text({\n ...textOps.styleProps(state.axis.labelStyle),\n text: caption,\n opacity: () => arrivalOf(state.arrivals, i).opacity,\n y: () => arrivalOf(state.arrivals, i).shift,\n }),\n ],\n })\n )\n\n const children: Node2D[] = [new Rect({ width: \"fill\", height: \"hug\", padding: { top: tickPad }, children: slots })]\n if (state.label !== \"\") {\n children.push(\n new Text({\n ...textOps.styleProps(state.axis.titleStyle),\n text: state.label,\n opacity: () => arrivalOf(state.arrivals, \"label\").opacity,\n y: () => arrivalOf(state.arrivals, \"label\").shift,\n })\n )\n }\n\n column.push(new Rect({ flow: \"vertical\", gap: titlePad, height: \"hug\", width: \"fill\", children }))\n return asParts(column)\n },\n commands: {\n /**\n * Slide + fade every caption in from above, staggered left-to-right, then\n * bring the title down behind them. Its first frame arms them all: lifted\n * by `slide` and transparent.\n *\n * The timeline's duration is the **whole** entrance — the stagger and the\n * title are carved out of it rather than added on top. See {@link enterBudget}.\n *\n * `stagger` is seconds between successive captions (derived when omitted);\n * `slide` is the starting upward offset in px (node space is y-up, so a\n * positive start slides *down* into place).\n */\n enter: {\n args: {\n stagger: Types.custom<number | undefined>(undefined),\n slide: Types.number(SLIDE),\n },\n run: (timeline, state) => {\n const { stagger, slide } = timeline.args\n const count = state.categories.length\n const captioned = state.label !== \"\"\n const from: Arrival = { opacity: 0, shift: slide }\n const keys = [...state.categories.keys(), ...(captioned ? [\"label\"] : [])]\n const arm = timeline.animate(() => ({ arrivals: armed(keys, from) }))\n if (count === 0) return arm\n const { step, per, caption } = enterBudget(timeline.duration, count, captioned, stagger)\n const ease = frameEase(timeline)\n const lastCaptionEnds = (count - 1) * step + per\n const captions = state.categories.map((_, i) => ({ at: i * step, duration: per, piece: arrival(timeline, i, from, ease) }))\n const label = captioned ? [{ at: lastCaptionEnds, duration: caption, piece: arrival(timeline, \"label\", from, ease) }] : []\n return timeline.together([arm, beats(timeline, [...captions, ...label])])\n },\n },\n },\n})\n\nexport type CategoryAxis = NodeOf<typeof CategoryAxis>\n"]}
1
+ {"version":3,"file":"category-axis.js","sourceRoot":"","sources":["../../src/bar-chart/category-axis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAO,GAKR,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAgB,MAAM,eAAe,CAAA;AACxG,OAAO,EACL,cAAc,GAEf,MAAM,eAAe,CAAA;AAEtB,MAAM,KAAK,GAAG,EAAE,CAAA;AAEhB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;IACtC,GAAG,EAAE,cAAc;IACnB,KAAK,EAAE;QACL,UAAU,EAAE,KAAK,CAAW,GAAG,EAAE,CAAC,EAAE,CAAC;QACrC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAa,cAAc,CAAC;QAC9C,KAAK,EAAE,EAAE;QACT,8GAA8G;QAC9G,IAAI,EAAE,KAAK,CAAW,GAAG,EAAE,CAAC,EAAE,CAAC;QAC/B,QAAQ,EAAE,aAAa,EAAE;KAC1B;IACD,oDAAoD;IACpD,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;IAC3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AE,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;gBAC3H,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;gBAC1H,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC3E,CAAC;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import {\n Rect,\n Text,\n Types,\n clamp,\n component2d,\n insetsOps,\n textOps,\n type NodeOf,\n // Named so this component's emitted type reaches `Node2D` and its props through the sdk, not core.\n type Node2D,\n type Node2DProps as _Node2DProps,\n} from \"@motionscript/sdk\"\nimport { enterBudget } from \"@motionscript/sdk/component\"\n\nimport { asParts, fresh } from \"../kit/entries\"\nimport { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase, type Arrival } from \"../kit/motion\"\nimport {\n DEFAULT_X_AXIS,\n type AxisConfig,\n} from \"../kit/shared\"\n\nconst SLIDE = 24\n\n/**\n * The categorical axis of a {@link BarChart}: one {@link Text} caption per row,\n * centred on its slot. Not folded into `HorizontalAxis`, which places markers by\n * value on a scale; this divides its width into equal slots. It is laid out to\n * exactly the plot's width, so each caption lands under its columns with neither\n * side told about the other. The resting state is landed.\n */\nexport const CategoryAxis = component2d({\n key: \"categoryAxis\",\n state: {\n categories: fresh<string[]>(() => []),\n axis: Types.custom<AxisConfig>(DEFAULT_X_AXIS),\n label: \"\",\n /** Per-category opacity multiplier, so the caption under a dimmed column dims with it. Missing reads as 1. */\n dims: fresh<number[]>(() => []),\n arrivals: arrivalsEntry(),\n },\n // A node made of captions would otherwise hug them.\n defaults: { width: \"fill\", height: \"fill\" },\n children: (state) => {\n const tickPad = insetsOps.resolve(state.axis.tickPadding).top\n const titlePad = insetsOps.resolve(state.axis.titlePadding).top\n\n const column: Node2D[] = []\n // The column's parent is the axis: its box is what the slots divide.\n const width = () => (column[0]?.parent as Node2D | null | undefined)?.layoutBounds.width ?? 0\n const slotCenter = (index: number) => {\n const n = state.categories.length\n if (n <= 0) return 0\n return -width() / 2 + (width() / n) * (index + 0.5)\n }\n\n // The spotlight dim sits on a hug box around each caption, so the entrance animates the text's own opacity without the two fighting over one value.\n const slots = state.categories.map((caption, i) =>\n new Rect({\n width: \"hug\",\n height: \"hug\",\n flow: \"freeform\",\n opacity: () => clamp(state.dims[i] ?? 1, 0, 1),\n x: () => slotCenter(i),\n children: [\n new Text({\n ...textOps.styleProps(state.axis.labelStyle),\n text: caption,\n opacity: () => arrivalOf(state.arrivals, i).opacity,\n y: () => arrivalOf(state.arrivals, i).shift,\n }),\n ],\n })\n )\n\n const children: Node2D[] = [new Rect({ width: \"fill\", height: \"hug\", padding: { top: tickPad }, children: slots })]\n if (state.label !== \"\") {\n children.push(\n new Text({\n ...textOps.styleProps(state.axis.titleStyle),\n text: state.label,\n opacity: () => arrivalOf(state.arrivals, \"label\").opacity,\n y: () => arrivalOf(state.arrivals, \"label\").shift,\n })\n )\n }\n\n column.push(new Rect({ flow: \"vertical\", gap: titlePad, height: \"hug\", width: \"fill\", children }))\n return asParts(column)\n },\n commands: {\n /**\n * Slide and fade captions in left to right, then the title. The duration is\n * the whole entrance ({@link enterBudget}). `stagger` is seconds between\n * captions (derived when omitted); `slide` is the starting offset in px.\n */\n enter: {\n args: {\n stagger: Types.custom<number | undefined>(undefined),\n slide: Types.number(SLIDE),\n },\n run: (timeline, state) => {\n const { stagger, slide } = timeline.args\n const count = state.categories.length\n const captioned = state.label !== \"\"\n const from: Arrival = { opacity: 0, shift: slide }\n const keys = [...state.categories.keys(), ...(captioned ? [\"label\"] : [])]\n const arm = timeline.animate(() => ({ arrivals: armed(keys, from) }))\n if (count === 0) return arm\n const { step, per, caption } = enterBudget(timeline.duration, count, captioned, stagger)\n const ease = frameEase(timeline)\n const lastCaptionEnds = (count - 1) * step + per\n const captions = state.categories.map((_, i) => ({ at: i * step, duration: per, piece: arrival(timeline, i, from, ease) }))\n const label = captioned ? [{ at: lastCaptionEnds, duration: caption, piece: arrival(timeline, \"label\", from, ease) }] : []\n return timeline.together([arm, beats(timeline, [...captions, ...label])])\n },\n },\n },\n})\n\nexport type CategoryAxis = NodeOf<typeof CategoryAxis>\n"]}
@@ -1,129 +1,98 @@
1
- import { type Fill, type FillResolved, type NodeOf, type Node2D as _Node2D, type Node2DProps, type Shadow, type ShadowResolved, type Stroke, type StrokeResolved, type TextStyle } from "@motionscript/sdk";
1
+ import { type Fill, type FillResolved, type NodeOf, type Node2D as _Node2D, type Node2DProps as _Node2DProps, type Shadow, type ShadowResolved, type Stroke, type StrokeResolved, type TextStyle } from "@motionscript/sdk";
2
2
  /**
3
- * One drawn column, already mapped into the plot's **centred pixel space**
4
- * (origin at the plot centre, y-up) by the parent {@link BarChart}.
5
- *
6
- * `from`/`to` are the two ends of the column rather than a base and a height,
7
- * for the same reason {@link BarSpan} is a span: it is the one shape that fits a
8
- * grouped bar, a stacked segment and a negative value without a special case.
3
+ * One drawn column in the plot's centred pixel space (origin at the centre,
4
+ * y-up), mapped by the parent {@link BarChart}. `from`/`to` are the two ends
5
+ * rather than a base and a height, like {@link BarSpan}: one shape fits grouped,
6
+ * stacked and negative.
9
7
  */
10
8
  export interface BarGeometry {
11
- /** Centre x of the column. */
9
+ /** Centre x. */
12
10
  x: number;
13
- /** Column width in px. */
14
11
  width: number;
15
- /** Pixel y of the column's base — the baseline when grouped, the running stack top when stacked. */
12
+ /** Pixel y of the base: the baseline when grouped, the running stack top when stacked. */
16
13
  from: number;
17
- /** Pixel y of its far end, at full {@link ChartBarsProps.growth}. */
14
+ /** Pixel y of the far end at full growth. */
18
15
  to: number;
19
- /** Whether the far end takes the theme's corner radius (the stack's cap). */
16
+ /** Whether the far end takes the corner radius (the stack's cap). */
20
17
  round: boolean;
21
- /** The value this column plots, for the figure printed on it. */
18
+ /** The value plotted, for the printed figure. */
22
19
  value: number;
23
- /**
24
- * The figure printed on it, written as the chart's value axis writes its
25
- * ticks, so the two cannot disagree. Absent, the bare marker reading of
26
- * {@link value}.
27
- */
20
+ /** The printed figure, written as the value axis writes its ticks; absent, the bare marker reading of `value`. */
28
21
  caption?: string;
29
22
  }
30
- export interface ChartBarsProps extends Node2DProps {
31
- /** This series' columns, one per row of the chart's data. */
32
- bars: BarGeometry[];
33
- /** Pixel y of value 0 — where every column grows *from*. */
34
- baseline: number;
35
- /** Column paint — this series' own, or the theme palette's entry for its index. */
36
- fill: Fill;
37
- /** Optional outline on every column. */
38
- barStroke: Stroke;
39
- /** Optional drop shadow on every column. */
40
- barShadow: Shadow;
41
- /** Radius of the far-end corners, in px. */
42
- cornerRadius: number;
43
- /**
44
- * Rise of every column in `[0, 1]`, measured **about the baseline**: 0
45
- * collapses them all onto it, 1 draws them at full length.
46
- *
47
- * Scaling about the baseline rather than about each column's own base is what
48
- * keeps a stack flush mid-animation — every segment's base and end travel by
49
- * the same factor, so the segments stay stacked instead of the upper ones
50
- * floating above the still-growing lower ones. It also means a negative
51
- * column grows *down* out of the same signal.
52
- */
53
- growth: number;
54
- /**
55
- * Per-column opacity multiplier, by row index — how the chart's category
56
- * spotlight reaches a single column without touching the series it belongs
57
- * to. Missing entries read as 1.
58
- */
59
- dims: number[];
60
- /** Whether the figure each column plots is printed on it. */
61
- showValues: boolean;
62
- /** Type style for those figures. */
63
- valueStyle: TextStyle;
64
- /**
65
- * Whether this series draws at all — the wholesale switch behind
66
- * `BarChart.showSeries`/`hideSeries`, alongside the slot weight that animates
67
- * the reflow. Off skips the columns *and* their figures.
68
- */
69
- enabled: boolean;
70
- }
71
23
  /**
72
- * One **series** of a {@link BarChart}, drawn as one command list: its column in
73
- * every category, plus the figures printed on them.
74
- *
75
- * A node per series rather than a node per bar, deliberately — it is the same
76
- * unit `ChartLine` is, which is what lets `showSeries`/`hideSeries`/
77
- * `spotlightSeries` mean exactly the same thing on a bar chart as on a line
78
- * chart: enable the node, or tween its opacity. The columns' *positions* come
79
- * from the parent (it owns the slot arithmetic both modes share), so this part
80
- * only has to know how to draw a span and grow it.
24
+ * One series of a {@link BarChart}: its column in every category plus the
25
+ * printed figures. A node per series, like `ChartLine`, so `showSeries` and
26
+ * `spotlightSeries` mean the same on both: enable the node or tween its opacity.
27
+ * Positions come from the parent, which owns the slot arithmetic.
81
28
  *
82
- * The figures are real {@link Text} children rather than glyphs in the command
83
- * list, so they take the theme's type style, are measured by the layout engine,
84
- * and ride the node's own opacity — which is why hiding the series takes its
85
- * figures with it for free.
29
+ * The figures are {@link Text} children, so they take the theme's type style,
30
+ * are measured by layout, and hide with the series.
86
31
  */
87
32
  export declare const ChartBars: import("@motionscript/sdk").Component<"chartBars", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
88
33
  readonly bars: import("@motionscript/sdk").Type<BarGeometry[], BarGeometry[], false>;
34
+ /** Pixel y of value 0, where every column grows from. */
89
35
  readonly baseline: 0;
90
36
  readonly fill: import("@motionscript/sdk").Type<Fill, FillResolved[], false>;
91
37
  readonly barStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
92
38
  readonly barShadow: import("@motionscript/sdk").Type<Shadow, ShadowResolved[], false>;
93
39
  readonly cornerRadius: number;
40
+ /**
41
+ * Rise of every column in `[0, 1]` about the baseline, not each column's own
42
+ * base: every segment travels by the same factor, so a stack stays flush
43
+ * mid-animation and a negative column grows down.
44
+ */
94
45
  readonly growth: 1;
46
+ /** Per-column opacity by row index, how the category spotlight reaches one column. Missing reads as 1. */
95
47
  readonly dims: import("@motionscript/sdk").Type<number[], number[], false>;
96
48
  readonly showValues: false;
97
49
  readonly valueStyle: import("@motionscript/sdk").Type<TextStyle, TextStyle, false>;
50
+ /** The wholesale switch behind `showSeries`/`hideSeries`; off skips the columns and their figures. */
98
51
  readonly enabled: true;
99
52
  }>, {
100
53
  readonly enter: unknown;
101
- }, null, _Node2D<Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
54
+ }, null, _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
102
55
  readonly bars: import("@motionscript/sdk").Type<BarGeometry[], BarGeometry[], false>;
56
+ /** Pixel y of value 0, where every column grows from. */
103
57
  readonly baseline: 0;
104
58
  readonly fill: import("@motionscript/sdk").Type<Fill, FillResolved[], false>;
105
59
  readonly barStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
106
60
  readonly barShadow: import("@motionscript/sdk").Type<Shadow, ShadowResolved[], false>;
107
61
  readonly cornerRadius: number;
62
+ /**
63
+ * Rise of every column in `[0, 1]` about the baseline, not each column's own
64
+ * base: every segment travels by the same factor, so a stack stays flush
65
+ * mid-animation and a negative column grows down.
66
+ */
108
67
  readonly growth: 1;
68
+ /** Per-column opacity by row index, how the category spotlight reaches one column. Missing reads as 1. */
109
69
  readonly dims: import("@motionscript/sdk").Type<number[], number[], false>;
110
70
  readonly showValues: false;
111
71
  readonly valueStyle: import("@motionscript/sdk").Type<TextStyle, TextStyle, false>;
72
+ /** The wholesale switch behind `showSeries`/`hideSeries`; off skips the columns and their figures. */
112
73
  readonly enabled: true;
113
74
  }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
114
75
  readonly bars: import("@motionscript/sdk").Type<BarGeometry[], BarGeometry[], false>;
76
+ /** Pixel y of value 0, where every column grows from. */
115
77
  readonly baseline: 0;
116
78
  readonly fill: import("@motionscript/sdk").Type<Fill, FillResolved[], false>;
117
79
  readonly barStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
118
80
  readonly barShadow: import("@motionscript/sdk").Type<Shadow, ShadowResolved[], false>;
119
81
  readonly cornerRadius: number;
82
+ /**
83
+ * Rise of every column in `[0, 1]` about the baseline, not each column's own
84
+ * base: every segment travels by the same factor, so a stack stays flush
85
+ * mid-animation and a negative column grows down.
86
+ */
120
87
  readonly growth: 1;
88
+ /** Per-column opacity by row index, how the category spotlight reaches one column. Missing reads as 1. */
121
89
  readonly dims: import("@motionscript/sdk").Type<number[], number[], false>;
122
90
  readonly showValues: false;
123
91
  readonly valueStyle: import("@motionscript/sdk").Type<TextStyle, TextStyle, false>;
92
+ /** The wholesale switch behind `showSeries`/`hideSeries`; off skips the columns and their figures. */
124
93
  readonly enabled: true;
125
94
  }>, {
126
95
  readonly enter: unknown;
127
- }, _Node2D<Node2DProps>>>>;
96
+ }, _Node2D<_Node2DProps>>>>;
128
97
  export type ChartBars = NodeOf<typeof ChartBars>;
129
98
  //# sourceMappingURL=chart-bars.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-bars.d.ts","sourceRoot":"","sources":["../../src/bar-chart/chart-bars.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,MAAM,EAEX,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAA;AAQ1B;;;;;;;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,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAA;IACV,6EAA6E;I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