@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.
- package/README.md +353 -50
- package/bin/mechane-elements-catalog.mjs +42 -4
- package/dist/ai.js +268 -202
- package/dist/catalog.json +2480 -71
- package/dist/categorical-values-DdfGIowV.js +107 -0
- package/dist/cells--Bd1fQFR.js +384 -0
- package/dist/chart-cursor-1mFd48Jc.js +23 -0
- package/dist/chart-link-AE_xuxiP.js +35 -0
- package/dist/chart-tones-ei3BC2AL.js +27 -0
- package/dist/charts/cartesian.js +1 -2792
- package/dist/charts/cells.js +1 -0
- package/dist/charts/comparison.js +1 -0
- package/dist/charts/distribution.js +1 -709
- package/dist/charts/figure.js +3404 -0
- package/dist/charts/graph.js +1 -641
- package/dist/charts/hierarchy.js +1 -112
- package/dist/charts/image.js +1 -0
- package/dist/charts/matrix.js +3 -637
- package/dist/charts/plot.js +15 -0
- package/dist/charts/relationship.js +1 -0
- package/dist/charts/text.js +1 -0
- package/dist/charts/timeline.js +1 -233
- package/dist/charts/transforms.js +677 -0
- package/dist/charts/trend.js +1 -0
- package/dist/charts.js +8 -3
- package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
- package/dist/collections.js +1 -1735
- package/dist/color-legend-CIo7DhXB.js +62 -0
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +67 -66
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/csp.js +6 -11
- package/dist/dates-Cww8UR_n.js +810 -0
- package/dist/dumbbell-plot-B2ZTgQaI.js +508 -0
- package/dist/embedding-map-CGM_k6lC.js +1929 -0
- package/dist/feedback.js +1 -1
- package/dist/figure-format-B8kRZMlo.js +36 -0
- package/dist/figure-frame-wRkIEAwe.js +270 -0
- package/dist/forms/dates.js +1 -750
- package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
- package/dist/forms.js +3 -3
- package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
- package/dist/image-grid-CVA4SOy_.js +598 -0
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +431 -0
- package/dist/kits/explainers.js +452 -0
- package/dist/kits/interpretability.js +1033 -0
- package/dist/kits/operations.js +239 -0
- package/dist/kits/training.js +335 -0
- package/dist/label-place-Z0fryBZb.js +42 -0
- package/dist/layout.js +207 -207
- package/dist/locate-Bcg3QcP4.js +11 -0
- package/dist/navigation.js +4 -3
- package/dist/packages/ai/src/conversation.d.ts +2 -0
- package/dist/packages/ai/src/prompt-input.d.ts +7 -2
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
- package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
- package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
- package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
- package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
- package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
- package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
- package/dist/packages/charts/src/cartesian/index.d.ts +6 -5
- package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +37 -26
- package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
- package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
- package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
- package/dist/packages/charts/src/cartesian/time-series.d.ts +61 -27
- package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
- package/dist/packages/charts/src/categorical-values.d.ts +15 -10
- package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
- package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
- package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
- package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
- package/dist/packages/charts/src/cells/index.d.ts +11 -0
- package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
- package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
- package/dist/packages/charts/src/chart-frame.d.ts +17 -12
- package/dist/packages/charts/src/chart-grid.d.ts +19 -0
- package/dist/packages/charts/src/chart-input.d.ts +1 -9
- package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
- package/dist/packages/charts/src/chart-link.d.ts +56 -0
- package/dist/packages/charts/src/chart-range.d.ts +33 -0
- package/dist/packages/charts/src/chart-rows.d.ts +20 -0
- package/dist/packages/charts/src/chart-theme.d.ts +17 -0
- package/dist/packages/charts/src/chart.d.ts +73 -0
- package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
- package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
- package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
- package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
- package/dist/packages/charts/src/comparison/index.d.ts +6 -0
- package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
- package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
- package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
- package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
- package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
- package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
- package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
- package/dist/packages/charts/src/distribution/index.d.ts +11 -0
- package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
- package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
- package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
- package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
- package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
- package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
- package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
- package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
- package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
- package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
- package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
- package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
- package/dist/packages/charts/src/graph/index.d.ts +6 -2
- package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
- package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
- package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
- package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
- package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
- package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
- package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
- package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
- package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
- package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
- package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
- package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
- package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
- package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
- package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
- package/dist/packages/charts/src/image/image-input.d.ts +27 -0
- package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
- package/dist/packages/charts/src/image/index.d.ts +7 -0
- package/dist/packages/charts/src/index.d.ts +16 -1
- package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
- package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
- package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
- package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
- package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
- package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
- package/dist/packages/charts/src/matrix/index.d.ts +14 -3
- package/dist/packages/charts/src/matrix/matrix-cells.d.ts +27 -3
- package/dist/packages/charts/src/matrix/matrix-figure.d.ts +50 -0
- package/dist/packages/charts/src/matrix/matrix-mark.d.ts +34 -0
- package/dist/packages/charts/src/matrix/matrix-presets.d.ts +20 -0
- package/dist/packages/charts/src/matrix/matrix-range.d.ts +45 -0
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +13 -14
- package/dist/packages/charts/src/matrix/matrix-types.d.ts +40 -0
- package/dist/packages/charts/src/matrix/matrix.d.ts +13 -11
- package/dist/packages/charts/src/matrix/token-heatmap.d.ts +16 -10
- package/dist/packages/charts/src/plot/contours.d.ts +45 -0
- package/dist/packages/charts/src/plot/index.d.ts +49 -0
- package/dist/packages/charts/src/plot/label-place.d.ts +35 -0
- package/dist/packages/charts/src/plot/locate.d.ts +18 -0
- package/dist/packages/charts/src/plot/path.d.ts +39 -0
- package/dist/packages/charts/src/plot/plot-axes.d.ts +20 -0
- package/dist/packages/charts/src/plot/plot-layout.d.ts +221 -0
- package/dist/packages/charts/src/plot/plot-marks.d.ts +124 -0
- package/dist/packages/charts/src/plot/plot-surface.d.ts +32 -0
- package/dist/packages/charts/src/plot/render/density-layer.d.ts +17 -0
- package/dist/packages/charts/src/plot/render/hit-index.d.ts +37 -0
- package/dist/packages/charts/src/plot/render/plot-viewport.d.ts +39 -0
- package/dist/packages/charts/src/plot/render/point-layer.d.ts +41 -0
- package/dist/packages/charts/src/plot/render/theme-colors.d.ts +15 -0
- package/dist/packages/charts/src/plot/scale.d.ts +48 -0
- package/dist/packages/charts/src/plot/ticks.d.ts +34 -0
- package/dist/packages/charts/src/plot-width.d.ts +3 -3
- package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
- package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
- package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
- package/dist/packages/charts/src/relationship/index.d.ts +11 -0
- package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
- package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
- package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
- package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
- package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
- package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
- package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
- package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
- package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
- package/dist/packages/charts/src/spec/figure.d.ts +12 -0
- package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
- package/dist/packages/charts/src/spec/index.d.ts +10 -0
- package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
- package/dist/packages/charts/src/text/index.d.ts +11 -0
- package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
- package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
- package/dist/packages/charts/src/text/token-links.d.ts +49 -0
- package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
- package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
- package/dist/packages/charts/src/text/token-text.d.ts +39 -0
- package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
- package/dist/packages/charts/src/timeline/index.d.ts +3 -1
- package/dist/packages/charts/src/timeline/waterfall.d.ts +29 -14
- package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
- package/dist/packages/charts/src/transforms/density.d.ts +53 -0
- package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
- package/dist/packages/charts/src/transforms/index.d.ts +19 -0
- package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
- package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
- package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
- package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
- package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
- package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
- package/dist/packages/charts/src/transforms/values.d.ts +70 -0
- package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
- package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
- package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
- package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
- package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
- package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
- package/dist/packages/charts/src/trend/index.d.ts +10 -0
- package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
- package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
- package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
- package/dist/packages/collections/src/collection-controls.d.ts +5 -1
- package/dist/packages/collections/src/collection-filters.d.ts +4 -1
- package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
- package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
- package/dist/packages/collections/src/data-table-text.d.ts +13 -0
- package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
- package/dist/packages/collections/src/data-table.d.ts +3 -85
- package/dist/packages/collections/src/index.d.ts +11 -6
- package/dist/packages/collections/src/query-controls.d.ts +6 -2
- package/dist/packages/collections/src/table-results.d.ts +47 -13
- package/dist/packages/collections/src/timeline.d.ts +1 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
- package/dist/packages/collections/src/use-table-window.d.ts +25 -0
- package/dist/packages/content/src/viewer.d.ts +8 -0
- package/dist/packages/core/src/disclosure.d.ts +9 -1
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/route-link.d.ts +11 -0
- package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
- package/dist/packages/forms/src/file-picker.d.ts +15 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -6
- package/dist/packages/forms/src/forms.d.ts +4 -1
- package/dist/packages/forms/src/index.d.ts +4 -2
- package/dist/packages/forms/src/selection.d.ts +14 -0
- package/dist/packages/foundations/src/csp/index.d.ts +1 -1
- package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
- package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
- package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
- package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
- package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
- package/dist/packages/kits/src/explainers/bound-value.d.ts +29 -0
- package/dist/packages/kits/src/explainers/figures.d.ts +31 -0
- package/dist/packages/kits/src/explainers/index.d.ts +8 -0
- package/dist/packages/kits/src/explainers/linked-target.d.ts +22 -0
- package/dist/packages/kits/src/explainers/story-steps.d.ts +46 -0
- package/dist/packages/kits/src/explainers/term.d.ts +29 -0
- package/dist/packages/kits/src/interpretability/attention-head-grid.d.ts +56 -0
- package/dist/packages/kits/src/interpretability/attribution-workbench.d.ts +29 -0
- package/dist/packages/kits/src/interpretability/embedding-atlas.d.ts +41 -0
- package/dist/packages/kits/src/interpretability/feature-card.d.ts +33 -0
- package/dist/packages/kits/src/interpretability/feature-list.d.ts +51 -0
- package/dist/packages/kits/src/interpretability/feature-logits.d.ts +23 -0
- package/dist/packages/kits/src/interpretability/features.d.ts +70 -0
- package/dist/packages/kits/src/interpretability/index.d.ts +16 -0
- package/dist/packages/kits/src/interpretability/kit-styles.d.ts +118 -0
- package/dist/packages/kits/src/interpretability/logit-lens.d.ts +50 -0
- package/dist/packages/kits/src/interpretability/node-panel.d.ts +32 -0
- package/dist/packages/kits/src/interpretability/shared-link.d.ts +8 -0
- package/dist/packages/kits/src/interpretability/steering-panel.d.ts +52 -0
- package/dist/packages/kits/src/operations/budget-board.d.ts +49 -0
- package/dist/packages/kits/src/operations/incident-timeline.d.ts +30 -0
- package/dist/packages/kits/src/operations/index.d.ts +6 -0
- package/dist/packages/kits/src/operations/service-health.d.ts +66 -0
- package/dist/packages/kits/src/training/index.d.ts +8 -0
- package/dist/packages/kits/src/training/run-dashboard.d.ts +49 -0
- package/dist/packages/kits/src/training/run-legend.d.ts +21 -0
- package/dist/packages/kits/src/training/run-marker.d.ts +5 -0
- package/dist/packages/kits/src/training/run-state.d.ts +7 -0
- package/dist/packages/kits/src/training/run-table.d.ts +63 -0
- package/dist/packages/kits/src/training/runs-overview.d.ts +20 -0
- package/dist/packages/kits/src/training/runs.d.ts +34 -0
- package/dist/packages/navigation/src/index.d.ts +1 -1
- package/dist/path-BglsXpnO.js +59 -0
- package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
- package/dist/plot-axes-DJkLW4wk.js +100 -0
- package/dist/plot-layout-BEuoOHbs.js +911 -0
- package/dist/plot-marks-A64v7aTw.js +226 -0
- package/dist/plot-surface-CJTIqtck.js +51 -0
- package/dist/{plot-width-CIqBiHcd.js → plot-width-DcqtSgzb.js} +22 -3
- package/dist/point-layer-C-EYETAt.js +655 -0
- package/dist/reference-lines-CWA8VeUR.js +82 -0
- package/dist/scale-C2xgZyZN.js +63 -0
- package/dist/slope-chart-DT22h_ym.js +1279 -0
- package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
- package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
- package/dist/{src-Dcs3SZ9V.js → src-CExIrXPC.js} +170 -194
- package/dist/src-CGc_hjxJ.js +409 -0
- package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
- package/dist/src-D5NXRJZe.js +2195 -0
- package/dist/src-DIS0YOj0.js +44 -0
- package/dist/styles2.css +574 -161
- package/dist/time-series-IB3CB93O.js +2668 -0
- package/dist/token-heatmap-C00DnoNO.js +1354 -0
- package/dist/token-predictions-Cxx29iDr.js +1093 -0
- package/dist/tone-scope-DKiSw-JR.js +32 -0
- package/dist/tree-diagram-DsckNKaW.js +1629 -0
- package/dist/treemap-9_DpLCW9.js +472 -0
- package/dist/values-963L6n1m.js +65 -0
- package/dist/violin-plot-BhPHKXsN.js +1291 -0
- package/dist/waterfall-CGksuTy5.js +576 -0
- package/package.json +57 -7
- package/recipes/allocation-report.tsx +15 -7
- package/skills/extend-elements/SKILL.md +134 -0
- package/skills/review-elements/SKILL.md +118 -0
- package/skills/upgrade-elements/SKILL.md +36 -0
- package/skills/upgrade-elements/references/releases.md +242 -0
- package/skills/use-elements/SKILL.md +70 -13
- package/skills/use-elements/references/agent.md +57 -0
- package/skills/use-elements/references/charts.md +384 -0
- package/skills/use-elements/references/collections.md +89 -0
- package/skills/use-elements/references/conversations.md +47 -0
- package/skills/use-elements/references/figures.md +173 -0
- package/skills/use-elements/references/forms.md +81 -0
- package/skills/use-elements/references/kits.md +198 -0
- package/skills/use-elements/references/styling.md +70 -0
- package/skills/use-elements/references/workspace.md +3 -3
- package/dist/categorical-values-DZLGQVW1.js +0 -63
- package/dist/chart-frame-Ztktqs1b.js +0 -255
- package/dist/chart-input-BO3BqlFO.js +0 -22
- package/dist/chart-navigation-BAbb5PV9.js +0 -154
- package/dist/header-styles-COxCYFZx.js +0 -90
- package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
- package/dist/packages/charts/src/chart-surface.d.ts +0 -27
- package/dist/packages/navigation/src/route-link.d.ts +0 -2
- package/dist/src-Bk7M67zy.js +0 -396
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ChangeDetails } from '@ui-sdk/core';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { ValueFormat } from '../../../charts/src/index.ts';
|
|
4
|
+
import type { ValueStateProperties } from '../../../foundations/src/control-state.ts';
|
|
5
|
+
/** How a bound value maps a drag to a value: evenly, or by ratio so each tenfold takes the same distance. */
|
|
6
|
+
export type BoundValueScale = 'linear' | 'log';
|
|
7
|
+
/** Why the value changed: a horizontal drag, an arrow, Page, Home or End key, or an agent's call. */
|
|
8
|
+
export type BoundValueChangeDetails = ChangeDetails<'drag' | 'step-key' | 'imperative'>;
|
|
9
|
+
type BoundValueChange = (value: number, details: BoundValueChangeDetails) => void;
|
|
10
|
+
export type BoundValueProps = ValueStateProperties<number, BoundValueChange> & {
|
|
11
|
+
/** The lowest and highest values the reader can pick. */
|
|
12
|
+
readonly min: number;
|
|
13
|
+
readonly max: number;
|
|
14
|
+
/** The grid values land on, in the value's units. */
|
|
15
|
+
readonly step: number;
|
|
16
|
+
/** `log` gives each tenfold the same drag distance, for rates, sizes and other ratios. */
|
|
17
|
+
readonly scale?: BoundValueScale | undefined;
|
|
18
|
+
readonly locale: string;
|
|
19
|
+
readonly format: ValueFormat;
|
|
20
|
+
/** What the number is, for assistive technology: "Learning rate". */
|
|
21
|
+
readonly label: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A number in a sentence that the reader changes in place: "with a learning rate of 0.003". Drag it sideways to scrub,
|
|
25
|
+
* or focus it and use the arrow keys, Page Up and Page Down, Home and End. Assistive technology hears it as a slider
|
|
26
|
+
* with the formatted value, and the value is the application's: pass `value` and `onValueChange`, or a `defaultValue`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function BoundValue({ label, locale, format, ...options }: BoundValueProps): ReactNode;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ExplainerProps = {
|
|
3
|
+
/** The id of every numbered figure, in reading order. Numbers come from this list, so server and browser agree. */
|
|
4
|
+
readonly figures: ReadonlyArray<string>;
|
|
5
|
+
/** The article: prose, figures and references in any arrangement. */
|
|
6
|
+
readonly children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A long page whose figures are numbered and referred to by number, like a paper. List the figure ids in reading order;
|
|
10
|
+
* each `NumberedFigure` shows its number and each `FigureReference` links to it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Explainer({ figures, children }: ExplainerProps): ReactNode;
|
|
13
|
+
export type NumberedFigureProps = {
|
|
14
|
+
/** The figure's id in the explainer's list. It is also the element id, so `#id` links land on the figure. */
|
|
15
|
+
readonly id: string;
|
|
16
|
+
/** What the reader should see in the figure, after its number. */
|
|
17
|
+
readonly caption: ReactNode;
|
|
18
|
+
/** The chart, diagram or image. */
|
|
19
|
+
readonly children: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A chart or diagram with its number and caption below it: "Figure 2. Loss falls faster for the wide run." A figure the
|
|
23
|
+
* explainer does not list says so in place of its number.
|
|
24
|
+
*/
|
|
25
|
+
export declare function NumberedFigure({ id, caption, children }: NumberedFigureProps): ReactNode;
|
|
26
|
+
export type FigureReferenceProps = {
|
|
27
|
+
/** The id of the figure the reference points to. */
|
|
28
|
+
readonly to: string;
|
|
29
|
+
};
|
|
30
|
+
/** "Figure 2" in prose, as a link that moves the reader to that figure. An unknown id shows an error in its place. */
|
|
31
|
+
export declare function FigureReference({ to }: FigureReferenceProps): ReactNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { BoundValueChangeDetails, BoundValueProps, BoundValueScale } from './bound-value.tsx';
|
|
2
|
+
export { BoundValue } from './bound-value.tsx';
|
|
3
|
+
export type { ExplainerProps, FigureReferenceProps, NumberedFigureProps } from './figures.tsx';
|
|
4
|
+
export { Explainer, FigureReference, NumberedFigure } from './figures.tsx';
|
|
5
|
+
export type { StoryStep, StoryStepChangeDetails, StoryStepsLabels, StoryStepsProps } from './story-steps.tsx';
|
|
6
|
+
export { StorySteps } from './story-steps.tsx';
|
|
7
|
+
export type { DiagramPartProps, TermProps } from './term.tsx';
|
|
8
|
+
export { DiagramPart, Term } from './term.tsx';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FocusEvent, MouseEvent, PointerEvent } from 'react';
|
|
2
|
+
/** The events a piece of prose or a diagram part listens to so it can point the linked figures at its record. */
|
|
3
|
+
export type LinkedTargetHandlers = {
|
|
4
|
+
readonly onPointerEnter: (event: PointerEvent) => void;
|
|
5
|
+
readonly onPointerLeave: (event: PointerEvent) => void;
|
|
6
|
+
readonly onFocus: (event: FocusEvent) => void;
|
|
7
|
+
readonly onBlur: (event: FocusEvent) => void;
|
|
8
|
+
readonly onClick: (event: MouseEvent) => void;
|
|
9
|
+
};
|
|
10
|
+
/** A record outside the charts that points into them: whether the link inspects it now, and the events that set it. */
|
|
11
|
+
export type LinkedTarget = {
|
|
12
|
+
readonly isInspected: boolean;
|
|
13
|
+
readonly handlers: LinkedTargetHandlers;
|
|
14
|
+
/** Points the link at this record from a press that is not a click, such as Enter on a diagram part. */
|
|
15
|
+
readonly press: (event: Event) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Points the enclosing chart link at `id` while a mouse rests on the element or keyboard focus is in it, and on a
|
|
19
|
+
* press, so touch readers get it too. Leaving clears the link only while it still holds this id, so moving from one
|
|
20
|
+
* term straight to another never clears the second.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useLinkedTarget(id: string): LinkedTarget;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ChangeDetails } from '@ui-sdk/core';
|
|
2
|
+
import type { SegmentedControlValueChangeReason } from '@ui-sdk/core/segmented-control';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
/** One observation in a walk through the figures. */
|
|
5
|
+
export type StoryStep = {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly title: string;
|
|
8
|
+
/** The explanation: a few sentences, which may hold `Term`s and `FigureReference`s. */
|
|
9
|
+
readonly body: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* The record this step talks about, which every linked figure inspects while the step is shown. The reader can still
|
|
12
|
+
* inspect freely, and the next step points the figures again.
|
|
13
|
+
*/
|
|
14
|
+
readonly inspected?: string | null | undefined;
|
|
15
|
+
};
|
|
16
|
+
/** Why the step changed: Back or Next, a press on a step's number, or an arrow key on the numbers. */
|
|
17
|
+
export type StoryStepChangeDetails = ChangeDetails<SegmentedControlValueChangeReason | 'previous-press' | 'next-press'>;
|
|
18
|
+
/** The words of the step controls. The position reads "Step 2 of 5": `step`, the number, `of`, the count. */
|
|
19
|
+
export type StoryStepsLabels = {
|
|
20
|
+
readonly back: string;
|
|
21
|
+
readonly next: string;
|
|
22
|
+
readonly step: string;
|
|
23
|
+
readonly of: string;
|
|
24
|
+
};
|
|
25
|
+
export type StoryStepsProps = {
|
|
26
|
+
/**
|
|
27
|
+
* Back, Next and the step numbers move between steps, and the arrow keys move along the numbers. Nothing advances on
|
|
28
|
+
* its own.
|
|
29
|
+
*/
|
|
30
|
+
readonly steps: ReadonlyArray<StoryStep>;
|
|
31
|
+
/** The id of the step shown, when the application holds it. */
|
|
32
|
+
readonly step?: string | undefined;
|
|
33
|
+
readonly defaultStep?: string | undefined;
|
|
34
|
+
readonly onStepChange?: ((step: string, details: StoryStepChangeDetails) => void) | undefined;
|
|
35
|
+
/** Names the walk for assistive technology, such as "How the runs differ". */
|
|
36
|
+
readonly label?: string | undefined;
|
|
37
|
+
readonly labels?: Partial<StoryStepsLabels> | undefined;
|
|
38
|
+
/** The figures the steps talk about. They share one inspection with the steps. */
|
|
39
|
+
readonly children: ReactNode;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* An explanation told in steps beside its figures, like a guided reading of a chart, where each step points every
|
|
43
|
+
* linked figure at the record it talks about. Inside an enclosing `ChartLink`, such as one around a whole article, it
|
|
44
|
+
* points that link on each move instead of keeping its own. Terms anywhere on the page then reach the same figures.
|
|
45
|
+
*/
|
|
46
|
+
export declare function StorySteps({ steps, step, defaultStep, onStepChange, label, labels, children, }: StoryStepsProps): ReactNode;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type TermProps = {
|
|
3
|
+
/** The record the term names, by the id the figures use for it: a series, a run, a step. */
|
|
4
|
+
readonly inspects: string;
|
|
5
|
+
/** The words in the sentence. */
|
|
6
|
+
readonly children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A word in prose that points into the figures: hovering or focusing "the base run" highlights that run in every chart
|
|
10
|
+
* of the enclosing `ChartLink`. A press does the same on touch. Its dotted underline takes the record's hue when a
|
|
11
|
+
* `ToneScope` names it, so the sentence doubles as a legend.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Term({ inspects, children }: TermProps): ReactNode;
|
|
14
|
+
export type DiagramPartProps = {
|
|
15
|
+
/** The record this part of the diagram stands for, by the id the figures and terms use for it. */
|
|
16
|
+
readonly inspects: string;
|
|
17
|
+
/** What the part is, for a reader who cannot see it: "Attention layer". */
|
|
18
|
+
readonly label: string;
|
|
19
|
+
/**
|
|
20
|
+
* The part's shapes. Draw them without their own stroke, stroke width or fill and they take the part's hue, and its
|
|
21
|
+
* emphasis while the link inspects this record.
|
|
22
|
+
*/
|
|
23
|
+
readonly children: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A part of a hand-drawn SVG diagram linked to the figures both ways: pointing at it or focusing it highlights its
|
|
27
|
+
* record in every chart of the enclosing `ChartLink`. It is emphasized whenever a chart or a `Term` inspects it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function DiagramPart({ inspects, label, children }: DiagramPartProps): ReactNode;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FigureProps } from '../../../charts/src/index.ts';
|
|
3
|
+
import type { AttentionToken } from '../../../charts/src/matrix/index.ts';
|
|
4
|
+
import type { InterpretabilityChangeDetails } from './features.ts';
|
|
5
|
+
/** One attention head: its name and its attention pattern over the shared tokens. */
|
|
6
|
+
export type AttentionHead = {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
/** "Layer 5 · head 1". */
|
|
9
|
+
readonly label: string;
|
|
10
|
+
/** A short note on what the head appears to do: "Attends to the previous token". */
|
|
11
|
+
readonly description?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Weights in [0, 1] as a model computes them: one line per destination (the token that attends), one weight per
|
|
14
|
+
* source (the token attended to), in token order. Null marks a masked or unrecorded pair.
|
|
15
|
+
*/
|
|
16
|
+
readonly weights: ReadonlyArray<ReadonlyArray<number | null>>;
|
|
17
|
+
};
|
|
18
|
+
/** The words around the heads. Each has an English default. */
|
|
19
|
+
export type AttentionHeadGridLabels = {
|
|
20
|
+
readonly inspect: string;
|
|
21
|
+
readonly inspecting: string;
|
|
22
|
+
readonly heads: string;
|
|
23
|
+
readonly links: string;
|
|
24
|
+
readonly linksDescription: string;
|
|
25
|
+
readonly weight: string;
|
|
26
|
+
};
|
|
27
|
+
export type AttentionHeadGridProps = Pick<FigureProps, 'title' | 'description' | 'locale' | 'status' | 'coverage' | 'source'> & {
|
|
28
|
+
/** The sequence every head attends over, as both sources and destinations. */
|
|
29
|
+
readonly tokens: ReadonlyArray<AttentionToken>;
|
|
30
|
+
readonly heads: ReadonlyArray<AttentionHead>;
|
|
31
|
+
/** `causal` draws each pair where a token would read a later token as masked. Their weights must be null. */
|
|
32
|
+
readonly mask?: 'none' | 'causal' | undefined;
|
|
33
|
+
/** The head shown enlarged, with its links. Absent or null enlarges the first head. */
|
|
34
|
+
readonly selected?: string | null | undefined;
|
|
35
|
+
readonly onSelectedChange?: ((id: string, details: InterpretabilityChangeDetails) => void) | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The pair marked in every head, as `matrixCellId(destination, source)`: the token that attends, then the token
|
|
38
|
+
* attended to. Every head shows it, and pointing at a pair in one head marks it in every head.
|
|
39
|
+
*/
|
|
40
|
+
readonly pair?: string | null | undefined;
|
|
41
|
+
readonly onPairChange?: ((id: string, details: InterpretabilityChangeDetails) => void) | undefined;
|
|
42
|
+
/** The narrowest a small head panel may be, in CSS pixels. */
|
|
43
|
+
readonly minPanelWidth?: number | undefined;
|
|
44
|
+
readonly labels?: Partial<AttentionHeadGridLabels> | undefined;
|
|
45
|
+
};
|
|
46
|
+
/** The most heads the grid draws at once. Supply one layer, or the heads a study is about. */
|
|
47
|
+
export declare const attentionHeadLimits: {
|
|
48
|
+
readonly heads: 32;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Attention heads as small multiples, the way circuit papers compare them: one color-only attention pattern per head
|
|
52
|
+
* over the same tokens and the same 0 to 1 color scale. The selected head is drawn large, beside the lines from each
|
|
53
|
+
* token to the tokens it attends to. Attention weights describe where a head reads from, and are not by themselves an
|
|
54
|
+
* explanation of what it computes.
|
|
55
|
+
*/
|
|
56
|
+
export declare function AttentionHeadGrid({ title, description, locale, status, coverage, source, tokens, heads, mask, selected, onSelectedChange, pair, onPairChange, minPanelWidth, labels: given, }: AttentionHeadGridProps): ReactNode;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AttributionGraphProps } from '../../../charts/src/graph/index.ts';
|
|
3
|
+
import type { FeatureCardData, InterpretabilityChangeDetails } from './features.ts';
|
|
4
|
+
import type { NodePanelLabels } from './node-panel.tsx';
|
|
5
|
+
export type AttributionWorkbenchLabels = NodePanelLabels;
|
|
6
|
+
export type AttributionWorkbenchProps = Omit<AttributionGraphProps, 'selected' | 'onSelectedChange' | 'pinned' | 'onPinnedChange'> & {
|
|
7
|
+
/**
|
|
8
|
+
* What the panel shows for each feature node, keyed by node id. A node without an entry shows its name only. The
|
|
9
|
+
* application supplies a card for each feature node.
|
|
10
|
+
*/
|
|
11
|
+
readonly details: Readonly<Record<string, FeatureCardData>>;
|
|
12
|
+
/** The node the reader opened. It stays in the panel while nothing else is pointed at. */
|
|
13
|
+
readonly selected?: string | null | undefined;
|
|
14
|
+
readonly onSelectedChange?: ((id: string, details: InterpretabilityChangeDetails) => void) | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The nodes pinned to build a subgraph, in the order they were pinned. The application holds the selection and the
|
|
17
|
+
* pins.
|
|
18
|
+
*/
|
|
19
|
+
readonly pinned?: ReadonlyArray<string> | undefined;
|
|
20
|
+
readonly onPinnedChange?: ((ids: ReadonlyArray<string>, details: InterpretabilityChangeDetails) => void) | undefined;
|
|
21
|
+
readonly labels?: Partial<AttributionWorkbenchLabels> | undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* An attribution graph beside a panel for the node in focus, the way circuit-tracing tools present a traced prompt.
|
|
25
|
+
* Point at a node to read its feature card; press it to keep it in the panel; pin nodes to build a subgraph and step
|
|
26
|
+
* between them. The graph and the panel share one chart link, so a feature list or map on the same page lights the same
|
|
27
|
+
* node.
|
|
28
|
+
*/
|
|
29
|
+
export declare function AttributionWorkbench({ details, selected, onSelectedChange, pinned, onPinnedChange, labels: given, ...graph }: AttributionWorkbenchProps): ReactNode;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { EmbeddingMapProps } from '../../../charts/src/relationship/index.ts';
|
|
3
|
+
import type { FeatureCardLabels } from './feature-card.tsx';
|
|
4
|
+
import type { FeatureCardData, InterpretabilityChangeDetails } from './features.ts';
|
|
5
|
+
/** The words beside the map. Each has an English default. */
|
|
6
|
+
export type EmbeddingAtlasLabels = {
|
|
7
|
+
readonly search: string;
|
|
8
|
+
readonly searchDescription: string;
|
|
9
|
+
readonly matches: string;
|
|
10
|
+
readonly noMatches: string;
|
|
11
|
+
readonly more: string;
|
|
12
|
+
readonly hint: string;
|
|
13
|
+
readonly card: Partial<FeatureCardLabels>;
|
|
14
|
+
};
|
|
15
|
+
export type EmbeddingAtlasProps = Omit<EmbeddingMapProps, 'selected' | 'onSelectedChange' | 'landmarks'> & {
|
|
16
|
+
/**
|
|
17
|
+
* The features a reader can find, each placed on the map as a labelled landmark. Its card data comes from `details`
|
|
18
|
+
* under the same id.
|
|
19
|
+
*/
|
|
20
|
+
readonly landmarks: ReadonlyArray<{
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly x: number;
|
|
23
|
+
readonly y: number;
|
|
24
|
+
}>;
|
|
25
|
+
/** Each findable feature's card: its name, explanation and any charts. Keyed by landmark id. */
|
|
26
|
+
readonly details: Readonly<Record<string, FeatureCardData>>;
|
|
27
|
+
/** The search text. Only matching landmarks stay labelled on the map. */
|
|
28
|
+
readonly query?: string | undefined;
|
|
29
|
+
readonly onQueryChange?: ((query: string, details: InterpretabilityChangeDetails) => void) | undefined;
|
|
30
|
+
/** The feature whose card is open beside the map. */
|
|
31
|
+
readonly selected?: string | null | undefined;
|
|
32
|
+
readonly onSelectedChange?: ((id: string, details: InterpretabilityChangeDetails) => void) | undefined;
|
|
33
|
+
readonly labels?: Partial<EmbeddingAtlasLabels> | undefined;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A map of features, such as a projection of decoder directions, with a search over the labelled features beside it.
|
|
37
|
+
* Typing narrows the labels on the map and lists the matches; resting on a match lights its label; pressing one, or its
|
|
38
|
+
* label on the map, opens its card. The application projects the points, holds the search text and the selection, and
|
|
39
|
+
* supplies the cards.
|
|
40
|
+
*/
|
|
41
|
+
export declare function EmbeddingAtlas({ landmarks, details, query, onQueryChange, selected, onSelectedChange, labels: given, ...map }: EmbeddingAtlasProps): ReactNode;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FigureStatus, ValueFormat } from '../../../charts/src/index.ts';
|
|
3
|
+
import type { FeatureLogitLabels } from './feature-logits.tsx';
|
|
4
|
+
import type { FeatureCardData } from './features.ts';
|
|
5
|
+
/** How much of a feature a card shows: a compact card for grids and side panels, or the full card for a detail page. */
|
|
6
|
+
export type FeatureCardSize = 'compact' | 'full';
|
|
7
|
+
/** The words on a feature card. Each has an English default. */
|
|
8
|
+
export type FeatureCardLabels = FeatureLogitLabels & {
|
|
9
|
+
readonly density: string;
|
|
10
|
+
readonly densityDescription: string;
|
|
11
|
+
readonly examples: string;
|
|
12
|
+
readonly examplesDescription: string;
|
|
13
|
+
readonly activation: string;
|
|
14
|
+
readonly frequency: string;
|
|
15
|
+
readonly noData: string;
|
|
16
|
+
};
|
|
17
|
+
export type FeatureCardProps = FeatureCardData & {
|
|
18
|
+
readonly locale: string;
|
|
19
|
+
readonly status?: FigureStatus | undefined;
|
|
20
|
+
/** Use `compact` in grids and side panels, and `full` on a feature's own page. */
|
|
21
|
+
readonly size?: FeatureCardSize | undefined;
|
|
22
|
+
/** How the activation frequency is written. Absent writes a percent with two significant digits. */
|
|
23
|
+
readonly frequencyFormat?: ValueFormat | undefined;
|
|
24
|
+
/** Controls beside the feature's name, such as a pin or a link to its page. */
|
|
25
|
+
readonly actions?: ReactNode;
|
|
26
|
+
readonly labels?: Partial<FeatureCardLabels> | undefined;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* One learned feature at a glance, as interpretability papers and feature browsers show it. The card shows its name, id
|
|
30
|
+
* and explanation, how often it fires and how strongly, the contexts that activate it most, and the output tokens it
|
|
31
|
+
* promotes and suppresses. Supply only the parts you have, and the card leaves out the rest.
|
|
32
|
+
*/
|
|
33
|
+
export declare function FeatureCard({ feature, density, examples, logits, locale, status, size, frequencyFormat, actions, labels: given, }: FeatureCardProps): ReactNode;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FigureStatus, NumericDomain, ValueFormat } from '../../../charts/src/index.ts';
|
|
3
|
+
import type { DataTableSort } from '../../../collections/src/index.ts';
|
|
4
|
+
import type { FeatureSummary, InterpretabilityChangeDetails } from './features.ts';
|
|
5
|
+
/** One row of the list: a feature with the measures the application computed for it. */
|
|
6
|
+
export type FeatureListRow = FeatureSummary & {
|
|
7
|
+
/** The largest activation seen, or null where it was not measured. */
|
|
8
|
+
readonly maxActivation?: number | null | undefined;
|
|
9
|
+
/** The feature's activation at each layer, in `layers` order, for a tiny curve. */
|
|
10
|
+
readonly profile?: ReadonlyArray<number | null> | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** The words in the list. Each has an English default. */
|
|
13
|
+
export type FeatureListLabels = {
|
|
14
|
+
readonly feature: string;
|
|
15
|
+
readonly frequency: string;
|
|
16
|
+
readonly maxActivation: string;
|
|
17
|
+
readonly profile: string;
|
|
18
|
+
readonly search: string;
|
|
19
|
+
readonly searchPlaceholder: string;
|
|
20
|
+
readonly empty: string;
|
|
21
|
+
readonly noMatches: string;
|
|
22
|
+
};
|
|
23
|
+
export type FeatureListProps = {
|
|
24
|
+
/** The table's caption, which names it for assistive technology. */
|
|
25
|
+
readonly title: string;
|
|
26
|
+
readonly locale: string;
|
|
27
|
+
readonly status?: FigureStatus | undefined;
|
|
28
|
+
readonly features: ReadonlyArray<FeatureListRow>;
|
|
29
|
+
/** The scale every frequency bar shares. It starts at zero. */
|
|
30
|
+
readonly frequencyDomain: NumericDomain;
|
|
31
|
+
readonly frequencyFormat: ValueFormat;
|
|
32
|
+
readonly activationFormat: ValueFormat;
|
|
33
|
+
/** The scale every layer profile shares. Leave it out, with the profiles, to drop the column. */
|
|
34
|
+
readonly profileDomain?: NumericDomain | undefined;
|
|
35
|
+
/** The feature the reader opened. Pressing a row asks to open it. */
|
|
36
|
+
readonly selected?: string | null | undefined;
|
|
37
|
+
readonly onSelectedChange?: ((id: string, details: InterpretabilityChangeDetails) => void) | undefined;
|
|
38
|
+
/** The search text. The list shows the features whose label, id or explanation contains it. */
|
|
39
|
+
readonly query?: string | undefined;
|
|
40
|
+
readonly onQueryChange?: ((query: string, details: InterpretabilityChangeDetails) => void) | undefined;
|
|
41
|
+
readonly sort?: DataTableSort | undefined;
|
|
42
|
+
readonly onSortChange?: ((sort: DataTableSort | undefined) => void) | undefined;
|
|
43
|
+
readonly labels?: Partial<FeatureListLabels> | undefined;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Many features as a sortable, searchable table, as a feature browser lists a dictionary, where the application holds
|
|
47
|
+
* the open feature, search text and sort, and supplies every measure. Each row names the feature and shows how often it
|
|
48
|
+
* fires as a bar, its largest activation and, when supplied, a tiny curve of its activation by layer. Pressing a row
|
|
49
|
+
* opens the feature, and resting on a row lights it in linked figures.
|
|
50
|
+
*/
|
|
51
|
+
export declare function FeatureList({ title, locale, status, features, frequencyDomain, frequencyFormat, activationFormat, profileDomain, selected, onSelectedChange, query, onQueryChange, sort, onSortChange, labels: given, }: FeatureListProps): ReactNode;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FigureStatus } from '../../../charts/src/index.ts';
|
|
3
|
+
import type { FeatureLogits } from './features.ts';
|
|
4
|
+
/** The words around the promoted and suppressed tokens. */
|
|
5
|
+
export type FeatureLogitLabels = {
|
|
6
|
+
readonly promotes: string;
|
|
7
|
+
readonly suppresses: string;
|
|
8
|
+
readonly logitsDescription: string;
|
|
9
|
+
};
|
|
10
|
+
type FeatureLogitsProps = {
|
|
11
|
+
readonly logits: FeatureLogits;
|
|
12
|
+
readonly locale: string;
|
|
13
|
+
readonly status?: FigureStatus | undefined;
|
|
14
|
+
readonly isCompact: boolean;
|
|
15
|
+
readonly labels: FeatureLogitLabels;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* What the feature does to the output: the tokens whose logits it raises, in the positive hue, and the tokens it
|
|
19
|
+
* lowers, in the negative hue. Both bar lists share one magnitude, so a long bar means the same in each. The compact
|
|
20
|
+
* form writes the leading tokens as text.
|
|
21
|
+
*/
|
|
22
|
+
export declare function FeatureLogitBars({ logits, locale, status, isCompact, labels }: FeatureLogitsProps): ReactNode;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { HistogramBin } from '../../../charts/src/distribution/index.ts';
|
|
2
|
+
import type { NumericDomain, PlotAxis, ValueFormat } from '../../../charts/src/index.ts';
|
|
3
|
+
import type { TokenExample, TokenPalette } from '../../../charts/src/text/index.ts';
|
|
4
|
+
/** Why an interpretability view asks for a change: a press, a typed or dragged input, or an agent's call. */
|
|
5
|
+
export type InterpretabilityChangeDetails = {
|
|
6
|
+
readonly reason: 'press' | 'input' | 'imperative';
|
|
7
|
+
readonly event?: Event | undefined;
|
|
8
|
+
};
|
|
9
|
+
/** What names a learned feature, such as a sparse autoencoder latent, wherever it appears. */
|
|
10
|
+
export type FeatureSummary = {
|
|
11
|
+
/** The feature's id. It is the same in the list, the card, the map and the attribution graph. */
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/** The short human name: "Golden Gate Bridge". */
|
|
14
|
+
readonly label: string;
|
|
15
|
+
/** Where the feature lives, such as "Layer 20 · 65k dictionary". */
|
|
16
|
+
readonly source?: string | undefined;
|
|
17
|
+
/** What the feature appears to detect, in a sentence or two, written by a person or a model. */
|
|
18
|
+
readonly explanation?: string | undefined;
|
|
19
|
+
/** The share of tokens on which the feature is active, between 0 and 1, or null where it was not measured. */
|
|
20
|
+
readonly frequency?: number | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
/** How often the feature reaches each activation: prepared histogram bins over the activation axis. */
|
|
23
|
+
export type FeatureDensity = {
|
|
24
|
+
readonly bins: ReadonlyArray<HistogramBin>;
|
|
25
|
+
readonly value: PlotAxis;
|
|
26
|
+
readonly count: PlotAxis;
|
|
27
|
+
};
|
|
28
|
+
/** The contexts that activate the feature most, ranked by the application, with one color scale. */
|
|
29
|
+
export type FeatureExamples = {
|
|
30
|
+
readonly examples: ReadonlyArray<TokenExample>;
|
|
31
|
+
readonly domain: NumericDomain;
|
|
32
|
+
/** Absent shades activations in one hue. */
|
|
33
|
+
readonly palette?: TokenPalette | undefined;
|
|
34
|
+
readonly valueFormat: ValueFormat;
|
|
35
|
+
/** Tokens shown on each side of each example's peak. Every example then needs a `peakIndex`. */
|
|
36
|
+
readonly context?: number | undefined;
|
|
37
|
+
};
|
|
38
|
+
/** One output token and the feature's direct effect on its logit: positive promotes it, negative suppresses it. */
|
|
39
|
+
export type FeatureLogit = {
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly token: string;
|
|
42
|
+
readonly value: number;
|
|
43
|
+
};
|
|
44
|
+
/** The tokens the feature pushes up and down, each list in the order the application ranked it. */
|
|
45
|
+
export type FeatureLogits = {
|
|
46
|
+
readonly tokens: ReadonlyArray<FeatureLogit>;
|
|
47
|
+
/** The effect's axis: its label and format. A domain, when given, must hold zero. */
|
|
48
|
+
readonly value: PlotAxis;
|
|
49
|
+
};
|
|
50
|
+
/** Everything a feature card can show. Each part is optional; the card leaves out what is absent. */
|
|
51
|
+
export type FeatureCardData = {
|
|
52
|
+
readonly feature: FeatureSummary;
|
|
53
|
+
readonly density?: FeatureDensity | undefined;
|
|
54
|
+
readonly examples?: FeatureExamples | undefined;
|
|
55
|
+
readonly logits?: FeatureLogits | undefined;
|
|
56
|
+
};
|
|
57
|
+
/** The most features a list, a map's search or a workbench takes. */
|
|
58
|
+
export declare const featureLimits: {
|
|
59
|
+
readonly features: 5000;
|
|
60
|
+
readonly matches: 8;
|
|
61
|
+
};
|
|
62
|
+
/** True when the query is empty or a feature's label, id or explanation contains it, ignoring case. */
|
|
63
|
+
export declare function matchesQuery(feature: FeatureSummary, query: string): boolean;
|
|
64
|
+
/** The first id that appears twice, or undefined. */
|
|
65
|
+
export declare function repeatedFeatureId(ids: ReadonlyArray<string>): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Hands the row or item a reader rests on to the enclosing chart link. A feature lit in a list or a search is then lit
|
|
68
|
+
* in the map or graph beside it. Moving away clears only an id this view set, and outside a link it does nothing.
|
|
69
|
+
*/
|
|
70
|
+
export declare function useFeatureHighlight(ids: ReadonlyArray<string>): (id: string | undefined) => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type { AttentionHead, AttentionHeadGridLabels, AttentionHeadGridProps } from './attention-head-grid.tsx';
|
|
2
|
+
export { AttentionHeadGrid, attentionHeadLimits } from './attention-head-grid.tsx';
|
|
3
|
+
export type { AttributionWorkbenchLabels, AttributionWorkbenchProps } from './attribution-workbench.tsx';
|
|
4
|
+
export { AttributionWorkbench } from './attribution-workbench.tsx';
|
|
5
|
+
export type { EmbeddingAtlasLabels, EmbeddingAtlasProps } from './embedding-atlas.tsx';
|
|
6
|
+
export { EmbeddingAtlas } from './embedding-atlas.tsx';
|
|
7
|
+
export type { FeatureCardLabels, FeatureCardProps, FeatureCardSize } from './feature-card.tsx';
|
|
8
|
+
export { FeatureCard } from './feature-card.tsx';
|
|
9
|
+
export type { FeatureListLabels, FeatureListProps, FeatureListRow } from './feature-list.tsx';
|
|
10
|
+
export { FeatureList } from './feature-list.tsx';
|
|
11
|
+
export type { FeatureCardData, FeatureDensity, FeatureExamples, FeatureLogit, FeatureLogits, FeatureSummary, InterpretabilityChangeDetails, } from './features.ts';
|
|
12
|
+
export { featureLimits } from './features.ts';
|
|
13
|
+
export type { LensLayer, LensTrack, LogitLensLabels, LogitLensProps } from './logit-lens.tsx';
|
|
14
|
+
export { LogitLens } from './logit-lens.tsx';
|
|
15
|
+
export type { SteeringCompletions, SteeringFeature, SteeringPanelLabels, SteeringPanelProps, } from './steering-panel.tsx';
|
|
16
|
+
export { SteeringPanel } from './steering-panel.tsx';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as stylex from '@stylexjs/stylex';
|
|
2
|
+
/** The layout and words every interpretability view shares, so their panels line up when composed on one page. */
|
|
3
|
+
export declare const kitStyles: Readonly<{
|
|
4
|
+
readonly stack: Readonly<{
|
|
5
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
6
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
7
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
8
|
+
readonly alignContent: stylex.StyleXClassNameFor<"alignContent", "start">;
|
|
9
|
+
}>;
|
|
10
|
+
readonly tight: Readonly<{
|
|
11
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
12
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
13
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
14
|
+
readonly alignContent: stylex.StyleXClassNameFor<"alignContent", "start">;
|
|
15
|
+
}>;
|
|
16
|
+
readonly split: Readonly<{
|
|
17
|
+
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
18
|
+
readonly flexWrap: stylex.StyleXClassNameFor<"flexWrap", "wrap">;
|
|
19
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
20
|
+
readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "flex-start">;
|
|
21
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
22
|
+
}>;
|
|
23
|
+
readonly main: Readonly<{
|
|
24
|
+
readonly flexGrow: stylex.StyleXClassNameFor<"flexGrow", 3>;
|
|
25
|
+
readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 1>;
|
|
26
|
+
readonly flexBasis: stylex.StyleXClassNameFor<"flexBasis", "420px">;
|
|
27
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
28
|
+
}>;
|
|
29
|
+
readonly aside: Readonly<{
|
|
30
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
31
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
32
|
+
readonly flexGrow: stylex.StyleXClassNameFor<"flexGrow", 1>;
|
|
33
|
+
readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 1>;
|
|
34
|
+
readonly flexBasis: stylex.StyleXClassNameFor<"flexBasis", "300px">;
|
|
35
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
36
|
+
readonly alignContent: stylex.StyleXClassNameFor<"alignContent", "start">;
|
|
37
|
+
}>;
|
|
38
|
+
readonly card: Readonly<{
|
|
39
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
40
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
41
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
42
|
+
readonly padding: stylex.StyleXClassNameFor<"padding", string>;
|
|
43
|
+
readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 1>;
|
|
44
|
+
readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
|
|
45
|
+
readonly borderColor: stylex.StyleXClassNameFor<"borderColor", string>;
|
|
46
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
|
47
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
|
|
48
|
+
readonly alignContent: stylex.StyleXClassNameFor<"alignContent", "start">;
|
|
49
|
+
}>;
|
|
50
|
+
readonly heading: Readonly<{
|
|
51
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
52
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
53
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
54
|
+
}>;
|
|
55
|
+
readonly title: Readonly<{
|
|
56
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
57
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
58
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
59
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
60
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
61
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
62
|
+
readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
|
|
63
|
+
}>;
|
|
64
|
+
readonly meta: Readonly<{
|
|
65
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
66
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
67
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
68
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
69
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
70
|
+
readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
|
|
71
|
+
}>;
|
|
72
|
+
readonly body: Readonly<{
|
|
73
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
74
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
75
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
76
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
77
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
78
|
+
readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
|
|
79
|
+
}>;
|
|
80
|
+
readonly muted: Readonly<{
|
|
81
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
82
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
83
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
84
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
85
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
86
|
+
readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
|
|
87
|
+
}>;
|
|
88
|
+
readonly label: Readonly<{
|
|
89
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
90
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
91
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
92
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
93
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
94
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
95
|
+
}>;
|
|
96
|
+
readonly list: Readonly<{
|
|
97
|
+
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
98
|
+
readonly flexWrap: stylex.StyleXClassNameFor<"flexWrap", "wrap">;
|
|
99
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
100
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
101
|
+
readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
|
|
102
|
+
readonly listStyle: stylex.StyleXClassNameFor<"listStyle", "none">;
|
|
103
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
104
|
+
}>;
|
|
105
|
+
readonly token: Readonly<{
|
|
106
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
|
|
107
|
+
readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 1>;
|
|
108
|
+
readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
|
|
109
|
+
readonly borderColor: stylex.StyleXClassNameFor<"borderColor", string>;
|
|
110
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
|
111
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
|
|
112
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
113
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
114
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
115
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
116
|
+
readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "pre">;
|
|
117
|
+
}>;
|
|
118
|
+
}>;
|