@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
@@ -0,0 +1,41 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ /** A paragraph of the essay. */
3
+ export declare function EssayParagraph(props: ComponentProps<'p'>): ReactNode;
4
+ /** A Markdown `#` or `##` heading, drawn as the heading of a section inside a beat, whose own title is the `h2`. */
5
+ export declare function EssaySection({ children, ...props }: ComponentProps<'h3'>): ReactNode;
6
+ /** A Markdown `###` heading, drawn below a section heading. */
7
+ export declare function EssaySubsection({ children, ...props }: ComponentProps<'h4'>): ReactNode;
8
+ /** A bulleted list. */
9
+ export declare function EssayList(props: ComponentProps<'ul'>): ReactNode;
10
+ /** A numbered list. */
11
+ export declare function EssayOrderedList(props: ComponentProps<'ol'>): ReactNode;
12
+ /** One item of a list. */
13
+ export declare function EssayItem(props: ComponentProps<'li'>): ReactNode;
14
+ /** A quotation. */
15
+ export declare function EssayQuote(props: ComponentProps<'blockquote'>): ReactNode;
16
+ /** Emphasized text. */
17
+ export declare function EssayEmphasis(props: ComponentProps<'em'>): ReactNode;
18
+ /** Strong text. */
19
+ export declare function EssayStrong(props: ComponentProps<'strong'>): ReactNode;
20
+ /** A divider between two parts of a beat. */
21
+ export declare function EssayRule(props: ComponentProps<'hr'>): ReactNode;
22
+ /** An image that never outgrows the text column. */
23
+ export declare function EssayImage({ alt, ...props }: ComponentProps<'img'>): ReactNode;
24
+ /** A link. It follows the same rules as `ContentLink`: only web and mail addresses are followed. */
25
+ export declare function EssayLink({ href, title, children }: ComponentProps<'a'>): ReactNode;
26
+ /** A table that scrolls inside its own box when the column is narrower than it. */
27
+ export declare function EssayTable(props: ComponentProps<'table'>): ReactNode;
28
+ /** A table head cell. Its `align` attribute from a Markdown table column is kept. */
29
+ export declare function EssayHeadCell(props: ComponentProps<'th'>): ReactNode;
30
+ /** A table cell. Its `align` attribute is kept. */
31
+ export declare function EssayCell(props: ComponentProps<'td'>): ReactNode;
32
+ /**
33
+ * Inline code, or inline math when remark-math marked it. Math reaches `TeX` with its TeX source, so the article's
34
+ * typesetter draws it.
35
+ */
36
+ export declare function EssayCode({ className, children, ...props }: ComponentProps<'code'>): ReactNode;
37
+ /**
38
+ * A fenced code block, drawn by `CodeBlock` with the language of the fence. Display math is a code element that
39
+ * remark-math marked, so it passes through to be typeset.
40
+ */
41
+ export declare function EssayPre({ children }: ComponentProps<'pre'>): ReactNode;
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ArticleProps, ArticleView } from '../article/index.ts';
3
+ import type { LessonParams } from '../lesson/index.ts';
4
+ import type { EssayComponents } from './essay-components.ts';
5
+ /** The metadata an essay file may export as `export const meta = { title: '…' }`, to spread onto `Essay`. */
6
+ export type EssayMeta = {
7
+ readonly title: string;
8
+ readonly authors?: ReadonlyArray<string> | undefined;
9
+ /** The publication date as an ISO date, such as `2026-11-23`. */
10
+ readonly date?: string | undefined;
11
+ readonly summary?: string | undefined;
12
+ };
13
+ /** The props a compiled MDX component takes: the components its elements and tags resolve to. */
14
+ export type EssayContentProps = {
15
+ readonly components?: EssayComponents;
16
+ };
17
+ /** A compiled MDX file: the default export of `essay.mdx` once the application's MDX plugin has compiled it. */
18
+ export type EssayContent = (props: EssayContentProps) => ReactNode;
19
+ export type EssayProps<Params extends LessonParams, Derived extends string, Beat extends string> = Omit<ArticleProps<Params, Derived, Beat>, 'children' | 'view'> & {
20
+ /** The compiled MDX file: `import Content from './essay.mdx'`. */
21
+ readonly content: EssayContent;
22
+ /** Components the essay file may use besides `essayComponents`, or instead of them under the same name. */
23
+ readonly components?: EssayComponents | undefined;
24
+ /** How the essay is arranged. Without it, the `view` address parameter decides: `?view=present|static|sheet`. */
25
+ readonly view?: ArticleView | undefined;
26
+ };
27
+ /**
28
+ * An explorable essay written as one MDX file. It renders the compiled file inside an `Article` with `essayComponents`,
29
+ * so the file uses `Beat`, `Param`, `Figure`, `Scene` and the rest without imports. The file's elements are read once
30
+ * so the article sees its beats, and a compiled file that reads a context hook sits inside this component's render.
31
+ */
32
+ export declare function Essay<Params extends LessonParams, Derived extends string, Beat extends string>({ content, components, view, ...article }: EssayProps<Params, Derived, Beat>): ReactNode;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Explorable essays written in MDX. `Essay` renders a compiled MDX file as an `Article`. `essayComponents` lets the
3
+ * file use Markdown and every teaching part without imports. The application brings its own MDX compiler, such as
4
+ * `@mdx-js/rollup`.
5
+ */
6
+ export type { EssayComponents } from './essay-components.ts';
7
+ export { essayComponents } from './essay-components.ts';
8
+ export type { EssayContent, EssayContentProps, EssayMeta, EssayProps } from './essay.tsx';
9
+ export { Essay } from './essay.tsx';
@@ -0,0 +1,6 @@
1
+ import type { ArticleView } from '../article/index.ts';
2
+ /**
3
+ * The view the address asks for with `?view=present`, `static` or `sheet`, and `article` when it asks for none. The
4
+ * server and the first browser render show `article`, so the page hydrates cleanly before it switches.
5
+ */
6
+ export declare function useRequestedView(): ArticleView;
@@ -0,0 +1,38 @@
1
+ import type { NumericDomain } from '../../../../charts/src/index.ts';
2
+ import type { LessonGraph } from '../../lesson/define-lesson.ts';
3
+ import type { ScenePosition } from '../scene-geometry.ts';
4
+ /** Which way the layers of a flow advance: from left to right, or from top to bottom. */
5
+ export type FlowDirection = 'across' | 'down';
6
+ /** One value of a flow with its place: the layer it sits in and its row inside that layer. */
7
+ export type FlowSlot = {
8
+ readonly name: string;
9
+ readonly kind: 'param' | 'derived';
10
+ readonly label: string;
11
+ readonly layer: number;
12
+ readonly row: number;
13
+ };
14
+ /** A lesson graph arranged in layers, ready to be placed in a box. */
15
+ export type FlowPlan = {
16
+ readonly slots: ReadonlyArray<FlowSlot>;
17
+ readonly edges: LessonGraph['edges'];
18
+ /** How many layers the values fill. */
19
+ readonly layers: number;
20
+ /** How many values the busiest layer holds. */
21
+ readonly rows: number;
22
+ };
23
+ /** The first name the graph does not hold, or undefined when it holds them all. */
24
+ export declare function unknownFlowName(graph: LessonGraph, names: ReadonlyArray<string>): string | undefined;
25
+ /**
26
+ * Arranges a lesson's derivation in layers. Each derived value sits one layer after the last value it reads, and each
27
+ * param one layer before the first value that reads it. Inside a layer, values follow the values they read.
28
+ */
29
+ export declare function flowPlan(graph: LessonGraph, names?: ReadonlyArray<string>): FlowPlan;
30
+ /** The center of each value of a plan inside a data box: layers across or down the box, rows along the other axis. */
31
+ export declare function flowPositions({ plan, box, direction, }: {
32
+ readonly plan: FlowPlan;
33
+ readonly box: {
34
+ readonly x: NumericDomain;
35
+ readonly y: NumericDomain;
36
+ };
37
+ readonly direction: FlowDirection;
38
+ }): ReadonlyMap<string, ScenePosition>;
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../../charts/src/index.ts';
3
+ import type { LessonValue } from '../../lesson/define-lesson.ts';
4
+ import type { Pace } from '../../time/tween.ts';
5
+ import type { FlowPlan } from './flow-layout.ts';
6
+ /**
7
+ * Shows a lesson change as a cause: the values that changed glow once, layer after layer, and a dot runs along each
8
+ * wire between them. With reduced motion the touched values are marked at rest instead. It draws nothing until a value
9
+ * changes.
10
+ */
11
+ export declare function FlowPulse({ plan, values, pace, tone, }: {
12
+ readonly plan: FlowPlan;
13
+ readonly values: Readonly<Record<string, LessonValue | undefined>>;
14
+ readonly pace: Pace;
15
+ readonly tone: ChartTone | undefined;
16
+ }): ReactNode;
@@ -0,0 +1,81 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone, NumericDomain, PlotHeight } from '../../../../charts/src/index.ts';
3
+ import type { AnyLesson } from '../../lesson/define-lesson.ts';
4
+ import type { SceneLabels } from '../scene-validate.ts';
5
+ import type { SceneProps } from '../scene.tsx';
6
+ import type { FlowDirection } from './flow-layout.ts';
7
+ /** The words a flow shows that are not the author's content. Placeholders in braces are filled in. */
8
+ export type SceneFlowLabels = {
9
+ readonly noLesson: string;
10
+ /** `{name}` is the name the author gave, `{lesson}` the lesson's id. */
11
+ readonly unknownName: string;
12
+ /** `{count}` is how many values share one column, `{limit}` how many the plot holds. */
13
+ readonly crowded: string;
14
+ /** The readout sentence of a value: `{label}` and its `{value}` in its format. */
15
+ readonly node: string;
16
+ /** Appended to a derived value's sentence when it has a formula: `{formula}`. */
17
+ readonly formula: string;
18
+ /** Appended to a value's sentence: `{names}` are the labels of the values it reads. */
19
+ readonly reads: string;
20
+ readonly on: string;
21
+ readonly off: string;
22
+ };
23
+ export declare const sceneFlowLabels: {
24
+ readonly noLesson: 'SceneFlow needs a Lesson around it that renders its lesson.';
25
+ readonly unknownName: 'The flow names "{name}", which lesson "{lesson}" does not declare.';
26
+ readonly crowded: 'The flow stacks {count} values in one column, and this plot holds {limit}. Show fewer with `names`.';
27
+ readonly node: '{label}: {value}';
28
+ readonly formula: ', {formula}';
29
+ readonly reads: '. Reads {names}';
30
+ readonly on: 'on';
31
+ readonly off: 'off';
32
+ };
33
+ /** The pixel box of each value in a flow, big enough for a two-line label and an inline control. */
34
+ export declare const flowNodeSize: {
35
+ readonly width: 128;
36
+ readonly height: 64;
37
+ };
38
+ export type SceneFlowProps = {
39
+ /** The lesson to draw. Left out, the nearest `Lesson`'s. A `Lesson` that renders it must enclose the flow. */
40
+ readonly lesson?: AnyLesson | undefined;
41
+ /** Draw only these values and every value they read. Left out, the whole lesson. */
42
+ readonly names?: ReadonlyArray<string> | undefined;
43
+ /** Layers from left to right, or from top to bottom. Defaults to `across`. */
44
+ readonly layout?: FlowDirection | undefined;
45
+ /** The part of the scene's data box the flow fills. Left out, the whole box. */
46
+ readonly at?: {
47
+ readonly x: NumericDomain;
48
+ readonly y: NumericDomain;
49
+ } | undefined;
50
+ /** Plain text for a derived value's readout, by name, such as `−log₂ p`. */
51
+ readonly formula?: Readonly<Record<string, string>> | undefined;
52
+ /** The pixel box of each value. Defaults to `flowNodeSize`. */
53
+ readonly size?: {
54
+ readonly width: number;
55
+ readonly height: number;
56
+ } | undefined;
57
+ /** The hue of the pulse that shows a change. Left out, ink. */
58
+ readonly tone?: ChartTone | undefined;
59
+ readonly labels?: Partial<SceneFlowLabels> | undefined;
60
+ };
61
+ /**
62
+ * A lesson's derivation drawn live inside a `Scene`: each param and derived value is a node in layers left to right,
63
+ * wired to the values it reads. Params are inline controls, every value shows its current text, and a change glows
64
+ * through what it touched. Inspecting a value lights what it reads and what reads it.
65
+ */
66
+ export declare function SceneFlow({ lesson, names, layout, at, formula, size, tone, labels: labelInput, }: SceneFlowProps): ReactNode;
67
+ export type LessonFlowProps = Omit<SceneProps, 'x' | 'y' | 'title' | 'height' | 'aspect' | 'children' | 'labels'> & Omit<SceneFlowProps, 'at' | 'labels'> & {
68
+ /** The flow's words and the scene's words in one object. */
69
+ readonly labels?: (Partial<SceneFlowLabels> & Partial<SceneLabels>) | undefined;
70
+ /** Left out, the lesson's title. */
71
+ readonly title?: string | undefined;
72
+ /** Left out, the smallest named height whose columns hold the flow's busiest layer. */
73
+ readonly height?: PlotHeight | undefined;
74
+ /** More scene parts drawn with the flow, such as a `SceneCallout` on one of its values. */
75
+ readonly children?: ReactNode;
76
+ };
77
+ /**
78
+ * A lesson's derivation as a figure of its own: a `Scene` sized to the flow, with `SceneFlow` inside. Use it beside the
79
+ * prose and controls of a lesson; the author supplies only a title and description, or nothing.
80
+ */
81
+ export declare function LessonFlow({ lesson, names, layout, formula, size, tone, labels, title, height, children, ...scene }: LessonFlowProps): ReactNode;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Diagrams with identity. A `Scene` places nodes, wires, notes, plane marks, cards, cells and tokens in a data box on
3
+ * the plot kernel; change their props and they ease to the new state. New parts build on `useSceneObject`.
4
+ */
5
+ export type { SceneProps } from './scene.tsx';
6
+ export { Scene } from './scene.tsx';
7
+ export type { SceneNodeProps } from './scene-node.tsx';
8
+ export { SceneNode } from './scene-node.tsx';
9
+ export type { SceneWireProps, SceneWireShape, SceneWireTextSide } from './scene-wire.tsx';
10
+ export { SceneWire } from './scene-wire.tsx';
11
+ export type { SceneGroupProps } from './scene-group.tsx';
12
+ export { SceneGroup } from './scene-group.tsx';
13
+ export type { SceneBracketProps, SceneBracketSide } from './scene-bracket.tsx';
14
+ export { SceneBracket } from './scene-bracket.tsx';
15
+ export type { SceneCalloutProps, SceneCalloutSide } from './scene-callout.tsx';
16
+ export { SceneCallout } from './scene-callout.tsx';
17
+ export type { SceneHighlightProps } from './scene-highlight.tsx';
18
+ export { SceneHighlight } from './scene-highlight.tsx';
19
+ export type { SceneCustomProps, SceneDrawing } from './scene-custom.tsx';
20
+ export { SceneCustom } from './scene-custom.tsx';
21
+ export type { SceneLayerName } from './scene-layer.tsx';
22
+ export { SceneLayer, SceneOutside } from './scene-layer.tsx';
23
+ export type { SceneContextValue, SceneFollowed, SceneObjectInput, SceneObjectState } from './scene-context.ts';
24
+ export { useSceneContext, useSceneFrames, useSceneObject } from './scene-context.ts';
25
+ export type { SceneDelay, SceneStagger, SceneStaggerPlace } from './scene-stagger.ts';
26
+ export { sceneStaggers } from './scene-stagger.ts';
27
+ export type { SceneDataPoint, SceneFrame, SceneMargins, SceneOffset, ScenePixel, ScenePosition, SceneRect, SceneShape, SceneSize, SceneSizeName, SceneView, } from './scene-geometry.ts';
28
+ export { edgePoint, nodeBox, padRect, rectCenter, rectsOverlap, sceneCircleSizes, sceneNodeSizes, sidePoint, unionRect, } from './scene-geometry.ts';
29
+ export { useObstacle } from './scene-obstacles.ts';
30
+ export type { SceneFrameKey, SceneFrameValues, SceneMember, SceneRegistry, SceneTrack } from './scene-registry.ts';
31
+ export { sceneStore } from './scene-registry.ts';
32
+ export type { SceneOutlineState } from './scene-style.ts';
33
+ export { sceneContextColor, sceneOutlines } from './scene-style.ts';
34
+ export type { SceneLabels } from './scene-validate.ts';
35
+ export { fillLabel, sceneLabels, sceneLimits } from './scene-validate.ts';
36
+ export type { SceneAxesProps, SceneAxis } from './plane/scene-axes.tsx';
37
+ export { SceneAxes } from './plane/scene-axes.tsx';
38
+ export type { SceneCurveProps } from './plane/scene-curve.tsx';
39
+ export { SceneCurve } from './plane/scene-curve.tsx';
40
+ export type { ScenePointAlong, ScenePointMoveDetails, ScenePointProps, ScenePointSets } from './plane/scene-point.tsx';
41
+ export { ScenePoint } from './plane/scene-point.tsx';
42
+ export type { SceneProjectionProps } from './plane/scene-projection.tsx';
43
+ export { SceneProjection } from './plane/scene-projection.tsx';
44
+ export type { SceneRegionProps } from './plane/scene-region.tsx';
45
+ export { SceneRegion } from './plane/scene-region.tsx';
46
+ export type { SceneRuleProps } from './plane/scene-rule.tsx';
47
+ export { SceneRule } from './plane/scene-rule.tsx';
48
+ export type { SceneVectorProps } from './plane/scene-vector.tsx';
49
+ export { SceneVector } from './plane/scene-vector.tsx';
50
+ export type { ScenePlaneLabels } from './plane/plane-labels.ts';
51
+ export { planeLabels } from './plane/plane-labels.ts';
52
+ export type { SceneCurveResolution, ScenePlaneThickness } from './plane/plane-math.ts';
53
+ export { curveResolutions, planeLimits, planeThicknesses } from './plane/plane-math.ts';
54
+ export type { CardRank, CardSuit, SceneCardLabels, SceneCardProps } from './shapes/scene-card.tsx';
55
+ export { cardRanks, cardSuits, SceneCard, sceneCardLabels, suitTones } from './shapes/scene-card.tsx';
56
+ export type { SceneStackLabels, SceneStackProps } from './shapes/scene-stack.tsx';
57
+ export { SceneStack, sceneStackLabels } from './shapes/scene-stack.tsx';
58
+ export type { SceneSlotProps } from './shapes/scene-slot.tsx';
59
+ export { SceneSlot } from './shapes/scene-slot.tsx';
60
+ export type { SceneCardSizeName, StackBounds, StackGapName, StackLayout, StackPlace, StackShape, } from './shapes/stack-layout.ts';
61
+ export { sceneCardSizes, stackBounds, stackGaps, stackPlace } from './shapes/stack-layout.ts';
62
+ export type { SceneCellsLabels, SceneCellsProps } from './shapes/scene-cells.tsx';
63
+ export { SceneCells, sceneCellsLabels } from './shapes/scene-cells.tsx';
64
+ export type { SceneCellInput, SceneCellsDirection, SceneCellSizeName, SceneCellValues } from './shapes/cell-grid.ts';
65
+ export { cellGap, sceneCellSizes } from './shapes/cell-grid.ts';
66
+ export type { SceneTokenLabels, SceneTokenProps } from './shapes/scene-token.tsx';
67
+ export { SceneToken, sceneTokenLabels, tokenPercent } from './shapes/scene-token.tsx';
68
+ export type { SceneTokenItem, SceneTokensProps } from './shapes/scene-tokens.tsx';
69
+ export { SceneTokens } from './shapes/scene-tokens.tsx';
70
+ export type { TokenFlow, TokenGapName } from './shapes/token-layout.ts';
71
+ export { tokenBox, tokenFlow, tokenGaps } from './shapes/token-layout.ts';
72
+ export type { LessonFlowProps, SceneFlowLabels, SceneFlowProps } from './flow/scene-flow.tsx';
73
+ export { flowNodeSize, LessonFlow, SceneFlow, sceneFlowLabels } from './flow/scene-flow.tsx';
74
+ export type { FlowDirection, FlowPlan, FlowSlot } from './flow/flow-layout.ts';
75
+ export { flowPlan, flowPositions } from './flow/flow-layout.ts';
76
+ export type { MorphLabels, MorphScopeProps } from './morph/morph-scope.tsx';
77
+ export { morphLabels, MorphScope } from './morph/morph-scope.tsx';
@@ -0,0 +1,28 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../../charts/src/index.ts';
3
+ import type { Pace } from '../../time/tween.ts';
4
+ /** The words a morph shows that are not the author's content. */
5
+ export type MorphLabels = {
6
+ /** `{name}` is the figure `show` names, `{names}` the figures given. */
7
+ readonly unknownFigure: string;
8
+ };
9
+ export declare const morphLabels: {
10
+ readonly unknownFigure: 'MorphScope shows "{name}", which is not one of its figures: {names}.';
11
+ };
12
+ export type MorphScopeProps<Name extends string> = {
13
+ /** The figures by name. Each stays mounted and keeps its state while another is shown. */
14
+ readonly figures: Readonly<Record<Name, ReactNode>>;
15
+ /** The figure on screen. Change it and every thing both figures draw travels to its place in the new one. */
16
+ readonly show: Name;
17
+ /** How fast the figures trade places. Defaults to `slow`. Reduced motion swaps at once. */
18
+ readonly pace?: Pace | undefined;
19
+ /** The hue of each thing's travelling shape, by id. Left out, the tone scope's, or neutral. */
20
+ readonly tones?: Readonly<Record<string, ChartTone>> | undefined;
21
+ readonly labels?: Partial<MorphLabels> | undefined;
22
+ };
23
+ /**
24
+ * Two or more figures that show the same things, one at a time. When `show` changes, each thing drawn in both, matched
25
+ * by id, travels from its place in the old figure to its place in the new one while the figures cross-fade. Use it when
26
+ * a card becomes a bar, or a neuron a dot: the author names the figure to show and nothing else.
27
+ */
28
+ export declare function MorphScope<Name extends string>({ figures, show, pace, tones, labels: labelInput, }: MorphScopeProps<Name>): ReactNode;
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { SceneLayerName } from '../scene-layer.tsx';
3
+ /** Draws plane marks into one scene layer, faded to the part's own opacity. Nothing is drawn outside a scene. */
4
+ export declare function PlaneMarks({ id, layer, opacity, children, }: {
5
+ readonly id: string;
6
+ readonly layer: SceneLayerName;
7
+ readonly opacity: number;
8
+ readonly children: ReactNode;
9
+ }): ReactNode;
10
+ /**
11
+ * The part of a mark a pointer can reach and the keyboard cursor's dashed edge. A part with a label is an item the
12
+ * reader inspects, so its path takes pointer events; the cursor draws along the same path.
13
+ */
14
+ export declare function PlaneHit({ id, d, hasLabel, isCursor, reach, }: {
15
+ readonly id: string;
16
+ /** The SVG path of the mark. */
17
+ readonly d: string;
18
+ readonly hasLabel: boolean;
19
+ readonly isCursor: boolean;
20
+ /** `stroke` for a line, `fill` for a region. */
21
+ readonly reach?: 'stroke' | 'fill' | undefined;
22
+ }): ReactNode;
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { LabelObstacle, LabelSpot } from '../../../../charts/src/plot/index.ts';
3
+ /** The places a label may go around a mark at a position, in order of preference: beside it, then above or below. */
4
+ export declare function spotsAround({ x, y, text, }: {
5
+ readonly x: number;
6
+ readonly y: number;
7
+ readonly text: string;
8
+ }): ReadonlyArray<LabelSpot>;
9
+ /**
10
+ * A part's short text in the plot. It takes the first of `spots` that stays inside the plot and touches no other part
11
+ * and no label placed before it. Failing that, it takes the one that touches least.
12
+ */
13
+ export declare function PlaneLabel({ owner, name, spots, lines, isStrong, }: {
14
+ /** The id of the part the text belongs to. Its own lines are not avoided; pass the ones to avoid in `lines`. */
15
+ readonly owner: string;
16
+ /** Tells apart the labels of one part. */
17
+ readonly name: string;
18
+ /** Where the text may go, in order of preference. */
19
+ readonly spots: ReadonlyArray<LabelSpot>;
20
+ /** Extra lines to keep clear of, in plot pixels. A single point stands for a dot. */
21
+ readonly lines?: ReadonlyArray<ReadonlyArray<LabelObstacle>> | undefined;
22
+ readonly isStrong?: boolean | undefined;
23
+ }): ReactNode;
@@ -0,0 +1,42 @@
1
+ /** The words the plane parts show that are not the author's content. Placeholders in braces are filled in. */
2
+ export type ScenePlaneLabels = {
3
+ /** `{id}` names the curve. */
4
+ readonly curveSource: string;
5
+ /** `{id}` names the curve, `{limit}` is the most points one curve takes. */
6
+ readonly curveTooMany: string;
7
+ /** `{id}` names the curve. */
8
+ readonly curveOrder: string;
9
+ /** `{id}` names the curve and `{x}` the position where the function gave a value that is not a number. */
10
+ readonly curveValue: string;
11
+ /** `{id}` names the point. */
12
+ readonly pointLabel: string;
13
+ /** `{id}` names the point that sets lesson params outside any `Lesson`. */
14
+ readonly pointOutsideLesson: string;
15
+ /** `{id}` names the point, `{name}` the param and `{lesson}` the lesson that does not declare it as a number. */
16
+ readonly pointParam: string;
17
+ /** Added after a movable point's label in the readout. */
18
+ readonly pointMovable: string;
19
+ /** `{id}` names the region. */
20
+ readonly regionShape: string;
21
+ /** `{id}` names the rule. */
22
+ readonly ruleAxis: string;
23
+ /** `{id}` names the projection. */
24
+ readonly projectionSource: string;
25
+ /** `{kind}` and `{id}` name the part whose value is not a finite number. */
26
+ readonly notFinite: string;
27
+ };
28
+ /** The plain English defaults of `ScenePlaneLabels`. */
29
+ export declare const planeLabels: {
30
+ readonly curveSource: 'The curve "{id}" needs `points` or `of`, and not both.';
31
+ readonly curveTooMany: 'The curve "{id}" takes at most {limit} points. Pass fewer, or use `of`.';
32
+ readonly curveOrder: 'The curve "{id}" needs at least two points with strictly increasing x.';
33
+ readonly curveValue: 'The curve "{id}" gives a value that is not a number at x = {x}.';
34
+ readonly pointLabel: 'The point "{id}" can be moved, so it needs a `label` for the readout.';
35
+ readonly pointOutsideLesson: 'The point "{id}" sets lesson params, so it must be inside a Lesson.';
36
+ readonly pointParam: 'The point "{id}" sets "{name}", which lesson "{lesson}" does not declare as a number param.';
37
+ readonly pointMovable: ' Use the arrow keys to move it.';
38
+ readonly regionShape: 'The region "{id}" needs one of `between`, `above`, `below` or `points`.';
39
+ readonly ruleAxis: 'The rule "{id}" needs `x` or `y`, and not both.';
40
+ readonly projectionSource: 'The projection "{id}" needs `of` or `at`, and not both.';
41
+ readonly notFinite: 'The {kind} "{id}" has a value that is not a finite number.';
42
+ };
@@ -0,0 +1,45 @@
1
+ import type { NumericDomain } from '../../../../charts/src/index.ts';
2
+ import type { SceneDataPoint, ScenePosition } from '../scene-geometry.ts';
3
+ /** How many samples a function curve takes across the whole data box, by name. */
4
+ export declare const curveResolutions: {
5
+ readonly coarse: 60;
6
+ readonly regular: 160;
7
+ readonly fine: 400;
8
+ };
9
+ /** How finely a function curve is sampled. Use `fine` for a curve the camera zooms into. */
10
+ export type SceneCurveResolution = keyof typeof curveResolutions;
11
+ /** The most points one curve or polygon takes. Larger input shows an error. */
12
+ export declare const planeLimits: {
13
+ readonly curvePoints: 2000;
14
+ readonly polygonPoints: 200;
15
+ };
16
+ /** How thick a curve or vector is drawn. */
17
+ export type ScenePlaneThickness = 'thin' | 'regular' | 'thick';
18
+ /** The stroke width of each named thickness, in pixels. */
19
+ export declare const planeThicknesses: {
20
+ readonly thin: 1.25;
21
+ readonly regular: 1.75;
22
+ readonly thick: 3;
23
+ };
24
+ /** The scene's data box. */
25
+ export type DataBox = {
26
+ readonly x: NumericDomain;
27
+ readonly y: NumericDomain;
28
+ };
29
+ /** A value held between the two ends of a domain. A value that is not a number lands in the middle. */
30
+ export declare function insideDomain(value: number, domain: NumericDomain): number;
31
+ /** A position held inside the data box. */
32
+ export declare function insideBox(position: ScenePosition, box: DataBox): ScenePosition;
33
+ /** `count` evenly spaced values from one end of the domain to the other. */
34
+ export declare function gridXs(domain: NumericDomain, count: number): ReadonlyArray<number>;
35
+ /** The y of a polyline at `x`, holding the first and last values beyond its ends. Points increase in x. */
36
+ export declare function interpolateAt(points: ReadonlyArray<ScenePosition>, across: number): number;
37
+ /** The part of a sampled curve that lies between `from` and `to`, with a vertex exactly at each end. */
38
+ export declare function visibleRun({ xs, ys, from, to, }: {
39
+ readonly xs: ReadonlyArray<number>;
40
+ readonly ys: ReadonlyArray<number>;
41
+ readonly from: number;
42
+ readonly to: number;
43
+ }): ReadonlyArray<SceneDataPoint>;
44
+ /** The mean of a polygon's corners, which is a fair place for its name and for a keyboard cursor. */
45
+ export declare function centroid(corners: ReadonlyArray<SceneDataPoint>): SceneDataPoint;
@@ -0,0 +1,30 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ValueFormat } from '../../../../charts/src/index.ts';
3
+ import type { PlotGrid } from '../../../../charts/src/plot/index.ts';
4
+ /** One axis of the plane: its title, how its numbers are written, and where its ticks fall. */
5
+ export type SceneAxis = {
6
+ /** The axis title, with its unit: "Weight (kg)". Left out, the axis has no title. */
7
+ readonly label?: string | undefined;
8
+ /** How tick labels write a number. Defaults to at most two decimals. */
9
+ readonly format?: ValueFormat | undefined;
10
+ /** The values that get a tick. Left out, round values are chosen from the part of the box the camera shows. */
11
+ readonly ticks?: ReadonlyArray<number> | undefined;
12
+ };
13
+ export type SceneAxesProps = {
14
+ /** Defaults to `axes`. */
15
+ readonly id?: string | undefined;
16
+ /** The horizontal axis, along the bottom of the box. */
17
+ readonly x?: SceneAxis | undefined;
18
+ /** The vertical axis, along the left of the box. */
19
+ readonly y?: SceneAxis | undefined;
20
+ /** Which ticks draw a line across the plot. Defaults to `y`, horizontal lines, as in a chart. */
21
+ readonly grid?: PlotGrid | undefined;
22
+ /** False fades the axes out and gives their room back to the box. */
23
+ readonly isShown?: boolean | undefined;
24
+ };
25
+ /**
26
+ * The x and y axes of the scene's data box: ticks, titles and grid lines drawn with the parts a chart uses. The scene
27
+ * keeps room for the tick labels and titles beside the box, and the ticks follow the camera. Put it first in the
28
+ * scene.
29
+ */
30
+ export declare function SceneAxes({ id, x, y, grid, isShown }: SceneAxesProps): ReactNode;
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../../charts/src/index.ts';
3
+ import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
4
+ import type { Pace } from '../../time/tween.ts';
5
+ import type { ScenePosition } from '../scene-geometry.ts';
6
+ import type { ScenePlaneLabels } from './plane-labels.ts';
7
+ import type { SceneCurveResolution, ScenePlaneThickness } from './plane-math.ts';
8
+ export type SceneCurveProps = {
9
+ /** Stable across states: the curve with this id eases from its old shape to the new one. */
10
+ readonly id: string;
11
+ /** The curve as data: `[x, y]` pairs with strictly increasing x. Give this or `of`. */
12
+ readonly points?: ReadonlyArray<ScenePosition> | undefined;
13
+ /** The curve as a function of x, sampled across the scene's x range. Give this or `points`. */
14
+ readonly of?: ((across: number) => number) | undefined;
15
+ /** How many samples `of` takes. Defaults to `regular`. Samples are also how a curve eases between shapes. */
16
+ readonly resolution?: SceneCurveResolution | undefined;
17
+ /** The readout sentence. With one, the arrow keys reach the curve. */
18
+ readonly label?: string | undefined;
19
+ /** The hue that names the curve. Left out, the tone scope's tone for the id, or the first series hue. */
20
+ readonly tone?: ChartTone | undefined;
21
+ /** `context` draws the curve gray; the others yield to inspection. */
22
+ readonly emphasis?: MarkEmphasis | undefined;
23
+ /** Dashed for a curve that is modelled: a fit, a projection or a baseline. */
24
+ readonly isDashed?: boolean | undefined;
25
+ /** The stroke width by name. Defaults to `regular`. */
26
+ readonly thickness?: ScenePlaneThickness | undefined;
27
+ /** Fills the area between the curve and this y value with a pale wash of its tone. */
28
+ readonly fillTo?: number | undefined;
29
+ /** False fades the curve out and takes it out of the keyboard order. */
30
+ readonly isShown?: boolean | undefined;
31
+ /** True keeps the curve at full strength while the rest recede. */
32
+ readonly isActive?: boolean | undefined;
33
+ /** Overrides the scene's pace for this curve. */
34
+ readonly pace?: Pace | undefined;
35
+ readonly labels?: Partial<ScenePlaneLabels> | undefined;
36
+ };
37
+ /**
38
+ * A curve in the scene's data box, from points or from a function of x: a function a lesson explains, a loss, a fit.
39
+ * Give it new points or a new function and it eases from the old shape to the new one. Wires and callouts that name it
40
+ * attach at its middle.
41
+ */
42
+ export declare function SceneCurve({ id, points, of, resolution, label, tone, emphasis, isDashed, thickness, fillTo, isShown, isActive, pace, labels: labelInput, }: SceneCurveProps): ReactNode;
@@ -0,0 +1,59 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../../charts/src/index.ts';
3
+ import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
4
+ import type { Pace } from '../../time/tween.ts';
5
+ import type { ScenePosition } from '../scene-geometry.ts';
6
+ import type { ScenePlaneLabels } from './plane-labels.ts';
7
+ /** Why a point moved: a pointer drag, or an arrow key. A cancelled drag reports `drag` with the starting position. */
8
+ export type ScenePointMoveDetails = {
9
+ readonly reason: 'drag' | 'step-key';
10
+ readonly event: PointerEvent | KeyboardEvent;
11
+ };
12
+ /** What a movable point keeps fixed: `x` moves it along x only, `y` along y only, a function along that curve. */
13
+ export type ScenePointAlong = 'x' | 'y' | ((across: number) => number);
14
+ /** The number params of the nearest `Lesson` a moved point writes: its x position to one, its y position to another. */
15
+ export type ScenePointSets = {
16
+ readonly x?: string | undefined;
17
+ readonly y?: string | undefined;
18
+ };
19
+ export type ScenePointProps = {
20
+ /** Stable across states: the point with this id eases to its new position. */
21
+ readonly id: string;
22
+ /** The point's position, in the scene's data units. Wires, callouts and projections attach to it. */
23
+ readonly at: ScenePosition;
24
+ /** The readout sentence. With one, the arrow keys reach the point. Required when the point can move. */
25
+ readonly label?: string | undefined;
26
+ /** Short text beside the point, placed where it touches no curve. */
27
+ readonly text?: string | undefined;
28
+ /** The hue that names the point. Left out, the tone scope's tone for the id, or the first series hue. */
29
+ readonly tone?: ChartTone | undefined;
30
+ /** `context` draws the point gray; the others yield to inspection. */
31
+ readonly emphasis?: MarkEmphasis | undefined;
32
+ /** False fades the point out and takes it out of the keyboard order. */
33
+ readonly isShown?: boolean | undefined;
34
+ /** True keeps the point and what attaches to it at full strength while the rest recede. */
35
+ readonly isActive?: boolean | undefined;
36
+ /**
37
+ * Makes the point movable by a pointer and by the arrow keys when it is the keyboard cursor. It is told where the
38
+ * reader wants the point; the point stays where `at` says until the application moves it.
39
+ */
40
+ readonly onMove?: ((position: ScenePosition, details: ScenePointMoveDetails) => void) | undefined;
41
+ /**
42
+ * Makes the point movable and names the lesson number params its position writes, as `{ x: 'weight' }`. A move sets
43
+ * them in one change, on each param's step grid and inside its range; `at` stays the author's, read from the lesson.
44
+ */
45
+ readonly sets?: ScenePointSets | undefined;
46
+ /** The step, in data units, that a moved point lands on along each axis it moves. A bound axis takes its param's. */
47
+ readonly snap?: number | undefined;
48
+ /** Limits the movement. Left out, a point bound on one axis moves along it, and any other moves freely in the box. */
49
+ readonly along?: ScenePointAlong | undefined;
50
+ /** Overrides the scene's pace for this point. A drag always follows the pointer at once. */
51
+ readonly pace?: Pace | undefined;
52
+ readonly labels?: Partial<ScenePlaneLabels> | undefined;
53
+ };
54
+ /**
55
+ * A point at a position in the scene, with optional text beside it. Give it `sets` or `onMove` and the reader grabs it
56
+ * with a pointer, or moves it with the arrow keys while it is the keyboard cursor. It follows the pointer at once and
57
+ * eases only when the application moves it.
58
+ */
59
+ export declare function ScenePoint({ id, at, label, text, tone, emphasis, isShown, isActive, onMove, sets, snap, along, pace, labels: labelInput, }: ScenePointProps): ReactNode;