@mechane-ai/elements 0.45.0 → 0.47.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 (340) hide show
  1. package/README.md +353 -50
  2. package/bin/mechane-elements-catalog.mjs +42 -4
  3. package/dist/ai.js +268 -202
  4. package/dist/catalog.json +2480 -71
  5. package/dist/categorical-values-DdfGIowV.js +107 -0
  6. package/dist/cells--Bd1fQFR.js +384 -0
  7. package/dist/chart-cursor-1mFd48Jc.js +23 -0
  8. package/dist/chart-link-AE_xuxiP.js +35 -0
  9. package/dist/chart-tones-ei3BC2AL.js +27 -0
  10. package/dist/charts/cartesian.js +1 -2792
  11. package/dist/charts/cells.js +1 -0
  12. package/dist/charts/comparison.js +1 -0
  13. package/dist/charts/distribution.js +1 -709
  14. package/dist/charts/figure.js +3404 -0
  15. package/dist/charts/graph.js +1 -641
  16. package/dist/charts/hierarchy.js +1 -112
  17. package/dist/charts/image.js +1 -0
  18. package/dist/charts/matrix.js +3 -637
  19. package/dist/charts/plot.js +15 -0
  20. package/dist/charts/relationship.js +1 -0
  21. package/dist/charts/text.js +1 -0
  22. package/dist/charts/timeline.js +1 -233
  23. package/dist/charts/transforms.js +677 -0
  24. package/dist/charts/trend.js +1 -0
  25. package/dist/charts.js +8 -3
  26. package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
  27. package/dist/collections.js +1 -1735
  28. package/dist/color-legend-CIo7DhXB.js +62 -0
  29. package/dist/content/code.js +1 -1
  30. package/dist/content/diff.js +67 -66
  31. package/dist/content/link.js +1 -1
  32. package/dist/content/markdown.js +2 -2
  33. package/dist/content/tree.js +2 -2
  34. package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
  35. package/dist/content.js +1 -1
  36. package/dist/csp.js +6 -11
  37. package/dist/dates-Cww8UR_n.js +810 -0
  38. package/dist/dumbbell-plot-B2ZTgQaI.js +508 -0
  39. package/dist/embedding-map-CGM_k6lC.js +1929 -0
  40. package/dist/feedback.js +1 -1
  41. package/dist/figure-format-B8kRZMlo.js +36 -0
  42. package/dist/figure-frame-wRkIEAwe.js +270 -0
  43. package/dist/forms/dates.js +1 -750
  44. package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
  45. package/dist/forms.js +3 -3
  46. package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
  47. package/dist/image-grid-CVA4SOy_.js +598 -0
  48. package/dist/index.js +1 -1
  49. package/dist/kits/evaluation.js +431 -0
  50. package/dist/kits/explainers.js +452 -0
  51. package/dist/kits/interpretability.js +1033 -0
  52. package/dist/kits/operations.js +239 -0
  53. package/dist/kits/training.js +335 -0
  54. package/dist/label-place-Z0fryBZb.js +42 -0
  55. package/dist/layout.js +207 -207
  56. package/dist/locate-Bcg3QcP4.js +11 -0
  57. package/dist/navigation.js +4 -3
  58. package/dist/packages/ai/src/conversation.d.ts +2 -0
  59. package/dist/packages/ai/src/prompt-input.d.ts +7 -2
  60. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
  61. package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
  62. package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
  63. package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
  64. package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
  65. package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
  66. package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
  67. package/dist/packages/charts/src/cartesian/index.d.ts +6 -5
  68. package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
  69. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +37 -26
  70. package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
  71. package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
  72. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
  73. package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
  74. package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
  75. package/dist/packages/charts/src/cartesian/time-series.d.ts +61 -27
  76. package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
  77. package/dist/packages/charts/src/categorical-values.d.ts +15 -10
  78. package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
  79. package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
  80. package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
  81. package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
  82. package/dist/packages/charts/src/cells/index.d.ts +11 -0
  83. package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
  84. package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
  85. package/dist/packages/charts/src/chart-frame.d.ts +17 -12
  86. package/dist/packages/charts/src/chart-grid.d.ts +19 -0
  87. package/dist/packages/charts/src/chart-input.d.ts +1 -9
  88. package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
  89. package/dist/packages/charts/src/chart-link.d.ts +56 -0
  90. package/dist/packages/charts/src/chart-range.d.ts +33 -0
  91. package/dist/packages/charts/src/chart-rows.d.ts +20 -0
  92. package/dist/packages/charts/src/chart-theme.d.ts +17 -0
  93. package/dist/packages/charts/src/chart.d.ts +73 -0
  94. package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
  95. package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
  96. package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
  97. package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
  98. package/dist/packages/charts/src/comparison/index.d.ts +6 -0
  99. package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
  100. package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
  101. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
  102. package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
  103. package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
  104. package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
  105. package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
  106. package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
  107. package/dist/packages/charts/src/distribution/index.d.ts +11 -0
  108. package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
  109. package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
  110. package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
  111. package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
  112. package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
  113. package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
  114. package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
  115. package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
  116. package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
  117. package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
  118. package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
  119. package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
  120. package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
  121. package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
  122. package/dist/packages/charts/src/graph/index.d.ts +6 -2
  123. package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
  124. package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
  125. package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
  126. package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
  127. package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
  128. package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
  129. package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
  130. package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
  131. package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
  132. package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
  133. package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
  134. package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
  135. package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
  136. package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
  137. package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
  138. package/dist/packages/charts/src/image/image-input.d.ts +27 -0
  139. package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
  140. package/dist/packages/charts/src/image/index.d.ts +7 -0
  141. package/dist/packages/charts/src/index.d.ts +16 -1
  142. package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
  143. package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
  144. package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
  145. package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
  146. package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
  147. package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
  148. package/dist/packages/charts/src/matrix/index.d.ts +14 -3
  149. package/dist/packages/charts/src/matrix/matrix-cells.d.ts +27 -3
  150. package/dist/packages/charts/src/matrix/matrix-figure.d.ts +50 -0
  151. package/dist/packages/charts/src/matrix/matrix-mark.d.ts +34 -0
  152. package/dist/packages/charts/src/matrix/matrix-presets.d.ts +20 -0
  153. package/dist/packages/charts/src/matrix/matrix-range.d.ts +45 -0
  154. package/dist/packages/charts/src/matrix/matrix-strip.d.ts +13 -14
  155. package/dist/packages/charts/src/matrix/matrix-types.d.ts +40 -0
  156. package/dist/packages/charts/src/matrix/matrix.d.ts +13 -11
  157. package/dist/packages/charts/src/matrix/token-heatmap.d.ts +16 -10
  158. package/dist/packages/charts/src/plot/contours.d.ts +45 -0
  159. package/dist/packages/charts/src/plot/index.d.ts +49 -0
  160. package/dist/packages/charts/src/plot/label-place.d.ts +35 -0
  161. package/dist/packages/charts/src/plot/locate.d.ts +18 -0
  162. package/dist/packages/charts/src/plot/path.d.ts +39 -0
  163. package/dist/packages/charts/src/plot/plot-axes.d.ts +20 -0
  164. package/dist/packages/charts/src/plot/plot-layout.d.ts +221 -0
  165. package/dist/packages/charts/src/plot/plot-marks.d.ts +124 -0
  166. package/dist/packages/charts/src/plot/plot-surface.d.ts +32 -0
  167. package/dist/packages/charts/src/plot/render/density-layer.d.ts +17 -0
  168. package/dist/packages/charts/src/plot/render/hit-index.d.ts +37 -0
  169. package/dist/packages/charts/src/plot/render/plot-viewport.d.ts +39 -0
  170. package/dist/packages/charts/src/plot/render/point-layer.d.ts +41 -0
  171. package/dist/packages/charts/src/plot/render/theme-colors.d.ts +15 -0
  172. package/dist/packages/charts/src/plot/scale.d.ts +48 -0
  173. package/dist/packages/charts/src/plot/ticks.d.ts +34 -0
  174. package/dist/packages/charts/src/plot-width.d.ts +3 -3
  175. package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
  176. package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
  177. package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
  178. package/dist/packages/charts/src/relationship/index.d.ts +11 -0
  179. package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
  180. package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
  181. package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
  182. package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
  183. package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
  184. package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
  185. package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
  186. package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
  187. package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
  188. package/dist/packages/charts/src/spec/figure.d.ts +12 -0
  189. package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
  190. package/dist/packages/charts/src/spec/index.d.ts +10 -0
  191. package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
  192. package/dist/packages/charts/src/text/index.d.ts +11 -0
  193. package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
  194. package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
  195. package/dist/packages/charts/src/text/token-links.d.ts +49 -0
  196. package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
  197. package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
  198. package/dist/packages/charts/src/text/token-text.d.ts +39 -0
  199. package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
  200. package/dist/packages/charts/src/timeline/index.d.ts +3 -1
  201. package/dist/packages/charts/src/timeline/waterfall.d.ts +29 -14
  202. package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
  203. package/dist/packages/charts/src/transforms/density.d.ts +53 -0
  204. package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
  205. package/dist/packages/charts/src/transforms/index.d.ts +19 -0
  206. package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
  207. package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
  208. package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
  209. package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
  210. package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
  211. package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
  212. package/dist/packages/charts/src/transforms/values.d.ts +70 -0
  213. package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
  214. package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
  215. package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
  216. package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
  217. package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
  218. package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
  219. package/dist/packages/charts/src/trend/index.d.ts +10 -0
  220. package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
  221. package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
  222. package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
  223. package/dist/packages/collections/src/collection-controls.d.ts +5 -1
  224. package/dist/packages/collections/src/collection-filters.d.ts +4 -1
  225. package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
  226. package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
  227. package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
  228. package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
  229. package/dist/packages/collections/src/data-table-text.d.ts +13 -0
  230. package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
  231. package/dist/packages/collections/src/data-table.d.ts +3 -85
  232. package/dist/packages/collections/src/index.d.ts +11 -6
  233. package/dist/packages/collections/src/query-controls.d.ts +6 -2
  234. package/dist/packages/collections/src/table-results.d.ts +47 -13
  235. package/dist/packages/collections/src/timeline.d.ts +1 -0
  236. package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
  237. package/dist/packages/collections/src/use-table-window.d.ts +25 -0
  238. package/dist/packages/content/src/viewer.d.ts +8 -0
  239. package/dist/packages/core/src/disclosure.d.ts +9 -1
  240. package/dist/packages/core/src/index.d.ts +1 -0
  241. package/dist/packages/core/src/route-link.d.ts +11 -0
  242. package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
  243. package/dist/packages/forms/src/file-picker.d.ts +15 -0
  244. package/dist/packages/forms/src/form-controls.d.ts +1 -6
  245. package/dist/packages/forms/src/forms.d.ts +4 -1
  246. package/dist/packages/forms/src/index.d.ts +4 -2
  247. package/dist/packages/forms/src/selection.d.ts +14 -0
  248. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  249. package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
  250. package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
  251. package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
  252. package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
  253. package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
  254. package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
  255. package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
  256. package/dist/packages/kits/src/explainers/bound-value.d.ts +29 -0
  257. package/dist/packages/kits/src/explainers/figures.d.ts +31 -0
  258. package/dist/packages/kits/src/explainers/index.d.ts +8 -0
  259. package/dist/packages/kits/src/explainers/linked-target.d.ts +22 -0
  260. package/dist/packages/kits/src/explainers/story-steps.d.ts +46 -0
  261. package/dist/packages/kits/src/explainers/term.d.ts +29 -0
  262. package/dist/packages/kits/src/interpretability/attention-head-grid.d.ts +56 -0
  263. package/dist/packages/kits/src/interpretability/attribution-workbench.d.ts +29 -0
  264. package/dist/packages/kits/src/interpretability/embedding-atlas.d.ts +41 -0
  265. package/dist/packages/kits/src/interpretability/feature-card.d.ts +33 -0
  266. package/dist/packages/kits/src/interpretability/feature-list.d.ts +51 -0
  267. package/dist/packages/kits/src/interpretability/feature-logits.d.ts +23 -0
  268. package/dist/packages/kits/src/interpretability/features.d.ts +70 -0
  269. package/dist/packages/kits/src/interpretability/index.d.ts +16 -0
  270. package/dist/packages/kits/src/interpretability/kit-styles.d.ts +118 -0
  271. package/dist/packages/kits/src/interpretability/logit-lens.d.ts +50 -0
  272. package/dist/packages/kits/src/interpretability/node-panel.d.ts +32 -0
  273. package/dist/packages/kits/src/interpretability/shared-link.d.ts +8 -0
  274. package/dist/packages/kits/src/interpretability/steering-panel.d.ts +52 -0
  275. package/dist/packages/kits/src/operations/budget-board.d.ts +49 -0
  276. package/dist/packages/kits/src/operations/incident-timeline.d.ts +30 -0
  277. package/dist/packages/kits/src/operations/index.d.ts +6 -0
  278. package/dist/packages/kits/src/operations/service-health.d.ts +66 -0
  279. package/dist/packages/kits/src/training/index.d.ts +8 -0
  280. package/dist/packages/kits/src/training/run-dashboard.d.ts +49 -0
  281. package/dist/packages/kits/src/training/run-legend.d.ts +21 -0
  282. package/dist/packages/kits/src/training/run-marker.d.ts +5 -0
  283. package/dist/packages/kits/src/training/run-state.d.ts +7 -0
  284. package/dist/packages/kits/src/training/run-table.d.ts +63 -0
  285. package/dist/packages/kits/src/training/runs-overview.d.ts +20 -0
  286. package/dist/packages/kits/src/training/runs.d.ts +34 -0
  287. package/dist/packages/navigation/src/index.d.ts +1 -1
  288. package/dist/path-BglsXpnO.js +59 -0
  289. package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
  290. package/dist/plot-axes-DJkLW4wk.js +100 -0
  291. package/dist/plot-layout-BEuoOHbs.js +911 -0
  292. package/dist/plot-marks-A64v7aTw.js +226 -0
  293. package/dist/plot-surface-CJTIqtck.js +51 -0
  294. package/dist/{plot-width-CIqBiHcd.js → plot-width-DcqtSgzb.js} +22 -3
  295. package/dist/point-layer-C-EYETAt.js +655 -0
  296. package/dist/reference-lines-CWA8VeUR.js +82 -0
  297. package/dist/scale-C2xgZyZN.js +63 -0
  298. package/dist/slope-chart-DT22h_ym.js +1279 -0
  299. package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
  300. package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
  301. package/dist/{src-Dcs3SZ9V.js → src-CExIrXPC.js} +170 -194
  302. package/dist/src-CGc_hjxJ.js +409 -0
  303. package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
  304. package/dist/src-D5NXRJZe.js +2195 -0
  305. package/dist/src-DIS0YOj0.js +44 -0
  306. package/dist/styles2.css +574 -161
  307. package/dist/time-series-IB3CB93O.js +2668 -0
  308. package/dist/token-heatmap-C00DnoNO.js +1354 -0
  309. package/dist/token-predictions-Cxx29iDr.js +1093 -0
  310. package/dist/tone-scope-DKiSw-JR.js +32 -0
  311. package/dist/tree-diagram-DsckNKaW.js +1629 -0
  312. package/dist/treemap-9_DpLCW9.js +472 -0
  313. package/dist/values-963L6n1m.js +65 -0
  314. package/dist/violin-plot-BhPHKXsN.js +1291 -0
  315. package/dist/waterfall-CGksuTy5.js +576 -0
  316. package/package.json +57 -7
  317. package/recipes/allocation-report.tsx +15 -7
  318. package/skills/extend-elements/SKILL.md +134 -0
  319. package/skills/review-elements/SKILL.md +118 -0
  320. package/skills/upgrade-elements/SKILL.md +36 -0
  321. package/skills/upgrade-elements/references/releases.md +242 -0
  322. package/skills/use-elements/SKILL.md +70 -13
  323. package/skills/use-elements/references/agent.md +57 -0
  324. package/skills/use-elements/references/charts.md +384 -0
  325. package/skills/use-elements/references/collections.md +89 -0
  326. package/skills/use-elements/references/conversations.md +47 -0
  327. package/skills/use-elements/references/figures.md +173 -0
  328. package/skills/use-elements/references/forms.md +81 -0
  329. package/skills/use-elements/references/kits.md +198 -0
  330. package/skills/use-elements/references/styling.md +70 -0
  331. package/skills/use-elements/references/workspace.md +3 -3
  332. package/dist/categorical-values-DZLGQVW1.js +0 -63
  333. package/dist/chart-frame-Ztktqs1b.js +0 -255
  334. package/dist/chart-input-BO3BqlFO.js +0 -22
  335. package/dist/chart-navigation-BAbb5PV9.js +0 -154
  336. package/dist/header-styles-COxCYFZx.js +0 -90
  337. package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
  338. package/dist/packages/charts/src/chart-surface.d.ts +0 -27
  339. package/dist/packages/navigation/src/route-link.d.ts +0 -2
  340. package/dist/src-Bk7M67zy.js +0 -396
@@ -0,0 +1,79 @@
1
+ import type { ChartPoint } from '../chart.tsx';
2
+ import type { PlotGrid } from '../plot/plot-axes.tsx';
3
+ import type { PlotAxis, PlotBox, PlotCategory, PlotHeight, PlotTick } from '../plot/plot-layout.ts';
4
+ import type { Segment } from '../plot/plot-marks.tsx';
5
+ import type { ContinuousScale, NumericDomain } from '../plot/scale.ts';
6
+ /** Which way the groups run: `columns` stand along the bottom, `rows` list down the side. */
7
+ export type GroupDirection = 'columns' | 'rows';
8
+ /** A position in the plot's drawn pixels. */
9
+ export type Vertex = {
10
+ readonly x: number;
11
+ readonly y: number;
12
+ };
13
+ /** A rectangle in the plot's drawn pixels. */
14
+ export type Slot = {
15
+ readonly x: number;
16
+ readonly y: number;
17
+ readonly width: number;
18
+ readonly height: number;
19
+ };
20
+ /**
21
+ * Turns a position across the groups and a position along the value axis into a drawn position, so one set of marks
22
+ * serves both directions.
23
+ */
24
+ export type Orientation = {
25
+ readonly point: (across: number, along: number) => Vertex;
26
+ };
27
+ /** The box, ticks, titles and grid a chart of named groups draws its axes from. */
28
+ export type GroupAxes = {
29
+ readonly box: PlotBox;
30
+ readonly xTicks: ReadonlyArray<PlotTick>;
31
+ readonly yTicks: ReadonlyArray<PlotTick>;
32
+ readonly xTitle?: string | undefined;
33
+ readonly yTitle?: string | undefined;
34
+ readonly grid: PlotGrid;
35
+ };
36
+ export type GroupLayout<Group extends PlotCategory> = GroupAxes & {
37
+ readonly value: ContinuousScale;
38
+ /** The width of one group's band. */
39
+ readonly bandwidth: number;
40
+ /** The groups with the position of each band's center across the groups. */
41
+ readonly placed: ReadonlyArray<Group & {
42
+ readonly center: number;
43
+ }>;
44
+ readonly orient: Orientation;
45
+ /** The pointer inspects the group whose band is nearest. */
46
+ readonly locate: (point: ChartPoint) => string | undefined;
47
+ /** The whole band of the group centered at `center`, for the keyboard cursor. */
48
+ readonly slot: (center: number) => Slot;
49
+ };
50
+ /**
51
+ * The plot height of a chart that lists one row per record. It is the named height, grown when the rows would otherwise
52
+ * be shorter than a readable line.
53
+ */
54
+ export declare function rowsPlotHeight({ height, count }: {
55
+ readonly height: PlotHeight;
56
+ readonly count: number;
57
+ }): number;
58
+ /** The segment between two positions. */
59
+ export declare function segmentBetween(first: Vertex, second: Vertex): Segment;
60
+ /** The SVG path of the closed shape through the vertices. */
61
+ export declare function shapePath(vertices: ReadonlyArray<Vertex>): string;
62
+ /**
63
+ * The layout shared by charts that set one measured value against named groups. It holds the category plot, the groups
64
+ * placed along it, axes written for the direction, and a pointer that finds the nearest group.
65
+ */
66
+ export declare function groupLayout<Group extends PlotCategory>({ width, height, direction, groups, value, valueDomain, locale, }: {
67
+ readonly width: number;
68
+ readonly height: number;
69
+ readonly direction: GroupDirection;
70
+ readonly groups: ReadonlyArray<Group>;
71
+ readonly value: PlotAxis;
72
+ readonly valueDomain: NumericDomain;
73
+ readonly locale: string;
74
+ }): GroupLayout<Group>;
75
+ /**
76
+ * Where the nth dot of a group sits across its band, from -0.5 to 0.5 of the band's width. The golden ratio spreads
77
+ * neighbors apart and the same dot always lands in the same place.
78
+ */
79
+ export declare function stripOffset(ordinal: number): number;
@@ -0,0 +1,73 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
3
+ import type { ChartItem, ChartPoint, ChartView } from '../chart.tsx';
4
+ import type { FigureFrameInput, FigureSelectionProps } from '../figure/figure-props.ts';
5
+ import type { Segment } from '../plot/plot-marks.tsx';
6
+ import type { usePlotSize } from '../plot/plot-surface.tsx';
7
+ import type { GroupAxes, Slot } from './group-plot-layout.ts';
8
+ /**
9
+ * Gives each record the tone it draws in: its own, the enclosing scope's, or the hue its place in the figure assigns.
10
+ * Call it before any early return, because it reads the tone scope.
11
+ */
12
+ export declare function useToned<Item extends {
13
+ readonly id: string;
14
+ readonly tone?: ChartTone | undefined;
15
+ }>(records: ReadonlyArray<Item>): ReadonlyArray<Item & {
16
+ readonly tone: ChartTone;
17
+ }>;
18
+ /** A closed shape tinted in a group's hue with a crisp edge: a box, a violin or a ridge. */
19
+ export declare function ShapeMark({ d, tone, fill, isInspected, isSelected, }: {
20
+ /** The path from `shapePath`. */
21
+ readonly d: string;
22
+ readonly tone: ChartTone;
23
+ /** `soft` lets what lies behind show through; `strong` is a filled body. */
24
+ readonly fill: 'soft' | 'strong';
25
+ readonly isInspected?: boolean | undefined;
26
+ readonly isSelected?: boolean | undefined;
27
+ }): ReactNode;
28
+ /** A segment in ink that marks a summary on top of the data: a median, a typical value or an interquartile bar. */
29
+ export declare function InkBarMark({ weight, ...segment }: Segment & {
30
+ readonly weight: 'thin' | 'thick';
31
+ }): ReactNode;
32
+ /** A dot in ink on a surface-colored fill, for the median inside a violin. */
33
+ export declare function InkDotMark({ x, y }: {
34
+ readonly x: number;
35
+ readonly y: number;
36
+ }): ReactNode;
37
+ /** The keyboard cursor around one group's band. */
38
+ export declare function BandCursor({ x, y, width, height }: Slot): ReactNode;
39
+ /** The keyboard cursor around one dot. */
40
+ export declare function PointCursor({ x, y, radius, }: {
41
+ readonly x: number;
42
+ readonly y: number;
43
+ readonly radius: number;
44
+ }): ReactNode;
45
+ export type GroupFigureProps = FigureSelectionProps & {
46
+ /** The figure's shared props, without the empty label. */
47
+ readonly frame: FigureFrameInput;
48
+ readonly emptyLabel: string;
49
+ /** What the figure measured with `usePlotSize`. */
50
+ readonly size: ReturnType<typeof usePlotSize>;
51
+ readonly axes: GroupAxes;
52
+ /** What the arrow keys step through. No items means there is nothing to draw. */
53
+ readonly items: ReadonlyArray<ChartItem>;
54
+ readonly locate: (point: ChartPoint) => string | undefined;
55
+ /** Where each item sits, so the arrow keys move to the nearest one in their direction. */
56
+ readonly place?: ((id: string) => {
57
+ left: number;
58
+ top: number;
59
+ right: number;
60
+ bottom: number;
61
+ } | undefined) | undefined;
62
+ /** Names what the arrow keys step through, for the plot's accessible name: "groups". */
63
+ readonly marksLabel: string;
64
+ /** A line under the readout that says how to read the marks. */
65
+ readonly note?: string | undefined;
66
+ readonly marks: (view: ChartView) => ReactNode;
67
+ readonly cursor: (id: string) => ReactNode;
68
+ };
69
+ /**
70
+ * The frame, axes, readout, keyboard cursor and exact-value table that charts of named groups share. Each chart
71
+ * supplies its marks and what its items say.
72
+ */
73
+ export declare function GroupFigure({ frame, emptyLabel, size, axes, items, locate, place, marksLabel, note, marks, cursor, selected, onSelectedChange, }: GroupFigureProps): ReactNode;
@@ -1,7 +1,8 @@
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 bin: its bounds on the value axis and the number of observations in it, or null when unrecorded. */
5
6
  export type HistogramBin = {
6
7
  readonly id: string;
7
8
  readonly label: string;
@@ -9,19 +10,18 @@ export type HistogramBin = {
9
10
  readonly upperBound: number;
10
11
  readonly count: number | null;
11
12
  };
12
- export type HistogramProps = {
13
- readonly title: string;
14
- readonly report?: ChartReport | undefined;
15
- readonly description?: string;
13
+ export type HistogramProps = FigureProps & FigureSelectionProps & {
14
+ /** Bins in increasing order that do not overlap. The application computes them. */
16
15
  readonly bins: ReadonlyArray<HistogramBin>;
17
- readonly domain: NumericDomain;
18
- readonly maximumCount: number;
19
- readonly valueLabel: string;
20
- readonly countLabel: string;
21
- readonly formatValue: (value: number) => string;
22
- readonly formatCount: (count: number) => string;
23
- readonly tone?: ChartTone;
24
- readonly selection?: ChartSelection;
25
- readonly emptyLabel?: string;
16
+ /** The measured variable the bins divide, with its unit. */
17
+ readonly value: PlotAxis;
18
+ /** The count axis. It starts at zero; leave its domain out to fit the largest count. */
19
+ readonly count: PlotAxis;
20
+ readonly tone?: ChartTone | undefined;
21
+ readonly height?: PlotHeight | undefined;
26
22
  };
27
- export declare function Histogram({ title, report, description, bins, domain, maximumCount, valueLabel, countLabel, formatValue, formatCount, tone, selection, emptyLabel, }: HistogramProps): ReactNode;
23
+ /**
24
+ * Counts of observations in prepared bins along a measured value, such as request latency or token length. Bars start
25
+ * at zero; a bin with no recorded count is drawn hollow, never as zero. Use `ECDF` to read cumulative shares instead.
26
+ */
27
+ export declare function Histogram(props: HistogramProps): ReactNode;
@@ -1,3 +1,4 @@
1
+ export { distributionLimits } from './distribution-input.ts';
1
2
  export type { ECDFPoint, ECDFProps } from './ecdf.tsx';
2
3
  export { ECDF } from './ecdf.tsx';
3
4
  export type { HistogramBin, HistogramProps } from './histogram.tsx';
@@ -6,3 +7,13 @@ export type { IntervalDatum, IntervalPlotProps } from './interval-plot.tsx';
6
7
  export { IntervalPlot } from './interval-plot.tsx';
7
8
  export type { RankedBarDatum, RankedBarsProps } from './ranked-bars.tsx';
8
9
  export { RankedBars } from './ranked-bars.tsx';
10
+ export type { BoxGroup, BoxPlotProps } from './box-plot.tsx';
11
+ export { BoxPlot, boxLimits } from './box-plot.tsx';
12
+ export type { DensityPoint } from './group-plot-input.ts';
13
+ export type { GroupDirection } from './group-plot-layout.ts';
14
+ export type { RidgeRow, RidgelineProps } from './ridgeline.tsx';
15
+ export { Ridgeline, ridgelineLimits } from './ridgeline.tsx';
16
+ export type { StripGroup, StripPlotProps, StripPoint } from './strip-plot.tsx';
17
+ export { StripPlot, stripLimits } from './strip-plot.tsx';
18
+ export type { ViolinGroup, ViolinPlotProps } from './violin-plot.tsx';
19
+ export { ViolinPlot, violinLimits } from './violin-plot.tsx';
@@ -1,25 +1,28 @@
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 estimate with its interval. A null bound or estimate stays unavailable and is not drawn. */
5
6
  export type IntervalDatum = {
6
7
  readonly id: string;
7
8
  readonly label: string;
8
9
  readonly lower: number | null;
9
10
  readonly estimate: number | null;
10
11
  readonly upper: number | null;
11
- readonly tone?: ChartTone;
12
+ readonly tone?: ChartTone | undefined;
12
13
  };
13
- export type IntervalPlotProps = {
14
- readonly title: string;
15
- readonly report?: ChartReport | undefined;
16
- readonly description?: string;
14
+ export type IntervalPlotProps = FigureProps & FigureSelectionProps & {
17
15
  readonly items: ReadonlyArray<IntervalDatum>;
18
- readonly domain: NumericDomain;
19
- readonly valueLabel: string;
16
+ /** The estimated quantity, with its unit. */
17
+ readonly value: PlotAxis;
18
+ /** What the interval is, as the application computed it: "95% bootstrap interval". */
20
19
  readonly intervalLabel: string;
21
- readonly formatValue: (value: number) => string;
22
- readonly selection?: ChartSelection;
23
- readonly emptyLabel?: string;
20
+ /** The room each row gets: `compact` fits a short list in a card. */
21
+ readonly height?: PlotHeight | undefined;
24
22
  };
25
- export declare function IntervalPlot({ title, report, description, items, domain, valueLabel, intervalLabel, formatValue, selection, emptyLabel, }: IntervalPlotProps): ReactNode;
23
+ /**
24
+ * Prepared estimates with their intervals, one row each: model accuracy with a bootstrap interval, an effect with its
25
+ * confidence bounds. The rows keep the supplied order, and the readout states the exact values of the row being
26
+ * inspected.
27
+ */
28
+ export declare function IntervalPlot(props: IntervalPlotProps): ReactNode;
@@ -1,23 +1,26 @@
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 ranked value. `rank` is the application's own ordinal, shown before the label. */
5
6
  export type RankedBarDatum = {
6
7
  readonly id: string;
7
8
  readonly label: string;
8
- readonly rank?: string;
9
+ readonly rank?: string | undefined;
9
10
  readonly value: number | null;
10
- readonly tone?: ChartTone;
11
+ readonly tone?: ChartTone | undefined;
11
12
  };
12
- export type RankedBarsProps = {
13
- readonly title: string;
14
- readonly report?: ChartReport | undefined;
15
- readonly description?: string;
13
+ export type RankedBarsProps = FigureProps & FigureSelectionProps & {
14
+ /** Values in the order the application ranked them. */
16
15
  readonly items: ReadonlyArray<RankedBarDatum>;
17
- readonly domain: NumericDomain;
18
- readonly valueLabel: string;
19
- readonly formatValue: (value: number) => string;
20
- readonly selection?: ChartSelection;
21
- readonly emptyLabel?: string;
16
+ /** The ranked quantity, with its unit. Its domain includes zero, where every bar starts. */
17
+ readonly value: PlotAxis;
18
+ /** The room each row gets: `compact` fits a short ranked list in a card. */
19
+ readonly height?: PlotHeight | undefined;
22
20
  };
23
- export declare function RankedBars({ title, report, description, items, domain, valueLabel, formatValue, selection, emptyLabel, }: RankedBarsProps): ReactNode;
21
+ /**
22
+ * Signed or positive values in the application's ranking, one bar per row from zero: feature attributions, top error
23
+ * sources, the largest regressions. The readout states the exact value of the row being inspected, and a measured zero
24
+ * keeps its row.
25
+ */
26
+ export declare function RankedBars(props: RankedBarsProps): ReactNode;
@@ -0,0 +1,34 @@
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 { DensityPoint } from './group-plot-input.ts';
6
+ /** One row of the ridgeline: a group and its density curve, computed by the application. */
7
+ export type RidgeRow = {
8
+ readonly id: string;
9
+ readonly label: string;
10
+ /** The hue of a row the application wants to tell apart. Left out, every row shares one hue. */
11
+ readonly tone?: ChartTone | undefined;
12
+ /** The curve in increasing `value`. Densities are zero or more and share one unit across rows. */
13
+ readonly density: ReadonlyArray<DensityPoint>;
14
+ };
15
+ export type RidgelineProps = FigureProps & {
16
+ readonly rows: ReadonlyArray<RidgeRow>;
17
+ readonly value: PlotAxis;
18
+ /** How far a ridge may rise into the row above, from 0 to 1. Defaults to 0.5. */
19
+ readonly overlap?: number | undefined;
20
+ /** What the height means, with its unit: "Density (per unit activation)". */
21
+ readonly densityLabel: string;
22
+ readonly height?: PlotHeight | undefined;
23
+ };
24
+ export declare const ridgelineLimits: {
25
+ readonly rows: 40;
26
+ readonly densityPoints: 200;
27
+ };
28
+ /**
29
+ * Densities of many groups as overlapping ridges down the page, one shared value axis at the bottom and each row named
30
+ * on the left. Rows share one hue unless a row or a tone scope sets its own, later rows are drawn on top, and the
31
+ * application computes every density. Ridge heights share one density scale so heights compare across rows, and the
32
+ * plot grows taller when there are too many rows to keep each readable.
33
+ */
34
+ export declare function Ridgeline(props: RidgelineProps): ReactNode;
@@ -0,0 +1,37 @@
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 StripGroup = {
6
+ readonly id: string;
7
+ readonly label: string;
8
+ readonly tone?: ChartTone | undefined;
9
+ };
10
+ /** One observation: a run, a prompt or a sample, in the group it belongs to. */
11
+ export type StripPoint = {
12
+ readonly id: string;
13
+ readonly groupId: string;
14
+ readonly value: number;
15
+ /** What a reader calls the observation. Defaults to its identifier. */
16
+ readonly label?: string | undefined;
17
+ };
18
+ export type StripPlotProps = FigureProps & FigureSelectionProps & {
19
+ readonly groups: ReadonlyArray<StripGroup>;
20
+ readonly points: ReadonlyArray<StripPoint>;
21
+ readonly value: PlotAxis;
22
+ /** One value per group id, such as its median or mean, drawn as an ink tick across the group. */
23
+ readonly summary?: Readonly<Record<string, number>> | undefined;
24
+ /** What the tick is: "Median". Defaults to "Summary". */
25
+ readonly summaryLabel?: string | undefined;
26
+ readonly height?: PlotHeight | undefined;
27
+ };
28
+ export declare const stripLimits: {
29
+ readonly points: 2000;
30
+ readonly groups: 24;
31
+ };
32
+ /**
33
+ * Every observation as a dot in its group's band, spread across the band by a fixed rule so a reload never moves one.
34
+ * Dots are translucent so piles read as density, and an optional ink tick per group marks a median or mean the
35
+ * application computed. Use it when the number of observations is small enough to show each one.
36
+ */
37
+ export declare function StripPlot(props: StripPlotProps): ReactNode;
@@ -0,0 +1,34 @@
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 { DensityPoint } from './group-plot-input.ts';
6
+ /** One group's density curve, computed by the application, with the summary marks it may show inside. */
7
+ export type ViolinGroup = {
8
+ readonly id: string;
9
+ readonly label: string;
10
+ readonly tone?: ChartTone | undefined;
11
+ /** The curve in increasing `value`. Densities are zero or more and share one unit across groups. */
12
+ readonly density: ReadonlyArray<DensityPoint>;
13
+ readonly median?: number | undefined;
14
+ /** The quartiles bound the bar inside the violin. Supply both or neither. */
15
+ readonly q1?: number | undefined;
16
+ readonly q3?: number | undefined;
17
+ };
18
+ export type ViolinPlotProps = FigureProps & {
19
+ readonly groups: ReadonlyArray<ViolinGroup>;
20
+ readonly value: PlotAxis;
21
+ /** What the width means, with its unit: "Density (per unit score)". */
22
+ readonly densityLabel: string;
23
+ readonly height?: PlotHeight | undefined;
24
+ };
25
+ export declare const violinLimits: {
26
+ readonly groups: 24;
27
+ readonly densityPoints: 200;
28
+ };
29
+ /**
30
+ * One mirrored density per group, so a reader sees where values pile up and whether a distribution has more than one
31
+ * peak. Every violin shares one density scale, so widths compare across groups. A bar and a dot inside show the
32
+ * quartiles and median when the application supplies them, and the application computes the density.
33
+ */
34
+ export declare function ViolinPlot(props: ViolinPlotProps): ReactNode;
@@ -0,0 +1,34 @@
1
+ import type { NumberFormat } from '@ui-sdk/core/number';
2
+ /** How a figure writes a number: `Intl.NumberFormat` options in the figure's locale, or a function of the value. */
3
+ export type ValueFormat = NumberFormat;
4
+ /**
5
+ * How a figure writes an instant: `Intl.DateTimeFormat` options that name their time zone, or a function of the
6
+ * timestamp in milliseconds.
7
+ */
8
+ export type TimeFormat = (Intl.DateTimeFormatOptions & {
9
+ readonly timeZone: string;
10
+ }) | ((timestamp: number) => string);
11
+ /** The text every figure shows for a value that was not recorded. A missing value is never drawn or written as zero. */
12
+ export declare const MISSING_VALUE_TEXT = "Unavailable";
13
+ export type ValueFormatInput = {
14
+ readonly value: number | null;
15
+ readonly locale: string;
16
+ readonly format: ValueFormat;
17
+ };
18
+ /** A value as the reader sees it in a readout, a legend or a table. */
19
+ export declare function formatValue({ value, locale, format }: ValueFormatInput): string;
20
+ /**
21
+ * The short form of a value format for an axis, where "1.2M" reads better than "1,200,000". A function format and a
22
+ * format that names its own notation stay as supplied.
23
+ */
24
+ export declare function tickFormat(format: ValueFormat): ValueFormat;
25
+ export type TimeFormatInput = {
26
+ /** The instant in milliseconds since the epoch. */
27
+ readonly timestamp: number;
28
+ readonly locale: string;
29
+ readonly format: TimeFormat;
30
+ };
31
+ /** An instant as the reader sees it, in the format's declared time zone. */
32
+ export declare function formatTime({ timestamp, locale, format }: TimeFormatInput): string;
33
+ /** How far a time zone is ahead of UTC at an instant, in milliseconds, so axis ticks land on local clock steps. */
34
+ export declare function zoneOffset(timestamp: number, timeZone: string): number;
@@ -0,0 +1,47 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ import type { ChartLegendItem } from '../chart-frame.tsx';
3
+ import type { PlotHeight } from '../plot/plot-layout.ts';
4
+ import type { FigureCoverage, FigureFrameInput } from './figure-props.ts';
5
+ /** "1,000 of 1.2 million points shown": the sentence a partial figure states beside its title. */
6
+ export declare function coverageText(coverage: FigureCoverage, locale: string): string;
7
+ export type FigureFrameProps = FigureFrameInput & {
8
+ /** The chart part's own props, when this figure is the root of an interactive chart. */
9
+ readonly figure?: ComponentProps<'figure'> | undefined;
10
+ /** The series a report's period summary names. */
11
+ readonly series?: ReadonlyArray<ChartLegendItem> | undefined;
12
+ /**
13
+ * What the reader is inspecting, in a few words. At phone width, where the floating inspector is hidden, the heading
14
+ * shows it in place of the title.
15
+ */
16
+ readonly titleDetail?: string | undefined;
17
+ /** The readout and any other line the chart keeps under its plot, above the footnote. */
18
+ readonly footer?: ReactNode;
19
+ /**
20
+ * The legend that names things: series, models, classes. The frame sets it above the plot, directly under the title
21
+ * block, with the standard gap. A chart never places such a legend among its own children.
22
+ */
23
+ readonly seriesLegend?: ReactNode;
24
+ /** The legend that explains a color or size scale. The frame sets it directly below the plot. */
25
+ readonly scaleLegend?: ReactNode;
26
+ readonly children: ReactNode;
27
+ };
28
+ /**
29
+ * The frame every figure shares: title, description, the plot, then the readout and one footnote. The footnote names
30
+ * the source, how much of the data is drawn and what was done to it. A partial figure also says so beside its title.
31
+ */
32
+ export declare function FigureFrame({ title, description, report, actions, locale, source, coverage, transforms, status, figure, series, titleDetail, footer, seriesLegend, scaleLegend, children, }: FigureFrameProps): ReactNode;
33
+ /** The sentence a figure shows in place of its plot when there is nothing to draw. */
34
+ export declare function FigureEmpty({ children }: {
35
+ readonly children: string;
36
+ }): ReactNode;
37
+ /** A figure whose input cannot be drawn faithfully. It states the reason and draws nothing. */
38
+ export declare function FigureInvalid({ message, ...frame }: FigureFrameInput & {
39
+ readonly message: string;
40
+ }): ReactNode;
41
+ /**
42
+ * A figure before its first read: the same frame and plot height as the loaded chart, so nothing moves when the data
43
+ * arrives. The enclosing async region owns the announcement.
44
+ */
45
+ export declare function FigureLoading({ height, ...frame }: FigureFrameInput & {
46
+ readonly height?: PlotHeight | undefined;
47
+ }): ReactNode;
@@ -0,0 +1,54 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartReport, ChartSeriesReport } from '../chart-frame.tsx';
3
+ import type { ChartSelectDetails } from '../chart.tsx';
4
+ /** How much of the full data a figure draws, when it draws a sample or a window. */
5
+ export type FigureCoverage = {
6
+ readonly shown: number;
7
+ readonly total: number;
8
+ /** What is counted, in the plural: "points", "runs", "tokens". */
9
+ readonly unit: string;
10
+ };
11
+ /**
12
+ * Where a figure's data stands. `loading` holds the final geometry before the first read. `refreshing` keeps the drawn
13
+ * data while a newer read is under way.
14
+ */
15
+ export type FigureStatus = 'ready' | 'loading' | 'refreshing';
16
+ /**
17
+ * What every figure accepts, whichever chart it is: its title, the words around the plot, the locale its numbers and
18
+ * dates are written in, and where its data stands.
19
+ */
20
+ export type FigureProps = {
21
+ readonly title: string;
22
+ /** One or two sentences under the title: what is measured and how to read it. */
23
+ readonly description?: string | undefined;
24
+ /** Sets the figure in a bordered report with its own heading, metadata and summary. */
25
+ readonly report?: ChartReport | undefined;
26
+ /** Controls beside the title, such as a download or a period switch. */
27
+ readonly actions?: ReactNode;
28
+ /** The locale of every number and date in the figure. It is an input, so a server and a browser render alike. */
29
+ readonly locale: string;
30
+ /** Where the data came from, for the footnote: a dataset, a run or a query. */
31
+ readonly source?: string | undefined;
32
+ /** Set when the figure draws part of the data. The figure then says so beside its title and in its footnote. */
33
+ readonly coverage?: FigureCoverage | undefined;
34
+ /** What the application did to the data before drawing, in the reader's words: "Smoothed over 5 steps". */
35
+ readonly transforms?: ReadonlyArray<string> | undefined;
36
+ readonly status?: FigureStatus | undefined;
37
+ /** The sentence shown in place of the plot when there is nothing to draw. */
38
+ readonly emptyLabel?: string | undefined;
39
+ };
40
+ /**
41
+ * The record an application has selected in a figure, and its request to select another. Selection is the application's
42
+ * state: the figure reports a press or a key and draws what it is given.
43
+ */
44
+ export type FigureSelectionProps = {
45
+ readonly selected?: string | null | undefined;
46
+ /** The details say why and how: a press, a key or an agent's step. */
47
+ readonly onSelectedChange?: ((id: string, details: ChartSelectDetails) => void) | undefined;
48
+ };
49
+ /** `FigureProps` for a chart of named series, whose report can show one period value per series. */
50
+ export type SeriesFigureProps = Omit<FigureProps, 'report'> & {
51
+ readonly report?: ChartSeriesReport | undefined;
52
+ };
53
+ /** What a chart passes on to its frame: every shared prop but the empty label, which the chart shows itself. */
54
+ export type FigureFrameInput = Omit<SeriesFigureProps, 'emptyLabel'>;
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
3
+ /** The automatic tone of the nth thing in a figure. The six series hues repeat past the sixth. */
4
+ export declare function automaticTone(index: number): ChartTone;
5
+ /**
6
+ * One tone per id, in supplied order. A pinned id keeps its tone and takes no automatic slot, so a remainder group in
7
+ * neutral never shifts the hues of the named things after it.
8
+ */
9
+ export declare function assignTones(ids: ReadonlyArray<string>, pinned?: Readonly<Record<string, ChartTone>>): ReadonlyMap<string, ChartTone>;
10
+ export type ToneScopeProps = {
11
+ /** Every thing the figures inside draw, such as models or runs, in the order their hues are assigned. */
12
+ readonly ids: ReadonlyArray<string>;
13
+ /** Tones the application pins by id. */
14
+ readonly tones?: Readonly<Record<string, ChartTone>> | undefined;
15
+ readonly children: ReactNode;
16
+ };
17
+ /**
18
+ * Gives each thing one hue in every figure inside. A model that is blue in a curve is blue in the bar chart and the
19
+ * table beside it, whatever order each figure lists its series in.
20
+ */
21
+ export declare function ToneScope({ ids, tones, children }: ToneScopeProps): ReactNode;
22
+ export type ToneInput = {
23
+ readonly id: string;
24
+ /** The tone the caller set on this record. It wins over the scope. */
25
+ readonly tone?: ChartTone | undefined;
26
+ /** The record's place among its figure's own records, used when no scope names it. */
27
+ readonly index: number;
28
+ };
29
+ /** Resolves a record's tone: its own, then the enclosing scope's, then its place in the figure. */
30
+ export declare function useTones(): (input: ToneInput) => ChartTone;
31
+ /** The tone the enclosing scope gives `id`, or undefined when none names it. For prose and marks outside a figure. */
32
+ export declare function useScopedTone(id: string): ChartTone | undefined;
@@ -0,0 +1,62 @@
1
+ import type { ChangeDetails } from '@ui-sdk/core';
2
+ import type { ReactNode } from 'react';
3
+ import type { ValueFormat } from '../figure/figure-format.ts';
4
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
5
+ import type { AttributionDirection } from './attribution-layout.ts';
6
+ export type { AttributionDirection } from './attribution-layout.ts';
7
+ /** One layer of the model, in the order computation flows: input tokens, the layers, then the output logits. */
8
+ export type AttributionLayer = {
9
+ readonly id: string;
10
+ readonly label: string;
11
+ };
12
+ /** What a node stands for, by shape. An error node is hollow, the part the features leave unexplained. */
13
+ export type AttributionNodeKind = 'token' | 'feature' | 'error' | 'output';
14
+ export type AttributionNode = {
15
+ readonly id: string;
16
+ readonly layerId: string;
17
+ readonly label: string;
18
+ /** A longer description for the readout, such as the feature's top activating contexts. */
19
+ readonly detail?: string | undefined;
20
+ /** The node's own measure, such as an activation, in `valueFormat`. Null where none was recorded. */
21
+ readonly value?: number | null | undefined;
22
+ readonly kind?: AttributionNodeKind | undefined;
23
+ };
24
+ /** A supplied, signed attribution from an earlier node to a later one. */
25
+ export type AttributionEdge = {
26
+ readonly id: string;
27
+ readonly sourceId: string;
28
+ readonly targetId: string;
29
+ readonly weight: number;
30
+ };
31
+ /** Why the pinned nodes changed: the visible Pin control, or the P key on the plot. */
32
+ export type AttributionPinReason = 'item-press' | 'shortcut';
33
+ export type AttributionPinDetails = ChangeDetails<AttributionPinReason>;
34
+ export type AttributionGraphProps = FigureProps & FigureSelectionProps & {
35
+ readonly layers: ReadonlyArray<AttributionLayer>;
36
+ /** Nodes in the order the application wants them within each layer. The graph never reorders them. */
37
+ readonly nodes: ReadonlyArray<AttributionNode>;
38
+ readonly edges: ReadonlyArray<AttributionEdge>;
39
+ /** What an edge weight measures, such as "Attribution". */
40
+ readonly weightLabel: string;
41
+ readonly weightFormat: ValueFormat;
42
+ /** What a node value measures, such as "Activation". Required when any node has a value. */
43
+ readonly valueLabel?: string | undefined;
44
+ readonly valueFormat?: ValueFormat | undefined;
45
+ /** Which way layers advance. Defaults to bottom to top, with the inputs at the bottom. */
46
+ readonly direction?: AttributionDirection | undefined;
47
+ /** The nodes a reader has pinned to build a subgraph. Leave it out and the graph keeps its own pins. */
48
+ readonly pinned?: ReadonlyArray<string> | undefined;
49
+ readonly onPinnedChange?: ((ids: ReadonlyArray<string>, details: AttributionPinDetails) => void) | undefined;
50
+ };
51
+ export declare const attributionLimits: {
52
+ readonly nodes: 400;
53
+ readonly edges: 2000;
54
+ readonly layers: 40;
55
+ };
56
+ /**
57
+ * An attribution graph: how a model computes an output, traced through input tokens, features in each layer and the
58
+ * output logits, with only supplied edges drawn. Nodes sit in supplied order within each layer, and edges carry
59
+ * supplied signed attributions, with hue giving the sign and width the size. Inspect a node to light its inputs and
60
+ * outputs, and pin nodes to keep their mutual edges in view.
61
+ */
62
+ export declare function AttributionGraph(props: AttributionGraphProps): ReactNode;