@mechane-ai/elements 0.46.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 (276) hide show
  1. package/README.md +306 -33
  2. package/dist/ai.js +4 -4
  3. package/dist/catalog.json +2382 -33
  4. package/dist/categorical-values-DdfGIowV.js +107 -0
  5. package/dist/cells--Bd1fQFR.js +384 -0
  6. package/dist/chart-link-AE_xuxiP.js +35 -0
  7. package/dist/chart-tones-ei3BC2AL.js +27 -0
  8. package/dist/charts/cartesian.js +1 -2958
  9. package/dist/charts/cells.js +1 -0
  10. package/dist/charts/comparison.js +1 -0
  11. package/dist/charts/distribution.js +1 -781
  12. package/dist/charts/figure.js +3404 -0
  13. package/dist/charts/graph.js +1 -655
  14. package/dist/charts/hierarchy.js +1 -121
  15. package/dist/charts/image.js +1 -0
  16. package/dist/charts/matrix.js +3 -644
  17. package/dist/charts/plot.js +15 -0
  18. package/dist/charts/relationship.js +1 -0
  19. package/dist/charts/text.js +1 -0
  20. package/dist/charts/timeline.js +1 -266
  21. package/dist/charts/transforms.js +677 -0
  22. package/dist/charts/trend.js +1 -0
  23. package/dist/charts.js +8 -3
  24. package/dist/collections.js +1 -2195
  25. package/dist/color-legend-CIo7DhXB.js +62 -0
  26. package/dist/dates-Cww8UR_n.js +810 -0
  27. package/dist/dumbbell-plot-B2ZTgQaI.js +508 -0
  28. package/dist/embedding-map-CGM_k6lC.js +1929 -0
  29. package/dist/feedback.js +1 -1
  30. package/dist/figure-format-B8kRZMlo.js +36 -0
  31. package/dist/figure-frame-wRkIEAwe.js +270 -0
  32. package/dist/forms/dates.js +1 -810
  33. package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
  34. package/dist/image-grid-CVA4SOy_.js +598 -0
  35. package/dist/kits/evaluation.js +431 -0
  36. package/dist/kits/explainers.js +452 -0
  37. package/dist/kits/interpretability.js +1033 -0
  38. package/dist/kits/operations.js +239 -0
  39. package/dist/kits/training.js +335 -0
  40. package/dist/label-place-Z0fryBZb.js +42 -0
  41. package/dist/locate-Bcg3QcP4.js +11 -0
  42. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
  43. package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
  44. package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
  45. package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
  46. package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
  47. package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
  48. package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
  49. package/dist/packages/charts/src/cartesian/index.d.ts +5 -5
  50. package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
  51. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +30 -25
  52. package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
  53. package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
  54. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
  55. package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
  56. package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
  57. package/dist/packages/charts/src/cartesian/time-series.d.ts +60 -36
  58. package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
  59. package/dist/packages/charts/src/categorical-values.d.ts +1 -1
  60. package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
  61. package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
  62. package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
  63. package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
  64. package/dist/packages/charts/src/cells/index.d.ts +11 -0
  65. package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
  66. package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
  67. package/dist/packages/charts/src/chart-frame.d.ts +14 -7
  68. package/dist/packages/charts/src/chart-grid.d.ts +19 -0
  69. package/dist/packages/charts/src/chart-input.d.ts +1 -9
  70. package/dist/packages/charts/src/chart-link.d.ts +56 -0
  71. package/dist/packages/charts/src/chart.d.ts +0 -8
  72. package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
  73. package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
  74. package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
  75. package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
  76. package/dist/packages/charts/src/comparison/index.d.ts +6 -0
  77. package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
  78. package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
  79. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
  80. package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
  81. package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
  82. package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
  83. package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
  84. package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
  85. package/dist/packages/charts/src/distribution/index.d.ts +11 -0
  86. package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
  87. package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
  88. package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
  89. package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
  90. package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
  91. package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
  92. package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
  93. package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
  94. package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
  95. package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
  96. package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
  97. package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
  98. package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
  99. package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
  100. package/dist/packages/charts/src/graph/index.d.ts +6 -2
  101. package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
  102. package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
  103. package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
  104. package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
  105. package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
  106. package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
  107. package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
  108. package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
  109. package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
  110. package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
  111. package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
  112. package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
  113. package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
  114. package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
  115. package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
  116. package/dist/packages/charts/src/image/image-input.d.ts +27 -0
  117. package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
  118. package/dist/packages/charts/src/image/index.d.ts +7 -0
  119. package/dist/packages/charts/src/index.d.ts +15 -1
  120. package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
  121. package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
  122. package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
  123. package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
  124. package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
  125. package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
  126. package/dist/packages/charts/src/matrix/index.d.ts +14 -3
  127. package/dist/packages/charts/src/matrix/matrix-cells.d.ts +27 -3
  128. package/dist/packages/charts/src/matrix/matrix-figure.d.ts +50 -0
  129. package/dist/packages/charts/src/matrix/matrix-mark.d.ts +34 -0
  130. package/dist/packages/charts/src/matrix/matrix-presets.d.ts +20 -0
  131. package/dist/packages/charts/src/matrix/matrix-range.d.ts +45 -0
  132. package/dist/packages/charts/src/matrix/matrix-strip.d.ts +13 -14
  133. package/dist/packages/charts/src/matrix/matrix-types.d.ts +40 -0
  134. package/dist/packages/charts/src/matrix/matrix.d.ts +13 -11
  135. package/dist/packages/charts/src/matrix/token-heatmap.d.ts +16 -10
  136. package/dist/packages/charts/src/plot/contours.d.ts +45 -0
  137. package/dist/packages/charts/src/plot/index.d.ts +49 -0
  138. package/dist/packages/charts/src/plot/label-place.d.ts +35 -0
  139. package/dist/packages/charts/src/plot/locate.d.ts +18 -0
  140. package/dist/packages/charts/src/plot/path.d.ts +39 -0
  141. package/dist/packages/charts/src/plot/plot-axes.d.ts +20 -0
  142. package/dist/packages/charts/src/plot/plot-layout.d.ts +221 -0
  143. package/dist/packages/charts/src/plot/plot-marks.d.ts +124 -0
  144. package/dist/packages/charts/src/plot/plot-surface.d.ts +32 -0
  145. package/dist/packages/charts/src/plot/render/density-layer.d.ts +17 -0
  146. package/dist/packages/charts/src/plot/render/hit-index.d.ts +37 -0
  147. package/dist/packages/charts/src/plot/render/plot-viewport.d.ts +39 -0
  148. package/dist/packages/charts/src/plot/render/point-layer.d.ts +41 -0
  149. package/dist/packages/charts/src/plot/render/theme-colors.d.ts +15 -0
  150. package/dist/packages/charts/src/plot/scale.d.ts +48 -0
  151. package/dist/packages/charts/src/plot/ticks.d.ts +34 -0
  152. package/dist/packages/charts/src/plot-width.d.ts +3 -2
  153. package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
  154. package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
  155. package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
  156. package/dist/packages/charts/src/relationship/index.d.ts +11 -0
  157. package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
  158. package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
  159. package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
  160. package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
  161. package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
  162. package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
  163. package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
  164. package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
  165. package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
  166. package/dist/packages/charts/src/spec/figure.d.ts +12 -0
  167. package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
  168. package/dist/packages/charts/src/spec/index.d.ts +10 -0
  169. package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
  170. package/dist/packages/charts/src/text/index.d.ts +11 -0
  171. package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
  172. package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
  173. package/dist/packages/charts/src/text/token-links.d.ts +49 -0
  174. package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
  175. package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
  176. package/dist/packages/charts/src/text/token-text.d.ts +39 -0
  177. package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
  178. package/dist/packages/charts/src/timeline/index.d.ts +3 -1
  179. package/dist/packages/charts/src/timeline/waterfall.d.ts +24 -13
  180. package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
  181. package/dist/packages/charts/src/transforms/density.d.ts +53 -0
  182. package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
  183. package/dist/packages/charts/src/transforms/index.d.ts +19 -0
  184. package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
  185. package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
  186. package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
  187. package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
  188. package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
  189. package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
  190. package/dist/packages/charts/src/transforms/values.d.ts +70 -0
  191. package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
  192. package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
  193. package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
  194. package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
  195. package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
  196. package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
  197. package/dist/packages/charts/src/trend/index.d.ts +10 -0
  198. package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
  199. package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
  200. package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
  201. package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
  202. package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
  203. package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
  204. package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
  205. package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
  206. package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
  207. package/dist/packages/kits/src/explainers/bound-value.d.ts +29 -0
  208. package/dist/packages/kits/src/explainers/figures.d.ts +31 -0
  209. package/dist/packages/kits/src/explainers/index.d.ts +8 -0
  210. package/dist/packages/kits/src/explainers/linked-target.d.ts +22 -0
  211. package/dist/packages/kits/src/explainers/story-steps.d.ts +46 -0
  212. package/dist/packages/kits/src/explainers/term.d.ts +29 -0
  213. package/dist/packages/kits/src/interpretability/attention-head-grid.d.ts +56 -0
  214. package/dist/packages/kits/src/interpretability/attribution-workbench.d.ts +29 -0
  215. package/dist/packages/kits/src/interpretability/embedding-atlas.d.ts +41 -0
  216. package/dist/packages/kits/src/interpretability/feature-card.d.ts +33 -0
  217. package/dist/packages/kits/src/interpretability/feature-list.d.ts +51 -0
  218. package/dist/packages/kits/src/interpretability/feature-logits.d.ts +23 -0
  219. package/dist/packages/kits/src/interpretability/features.d.ts +70 -0
  220. package/dist/packages/kits/src/interpretability/index.d.ts +16 -0
  221. package/dist/packages/kits/src/interpretability/kit-styles.d.ts +118 -0
  222. package/dist/packages/kits/src/interpretability/logit-lens.d.ts +50 -0
  223. package/dist/packages/kits/src/interpretability/node-panel.d.ts +32 -0
  224. package/dist/packages/kits/src/interpretability/shared-link.d.ts +8 -0
  225. package/dist/packages/kits/src/interpretability/steering-panel.d.ts +52 -0
  226. package/dist/packages/kits/src/operations/budget-board.d.ts +49 -0
  227. package/dist/packages/kits/src/operations/incident-timeline.d.ts +30 -0
  228. package/dist/packages/kits/src/operations/index.d.ts +6 -0
  229. package/dist/packages/kits/src/operations/service-health.d.ts +66 -0
  230. package/dist/packages/kits/src/training/index.d.ts +8 -0
  231. package/dist/packages/kits/src/training/run-dashboard.d.ts +49 -0
  232. package/dist/packages/kits/src/training/run-legend.d.ts +21 -0
  233. package/dist/packages/kits/src/training/run-marker.d.ts +5 -0
  234. package/dist/packages/kits/src/training/run-state.d.ts +7 -0
  235. package/dist/packages/kits/src/training/run-table.d.ts +63 -0
  236. package/dist/packages/kits/src/training/runs-overview.d.ts +20 -0
  237. package/dist/packages/kits/src/training/runs.d.ts +34 -0
  238. package/dist/path-BglsXpnO.js +59 -0
  239. package/dist/plot-axes-DJkLW4wk.js +100 -0
  240. package/dist/plot-layout-BEuoOHbs.js +911 -0
  241. package/dist/plot-marks-A64v7aTw.js +226 -0
  242. package/dist/plot-surface-CJTIqtck.js +51 -0
  243. package/dist/plot-width-DcqtSgzb.js +124 -0
  244. package/dist/point-layer-C-EYETAt.js +655 -0
  245. package/dist/reference-lines-CWA8VeUR.js +82 -0
  246. package/dist/scale-C2xgZyZN.js +63 -0
  247. package/dist/slope-chart-DT22h_ym.js +1279 -0
  248. package/dist/{src-DVHlknB6.js → src-CExIrXPC.js} +169 -193
  249. package/dist/src-D5NXRJZe.js +2195 -0
  250. package/dist/src-DIS0YOj0.js +44 -0
  251. package/dist/styles2.css +453 -62
  252. package/dist/time-series-IB3CB93O.js +2668 -0
  253. package/dist/token-heatmap-C00DnoNO.js +1354 -0
  254. package/dist/token-predictions-Cxx29iDr.js +1093 -0
  255. package/dist/tone-scope-DKiSw-JR.js +32 -0
  256. package/dist/tree-diagram-DsckNKaW.js +1629 -0
  257. package/dist/treemap-9_DpLCW9.js +472 -0
  258. package/dist/values-963L6n1m.js +65 -0
  259. package/dist/violin-plot-BhPHKXsN.js +1291 -0
  260. package/dist/waterfall-CGksuTy5.js +576 -0
  261. package/package.json +57 -4
  262. package/recipes/allocation-report.tsx +15 -7
  263. package/skills/extend-elements/SKILL.md +60 -0
  264. package/skills/review-elements/SKILL.md +43 -1
  265. package/skills/upgrade-elements/SKILL.md +3 -1
  266. package/skills/upgrade-elements/references/releases.md +184 -0
  267. package/skills/use-elements/SKILL.md +19 -13
  268. package/skills/use-elements/references/charts.md +362 -41
  269. package/skills/use-elements/references/figures.md +173 -0
  270. package/skills/use-elements/references/kits.md +198 -0
  271. package/dist/categorical-values-BXi-rJuv.js +0 -74
  272. package/dist/chart-data-CIJVWCYt.js +0 -21
  273. package/dist/chart-frame-BaxKn_MB.js +0 -236
  274. package/dist/chart-input-Bm82_9Rd.js +0 -22
  275. package/dist/chart-theme-4zprJ3rW.js +0 -404
  276. package/dist/plot-width-v2c_rA20.js +0 -63
@@ -0,0 +1,147 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { BarChartProps } from '../cartesian/bar-chart.tsx';
3
+ import type { BreakdownBarProps } from '../cartesian/breakdown-bar.tsx';
4
+ import type { BridgeChartProps } from '../cartesian/bridge-chart.tsx';
5
+ import type { ScatterPlotProps } from '../cartesian/scatter-plot.tsx';
6
+ import type { SparklineProps } from '../cartesian/sparkline.tsx';
7
+ import type { AreaChartProps, SmallMultiplesProps, TimeSeriesChartProps } from '../cartesian/time-series.tsx';
8
+ import type { BulletBarProps } from '../comparison/bullet-bar.tsx';
9
+ import type { DotPlotProps } from '../comparison/dot-plot.tsx';
10
+ import type { DumbbellPlotProps } from '../comparison/dumbbell-plot.tsx';
11
+ import type { BoxPlotProps } from '../distribution/box-plot.tsx';
12
+ import type { ECDFProps } from '../distribution/ecdf.tsx';
13
+ import type { HistogramProps } from '../distribution/histogram.tsx';
14
+ import type { IntervalPlotProps } from '../distribution/interval-plot.tsx';
15
+ import type { RankedBarsProps } from '../distribution/ranked-bars.tsx';
16
+ import type { RidgelineProps } from '../distribution/ridgeline.tsx';
17
+ import type { StripPlotProps } from '../distribution/strip-plot.tsx';
18
+ import type { ViolinPlotProps } from '../distribution/violin-plot.tsx';
19
+ import type { AttributionGraphProps } from '../graph/attribution-graph.tsx';
20
+ import type { FlowDiagramProps } from '../graph/flow-diagram.tsx';
21
+ import type { RelationGraphProps } from '../graph/relation-graph.tsx';
22
+ import type { TreeDiagramProps } from '../graph/tree-diagram.tsx';
23
+ import type { IcicleProps } from '../hierarchy/icicle.tsx';
24
+ import type { TreemapProps } from '../hierarchy/treemap.tsx';
25
+ import type { AttributionOverlayProps } from '../image/attribution-overlay.tsx';
26
+ import type { ImageAtlasProps } from '../image/image-atlas.tsx';
27
+ import type { ImageGridProps } from '../image/image-grid.tsx';
28
+ import type { AttentionMatrixProps } from '../matrix/attention-matrix.tsx';
29
+ import type { CalendarHeatmapProps } from '../matrix/calendar-heatmap.tsx';
30
+ import type { ConfusionMatrixProps } from '../matrix/confusion-matrix.tsx';
31
+ import type { CorrelationMatrixProps } from '../matrix/correlation-matrix.tsx';
32
+ import type { MatrixProps } from '../matrix/matrix.tsx';
33
+ import type { TokenHeatmapProps } from '../matrix/token-heatmap.tsx';
34
+ import type { ContourPlotProps } from '../relationship/contour-plot.tsx';
35
+ import type { DensityMapProps } from '../relationship/density-map.tsx';
36
+ import type { EmbeddingMapProps } from '../relationship/embedding-map.tsx';
37
+ import type { ParallelCoordinatesProps } from '../relationship/parallel-coordinates.tsx';
38
+ import type { ScatterMatrixProps } from '../relationship/scatter-matrix.tsx';
39
+ import type { TokenExamplesProps } from '../text/token-examples.tsx';
40
+ import type { TokenGridProps } from '../text/token-grid.tsx';
41
+ import type { TokenLinksProps } from '../text/token-links.tsx';
42
+ import type { TokenPredictionsProps } from '../text/token-predictions.tsx';
43
+ import type { EventStripProps } from '../timeline/event-strip.tsx';
44
+ import type { WaterfallProps } from '../timeline/waterfall.tsx';
45
+ import type { BumpChartProps } from '../trend/bump-chart.tsx';
46
+ import type { CurveChartProps } from '../trend/curve-chart.tsx';
47
+ import type { HorizonChartProps } from '../trend/horizon-chart.tsx';
48
+ import type { RunsChartProps } from '../trend/runs-chart.tsx';
49
+ import type { SlopeChartProps } from '../trend/slope-chart.tsx';
50
+ /** The props of every chart a figure spec can name, by chart name. */
51
+ export type FigureChartProps = {
52
+ readonly BarChart: BarChartProps;
53
+ readonly BridgeChart: BridgeChartProps;
54
+ readonly BreakdownBar: BreakdownBarProps;
55
+ readonly ScatterPlot: ScatterPlotProps;
56
+ readonly LineChart: TimeSeriesChartProps;
57
+ readonly AreaChart: AreaChartProps;
58
+ readonly SmallMultiples: SmallMultiplesProps;
59
+ readonly Sparkline: SparklineProps;
60
+ readonly Histogram: HistogramProps;
61
+ readonly ECDF: ECDFProps;
62
+ readonly IntervalPlot: IntervalPlotProps;
63
+ readonly RankedBars: RankedBarsProps;
64
+ readonly BoxPlot: BoxPlotProps;
65
+ readonly ViolinPlot: ViolinPlotProps;
66
+ readonly StripPlot: StripPlotProps;
67
+ readonly Ridgeline: RidgelineProps;
68
+ readonly Matrix: MatrixProps;
69
+ readonly TokenHeatmap: TokenHeatmapProps;
70
+ readonly ConfusionMatrix: ConfusionMatrixProps;
71
+ readonly CorrelationMatrix: CorrelationMatrixProps;
72
+ readonly AttentionMatrix: AttentionMatrixProps;
73
+ readonly CalendarHeatmap: CalendarHeatmapProps;
74
+ readonly RelationGraph: RelationGraphProps;
75
+ readonly FlowDiagram: FlowDiagramProps;
76
+ readonly AttributionGraph: AttributionGraphProps;
77
+ readonly TreeDiagram: TreeDiagramProps;
78
+ readonly Treemap: TreemapProps;
79
+ readonly Icicle: IcicleProps;
80
+ readonly Waterfall: WaterfallProps;
81
+ readonly EventStrip: EventStripProps;
82
+ readonly CurveChart: CurveChartProps;
83
+ readonly RunsChart: RunsChartProps;
84
+ readonly SlopeChart: SlopeChartProps;
85
+ readonly BumpChart: BumpChartProps;
86
+ readonly HorizonChart: HorizonChartProps;
87
+ readonly DotPlot: DotPlotProps;
88
+ readonly DumbbellPlot: DumbbellPlotProps;
89
+ readonly BulletBar: BulletBarProps;
90
+ readonly ContourPlot: ContourPlotProps;
91
+ readonly ScatterMatrix: ScatterMatrixProps;
92
+ readonly ParallelCoordinates: ParallelCoordinatesProps;
93
+ readonly EmbeddingMap: EmbeddingMapProps;
94
+ readonly DensityMap: DensityMapProps;
95
+ readonly TokenExamples: TokenExamplesProps;
96
+ readonly TokenPredictions: TokenPredictionsProps;
97
+ readonly TokenGrid: TokenGridProps;
98
+ readonly TokenLinks: TokenLinksProps;
99
+ readonly ImageGrid: ImageGridProps;
100
+ readonly AttributionOverlay: AttributionOverlayProps;
101
+ readonly ImageAtlas: ImageAtlasProps;
102
+ };
103
+ /** The name of a chart a figure spec can draw: "CurveChart", "Histogram". */
104
+ export type FigureChart = keyof FigureChartProps;
105
+ /** The folder a chart belongs to, which groups related charts in the guide and on the figure wall. */
106
+ export type FigureFamily = 'cartesian' | 'distribution' | 'matrix' | 'graph' | 'hierarchy' | 'timeline' | 'trend' | 'comparison' | 'relationship' | 'text' | 'image';
107
+ type JsonPrimitive = string | number | boolean | null | undefined;
108
+ /** True for a prop that takes React content, such as `actions`: JSON cannot carry it, so a spec leaves it out. */
109
+ type IsSlot<Value> = ReactElement extends NonNullable<Value> ? true : false;
110
+ /** A key a spec keeps: neither a callback (`on...`) nor a React content slot. */
111
+ type JsonKey<Key, Value> = Key extends `on${Capitalize<string>}` ? never : IsSlot<Value> extends true ? never : Key;
112
+ /** The props an object must supply: every key that is not optional. */
113
+ export type RequiredKey<Props> = {
114
+ readonly [Key in keyof Props]-?: Props extends Readonly<Record<Key, unknown>> ? Key : never;
115
+ }[keyof Props];
116
+ /** A required key whose value JSON cannot carry, such as a required function format. */
117
+ type ImpossibleKey<Shape> = {
118
+ readonly [Key in RequiredKey<Shape>]: Shape[Key] extends never ? Key : never;
119
+ }[RequiredKey<Shape>];
120
+ /** An object with a required key JSON cannot carry is not a JSON shape, so a union keeps only its other members. */
121
+ type JsonShape<Shape> = ImpossibleKey<Shape> extends never ? Shape : never;
122
+ /**
123
+ * The part of a value JSON can carry: callbacks, refs and React content are dropped. A format that accepts `Intl`
124
+ * options or a function keeps the options form only. A union member that needs a function is left out.
125
+ */
126
+ export type JsonData<Value> = Value extends JsonPrimitive ? Value : Value extends (...input: never) => unknown ? never : Value extends {
127
+ readonly current: unknown;
128
+ } ? never : Value extends ReadonlyArray<unknown> ? {
129
+ readonly [Index in keyof Value]: JsonData<Value[Index]>;
130
+ } : Value extends object ? JsonShape<{
131
+ readonly [Key in keyof Value as JsonKey<Key, Value[Key]>]: JsonData<Value[Key]>;
132
+ }> : never;
133
+ /** A chart's props as JSON can carry them: what an agent or a server writes in a figure spec. */
134
+ export type JsonProps<Props> = JsonData<Props>;
135
+ /** The spec of one named chart. */
136
+ export type FigureSpecOf<Chart extends FigureChart> = {
137
+ readonly chart: Chart;
138
+ readonly props: JsonProps<FigureChartProps[Chart]>;
139
+ };
140
+ /**
141
+ * A figure described as plain JSON: the chart to draw and its props. An agent or a server writes it,
142
+ * `validateFigureSpec` checks it and `Figure` draws it.
143
+ */
144
+ export type FigureSpec = {
145
+ readonly [Chart in FigureChart]: FigureSpecOf<Chart>;
146
+ }[FigureChart];
147
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { FigureSpec } from './figure-spec.ts';
2
+ /**
3
+ * A short plain-text account of a figure for places that cannot draw it: a chat transcript, a log, a screen reader
4
+ * summary or an agent reading its results back. It names the chart, its title and description, the source, how much of
5
+ * the data is drawn, the transforms and how many records it holds ("3 series, 120 points"). It does not restate the
6
+ * values.
7
+ */
8
+ export declare function describeFigure(spec: FigureSpec): string;
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FigureState } from './figure-registry.tsx';
3
+ export type FigureSpecProps = FigureState & {
4
+ /** A `FigureSpec`: typed in code, or parsed from JSON an agent or a server wrote. It is checked before drawing. */
5
+ readonly spec: unknown;
6
+ };
7
+ /**
8
+ * Draws a figure from its spec: the registered chart, with the spec's props. Selection and other state JSON cannot
9
+ * carry arrive beside the spec, and `status` overrides the spec's own while newer data loads. A spec that fails the
10
+ * check draws the shared invalid figure with the reason; it never throws.
11
+ */
12
+ export declare function Figure({ spec, ...state }: FigureSpecProps): ReactNode;
@@ -0,0 +1,85 @@
1
+ /** A number rounded to three decimals, so examples stay readable as JSON. */
2
+ export declare function round(value: number): number;
3
+ export type RangeInput = {
4
+ readonly count: number;
5
+ readonly start?: number | undefined;
6
+ readonly step?: number | undefined;
7
+ };
8
+ /** Evenly spaced numbers: `count` of them from `start`, `step` apart. */
9
+ export declare function range({ count, start, step }: RangeInput): ReadonlyArray<number>;
10
+ export type DecayInput = {
11
+ readonly xs: ReadonlyArray<number>;
12
+ readonly start: number;
13
+ readonly floor: number;
14
+ /** How fast the value falls toward the floor, per unit of `log10(x / xs[0])`. */
15
+ readonly rate: number;
16
+ /** The half-width of a band around each value, as a share of the value. Leave it out for no band. */
17
+ readonly spread?: number | undefined;
18
+ };
19
+ /** A loss-like curve that falls from `start` toward `floor` over log-spaced steps. */
20
+ export declare function decay({ xs, start, floor, rate, spread, }: DecayInput): ReadonlyArray<{
21
+ readonly x: number;
22
+ readonly y: number;
23
+ readonly lower?: number;
24
+ readonly upper?: number;
25
+ }>;
26
+ export type WaveInput = {
27
+ readonly count: number;
28
+ readonly base: number;
29
+ readonly amplitude: number;
30
+ /** Values per full cycle. */
31
+ readonly cycle: number;
32
+ readonly phase?: number | undefined;
33
+ /** Added per value, for a drift. */
34
+ readonly trend?: number | undefined;
35
+ };
36
+ /** A smooth, repeating series of values, such as daily traffic. */
37
+ export declare function wave({ count, base, amplitude, cycle, phase, trend }: WaveInput): ReadonlyArray<number>;
38
+ export type TimedInput = {
39
+ readonly start: number;
40
+ readonly step: number;
41
+ readonly values: ReadonlyArray<number | null>;
42
+ };
43
+ /** Values at evenly spaced instants, as time series points. */
44
+ export declare function timed({ start, step, values, }: TimedInput): ReadonlyArray<{
45
+ readonly timestamp: number;
46
+ readonly value: number | null;
47
+ }>;
48
+ export type BellInput = {
49
+ readonly center: number;
50
+ readonly width: number;
51
+ readonly from: number;
52
+ readonly to: number;
53
+ readonly count: number;
54
+ };
55
+ /** A normal density sampled at `count` evenly spaced values, for violins and ridgelines. */
56
+ export declare function bell({ center, width, from, to, count, }: BellInput): ReadonlyArray<{
57
+ readonly value: number;
58
+ readonly density: number;
59
+ }>;
60
+ export type PeaksInput = {
61
+ readonly columns: number;
62
+ readonly rows: number;
63
+ /** Peaks in grid units from the top left: where each sits, how wide it is and how high. */
64
+ readonly peaks: ReadonlyArray<{
65
+ readonly x: number;
66
+ readonly y: number;
67
+ readonly width: number;
68
+ readonly height: number;
69
+ }>;
70
+ };
71
+ /** A grid of values, row by row from the top, made of smooth peaks: a loss surface or a point density. */
72
+ export declare function peaks({ columns, rows, peaks: list }: PeaksInput): ReadonlyArray<number>;
73
+ export type DaysInput = {
74
+ /** The first day, as an instant at midnight UTC. */
75
+ readonly start: number;
76
+ /** The length of a day in the same unit. */
77
+ readonly step: number;
78
+ readonly count: number;
79
+ };
80
+ /** `count` consecutive calendar days, as `YYYY-MM-DD` strings. */
81
+ export declare function days({ start, step, count }: DaysInput): ReadonlyArray<string>;
82
+ /** A share rounded to four decimals, so `0.1234` reads as 12.34% with a percent format. */
83
+ export declare function share(value: number): number;
84
+ /** A small synthetic picture as a data URL: a white disc on a hue. The same index always gives the same picture. */
85
+ export declare function tile(index: number): string;
@@ -0,0 +1,10 @@
1
+ export type { ChartGuideEntry, ChartGuideText } from './chart-guide.tsx';
2
+ export { chartGuide } from './chart-guide.tsx';
3
+ export type { FigureSpecProps } from './figure.tsx';
4
+ export { Figure } from './figure.tsx';
5
+ export type { FigureSelectDetails, FigureState, JsonKind } from './figure-registry.tsx';
6
+ export { figureCharts } from './figure-registry.tsx';
7
+ export type { FigureChart, FigureChartProps, FigureFamily, FigureSpec, FigureSpecOf, JsonData, JsonProps, RequiredKey, } from './figure-spec.ts';
8
+ export { describeFigure } from './figure-text.ts';
9
+ export type { FigureSpecResult } from './validate-figure.ts';
10
+ export { validateFigureSpec } from './validate-figure.ts';
@@ -0,0 +1,15 @@
1
+ import type { FigureSpec } from './figure-spec.ts';
2
+ /** The outcome of checking a figure spec: the spec, typed, or the first reason it cannot be drawn. */
3
+ export type FigureSpecResult = {
4
+ readonly kind: 'ok';
5
+ readonly spec: FigureSpec;
6
+ } | {
7
+ readonly kind: 'invalid';
8
+ readonly message: string;
9
+ };
10
+ /**
11
+ * Checks a figure spec from an agent, a server or a file before it is drawn. The check is structural: an object, a
12
+ * registered `chart`, `props` with every required prop of the right JSON kind, no functions anywhere and a non-empty
13
+ * `locale`. Each chart checks its values itself and shows an invalid state with the reason.
14
+ */
15
+ export declare function validateFigureSpec(input: unknown): FigureSpecResult;
@@ -0,0 +1,11 @@
1
+ export type { TokenExample, TokenExampleToken, TokenExamplesProps } from './token-examples.tsx';
2
+ export { tokenExampleLimits, TokenExamples } from './token-examples.tsx';
3
+ export type { TokenGridCell, TokenGridColumn, TokenGridProps, TokenGridRow } from './token-grid.tsx';
4
+ export { TokenGrid, tokenGridCellId, tokenGridLimits } from './token-grid.tsx';
5
+ export type { TokenLink, TokenLinksProps, TokenLinkToken } from './token-links.tsx';
6
+ export { tokenLinkLimits, TokenLinks } from './token-links.tsx';
7
+ export type { TokenPrediction, TokenPredictionsProps } from './token-predictions.tsx';
8
+ export { tokenPredictionLimits, TokenPredictions } from './token-predictions.tsx';
9
+ export type { TokenPalette, TokenScale } from './token-scale.ts';
10
+ export type { TokenScaleLegendProps } from './token-text.tsx';
11
+ export { quoteToken, TokenScaleLegend, TokenText } from './token-text.tsx';
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ValueFormat } from '../figure/figure-format.ts';
3
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
4
+ import type { TokenScale } from './token-scale.ts';
5
+ /** One token of an example: its exact text and its value, or null where none was recorded. */
6
+ export type TokenExampleToken = {
7
+ readonly text: string;
8
+ readonly value: number | null;
9
+ };
10
+ /** One text example, such as a context that activates a feature, as its tokens in supplied order. */
11
+ export type TokenExample = {
12
+ readonly id: string;
13
+ /** A name for the example, such as its document and offset. Without one, the example is numbered. */
14
+ readonly label?: string | undefined;
15
+ readonly tokens: ReadonlyArray<TokenExampleToken>;
16
+ /** The position of the token the application marks as the peak. It is outlined, and `context` centers on it. */
17
+ readonly peakIndex?: number | undefined;
18
+ };
19
+ export type TokenExamplesProps = FigureProps & FigureSelectionProps & TokenScale & {
20
+ /** The examples, in the order the application ranked them. Every example shares one color scale. */
21
+ readonly examples: ReadonlyArray<TokenExample>;
22
+ /** What a token's value measures: "Activation". */
23
+ readonly valueLabel: string;
24
+ readonly valueFormat: ValueFormat;
25
+ /**
26
+ * Shows only this many tokens on each side of each example's peak. The rest stay hidden behind an ellipsis that
27
+ * says how many there are. Every example then needs a `peakIndex`.
28
+ */
29
+ readonly context?: number | undefined;
30
+ };
31
+ /** The most examples, and tokens per example, that `TokenExamples` draws. */
32
+ export declare const tokenExampleLimits: {
33
+ readonly examples: 50;
34
+ readonly tokensPerExample: 256;
35
+ };
36
+ /**
37
+ * The text examples that most activate a feature, one per row, each token shaded by its value on one scale shared by
38
+ * every example. Arrow keys step token by token, Up and Down move between examples, and the readout gives each token's
39
+ * exact text, position and value. The peak token is outlined and its value starts the row, and the chart suits a
40
+ * feature's top activations or any ranked set of contexts scored per token.
41
+ */
42
+ export declare function TokenExamples(props: TokenExamplesProps): ReactNode;
@@ -0,0 +1,47 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ValueFormat } from '../figure/figure-format.ts';
3
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
4
+ import type { TokenScale } from './token-scale.ts';
5
+ /** One position of the prompt, shown in the header row. */
6
+ export type TokenGridColumn = {
7
+ readonly id: string;
8
+ readonly token: string;
9
+ };
10
+ /** One ordered stage the predictions are read at, such as a layer. */
11
+ export type TokenGridRow = {
12
+ readonly id: string;
13
+ readonly label: string;
14
+ };
15
+ /** The prediction at one stage and position: a short token and its value, either of which may be missing. */
16
+ export type TokenGridCell = {
17
+ readonly rowId: string;
18
+ readonly columnId: string;
19
+ readonly token: string | null;
20
+ readonly value: number | null;
21
+ };
22
+ export type TokenGridProps = FigureProps & FigureSelectionProps & TokenScale & {
23
+ /** The prompt's tokens in order. A column's position is its place in this list. */
24
+ readonly columns: ReadonlyArray<TokenGridColumn>;
25
+ /** The stages from top to bottom, such as layers. */
26
+ readonly rows: ReadonlyArray<TokenGridRow>;
27
+ /** The supplied predictions. A row and column pair with no cell is drawn hollow and read as unavailable. */
28
+ readonly cells: ReadonlyArray<TokenGridCell>;
29
+ /** What a cell's value measures: "Probability". */
30
+ readonly valueLabel: string;
31
+ readonly valueFormat: ValueFormat;
32
+ };
33
+ /** The most cells, columns and rows `TokenGrid` draws. Every row and column pair counts as a cell. */
34
+ export declare const tokenGridLimits: {
35
+ readonly cells: 2400;
36
+ readonly columns: 64;
37
+ readonly rows: 64;
38
+ };
39
+ /** The id of the cell at a row and column, as `selected` and `onSelectedChange` name it. */
40
+ export declare function tokenGridCellId(rowId: string, columnId: string): string;
41
+ /**
42
+ * The logit-lens table: rows are layers or any ordered stage, columns are the positions of a prompt, and each cell
43
+ * holds the token predicted there, shaded by its value. Arrow keys move cell by cell, and the readout gives the stage,
44
+ * the position and its token, the prediction and its exact value. The grid scrolls inside its frame with its row labels
45
+ * and header kept in view, and it suits following how a prediction forms through a model.
46
+ */
47
+ export declare function TokenGrid(props: TokenGridProps): ReactNode;
@@ -0,0 +1,49 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ValueFormat } from '../figure/figure-format.ts';
3
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
4
+ import type { NumericDomain } from '../plot/scale.ts';
5
+ /** One token of the sequence, drawn in both rows. */
6
+ export type TokenLinkToken = {
7
+ readonly id: string;
8
+ readonly text: string;
9
+ };
10
+ /**
11
+ * A supplied weight between two tokens, such as how much one token attends to another. The words match AttentionMatrix:
12
+ * information moves from the source to the destination.
13
+ */
14
+ export type TokenLink = {
15
+ /** The token attended to: the one information is read from. Drawn in the top row. */
16
+ readonly sourceId: string;
17
+ /** The token that attends: the one that reads from the source. Drawn in the bottom row. */
18
+ readonly destinationId: string;
19
+ readonly weight: number;
20
+ };
21
+ export type TokenLinksProps = FigureProps & FigureSelectionProps & {
22
+ /** The sequence in order. A token's position is its place in this list. */
23
+ readonly tokens: ReadonlyArray<TokenLinkToken>;
24
+ /** The links to draw. Only supplied links are drawn; nearness never implies one. */
25
+ readonly links: ReadonlyArray<TokenLink>;
26
+ /** What a link's weight measures: "Attention weight". */
27
+ readonly weightLabel: string;
28
+ readonly valueFormat: ValueFormat;
29
+ /** The weights the line widths span. It starts at zero or above. */
30
+ readonly domain: NumericDomain;
31
+ /**
32
+ * How to read a link: from its source, the token attended to, in the top row, down to its destination, the token
33
+ * that attends, in the bottom row.
34
+ */
35
+ readonly direction: 'source-to-destination';
36
+ };
37
+ /** The most tokens and links `TokenLinks` draws. */
38
+ export declare const tokenLinkLimits: {
39
+ readonly tokens: 128;
40
+ readonly links: 4096;
41
+ };
42
+ /**
43
+ * Which tokens attend to which: the sequence drawn twice, sources (attended to) above and destinations (attending)
44
+ * below, joined by straight lines whose width and opacity follow the supplied weight. With nothing inspected every link
45
+ * is drawn faintly; inspecting or selecting a token draws only its links, and the readout lists its strongest links
46
+ * with exact weights. Long sequences scroll sideways inside the frame, because the two rows must stay aligned for the
47
+ * lines to read.
48
+ */
49
+ export declare function TokenLinks(props: TokenLinksProps): ReactNode;
@@ -0,0 +1,38 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ValueFormat } from '../figure/figure-format.ts';
3
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
4
+ import type { NumericDomain } from '../plot/scale.ts';
5
+ /** One predicted token: its exact text, its value, and optionally its value under a baseline condition. */
6
+ export type TokenPrediction = {
7
+ readonly id: string;
8
+ readonly token: string;
9
+ /** The value of this prediction, or null where none was recorded. */
10
+ readonly probability: number | null;
11
+ /** The value before an intervention, such as before steering. Drawn as a tick on the same axis. */
12
+ readonly baseline?: number | null | undefined;
13
+ /** True for the token the application expects, such as the correct answer. It is marked "target" in text. */
14
+ readonly isTarget?: boolean | undefined;
15
+ };
16
+ export type TokenPredictionsProps = FigureProps & FigureSelectionProps & {
17
+ /** The predictions in the order to draw them, usually most likely first. */
18
+ readonly predictions: ReadonlyArray<TokenPrediction>;
19
+ /** What the bars measure. Defaults to "Probability". */
20
+ readonly valueLabel?: string | undefined;
21
+ /** How values are written. Defaults to a percent. */
22
+ readonly valueFormat?: ValueFormat | undefined;
23
+ /** The value axis. It always holds zero, where the bars start. Leave it out to fit the values on round bounds. */
24
+ readonly domain?: NumericDomain | undefined;
25
+ /** What the baseline ticks are, such as "Before steering". */
26
+ readonly baselineLabel?: string | undefined;
27
+ };
28
+ /** The most predictions `TokenPredictions` draws. */
29
+ export declare const tokenPredictionLimits: {
30
+ readonly rows: 50;
31
+ };
32
+ /**
33
+ * What a model predicts next, as ranked tokens: each row is a token chip and a bar from zero, in one hue, with the
34
+ * target token marked in text. An ink tick on the same axis shows the value under another condition, such as before
35
+ * steering, and the readout gives both values and the signed change. Use it beside a prompt to show the next-token
36
+ * distribution, or to compare it before and after an intervention.
37
+ */
38
+ export declare function TokenPredictions(props: TokenPredictionsProps): ReactNode;
@@ -0,0 +1,20 @@
1
+ import type { NumericDomain } from '../plot/scale.ts';
2
+ /**
3
+ * How a token's value becomes a shade. A `sequential` palette darkens one hue from the low end of the domain to the
4
+ * high end. A `diverging` palette shades negative values in one hue and positive values in another, with zero left
5
+ * unshaded.
6
+ */
7
+ export type TokenPalette = 'sequential' | 'diverging';
8
+ /** The color scale of a text chart: the values its shades span and how they map to color. */
9
+ export type TokenScale = {
10
+ readonly domain: NumericDomain;
11
+ readonly palette: TokenPalette;
12
+ };
13
+ /** Why a color scale cannot be drawn, or undefined when it can. */
14
+ export declare function tokenScaleError({ domain, palette }: TokenScale): string | undefined;
15
+ /** True when a value lies outside its declared color domain or is not finite. Charts reject such input. */
16
+ export declare function isOutsideScale(value: number, domain: NumericDomain): boolean;
17
+ /** The shade of a value, as a CSS color that follows the theme. The value must lie inside the domain. */
18
+ export declare function tokenShade(value: number, { domain, palette }: TokenScale): string;
19
+ /** The CSS gradient a color legend draws: the scale's shades from the low end of the domain to the high end. */
20
+ export declare function tokenScaleGradient(scale: TokenScale): string;
@@ -0,0 +1,39 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ValueFormat } from '../figure/figure-format.ts';
3
+ import type { TokenScale } from './token-scale.ts';
4
+ /**
5
+ * A token's exact text as a readout writes it: in single quotes, with a newline, tab or other invisible character
6
+ * spelled as an escape. A token of only whitespace, or none, also says what it holds: `'\n' (newline)`.
7
+ */
8
+ export declare function quoteToken(text: string): string;
9
+ /**
10
+ * A token's exact text in the mono face. Spaces show a faint dot and newlines, tabs and other invisible characters a
11
+ * faint arrow or box, drawn beside the characters rather than in place of them. The text a reader copies is the
12
+ * supplied text, and an empty token shows a faint ∅.
13
+ */
14
+ export declare function TokenText({ text, shouldWrap, }: {
15
+ readonly text: string;
16
+ /** False keeps the token on one line, for a chip or a cell that clips what does not fit. */
17
+ readonly shouldWrap?: boolean | undefined;
18
+ }): ReactNode;
19
+ export type TokenScaleLegendProps = TokenScale & {
20
+ /** What the shade measures, with its unit. */
21
+ readonly label: string;
22
+ readonly locale: string;
23
+ readonly format: ValueFormat;
24
+ /** True when some token or cell has no value, so the legend explains the hollow mark. */
25
+ readonly hasMissing?: boolean | undefined;
26
+ };
27
+ /** The key to a text chart's shades: the measure, a ramp across the domain, its bounds, and the hollow missing mark. */
28
+ export declare function TokenScaleLegend({ label, domain, palette, locale, format, hasMissing, }: TokenScaleLegendProps): ReactNode;
29
+ /**
30
+ * A frame that scrolls sideways when its content is wider than the figure, and keeps the keyboard cursor in view. The
31
+ * element under the cursor carries `data-token-cursor`.
32
+ */
33
+ export declare function TokenScrollFrame({ cursor, isBounded, children, }: {
34
+ /** The id under the keyboard cursor. The frame scrolls the marked element into view when it changes. */
35
+ readonly cursor: string | null;
36
+ /** True to scroll down as well, inside a frame no taller than most of the window, for sticky headers. */
37
+ readonly isBounded?: boolean | undefined;
38
+ readonly children: ReactNode;
39
+ }): ReactNode;
@@ -0,0 +1,70 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
3
+ import type { TimeFormat } from '../figure/figure-format.ts';
4
+ import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
5
+ import type { NumericDomain } from '../plot/scale.ts';
6
+ /** A row of the strip, such as deploys, incidents or evaluation runs. */
7
+ export type EventStripLane = {
8
+ readonly id: string;
9
+ readonly label: string;
10
+ /** The hue of the lane's events. Absent takes the lane's automatic tone. */
11
+ readonly tone?: ChartTone | undefined;
12
+ };
13
+ /** Something that happened: at one instant when it has no `end`, or over an interval when it has one. */
14
+ export type EventStripItem = {
15
+ readonly id: string;
16
+ readonly laneId: string;
17
+ readonly label: string;
18
+ /** The instant it started, in milliseconds since the epoch. */
19
+ readonly start: number;
20
+ /** The instant it ended, after `start`. Leave it out for an event without duration, such as an alert. */
21
+ readonly end?: number | undefined;
22
+ /** A hue that overrides the lane's, such as a failed run in the negative tone. */
23
+ readonly tone?: ChartTone | undefined;
24
+ readonly detail?: string | undefined;
25
+ };
26
+ /** An instant drawn as a dashed rule across every lane, such as a release cut or a freeze. */
27
+ export type EventStripMarker = {
28
+ readonly id: string;
29
+ readonly label: string;
30
+ readonly at: number;
31
+ };
32
+ /**
33
+ * How the strip writes instants. Options name their own time zone; a function format needs `timeZone` beside it, so the
34
+ * axis ticks fall on that zone's clock.
35
+ */
36
+ export type EventStripTime = {
37
+ readonly timeFormat: Exclude<TimeFormat, (timestamp: number) => string>;
38
+ readonly timeZone?: undefined;
39
+ } | {
40
+ readonly timeFormat: (timestamp: number) => string;
41
+ readonly timeZone: string;
42
+ };
43
+ export type EventStripProps = FigureProps & FigureSelectionProps & EventStripTime & {
44
+ readonly lanes: ReadonlyArray<EventStripLane>;
45
+ readonly events: ReadonlyArray<EventStripItem>;
46
+ /** The first and last instant the strip spans, in milliseconds since the epoch. */
47
+ readonly domain: NumericDomain;
48
+ readonly markers?: ReadonlyArray<EventStripMarker> | undefined;
49
+ /**
50
+ * The lane-label gutter's width in pixels, which strips stacked in a column pass the same from `eventStripGutter`
51
+ * over all their lanes so their time axes line up. A label longer than the gutter is cut with an ellipsis and keeps
52
+ * its full text in a title. Absent fits this strip's own labels.
53
+ */
54
+ readonly gutterWidth?: number | undefined;
55
+ };
56
+ export declare const eventStripLimits: {
57
+ readonly lanes: 12;
58
+ readonly events: 1000;
59
+ };
60
+ /**
61
+ * The lane-label gutter that holds every listed label, in pixels. Pass the result as `gutterWidth` to each strip of a
62
+ * column, with the lane labels of all of them, so their time axes start at the same place.
63
+ */
64
+ export declare function eventStripGutter(labels: ReadonlyArray<string>): number;
65
+ /**
66
+ * Events along time in a few lanes: deploys, incidents, evaluation runs and alerts. An instant is a dot and an interval
67
+ * a bar, and events that overlap in a lane stack into rows. Dashed rules mark supplied instants across every lane, and
68
+ * the arrow keys step through events in time while Up and Down move to a neighboring lane.
69
+ */
70
+ export declare function EventStrip(props: EventStripProps): ReactNode;
@@ -1,2 +1,4 @@
1
- export type { WaterfallItem, WaterfallSelectDetails } from './waterfall.tsx';
1
+ export type { EventStripItem, EventStripLane, EventStripMarker, EventStripProps, EventStripTime, } from './event-strip.tsx';
2
+ export { EventStrip, eventStripGutter, eventStripLimits } from './event-strip.tsx';
3
+ export type { WaterfallGeometry, WaterfallItem, WaterfallProps, WaterfallSelectDetails, WaterfallTone, } from './waterfall.tsx';
2
4
  export { Waterfall } from './waterfall.tsx';