@mechane-ai/elements 0.46.0 → 0.48.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 (419) hide show
  1. package/README.md +590 -34
  2. package/bin/mechane-elements-catalog.mjs +104 -12
  3. package/dist/ai.js +4 -4
  4. package/dist/article-BXZr10QQ.js +1904 -0
  5. package/dist/article.js +1 -0
  6. package/dist/catalog.json +3696 -33
  7. package/dist/categorical-values-BpVq8cFj.js +107 -0
  8. package/dist/cells-xVmnQ9oQ.js +384 -0
  9. package/dist/chart-link-AE_xuxiP.js +35 -0
  10. package/dist/chart-tones-ei3BC2AL.js +27 -0
  11. package/dist/charts/cartesian.js +1 -2958
  12. package/dist/charts/cells.js +1 -0
  13. package/dist/charts/comparison.js +1 -0
  14. package/dist/charts/distribution.js +1 -781
  15. package/dist/charts/figure.js +3404 -0
  16. package/dist/charts/graph.js +1 -655
  17. package/dist/charts/hierarchy.js +1 -121
  18. package/dist/charts/image.js +1 -0
  19. package/dist/charts/matrix.js +4 -644
  20. package/dist/charts/plot.js +15 -0
  21. package/dist/charts/relationship.js +1 -0
  22. package/dist/charts/text.js +1 -0
  23. package/dist/charts/timeline.js +1 -266
  24. package/dist/charts/transforms.js +677 -0
  25. package/dist/charts/trend.js +1 -0
  26. package/dist/charts.js +8 -3
  27. package/dist/clock-DSm5lkNE.js +16 -0
  28. package/dist/collections.js +1 -2195
  29. package/dist/color-legend-CIo7DhXB.js +62 -0
  30. package/dist/dates-Cww8UR_n.js +810 -0
  31. package/dist/describe-lesson-BmREzDpt.js +175 -0
  32. package/dist/dumbbell-plot-DQdTxDeO.js +509 -0
  33. package/dist/embedding-map-CF-J-8JW.js +1929 -0
  34. package/dist/feedback.js +1 -1
  35. package/dist/figure-format-B8kRZMlo.js +36 -0
  36. package/dist/figure-frame-BJ3REgTA.js +270 -0
  37. package/dist/forms/dates.js +1 -810
  38. package/dist/forms.js +1 -1
  39. package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
  40. package/dist/image-grid-Dl2sjIMB.js +598 -0
  41. package/dist/kits/evaluation.js +431 -0
  42. package/dist/kits/interpretability.js +1033 -0
  43. package/dist/kits/operations.js +239 -0
  44. package/dist/kits/training.js +335 -0
  45. package/dist/label-place-Z0fryBZb.js +42 -0
  46. package/dist/lesson/agent.js +811 -0
  47. package/dist/lesson/spec.js +661 -0
  48. package/dist/lesson.js +5 -0
  49. package/dist/locate-Bcg3QcP4.js +11 -0
  50. package/dist/mdx.js +227 -0
  51. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
  52. package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
  53. package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
  54. package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
  55. package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
  56. package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
  57. package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
  58. package/dist/packages/charts/src/cartesian/index.d.ts +5 -5
  59. package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
  60. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +30 -25
  61. package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
  62. package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
  63. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
  64. package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
  65. package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
  66. package/dist/packages/charts/src/cartesian/time-series.d.ts +60 -36
  67. package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
  68. package/dist/packages/charts/src/categorical-values.d.ts +1 -1
  69. package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
  70. package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
  71. package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
  72. package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
  73. package/dist/packages/charts/src/cells/index.d.ts +11 -0
  74. package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
  75. package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
  76. package/dist/packages/charts/src/chart-frame.d.ts +14 -7
  77. package/dist/packages/charts/src/chart-grid.d.ts +19 -0
  78. package/dist/packages/charts/src/chart-input.d.ts +1 -9
  79. package/dist/packages/charts/src/chart-link.d.ts +56 -0
  80. package/dist/packages/charts/src/chart.d.ts +0 -8
  81. package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
  82. package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
  83. package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
  84. package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
  85. package/dist/packages/charts/src/comparison/index.d.ts +6 -0
  86. package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
  87. package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
  88. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
  89. package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
  90. package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
  91. package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
  92. package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
  93. package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
  94. package/dist/packages/charts/src/distribution/index.d.ts +11 -0
  95. package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
  96. package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
  97. package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
  98. package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
  99. package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
  100. package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
  101. package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
  102. package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
  103. package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
  104. package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
  105. package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
  106. package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
  107. package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
  108. package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
  109. package/dist/packages/charts/src/graph/index.d.ts +6 -2
  110. package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
  111. package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
  112. package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
  113. package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
  114. package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
  115. package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
  116. package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
  117. package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
  118. package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
  119. package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
  120. package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
  121. package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
  122. package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
  123. package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
  124. package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
  125. package/dist/packages/charts/src/image/image-input.d.ts +27 -0
  126. package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
  127. package/dist/packages/charts/src/image/index.d.ts +7 -0
  128. package/dist/packages/charts/src/index.d.ts +15 -1
  129. package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
  130. package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
  131. package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
  132. package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
  133. package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
  134. package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
  135. package/dist/packages/charts/src/matrix/index.d.ts +15 -3
  136. package/dist/packages/charts/src/matrix/matrix-cells.d.ts +27 -3
  137. package/dist/packages/charts/src/matrix/matrix-figure.d.ts +50 -0
  138. package/dist/packages/charts/src/matrix/matrix-mark.d.ts +34 -0
  139. package/dist/packages/charts/src/matrix/matrix-presets.d.ts +20 -0
  140. package/dist/packages/charts/src/matrix/matrix-range.d.ts +45 -0
  141. package/dist/packages/charts/src/matrix/matrix-strip.d.ts +13 -14
  142. package/dist/packages/charts/src/matrix/matrix-types.d.ts +40 -0
  143. package/dist/packages/charts/src/matrix/matrix.d.ts +13 -11
  144. package/dist/packages/charts/src/matrix/token-heatmap.d.ts +16 -10
  145. package/dist/packages/charts/src/plot/contours.d.ts +45 -0
  146. package/dist/packages/charts/src/plot/index.d.ts +49 -0
  147. package/dist/packages/charts/src/plot/label-place.d.ts +35 -0
  148. package/dist/packages/charts/src/plot/locate.d.ts +18 -0
  149. package/dist/packages/charts/src/plot/path.d.ts +39 -0
  150. package/dist/packages/charts/src/plot/plot-axes.d.ts +20 -0
  151. package/dist/packages/charts/src/plot/plot-layout.d.ts +221 -0
  152. package/dist/packages/charts/src/plot/plot-marks.d.ts +128 -0
  153. package/dist/packages/charts/src/plot/plot-surface.d.ts +32 -0
  154. package/dist/packages/charts/src/plot/render/density-layer.d.ts +17 -0
  155. package/dist/packages/charts/src/plot/render/hit-index.d.ts +37 -0
  156. package/dist/packages/charts/src/plot/render/plot-viewport.d.ts +39 -0
  157. package/dist/packages/charts/src/plot/render/point-layer.d.ts +41 -0
  158. package/dist/packages/charts/src/plot/render/theme-colors.d.ts +15 -0
  159. package/dist/packages/charts/src/plot/scale.d.ts +48 -0
  160. package/dist/packages/charts/src/plot/ticks.d.ts +34 -0
  161. package/dist/packages/charts/src/plot-width.d.ts +3 -2
  162. package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
  163. package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
  164. package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
  165. package/dist/packages/charts/src/relationship/index.d.ts +11 -0
  166. package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
  167. package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
  168. package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
  169. package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
  170. package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
  171. package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
  172. package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
  173. package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
  174. package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
  175. package/dist/packages/charts/src/spec/figure.d.ts +12 -0
  176. package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
  177. package/dist/packages/charts/src/spec/index.d.ts +10 -0
  178. package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
  179. package/dist/packages/charts/src/text/index.d.ts +11 -0
  180. package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
  181. package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
  182. package/dist/packages/charts/src/text/token-links.d.ts +49 -0
  183. package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
  184. package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
  185. package/dist/packages/charts/src/text/token-text.d.ts +39 -0
  186. package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
  187. package/dist/packages/charts/src/timeline/index.d.ts +3 -1
  188. package/dist/packages/charts/src/timeline/waterfall.d.ts +24 -13
  189. package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
  190. package/dist/packages/charts/src/transforms/density.d.ts +53 -0
  191. package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
  192. package/dist/packages/charts/src/transforms/index.d.ts +19 -0
  193. package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
  194. package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
  195. package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
  196. package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
  197. package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
  198. package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
  199. package/dist/packages/charts/src/transforms/values.d.ts +70 -0
  200. package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
  201. package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
  202. package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
  203. package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
  204. package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
  205. package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
  206. package/dist/packages/charts/src/trend/index.d.ts +10 -0
  207. package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
  208. package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
  209. package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
  210. package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
  211. package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
  212. package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
  213. package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
  214. package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
  215. package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
  216. package/dist/packages/kits/src/interpretability/attention-head-grid.d.ts +56 -0
  217. package/dist/packages/kits/src/interpretability/attribution-workbench.d.ts +29 -0
  218. package/dist/packages/kits/src/interpretability/embedding-atlas.d.ts +41 -0
  219. package/dist/packages/kits/src/interpretability/feature-card.d.ts +33 -0
  220. package/dist/packages/kits/src/interpretability/feature-list.d.ts +51 -0
  221. package/dist/packages/kits/src/interpretability/feature-logits.d.ts +23 -0
  222. package/dist/packages/kits/src/interpretability/features.d.ts +70 -0
  223. package/dist/packages/kits/src/interpretability/index.d.ts +16 -0
  224. package/dist/packages/kits/src/interpretability/kit-styles.d.ts +118 -0
  225. package/dist/packages/kits/src/interpretability/logit-lens.d.ts +50 -0
  226. package/dist/packages/kits/src/interpretability/node-panel.d.ts +32 -0
  227. package/dist/packages/kits/src/interpretability/shared-link.d.ts +8 -0
  228. package/dist/packages/kits/src/interpretability/steering-panel.d.ts +52 -0
  229. package/dist/packages/kits/src/operations/budget-board.d.ts +49 -0
  230. package/dist/packages/kits/src/operations/incident-timeline.d.ts +30 -0
  231. package/dist/packages/kits/src/operations/index.d.ts +6 -0
  232. package/dist/packages/kits/src/operations/service-health.d.ts +66 -0
  233. package/dist/packages/kits/src/training/index.d.ts +8 -0
  234. package/dist/packages/kits/src/training/run-dashboard.d.ts +49 -0
  235. package/dist/packages/kits/src/training/run-legend.d.ts +21 -0
  236. package/dist/packages/kits/src/training/run-marker.d.ts +5 -0
  237. package/dist/packages/kits/src/training/run-state.d.ts +7 -0
  238. package/dist/packages/kits/src/training/run-table.d.ts +63 -0
  239. package/dist/packages/kits/src/training/runs-overview.d.ts +20 -0
  240. package/dist/packages/kits/src/training/runs.d.ts +34 -0
  241. package/dist/packages/teaching/src/agent/index.d.ts +11 -0
  242. package/dist/packages/teaching/src/agent/learner-trace.d.ts +84 -0
  243. package/dist/packages/teaching/src/agent/lesson-bridge.d.ts +59 -0
  244. package/dist/packages/teaching/src/agent/lesson-tour.d.ts +63 -0
  245. package/dist/packages/teaching/src/agent/tutor-tools.d.ts +86 -0
  246. package/dist/packages/teaching/src/article/article-checks.d.ts +9 -0
  247. package/dist/packages/teaching/src/article/article-context.d.ts +49 -0
  248. package/dist/packages/teaching/src/article/article-error.d.ts +12 -0
  249. package/dist/packages/teaching/src/article/article-labels.d.ts +54 -0
  250. package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +14 -0
  251. package/dist/packages/teaching/src/article/article-outline.d.ts +9 -0
  252. package/dist/packages/teaching/src/article/article.d.ts +42 -0
  253. package/dist/packages/teaching/src/article/beat-steps.d.ts +18 -0
  254. package/dist/packages/teaching/src/article/beat.d.ts +16 -0
  255. package/dist/packages/teaching/src/article/challenge.d.ts +29 -0
  256. package/dist/packages/teaching/src/article/exercise-styles.d.ts +76 -0
  257. package/dist/packages/teaching/src/article/figure.d.ts +51 -0
  258. package/dist/packages/teaching/src/article/index.d.ts +31 -0
  259. package/dist/packages/teaching/src/article/lesson-values.d.ts +5 -0
  260. package/dist/packages/teaching/src/article/linked-target.d.ts +22 -0
  261. package/dist/packages/teaching/src/article/notes.d.ts +36 -0
  262. package/dist/packages/teaching/src/article/outline-types.d.ts +73 -0
  263. package/dist/packages/teaching/src/article/predict.d.ts +58 -0
  264. package/dist/packages/teaching/src/article/progress-store.d.ts +64 -0
  265. package/dist/packages/teaching/src/article/scrolly.d.ts +26 -0
  266. package/dist/packages/teaching/src/article/term.d.ts +35 -0
  267. package/dist/packages/teaching/src/article/tex.d.ts +12 -0
  268. package/dist/packages/teaching/src/article/view-essay.d.ts +13 -0
  269. package/dist/packages/teaching/src/article/view-present.d.ts +8 -0
  270. package/dist/packages/teaching/src/article/view-sheet.d.ts +7 -0
  271. package/dist/packages/teaching/src/article/view-static.d.ts +7 -0
  272. package/dist/packages/teaching/src/article/walk.d.ts +34 -0
  273. package/dist/packages/teaching/src/lesson/bound-value.d.ts +29 -0
  274. package/dist/packages/teaching/src/lesson/define-lesson.d.ts +136 -0
  275. package/dist/packages/teaching/src/lesson/index.d.ts +24 -0
  276. package/dist/packages/teaching/src/lesson/inline-choice.d.ts +12 -0
  277. package/dist/packages/teaching/src/lesson/lesson-context.d.ts +18 -0
  278. package/dist/packages/teaching/src/lesson/lesson-error.d.ts +12 -0
  279. package/dist/packages/teaching/src/lesson/lesson-locale.d.ts +4 -0
  280. package/dist/packages/teaching/src/lesson/lesson-persistence.d.ts +17 -0
  281. package/dist/packages/teaching/src/lesson/lesson-player.d.ts +51 -0
  282. package/dist/packages/teaching/src/lesson/lesson-store.d.ts +84 -0
  283. package/dist/packages/teaching/src/lesson/lesson.d.ts +39 -0
  284. package/dist/packages/teaching/src/lesson/param-controls.d.ts +14 -0
  285. package/dist/packages/teaching/src/lesson/param.d.ts +34 -0
  286. package/dist/packages/teaching/src/lesson/playback.d.ts +42 -0
  287. package/dist/packages/teaching/src/lesson/transport.d.ts +19 -0
  288. package/dist/packages/teaching/src/lesson/use-lesson.d.ts +36 -0
  289. package/dist/packages/teaching/src/mdx/essay-components.d.ts +79 -0
  290. package/dist/packages/teaching/src/mdx/essay-markdown.d.ts +41 -0
  291. package/dist/packages/teaching/src/mdx/essay.d.ts +32 -0
  292. package/dist/packages/teaching/src/mdx/index.d.ts +9 -0
  293. package/dist/packages/teaching/src/mdx/requested-view.d.ts +6 -0
  294. package/dist/packages/teaching/src/scene/flow/flow-layout.d.ts +38 -0
  295. package/dist/packages/teaching/src/scene/flow/flow-pulse.d.ts +16 -0
  296. package/dist/packages/teaching/src/scene/flow/scene-flow.d.ts +81 -0
  297. package/dist/packages/teaching/src/scene/index.d.ts +77 -0
  298. package/dist/packages/teaching/src/scene/morph/morph-scope.d.ts +28 -0
  299. package/dist/packages/teaching/src/scene/plane/plane-hit.d.ts +22 -0
  300. package/dist/packages/teaching/src/scene/plane/plane-label.d.ts +23 -0
  301. package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +42 -0
  302. package/dist/packages/teaching/src/scene/plane/plane-math.d.ts +45 -0
  303. package/dist/packages/teaching/src/scene/plane/scene-axes.d.ts +30 -0
  304. package/dist/packages/teaching/src/scene/plane/scene-curve.d.ts +42 -0
  305. package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +59 -0
  306. package/dist/packages/teaching/src/scene/plane/scene-projection.d.ts +27 -0
  307. package/dist/packages/teaching/src/scene/plane/scene-region.d.ts +38 -0
  308. package/dist/packages/teaching/src/scene/plane/scene-rule.d.ts +35 -0
  309. package/dist/packages/teaching/src/scene/plane/scene-vector.d.ts +39 -0
  310. package/dist/packages/teaching/src/scene/scene-bracket.d.ts +24 -0
  311. package/dist/packages/teaching/src/scene/scene-callout.d.ts +26 -0
  312. package/dist/packages/teaching/src/scene/scene-context.d.ts +179 -0
  313. package/dist/packages/teaching/src/scene/scene-custom.d.ts +31 -0
  314. package/dist/packages/teaching/src/scene/scene-geometry.d.ts +181 -0
  315. package/dist/packages/teaching/src/scene/scene-group.d.ts +28 -0
  316. package/dist/packages/teaching/src/scene/scene-highlight.d.ts +19 -0
  317. package/dist/packages/teaching/src/scene/scene-layer.d.ts +16 -0
  318. package/dist/packages/teaching/src/scene/scene-node.d.ts +67 -0
  319. package/dist/packages/teaching/src/scene/scene-obstacles.d.ts +27 -0
  320. package/dist/packages/teaching/src/scene/scene-registry.d.ts +79 -0
  321. package/dist/packages/teaching/src/scene/scene-stagger.d.ts +43 -0
  322. package/dist/packages/teaching/src/scene/scene-style.d.ts +14 -0
  323. package/dist/packages/teaching/src/scene/scene-validate.d.ts +65 -0
  324. package/dist/packages/teaching/src/scene/scene-wire.d.ts +45 -0
  325. package/dist/packages/teaching/src/scene/scene.d.ts +36 -0
  326. package/dist/packages/teaching/src/scene/shapes/cell-color.d.ts +11 -0
  327. package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +69 -0
  328. package/dist/packages/teaching/src/scene/shapes/scene-card.d.ts +114 -0
  329. package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +84 -0
  330. package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +37 -0
  331. package/dist/packages/teaching/src/scene/shapes/scene-stack.d.ts +46 -0
  332. package/dist/packages/teaching/src/scene/shapes/scene-token.d.ts +63 -0
  333. package/dist/packages/teaching/src/scene/shapes/scene-tokens.d.ts +40 -0
  334. package/dist/packages/teaching/src/scene/shapes/stack-book.d.ts +35 -0
  335. package/dist/packages/teaching/src/scene/shapes/stack-layout.d.ts +63 -0
  336. package/dist/packages/teaching/src/scene/shapes/token-layout.d.ts +39 -0
  337. package/dist/packages/teaching/src/spec/advice.d.ts +23 -0
  338. package/dist/packages/teaching/src/spec/chart-names.d.ts +2 -0
  339. package/dist/packages/teaching/src/spec/describe-lesson.d.ts +85 -0
  340. package/dist/packages/teaching/src/spec/explainer-guide.d.ts +21 -0
  341. package/dist/packages/teaching/src/spec/findings.d.ts +39 -0
  342. package/dist/packages/teaching/src/spec/index.d.ts +14 -0
  343. package/dist/packages/teaching/src/spec/lesson-plan.d.ts +43 -0
  344. package/dist/packages/teaching/src/spec/validate-plan.d.ts +11 -0
  345. package/dist/packages/teaching/src/time/clock.d.ts +7 -0
  346. package/dist/packages/teaching/src/time/tween.d.ts +19 -0
  347. package/dist/packages/teaching/src/time/use-tween.d.ts +6 -0
  348. package/dist/param-CqKUTHaO.js +450 -0
  349. package/dist/path-BglsXpnO.js +59 -0
  350. package/dist/plot-axes-DJkLW4wk.js +100 -0
  351. package/dist/plot-layout-CZVSJ-le.js +912 -0
  352. package/dist/plot-marks-uozcbOIX.js +229 -0
  353. package/dist/plot-surface-CbVBvgqZ.js +51 -0
  354. package/dist/plot-width-DcqtSgzb.js +124 -0
  355. package/dist/point-layer-C-EYETAt.js +655 -0
  356. package/dist/reference-lines-BDcttOp0.js +82 -0
  357. package/dist/scale-C2xgZyZN.js +63 -0
  358. package/dist/scene-0z2gbaDE.js +4938 -0
  359. package/dist/scene.js +1 -0
  360. package/dist/slope-chart-BKVEAVCs.js +1279 -0
  361. package/dist/{src-1EHkSFS-.js → src-BD6xlvDt.js} +2 -2
  362. package/dist/{src-DVHlknB6.js → src-CExIrXPC.js} +169 -193
  363. package/dist/src-DIS0YOj0.js +44 -0
  364. package/dist/src-Dcfq8vE4.js +2195 -0
  365. package/dist/styles2.css +907 -59
  366. package/dist/time-series-BgzGNOk0.js +2670 -0
  367. package/dist/token-heatmap-BrW1OsKD.js +1354 -0
  368. package/dist/token-predictions-yerq_Oet.js +1093 -0
  369. package/dist/tone-scope-DKiSw-JR.js +32 -0
  370. package/dist/transport-BJweqDPj.js +715 -0
  371. package/dist/tree-diagram-D09BRqE-.js +1629 -0
  372. package/dist/treemap-CW4WsJNL.js +472 -0
  373. package/dist/use-tween-5HZ55_9d.js +72 -0
  374. package/dist/values-963L6n1m.js +65 -0
  375. package/dist/violin-plot-DrtPZ1-T.js +1292 -0
  376. package/dist/waterfall-DYLSnGjm.js +576 -0
  377. package/package.json +78 -4
  378. package/recipes/allocation-report.tsx +15 -7
  379. package/recipes/counting-cards.tsx +656 -0
  380. package/recipes/explorable-essay.tsx +172 -0
  381. package/skills/extend-elements/SKILL.md +81 -0
  382. package/skills/plan-lesson/SKILL.md +86 -0
  383. package/skills/plan-lesson/references/plan-format.md +114 -0
  384. package/skills/plan-lesson/references/worked-plan.md +171 -0
  385. package/skills/review-elements/SKILL.md +47 -3
  386. package/skills/review-explainer/SKILL.md +97 -0
  387. package/skills/upgrade-elements/SKILL.md +3 -1
  388. package/skills/upgrade-elements/references/releases.md +249 -0
  389. package/skills/use-elements/SKILL.md +22 -14
  390. package/skills/use-elements/references/charts.md +362 -41
  391. package/skills/use-elements/references/figures.md +173 -0
  392. package/skills/use-elements/references/kits.md +180 -0
  393. package/skills/use-elements/references/teaching.md +36 -0
  394. package/skills/write-explainer/SKILL.md +112 -0
  395. package/skills/write-explainer/references/article.md +164 -0
  396. package/skills/write-explainer/references/lesson.md +148 -0
  397. package/skills/write-explainer/references/mdx.md +78 -0
  398. package/skills/write-explainer/references/scene-parts.md +273 -0
  399. package/skills/write-explainer/references/scene.md +168 -0
  400. package/skills/write-explainer/references/tutor.md +104 -0
  401. package/skills/write-explainer/references/worked-essay.md +459 -0
  402. package/templates/essay/AGENTS.md +14 -0
  403. package/templates/essay/README.md +59 -0
  404. package/templates/essay/index.html +17 -0
  405. package/templates/essay/package.template.json +21 -0
  406. package/templates/essay/plan.json +96 -0
  407. package/templates/essay/src/essay.mdx +97 -0
  408. package/templates/essay/src/figures.tsx +92 -0
  409. package/templates/essay/src/lesson.ts +83 -0
  410. package/templates/essay/src/main.tsx +53 -0
  411. package/templates/essay/src/mdx.d.ts +7 -0
  412. package/templates/essay/tsconfig.template.json +15 -0
  413. package/templates/essay/vite.config.template.txt +8 -0
  414. package/dist/categorical-values-BXi-rJuv.js +0 -74
  415. package/dist/chart-data-CIJVWCYt.js +0 -21
  416. package/dist/chart-frame-BaxKn_MB.js +0 -236
  417. package/dist/chart-input-Bm82_9Rd.js +0 -22
  418. package/dist/chart-theme-4zprJ3rW.js +0 -404
  419. package/dist/plot-width-v2c_rA20.js +0 -63
package/dist/lesson.js ADDED
@@ -0,0 +1,5 @@
1
+ import { n as e, t } from "./clock-DSm5lkNE.js";
2
+ import { n, t as r } from "./use-tween-5HZ55_9d.js";
3
+ import { c as i, h as a, i as o, l as s, m as c, n as l, t as u } from "./param-CqKUTHaO.js";
4
+ import { a as d, c as f, i as p, l as m, n as h, o as g, r as _, s as v, t as y, u as b } from "./transport-BJweqDPj.js";
5
+ export { o as BoundValue, m as Lesson, c as LessonLocale, u as Param, p as ParamChoice, d as ParamSlider, g as ParamToggle, h as Playback, y as Transport, l as Value, n as createTween, i as defineLesson, t as isMotionReduced, s as lessonGraph, e as onFrame, b as playbackPaces, v as useLesson, f as useLessonContext, a as useLessonLocale, _ as usePlayback, r as useTween };
@@ -0,0 +1,11 @@
1
+ // packages/charts/src/plot/locate.ts
2
+ function e({ marks: e, width: t, height: n, axis: r = "both" }) {
3
+ return (i) => {
4
+ let a = i.x / i.width * t, o = i.y / i.height * n, s = e.map((e) => {
5
+ let t = r === "y" ? 0 : e.x - a, n = r === "x" ? 0 : e.y - o;
6
+ return t * t + n * n;
7
+ });
8
+ return e[s.indexOf(Math.min(...s))]?.id;
9
+ };
10
+ }
11
+ export { e as t };
package/dist/mdx.js ADDED
@@ -0,0 +1,227 @@
1
+ import { _ as e, b as t, d as n, f as r, g as i, i as ee, l as a, m as o, n as s, p as te, r as c, t as ne, u as re, v as ie, x as ae, y as oe } from "./article-BXZr10QQ.js";
2
+ import { n as se, t as ce } from "./param-CqKUTHaO.js";
3
+ import { a as l, i as u, n as d, o as f, t as p } from "./transport-BJweqDPj.js";
4
+ import { C as m, F as h, G as g, H as _, I as v, J as y, L as b, M as x, N as S, P as C, U as w, W as T, X as E, Y as D, b as O, g as k, i as A, l as j, q as M, r as N, t as P, tt as F, u as I, x as L } from "./scene-0z2gbaDE.js";
5
+ import { t as R } from "./code-block-DioAM2bZ.js";
6
+ import { t as z } from "./content-link-NWuHp5rC.js";
7
+ import * as B from "@stylexjs/stylex";
8
+ import { mergeProps as V } from "@ui-sdk/react/primitive";
9
+ import { Children as H, isValidElement as U, useSyncExternalStore as W } from "react";
10
+ import { jsx as G } from "react/jsx-runtime";
11
+ // packages/teaching/src/mdx/essay-markdown.tsx
12
+ var K = {
13
+ headCell: {
14
+ k8WAf4: "xn9t2bk",
15
+ kg3NbH: "x1doqdfy",
16
+ kt9PQ7: "xso031l",
17
+ kfdmCh: "x1q0q8m5",
18
+ kL6WhQ: "xdjqune",
19
+ kMwMTN: "x153jb6y",
20
+ k63SB2: "x1b5ytql",
21
+ k9WMMc: "x1yc453h",
22
+ $$css: !0
23
+ },
24
+ cell: {
25
+ k8WAf4: "xn9t2bk",
26
+ kg3NbH: "x1doqdfy",
27
+ kt9PQ7: "xso031l",
28
+ kfdmCh: "x1q0q8m5",
29
+ kL6WhQ: "x1qndepd",
30
+ $$css: !0
31
+ },
32
+ aligned: (e) => [{
33
+ k9WMMc: e == null ? e : "x142shqn",
34
+ $$css: !0
35
+ }, { "--x-textAlign": e ?? void 0 }]
36
+ }, le = "math-inline", q = "math-display", ue = "language-";
37
+ function de(e) {
38
+ return /* @__PURE__ */ G("p", { ...V({ className: "xhff0hu" }, e) });
39
+ }
40
+ function J({ children: e, ...t }) {
41
+ return /* @__PURE__ */ G("h3", {
42
+ ...V({ className: "x1tku9c6 x14yccmi x1i2cqwi x1ytb0s6 x1b5ytql x1wjjqco x1w2vvpw x37gifx" }, t),
43
+ children: e
44
+ });
45
+ }
46
+ function Y({ children: e, ...t }) {
47
+ return /* @__PURE__ */ G("h4", {
48
+ ...V({ className: "x433zq8 x1jfksii x1i2cqwi x1ytb0s6 xk4h15q x37gifx" }, t),
49
+ children: e
50
+ });
51
+ }
52
+ function fe(e) {
53
+ return /* @__PURE__ */ G("ul", { ...V({ className: "xhff0hu x1sbza1b" }, e) });
54
+ }
55
+ function pe(e) {
56
+ return /* @__PURE__ */ G("ol", { ...V({ className: "xhff0hu x1sbza1b" }, e) });
57
+ }
58
+ function me(e) {
59
+ return /* @__PURE__ */ G("li", { ...V({ className: "x1v8es8e x1vblts3" }, e) });
60
+ }
61
+ function he(e) {
62
+ return /* @__PURE__ */ G("blockquote", { ...V({ className: "xhff0hu xrxpjvj xo02m6d xyumdvf x1t7ytsu x97x49r x153jb6y" }, e) });
63
+ }
64
+ function ge(e) {
65
+ return /* @__PURE__ */ G("em", { ...V({ className: "x1k4tb9n" }, e) });
66
+ }
67
+ function _e(e) {
68
+ return /* @__PURE__ */ G("strong", { ...V({ className: "x1b5ytql" }, e) });
69
+ }
70
+ function ve(e) {
71
+ return /* @__PURE__ */ G("hr", { ...V({ className: "x4ire xc342km x178xt8z x13fuv20 xhjagg4" }, e) });
72
+ }
73
+ function ye({ alt: e, ...t }) {
74
+ return /* @__PURE__ */ G("img", {
75
+ alt: e,
76
+ ...V({ className: "x1lliihq x193iq5w xt7dq6l xhff0hu x1ok0vyi" }, t)
77
+ });
78
+ }
79
+ function be({ href: e, title: t, children: n }) {
80
+ return /* @__PURE__ */ G(z, {
81
+ href: e,
82
+ title: t,
83
+ children: n
84
+ });
85
+ }
86
+ function xe(e) {
87
+ return /* @__PURE__ */ G("div", {
88
+ className: "xhff0hu xw2csxc",
89
+ children: /* @__PURE__ */ G("table", { ...V({ className: "xh8yej3 x1mwwwfo xtqrqnz x1778rvt xss6m8b" }, e) })
90
+ });
91
+ }
92
+ function Se(e) {
93
+ return /* @__PURE__ */ G("th", { ...V(B.props(K.headCell, e.align !== void 0 && K.aligned(e.align)), e) });
94
+ }
95
+ function Ce(e) {
96
+ return /* @__PURE__ */ G("td", { ...V(B.props(K.cell, e.align !== void 0 && K.aligned(e.align)), e) });
97
+ }
98
+ function X(e) {
99
+ return H.toArray(e).map((e) => typeof e == "string" ? e : "").join("");
100
+ }
101
+ function Z(e, t) {
102
+ return (e ?? "").split(" ").includes(t);
103
+ }
104
+ function we({ className: e, children: t, ...n }) {
105
+ return Z(e, le) ? /* @__PURE__ */ G(c, { children: X(t) }) : Z(e, q) ? /* @__PURE__ */ G(c, {
106
+ isDisplay: !0,
107
+ children: X(t)
108
+ }) : /* @__PURE__ */ G("code", {
109
+ ...V({ className: "x10dazmo x14w6jbu x1ok0vyi x1r7kqkb xiard35 xtqrqnz" }, {
110
+ ...n,
111
+ className: e
112
+ }),
113
+ children: t
114
+ });
115
+ }
116
+ function Q({ children: e }) {
117
+ let t = H.toArray(e)[0];
118
+ if (!U(t)) return e;
119
+ let { className: n, children: r } = t.props;
120
+ if (Z(n, q)) return t;
121
+ let i = (n ?? "").split(" ").find((e) => e.startsWith(ue));
122
+ return /* @__PURE__ */ G("div", {
123
+ className: "xhff0hu xeuugli",
124
+ children: /* @__PURE__ */ G(R, {
125
+ code: X(r).replace(/\n$/, ""),
126
+ language: i?.slice(9)
127
+ })
128
+ });
129
+ }
130
+ // packages/teaching/src/mdx/essay-components.ts
131
+ var $ = {
132
+ h1: J,
133
+ h2: J,
134
+ h3: Y,
135
+ h4: Y,
136
+ p: de,
137
+ a: be,
138
+ ul: fe,
139
+ ol: pe,
140
+ li: me,
141
+ blockquote: he,
142
+ code: we,
143
+ pre: Q,
144
+ table: xe,
145
+ th: Se,
146
+ td: Ce,
147
+ hr: ve,
148
+ img: ye,
149
+ em: ge,
150
+ strong: _e,
151
+ Beat: e,
152
+ Figure: r,
153
+ FigureReference: te,
154
+ Reveal: o,
155
+ Aside: ie,
156
+ Footnote: t,
157
+ Cite: oe,
158
+ TeX: c,
159
+ Term: s,
160
+ DiagramPart: ne,
161
+ Scrolly: a,
162
+ ScrollyStep: re,
163
+ Predict: n,
164
+ Challenge: i,
165
+ References: ae,
166
+ Param: ce,
167
+ Value: se,
168
+ ParamSlider: l,
169
+ ParamChoice: u,
170
+ ParamToggle: f,
171
+ Playback: d,
172
+ Transport: p,
173
+ Scene: F,
174
+ SceneNode: E,
175
+ SceneWire: D,
176
+ SceneGroup: y,
177
+ SceneBracket: M,
178
+ SceneCallout: g,
179
+ SceneHighlight: T,
180
+ SceneCustom: w,
181
+ SceneAxes: _,
182
+ SceneCurve: b,
183
+ ScenePoint: v,
184
+ SceneVector: x,
185
+ SceneRegion: C,
186
+ SceneRule: S,
187
+ SceneProjection: h,
188
+ SceneCard: m,
189
+ SceneStack: L,
190
+ SceneSlot: O,
191
+ SceneCells: k,
192
+ SceneToken: I,
193
+ SceneTokens: j,
194
+ SceneFlow: A,
195
+ LessonFlow: N,
196
+ MorphScope: P
197
+ }, Te = /* @__PURE__ */ new Map([
198
+ ["article", "article"],
199
+ ["present", "present"],
200
+ ["static", "static"],
201
+ ["sheet", "sheet"]
202
+ ]);
203
+ function Ee() {
204
+ return Te.get(new URLSearchParams(globalThis.location.search).get("view") ?? "") ?? "article";
205
+ }
206
+ function De() {
207
+ return "article";
208
+ }
209
+ function Oe(e) {
210
+ return globalThis.addEventListener("popstate", e), () => globalThis.removeEventListener("popstate", e);
211
+ }
212
+ function ke() {
213
+ return W(Oe, Ee, De);
214
+ }
215
+ // packages/teaching/src/mdx/essay.tsx
216
+ function Ae({ content: e, components: t, view: n, ...r }) {
217
+ let i = ke();
218
+ return /* @__PURE__ */ G(ee, {
219
+ ...r,
220
+ view: n ?? i,
221
+ children: e({ components: {
222
+ ...$,
223
+ ...t
224
+ } })
225
+ });
226
+ }
227
+ export { Ae as Essay, $ as essayComponents };
@@ -1,26 +1,36 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ChartSelection, ChartSeriesReport } from '../chart-frame.tsx';
2
+ import type { ValueFormat } from '../figure/figure-format.ts';
3
+ import type { FigureFrameInput, FigureSelectionProps, SeriesFigureProps } from '../figure/figure-props.ts';
4
+ import type { PlotHeight } from '../plot/plot-layout.ts';
5
+ import type { NumericDomain } from '../plot/scale.ts';
3
6
  import type { BarAnnotation, BarComposition, BarMarker, BarSeries } from './bar-data.ts';
4
7
  import type { ChartReferenceLine } from './reference-lines.tsx';
5
8
  export type { BarSeries, BarBucket, BarComposition, BarMarker, BarAnnotation } from './bar-data.ts';
6
- export type BarChartProps = {
7
- readonly title: string;
8
- readonly description?: ReactNode;
9
- readonly report?: ChartSeriesReport | undefined;
10
- readonly categories: ReadonlyArray<{
11
- readonly id: string;
12
- readonly label: string;
13
- readonly axisLabel?: string | undefined;
14
- }>;
9
+ export type BarCategory = {
10
+ readonly id: string;
11
+ readonly label: string;
12
+ /** A short name for the axis, such as "Jan". The readout uses the full label. */
13
+ readonly axisLabel?: string | undefined;
14
+ };
15
+ export type BarChartProps = SeriesFigureProps & FigureSelectionProps & {
16
+ readonly categories: ReadonlyArray<BarCategory>;
15
17
  readonly series: ReadonlyArray<BarSeries>;
16
- readonly domain: readonly [number, number];
18
+ /** The value axis. Leave it out to fit zero and every drawn value on round bounds. */
19
+ readonly domain?: NumericDomain | undefined;
17
20
  readonly mode?: 'grouped' | 'stacked' | undefined;
18
21
  readonly composition?: BarComposition | undefined;
19
- readonly formatValue: (value: number) => string;
20
- readonly formatTick?: ((value: number) => string) | undefined;
21
- readonly highlightedSeriesId?: string | undefined;
22
- readonly selection?: ChartSelection | undefined;
23
- readonly height?: number | undefined;
22
+ /** How the readout and the table write a value. */
23
+ readonly valueFormat: ValueFormat;
24
+ /** How the value axis writes its ticks. Absent uses the compact form of `valueFormat`. */
25
+ readonly tickFormat?: ValueFormat | undefined;
26
+ /**
27
+ * The value axis title, with its unit: "Cost (USD)". With a title the ticks leave a `unit` style out, so the unit
28
+ * is written once. Absent draws no title.
29
+ */
30
+ readonly valueLabel?: string | undefined;
31
+ /** The series drawn at full strength while the others fade. Emphasis only; selection is unchanged. */
32
+ readonly highlighted?: string | null | undefined;
33
+ readonly height?: PlotHeight | undefined;
24
34
  /** Labelled values drawn across the plot, such as a target or an average. They join every category's readout. */
25
35
  readonly referenceLines?: ReadonlyArray<ChartReferenceLine> | undefined;
26
36
  /** Ticks or whiskers drawn on each bar of a series, listed in the legend and the readout. */
@@ -28,14 +38,23 @@ export type BarChartProps = {
28
38
  /** Short notes above chosen bars. Notes for a category also join its readout and exact values. */
29
39
  readonly annotations?: ReadonlyArray<BarAnnotation> | undefined;
30
40
  /**
31
- * Recedes every other category so these stand out, without changing selection or inspection. Emphasis is visual only;
32
- * explain it with an annotation or the description.
41
+ * Recedes every other category so these stand out, without changing selection or inspection. Emphasis is visual
42
+ * only; explain it with an annotation or the description.
33
43
  */
34
44
  readonly emphasizedCategoryIds?: ReadonlyArray<string> | undefined;
35
45
  };
36
- export type BarChartPlaceholderProps = Pick<BarChartProps, 'description' | 'height' | 'report'> & {
46
+ export type BarChartPlaceholderProps = Omit<FigureFrameInput, 'title' | 'status'> & {
37
47
  readonly title?: string | undefined;
38
48
  readonly series?: ReadonlyArray<Pick<BarSeries, 'id' | 'label' | 'tone'>> | undefined;
49
+ readonly height?: PlotHeight | undefined;
39
50
  };
40
- export declare function BarChartPlaceholder({ title, description, report, series, height, }: BarChartPlaceholderProps): ReactNode;
41
- export declare function BarChart({ title, description, report, categories, series, domain, mode, formatValue, formatTick, highlightedSeriesId, selection, height, composition, referenceLines, markers, annotations, emphasizedCategoryIds, }: BarChartProps): ReactNode;
51
+ /**
52
+ * The loading state of a bar chart: its heading, its legend for known series and the plot footprint, with no invented
53
+ * bars. The enclosing async region owns the announcement.
54
+ */
55
+ export declare function BarChartPlaceholder({ title, series, height, ...frame }: BarChartPlaceholderProps): ReactNode;
56
+ /**
57
+ * Bars that compare an amount across named categories, grouped or stacked by series from a zero baseline. It also draws
58
+ * prepared composition buckets, reference lines, markers and short notes the application supplies.
59
+ */
60
+ export declare function BarChart({ categories, series, domain, mode, valueFormat, tickFormat, valueLabel, highlighted, selected, onSelectedChange, height: plotHeight, composition, referenceLines, markers, annotations, emphasizedCategoryIds, ...figure }: BarChartProps): ReactNode;
@@ -1,16 +1,23 @@
1
1
  import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
2
+ import type { NumericDomain } from '../plot/scale.ts';
3
+ /** One series of bars: a value per category, in category order, or null where none was recorded. */
2
4
  export type BarSeries = {
3
5
  readonly id: string;
4
6
  readonly label: string;
5
7
  readonly values: ReadonlyArray<number | null>;
6
8
  readonly tone?: ChartTone | undefined;
7
9
  };
10
+ /**
11
+ * One category of a composition: `parts` stacks the series under a supplied total, `total` draws only the total, and
12
+ * `gap` draws nothing.
13
+ */
8
14
  export type BarBucket = {
9
15
  readonly kind: 'parts' | 'total';
10
16
  readonly total: number;
11
17
  } | {
12
18
  readonly kind: 'gap';
13
19
  };
20
+ /** Supplied totals drawn as gray context behind the series, with an optional focused series. */
14
21
  export type BarComposition = {
15
22
  readonly buckets: ReadonlyArray<BarBucket>;
16
23
  readonly contextLabel: string;
@@ -25,8 +32,9 @@ type CompositionInput = {
25
32
  readonly composition: BarComposition | undefined;
26
33
  readonly series: ReadonlyArray<BarSeries>;
27
34
  readonly categoryIds: ReadonlyArray<string>;
28
- readonly domain: readonly [number, number];
35
+ readonly domain: NumericDomain;
29
36
  };
37
+ /** Why a composition cannot be drawn on the value domain, or undefined when it can. */
30
38
  export declare function validateComposition({ composition, series, categoryIds, domain, }: CompositionInput): string | undefined;
31
39
  /**
32
40
  * A second value drawn on each bar of one series, on the value axis rather than the stack. A tick marks one value, such
@@ -61,13 +69,16 @@ type OverlayInput = {
61
69
  readonly emphasizedCategoryIds: ReadonlyArray<string>;
62
70
  readonly seriesIds: ReadonlyArray<string>;
63
71
  readonly categoryIds: ReadonlyArray<string>;
64
- readonly domain: readonly [number, number];
72
+ readonly domain: NumericDomain;
65
73
  };
74
+ /** Why bar markers, annotations or emphasis cannot be drawn, or undefined when they can. */
66
75
  export declare function validateBarOverlays({ markers, annotations, emphasizedCategoryIds, seriesIds, categoryIds, domain, }: OverlayInput): string | undefined;
67
- export declare function markerValueLabel({ marker, index, formatValue, }: {
76
+ /** A marker's exact value at one category, as the readout and the table write it. */
77
+ export declare function markerValueLabel({ marker, index, valueText, }: {
68
78
  readonly marker: BarMarker;
69
79
  readonly index: number;
70
- readonly formatValue: (value: number) => string;
80
+ /** Writes one value exactly, and a missing one as unavailable. */
81
+ readonly valueText: (value: number | null) => string;
71
82
  }): string;
72
83
  /** The highest value a marker draws at one category, so an annotation can clear it. */
73
84
  export declare function markerPeak(marker: BarMarker, index: number): number | null;
@@ -14,16 +14,20 @@ type BarMarkersProps = {
14
14
  readonly y: (value: number) => number;
15
15
  readonly isReceded: (categoryId: string) => boolean;
16
16
  };
17
+ /** A note above one bar, positioned in plot pixels. */
17
18
  export type PlacedAnnotation = {
18
19
  readonly id: string;
19
- readonly label: string;
20
+ readonly text: string;
20
21
  readonly x: number;
21
22
  readonly y: number;
22
23
  readonly isReceded: boolean;
23
24
  };
24
- /** Draws each marker's tick or whisker over its bar with a surface halo, so it reads on the bar and on the canvas. */
25
+ /** Draws each marker's tick or whisker over its bar, on the value axis rather than the stack. */
25
26
  export declare function BarMarkers({ markers, categoryIds, span, barTop, y, isReceded }: BarMarkersProps): ReactNode;
26
- /** Centers each note above its anchor and keeps it inside the plot's horizontal bounds. */
27
+ /**
28
+ * Notes above their bars, kept inside the plot's horizontal bounds. Where notes would touch, as on a narrow plot, the
29
+ * later ones are left out of the plot; they stay in the readout and the exact values.
30
+ */
27
31
  export declare function BarAnnotations({ annotations, left, right, }: {
28
32
  readonly annotations: ReadonlyArray<PlacedAnnotation>;
29
33
  readonly left: number;
@@ -1,13 +1,15 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { BreakdownItem } from '../categorical-values.tsx';
3
- import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
4
- export type BreakdownBarProps = {
5
- readonly title: string;
6
- readonly report?: ChartReport | undefined;
7
- readonly description?: string | undefined;
3
+ import type { ValueFormat } from '../figure/figure-format.ts';
4
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
5
+ export type BreakdownBarProps = FigureProps & FigureSelectionProps & {
8
6
  readonly items: ReadonlyArray<BreakdownItem>;
7
+ /** The declared whole. Recorded values may fall short of it; the rest is shown as unassigned. */
9
8
  readonly total: number;
10
- readonly formatValue: (value: number) => string;
11
- readonly selection?: ChartSelection | undefined;
9
+ readonly valueFormat: ValueFormat;
12
10
  };
13
- export declare function BreakdownBar({ title, report, description, items, total, formatValue, selection, }: BreakdownBarProps): ReactNode;
11
+ /**
12
+ * The parts of one declared total as a single strip with a row per part. Use it when the whole and an unassigned
13
+ * remainder matter; the application supplies every part and the total.
14
+ */
15
+ export declare function BreakdownBar({ items, total, valueFormat, selected, onSelectedChange, ...figure }: BreakdownBarProps): ReactNode;
@@ -1,29 +1,33 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
2
+ import type { ValueFormat } from '../figure/figure-format.ts';
3
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
4
+ import type { PlotHeight } from '../plot/plot-layout.ts';
5
+ import type { NumericDomain } from '../plot/scale.ts';
3
6
  import type { BridgeStep } from './bridge-data.ts';
4
7
  import type { ChartReferenceLine } from './reference-lines.tsx';
5
8
  export type { BridgeStep } from './bridge-data.ts';
6
- export type BridgeChartProps = {
7
- readonly title: string;
8
- readonly description?: ReactNode;
9
- readonly report?: ChartReport | undefined;
9
+ export type BridgeChartProps = FigureProps & FigureSelectionProps & {
10
10
  readonly steps: ReadonlyArray<BridgeStep>;
11
- /** Formats totals and running levels exactly, for labels, inspection and accessible values. */
12
- readonly formatValue: (value: number) => string;
13
- /** Formats a signed change. Absent prefixes the formatted magnitude with + or −. */
14
- readonly formatChange?: ((value: number) => string) | undefined;
15
- /** Formats compact value-axis ticks. Absent uses `formatValue`. */
16
- readonly formatTick?: ((value: number) => string) | undefined;
17
- /** A fixed value domain shared with related charts. Absent fits zero and every running total. */
18
- readonly domain?: readonly [number, number] | undefined;
11
+ /** How totals and running levels are written in labels, inspection and exact values. */
12
+ readonly valueFormat: ValueFormat;
13
+ /** How a signed change is written. Absent writes the value format with its sign. */
14
+ readonly changeFormat?: ValueFormat | undefined;
15
+ /** How the value axis writes its ticks. Absent uses the compact form of `valueFormat`. */
16
+ readonly tickFormat?: ValueFormat | undefined;
17
+ /**
18
+ * The value axis title, with its unit: "Cost (USD)". With a title the ticks leave a `unit` style out, so the unit
19
+ * is written once. Absent draws no title.
20
+ */
21
+ readonly valueLabel?: string | undefined;
22
+ /** A fixed value domain shared with related charts. Absent fits zero and every running total on round bounds. */
23
+ readonly domain?: NumericDomain | undefined;
19
24
  /** Labelled values drawn across the plot, such as a target for the final total. */
20
25
  readonly referenceLines?: ReadonlyArray<ChartReferenceLine> | undefined;
21
- readonly selection?: ChartSelection | undefined;
22
- readonly height?: number | undefined;
26
+ readonly height?: PlotHeight | undefined;
23
27
  };
24
28
  /**
25
29
  * Explains how a starting total becomes a result through signed changes, such as an amount and the deductions that
26
30
  * leave a remainder. Columns float from the running total, and dashed connectors carry it to the next step. Use
27
31
  * BarChart for independent categories and BreakdownBar for parts of one total; the application supplies every change.
28
32
  */
29
- export declare function BridgeChart({ title, description, report, steps, formatValue, formatChange, formatTick, domain, referenceLines, selection, height, }: BridgeChartProps): ReactNode;
33
+ export declare function BridgeChart({ steps, valueFormat, changeFormat, tickFormat, valueLabel, domain, referenceLines, selected, onSelectedChange, height: plotHeight, ...figure }: BridgeChartProps): ReactNode;
@@ -1,4 +1,5 @@
1
1
  import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
2
+ import type { NumericDomain } from '../plot/scale.ts';
2
3
  /**
3
4
  * One column of a bridge; the first is the start total. A change adds its signed value to the running total, and a
4
5
  * missing change leaves later levels unknown. A total shows the running total so far, such as a subtotal or the
@@ -31,10 +32,10 @@ export type BridgeLevel = {
31
32
  };
32
33
  /** Stacks the supplied changes into running levels; totals start at zero and missing changes stay unknown. */
33
34
  export declare function bridgeLevels(steps: ReadonlyArray<BridgeStep>): ReadonlyArray<BridgeLevel>;
34
- type ValueDomain = readonly [number, number];
35
- export declare function bridgeDomain(levels: ReadonlyArray<BridgeLevel>): ValueDomain;
35
+ /** The span of zero and every known running level, which any domain for the bridge must contain. */
36
+ export declare function bridgeDomain(levels: ReadonlyArray<BridgeLevel>): NumericDomain;
37
+ /** Why steps cannot form a bridge on the domain, or undefined when they can. */
36
38
  export declare function validateBridge({ steps, domain, }: {
37
39
  readonly steps: ReadonlyArray<BridgeStep>;
38
- readonly domain?: ValueDomain | undefined;
40
+ readonly domain?: NumericDomain | undefined;
39
41
  }): string | undefined;
40
- export {};
@@ -1,6 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
3
+ import type { MarkState } from '../plot/plot-marks.tsx';
2
4
  import type { BarBucket, BarSeries } from './bar-data.ts';
3
- type CompositionBarsProps = {
5
+ type CompositionBarsProps = MarkState & {
4
6
  readonly bucket: BarBucket;
5
7
  readonly series: ReadonlyArray<BarSeries>;
6
8
  readonly focusedSeries: BarSeries | undefined;
@@ -8,8 +10,10 @@ type CompositionBarsProps = {
8
10
  readonly x: number;
9
11
  readonly width: number;
10
12
  readonly y: (value: number) => number;
11
- readonly isSelected: boolean;
12
- readonly highlightedSeriesId?: string | undefined;
13
+ readonly highlighted?: string | null | undefined;
14
+ /** The resolved tone of a series. */
15
+ readonly toneOf: (id: string) => ChartTone;
13
16
  };
14
- export declare function CompositionBars({ bucket, series, focusedSeries, index, x, width, y, isSelected, highlightedSeriesId, }: CompositionBarsProps): ReactNode;
17
+ /** One composition bucket: its supplied total as gray context and its parts or focused series over it. */
18
+ export declare function CompositionBars({ bucket, series, focusedSeries, index, x, width, y, isSelected, isInspected, highlighted, toneOf, }: CompositionBarsProps): ReactNode;
15
19
  export {};
@@ -1,18 +1,18 @@
1
- export type { BarSeries, BarBucket, BarComposition, BarChartProps, BarChartPlaceholderProps, BarMarker, BarAnnotation, } from './bar-chart.tsx';
1
+ export type { BarSeries, BarBucket, BarCategory, BarComposition, BarChartProps, BarChartPlaceholderProps, BarMarker, BarAnnotation, } from './bar-chart.tsx';
2
2
  export { BarChart, BarChartPlaceholder } from './bar-chart.tsx';
3
3
  export type { BreakdownBarProps } from './breakdown-bar.tsx';
4
4
  export { BreakdownBar } from './breakdown-bar.tsx';
5
5
  export type { BridgeChartProps, BridgeStep } from './bridge-chart.tsx';
6
6
  export { BridgeChart } from './bridge-chart.tsx';
7
7
  export type { ChartReferenceLine } from './reference-lines.tsx';
8
- export type { ScatterPoint, ScatterRange, ScatterRangeDetails, ScatterRangeSelection, ScatterPlotProps, } from './scatter-plot.tsx';
9
- export { MAX_SCATTER_POINTS, ScatterPlot } from './scatter-plot.tsx';
10
- export type { SparklineProps, SparklinePoint } from './sparkline.tsx';
8
+ export type { ScatterPoint, ScatterRange, ScatterRangeDetails, ScatterPlotProps } from './scatter-plot.tsx';
9
+ export { ScatterPlot, scatterLimits } from './scatter-plot.tsx';
10
+ export type { SparklineLayout, SparklineProps, SparklinePoint } from './sparkline.tsx';
11
11
  export { Sparkline } from './sparkline.tsx';
12
12
  export type { TimeSeriesPoint, TimeSeries, TimeSeriesMarker } from './time-series-data.ts';
13
13
  export { timeSeriesLimits } from './time-series-data.ts';
14
14
  export type { TimeSeriesBand, TimeSeriesBandPoint, TimeSeriesCrossing } from './time-series-bands.ts';
15
15
  export { timeSeriesBandLimits } from './time-series-bands.ts';
16
- export type { TimeSeriesChartProps, TimeSeriesChartPlaceholderProps, AreaChartProps, SmallMultiplesProps, SmallMultiplesPlaceholderProps, TimeRangeSelection, } from './time-series.tsx';
16
+ export type { TimeSeriesChartProps, TimeSeriesChartPlaceholderProps, AreaChartProps, SmallMultiplesProps, SmallMultiplesPlaceholderProps, SmallMultiplesPanel, TimestampUnit, } from './time-series.tsx';
17
17
  export type { ChartRangeDetails, ChartRangeValue } from '../chart-range.tsx';
18
18
  export { LineChart, AreaChart, SmallMultiples, SmallMultiplesPlaceholder, TimeSeriesChartPlaceholder, } from './time-series.tsx';
@@ -1,5 +1,9 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
3
+ import type { LabelBox, LabelObstacle } from '../plot/label-place.ts';
4
+ import type { PlotBox } from '../plot/plot-layout.ts';
5
+ import type { NumericDomain } from '../plot/scale.ts';
6
+ import type { PlacedLabel } from './value-labels.ts';
3
7
  /**
4
8
  * A labelled value drawn across the plot, such as a target or a period average. The application supplies the value and
5
9
  * its meaning; the chart neither computes nor ranks it.
@@ -8,27 +12,30 @@ export type ChartReferenceLine = {
8
12
  readonly id: string;
9
13
  readonly label: string;
10
14
  readonly value: number;
11
- /** Colors the line. Absent means the neutral tone; the label always uses text colors. */
15
+ /** Colors the line. Absent means ink; the label always uses text colors. */
12
16
  readonly tone?: ChartTone | undefined;
13
17
  };
18
+ /** Why reference lines cannot be drawn on a value axis, or undefined when they can. */
14
19
  export declare function validateReferenceLines({ lines, domain, }: {
15
20
  readonly lines: ReadonlyArray<ChartReferenceLine>;
16
- readonly domain: readonly [number, number];
21
+ readonly domain: NumericDomain;
17
22
  }): string | undefined;
18
- /** The right gutter that holds reference labels, or zero when the plot has none. */
19
- export declare function referenceGutterWidth({ lines, formatValue, }: {
20
- readonly lines: ReadonlyArray<ChartReferenceLine>;
21
- readonly formatValue: (value: number) => string;
22
- }): number;
23
- type ReferenceLinesProps = {
23
+ /**
24
+ * Dashed reference lines across a plot, each named with its exact value. A label sits above its line at the plot's
25
+ * right end, or else at the left end, or else further along the line, then below it. It takes the first place that
26
+ * clears the chart's own value labels and the marks it is given, and labels that would touch are spread apart
27
+ * vertically, never dropped.
28
+ */
29
+ export declare function ReferenceMarks({ lines, box, position, valueText, avoid, marks, obstacles, }: {
24
30
  readonly lines: ReadonlyArray<ChartReferenceLine>;
25
- readonly y: (value: number) => number;
26
- readonly left: number;
27
- readonly right: number;
28
- readonly top: number;
29
- readonly bottom: number;
30
- readonly formatValue: (value: number) => string;
31
- };
32
- /** Draws dashed reference lines across the plot and names each one in the right gutter beside its line. */
33
- export declare function ReferenceLines({ lines, y, left, right, top, bottom, formatValue }: ReferenceLinesProps): ReactNode;
34
- export {};
31
+ readonly box: PlotBox;
32
+ /** Where a value sits on the plot's value axis. */
33
+ readonly position: (value: number) => number;
34
+ readonly valueText: (value: number) => string;
35
+ /** Labels the chart draws in the plot, such as a column's value, that a reference label must not cover. */
36
+ readonly avoid?: ReadonlyArray<PlacedLabel> | undefined;
37
+ /** The boxes of marks a reference label must not sit on, such as the columns of a bridge. */
38
+ readonly marks?: ReadonlyArray<LabelBox> | undefined;
39
+ /** The lines a reference label must not sit on, such as a chart's series, as pixel polylines. */
40
+ readonly obstacles?: ReadonlyArray<ReadonlyArray<LabelObstacle>> | undefined;
41
+ }): ReactNode;