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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +98 -28
  3. package/dist/bar-chart/bar-chart.d.ts +233 -39
  4. package/dist/bar-chart/bar-chart.d.ts.map +1 -1
  5. package/dist/bar-chart/bar-chart.js +215 -171
  6. package/dist/bar-chart/bar-chart.js.map +1 -1
  7. package/dist/bar-chart/category-axis.d.ts +12 -7
  8. package/dist/bar-chart/category-axis.d.ts.map +1 -1
  9. package/dist/bar-chart/category-axis.js +56 -42
  10. package/dist/bar-chart/category-axis.js.map +1 -1
  11. package/dist/bar-chart/chart-bars.d.ts +52 -52
  12. package/dist/bar-chart/chart-bars.d.ts.map +1 -1
  13. package/dist/bar-chart/chart-bars.js +80 -89
  14. package/dist/bar-chart/chart-bars.js.map +1 -1
  15. package/dist/bar-chart/index.d.ts +4 -4
  16. package/dist/bar-chart/index.d.ts.map +1 -1
  17. package/dist/bar-chart/index.js +2 -2
  18. package/dist/bar-chart/index.js.map +1 -1
  19. package/dist/bar-chart/shared.d.ts +36 -65
  20. package/dist/bar-chart/shared.d.ts.map +1 -1
  21. package/dist/bar-chart/shared.js +68 -117
  22. package/dist/bar-chart/shared.js.map +1 -1
  23. package/dist/browser/chunks/chunk-R3Q5EE6E.js +2 -0
  24. package/dist/browser/chunks/chunk-R3Q5EE6E.js.map +7 -0
  25. package/dist/browser/index.js +1 -1
  26. package/dist/browser/index.js.map +4 -4
  27. package/dist/browser/kit.js +1 -1
  28. package/dist/browser/manifest.json +1 -1
  29. package/dist/engine.d.ts +5 -2
  30. package/dist/engine.d.ts.map +1 -1
  31. package/dist/engine.js +5 -2
  32. package/dist/engine.js.map +1 -1
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +2 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/kit/cartesian.d.ts +49 -15
  38. package/dist/kit/cartesian.d.ts.map +1 -1
  39. package/dist/kit/cartesian.js +79 -29
  40. package/dist/kit/cartesian.js.map +1 -1
  41. package/dist/kit/chart-canvas.d.ts +32 -24
  42. package/dist/kit/chart-canvas.d.ts.map +1 -1
  43. package/dist/kit/chart-canvas.js +52 -46
  44. package/dist/kit/chart-canvas.js.map +1 -1
  45. package/dist/kit/chart-legend.d.ts +8 -4
  46. package/dist/kit/chart-legend.d.ts.map +1 -1
  47. package/dist/kit/chart-legend.js +30 -20
  48. package/dist/kit/chart-legend.js.map +1 -1
  49. package/dist/{line-chart → kit}/horizontal-axis.d.ts +31 -6
  50. package/dist/kit/horizontal-axis.d.ts.map +1 -0
  51. package/dist/{line-chart → kit}/horizontal-axis.js +23 -24
  52. package/dist/kit/horizontal-axis.js.map +1 -0
  53. package/dist/kit/motion.d.ts +5 -0
  54. package/dist/kit/motion.d.ts.map +1 -1
  55. package/dist/kit/motion.js +8 -0
  56. package/dist/kit/motion.js.map +1 -1
  57. package/dist/{pie-chart → kit}/pie-legend.d.ts +3 -3
  58. package/dist/kit/pie-legend.d.ts.map +1 -0
  59. package/dist/{pie-chart → kit}/pie-legend.js +11 -10
  60. package/dist/kit/pie-legend.js.map +1 -0
  61. package/dist/kit/polar.d.ts +31 -0
  62. package/dist/kit/polar.d.ts.map +1 -0
  63. package/dist/kit/polar.js +33 -0
  64. package/dist/kit/polar.js.map +1 -0
  65. package/dist/kit/shared.d.ts +11 -50
  66. package/dist/kit/shared.d.ts.map +1 -1
  67. package/dist/kit/shared.js +58 -141
  68. package/dist/kit/shared.js.map +1 -1
  69. package/dist/kit/style.d.ts +254 -0
  70. package/dist/kit/style.d.ts.map +1 -0
  71. package/dist/kit/style.js +197 -0
  72. package/dist/kit/style.js.map +1 -0
  73. package/dist/kit/vertical-axis.d.ts +22 -2
  74. package/dist/kit/vertical-axis.d.ts.map +1 -1
  75. package/dist/kit/vertical-axis.js +56 -43
  76. package/dist/kit/vertical-axis.js.map +1 -1
  77. package/dist/line-chart/chart-line.d.ts +95 -3
  78. package/dist/line-chart/chart-line.d.ts.map +1 -1
  79. package/dist/line-chart/chart-line.js +165 -53
  80. package/dist/line-chart/chart-line.js.map +1 -1
  81. package/dist/line-chart/chart-region.d.ts +1 -1
  82. package/dist/line-chart/chart-region.d.ts.map +1 -1
  83. package/dist/line-chart/chart-region.js +7 -8
  84. package/dist/line-chart/chart-region.js.map +1 -1
  85. package/dist/line-chart/index.d.ts +5 -6
  86. package/dist/line-chart/index.d.ts.map +1 -1
  87. package/dist/line-chart/index.js +3 -4
  88. package/dist/line-chart/index.js.map +1 -1
  89. package/dist/line-chart/line-chart.d.ts +257 -18
  90. package/dist/line-chart/line-chart.d.ts.map +1 -1
  91. package/dist/line-chart/line-chart.js +282 -134
  92. package/dist/line-chart/line-chart.js.map +1 -1
  93. package/dist/line-chart/shared.d.ts +51 -34
  94. package/dist/line-chart/shared.d.ts.map +1 -1
  95. package/dist/line-chart/shared.js +175 -83
  96. package/dist/line-chart/shared.js.map +1 -1
  97. package/dist/line-chart/x-scale.d.ts +2 -0
  98. package/dist/line-chart/x-scale.d.ts.map +1 -1
  99. package/dist/line-chart/x-scale.js +15 -0
  100. package/dist/line-chart/x-scale.js.map +1 -1
  101. package/dist/nodes.d.ts +3 -1
  102. package/dist/nodes.d.ts.map +1 -1
  103. package/dist/nodes.js +9 -1
  104. package/dist/nodes.js.map +1 -1
  105. package/dist/pie-chart/index.d.ts +2 -3
  106. package/dist/pie-chart/index.d.ts.map +1 -1
  107. package/dist/pie-chart/index.js +1 -2
  108. package/dist/pie-chart/index.js.map +1 -1
  109. package/dist/pie-chart/pie-chart.d.ts +114 -18
  110. package/dist/pie-chart/pie-chart.d.ts.map +1 -1
  111. package/dist/pie-chart/pie-chart.js +37 -24
  112. package/dist/pie-chart/pie-chart.js.map +1 -1
  113. package/dist/pie-chart/pie-ring.d.ts +16 -5
  114. package/dist/pie-chart/pie-ring.d.ts.map +1 -1
  115. package/dist/pie-chart/pie-ring.js +89 -55
  116. package/dist/pie-chart/pie-ring.js.map +1 -1
  117. package/dist/pie-chart/shared.d.ts +53 -61
  118. package/dist/pie-chart/shared.d.ts.map +1 -1
  119. package/dist/pie-chart/shared.js +41 -121
  120. package/dist/pie-chart/shared.js.map +1 -1
  121. package/dist/radar-chart/index.d.ts +5 -0
  122. package/dist/radar-chart/index.d.ts.map +1 -0
  123. package/dist/radar-chart/index.js +5 -0
  124. package/dist/radar-chart/index.js.map +1 -0
  125. package/dist/radar-chart/radar-chart.d.ts +218 -0
  126. package/dist/radar-chart/radar-chart.d.ts.map +1 -0
  127. package/dist/radar-chart/radar-chart.js +224 -0
  128. package/dist/radar-chart/radar-chart.js.map +1 -0
  129. package/dist/radar-chart/radar-grid.d.ts +43 -0
  130. package/dist/radar-chart/radar-grid.d.ts.map +1 -0
  131. package/dist/radar-chart/radar-grid.js +61 -0
  132. package/dist/radar-chart/radar-grid.js.map +1 -0
  133. package/dist/radar-chart/radar-series.d.ts +59 -0
  134. package/dist/radar-chart/radar-series.d.ts.map +1 -0
  135. package/dist/radar-chart/radar-series.js +71 -0
  136. package/dist/radar-chart/radar-series.js.map +1 -0
  137. package/dist/radar-chart/shared.d.ts +73 -0
  138. package/dist/radar-chart/shared.d.ts.map +1 -0
  139. package/dist/radar-chart/shared.js +123 -0
  140. package/dist/radar-chart/shared.js.map +1 -0
  141. package/dist/radial-chart/index.d.ts +6 -0
  142. package/dist/radial-chart/index.d.ts.map +1 -0
  143. package/dist/radial-chart/index.js +4 -0
  144. package/dist/radial-chart/index.js.map +1 -0
  145. package/dist/radial-chart/radial-chart.d.ts +216 -0
  146. package/dist/radial-chart/radial-chart.d.ts.map +1 -0
  147. package/dist/radial-chart/radial-chart.js +174 -0
  148. package/dist/radial-chart/radial-chart.js.map +1 -0
  149. package/dist/radial-chart/radial-rings.d.ts +121 -0
  150. package/dist/radial-chart/radial-rings.d.ts.map +1 -0
  151. package/dist/radial-chart/radial-rings.js +273 -0
  152. package/dist/radial-chart/radial-rings.js.map +1 -0
  153. package/dist/radial-chart/shared.d.ts +73 -0
  154. package/dist/radial-chart/shared.d.ts.map +1 -0
  155. package/dist/radial-chart/shared.js +79 -0
  156. package/dist/radial-chart/shared.js.map +1 -0
  157. package/package.json +4 -4
  158. package/registry.json +21 -6
  159. package/src/bar-chart/bar-chart.ts +252 -179
  160. package/src/bar-chart/category-axis.ts +46 -40
  161. package/src/bar-chart/chart-bars.ts +97 -117
  162. package/src/bar-chart/index.ts +7 -10
  163. package/src/bar-chart/shared.ts +78 -238
  164. package/src/engine.ts +5 -2
  165. package/src/index.ts +2 -0
  166. package/src/kit/cartesian.ts +118 -40
  167. package/src/kit/chart-canvas.ts +49 -54
  168. package/src/kit/chart-legend.ts +28 -20
  169. package/src/kit/horizontal-axis.ts +114 -0
  170. package/src/kit/motion.ts +7 -0
  171. package/src/{pie-chart → kit}/pie-legend.ts +12 -11
  172. package/src/kit/polar.ts +54 -0
  173. package/src/kit/shared.ts +55 -277
  174. package/src/kit/style.ts +257 -0
  175. package/src/kit/vertical-axis.ts +67 -48
  176. package/src/line-chart/chart-line.ts +176 -54
  177. package/src/line-chart/chart-region.ts +6 -10
  178. package/src/line-chart/index.ts +14 -10
  179. package/src/line-chart/line-chart.ts +347 -151
  180. package/src/line-chart/shared.ts +193 -174
  181. package/src/line-chart/x-scale.ts +13 -0
  182. package/src/nodes.ts +9 -1
  183. package/src/pie-chart/index.ts +2 -23
  184. package/src/pie-chart/pie-chart.ts +52 -35
  185. package/src/pie-chart/pie-ring.ts +92 -71
  186. package/src/pie-chart/shared.ts +68 -266
  187. package/src/radar-chart/index.ts +4 -0
  188. package/src/radar-chart/radar-chart.ts +287 -0
  189. package/src/radar-chart/radar-grid.ts +78 -0
  190. package/src/radar-chart/radar-series.ts +88 -0
  191. package/src/radar-chart/shared.ts +146 -0
  192. package/src/radial-chart/index.ts +5 -0
  193. package/src/radial-chart/radial-chart.ts +210 -0
  194. package/src/radial-chart/radial-rings.ts +328 -0
  195. package/src/radial-chart/shared.ts +114 -0
  196. package/dist/browser/chunks/chunk-4SMRCU24.js +0 -2
  197. package/dist/browser/chunks/chunk-4SMRCU24.js.map +0 -7
  198. package/dist/kit/chart-border.d.ts +0 -18
  199. package/dist/kit/chart-border.d.ts.map +0 -1
  200. package/dist/kit/chart-border.js +0 -23
  201. package/dist/kit/chart-border.js.map +0 -1
  202. package/dist/line-chart/horizontal-axis.d.ts.map +0 -1
  203. package/dist/line-chart/horizontal-axis.js.map +0 -1
  204. package/dist/pie-chart/pie-legend.d.ts.map +0 -1
  205. package/dist/pie-chart/pie-legend.js.map +0 -1
  206. package/src/kit/chart-border.ts +0 -36
  207. package/src/line-chart/horizontal-axis.ts +0 -122
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @motionscript/charts
2
2
 
3
+ ## 0.1.1-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 1810e8a: **Breaking:** the charts are rebuilt around one `style` entry, and the kit gains a radar and a radial chart.
8
+
9
+ - **One look entry.** Every chart's `theme` (and its `DEFAULT_*_THEME`, `resolve*Theme`, `lerp*Theme`) is gone, along with `showLegend` and the bar chart's `showValues`. Each chart has `style: Types.style("chart", …)` instead, with fields grouped as colours (`palette`, `foreground`, `muted`, `background`), text (`fontFamily`, `fontSize`, `fontWeight`), grid (`horizontalGrid`, `verticalGrid` and `axisStroke` on a line or bar chart, `gridStroke` and `spokeStroke` on a radar, all strokes, so weight, colour, dash and caps come with them and an empty one draws nothing), marks, labels and legend (`legend`: bottom, top, right or none; `swatch`: square, circle or line). A chart takes only the fields it draws, and one style dresses any chart. `CHART_STYLE_PRESETS` (midnight, paper, ember, neon, ocean, sunset, pastel, mono) are partial looks to spread in; `to({ style })` tweens a restyle.
10
+ - **Line and area are one chart.** `lineChart` draws curves `smooth` (monotone, never overshooting), `linear` or `step`, optional dots, and `style.area` of `none`, `solid` or `gradient` under each line. `stack` is `none`, `stacked` or `percent`. Up to twelve categorical or dated samples each get a tick.
11
+ - **Bars.** `barChart` takes `orientation` (`vertical` or `horizontal`) and `stack` (`none`, `stacked` or `percent`; replaces `stacked`). Negative values grow from zero, only a stack's outer end is rounded, and `style.values` puts figures at the `end` of a bar or `inside` it.
12
+ - **Pie.** `style.innerRadius` makes a donut; `sliceGap`, `sliceRadius` and `labelPlacement` (`inside`, `outside`, `none`) are style fields.
13
+ - **New: `radarChart`.** One spoke per row, one polygon per series, a `polygon` or `circle` grid, with `enter` and the series commands.
14
+ - **A line is a stroke, an area is a fill.** A radial's `track` is a fill (empty for none). There is no grid width, dash, axis-line, spoke or track switch, and no `gridColor`. A series' `label` is optional: the legend shows `label || field`.
15
+ - **New: `radialChart`.** One ring per row, swept by `value / max` over `style.sweep` degrees from `style.startAngle`, with tracks, round caps, ring labels, a centre summary, `enter`, `selectRing`, `clearSelection` and `revealCenter`.
16
+ - **The kit** draws no plot border by default, puts each legend swatch before its caption, and moves `HorizontalAxis`, the polar helpers (`kit/polar`) and `PieLegend` behind the kit barrel, so a copied chart reaches only the kit. Removed from `./kit`: `ChartBorder`, `CHART_PALETTE`, `DEFAULT_PLOT_AREA`, `PlotAreaConfig`, `DEFAULT_SERIES_COLORS` (use `CHART_PALETTE_DEFAULT`), `DEFAULT_SERIES_STROKES`, `DEFAULT_SERIES_FILLS`, `LegendTheme`, and the theme helpers `resolveAxisConfig`, `lerpAxisConfig`, `resolvePlotArea`, `lerpPlotArea`, `resolveLegendConfig`, `lerpLegendConfig`, `resolveSeriesStrokes`, `lerpSeriesStrokes`, `resolveSeriesFills`, `lerpSeriesFills`, `resolveSeriesStroke` and `resolveSeriesFill` (a chart's colours come from `seriesFill`/`paletteFill` over its style).
17
+
18
+ The renderer's path and paint cache keys no longer collide for shapes mirrored through the origin, which drew two symmetric grid rules as one.
19
+
20
+ Migration: nothing converts a stored chart. A document row's `theme`, `showLegend`, `showValues` and `stacked` are dropped on open and the chart draws in the default style; a host with stored charts rewrites them: `theme` → a `style` partial (series colours to `palette`, text colours to `foreground`/`muted`), `showLegend: false` → `style.legend: "none"`, `showValues: true` → `style.values: "end"`, `stacked: true` → `stack: "stacked"`, `gridColor`/`gridWidth`/`gridDashed` → `horizontalGrid`/`verticalGrid` (or `gridStroke` on a radar), `grid: "vertical"` → `verticalGrid` on and `horizontalGrid: []`, `axisLine` → `axisStroke`, `spokes: false` → `spokeStroke: []`, a radial's `track: false` → `track: []`, and a pie's `labelPlacement` → `style.labelPlacement` (`leader` is now `outside`).
21
+
3
22
  ## 0.1.1-alpha.0
4
23
 
5
24
  ### Patch Changes
package/README.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # @motionscript/charts
2
2
 
3
- Animated data charts for [Motion Script](https://motionscript.dev): a line chart,
4
- a bar chart and a pie chart, built from one shared kit (plot panel, value axis,
5
- legend, number formatting, theme resolution). Written against
3
+ Animated data charts for [Motion Script](https://motionscript.dev): a line chart
4
+ (which is also the area chart), a bar chart, a pie chart, a radar chart and a
5
+ radial chart, built from one shared kit (plot panel, value axis, legend, number
6
+ formatting) and dressed by one `style` entry. Written against
6
7
  [`@motionscript/sdk`](https://github.com/motionscript-dev/motionscript/tree/main/packages/sdk), which it takes as a peer dependency.
7
8
 
8
9
  ```ts
9
10
  import { NODES } from '@motionscript/charts';
10
11
 
11
- export const nodes = NODES; // [LineChart, BarChart, PieChart]
12
+ export const nodes = NODES; // [LineChart, BarChart, PieChart, RadarChart, RadialChart]
12
13
  ```
13
14
 
14
15
  Importing registers nothing; the host hands `NODES` to the engine (see
@@ -24,36 +25,98 @@ npm install @motionscript/charts @motionscript/sdk
24
25
 
25
26
  | Path | Source | What |
26
27
  |---|---|---|
27
- | `@motionscript/charts` | `src/index.ts` | the three chart barrels, `src/engine.ts` and `NODES` |
28
- | `@motionscript/charts/kit` | `src/engine.ts` | the shared kit (`src/kit/*`) and all of `@motionscript/sdk/component` |
29
-
30
- Each chart folder (`line-chart/`, `bar-chart/`, `pie-chart/`) has an `index.ts`
31
- barrel with the node, its parts, its theme (`DEFAULT_*_THEME`, `resolve*Theme`,
32
- `lerp*Theme`) and its pure helpers (`resolveXScale`, `barSpans`, `pieArcs`, ...).
33
- The charts and their parts (`ChartLine`, `ChartBars`, `PieRing`, `VerticalAxis`, ...)
34
- are components (`component2d`); only the charts are registered node types, so a
35
- document cannot name a part. A chart tells a host its key, entries and commands;
36
- where it is shelved and the box it is seeded at are the host's to keep. `lineChartDomains` and `barChartDomain` give the axes as drawn, and
37
- `isSliceSelected` whether a pie slice is out.
28
+ | `@motionscript/charts` | `src/index.ts` | the five chart barrels, `src/engine.ts` and `NODES` |
29
+ | `@motionscript/charts/kit` | `src/engine.ts` | the shared kit (`src/kit/*`, including `kit/style`, `kit/polar` and `PieLegend`) and all of `@motionscript/sdk/component` |
30
+
31
+ Each chart folder (`line-chart/`, `bar-chart/`, `pie-chart/`, `radar-chart/`,
32
+ `radial-chart/`) has an `index.ts` barrel with the node, its parts and its pure
33
+ helpers (`resolveXScale`, `barSpans`, `pieArcs`, ...). The charts and their parts
34
+ (`ChartLine`, `ChartBars`, `PieRing`, `VerticalAxis`, ...) are components
35
+ (`component2d`); only the charts are registered node types, so a document cannot
36
+ name a part. A chart tells a host its key, entries and commands; where it is
37
+ shelved and the box it is seeded at are the host's to keep. `lineChartDomains` and
38
+ `barChartDomain` give the axes as drawn, and `isSliceSelected` whether a pie slice
39
+ is out.
40
+
41
+ The style kit exports `CHART_STYLE_FAMILY` (`"chart"`), `CHART_STYLE_PRESETS`,
42
+ `CHART_PALETTE_DEFAULT` and the shared field groups (`CHART_COLORS`,
43
+ `CHART_TEXT`, `CARTESIAN_GRID`, `CHART_LEGEND`).
38
44
 
39
45
  ## Nodes
40
46
 
41
47
  | Key | Made for (w x h) | Data props | Commands |
42
48
  |---|---|---|---|
43
- | `lineChart` | 760 x 460 | `data`, `xField`, `series`, `xAxis`, `yAxis`, `region` | `enter`, `spotlightRegion`, `clearRegion`, `zoomTo`, `resetZoom`, `showSeries`/`hideSeries`/`spotlightSeries` |
44
- | `barChart` | 760 x 460 | `data`, `categoryField`, `series`, `valueAxis`, `stacked` | `enter`, `showSeries`/`hideSeries`/`spotlightSeries`, `spotlightCategory`, `clearCategory` |
45
- | `pieChart` | 680 x 480 | `data`, `categoryField`, `valueField` | `enter`, `revealCenter`, `selectSlice`/`deselectSlice`/`selectOnlySlice`/`clearSelection` |
49
+ | `lineChart` | 760 x 460 | `data`, `xField`, `series`, `stack`, `xAxis`, `yAxis`, `region` | `enter`, `spotlightRegion`, `clearRegion`, `zoomTo`, `resetZoom`, `showSeries`/`hideSeries`/`spotlightSeries` |
50
+ | `barChart` | 760 x 460 | `data`, `categoryField`, `series`, `orientation`, `stack`, `valueAxis`, `categoryAxis` | `enter`, `showSeries`/`hideSeries`/`spotlightSeries`, `spotlightCategory`, `clearCategory` |
51
+ | `pieChart` | 680 x 480 | `data`, `categoryField`, `valueField`, `labelMode`, `centerLabel`, `centerCaption` | `enter`, `revealCenter`, `selectSlice`/`deselectSlice`/`selectOnlySlice`/`clearSelection` |
52
+ | `radarChart` | 680 x 480 | `data`, `categoryField`, `series`, `min`, `max` | `enter`, `showSeries`/`hideSeries`/`spotlightSeries` |
53
+ | `radialChart` | 560 x 560 | `data`, `categoryField`, `valueField`, `max`, `centerLabel`, `centerCaption` | `enter`, `revealCenter`, `selectRing`, `clearSelection` |
46
54
 
47
55
  Every command takes the duration its row (or call) gives, and eases out unless
48
- given an easing. Arguments: `seriesIndex`, `sliceIndex`, `categoryIndex` (each 0
49
- when left out), and for `spotlightRegion` and `zoomTo` a `region` of
50
- `{ x?: [min, max], y?: [min, max] }`.
56
+ given an easing. Arguments: `seriesIndex`, `sliceIndex`, `categoryIndex`,
57
+ `ringIndex` (each 0 when left out), and for `spotlightRegion` and `zoomTo` a
58
+ `region` of `{ x?: [min, max], y?: [min, max] }`.
59
+
60
+ `lineChart` draws a line or an area chart: `style.area` of `none`, `solid` or
61
+ `gradient` fills under each line. `pieChart` draws a donut once `style.innerRadius`
62
+ is above 0.
63
+
64
+ ## Styling
65
+
66
+ Each chart has one look entry, `style`, and nothing else about colour or type:
67
+ no `theme`, no `showLegend`. Its fields come in groups, written grouped and read
68
+ flat (`state.style.fontSize`):
69
+
70
+ | Group | Fields | On |
71
+ |---|---|---|
72
+ | colors | `palette`, `foreground`, `muted`, `background` | every chart |
73
+ | text | `fontFamily`, `fontSize`, `fontWeight` | every chart |
74
+ | grid | `horizontalGrid` (a 2px `white/15` stroke), `verticalGrid` (none), `axisStroke` (none), `showXAxis`, `showYAxis` | line, bar |
75
+ | grid | `gridShape`, `gridLevels`, `gridStroke` (rings), `spokeStroke` (spokes), `spokeLabels` | radar |
76
+ | marks | the chart's own: `strokeWidth`, `curve`, `dots`, `area`, `barRadius`, `innerRadius`, `sweep`, ... | every chart |
77
+ | labels | `values` (line, bar), `labelPlacement` (pie), `ringLabels` (radial) | |
78
+
79
+ A line is a stroke and an area is a fill: `horizontalGrid`, `verticalGrid`, `axisStroke`, `gridStroke`
80
+ and `spokeStroke` are `Types.stroke` entries (weight, colour, dash and caps; empty draws
81
+ nothing), and a radial's `track` is a `Types.fill` (empty draws no track). A series' `label`
82
+ is optional; the legend shows `label || field`.
83
+ | legend | `legend` (`bottom`, `top`, `right`, `none`), `swatch` (`square`, `circle`, `line`) | every chart |
84
+
85
+ A chart takes only the fields it draws. A style is a partial laid over the chart's
86
+ previous style, and a key the chart does not have is dropped, so one style dresses
87
+ every chart in the family.
88
+
89
+ `CHART_STYLE_PRESETS` (`midnight`, `paper`, `ember`, `neon`, `ocean`, `sunset`,
90
+ `pastel`, `mono`) are colour-only partials. Spread one into a style and add to it:
91
+
92
+ ```ts
93
+ import { CHART_STYLE_PRESETS } from '@motionscript/charts';
94
+
95
+ const props = {
96
+ // ...data, series
97
+ style: { ...CHART_STYLE_PRESETS.paper, fontSize: 32, area: 'gradient' },
98
+ };
99
+ ```
100
+
101
+ Restyle with a `to` command, which tweens colours, sizes and weights and steps
102
+ everything else at the midpoint:
103
+
104
+ ```ts
105
+ { id: 'restyle', type: 'to', targetId: 'chart', at: 3, duration: 1,
106
+ args: { style: CHART_STYLE_PRESETS.ember } }
107
+ ```
108
+
109
+ Fields marked read-once below (`legend`, `showXAxis`, `showYAxis`, `values`,
110
+ `labelPlacement`, `spokeLabels`) shape which parts are built; a `to` of them
111
+ steps rather than tweens, and a document edit rebuilds the node.
51
112
 
52
113
  ## Rules worth knowing
53
114
 
54
115
  - **The kit stays an import.** A copy of `line-chart` takes only `line-chart/*` and
55
116
  rewrites its kit imports to `@motionscript/charts` (`registry.json`): a second
56
- copy of `VerticalAxis` would render as nothing, with no error.
117
+ copy of `VerticalAxis` would render as nothing, with no error. The kit includes
118
+ `kit/polar` and `PieLegend`, which the pie, radar and radial charts reach for, so
119
+ a copy of any chart reaches only the kit.
57
120
  - **Resting state is the finished chart.** `enter` arms every part on its first
58
121
  frame: every piece of a component command is built run to its end, and a beat
59
122
  ahead of the playhead writes nothing, so the first frame writes what each later
@@ -63,14 +126,18 @@ when left out), and for `spotlightRegion` and `zoomTo` a `region` of
63
126
  duration and easing it moves with; called directly, a part's command takes the
64
127
  duration it is given, and a part's own frames ease out unless given an easing.
65
128
  - **Some props are read once, at construction**: the series list (count, labels,
66
- `enabled`), `showLegend`, `showValues`, `showCenter`, axis captions, text styles and
67
- paddings, the bar chart's category captions, the pie's label and legend-row counts,
68
- `labelMode`, `labelPlacement`, `gap`, `centerLabel`, `centerCaption`. A `set` or `to`
69
- of them changes nothing; a document edit re-instantiates the node, which does
70
- refresh them. `data`, scales, ticks, theme paints, `region`, `stacked`, `weights`
129
+ `enabled`), `orientation`, `showCenter`, axis captions, the bar chart's category
130
+ captions, the pie's and radial's label and legend-row counts, `labelMode`, `gap`,
131
+ `centerLabel`, `centerCaption`, and the style fields `legend`, `showXAxis`,
132
+ `showYAxis`, `values`, `labelPlacement`, `spokeLabels`. A `set` or `to` of them
133
+ changes nothing; a document edit re-instantiates the node, which does refresh
134
+ them. `data`, scales, ticks, every other style field, `region`, `stack`, `weights`
71
135
  and `pops` are live.
72
136
  - **Non-finite cells plot as 0.** `num()` returns a cell only when it is a finite
73
137
  number, so a numeric string, `NaN`, `Infinity` and a missing cell all read 0.
138
+ - **`horizontalGrid` and `verticalGrid` are literal.** They name the lines drawn, not an axis: a
139
+ horizontal bar chart that wants rules along its value axis sets `verticalGrid` and
140
+ `horizontalGrid: []`.
74
141
  - **x units on the line chart.** `xAxis.range`, `xAxis.ticks` and a region's `x`
75
142
  are in the x scale's own units: the number (numeric column), UTC epoch
76
143
  milliseconds (time column) or the row index (ordinal column), chosen from the
@@ -85,7 +152,10 @@ when left out), and for `spotlightRegion` and `zoomTo` a `region` of
85
152
  the chart settles against its data, so a rescale from an auto axis is continuous.
86
153
  A restated range without ticks spreads explicit ticks across it; one side of an
87
154
  auto axis restated alone leaves the other to the data.
88
- - **Pie angles** are radians clockwise from 12 o'clock; `startAngle` is degrees.
155
+ - **Pie angles** are radians clockwise from 12 o'clock. A radial's `startAngle` and
156
+ `sweep` are degrees, `startAngle` clockwise from 12 o'clock.
157
+ - **Centre text needs a hole.** A pie shows `centerLabel` and `centerCaption` only
158
+ with `style.innerRadius` above 0; a radial's hole is `style.innerRadius` too.
89
159
 
90
160
  ## Development
91
161
 
@@ -1,47 +1,146 @@
1
- import { type DataRecord, type NodeOf, type Node2D, type Node2DProps as _Node2DProps } from "@motionscript/sdk";
1
+ import { type DataRecord, type NodeOf, type OutOf, type Node2D, type Node2DProps as _Node2DProps, type Fill as _Fill, type FillResolved as _FillResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved, type StyleInput as _StyleInput, type StyleValues as _StyleValues } from "@motionscript/sdk";
2
2
  import { type AxisDomainConfig, type ResolvedAxisDomain } from "../kit/shared.js";
3
- import { type BarChartConfig, type BarChartTheme, type BarSeries } from "./shared.js";
3
+ import { type BarSeries, type BarStack } from "./shared.js";
4
+ declare const BAR_STYLE: import("@motionscript/sdk").Type<_StyleInput<{
5
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
6
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
7
+ } & {
8
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
9
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
10
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
11
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
12
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
13
+ } & {
14
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
15
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
16
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
17
+ } & {
18
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
19
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
20
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
21
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
22
+ } & {
23
+ barRadius: import("@motionscript/sdk").Type<number, number, false>;
24
+ barWidth: import("@motionscript/sdk").Type<number, number, false>;
25
+ barGap: import("@motionscript/sdk").Type<number, number, false>;
26
+ } & {
27
+ values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
28
+ }>, _StyleValues<{
29
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
30
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
31
+ } & {
32
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
33
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
34
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
35
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
36
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
37
+ } & {
38
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
39
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
40
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
41
+ } & {
42
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
43
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
44
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
45
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
46
+ } & {
47
+ barRadius: import("@motionscript/sdk").Type<number, number, false>;
48
+ barWidth: import("@motionscript/sdk").Type<number, number, false>;
49
+ barGap: import("@motionscript/sdk").Type<number, number, false>;
50
+ } & {
51
+ values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
52
+ }>, false>;
53
+ /** A bar chart's resolved style. */
54
+ export type BarChartStyle = OutOf<typeof BAR_STYLE>;
4
55
  /** What a bar chart plots, as its entries hold it. */
5
56
  export interface BarChartValues {
6
57
  readonly data: DataRecord[];
7
58
  readonly series: BarSeries[];
8
- readonly stacked: boolean;
59
+ readonly stack: BarStack;
9
60
  readonly valueAxis: AxisDomainConfig;
10
61
  }
11
62
  /** The value axis's domain with its range and ticks resolved. */
12
63
  export type BarChartDomain = ResolvedAxisDomain;
13
- /** The value axis as drawn now. */
64
+ /** The value axis as drawn now. A series being hidden keeps its room, so the ticks hold still while it goes. */
14
65
  export declare function barChartDomain(s: BarChartValues): BarChartDomain;
15
66
  /**
16
- * A grouped or stacked bar chart, built like the line chart from `ChartCanvas`,
17
- * `VerticalAxis`, {@link CategoryAxis}, one {@link ChartBars} per series and
18
- * `ChartLegend`. Zero is always on the scale and columns grow about it, so a
19
- * negative value draws downward from the same `growth` signal.
67
+ * A bar chart, vertical or horizontal, its series side by side, stacked, or
68
+ * stacked as shares of 100. Built like the line chart from `ChartCanvas`, a
69
+ * value axis, a {@link CategoryAxis}, one {@link ChartBars} per series and
70
+ * `ChartLegend`. Zero is always on the scale and bars grow about it, so a
71
+ * negative value draws the other way from the same `growth` signal.
20
72
  *
21
73
  * Resting state is the finished chart; `enter` arms every part on its first
22
74
  * frame. A `to` of the value axis's `range` or `ticks` tweens from the domain as
23
- * drawn, so an auto axis rescales the columns continuously.
75
+ * drawn, so an auto axis rescales the bars continuously.
24
76
  */
25
77
  export declare const BarChart: import("@motionscript/sdk").Component<"barChart", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
26
78
  readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
27
79
  readonly categoryField: "";
28
80
  readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
29
- readonly stacked: false;
81
+ /** `vertical`: columns rise from a row of categories; `horizontal`: bars grow right from a column of them. */
82
+ readonly orientation: import("@motionscript/sdk").Type<"horizontal" | "vertical", "horizontal" | "vertical", false>;
83
+ /** `stacked`: each series sits on the sum of those before it; `percent`: every category reads as shares of 100. */
84
+ readonly stack: import("@motionscript/sdk").Type<"none" | "percent" | "stacked", "none" | "percent" | "stacked", false>;
30
85
  readonly valueAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
31
86
  readonly categoryAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
32
- readonly theme: import("@motionscript/sdk").Type<BarChartTheme, BarChartConfig, false>;
33
- /** Rise of every column about the baseline, `[0, 1]`: 0 collapses them onto it. */
87
+ readonly style: import("@motionscript/sdk").Type<_StyleInput<{
88
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
89
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
90
+ } & {
91
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
92
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
93
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
94
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
95
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
96
+ } & {
97
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
98
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
99
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
100
+ } & {
101
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
102
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
103
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
104
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
105
+ } & {
106
+ barRadius: import("@motionscript/sdk").Type<number, number, false>;
107
+ barWidth: import("@motionscript/sdk").Type<number, number, false>;
108
+ barGap: import("@motionscript/sdk").Type<number, number, false>;
109
+ } & {
110
+ values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
111
+ }>, _StyleValues<{
112
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
113
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
114
+ } & {
115
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
116
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
117
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
118
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
119
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
120
+ } & {
121
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
122
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
123
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
124
+ } & {
125
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
126
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
127
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
128
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
129
+ } & {
130
+ barRadius: import("@motionscript/sdk").Type<number, number, false>;
131
+ barWidth: import("@motionscript/sdk").Type<number, number, false>;
132
+ barGap: import("@motionscript/sdk").Type<number, number, false>;
133
+ } & {
134
+ values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
135
+ }>, false>;
136
+ /** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */
34
137
  readonly growth: 1;
35
- /** Each series' share of the slot, seeded from `enabled`: a weight rather than a switch, so hiding one widens the others. */
36
- readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
37
138
  /** The category spotlit, or `null`. The choice snaps; `spotlightReveal` animates it. */
38
139
  readonly spotlight: import("@motionscript/sdk").Type<number | null, number | null, false>;
39
140
  readonly spotlightReveal: 0;
40
- /** Read as the chart is built: the legend is a part the chart builds or doesn't. */
41
- readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
42
- /** Read as the chart is built: whether each column prints the figure it plots. */
43
- readonly showValues: import("@motionscript/sdk").Type<boolean, boolean, false>;
44
- /** Whether each series' columns are drawn: on for every frame a show or hide covers, off once a hide lands. */
141
+ /** Each series' share of the slot, seeded from `enabled`: a weight rather than a switch, so hiding one widens the others. */
142
+ readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
143
+ /** Whether each series' bars are drawn: on for every frame a show or hide covers, off once a hide lands. */
45
144
  readonly showing: import("@motionscript/sdk").Type<boolean[], boolean[], false>;
46
145
  }>, {
47
146
  readonly enter: {};
@@ -62,43 +161,137 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
62
161
  readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
63
162
  readonly categoryField: "";
64
163
  readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
65
- readonly stacked: false;
164
+ /** `vertical`: columns rise from a row of categories; `horizontal`: bars grow right from a column of them. */
165
+ readonly orientation: import("@motionscript/sdk").Type<"horizontal" | "vertical", "horizontal" | "vertical", false>;
166
+ /** `stacked`: each series sits on the sum of those before it; `percent`: every category reads as shares of 100. */
167
+ readonly stack: import("@motionscript/sdk").Type<"none" | "percent" | "stacked", "none" | "percent" | "stacked", false>;
66
168
  readonly valueAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
67
169
  readonly categoryAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
68
- readonly theme: import("@motionscript/sdk").Type<BarChartTheme, BarChartConfig, false>;
69
- /** Rise of every column about the baseline, `[0, 1]`: 0 collapses them onto it. */
170
+ readonly style: import("@motionscript/sdk").Type<_StyleInput<{
171
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
172
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
173
+ } & {
174
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
175
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
176
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
177
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
178
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
179
+ } & {
180
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
181
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
182
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
183
+ } & {
184
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
185
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
186
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
187
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
188
+ } & {
189
+ barRadius: import("@motionscript/sdk").Type<number, number, false>;
190
+ barWidth: import("@motionscript/sdk").Type<number, number, false>;
191
+ barGap: import("@motionscript/sdk").Type<number, number, false>;
192
+ } & {
193
+ values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
194
+ }>, _StyleValues<{
195
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
196
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
197
+ } & {
198
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
199
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
200
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
201
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
202
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
203
+ } & {
204
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
205
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
206
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
207
+ } & {
208
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
209
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
210
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
211
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
212
+ } & {
213
+ barRadius: import("@motionscript/sdk").Type<number, number, false>;
214
+ barWidth: import("@motionscript/sdk").Type<number, number, false>;
215
+ barGap: import("@motionscript/sdk").Type<number, number, false>;
216
+ } & {
217
+ values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
218
+ }>, false>;
219
+ /** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */
70
220
  readonly growth: 1;
71
- /** Each series' share of the slot, seeded from `enabled`: a weight rather than a switch, so hiding one widens the others. */
72
- readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
73
221
  /** The category spotlit, or `null`. The choice snaps; `spotlightReveal` animates it. */
74
222
  readonly spotlight: import("@motionscript/sdk").Type<number | null, number | null, false>;
75
223
  readonly spotlightReveal: 0;
76
- /** Read as the chart is built: the legend is a part the chart builds or doesn't. */
77
- readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
78
- /** Read as the chart is built: whether each column prints the figure it plots. */
79
- readonly showValues: import("@motionscript/sdk").Type<boolean, boolean, false>;
80
- /** Whether each series' columns are drawn: on for every frame a show or hide covers, off once a hide lands. */
224
+ /** Each series' share of the slot, seeded from `enabled`: a weight rather than a switch, so hiding one widens the others. */
225
+ readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
226
+ /** Whether each series' bars are drawn: on for every frame a show or hide covers, off once a hide lands. */
81
227
  readonly showing: import("@motionscript/sdk").Type<boolean[], boolean[], false>;
82
228
  }>, readonly [], import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
83
229
  readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
84
230
  readonly categoryField: "";
85
231
  readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
86
- readonly stacked: false;
232
+ /** `vertical`: columns rise from a row of categories; `horizontal`: bars grow right from a column of them. */
233
+ readonly orientation: import("@motionscript/sdk").Type<"horizontal" | "vertical", "horizontal" | "vertical", false>;
234
+ /** `stacked`: each series sits on the sum of those before it; `percent`: every category reads as shares of 100. */
235
+ readonly stack: import("@motionscript/sdk").Type<"none" | "percent" | "stacked", "none" | "percent" | "stacked", false>;
87
236
  readonly valueAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
88
237
  readonly categoryAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
89
- readonly theme: import("@motionscript/sdk").Type<BarChartTheme, BarChartConfig, false>;
90
- /** Rise of every column about the baseline, `[0, 1]`: 0 collapses them onto it. */
238
+ readonly style: import("@motionscript/sdk").Type<_StyleInput<{
239
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
240
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
241
+ } & {
242
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
243
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
244
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
245
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
246
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
247
+ } & {
248
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
249
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
250
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
251
+ } & {
252
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
253
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
254
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
255
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
256
+ } & {
257
+ barRadius: import("@motionscript/sdk").Type<number, number, false>;
258
+ barWidth: import("@motionscript/sdk").Type<number, number, false>;
259
+ barGap: import("@motionscript/sdk").Type<number, number, false>;
260
+ } & {
261
+ values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
262
+ }>, _StyleValues<{
263
+ legend: import("@motionscript/sdk").Type<"right" | "top" | "bottom" | "none", "right" | "top" | "bottom" | "none", false>;
264
+ swatch: import("@motionscript/sdk").Type<"square" | "circle" | "line", "square" | "circle" | "line", false>;
265
+ } & {
266
+ horizontalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
267
+ verticalGrid: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
268
+ axisStroke: import("@motionscript/sdk").Type<_Stroke, _StrokeResolved[], false>;
269
+ showXAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
270
+ showYAxis: import("@motionscript/sdk").Type<boolean, boolean, false>;
271
+ } & {
272
+ fontFamily: import("@motionscript/sdk").Type<string, string, false>;
273
+ fontSize: import("@motionscript/sdk").Type<number, number, false>;
274
+ fontWeight: import("@motionscript/sdk").Type<number, number, false>;
275
+ } & {
276
+ palette: import("@motionscript/sdk").Type<_Fill[], _FillResolved[][], false>;
277
+ foreground: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
278
+ muted: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
279
+ background: import("@motionscript/sdk").Type<_Fill, _FillResolved[], false>;
280
+ } & {
281
+ barRadius: import("@motionscript/sdk").Type<number, number, false>;
282
+ barWidth: import("@motionscript/sdk").Type<number, number, false>;
283
+ barGap: import("@motionscript/sdk").Type<number, number, false>;
284
+ } & {
285
+ values: import("@motionscript/sdk").Type<"end" | "inside" | "none", "end" | "inside" | "none", false>;
286
+ }>, false>;
287
+ /** Rise of every bar about the baseline, `[0, 1]`: 0 collapses them onto it. */
91
288
  readonly growth: 1;
92
- /** Each series' share of the slot, seeded from `enabled`: a weight rather than a switch, so hiding one widens the others. */
93
- readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
94
289
  /** The category spotlit, or `null`. The choice snaps; `spotlightReveal` animates it. */
95
290
  readonly spotlight: import("@motionscript/sdk").Type<number | null, number | null, false>;
96
291
  readonly spotlightReveal: 0;
97
- /** Read as the chart is built: the legend is a part the chart builds or doesn't. */
98
- readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
99
- /** Read as the chart is built: whether each column prints the figure it plots. */
100
- readonly showValues: import("@motionscript/sdk").Type<boolean, boolean, false>;
101
- /** Whether each series' columns are drawn: on for every frame a show or hide covers, off once a hide lands. */
292
+ /** Each series' share of the slot, seeded from `enabled`: a weight rather than a switch, so hiding one widens the others. */
293
+ readonly weights: import("@motionscript/sdk").Type<number[], number[], false>;
294
+ /** Whether each series' bars are drawn: on for every frame a show or hide covers, off once a hide lands. */
102
295
  readonly showing: import("@motionscript/sdk").Type<boolean[], boolean[], false>;
103
296
  }>, {
104
297
  readonly enter: {};
@@ -117,4 +310,5 @@ export declare const BarChart: import("@motionscript/sdk").Component<"barChart",
117
310
  readonly clearCategory: {};
118
311
  }, Node2D<_Node2DProps>>>>;
119
312
  export type BarChart = NodeOf<typeof BarChart>;
313
+ export {};
120
314
  //# sourceMappingURL=bar-chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EACf,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,WAAW,IAAI,YAAY,EAEjC,MAAM,mBAAmB,CAAA;AAU1B,OAAO,EASL,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAA;AAGtB,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,UAAU,CAAA;AAEjB,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAA;CACrC;AAED,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAA;AAkB/C,mCAAmC;AACnC,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,GAAG,cAAc,CAOhE;AA4HD;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ;;;;;;;;IAWjB,mFAAmF;;IAEnF,6HAA6H;;IAE7H,wFAAwF;;;IAGxF,oFAAoF;;IAEpF,kFAAkF;;IAElF,+GAA+G;;;;;;;;;;;;;;;;;;;;;;;;;IAX/G,mFAAmF;;IAEnF,6HAA6H;;IAE7H,wFAAwF;;;IAGxF,oFAAoF;;IAEpF,kFAAkF;;IAElF,+GAA+G;;;;;;;;;;IAX/G,mFAAmF;;IAEnF,6HAA6H;;IAE7H,wFAAwF;;;IAGxF,oFAAoF;;IAEpF,kFAAkF;;IAElF,+GAA+G;;;;;;;;;;;;;;;;;0BAsLjH,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAA"}
1
+ {"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../../src/bar-chart/bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,KAAK,EAEV,KAAK,MAAM,EACX,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,IAAI,IAAI,KAAK,EAClB,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EAEtC,KAAK,UAAU,IAAI,WAAW,EAC9B,KAAK,WAAW,IAAI,YAAY,EACjC,MAAM,mBAAmB,CAAA;AAS1B,OAAO,EAWL,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAA;AAgBtB,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,UAAU,CAAA;AAEjB,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAId,CAAA;AAED,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAEnD,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAA;CACrC;AAED,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAA;AAsB/C,gHAAgH;AAChH,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,GAAG,cAAc,CAOhE;AA6HD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ;;;;IAOjB,8GAA8G;;IAE9G,mHAAmH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnH,gFAAgF;;IAEhF,wFAAwF;;;IAGxF,6HAA6H;;IAE7H,4GAA4G;;;;;;;;;;;;;;;;;;;;;IAd5G,8GAA8G;;IAE9G,mHAAmH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnH,gFAAgF;;IAEhF,wFAAwF;;;IAGxF,6HAA6H;;IAE7H,4GAA4G;;;;;;IAd5G,8GAA8G;;IAE9G,mHAAmH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnH,gFAAgF;;IAEhF,wFAAwF;;;IAGxF,6HAA6H;;IAE7H,4GAA4G;;;;;;;;;;;;;;;;;0BA+N9G,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAA"}