@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,67 @@
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 { SceneOffset, ScenePosition, SceneShape, SceneSize } from './scene-geometry.ts';
6
+ import type { SceneDelay, SceneStaggerPlace } from './scene-stagger.ts';
7
+ export type SceneNodeProps = {
8
+ /** Stable across states: the node with this id eases to its new props. */
9
+ readonly id: string;
10
+ /** The node's center, in the scene's data units. */
11
+ readonly at: ScenePosition;
12
+ /** A shift from `at` in pixels, across then down, for a node placed beside another rather than in data units. */
13
+ readonly offset?: SceneOffset | undefined;
14
+ /** The full sentence for the readout and assistive technology. With one, the arrow keys reach the node. */
15
+ readonly label?: string | undefined;
16
+ /** What the node shows. Cut with an ellipsis when it does not fit; the label keeps the full text. */
17
+ readonly text?: string | undefined;
18
+ /** True for token text, code or an id: drawn in monospace. Names use the body face. */
19
+ readonly isCode?: boolean | undefined;
20
+ /** A named size or a pixel box. Defaults to `medium`. */
21
+ readonly size?: SceneSize | undefined;
22
+ /** The outline: `box`, `pill`, `circle` or `plain` text. Defaults to `box`; wires meet it at its edge. */
23
+ readonly shape?: SceneShape | undefined;
24
+ /** The hue that names the thing. Left out, the tone scope's tone for the id, or neutral. */
25
+ readonly tone?: ChartTone | undefined;
26
+ /** `context` draws the node gray; the others yield to inspection. */
27
+ readonly emphasis?: MarkEmphasis | undefined;
28
+ /** False fades the node out and takes it out of the keyboard order. Its content keeps its state. */
29
+ readonly isShown?: boolean | undefined;
30
+ /** True keeps the node at full strength while the parts it is not connected to recede. */
31
+ readonly isActive?: boolean | undefined;
32
+ /** 0 shows the front, 1 the back; values between are mid-flip. */
33
+ readonly turn?: number | undefined;
34
+ /** 0 rests on the page, 1 is raised toward the reader: larger, with a deeper shadow. */
35
+ readonly lift?: number | undefined;
36
+ /** Degrees of tilt around the horizontal axis; positive leans the top away. */
37
+ readonly tilt?: number | undefined;
38
+ /** Degrees of turn in the page around the node's center; positive turns clockwise, as one card of a fan. */
39
+ readonly rotate?: number | undefined;
40
+ /** The stacking order: higher draws above. A lifted node draws above every resting one. Defaults to 0. */
41
+ readonly order?: number | undefined;
42
+ /** How long every change waits before the node moves. Defaults to 0. */
43
+ readonly delay?: SceneDelay | undefined;
44
+ /**
45
+ * The node's place in a stagger group. Nodes of one group that change in the same update start one step apart in
46
+ * `index` order, and a node that changes alone starts at once.
47
+ */
48
+ readonly stagger?: SceneStaggerPlace | undefined;
49
+ /** Overrides the scene's pace for this node. */
50
+ readonly pace?: Pace | undefined;
51
+ /**
52
+ * True draws the node without making room for it: the scene's margins and derived minimum width leave it out. Use it
53
+ * for a node another part makes room for, as a stack does for its cards.
54
+ */
55
+ readonly isFloating?: boolean | undefined;
56
+ /** The other face, shown as the node turns. */
57
+ readonly back?: ReactNode;
58
+ /** The hue of the back face. Left out, the node's own; a playing card passes neutral so its back hides the suit. */
59
+ readonly backTone?: ChartTone | undefined;
60
+ /** Rich content under the text, such as a compact chart. It keeps its state while the node moves or resizes. */
61
+ readonly children?: ReactNode;
62
+ };
63
+ /**
64
+ * A labelled box, pill or circle at a position in the scene, with optional rich content and a back face. Change its
65
+ * props and it eases there: it moves, resizes, turns, lifts, tilts and rotates. Wires attach to its edge.
66
+ */
67
+ export declare function SceneNode({ id, at, offset, label, text, isCode, size, shape, tone, emphasis, isShown, isActive, turn, lift, tilt, rotate, order, delay, stagger, pace, isFloating, back, backTone, children, }: SceneNodeProps): ReactNode;
@@ -0,0 +1,27 @@
1
+ import type { LabelObstacle, LabelSpot } from '../../../charts/src/plot/index.ts';
2
+ import type { SceneDataPoint, ScenePixel, SceneRect } from './scene-geometry.ts';
3
+ /** Tells the scene's labels where this line runs, so none sits on it. Call it from a part that draws a line or dot. */
4
+ export declare function useObstacle({ id, line }: {
5
+ readonly id: string;
6
+ readonly line: ReadonlyArray<SceneDataPoint>;
7
+ }): void;
8
+ /**
9
+ * The lines other parts registered, in plot pixels as the camera shows them now, leaving out those of `owner`. A part's
10
+ * text and a callout keep clear of them.
11
+ */
12
+ export declare function useObstacleLines(owner: string | undefined): ReadonlyArray<ReadonlyArray<ScenePixel>>;
13
+ /** The boxes of the text placed before this claim, which it keeps clear of. A claim's place is its first render. */
14
+ export declare function useTakenBoxes(id: string): ReadonlyArray<SceneRect>;
15
+ /** Claims `box` for this text, so the labels and callouts placed after it keep clear of it. Null claims nothing. */
16
+ export declare function useClaimedBox(id: string, box: SceneRect | null): void;
17
+ /** Where a part's text goes, and the claim that keeps later labels off it. */
18
+ export declare function usePlacedLabel({ id, owner, spots, lines, }: {
19
+ /** Names this label among all the scene's labels. */
20
+ readonly id: string;
21
+ /** The id of the part the text belongs to. Its own registered lines are not avoided. */
22
+ readonly owner: string;
23
+ /** Where the text may go, in order of preference. */
24
+ readonly spots: ReadonlyArray<LabelSpot>;
25
+ /** Extra lines to keep clear of, in plot pixels. */
26
+ readonly lines: ReadonlyArray<ReadonlyArray<LabelObstacle>>;
27
+ }): LabelSpot | undefined;
@@ -0,0 +1,79 @@
1
+ import type { SceneFrame, SceneMargins, SceneShape } from './scene-geometry.ts';
2
+ /**
3
+ * The eased numbers every scene object has: its center in data units, its pixel shift from there (`dx` across, `dy`
4
+ * down), its pixel size, and how visible it is.
5
+ */
6
+ export type SceneFrameKey = 'x' | 'y' | 'dx' | 'dy' | 'width' | 'height' | 'opacity';
7
+ /** One object's geometry as it is on screen in this frame. */
8
+ export type SceneFrameValues = Readonly<Record<SceneFrameKey, number>>;
9
+ /** Read access to one object's animated geometry, for the parts that follow it, such as wires and groups. */
10
+ export type SceneTrack = {
11
+ /** The geometry on screen now. The same object is returned until a frame changes it. */
12
+ readonly get: () => SceneFrameValues;
13
+ readonly subscribe: (listener: () => void) => () => void;
14
+ };
15
+ /** What the scene knows about one registered object. It changes when the object's props do, never per frame. */
16
+ export type SceneMember = {
17
+ readonly id: string;
18
+ /** The part that registered it, such as `node` or `wire`. Later parts add their own kinds. */
19
+ readonly kind: string;
20
+ /** The readout sentence. An object with a label is an item the reader steps through with the arrow keys. */
21
+ readonly label: string | undefined;
22
+ readonly shape: SceneShape;
23
+ /** The target frame, or undefined for an object placed by others, such as a wire between two nodes. */
24
+ readonly frame: SceneFrame | undefined;
25
+ /** True when the frame only draws: the scene's margins and derived minimum width leave it out. */
26
+ readonly isFloating: boolean;
27
+ /** The room the object needs outside the data box, such as an axis's tick labels. */
28
+ readonly margins: SceneMargins | undefined;
29
+ /** The stacking order: higher draws above, and comes later among the keyboard items that share one place. */
30
+ readonly order: number;
31
+ /** The ids this object attaches to: a wire's ends, a group's members, a callout's target. Each must exist. */
32
+ readonly attaches: ReadonlyArray<string>;
33
+ /** The pixels an object that joins two others keeps between them, such as a wire's room for its text. */
34
+ readonly room: number | undefined;
35
+ /** What the object draws around the objects it attaches to, such as a group's outline and name. */
36
+ readonly surround: SceneMargins | undefined;
37
+ readonly isShown: boolean;
38
+ readonly isActive: boolean;
39
+ /** Why the object's own input cannot be drawn, in a sentence naming it. The scene shows it as invalid. */
40
+ readonly problem: string | undefined;
41
+ readonly track: SceneTrack;
42
+ };
43
+ /** Every registered object in registration order, and the ids that more than one object claimed. */
44
+ export type SceneMembers = {
45
+ readonly list: ReadonlyArray<SceneMember>;
46
+ readonly duplicates: ReadonlyArray<string>;
47
+ };
48
+ /**
49
+ * The shared record of a scene's objects. Parts register through `useSceneObject`; a part that follows others, such as
50
+ * a wire, looks them up with `member` and subscribes to their `track`.
51
+ */
52
+ export type SceneRegistry = {
53
+ readonly members: () => SceneMembers;
54
+ /** Hears every change to the membership: an object added, removed, or given new props. */
55
+ readonly subscribe: (listener: () => void) => () => void;
56
+ readonly member: (id: string) => SceneMember | undefined;
57
+ /** Adds or updates `member` for `owner`. A second owner of the same id is recorded as a duplicate. */
58
+ readonly upsert: (owner: object, member: SceneMember) => void;
59
+ readonly remove: (owner: object, id: string) => void;
60
+ /** Whether the scene has painted once. Objects registered later fade in. */
61
+ readonly isPainted: () => boolean;
62
+ readonly markPainted: () => void;
63
+ /**
64
+ * Records an object during the scene's first render, before any is registered, so `member` finds it for the parts
65
+ * rendered after it. That is how the server draws wires and groups at their target geometry.
66
+ */
67
+ readonly draft: (member: SceneMember) => void;
68
+ /** Whether the scene is still in its first render, so `member` answers from the drafts. */
69
+ readonly isDrafting: () => boolean;
70
+ /** Forgets the drafts once the scene has mounted and its objects are registered. */
71
+ readonly endDrafts: () => void;
72
+ };
73
+ /** Makes an empty registry. `Scene` makes one for itself; a part outside any scene gets a detached one. */
74
+ export declare function createSceneRegistry(): SceneRegistry;
75
+ /**
76
+ * Makes a store that each scene keeps for one kind of part, such as the stacks cards read their places from. The
77
+ * returned function gives a scene's store, made on first use and kept while the scene's registry lives.
78
+ */
79
+ export declare function sceneStore<Store extends object>(create: () => Store): (registry: SceneRegistry) => Store;
@@ -0,0 +1,43 @@
1
+ /** The steps of a stagger by name, in milliseconds. */
2
+ export declare const sceneStaggers: {
3
+ readonly short: 60;
4
+ readonly regular: 120;
5
+ readonly long: 240;
6
+ };
7
+ /** A named stagger step. */
8
+ export type SceneStagger = keyof typeof sceneStaggers;
9
+ /**
10
+ * How long a change waits on the shared clock before the object starts to move: milliseconds, or a place in a stagger,
11
+ * where `{ index: 2, step: 'regular' }` waits two regular steps. Reduced motion and the `instant` pace never wait.
12
+ */
13
+ export type SceneDelay = number | {
14
+ readonly index: number;
15
+ readonly step?: SceneStagger | undefined;
16
+ };
17
+ /**
18
+ * An object's place in a stagger group. When several members of one group change in the same update, they start one
19
+ * step apart in `index` order; a member that changes alone starts at once.
20
+ */
21
+ export type SceneStaggerPlace = {
22
+ /** Names the group. A stack's cards use the stack's id. */
23
+ readonly group: string;
24
+ /** The place in the group's order: lower starts first. */
25
+ readonly index: number;
26
+ /** The wait between two members that start one after another. Defaults to `regular`. */
27
+ readonly step?: SceneStagger | undefined;
28
+ };
29
+ /** The milliseconds a delay waits. */
30
+ export declare function delayOf(delay: SceneDelay): number;
31
+ type Entry = {
32
+ readonly place: SceneStaggerPlace;
33
+ /** Starts the member's move after `wait` milliseconds of stagger. */
34
+ readonly begin: (wait: number) => void;
35
+ };
36
+ /** The members of each group that changed in the update being committed, started together once it is committed. */
37
+ type Staggers = {
38
+ /** Adds a changed member to this update's batch of its group. Returns the function that takes it out again. */
39
+ readonly join: (entry: Entry) => () => void;
40
+ };
41
+ /** The stagger batches of a scene. Every member's layout effect in one commit runs before the batch starts. */
42
+ export declare const staggersOf: (registry: import("./scene-registry.ts").SceneRegistry) => Staggers;
43
+ export {};
@@ -0,0 +1,14 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ /** The gray of an object drawn as context, which stays visible on a dark surface. */
3
+ export declare const sceneContextColor: string;
4
+ /** Which of the scene's inspection marks an object shows now. */
5
+ export type SceneOutlineState = {
6
+ readonly isInspected: boolean;
7
+ readonly isSelected: boolean;
8
+ readonly isCursor: boolean;
9
+ };
10
+ /**
11
+ * The outlines an object drawn in HTML shows for inspection: thin while inspected, thick while selected, and a dashed
12
+ * ring while the keyboard cursor rests on it. Every HTML part draws them alike, so a card reads like a node.
13
+ */
14
+ export declare function sceneOutlines({ isInspected, isSelected, isCursor, }: SceneOutlineState): ReadonlyArray<stylex.StyleXStyles | false>;
@@ -0,0 +1,65 @@
1
+ import type { NumericDomain } from '../../../charts/src/index.ts';
2
+ import type { SceneMembers } from './scene-registry.ts';
3
+ /** The words a scene shows that are not the author's content. Placeholders in braces are filled in. */
4
+ export type SceneLabels = {
5
+ /** What the arrow keys step through, for the plot's accessible name. */
6
+ readonly objects: string;
7
+ /** The header of the exact-value table. */
8
+ readonly objectColumn: string;
9
+ readonly missingLocale: string;
10
+ readonly invalidBox: string;
11
+ readonly invalidAspect: string;
12
+ /** `{limit}` is the most objects a scene draws. */
13
+ readonly tooMany: string;
14
+ /** `{id}` is the shared id. */
15
+ readonly duplicateId: string;
16
+ /** `{kind}` and `{id}` name the object, `{target}` the id it names. */
17
+ readonly unknownId: string;
18
+ /** `{kind}` and `{id}` name the object. */
19
+ readonly outsideBox: string;
20
+ /** `{id}` is the id the focus names. */
21
+ readonly unknownFocus: string;
22
+ /** `{id}` names the wire, `{weight}` its weight and `{limit}` the scene's `weightMax`. */
23
+ readonly weightOutside: string;
24
+ /** `{part}` names a part rendered outside any scene. */
25
+ readonly outside: string;
26
+ };
27
+ /** The plain English defaults of `SceneLabels`. */
28
+ export declare const sceneLabels: {
29
+ readonly objects: 'diagram parts';
30
+ readonly objectColumn: 'Part';
31
+ readonly missingLocale: 'This scene needs a locale. Pass `locale`, or place it inside a Lesson.';
32
+ readonly invalidBox: 'The scene box needs two finite, increasing values on each axis.';
33
+ readonly invalidAspect: 'The scene aspect must be a positive, finite ratio of width to height.';
34
+ readonly tooMany: 'This scene draws at most {limit} objects. Show fewer, or group them.';
35
+ readonly duplicateId: 'Two scene objects share the id "{id}". Give each its own id.';
36
+ readonly unknownId: 'The {kind} "{id}" attaches to "{target}", which no object in this scene has.';
37
+ readonly outsideBox: 'The {kind} "{id}" sits outside the scene box.';
38
+ readonly unknownFocus: 'The focus names "{id}", which no object in this scene has.';
39
+ readonly weightOutside: 'The wire "{id}" has weight {weight}, outside the scene\'s weight limit of plus or minus {limit}.';
40
+ readonly outside: '{part} must be inside a Scene.';
41
+ };
42
+ /** The most objects one scene draws. Larger input shows an error; the author groups or splits the diagram. */
43
+ export declare const sceneLimits: {
44
+ readonly objects: 1200;
45
+ };
46
+ /** A label with its `{name}` placeholders filled in. */
47
+ export declare function fillLabel(template: string, values: Readonly<Record<string, string>>): string;
48
+ type Box = {
49
+ readonly x: NumericDomain;
50
+ readonly y: NumericDomain;
51
+ };
52
+ /** Why the scene's own props cannot be drawn, or undefined when they can. */
53
+ export declare function sceneBoxError({ box, aspect, labels, }: {
54
+ readonly box: Box;
55
+ readonly aspect: number | undefined;
56
+ readonly labels: SceneLabels;
57
+ }): string | undefined;
58
+ /** The first problem among the registered objects, as a sentence naming the object, or undefined. */
59
+ export declare function membersError({ members, focus, box, labels, }: {
60
+ readonly members: SceneMembers;
61
+ readonly focus: ReadonlyArray<string>;
62
+ readonly box: Box;
63
+ readonly labels: SceneLabels;
64
+ }): string | undefined;
65
+ export {};
@@ -0,0 +1,45 @@
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
+ /** How a wire runs: straight between edges, or a curve or elbow leaving the sides that face each other. */
5
+ export type SceneWireShape = 'straight' | 'curve' | 'elbow';
6
+ /**
7
+ * The side of the wire its text sits on. `auto` puts it above a wire that runs across and right of one that runs up or
8
+ * down. A side along the wire, such as `left` of a level wire, falls back to `auto`.
9
+ */
10
+ export type SceneWireTextSide = 'auto' | 'top' | 'right' | 'bottom' | 'left';
11
+ export type SceneWireProps = {
12
+ /** The id of the object the wire leaves. */
13
+ readonly from: string;
14
+ /** The id of the object the wire reaches. */
15
+ readonly to: string;
16
+ /** Defaults to `from>to`. */
17
+ readonly id?: string | undefined;
18
+ /** The readout sentence. With one, the arrow keys reach the wire. */
19
+ readonly label?: string | undefined;
20
+ /** Short text drawn beside the wire's middle, never on its stroke, such as its weight. */
21
+ readonly text?: string | undefined;
22
+ /** The side of the wire the text sits on. Defaults to `auto`. */
23
+ readonly textSide?: SceneWireTextSide | undefined;
24
+ /** A signed weight: thickness shows its size and, without a tone, hue its sign. */
25
+ readonly weight?: number | undefined;
26
+ /** The hue that names the connection. Left out, the weight's sign or neutral ink. */
27
+ readonly tone?: ChartTone | undefined;
28
+ /** How the wire runs between its ends. Defaults to `straight`. */
29
+ readonly shape?: SceneWireShape | undefined;
30
+ /** Dashed for a modelled or proposed connection. */
31
+ readonly isDashed?: boolean | undefined;
32
+ /** Draws an arrowhead at the `to` end. Defaults to true. */
33
+ readonly hasArrow?: boolean | undefined;
34
+ /** False fades the wire out and takes it out of the keyboard order. */
35
+ readonly isShown?: boolean | undefined;
36
+ /** True keeps the wire and its ends at full strength while the rest recede. */
37
+ readonly isActive?: boolean | undefined;
38
+ /** `context` draws the wire gray; the others yield to inspection. */
39
+ readonly emphasis?: MarkEmphasis | undefined;
40
+ };
41
+ /**
42
+ * A connection between two scene objects that stays attached to their edges while they move. Its thickness can carry a
43
+ * signed weight, eased when the weight changes. Give it a label to make it an item the reader can inspect.
44
+ */
45
+ export declare function SceneWire({ from, to, id, label, text, textSide, weight, tone, shape, isDashed, hasArrow, isShown, isActive, emphasis, }: SceneWireProps): ReactNode;
@@ -0,0 +1,36 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FigureProps, FigureSelectionProps, NumericDomain, PlotHeight } from '../../../charts/src/index.ts';
3
+ import type { Pace } from '../time/tween.ts';
4
+ import type { SceneLabels } from './scene-validate.ts';
5
+ export type SceneProps = Omit<FigureProps, 'locale'> & FigureSelectionProps & {
6
+ /** The locale of every number in the figure. Left out, the nearest `Lesson`'s locale is used. */
7
+ readonly locale?: string | undefined;
8
+ /** The data box's horizontal extent. Object positions are in these units. */
9
+ readonly x: NumericDomain;
10
+ /** The data box's vertical extent. y grows upward, as on a chart. */
11
+ readonly y: NumericDomain;
12
+ /** The plot height by name. Ignored when `aspect` is set. */
13
+ readonly height?: PlotHeight | undefined;
14
+ /** The plot's width divided by its height, for a scene that keeps its proportions as it narrows. */
15
+ readonly aspect?: number | undefined;
16
+ /** The camera: the ids to zoom to, with room around them. Null or absent shows the whole box. */
17
+ readonly focus?: string | ReadonlyArray<string> | null | undefined;
18
+ /** How fast changes ease. Reduced motion always jumps. */
19
+ readonly pace?: Pace | undefined;
20
+ /**
21
+ * The narrowest plot in pixels; below it the plot scrolls inside the frame. Left out, it is the width at which no
22
+ * two objects on the same row touch. Set it only to keep more room than the objects need.
23
+ */
24
+ readonly minWidth?: number | undefined;
25
+ /** The wire weight magnitude drawn thickest. Weights must lie within plus or minus this. Defaults to 1. */
26
+ readonly weightMax?: number | undefined;
27
+ readonly labels?: Partial<SceneLabels> | undefined;
28
+ /** The scene parts: `SceneNode`, `SceneWire`, `SceneGroup` and the rest, or components that render them. */
29
+ readonly children?: ReactNode;
30
+ };
31
+ /**
32
+ * A diagram with identity: nodes, wires, groups and notes placed in a data box, which move by themselves when their
33
+ * props change. Authors describe each state; the scene eases between them, and a reader steps through labelled parts
34
+ * with the arrow keys as in any chart. Use it for computation graphs, networks and other explanatory diagrams.
35
+ */
36
+ export declare function Scene(props: SceneProps): ReactNode;
@@ -0,0 +1,11 @@
1
+ import type { NumericDomain } from '../../../../charts/src/index.ts';
2
+ import type { HeatmapPalette } from '../../../../charts/src/matrix/index.ts';
3
+ /**
4
+ * The fill of a cell, from the heatmap charts' own scale: lightness of one hue for a magnitude, or two hues around zero
5
+ * for a signed value. A grid with no palette, a value outside the domain, or a cell with no value gets no fill.
6
+ */
7
+ export declare function cellFill({ value, palette, domain, }: {
8
+ readonly value: number | undefined;
9
+ readonly palette: HeatmapPalette | undefined;
10
+ readonly domain: NumericDomain;
11
+ }): string | undefined;
@@ -0,0 +1,69 @@
1
+ import type { NumericDomain } from '../../../../charts/src/index.ts';
2
+ import type { HeatmapPalette } from '../../../../charts/src/matrix/index.ts';
3
+ import type { SceneOffset } from '../scene-geometry.ts';
4
+ /** The pixel boxes of the named cell sizes. */
5
+ export declare const sceneCellSizes: {
6
+ readonly small: {
7
+ readonly width: 40;
8
+ readonly height: 28;
9
+ };
10
+ readonly medium: {
11
+ readonly width: 56;
12
+ readonly height: 36;
13
+ };
14
+ readonly large: {
15
+ readonly width: 76;
16
+ readonly height: 46;
17
+ };
18
+ };
19
+ /** A named cell size. */
20
+ export type SceneCellSizeName = keyof typeof sceneCellSizes;
21
+ /** The pixels between neighbouring cells. */
22
+ export declare const cellGap = 2;
23
+ /** One cell as the author describes it. */
24
+ export type SceneCellInput = {
25
+ /** Overrides the cell's id, `${grid id}.${row}.${column}`, for a cell whose identity must survive a reorder. */
26
+ readonly id?: string | undefined;
27
+ /** What the cell shows instead of its formatted value, such as a word or a symbol. */
28
+ readonly text?: string | undefined;
29
+ /** The cell's number. It eases when it changes, and it sets the cell's color. */
30
+ readonly value?: number | undefined;
31
+ /** The readout sentence. Left out, the cell says its row, column and value. */
32
+ readonly label?: string | undefined;
33
+ };
34
+ /** The numbers of a vector or a matrix: a flat list, or a list of rows. */
35
+ export type SceneCellValues = ReadonlyArray<number | ReadonlyArray<number>>;
36
+ /** Which way a flat list of values runs. */
37
+ export type SceneCellsDirection = 'row' | 'column';
38
+ /** The grid of cells an author described: rows of cells. A flat list of values becomes one row, or one column. */
39
+ export declare function cellGrid({ values, cells, direction, }: {
40
+ readonly values: SceneCellValues | undefined;
41
+ readonly cells: ReadonlyArray<ReadonlyArray<SceneCellInput>> | undefined;
42
+ readonly direction: SceneCellsDirection;
43
+ }): ReadonlyArray<ReadonlyArray<SceneCellInput>>;
44
+ /** The pixel box of a grid of `rows` by `columns` cells. */
45
+ export declare function cellsExtent({ rows, columns, size, }: {
46
+ readonly rows: number;
47
+ readonly columns: number;
48
+ readonly size: SceneCellSizeName;
49
+ }): {
50
+ readonly width: number;
51
+ readonly height: number;
52
+ };
53
+ /** A cell's center as a shift in pixels from the grid's center: across to the right, then down. */
54
+ export declare function cellOffset({ row, column, rows, columns, size, }: {
55
+ readonly row: number;
56
+ readonly column: number;
57
+ readonly rows: number;
58
+ readonly columns: number;
59
+ readonly size: SceneCellSizeName;
60
+ }): SceneOffset;
61
+ /**
62
+ * The values the color scale spans: the one the author gave, or zero to the largest magnitude, or its mirror for a
63
+ * diverging palette.
64
+ */
65
+ export declare function cellsDomain({ grid, palette, domain, }: {
66
+ readonly grid: ReadonlyArray<ReadonlyArray<SceneCellInput>>;
67
+ readonly palette: HeatmapPalette | undefined;
68
+ readonly domain: NumericDomain | undefined;
69
+ }): NumericDomain;
@@ -0,0 +1,114 @@
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 { SceneOffset, ScenePosition } from '../scene-geometry.ts';
6
+ import type { SceneDelay } from '../scene-stagger.ts';
7
+ import type { SceneCardSizeName } from './stack-layout.ts';
8
+ /** The ranks of a playing card, lowest first with the ace first. */
9
+ export declare const cardRanks: readonly ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];
10
+ /** A playing card's rank. */
11
+ export type CardRank = (typeof cardRanks)[number];
12
+ /** The four suits of a playing card. */
13
+ export declare const cardSuits: readonly ['heart', 'diamond', 'spade', 'club'];
14
+ /** A playing card's suit. */
15
+ export type CardSuit = (typeof cardSuits)[number];
16
+ /** The words a card speaks that are not the author's content. `{rank}`, `{suit}` and `{name}` are filled in. */
17
+ export type SceneCardLabels = {
18
+ readonly ranks: Readonly<Record<CardRank, string>>;
19
+ readonly suits: Readonly<Record<CardSuit, string>>;
20
+ /** The card's name for the readout, such as "Queen of Hearts". */
21
+ readonly name: string;
22
+ /** The readout of a face-down card. `{name}` is its name; the default leaves it out to keep the card secret. */
23
+ readonly faceDown: string;
24
+ /** `{id}` is the card that has no place. */
25
+ readonly noPlace: string;
26
+ };
27
+ /** The plain English words of a card. */
28
+ export declare const sceneCardLabels: {
29
+ readonly ranks: {
30
+ readonly A: 'Ace';
31
+ readonly '2': '2';
32
+ readonly '3': '3';
33
+ readonly '4': '4';
34
+ readonly '5': '5';
35
+ readonly '6': '6';
36
+ readonly '7': '7';
37
+ readonly '8': '8';
38
+ readonly '9': '9';
39
+ readonly '10': '10';
40
+ readonly J: 'Jack';
41
+ readonly Q: 'Queen';
42
+ readonly K: 'King';
43
+ };
44
+ readonly suits: {
45
+ readonly heart: 'Hearts';
46
+ readonly diamond: 'Diamonds';
47
+ readonly spade: 'Spades';
48
+ readonly club: 'Clubs';
49
+ };
50
+ readonly name: '{rank} of {suit}';
51
+ readonly faceDown: 'A card, face down';
52
+ readonly noPlace: 'The card "{id}" has no place. Give it `at`, or list it in a SceneStack declared before it.';
53
+ };
54
+ /** The tone a suit takes when neither the card nor the tone scope names one. */
55
+ export declare const suitTones: Readonly<Record<CardSuit, ChartTone>>;
56
+ export type SceneCardProps = {
57
+ /** Stable across states: the card with this id moves, turns and lifts to its new props. */
58
+ readonly id: string;
59
+ /** The card's center in data units. Left out, a `SceneStack` that lists the card places it. */
60
+ readonly at?: ScenePosition | undefined;
61
+ /** A shift from `at` in pixels, for hand placement. Ignored while a stack places the card. */
62
+ readonly offset?: SceneOffset | undefined;
63
+ /** Degrees of turn in the page, for hand placement. Ignored while a stack places the card. */
64
+ readonly rotate?: number | undefined;
65
+ /** With `suit`, a playing card: the corners and the center show them. */
66
+ readonly rank?: CardRank | undefined;
67
+ readonly suit?: CardSuit | undefined;
68
+ /** What a generic card shows in its center: a word, a symbol or a number. */
69
+ readonly text?: string | undefined;
70
+ /** The readout sentence. Left out, a playing card says its name, such as "Queen of Hearts". */
71
+ readonly label?: string | undefined;
72
+ /** False turns the card over, easing through a mid-turn. Defaults to true. */
73
+ readonly isFaceUp?: boolean | undefined;
74
+ /** 0 rests on the table, 1 is raised toward the reader. */
75
+ readonly lift?: number | undefined;
76
+ /** Degrees of lean around the horizontal axis. */
77
+ readonly tilt?: number | undefined;
78
+ /** The fixed pixel box in card proportions. A stack's size wins while it places the card. Defaults to `medium`. */
79
+ readonly size?: SceneCardSizeName | undefined;
80
+ /**
81
+ * The hue that names the card. Left out: the tone scope's tone for the card's id, then for its suit, then the suit's
82
+ * own.
83
+ */
84
+ readonly tone?: ChartTone | undefined;
85
+ /** `context` draws the card gray; the others yield to inspection, so a card recedes like any node. */
86
+ readonly emphasis?: MarkEmphasis | undefined;
87
+ /** False fades the card out and takes it out of the keyboard order. */
88
+ readonly isShown?: boolean | undefined;
89
+ /** True keeps the card at full strength while the rest recede. */
90
+ readonly isActive?: boolean | undefined;
91
+ /** The other face. Left out, a lattice in the card's tone; a playing card's is neutral so it hides the suit. */
92
+ readonly back?: ReactNode;
93
+ /**
94
+ * More on the face: for a playing card it replaces the big suit in the center, for a generic card it sits under the
95
+ * text.
96
+ */
97
+ readonly children?: ReactNode;
98
+ /**
99
+ * The stacking order. Left out, a stacked card draws above the cards under it, and a spread card above every pile, so
100
+ * a dealt card travels over the deck.
101
+ */
102
+ readonly order?: number | undefined;
103
+ /** How long every change waits before the card moves. Prefer the stack's `stagger` to deal cards in turn. */
104
+ readonly delay?: SceneDelay | undefined;
105
+ /** Overrides the scene's pace for this card. */
106
+ readonly pace?: Pace | undefined;
107
+ readonly labels?: Partial<SceneCardLabels> | undefined;
108
+ };
109
+ /**
110
+ * A playing card, or a generic card with a word on it, that eases to its new place, face, lift and tilt. Name a rank
111
+ * and suit and it draws the corners and the suit, spoken as "Queen of Hearts". Place it with `at`, or list its id in a
112
+ * `SceneStack` declared before it, so a card dealt from one stack to another travels there.
113
+ */
114
+ export declare function SceneCard({ id, at, offset, rotate, rank, suit, text, label, isFaceUp, lift, tilt, size, tone, emphasis, isShown, isActive, back, children, order, delay, pace, labels: labelInput, }: SceneCardProps): ReactNode;