@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
@@ -1,12 +1,4 @@
1
- import type { ReactNode } from 'react';
2
- import type { ChartSeriesReport } from './chart-frame.tsx';
3
- export declare function isFiniteDomain(domain: readonly [number, number]): boolean;
1
+ /** Whether every record has its own id. Charts refuse input that repeats one. */
4
2
  export declare function hasUniqueIds(records: ReadonlyArray<{
5
3
  readonly id: string;
6
4
  }>): boolean;
7
- export declare function ChartInputError({ title, description, message, report, }: {
8
- readonly title: string;
9
- readonly description?: ReactNode;
10
- readonly message: string;
11
- readonly report?: ChartSeriesReport | undefined;
12
- }): ReactNode;
@@ -0,0 +1,56 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartInspectDetails, ChartInspectReason } from './chart.tsx';
3
+ type Link = {
4
+ readonly inspected: string | null;
5
+ readonly onInspectedChange: (id: string | null, details: ChartInspectDetails) => void;
6
+ };
7
+ export type ChartLinkProps = {
8
+ /** The record every figure inside shows as inspected, when the application holds it. */
9
+ readonly inspected?: string | null | undefined;
10
+ readonly defaultInspected?: string | null | undefined;
11
+ /** Hears each change with its details: which figure's hover, press or key, or an agent's step. */
12
+ readonly onInspectedChange?: ((id: string | null, details: ChartInspectDetails) => void) | undefined;
13
+ readonly children: ReactNode;
14
+ };
15
+ /**
16
+ * Links the figures inside it: inspecting a record in one highlights the record with the same id in the others. Give a
17
+ * model, a run or a token one id everywhere and the page reads as one instrument.
18
+ */
19
+ export declare function ChartLink({ inspected, defaultInspected, onInspectedChange, children, }: ChartLinkProps): ReactNode;
20
+ /**
21
+ * The inspection a chart shares with its linked siblings: spread the result into `Chart`. Outside a link it is empty,
22
+ * and the chart keeps its own inspection. An id the chart does not draw reads as nothing inspected.
23
+ */
24
+ export declare function useLinkedInspection(): Partial<Link>;
25
+ export type LinkedHighlightInput = {
26
+ /** The ids a figure could highlight, such as its series. */
27
+ readonly ids: ReadonlyArray<string>;
28
+ /** The caller's own choice. Null highlights nothing; left out, the link decides. */
29
+ readonly highlighted?: string | null | undefined;
30
+ };
31
+ /**
32
+ * The record a figure draws at full strength while the others fade. That is the one the caller names, or else the
33
+ * record the enclosing link inspects when it is one of the figure's own. So a table row or a term in the prose that
34
+ * inspects a model lights up that model in every linked figure.
35
+ */
36
+ export declare function useLinkedHighlight({ ids, highlighted }: LinkedHighlightInput): string | null;
37
+ /** Why something outside the charts points them at a record: a hover, a press, focus arriving or leaving, or a call. */
38
+ export type ChartLinkInspectChange = {
39
+ readonly reason: ChartInspectReason;
40
+ /** The DOM event behind it, so the details say whether a pointer, a key or a screen reader caused it. */
41
+ readonly event?: Event | undefined;
42
+ };
43
+ /** The linked inspection as a control outside the charts reads and sets it. */
44
+ export type ChartLinkControl = {
45
+ /** The record every linked figure shows as inspected, or null. */
46
+ readonly inspected: string | null;
47
+ /** Points every linked figure at a record, or at nothing. Returns false when a listener canceled the change. */
48
+ readonly inspect: (id: string | null, change: ChartLinkInspectChange) => boolean;
49
+ };
50
+ /**
51
+ * Lets prose or a diagram point the linked figures at a record, such as a highlighted term that marks its series in
52
+ * every chart. The change reaches the link's listener with the same details a chart's own inspection sends. Outside a
53
+ * link it is undefined.
54
+ */
55
+ export declare function useChartLinkControl(): ChartLinkControl | undefined;
56
+ export {};
@@ -48,13 +48,6 @@ type ChartState = {
48
48
  };
49
49
  /** What a chart draws from: the open inspection, the application's selection, and where the keyboard cursor rests. */
50
50
  export type ChartView = Pick<ChartState, 'inspected' | 'selected' | 'cursor'>;
51
- /** A `locate` for items in equal bands along the x axis of a plot drawn `width` units wide, such as bar categories. */
52
- export declare function locateBand({ ids, start, step, width, }: {
53
- readonly ids: ReadonlyArray<string>;
54
- readonly start: number;
55
- readonly step: number;
56
- readonly width: number;
57
- }): (point: ChartPoint) => string | undefined;
58
51
  type MarkState = {
59
52
  readonly isInspected: boolean;
60
53
  readonly isSelected: boolean;
@@ -64,7 +57,6 @@ type ChartPart<Tag extends 'figure' | 'div' | 'svg' | 'p' | 'span', State, Named
64
57
  export declare const Chart: ChartPart<'figure', ChartView, ChartOptions>;
65
58
  /** The plot as one Tab stop: arrows move the cursor, Enter or Space selects, Escape or an outside press dismisses. */
66
59
  export declare const ChartPlot: ChartPart<'div', ChartView>;
67
- export declare const ChartSvgPlot: ChartPart<'svg', ChartView>;
68
60
  export declare const ChartTextPlot: ChartPart<'p', ChartView>;
69
61
  /** One datum a pointer can inspect and press. Pass `render` for a mark that is not a span, such as an SVG shape. */
70
62
  export declare const ChartMark: ChartPart<'span', MarkState, {
@@ -0,0 +1,34 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
3
+ import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
4
+ /** A qualitative band of the axis, such as "Poor" up to 100. Each band runs from the one before it. */
5
+ export type BulletRange = {
6
+ readonly upTo: number;
7
+ readonly label: string;
8
+ };
9
+ export type BulletRow = {
10
+ readonly id: string;
11
+ readonly label: string;
12
+ /** The measured amount, or null where it was not measured. */
13
+ readonly value: number | null;
14
+ /** The level the measure is held against, such as a service-level objective or a release bar. */
15
+ readonly target?: number | undefined;
16
+ /** The bands behind the bar, in increasing `upTo`. */
17
+ readonly ranges?: ReadonlyArray<BulletRange> | undefined;
18
+ };
19
+ export type BulletBarProps = FigureProps & FigureSelectionProps & {
20
+ readonly rows: ReadonlyArray<BulletRow>;
21
+ /** The measured axis. A bar's length carries its amount, so the domain must start at zero. */
22
+ readonly value: PlotAxis;
23
+ readonly height?: PlotHeight | undefined;
24
+ };
25
+ export declare const bulletLimits: {
26
+ readonly rows: 40;
27
+ readonly ranges: 4;
28
+ };
29
+ /**
30
+ * A measured bar against a target and qualitative ranges, one per row: latency against its objective, or an eval's pass
31
+ * rate against the release bar. The ranges are steps of gray behind the bar, the target is a tick in ink, and the bar
32
+ * starts at zero. The application supplies every value, target and range.
33
+ */
34
+ export declare function BulletBar(props: BulletBarProps): ReactNode;
@@ -0,0 +1,54 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartLegendItem } from '../chart-frame.tsx';
3
+ import type { ChartItem } from '../chart.tsx';
4
+ import type { FigureFrameInput, FigureSelectionProps } from '../figure/figure-props.ts';
5
+ import type { PlotGrid } from '../plot/plot-axes.tsx';
6
+ import type { CategoryPlotLayout, PlotAxis, PlotCategory, PlotHeight } from '../plot/plot-layout.ts';
7
+ import type { NumericDomain } from '../plot/scale.ts';
8
+ /** The height one row gets when it holds a single dot or bar, in pixels. */
9
+ export declare const ROW_STEP = 28;
10
+ export type ComparisonRowsInput = {
11
+ readonly rows: ReadonlyArray<PlotCategory>;
12
+ readonly value: PlotAxis;
13
+ /** The resolved value domain: the axis's own, or the result of `fitDomain`. */
14
+ readonly valueDomain: NumericDomain;
15
+ /** The most rows the chart draws. */
16
+ readonly rowsMax: number;
17
+ };
18
+ /** The first thing wrong with a comparison chart's rows or value axis, or undefined when they can be drawn. */
19
+ export declare function comparisonRowsError({ rows, value, valueDomain, rowsMax }: ComparisonRowsInput): string | undefined;
20
+ /** Every key of a record that names no row. A chart rejects values for rows it does not list. */
21
+ export declare function unknownRowIds(rows: ReadonlyArray<PlotCategory>, keys: ReadonlyArray<string>): ReadonlyArray<string>;
22
+ /** What a chart draws its marks from: the layout, and the rows that are inspected, selected or under the cursor. */
23
+ export type ComparisonState = {
24
+ readonly plot: CategoryPlotLayout;
25
+ readonly inspected: string | undefined;
26
+ readonly selected: string | undefined;
27
+ };
28
+ export type ComparisonFigureProps = FigureSelectionProps & {
29
+ /** The shared figure props: title, description, locale, source and the rest. */
30
+ readonly frame: FigureFrameInput;
31
+ /** True when there is nothing to draw. The figure then shows `emptyLabel` in place of the plot. */
32
+ readonly isEmpty: boolean;
33
+ readonly emptyLabel: string;
34
+ readonly rows: ReadonlyArray<PlotCategory>;
35
+ readonly value: PlotAxis;
36
+ readonly valueDomain: NumericDomain;
37
+ readonly height: PlotHeight;
38
+ /** The height each row needs, in pixels. The plot grows with its rows and never shrinks below its named height. */
39
+ readonly rowStep: number;
40
+ /** One per row, with the row's id: the sentence that gives its exact values. */
41
+ readonly items: ReadonlyArray<ChartItem>;
42
+ readonly legend: ReadonlyArray<ChartLegendItem>;
43
+ /** True to show the legend in the frame's legend slot above the plot. */
44
+ readonly hasLegend: boolean;
45
+ /** Which lines run across the plot. Value lines are vertical; row lines are horizontal. */
46
+ readonly grid: PlotGrid;
47
+ /** Draws the marks of every row inside the axes. */
48
+ readonly renderMarks: (state: ComparisonState) => ReactNode;
49
+ };
50
+ /**
51
+ * The plot every comparison chart shares: named rows down the side, one measured value along the bottom, a readout of
52
+ * the inspected row, and the keyboard cursor and selection. A chart supplies its rows, its sentences and its marks.
53
+ */
54
+ export declare function ComparisonFigure({ frame, isEmpty, emptyLabel, rows, value, valueDomain, height, rowStep, items, legend, hasLegend, grid, selected, onSelectedChange, renderMarks, }: ComparisonFigureProps): ReactNode;
@@ -0,0 +1,41 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
3
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
4
+ import type { PlotAxis, PlotCategory, PlotHeight } from '../plot/plot-layout.ts';
5
+ /** The bounds of an interval around a value, such as a confidence interval. */
6
+ export type DotPlotInterval = {
7
+ readonly lower: number;
8
+ readonly upper: number;
9
+ };
10
+ export type DotPlotSeries = {
11
+ readonly id: string;
12
+ readonly label: string;
13
+ readonly tone?: ChartTone | undefined;
14
+ /** The value of each row, by row id. A row left out or set to null has no value and draws no dot. */
15
+ readonly values: Readonly<Record<string, number | null>>;
16
+ /** The interval around each row's value, by row id. It is drawn behind the dot. */
17
+ readonly intervals?: Readonly<Record<string, DotPlotInterval>> | undefined;
18
+ };
19
+ export type DotPlotProps = FigureProps & FigureSelectionProps & {
20
+ /** The categories compared, listed down the side in the order given. */
21
+ readonly rows: ReadonlyArray<PlotCategory>;
22
+ readonly series: ReadonlyArray<DotPlotSeries>;
23
+ /** The measured axis. Position carries the value, so it need not start at zero. */
24
+ readonly value: PlotAxis;
25
+ /**
26
+ * The series drawn at full strength while the others fade. Emphasis only. Left out, it follows the enclosing chart
27
+ * link: a table row or a term in the prose that inspects a series id highlights that series.
28
+ */
29
+ readonly highlighted?: string | null | undefined;
30
+ readonly height?: PlotHeight | undefined;
31
+ };
32
+ export declare const dotPlotLimits: {
33
+ readonly rows: 60;
34
+ readonly series: 6;
35
+ };
36
+ /**
37
+ * One dot per series on each row, along one shared measured axis: a Cleveland dot plot. Use it to compare named
38
+ * categories, such as the accuracy of several models per task, when position reads better than bar length and the axis
39
+ * need not start at zero. An optional interval is drawn behind its dot, and the application supplies every value.
40
+ */
41
+ export declare function DotPlot(props: DotPlotProps): ReactNode;
@@ -0,0 +1,33 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
3
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
4
+ import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
5
+ export type DumbbellRow = {
6
+ readonly id: string;
7
+ readonly label: string;
8
+ /** The first value, such as the score before. Null where it was not measured. */
9
+ readonly from: number | null;
10
+ /** The second value, such as the score after. Null where it was not measured. */
11
+ readonly to: number | null;
12
+ };
13
+ export type DumbbellPlotProps = FigureProps & FigureSelectionProps & {
14
+ readonly rows: ReadonlyArray<DumbbellRow>;
15
+ /** What the first value is: "Before fine-tuning". */
16
+ readonly fromLabel: string;
17
+ /** What the second value is: "After fine-tuning". */
18
+ readonly toLabel: string;
19
+ readonly fromTone?: ChartTone | undefined;
20
+ readonly toTone?: ChartTone | undefined;
21
+ /** The measured axis. Position carries the value, so it need not start at zero. */
22
+ readonly value: PlotAxis;
23
+ readonly height?: PlotHeight | undefined;
24
+ };
25
+ export declare const dumbbellLimits: {
26
+ readonly rows: 60;
27
+ };
28
+ /**
29
+ * Two values per row joined by a segment, before and after or one condition against another, to show how far each
30
+ * category moved. The joining segment is gray context, and the two ends are dots in two hues named in the legend. A row
31
+ * with one end missing draws the present dot only, and the application supplies every value.
32
+ */
33
+ export declare function DumbbellPlot(props: DumbbellPlotProps): ReactNode;
@@ -0,0 +1,6 @@
1
+ export type { BulletBarProps, BulletRange, BulletRow } from './bullet-bar.tsx';
2
+ export { BulletBar, bulletLimits } from './bullet-bar.tsx';
3
+ export type { DotPlotInterval, DotPlotProps, DotPlotSeries } from './dot-plot.tsx';
4
+ export { DotPlot, dotPlotLimits } from './dot-plot.tsx';
5
+ export type { DumbbellPlotProps, DumbbellRow } from './dumbbell-plot.tsx';
6
+ export { DumbbellPlot, dumbbellLimits } from './dumbbell-plot.tsx';
@@ -0,0 +1,40 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
3
+ import type { FigureProps } from '../figure/figure-props.ts';
4
+ import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
5
+ import type { GroupDirection } from './group-plot-layout.ts';
6
+ /** One group's five-number summary, computed by the application, with the outliers it left out of the whiskers. */
7
+ export type BoxGroup = {
8
+ readonly id: string;
9
+ readonly label: string;
10
+ readonly tone?: ChartTone | undefined;
11
+ /** The end of the lower whisker. */
12
+ readonly low: number;
13
+ readonly q1: number;
14
+ readonly median: number;
15
+ readonly q3: number;
16
+ /** The end of the upper whisker. */
17
+ readonly high: number;
18
+ /** Observations beyond the whiskers. They are drawn as hollow dots and never extend a whisker. */
19
+ readonly outliers?: ReadonlyArray<number> | undefined;
20
+ /** How many observations the summary covers. */
21
+ readonly count?: number | undefined;
22
+ };
23
+ export type BoxPlotProps = FigureProps & {
24
+ readonly groups: ReadonlyArray<BoxGroup>;
25
+ readonly value: PlotAxis;
26
+ readonly direction?: GroupDirection | undefined;
27
+ /** What the whiskers mean, as a phrase without a final period: "Whiskers reach 1.5 × IQR". */
28
+ readonly whiskerLabel: string;
29
+ readonly height?: PlotHeight | undefined;
30
+ };
31
+ export declare const boxLimits: {
32
+ readonly groups: 40;
33
+ readonly outliers: 200;
34
+ };
35
+ /**
36
+ * One box per group, with the middle half of its values as a tinted box and the median as a line. Whiskers reach the
37
+ * ends of the ordinary range and hollow dots mark outliers beyond them, and the application computes every number and
38
+ * says what the whiskers mean. Use it to compare spread and center across groups such as models, layers or runs.
39
+ */
40
+ export declare function BoxPlot(props: BoxPlotProps): ReactNode;
@@ -1,14 +1,16 @@
1
- export type NumericDomain = readonly [minimum: number, maximum: number];
1
+ import type { NumericDomain, ScaleType } from '../plot/scale.ts';
2
+ /** The most records each distribution chart draws. Larger input is refused with a message that names the limit. */
2
3
  export declare const distributionLimits: {
3
4
  readonly bins: 200;
4
5
  readonly cumulativePoints: 2000;
5
6
  readonly rows: 200;
6
7
  };
7
- export declare function distributionInputError({ items, domain, maxEntries, }: {
8
+ /** Why a distribution chart cannot draw its records on a domain, or undefined when it can. */
9
+ export declare function distributionInputError({ items, domain, scale, maxEntries, }: {
8
10
  readonly items: ReadonlyArray<{
9
11
  readonly id: string;
10
12
  }>;
11
13
  readonly domain: NumericDomain;
14
+ readonly scale?: ScaleType | undefined;
12
15
  readonly maxEntries: number;
13
16
  }): string | undefined;
14
- export declare function outsideDomain(value: number, domain: NumericDomain): boolean;
@@ -1,162 +1,29 @@
1
- import * as stylex from '@stylexjs/stylex';
2
- import type { ReactNode } from 'react';
3
- import type { NumericDomain } from './distribution-input.ts';
4
- export declare const distributionGeometry: {
5
- readonly height: 160;
1
+ import type { ComponentProps, ReactNode, Ref } from 'react';
2
+ import type { ChartItem } from '../chart.tsx';
3
+ import type { FigureFrameInput } from '../figure/figure-props.ts';
4
+ import type { NumericPlotLayout, PlotAxis } from '../plot/plot-layout.ts';
5
+ export type DistributionFigureProps = {
6
+ readonly frame: FigureFrameInput;
7
+ /** The chart part's own props, from `Chart`'s render. */
8
+ readonly figure: ComponentProps<'figure'>;
9
+ readonly items: ReadonlyArray<ChartItem>;
10
+ readonly inspected: string | null;
11
+ readonly plotRef: Ref<HTMLDivElement>;
12
+ readonly plot: NumericPlotLayout;
13
+ readonly x: PlotAxis;
14
+ readonly y: PlotAxis;
15
+ readonly isSelectable: boolean;
16
+ readonly emptyLabel: string;
17
+ /** The marks, drawn inside the axes. */
18
+ readonly children: ReactNode;
19
+ /**
20
+ * Marks drawn over the axes without the clip: dots that may sit on the plot's edge, and the keyboard cursor, whose
21
+ * underline sits below the plot.
22
+ */
23
+ readonly overlay: ReactNode;
6
24
  };
7
- export declare const distributionStyles: Readonly<{
8
- readonly plot: Readonly<{
9
- readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
10
- readonly display: stylex.StyleXClassNameFor<"display", "grid">;
11
- readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "minmax(0, max-content) minmax(0, 1fr)">;
12
- readonly gap: stylex.StyleXClassNameFor<"gap", string>;
13
- }>;
14
- readonly yAxis: Readonly<{
15
- readonly height: stylex.StyleXClassNameFor<"height", 160>;
16
- readonly display: stylex.StyleXClassNameFor<"display", "flex">;
17
- readonly flexDirection: stylex.StyleXClassNameFor<"flexDirection", "column">;
18
- readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "space-between">;
19
- readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
20
- readonly color: stylex.StyleXClassNameFor<"color", string>;
21
- readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
22
- readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
23
- readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
24
- readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
25
- readonly maxWidth: stylex.StyleXClassNameFor<"maxWidth", 120>;
26
- readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
27
- }>;
28
- readonly plotArea: Readonly<{
29
- readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
30
- }>;
31
- readonly svg: Readonly<{
32
- readonly display: stylex.StyleXClassNameFor<"display", "block">;
33
- readonly width: stylex.StyleXClassNameFor<"width", "100%">;
34
- readonly height: stylex.StyleXClassNameFor<"height", 160>;
35
- readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
36
- }>;
37
- readonly grid: Readonly<{
38
- readonly stroke: stylex.StyleXClassNameFor<"stroke", string>;
39
- readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
40
- }>;
41
- readonly axis: Readonly<{
42
- readonly display: stylex.StyleXClassNameFor<"display", "flex">;
43
- readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "space-between">;
44
- readonly gap: stylex.StyleXClassNameFor<"gap", string>;
45
- readonly color: stylex.StyleXClassNameFor<"color", string>;
46
- readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
47
- readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
48
- readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
49
- readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
50
- }>;
51
- readonly tick: Readonly<{
52
- readonly flex: stylex.StyleXClassNameFor<"flex", "1 1 0">;
53
- readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
54
- readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
55
- }>;
56
- readonly middleTick: Readonly<{
57
- readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "center">;
58
- }>;
59
- readonly endTick: Readonly<{
60
- readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
61
- }>;
62
- readonly axisNames: Readonly<{
63
- readonly gridColumn: stylex.StyleXClassNameFor<"gridColumn", "1 / -1">;
64
- readonly display: stylex.StyleXClassNameFor<"display", "flex">;
65
- readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "space-between">;
66
- readonly gap: stylex.StyleXClassNameFor<"gap", string>;
67
- }>;
68
- readonly label: Readonly<{
69
- readonly color: stylex.StyleXClassNameFor<"color", string>;
70
- readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
71
- readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
72
- readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
73
- }>;
74
- readonly values: Readonly<{
75
- readonly display: stylex.StyleXClassNameFor<"display", "grid">;
76
- readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
77
- readonly containerType: stylex.StyleXClassNameFor<"containerType", "inline-size">;
78
- }>;
79
- readonly value: Readonly<{
80
- readonly display: stylex.StyleXClassNameFor<"display", "flex">;
81
- readonly flexWrap: stylex.StyleXClassNameFor<"flexWrap", "wrap">;
82
- readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "space-between">;
83
- readonly columnGap: stylex.StyleXClassNameFor<"columnGap", string>;
84
- readonly rowGap: stylex.StyleXClassNameFor<"rowGap", string>;
85
- readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
86
- readonly width: stylex.StyleXClassNameFor<"width", "100%">;
87
- }>;
88
- readonly summary: Readonly<{
89
- readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
90
- readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
91
- readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
92
- readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
93
- }>;
94
- readonly row: Readonly<{
95
- readonly display: stylex.StyleXClassNameFor<"display", "grid">;
96
- readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "minmax(0, 1fr)" | "minmax(100px, 1fr) minmax(120px, 2fr)">;
97
- readonly gap: stylex.StyleXClassNameFor<"gap", string>;
98
- readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
99
- readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
100
- readonly width: stylex.StyleXClassNameFor<"width", "100%">;
101
- }>;
102
- readonly rowAxis: Readonly<{
103
- readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
104
- readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
105
- }>;
106
- readonly axisSpacer: Readonly<{
107
- readonly display: stylex.StyleXClassNameFor<"display", "block" | "none">;
108
- }>;
109
- readonly rowLabel: Readonly<{
110
- readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
111
- readonly display: stylex.StyleXClassNameFor<"display", "grid">;
112
- readonly gap: stylex.StyleXClassNameFor<"gap", string>;
113
- readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
114
- }>;
115
- readonly rowValue: Readonly<{
116
- readonly color: stylex.StyleXClassNameFor<"color", string>;
117
- readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
118
- }>;
119
- readonly rowSvg: Readonly<{
120
- readonly display: stylex.StyleXClassNameFor<"display", "block">;
121
- readonly width: stylex.StyleXClassNameFor<"width", "100%">;
122
- readonly height: stylex.StyleXClassNameFor<"height", 28>;
123
- readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
124
- }>;
125
- readonly empty: Readonly<{
126
- readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
127
- readonly color: stylex.StyleXClassNameFor<"color", string>;
128
- readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
129
- readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
130
- }>;
131
- readonly baseline: Readonly<{
132
- readonly stroke: stylex.StyleXClassNameFor<"stroke", string>;
133
- readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
134
- }>;
135
- readonly track: Readonly<{
136
- readonly fill: stylex.StyleXClassNameFor<"fill", string>;
137
- }>;
138
- readonly missing: Readonly<{
139
- readonly fill: stylex.StyleXClassNameFor<"fill", string>;
140
- readonly stroke: stylex.StyleXClassNameFor<"stroke", string>;
141
- readonly strokeDasharray: stylex.StyleXClassNameFor<"strokeDasharray", "3 3">;
142
- readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
143
- }>;
144
- }>;
145
- type NumericPlotProps = {
146
- /** The plot's accessible name and the id of the readout that describes it. */
147
- readonly label: string;
148
- readonly readoutId: string;
149
- readonly xDomain: NumericDomain;
150
- readonly yDomain: NumericDomain;
151
- readonly xLabel: string;
152
- readonly yLabel: string;
153
- readonly formatX: (value: number) => string;
154
- readonly formatY: (value: number) => string;
155
- readonly children: (width: number) => ReactNode;
156
- };
157
- export declare function NumericPlot({ label, readoutId, xDomain, yDomain, xLabel, yLabel, formatX, formatY, children, }: NumericPlotProps): ReactNode;
158
- export declare function DomainLabels({ domain, formatValue, }: {
159
- readonly domain: NumericDomain;
160
- readonly formatValue: (value: number) => string;
161
- }): ReactNode;
162
- export {};
25
+ /**
26
+ * The frame, axes, readout and exact-value table that a histogram and a cumulative distribution share. Each chart
27
+ * supplies its own marks.
28
+ */
29
+ export declare function DistributionFigure({ frame, figure, items, inspected, plotRef, plot, x, y, isSelectable, emptyLabel, children, overlay, }: DistributionFigureProps): ReactNode;
@@ -1,24 +1,25 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
3
- import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
4
- import type { NumericDomain } from './distribution-input.ts';
3
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
4
+ import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
5
+ /** One prepared step of an empirical cumulative distribution: the share of observations at or below `value`. */
5
6
  export type ECDFPoint = {
6
7
  readonly id: string;
7
8
  readonly value: number;
8
9
  readonly probability: number | null;
9
10
  };
10
- export type ECDFProps = {
11
- readonly title: string;
12
- readonly report?: ChartReport | undefined;
13
- readonly description?: string;
11
+ export type ECDFProps = FigureProps & FigureSelectionProps & {
12
+ /** Points in increasing `value` whose probability never decreases. A null probability breaks the line. */
14
13
  readonly points: ReadonlyArray<ECDFPoint>;
15
- readonly domain: NumericDomain;
16
- readonly valueLabel: string;
17
- readonly probabilityLabel: string;
18
- readonly formatValue: (value: number) => string;
19
- readonly formatProbability: (probability: number) => string;
20
- readonly tone?: ChartTone;
21
- readonly selection?: ChartSelection;
22
- readonly emptyLabel?: string;
14
+ /** The measured variable, with its unit. */
15
+ readonly value: PlotAxis;
16
+ /** The cumulative share. Its domain is zero to one when left out. */
17
+ readonly probability: PlotAxis;
18
+ readonly tone?: ChartTone | undefined;
19
+ readonly height?: PlotHeight | undefined;
23
20
  };
24
- export declare function ECDF({ title, report, description, points, domain, valueLabel, probabilityLabel, formatValue, formatProbability, tone, selection, emptyLabel, }: ECDFProps): ReactNode;
21
+ /**
22
+ * The share of observations at or below each value, drawn as a step line from prepared points: latency percentiles,
23
+ * score thresholds, calibration. Read a percentile across from the probability axis. Use `Histogram` for counts.
24
+ */
25
+ export declare function ECDF(props: ECDFProps): ReactNode;
@@ -0,0 +1,35 @@
1
+ import type { NumericDomain, ScaleType } from '../plot/scale.ts';
2
+ /** One point of a density curve the application computed: how much of the data lies near `value`. */
3
+ export type DensityPoint = {
4
+ readonly value: number;
5
+ readonly density: number;
6
+ };
7
+ /**
8
+ * Why a chart of named groups cannot draw, or undefined when it can. The reasons are a domain the scale cannot carry,
9
+ * groups that share an identifier, or more groups than the chart draws.
10
+ */
11
+ export declare function groupFrameError({ records, limit, noun, domain, scale, }: {
12
+ readonly records: ReadonlyArray<{
13
+ readonly id: string;
14
+ }>;
15
+ readonly limit: number;
16
+ /** What the records are, in the plural: "groups" or "rows". */
17
+ readonly noun: string;
18
+ readonly domain: NumericDomain;
19
+ readonly scale?: ScaleType | undefined;
20
+ }): string | undefined;
21
+ /** The first problem in the density curves of a chart, or undefined when each can be drawn. */
22
+ export declare function densitiesError({ records, domain, limit, }: {
23
+ readonly records: ReadonlyArray<{
24
+ readonly id: string;
25
+ readonly density: ReadonlyArray<DensityPoint>;
26
+ }>;
27
+ readonly domain: NumericDomain;
28
+ readonly limit: number;
29
+ }): string | undefined;
30
+ /** The highest density among all curves. Charts that share one density scale divide by it. */
31
+ export declare function maxDensity(records: ReadonlyArray<{
32
+ readonly density: ReadonlyArray<DensityPoint>;
33
+ }>): number;
34
+ /** The point where a curve is highest, the first one when several tie. It reads a supplied point, computing nothing. */
35
+ export declare function peakPoint(density: ReadonlyArray<DensityPoint>): DensityPoint | undefined;