@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
@@ -9,7 +9,8 @@ description:
9
9
  # Review an Elements page
10
10
 
11
11
  Run the page in a browser and use it. A passing type check says nothing about focus, loading or layout. Report what you
12
- checked, what failed and what you could not check.
12
+ checked, what failed and what you could not check. For an explorable essay built with the teaching layers, also follow
13
+ the `review-explainer` skill, which checks whether it teaches.
13
14
 
14
15
  ## 1. Keyboard alone
15
16
 
@@ -46,14 +47,16 @@ Check 360 pixels wide, a tablet width and a wide desktop.
46
47
 
47
48
  - Switch to the dark theme and open every menu, dialog, popover and tooltip. A portaled panel in the wrong theme means
48
49
  the theme is not on the document root.
49
- - Turn on reduced motion. Fades and slides stop, and nothing waits for an animation to finish.
50
+ - Turn on reduced motion. Fades and slides stop, and nothing waits for an animation to finish. A scene lands on its new
51
+ state at once and a `Playback` jumps to its end.
50
52
 
51
53
  ## 5. Honest content
52
54
 
53
55
  - Unknown is not zero. A missing value shows as unavailable, and a chart draws a gap.
54
56
  - Try the longest real name, a large number, an empty optional field and a single row.
55
57
  - Dates and numbers carry a unit, and come from a formatter with an explicit locale and time zone.
56
- - An icon-only button has an accessible name. A chart's title says what was measured and for which period.
58
+ - An icon-only button has an accessible name. A chart's title says what was measured and for which period. Review a
59
+ chart further in section 8.
57
60
 
58
61
  ## 6. What an agent sees
59
62
 
@@ -72,5 +75,46 @@ When the app enables the bridge from `/agent`, print `agent.snapshot()` on the p
72
75
  - Each value has one owner: controlled with its callback, or an uncontrolled default.
73
76
  - The server authorizes every read and mutation. The UI's disabled state is not the permission check.
74
77
 
78
+ ## 8. Figures
79
+
80
+ Run this pass on every page with a chart, a kit component or a figure spec. Look at the figure, then read its footnote
81
+ and its readout.
82
+
83
+ - **After a chart change, look at the wall first.** When you changed a chart in the Elements source, open `Charts/Wall`
84
+ in the Elements Storybook before the page. It is one page that draws every registered chart from its `chartGuide`
85
+ example through `Figure`, with one story per family and an `All` story. Compare the changed chart's frame, axes,
86
+ ticks, legend, readout, footnote and states with its neighbors, in the light and dark themes and at phone width. A
87
+ chart that looks different from the others there is wrong before any page uses it. The wall is part of the Elements
88
+ Storybook, so an app with only the installed package has no wall. There, compare the figure with its `example` in
89
+ `chartGuide`.
90
+ - **One hue per thing.** The same model, run or series has the same hue in every figure, table and sentence on the page.
91
+ A `ToneScope` names the ids. A hue that changes between figures means an id differs or a scope is missing.
92
+ - **Linked figures answer together.** Inside a `ChartLink`, hover a row or a point and check that the same id is marked
93
+ in each other figure. A figure that stays still has a different id for the same thing.
94
+ - **A spec from JSON validates.** For a figure drawn from a spec, `validateFigureSpec` returns `ok`, or the page shows
95
+ its `message`. An invalid spec in the figure itself shows the same reason in place of the chart.
96
+ - **Declared formats and units.** Every number comes from a declared format with a `locale`, and every axis title names
97
+ its unit. A time format names its time zone. No formatter function appears in the props.
98
+ - **Bars start at zero.** A bar, histogram or area that starts elsewhere misleads. Dots and lines may use a fitted
99
+ range.
100
+ - **Log axes are named.** A log or symlog axis says so in its title. A log axis holds no zero or negative value.
101
+ - **Missing is hollow.** A missing value is a hollow mark, a gap or "Unavailable", never zero. A zero is drawn as zero.
102
+ - **Partial data states its coverage.** A sample or a window shows how much it draws, such as "1,000 of 48,000 points",
103
+ beside the title.
104
+ - **Source and transforms in the footnote.** The footnote names where the data came from and each step the app applied:
105
+ smoothing, binning, quantile method, sample.
106
+ - **One meaning per channel.** A dashed stroke is modelled, a pale band is uncertainty, gray is context, and size has a
107
+ legend. No second value axis on one plot.
108
+ - **Reachable by keyboard.** The plot is one Tab stop. Arrow keys inspect, Enter selects, and Escape closes the readout.
109
+ A range or a pan has a keyboard path.
110
+ - **Readout text is present.** The inspected record states its exact values in text, and the exact-value table lists
111
+ every record.
112
+ - **Limits are respected.** The page stays inside each chart's `<chart>Limits` and names its window or aggregate. A
113
+ chart that refuses input shows the reason, not a blank.
114
+ - **States match.** Loading holds the final geometry, empty says why, and invalid names the problem.
115
+ - **Dark theme and phone width.** In the dark theme, marks and labels keep their contrast. At 360 pixels, labels do not
116
+ overlap, the readout stays in view, and the plot does not scroll the page sideways.
117
+ - **No statistic in the chart.** The app computed every quantile, density, bin and fit, with a named transform.
118
+
75
119
  Not covered by this review: a real screen reader, a physical touch device and right-to-left text. Say so in the report
76
120
  unless you ran them.
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: review-explainer
3
+ description:
4
+ Review an explorable essay built with the Elements teaching layers before it ships. Use after writing or changing an
5
+ essay with `@mechane-ai/elements/lesson`, `/scene`, `/article` or `/mdx`, or when asked whether an explainer teaches.
6
+ ---
7
+
8
+ # Review an explainer
9
+
10
+ Review as a learner first and as a programmer second. A passing type check says nothing about whether the reader learns.
11
+ Report what you checked, what failed and what you could not check. Run the `review-elements` skill as well for keyboard,
12
+ themes and widths in general.
13
+
14
+ ## 1. Open these
15
+
16
+ - The plan (`plan.json`) and the lesson definition (`defineLesson`): the idea, the beats with their goals, the states.
17
+ - The **sheet view** (`?view=sheet` in the essay starter, or `view="sheet"`): every beat at each declared state, and its
18
+ "Checks" list. Read every cell; it is the fastest way to see the whole essay.
19
+ - The **static view** (`?view=static`): read it start to end as a reader with no script would.
20
+ - The essay itself in the browser, at a desktop width and at 360 pixels, with the pointer and with the keyboard alone.
21
+ - From Node, with `@mechane-ai/elements/lesson/spec`: `lessonWalk(lesson, 'en-US')` (the outline as text, each state
22
+ with its derived values written out), `describeLesson(lesson)` and `checkLesson(lesson)`. The `write-explainer`
23
+ skill's tutor reference has the command.
24
+
25
+ ## 2. Does it teach
26
+
27
+ In order of what matters most to a learner:
28
+
29
+ 1. **One idea.** State the essay's idea in one sentence after reading it. If you cannot, or it differs from the plan's
30
+ `idea`, that is the first finding.
31
+ 2. **One goal per beat, and its figure answers it.** For each beat, read its goal, then look at its sheet row. The
32
+ states should differ in the way the goal describes. A figure that looks the same in every state does not show the
33
+ point.
34
+ 3. **The reader acts before being told.** A `Predict` comes before the result it asks about, in the first three beats. A
35
+ `Challenge` asks for something the reader can do with the controls they have, and its hints lead there.
36
+ 4. **Every control changes something visible,** in the same beat, within the same screen. Move each `Param`, slider and
37
+ point and watch the figure. The sheet's check catches a prose param no figure reads; it does not catch a figure that
38
+ reads a value and barely changes.
39
+ 5. **Concrete before abstract.** The first beat shows a specific case. A symbol appears only after the reader has seen
40
+ the thing it stands for.
41
+ 6. **Identity is kept.** Step between states and watch: the same object moves, flips or fades, and is never replaced by
42
+ a look-alike. A `Term` for an object lights it in every figure. A thing has one hue in every figure and sentence.
43
+ 7. **The static reading teaches.** In the static view each beat still makes its point from its first state, the prose
44
+ and the figure descriptions. Prose that says "watch it move" fails here. The present view opens each beat at that
45
+ same first state, so it must be the right opening picture.
46
+ 8. **Reduced motion.** Turn it on. Every change lands at once, a `Playback` jumps to its end, and nothing waits.
47
+ 9. **Honest labels.** Synthetic data is called synthetic. Axes and values carry units. A modelled curve or wire is
48
+ dashed. Numbers in prose are `Value`s, not copies.
49
+ 10. **Tutor notes.** Every beat has a `goal`; beats that correct a belief have a `misconception`; challenges have
50
+ `hints`. If the essay has a tutor, its `answers` come from `answerSources(articleOutline(beats))`, not a map written
51
+ by hand, so every number `Predict` with an `answerFrom` is in it.
52
+ 11. **Narrow width.** At 360 pixels the prose and controls fit, and a scene scrolls inside its own frame rather than the
53
+ page.
54
+ 12. **Keyboard.** Every `Param` takes arrow keys; each scene and chart is one Tab stop whose arrow keys reach every
55
+ labelled object; a draggable `ScenePoint` moves with the arrow keys; in the present view Right, Space and Left move.
56
+
57
+ ## 3. Read the code once
58
+
59
+ These mean the layers were bypassed. The canonical case is a 7,000-line essay with 29 `useState` hooks in one component,
60
+ 19 `requestAnimationFrame` loops, 124 hand-placed SVG elements, 196 inline style objects and its prose kept as string
61
+ arrays.
62
+
63
+ ```sh
64
+ grep -rnE "useState|requestAnimationFrame|setInterval|setTimeout|@keyframes" src
65
+ grep -rnE "<(svg|rect|circle|line|path|text|g)[ >]" src
66
+ grep -rnE "style=\{\{|#[0-9a-fA-F]{3,6}\b|rgb\(" src
67
+ ```
68
+
69
+ - `useState` holding a value the reader changes, a beat index or a step: it belongs in the lesson, where prose, the
70
+ sheet, the address and agents can see it.
71
+ - A frame loop, a timer or a keyframe animation for meaning: a scene part or `Playback` does it on the shared clock,
72
+ with reduced motion.
73
+ - Hand-placed SVG where a scene part exists: it is not inspectable, not reachable by keyboard and not themed. Only
74
+ `SceneCustom` should hold raw SVG.
75
+ - Inline styles and color literals: tones come from `Article` `tones`, layout from the parts.
76
+ - Prose as string arrays or numbers in strings: prose is markup with `Param` and `Value`.
77
+ - A figure that takes props from its parent, or `Beat`, `Figure` or `Param` inside a custom component: the sheet and the
78
+ outline cannot see them. A nested `Beat`, `Figure`, `Predict` or `Challenge` shows an inline error saying so.
79
+ - A `ScenePoint` with an `onMove` that rounds or clamps by hand and calls `set`, or that writes component state:
80
+ `sets={{ x: 'name' }}` writes the param on its step grid and inside its range.
81
+ - A card `delay` with an index to deal cards in turn: a `SceneStack`'s `stagger` does it, and moves a lone card at once.
82
+ - Conditional mounting (`{isShown && <SceneNode …/>}`) instead of `isShown`: the object pops instead of fading.
83
+ - A changing id for the same object, such as an index in a list that reorders.
84
+ - A `Figure` without `description` or with `reads` missing names its component reads.
85
+
86
+ ## 4. Report
87
+
88
+ Lead with the verdict: ready, ready after the listed fixes, or not ready. Then list findings in the order of section 2,
89
+ each with the beat id, what a reader experiences, and the fix in one sentence:
90
+
91
+ ```text
92
+ Beat "weights": the vote figure looks the same at both states, because the wire weight is clamped to 0.2.
93
+ Fix: pass values.heartWeight as the wire's weight, and set weightMax to 1.
94
+ ```
95
+
96
+ Give code smells after the teaching findings, with file and line. Say which views, widths and input modes you checked,
97
+ and name what you did not: a real screen reader, a touch device, a print.
@@ -27,7 +27,9 @@ is large.
27
27
  ```
28
28
 
29
29
  5. Search the app for what the type check cannot see: agent component names in an `allow` function, role or Tab-order
30
- assumptions in tests, and CSS that targets Elements internals.
30
+ assumptions in tests, and CSS that targets Elements internals. After 0.47, also search for `MAX_` limit constants,
31
+ `selection={` and `ChartSelection`, `@visx` imports your app relied on Elements to install, chart `height` numbers,
32
+ and `format` function props or missing `locale` props passed through spread objects.
31
33
  6. Review each changed page with the `review-elements` skill. Behavior changes show in the browser, not in types.
32
34
 
33
35
  Do not pin an old behavior back with a wrapper or a patch. Move the call site to the new API, and report anything the
@@ -2,6 +2,255 @@
2
2
 
3
3
  Newest first. Each section lists what an application must change, then what it may adopt.
4
4
 
5
+ ## 0.48
6
+
7
+ Elements has a teaching family: lessons, diagrams with identity, explorable essays and tutor tools. It adds six entries
8
+ and removes one. The only breaking change is that the `/kits/explainers` entry is gone. Its exports moved to the new
9
+ entries or were removed, with no aliases: change each import.
10
+
11
+ ### Change
12
+
13
+ - **`/kits/explainers` is removed.** Each export has a new home or is gone, as the table shows. An essay is not a kit
14
+ any more. It is an `Article` on a lesson, from `/article`, `/lesson` and `/scene`.
15
+
16
+ | Old import from `/kits/explainers` | New import | What changed |
17
+ | ------------------------------------------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18
+ | `BoundValue` | `BoundValue` from `/lesson` | Nothing. Same props and types (`BoundValueProps`, `BoundValueScale`, `BoundValueChangeDetails`). Inside a lesson, `<Param name="…" />` is the bound value of a declared param. |
19
+ | `Explainer` | `Article` from `/article` | The `figures` list is gone: figures are numbered in reading order from each `Figure`. `Article` needs `lesson` (from `defineLesson`), `locale` and `title`, and renders the lesson, tone scope and chart link. |
20
+ | `NumberedFigure` | `Figure` from `/article` | `id`, `caption` and `children` are the same. It adds `description`, `reads` and `size`. It must sit inside an `Article`; outside one it shows an error. |
21
+ | `FigureReference` | `FigureReference` from `/article` | Same `to` prop. The number comes from the article's `Figure`s. |
22
+ | `Term` | `Term` from `/article` | Same `inspects` and `children`. It adds an optional `labels` prop with the hint text. |
23
+ | `DiagramPart` | `DiagramPart` from `/article` | Same `inspects`, `label` and `children`. It adds an optional `labels` prop. |
24
+ | `StorySteps` | `Scrolly` and `ScrollyStep`, or `Reveal` | Removed with its types `StoryStep`, `StoryStepChangeDetails`, `StoryStepsLabels` and `StoryStepsProps`. `ScrollyStep` sets lesson values (`values` or `state`) as the reader scrolls. It has no `inspected` prop. |
25
+ | types `ExplainerProps`, `NumberedFigureProps` | `ArticleProps`, `FigureProps` | Renamed with their components. |
26
+ | types `TermProps`, `DiagramPartProps`, `FigureReferenceProps` | the same names from `/article` | Moved. `TermProps` and `DiagramPartProps` add `labels`. |
27
+
28
+ An essay that kept its numbers in React state moves them into `defineLesson`, and its prose reads them through `Param`
29
+ and `Value`.
30
+
31
+ ```tsx
32
+ // Before
33
+ import { Explainer, NumberedFigure, Term } from '@mechane-ai/elements/kits/explainers';
34
+ <Explainer figures={['loss']}>
35
+ <NumberedFigure id="loss" caption="Loss by step.">
36
+ <CurveChart {...props} />
37
+ </NumberedFigure>
38
+ </Explainer>;
39
+ // After
40
+ import { Article, Beat, Figure } from '@mechane-ai/elements/article';
41
+ <Article lesson={lesson} locale="en-US" title="Loss by step">
42
+ <Beat id="training">
43
+ <Figure id="loss" caption="Loss by step." description="A falling line.">
44
+ <CurveChart {...props} />
45
+ </Figure>
46
+ </Beat>
47
+ </Article>;
48
+ ```
49
+
50
+ - **Chart marks carry their record id.** Marks a figure draws now write `data-chart-mark`, and `DotMark`, `BarMark` and
51
+ `SymbolMark` from `/charts/plot` take a `mark` prop. A stylesheet or a script that matched marks by their other
52
+ attributes can match this one. The attribute is added to `BarChart`, `ScatterPlot`, `DotPlot` and `StripPlot` marks
53
+ and to every chart item the `Chart` primitive renders.
54
+
55
+ ### Adopt
56
+
57
+ - **Six entries.** `/lesson` (`defineLesson`, `Lesson`, `Param`, `Value`, `Playback`, `Transport`, tweens), `/scene`
58
+ (`Scene`, nodes, wires, plane marks, cards, cells, tokens, `SceneFlow`, `MorphScope`), `/article` (`Article`, `Beat`,
59
+ `Figure`, `Scrolly`, `Predict`, `Challenge`, notes, `TeX`), `/mdx` (`Essay`, `essayComponents`), `/lesson/spec`
60
+ (`validateLessonPlan`, `checkLesson`, `explainerGuide`) and `/lesson/agent` (`tutorTools`, `createLearnerTrace`,
61
+ `playTour`).
62
+ - **`heatmapColor`** is exported from `/charts/matrix`, so a scene or an application colors a value on a matrix chart's
63
+ scale.
64
+ - **Start an essay.** `pnpm exec mechane-elements-catalog --new-essay <directory>` copies an MDX essay starter into a
65
+ new or empty directory.
66
+ - **A full example.** `recipes/counting-cards.tsx` (story `Recipes/Counting Cards`) is one essay that uses every layer.
67
+ - **Three skills.** `plan-lesson`, `write-explainer` and `review-explainer` ship in the package, and `--install-skills`
68
+ installs them with the others.
69
+
70
+ ## 0.47
71
+
72
+ Elements has a data display system. Every chart is built from one plot kernel and takes the same figure props. This
73
+ release breaks the API of every existing chart. There are no aliases: change each call site.
74
+
75
+ Elements no longer depends on `@visx/hierarchy`, `@visx/scale` or `@visx/shape`, and no chart uses them. If your app
76
+ imports `@visx/*` itself, add it to your own `package.json`: it no longer arrives through Elements. No export moved from
77
+ one entry to another in this release. The names that left an entry are listed under "Removed exports".
78
+
79
+ ### Change
80
+
81
+ - **`locale` is required on every chart.** A number or a date is written from a declared format and the figure's
82
+ `locale`, so a server and a browser render alike. Pass a BCP 47 tag such as `"en-US"`.
83
+ - **Formatter functions are gone.** `formatValue`, `formatX`, `formatY`, `formatTick`, `formatTimestamp`,
84
+ `formatChange`, `formatCount`, `formatProbability` and `formatOffset` are replaced by declared formats: `Intl` options
85
+ as a `ValueFormat` or a `TimeFormat` (which names its `timeZone`). A function is still accepted where no option can
86
+ write the text. Ticks use the compact form of the format unless you set `tickFormat`.
87
+
88
+ ```tsx
89
+ // Before
90
+ <BarChart formatValue={(value) => `${value.toFixed(1)} ms`} formatTick={(value) => `${value}`} />
91
+ // After
92
+ <BarChart locale="en-US" valueFormat={{ style: 'unit', unit: 'millisecond', maximumFractionDigits: 1 }} />
93
+ ```
94
+
95
+ - **Selection is `selected` and `onSelectedChange`.** The `selection={{ selectedId, onSelect }}` object is removed, and
96
+ so is the `ChartSelection` type.
97
+
98
+ ```tsx
99
+ // Before
100
+ <Histogram selection={{ selectedId, onSelect: (id) => setSelectedId(id) }} />
101
+ // After
102
+ <Histogram selected={selectedId} onSelectedChange={(id) => setSelectedId(id)} />
103
+ ```
104
+
105
+ - **Heights are named.** `height` takes `'compact'` (160 px), `'regular'` (260 px) or `'tall'` (380 px), not a number.
106
+ `RelationGraph` `width` and `height` stay numbers: they are the extent of your node positions.
107
+ - **Limits are objects.** Every `MAX_*` export is removed, as the table under "Removed exports" shows.
108
+ - **`description` is a string** on every chart. It was a `ReactNode` on the time-series charts, `BarChart` and
109
+ `FlowDiagram`.
110
+ - **Records take an optional `tone`.** An absent tone comes from the enclosing `ToneScope`, then from the record's
111
+ place.
112
+ - **Removed exports.** Each name below left the entry shown and has the replacement beside it.
113
+
114
+ | Entry | Removed | Use instead |
115
+ | ------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
116
+ | `/charts` | type `ChartSelection` | `selected` and `onSelectedChange` props, and type `FigureSelectionProps` |
117
+ | `/charts/cartesian` | types `ScatterRangeSelection` and `TimeRangeSelection` | `range`, `onRangeChange` and `rangeStep` props |
118
+ | `/charts/cartesian` | `MAX_SCATTER_POINTS` | `scatterLimits.points` |
119
+ | `/charts/matrix` | `MAX_MATRIX_CELLS` | `matrixLimits.cells` |
120
+ | `/charts/matrix` | `MAX_HEATMAP_TOKENS` | `tokenHeatmapLimits.tokens` |
121
+ | `/charts/graph` | `MAX_FLOW_NODES` and `MAX_FLOW_LINKS` | `flowLimits.nodes` and `flowLimits.links` |
122
+ | `/charts/graph` | `MAX_RELATION_NODES`, `MAX_RELATION_EDGES`, `MAX_RELATION_GROUPS`, `MAX_RELATION_DIMENSION` | `relationGraphLimits.nodes`, `.edges`, `.groups` and `.dimension` |
123
+
124
+ `ChartInputError` and `colorTone` were helpers inside the package and were never exported from an entry, so an app
125
+ could not import them. They are gone. A chart now shows an invalid input with `FigureInvalid`, which `/charts/plot`
126
+ exports for a chart you build yourself, and takes a hue from `ToneScope` or a record's `tone`.
127
+
128
+ #### Migration by chart
129
+
130
+ | Chart | Before | After |
131
+ | --------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
132
+ | `LineChart`, `AreaChart` | `formatTimestamp`, `formatValue`, `formatTick`, `rangeSelection={{ value, onChange, step }}` | `timeFormat`, `valueFormat`, `tickFormat`, `range`, `onRangeChange`, `rangeStep`, and `locale` |
133
+ | `SmallMultiples` | `formatTimestamp` on the group, `formatValue` and `formatTick` per panel | `timeFormat` and `locale` on the group, `valueFormat` and `tickFormat` per panel. Panels take no `locale`. |
134
+ | `Sparkline` | No change | No change |
135
+ | `BarChart` | `domain` required, `formatValue`, `formatTick`, `highlightedSeriesId`, `selection`, `height` number | `domain` optional (fitted from zero), `valueFormat`, `tickFormat`, `highlighted`, `selected`, `onSelectedChange`, `height` name |
136
+ | `BreakdownBar`, `Treemap` | `formatValue`, `selection` | `valueFormat`, `selected`, `onSelectedChange`. `Treemap` `height` is a name. |
137
+ | `BridgeChart` | `formatValue`, `formatChange`, `formatTick`, `selection` | `valueFormat`, `changeFormat`, `tickFormat`, `selected`, `onSelectedChange` |
138
+ | `ScatterPlot` | `xDomain`, `xLabel`, `formatX`, `yDomain`, `yLabel`, `formatY`, `rangeSelection` | `x` and `y` as `PlotAxis`, `range`, `onRangeChange`, `rangeStep={{ x, y }}`. A point `tone` is optional. |
139
+ | `Histogram` | `domain`, `valueLabel`, `formatValue`, `maximumCount`, `countLabel`, `formatCount` | `value` and `count` as `PlotAxis`. The count domain starts at zero and is fitted when absent. |
140
+ | `ECDF` | `domain`, `valueLabel`, `formatValue`, `probabilityLabel`, `formatProbability` | `value` and `probability` as `PlotAxis`. The probability domain is `[0, 1]` when absent. |
141
+ | `IntervalPlot`, `RankedBars` | `domain`, `valueLabel`, `formatValue` | `value` as `PlotAxis`. `intervalLabel` stays on `IntervalPlot`. |
142
+ | `Matrix`, `TokenHeatmap` | `formatValue`, `selection`, required `description` and `emptyLabel` | `valueFormat`, `selected`, `onSelectedChange`. `description` and `emptyLabel` are optional. |
143
+ | `ColorLegend` | `formatValue` | `valueFormat` and `locale` |
144
+ | `RelationGraph` | `selection`, required `description` and `emptyLabel`, node `tone` required | `selected`, `onSelectedChange`. `description` and `emptyLabel` optional, node `tone` optional. |
145
+ | `FlowDiagram` | `formatValue`, `selection`, `height` number | `valueFormat`, `selected`, `onSelectedChange`, `height` name |
146
+ | `Waterfall` | `label`, `selectedId`, `onSelect`, `formatOffset`, `emptyLabel` required | `title`, `selected`, `onSelectedChange`, `offsetFormat`, `locale`. `emptyLabel` is optional. Item `tone` is optional. |
147
+ | `TimeSeriesChartPlaceholder`, `BarChartPlaceholder` | Frame props without `locale` | Same frame props and `locale`. `BarChartPlaceholder` `height` is a name. |
148
+ | `SmallMultiplesPlaceholder` | `charts`, `height` number | `charts`, `locale`, `height` name |
149
+
150
+ The most common calls, before and after:
151
+
152
+ ```tsx
153
+ // BarChart
154
+ <BarChart domain={[0, 100]} formatValue={format} highlightedSeriesId={hovered} selection={{ selectedId, onSelect }} height={200} />
155
+ <BarChart locale="en-US" domain={[0, 100]} valueFormat={{ maximumFractionDigits: 1 }} highlighted={hovered} selected={selectedId} onSelectedChange={onSelect} height="regular" />
156
+
157
+ // LineChart (SmallMultiples panels take valueFormat and tickFormat, the group takes timeFormat)
158
+ <LineChart formatTimestamp={formatTime} formatValue={format} rangeSelection={{ value: range, onChange: setRange, step: 60_000 }} />
159
+ <LineChart locale="en-US" timeFormat={{ timeZone: 'UTC', timeStyle: 'short' }} valueFormat={{ maximumFractionDigits: 1 }} range={range} onRangeChange={setRange} rangeStep={60_000} />
160
+
161
+ // ScatterPlot
162
+ <ScatterPlot xDomain={[0, 1]} xLabel="Cost" formatX={usd} yDomain={[0, 1]} yLabel="Quality" formatY={percent} rangeSelection={{ value: range, onChange: setRange, xStep: 0.01, yStep: 0.01, locale: 'en-US' }} />
163
+ <ScatterPlot locale="en-US" x={{ label: 'Cost (USD)', domain: [0, 1], format: { style: 'currency', currency: 'USD' } }} y={{ label: 'Quality', domain: [0, 1], format: { style: 'percent' } }} range={range} onRangeChange={setRange} rangeStep={{ x: 0.01, y: 0.01 }} />
164
+
165
+ // Histogram
166
+ <Histogram domain={[0, 500]} valueLabel="Latency (ms)" formatValue={ms} maximumCount={400} countLabel="Requests" formatCount={count} />
167
+ <Histogram locale="en-US" value={{ label: 'Latency (ms)', domain: [0, 500], format: { maximumFractionDigits: 0 } }} count={{ label: 'Requests', domain: [0, 400], format: { maximumFractionDigits: 0 } }} />
168
+
169
+ // ECDF
170
+ <ECDF domain={[0, 500]} valueLabel="Latency (ms)" formatValue={ms} probabilityLabel="Share" formatProbability={percent} />
171
+ <ECDF locale="en-US" value={{ label: 'Latency (ms)', domain: [0, 500], format: { maximumFractionDigits: 0 } }} probability={{ label: 'Share of requests', format: { style: 'percent' } }} />
172
+
173
+ // IntervalPlot and RankedBars
174
+ <RankedBars domain={[0, 1]} valueLabel="Share of errors" formatValue={percent} />
175
+ <RankedBars locale="en-US" value={{ label: 'Share of errors', domain: [0, 1], format: { style: 'percent' } }} />
176
+
177
+ // Matrix and TokenHeatmap
178
+ <Matrix valueLabel="Weight" formatValue={weight} selection={{ selectedId, onSelect }} />
179
+ <Matrix locale="en-US" valueLabel="Weight" valueFormat={{ maximumFractionDigits: 2 }} selected={selectedId} onSelectedChange={onSelect} />
180
+
181
+ // Treemap, BreakdownBar and FlowDiagram
182
+ <Treemap formatValue={bytes} selection={{ selectedId, onSelect }} height={180} />
183
+ <Treemap locale="en-US" valueFormat={{ notation: 'compact' }} selected={selectedId} onSelectedChange={onSelect} height="compact" />
184
+
185
+ // BridgeChart
186
+ <BridgeChart formatValue={usd} formatChange={signedUsd} formatTick={compactUsd} />
187
+ <BridgeChart locale="en-US" valueFormat={{ style: 'currency', currency: 'USD' }} changeFormat={{ style: 'currency', currency: 'USD', signDisplay: 'exceptZero' }} />
188
+
189
+ // Waterfall
190
+ <Waterfall label="Request" selectedId={id} onSelect={setId} formatOffset={ms} />
191
+ <Waterfall title="Request" locale="en-US" selected={id} onSelectedChange={setId} offsetFormat={{ style: 'unit', unit: 'millisecond' }} />
192
+
193
+ // RelationGraph (width and height stay numbers)
194
+ <RelationGraph title="Dependencies" selection={{ selectedId, onSelect }} width={640} height={360} />
195
+ <RelationGraph locale="en-US" title="Dependencies" selected={selectedId} onSelectedChange={onSelect} width={640} height={360} />
196
+
197
+ // Sparkline: no change
198
+ <Sparkline title="Latency" summary="Steady" unit="ms" timestampUnit="seconds" series={series} valueDomain={[0, 300]} />
199
+ ```
200
+
201
+ - **`BridgeChart` `changeFormat`** defaults to `valueFormat` with `signDisplay: 'exceptZero'` when `valueFormat` is
202
+ options. When it is a function, the plus and minus prefix logic is unchanged.
203
+ - **A `timeFormat` function receives milliseconds**, whichever `timestampUnit` you declare. `timestampUnit` still tells
204
+ the chart whether your timestamps are seconds or milliseconds.
205
+
206
+ ### Behavior to check
207
+
208
+ - **Default heights changed.** Time-series charts, `BarChart` and `Treemap` default to `compact` (160 px), where they
209
+ were 180, 200 and 180 px. `BridgeChart` defaults to `regular` (260 px), where it was 240 px. Pass `height="regular"`
210
+ to keep a taller plot.
211
+ - **States are shared.** Loading shows `FigureLoading` at the chart's height. The time-series charts, `SmallMultiples`
212
+ and `BarChart` keep their placeholders. Empty and invalid input use `FigureEmpty` and `FigureInvalid`.
213
+ - **A partial figure says so.** A chart given `coverage` states how much it draws beside its title, and the footnote
214
+ names `source` and `transforms`.
215
+ - **Invalid input is refused with a reason.** Axis domains that exclude data, a log axis with zero, and unordered
216
+ records show an invalid figure. Nothing is clamped or reordered.
217
+ - **Tick text and legends changed.** Tick text gains precision until neighbours differ, an axis longer than 120 px shows
218
+ at least three ticks, and an axis that draws its title leaves a `style: 'unit'` out of its ticks. A legend that names
219
+ things sits above the plot, and a color or size scale below it.
220
+ - **`IntervalPlot` and `RankedBars` write no value beside each row.** The readout and the exact-value table carry the
221
+ exact values. Both take `height` for the room per row.
222
+ - **A hollow mark means missing.** A bin, cell or mark with no value is drawn hollow and read as "Unavailable".
223
+ - **Hues come from a scope.** A record with no `tone` takes its hue from the enclosing `ToneScope`, then from its place
224
+ in the figure. Pin `tone` where color carries identity.
225
+
226
+ ### Adopt
227
+
228
+ - **More charts.** 50 charts are registered in all. `/charts/trend` (`CurveChart`, `RunsChart`, `SlopeChart`,
229
+ `BumpChart`, `HorizonChart`), `/charts/comparison` (`DotPlot`, `DumbbellPlot`, `BulletBar`), `/charts/relationship`
230
+ (`ContourPlot`, `ScatterMatrix`, `ParallelCoordinates`, `EmbeddingMap`, `DensityMap`), `/charts/text`, `/charts/image`
231
+ and `/charts/cells`. `BoxPlot`, `ViolinPlot`, `StripPlot` and `Ridgeline` join `/charts/distribution`.
232
+ `ConfusionMatrix`, `CorrelationMatrix`, `AttentionMatrix` and `CalendarHeatmap` join `/charts/matrix`.
233
+ `AttributionGraph` and `TreeDiagram` join `/charts/graph`. `Icicle` joins `/charts/hierarchy` and `EventStrip` joins
234
+ `/charts/timeline`.
235
+ - **Newer props.** `valueLabel` titles the value axis of `LineChart`, `AreaChart`, `SmallMultiples` panels, `BarChart`
236
+ and `BridgeChart`. `Sparkline` takes `layout`, matrices take `cellValues`, and `Waterfall` takes `description`,
237
+ `actions`, `source` and `transforms`.
238
+ - **Linked figures.** `ToneScope` gives each id one hue in every figure. `ChartLink` and `ChartGrid` share one
239
+ inspection between figures, so hovering a row in one figure marks the same id in the others. `CurveChart` and
240
+ `DotPlot` take `highlighted` and follow the link when it is left out. `useScopedTone` and `useChartLinkControl` let
241
+ prose and diagrams join in. `CurveChart` takes `labels` of `'legend'`, `'inline'` or `'none'`.
242
+ - **Statistics as functions.** `/charts/transforms` has bins, densities, fits, quantiles, ranks, smoothing and sampling,
243
+ each with a `describe...` note for the footnote. `bin2d` counts points for `DensityMap`, and its rows count up from
244
+ the lowest `y`.
245
+ - **Figure specs.** `/charts/figure` has `FigureSpec`, `validateFigureSpec`, `Figure`, `describeFigure`, `figureCharts`
246
+ and `chartGuide`, so an agent or a server can describe a figure as JSON, check it, draw it and read it back as text.
247
+ `chartGuide` has one entry per registered chart with what it shows and when to use it.
248
+ - **The plot kernel.** `/charts/plot` exports the scales, ticks, axes, marks and states that every chart uses, so you
249
+ can build a chart the library lacks.
250
+ - **Kits.** `/kits/explainers`, `/kits/training`, `/kits/operations`, `/kits/evaluation` and `/kits/interpretability`
251
+ compose charts into pages.
252
+ - **Large point maps.** `EmbeddingMap` draws up to 100,000 points on canvas and 1,000,000 with WebGL.
253
+
5
254
  ## 0.46
6
255
 
7
256
  Every interactive component now runs on a UI SDK primitive. `@base-ui/react`, `@tanstack/react-virtual` and
@@ -50,19 +50,22 @@ persistence and every asynchronous operation.
50
50
 
51
51
  ## Pick the component
52
52
 
53
- | The page needs | Use | Read |
54
- | ------------------------------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------------- |
55
- | An app frame, a page, sections, a record page | `AppShell`, `PageLayout`, `PageSection`, `RecordPage` | [workspace](references/workspace.md) |
56
- | Records compared across columns, search, filters | `DataTable` with a `query` | [collections](references/collections.md) |
57
- | A selected record's fields beside its list | `Inspector`, `Details` | [collections](references/collections.md) |
58
- | Fields, choices, dates, files, a save | `Field`, the `/forms` controls, `FormActions`, `ConfirmButton` | [forms](references/forms.md) |
59
- | A trend, comparison, distribution or relationship | One chart from a `/charts/*` entry | [charts](references/charts.md) |
60
- | A first read, a refresh, an empty or failed read | `AsyncRegion`, `LoadingScope`, `EmptyState`, `Notice` | [reports](references/reports.md) |
61
- | A command menu, a decision, an anchored panel | `Menu`, `AlertDialog`, `Dialog`, `Drawer`, `Popover`, `Tooltip` | the catalog |
62
- | Route destinations or panels inside one view | `PageNavigation` for links, `Tabs` or `ContentTabs` for panels | [workspace](references/workspace.md) |
63
- | A transcript, a prompt, tool activity, approvals | `Conversation`, `Message`, `PromptInput`, `Approval` | [conversations](references/conversations.md) |
64
- | Markdown, source, a diff, a file tree, a log | `/content/markdown`, `/content/code`, `/content/diff`, `/content/tree`, `/content` | the catalog |
65
- | A model or browser agent that reads and acts | `createAgent` and `registerTools` from `/agent` | [agent access](references/agent.md) |
53
+ | The page needs | Use | Read |
54
+ | ------------------------------------------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------- |
55
+ | An app frame, a page, sections, a record page | `AppShell`, `PageLayout`, `PageSection`, `RecordPage` | [workspace](references/workspace.md) |
56
+ | Records compared across columns, search, filters | `DataTable` with a `query` | [collections](references/collections.md) |
57
+ | A selected record's fields beside its list | `Inspector`, `Details` | [collections](references/collections.md) |
58
+ | Fields, choices, dates, files, a save | `Field`, the `/forms` controls, `FormActions`, `ConfirmButton` | [forms](references/forms.md) |
59
+ | A trend, comparison, distribution or relationship | One chart from a `/charts/*` entry | [charts](references/charts.md) |
60
+ | A figure an agent or a server writes as JSON | `Figure`, `validateFigureSpec`, `describeFigure` and `chartGuide` from `/charts/figure` | [figures](references/figures.md) |
61
+ | A run, evaluation, service or feature | A kit from `/kits/training`, `/kits/evaluation`, `/kits/operations`, `/kits/interpretability` | [kits](references/kits.md) |
62
+ | An explorable essay, a lesson, a moving diagram | `/lesson`, `/scene`, `/article` and `/mdx`, planned with `/lesson/spec` | [teaching](references/teaching.md) |
63
+ | A first read, a refresh, an empty or failed read | `AsyncRegion`, `LoadingScope`, `EmptyState`, `Notice` | [reports](references/reports.md) |
64
+ | A command menu, a decision, an anchored panel | `Menu`, `AlertDialog`, `Dialog`, `Drawer`, `Popover`, `Tooltip` | the catalog |
65
+ | Route destinations or panels inside one view | `PageNavigation` for links, `Tabs` or `ContentTabs` for panels | [workspace](references/workspace.md) |
66
+ | A transcript, a prompt, tool activity, approvals | `Conversation`, `Message`, `PromptInput`, `Approval` | [conversations](references/conversations.md) |
67
+ | Markdown, source, a diff, a file tree, a log | `/content/markdown`, `/content/code`, `/content/diff`, `/content/tree`, `/content` | the catalog |
68
+ | A model or browser agent that reads and acts | `createAgent` and `registerTools` from `/agent` | [agent access](references/agent.md) |
66
69
 
67
70
  ## Start from a recipe
68
71
 
@@ -71,6 +74,10 @@ persistence and every asynchronous operation.
71
74
  need to return to the same results.
72
75
  - **Sectioned report.** Mount the shell around the router outlet. Put each heading and its body in a sibling
73
76
  `PageSection`. The shell and sections own the sticky geometry.
77
+ - **Linked figures.** Give each model, run or series one id. Wrap the figures in `ToneScope` and `ChartLink` so a thing
78
+ keeps one hue and inspecting it in one figure marks it in the others.
79
+ - **A chart you cannot name.** Read `chartGuide` from `/charts/figure`, or the chooser in
80
+ [charts](references/charts.md). It lists all 50 registered charts by family, with when to use each one.
74
81
  - **Allocation report.** Show how one total divides with a parts strip above one explanatory chart. Give each part one
75
82
  tone everywhere.
76
83
  - **Tabbed workspace.** Put page-wide navigation and its actions in the page navigation slot. Use links for route
@@ -84,4 +91,5 @@ a running Elements Storybook, an MCP client can also discover components and exa
84
91
  ## Before you finish
85
92
 
86
93
  Check the page with the `review-elements` skill: keyboard alone, every read state, a phone width, the dark theme, and
87
- what an agent sees. After a package upgrade, follow the `upgrade-elements` skill.
94
+ what an agent sees. Check an explorable essay with the `review-explainer` skill too. After a package upgrade, follow the
95
+ `upgrade-elements` skill.