@mechane-ai/elements 0.46.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +590 -34
- package/bin/mechane-elements-catalog.mjs +104 -12
- package/dist/ai.js +4 -4
- package/dist/article-BXZr10QQ.js +1904 -0
- package/dist/article.js +1 -0
- package/dist/catalog.json +3696 -33
- package/dist/categorical-values-BpVq8cFj.js +107 -0
- package/dist/cells-xVmnQ9oQ.js +384 -0
- package/dist/chart-link-AE_xuxiP.js +35 -0
- package/dist/chart-tones-ei3BC2AL.js +27 -0
- package/dist/charts/cartesian.js +1 -2958
- package/dist/charts/cells.js +1 -0
- package/dist/charts/comparison.js +1 -0
- package/dist/charts/distribution.js +1 -781
- package/dist/charts/figure.js +3404 -0
- package/dist/charts/graph.js +1 -655
- package/dist/charts/hierarchy.js +1 -121
- package/dist/charts/image.js +1 -0
- package/dist/charts/matrix.js +4 -644
- 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 -266
- package/dist/charts/transforms.js +677 -0
- package/dist/charts/trend.js +1 -0
- package/dist/charts.js +8 -3
- package/dist/clock-DSm5lkNE.js +16 -0
- package/dist/collections.js +1 -2195
- package/dist/color-legend-CIo7DhXB.js +62 -0
- package/dist/dates-Cww8UR_n.js +810 -0
- package/dist/describe-lesson-BmREzDpt.js +175 -0
- package/dist/dumbbell-plot-DQdTxDeO.js +509 -0
- package/dist/embedding-map-CF-J-8JW.js +1929 -0
- package/dist/feedback.js +1 -1
- package/dist/figure-format-B8kRZMlo.js +36 -0
- package/dist/figure-frame-BJ3REgTA.js +270 -0
- package/dist/forms/dates.js +1 -810
- package/dist/forms.js +1 -1
- package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
- package/dist/image-grid-Dl2sjIMB.js +598 -0
- package/dist/kits/evaluation.js +431 -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/lesson/agent.js +811 -0
- package/dist/lesson/spec.js +661 -0
- package/dist/lesson.js +5 -0
- package/dist/locate-Bcg3QcP4.js +11 -0
- package/dist/mdx.js +227 -0
- 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 +5 -5
- package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +30 -25
- 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 +60 -36
- package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
- package/dist/packages/charts/src/categorical-values.d.ts +1 -1
- 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 +14 -7
- 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-link.d.ts +56 -0
- package/dist/packages/charts/src/chart.d.ts +0 -8
- 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 +15 -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 +15 -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 +128 -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 -2
- 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 +24 -13
- 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/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/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/teaching/src/agent/index.d.ts +11 -0
- package/dist/packages/teaching/src/agent/learner-trace.d.ts +84 -0
- package/dist/packages/teaching/src/agent/lesson-bridge.d.ts +59 -0
- package/dist/packages/teaching/src/agent/lesson-tour.d.ts +63 -0
- package/dist/packages/teaching/src/agent/tutor-tools.d.ts +86 -0
- package/dist/packages/teaching/src/article/article-checks.d.ts +9 -0
- package/dist/packages/teaching/src/article/article-context.d.ts +49 -0
- package/dist/packages/teaching/src/article/article-error.d.ts +12 -0
- package/dist/packages/teaching/src/article/article-labels.d.ts +54 -0
- package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +14 -0
- package/dist/packages/teaching/src/article/article-outline.d.ts +9 -0
- package/dist/packages/teaching/src/article/article.d.ts +42 -0
- package/dist/packages/teaching/src/article/beat-steps.d.ts +18 -0
- package/dist/packages/teaching/src/article/beat.d.ts +16 -0
- package/dist/packages/teaching/src/article/challenge.d.ts +29 -0
- package/dist/packages/teaching/src/article/exercise-styles.d.ts +76 -0
- package/dist/packages/teaching/src/article/figure.d.ts +51 -0
- package/dist/packages/teaching/src/article/index.d.ts +31 -0
- package/dist/packages/teaching/src/article/lesson-values.d.ts +5 -0
- package/dist/packages/teaching/src/article/linked-target.d.ts +22 -0
- package/dist/packages/teaching/src/article/notes.d.ts +36 -0
- package/dist/packages/teaching/src/article/outline-types.d.ts +73 -0
- package/dist/packages/teaching/src/article/predict.d.ts +58 -0
- package/dist/packages/teaching/src/article/progress-store.d.ts +64 -0
- package/dist/packages/teaching/src/article/scrolly.d.ts +26 -0
- package/dist/packages/teaching/src/article/term.d.ts +35 -0
- package/dist/packages/teaching/src/article/tex.d.ts +12 -0
- package/dist/packages/teaching/src/article/view-essay.d.ts +13 -0
- package/dist/packages/teaching/src/article/view-present.d.ts +8 -0
- package/dist/packages/teaching/src/article/view-sheet.d.ts +7 -0
- package/dist/packages/teaching/src/article/view-static.d.ts +7 -0
- package/dist/packages/teaching/src/article/walk.d.ts +34 -0
- package/dist/packages/teaching/src/lesson/bound-value.d.ts +29 -0
- package/dist/packages/teaching/src/lesson/define-lesson.d.ts +136 -0
- package/dist/packages/teaching/src/lesson/index.d.ts +24 -0
- package/dist/packages/teaching/src/lesson/inline-choice.d.ts +12 -0
- package/dist/packages/teaching/src/lesson/lesson-context.d.ts +18 -0
- package/dist/packages/teaching/src/lesson/lesson-error.d.ts +12 -0
- package/dist/packages/teaching/src/lesson/lesson-locale.d.ts +4 -0
- package/dist/packages/teaching/src/lesson/lesson-persistence.d.ts +17 -0
- package/dist/packages/teaching/src/lesson/lesson-player.d.ts +51 -0
- package/dist/packages/teaching/src/lesson/lesson-store.d.ts +84 -0
- package/dist/packages/teaching/src/lesson/lesson.d.ts +39 -0
- package/dist/packages/teaching/src/lesson/param-controls.d.ts +14 -0
- package/dist/packages/teaching/src/lesson/param.d.ts +34 -0
- package/dist/packages/teaching/src/lesson/playback.d.ts +42 -0
- package/dist/packages/teaching/src/lesson/transport.d.ts +19 -0
- package/dist/packages/teaching/src/lesson/use-lesson.d.ts +36 -0
- package/dist/packages/teaching/src/mdx/essay-components.d.ts +79 -0
- package/dist/packages/teaching/src/mdx/essay-markdown.d.ts +41 -0
- package/dist/packages/teaching/src/mdx/essay.d.ts +32 -0
- package/dist/packages/teaching/src/mdx/index.d.ts +9 -0
- package/dist/packages/teaching/src/mdx/requested-view.d.ts +6 -0
- package/dist/packages/teaching/src/scene/flow/flow-layout.d.ts +38 -0
- package/dist/packages/teaching/src/scene/flow/flow-pulse.d.ts +16 -0
- package/dist/packages/teaching/src/scene/flow/scene-flow.d.ts +81 -0
- package/dist/packages/teaching/src/scene/index.d.ts +77 -0
- package/dist/packages/teaching/src/scene/morph/morph-scope.d.ts +28 -0
- package/dist/packages/teaching/src/scene/plane/plane-hit.d.ts +22 -0
- package/dist/packages/teaching/src/scene/plane/plane-label.d.ts +23 -0
- package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +42 -0
- package/dist/packages/teaching/src/scene/plane/plane-math.d.ts +45 -0
- package/dist/packages/teaching/src/scene/plane/scene-axes.d.ts +30 -0
- package/dist/packages/teaching/src/scene/plane/scene-curve.d.ts +42 -0
- package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +59 -0
- package/dist/packages/teaching/src/scene/plane/scene-projection.d.ts +27 -0
- package/dist/packages/teaching/src/scene/plane/scene-region.d.ts +38 -0
- package/dist/packages/teaching/src/scene/plane/scene-rule.d.ts +35 -0
- package/dist/packages/teaching/src/scene/plane/scene-vector.d.ts +39 -0
- package/dist/packages/teaching/src/scene/scene-bracket.d.ts +24 -0
- package/dist/packages/teaching/src/scene/scene-callout.d.ts +26 -0
- package/dist/packages/teaching/src/scene/scene-context.d.ts +179 -0
- package/dist/packages/teaching/src/scene/scene-custom.d.ts +31 -0
- package/dist/packages/teaching/src/scene/scene-geometry.d.ts +181 -0
- package/dist/packages/teaching/src/scene/scene-group.d.ts +28 -0
- package/dist/packages/teaching/src/scene/scene-highlight.d.ts +19 -0
- package/dist/packages/teaching/src/scene/scene-layer.d.ts +16 -0
- package/dist/packages/teaching/src/scene/scene-node.d.ts +67 -0
- package/dist/packages/teaching/src/scene/scene-obstacles.d.ts +27 -0
- package/dist/packages/teaching/src/scene/scene-registry.d.ts +79 -0
- package/dist/packages/teaching/src/scene/scene-stagger.d.ts +43 -0
- package/dist/packages/teaching/src/scene/scene-style.d.ts +14 -0
- package/dist/packages/teaching/src/scene/scene-validate.d.ts +65 -0
- package/dist/packages/teaching/src/scene/scene-wire.d.ts +45 -0
- package/dist/packages/teaching/src/scene/scene.d.ts +36 -0
- package/dist/packages/teaching/src/scene/shapes/cell-color.d.ts +11 -0
- package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +69 -0
- package/dist/packages/teaching/src/scene/shapes/scene-card.d.ts +114 -0
- package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +84 -0
- package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +37 -0
- package/dist/packages/teaching/src/scene/shapes/scene-stack.d.ts +46 -0
- package/dist/packages/teaching/src/scene/shapes/scene-token.d.ts +63 -0
- package/dist/packages/teaching/src/scene/shapes/scene-tokens.d.ts +40 -0
- package/dist/packages/teaching/src/scene/shapes/stack-book.d.ts +35 -0
- package/dist/packages/teaching/src/scene/shapes/stack-layout.d.ts +63 -0
- package/dist/packages/teaching/src/scene/shapes/token-layout.d.ts +39 -0
- package/dist/packages/teaching/src/spec/advice.d.ts +23 -0
- package/dist/packages/teaching/src/spec/chart-names.d.ts +2 -0
- package/dist/packages/teaching/src/spec/describe-lesson.d.ts +85 -0
- package/dist/packages/teaching/src/spec/explainer-guide.d.ts +21 -0
- package/dist/packages/teaching/src/spec/findings.d.ts +39 -0
- package/dist/packages/teaching/src/spec/index.d.ts +14 -0
- package/dist/packages/teaching/src/spec/lesson-plan.d.ts +43 -0
- package/dist/packages/teaching/src/spec/validate-plan.d.ts +11 -0
- package/dist/packages/teaching/src/time/clock.d.ts +7 -0
- package/dist/packages/teaching/src/time/tween.d.ts +19 -0
- package/dist/packages/teaching/src/time/use-tween.d.ts +6 -0
- package/dist/param-CqKUTHaO.js +450 -0
- package/dist/path-BglsXpnO.js +59 -0
- package/dist/plot-axes-DJkLW4wk.js +100 -0
- package/dist/plot-layout-CZVSJ-le.js +912 -0
- package/dist/plot-marks-uozcbOIX.js +229 -0
- package/dist/plot-surface-CbVBvgqZ.js +51 -0
- package/dist/plot-width-DcqtSgzb.js +124 -0
- package/dist/point-layer-C-EYETAt.js +655 -0
- package/dist/reference-lines-BDcttOp0.js +82 -0
- package/dist/scale-C2xgZyZN.js +63 -0
- package/dist/scene-0z2gbaDE.js +4938 -0
- package/dist/scene.js +1 -0
- package/dist/slope-chart-BKVEAVCs.js +1279 -0
- package/dist/{src-1EHkSFS-.js → src-BD6xlvDt.js} +2 -2
- package/dist/{src-DVHlknB6.js → src-CExIrXPC.js} +169 -193
- package/dist/src-DIS0YOj0.js +44 -0
- package/dist/src-Dcfq8vE4.js +2195 -0
- package/dist/styles2.css +907 -59
- package/dist/time-series-BgzGNOk0.js +2670 -0
- package/dist/token-heatmap-BrW1OsKD.js +1354 -0
- package/dist/token-predictions-yerq_Oet.js +1093 -0
- package/dist/tone-scope-DKiSw-JR.js +32 -0
- package/dist/transport-BJweqDPj.js +715 -0
- package/dist/tree-diagram-D09BRqE-.js +1629 -0
- package/dist/treemap-CW4WsJNL.js +472 -0
- package/dist/use-tween-5HZ55_9d.js +72 -0
- package/dist/values-963L6n1m.js +65 -0
- package/dist/violin-plot-DrtPZ1-T.js +1292 -0
- package/dist/waterfall-DYLSnGjm.js +576 -0
- package/package.json +78 -4
- package/recipes/allocation-report.tsx +15 -7
- package/recipes/counting-cards.tsx +656 -0
- package/recipes/explorable-essay.tsx +172 -0
- package/skills/extend-elements/SKILL.md +81 -0
- package/skills/plan-lesson/SKILL.md +86 -0
- package/skills/plan-lesson/references/plan-format.md +114 -0
- package/skills/plan-lesson/references/worked-plan.md +171 -0
- package/skills/review-elements/SKILL.md +47 -3
- package/skills/review-explainer/SKILL.md +97 -0
- package/skills/upgrade-elements/SKILL.md +3 -1
- package/skills/upgrade-elements/references/releases.md +249 -0
- package/skills/use-elements/SKILL.md +22 -14
- package/skills/use-elements/references/charts.md +362 -41
- package/skills/use-elements/references/figures.md +173 -0
- package/skills/use-elements/references/kits.md +180 -0
- package/skills/use-elements/references/teaching.md +36 -0
- package/skills/write-explainer/SKILL.md +112 -0
- package/skills/write-explainer/references/article.md +164 -0
- package/skills/write-explainer/references/lesson.md +148 -0
- package/skills/write-explainer/references/mdx.md +78 -0
- package/skills/write-explainer/references/scene-parts.md +273 -0
- package/skills/write-explainer/references/scene.md +168 -0
- package/skills/write-explainer/references/tutor.md +104 -0
- package/skills/write-explainer/references/worked-essay.md +459 -0
- package/templates/essay/AGENTS.md +14 -0
- package/templates/essay/README.md +59 -0
- package/templates/essay/index.html +17 -0
- package/templates/essay/package.template.json +21 -0
- package/templates/essay/plan.json +96 -0
- package/templates/essay/src/essay.mdx +97 -0
- package/templates/essay/src/figures.tsx +92 -0
- package/templates/essay/src/lesson.ts +83 -0
- package/templates/essay/src/main.tsx +53 -0
- package/templates/essay/src/mdx.d.ts +7 -0
- package/templates/essay/tsconfig.template.json +15 -0
- package/templates/essay/vite.config.template.txt +8 -0
- package/dist/categorical-values-BXi-rJuv.js +0 -74
- package/dist/chart-data-CIJVWCYt.js +0 -21
- package/dist/chart-frame-BaxKn_MB.js +0 -236
- package/dist/chart-input-Bm82_9Rd.js +0 -22
- package/dist/chart-theme-4zprJ3rW.js +0 -404
- package/dist/plot-width-v2c_rA20.js +0 -63
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* An image that fills the box its parent gives it, such as a tile with a fixed aspect ratio. It loads lazily, so
|
|
4
|
+
* nothing moves as it arrives. An image that cannot load becomes a neutral placeholder that keeps the alt text.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ImageFill({ src, alt }: {
|
|
7
|
+
readonly src: string;
|
|
8
|
+
readonly alt: string;
|
|
9
|
+
}): ReactNode;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { ImageRecord } from './image-input.ts';
|
|
5
|
+
/** One image in the grid, in the rank the application gives it. */
|
|
6
|
+
export type ImageGridItem = ImageRecord;
|
|
7
|
+
export type ImageGridProps = FigureProps & FigureSelectionProps & {
|
|
8
|
+
/** The images in the order to show them, best first. The grid never reorders them. */
|
|
9
|
+
readonly items: ReadonlyArray<ImageGridItem>;
|
|
10
|
+
/** What each value measures, such as "Activation". It names the value in the readout. */
|
|
11
|
+
readonly valueLabel?: string | undefined;
|
|
12
|
+
readonly valueFormat?: ValueFormat | undefined;
|
|
13
|
+
/** How many tiles sit in a row. Leave it out to fit as many as the width allows. */
|
|
14
|
+
readonly columns?: number | undefined;
|
|
15
|
+
/** Tile width divided by tile height. Every tile has the same one, so nothing moves as images load. */
|
|
16
|
+
readonly aspectRatio?: number | undefined;
|
|
17
|
+
};
|
|
18
|
+
export declare const imageGridLimits: {
|
|
19
|
+
readonly items: 200;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A ranked grid of image tiles, such as the dataset examples that most activate a feature. Tiles keep the supplied
|
|
23
|
+
* order, each with its value beneath it, so use it when a reader needs to see what the images have in common. The
|
|
24
|
+
* application supplies the images, their alt text, their order and their values.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ImageGrid(props: ImageGridProps): ReactNode;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
2
|
+
/** An image a figure shows, with the words that stand in for it. */
|
|
3
|
+
export type ImageRecord = {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/** Where the image loads from: a URL or a data URL. */
|
|
6
|
+
readonly src: string;
|
|
7
|
+
/** What the image shows, in the reader's words. Assistive technology reads it as part of the item. */
|
|
8
|
+
readonly alt: string;
|
|
9
|
+
/** A short name for the image, such as a dataset row number. */
|
|
10
|
+
readonly label?: string | undefined;
|
|
11
|
+
/** The number the figure attaches to the image, or null where there is none. */
|
|
12
|
+
readonly value?: number | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** Why the images cannot be drawn faithfully, or undefined when they can. */
|
|
15
|
+
export declare function imageRecordError(records: ReadonlyArray<ImageRecord>): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The sentence for one image: its label and alt text, its position when it has one, then its value when it has one. Use
|
|
18
|
+
* it as the item's label, so a reader who steps through the images hears what each shows.
|
|
19
|
+
*/
|
|
20
|
+
export declare function imageReadout({ record, position, valueLabel, locale, format, }: {
|
|
21
|
+
readonly record: ImageRecord;
|
|
22
|
+
/** Where the image sits, in words, such as "Column 3 of 6, row 2 of 4". */
|
|
23
|
+
readonly position?: string | undefined;
|
|
24
|
+
readonly valueLabel: string;
|
|
25
|
+
readonly locale: string;
|
|
26
|
+
readonly format: ValueFormat;
|
|
27
|
+
}): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartView } from '../chart.tsx';
|
|
3
|
+
export type ImageTileProps = {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/** What assistive technology reads for the tile: the alt text and every value the tile stands for. */
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly src: string;
|
|
8
|
+
readonly alt: string;
|
|
9
|
+
/** Width divided by height. */
|
|
10
|
+
readonly ratio: number;
|
|
11
|
+
readonly view: ChartView;
|
|
12
|
+
/** True when the application listens for selection, so the tile is a toggle button. */
|
|
13
|
+
readonly isSelectable: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The grid position, counted from 0, when the tile sits in a layout of its own. A gap of one pixel then separates
|
|
16
|
+
* tiles.
|
|
17
|
+
*/
|
|
18
|
+
readonly place?: {
|
|
19
|
+
readonly column: number;
|
|
20
|
+
readonly row: number;
|
|
21
|
+
} | undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* One image a reader can inspect and, when the application listens, select. Use it inside a chart plot. The tile is a
|
|
25
|
+
* mark of the chart, so pointer, arrow keys and Enter work as in every chart.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ImageTile({ id, label, src, alt, ratio, view, isSelectable, place }: ImageTileProps): ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AttributionOverlay, attributionOverlayLimits } from './attribution-overlay.tsx';
|
|
2
|
+
export type { AttributionGrid, AttributionImage, AttributionOpacityDetails, AttributionOverlayProps, } from './attribution-overlay.tsx';
|
|
3
|
+
export type { AttributionPalette } from './attribution-ramp.ts';
|
|
4
|
+
export { ImageAtlas, imageAtlasLimits } from './image-atlas.tsx';
|
|
5
|
+
export type { ImageAtlasCell, ImageAtlasProps } from './image-atlas.tsx';
|
|
6
|
+
export { ImageGrid, imageGridLimits } from './image-grid.tsx';
|
|
7
|
+
export type { ImageGridItem, ImageGridProps } from './image-grid.tsx';
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
export type { BreakdownItem } from './categorical-values.tsx';
|
|
2
|
-
export
|
|
2
|
+
export { categoricalLimits } from './categorical-values.tsx';
|
|
3
|
+
export type { ChartReport, ChartSeriesReport, ChartFrameProps, ChartLegendItem, ChartLegendProps, } from './chart-frame.tsx';
|
|
3
4
|
export { ChartFrame, ChartLegend } from './chart-frame.tsx';
|
|
4
5
|
export type { ChartSelectDetails } from './chart.tsx';
|
|
5
6
|
export type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
6
7
|
export { chartToneColors, chartToneOutlines } from '../../foundations/src/chart-tones.ts';
|
|
7
8
|
export type { ChartMarkShape, ChartSeriesMarkerProps } from './chart-series-marker.tsx';
|
|
8
9
|
export { ChartSeriesMarker } from './chart-series-marker.tsx';
|
|
10
|
+
export type { ChartGridProps } from './chart-grid.tsx';
|
|
11
|
+
export { ChartGrid } from './chart-grid.tsx';
|
|
12
|
+
export type { ChartLinkControl, ChartLinkInspectChange, ChartLinkProps } from './chart-link.tsx';
|
|
13
|
+
export { ChartLink, useChartLinkControl, useLinkedInspection } from './chart-link.tsx';
|
|
14
|
+
export type { TimeFormat, ValueFormat } from './figure/figure-format.ts';
|
|
15
|
+
export { MISSING_VALUE_TEXT, formatTime, formatValue, tickFormat } from './figure/figure-format.ts';
|
|
16
|
+
export type { FigureCoverage, FigureProps, FigureSelectionProps, FigureStatus, SeriesFigureProps, } from './figure/figure-props.ts';
|
|
17
|
+
export type { ToneScopeProps } from './figure/tone-scope.tsx';
|
|
18
|
+
export { ToneScope, useScopedTone } from './figure/tone-scope.tsx';
|
|
19
|
+
export type { PlotAxis, PlotHeight } from './plot/plot-layout.ts';
|
|
20
|
+
export { plotHeights } from './plot/plot-layout.ts';
|
|
21
|
+
export type { ChartRangeDetails, ChartRangeValue } from './chart-range.tsx';
|
|
22
|
+
export type { NumericDomain, ScaleType } from './plot/scale.ts';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { MatrixPresetProps } from './matrix-presets.ts';
|
|
4
|
+
import type { MatrixCellValuesProps } from './matrix-types.ts';
|
|
5
|
+
/** A token on one side of the attention pattern: its exact text and its position in the full sequence. */
|
|
6
|
+
export type AttentionToken = {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly index: number;
|
|
9
|
+
readonly text: string;
|
|
10
|
+
};
|
|
11
|
+
export type AttentionMatrixProps = MatrixPresetProps & MatrixCellValuesProps & {
|
|
12
|
+
/** The tokens that attend, down the rows. Each destination reads information from the sources. */
|
|
13
|
+
readonly destinations: ReadonlyArray<AttentionToken>;
|
|
14
|
+
/** The tokens attended to, across the columns: the tokens a destination reads information from. */
|
|
15
|
+
readonly sources: ReadonlyArray<AttentionToken>;
|
|
16
|
+
/**
|
|
17
|
+
* Weights in [0, 1] as a model computes them: one line per destination (the token that attends), one weight per
|
|
18
|
+
* source (the token attended to), in the supplied orders. Null marks a weight that was not recorded.
|
|
19
|
+
*/
|
|
20
|
+
readonly weights: ReadonlyArray<ReadonlyArray<number | null>>;
|
|
21
|
+
/**
|
|
22
|
+
* `causal` draws each pair whose source comes after its destination as masked, since a token cannot attend to a
|
|
23
|
+
* later one: hollow, never zero. Its weight must be null. Absent means none.
|
|
24
|
+
*/
|
|
25
|
+
readonly mask?: 'none' | 'causal' | undefined;
|
|
26
|
+
/** What the weight is: "Attention weight, layer 3 head 2". */
|
|
27
|
+
readonly valueLabel?: string | undefined;
|
|
28
|
+
/** How a weight is written. Absent writes two decimals. */
|
|
29
|
+
readonly valueFormat?: ValueFormat | undefined;
|
|
30
|
+
};
|
|
31
|
+
/** The largest number of tokens on each side. */
|
|
32
|
+
export declare const attentionMatrixLimits: {
|
|
33
|
+
readonly tokens: 64;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* One attention head's pattern: each row is a destination, the token that attends, and each column a source, the token
|
|
37
|
+
* attended to. Weights in [0, 1] show as lightness of one hue, token text stays exact with whitespace drawn visibly,
|
|
38
|
+
* and inspecting a cell names both tokens with their positions. A causal mask draws masked pairs hollow, apart from a
|
|
39
|
+
* weight of zero, and attention weights alone are not a causal explanation.
|
|
40
|
+
*/
|
|
41
|
+
export declare function AttentionMatrix(props: AttentionMatrixProps): ReactNode;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
4
|
+
import type { MatrixPresetProps } from './matrix-presets.ts';
|
|
5
|
+
/** A day of the week, for the row a week starts on. */
|
|
6
|
+
export type CalendarWeekday = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
|
|
7
|
+
/** One day's value. A day in the range with no entry, or with a null value, draws hollow as missing. */
|
|
8
|
+
export type CalendarDay = {
|
|
9
|
+
/** The civil date, as `YYYY-MM-DD`. It is also the cell's id for selection. */
|
|
10
|
+
readonly date: string;
|
|
11
|
+
readonly value: number | null;
|
|
12
|
+
};
|
|
13
|
+
export type CalendarHeatmapProps = MatrixPresetProps & {
|
|
14
|
+
readonly days: ReadonlyArray<CalendarDay>;
|
|
15
|
+
/** The first and last civil dates drawn, inclusive, as `YYYY-MM-DD`. */
|
|
16
|
+
readonly range: {
|
|
17
|
+
readonly from: string;
|
|
18
|
+
readonly to: string;
|
|
19
|
+
};
|
|
20
|
+
/** The weekday in the top row, as the reader's calendar starts its weeks. */
|
|
21
|
+
readonly weekStartsOn: CalendarWeekday;
|
|
22
|
+
/** What one day's value is, with its unit: "Evaluation runs". */
|
|
23
|
+
readonly valueLabel: string;
|
|
24
|
+
readonly valueFormat: ValueFormat;
|
|
25
|
+
/** The color domain. Absent spans zero to the largest value. */
|
|
26
|
+
readonly domain?: NumericDomain | undefined;
|
|
27
|
+
};
|
|
28
|
+
/** The longest range: three years of days. */
|
|
29
|
+
export declare const calendarHeatmapLimits: {
|
|
30
|
+
readonly days: 1096;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* One supplied value per civil date over a range, with weeks as columns, weekdays as rows and the months named above:
|
|
34
|
+
* daily evaluation runs, incidents, training jobs. Lightness of one hue shows the value; a day with no value is hollow.
|
|
35
|
+
* Dates are `YYYY-MM-DD` strings, and the week start is an input, so the chart reads no clock and no time zone.
|
|
36
|
+
*/
|
|
37
|
+
export declare function CalendarHeatmap(props: CalendarHeatmapProps): ReactNode;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
2
3
|
import type { HeatmapScale } from './heatmap-scale.ts';
|
|
3
4
|
export type ColorLegendProps = HeatmapScale & {
|
|
5
|
+
/** What the color measures, with its unit and any normalization: "Share of actual class (row-normalized)". */
|
|
4
6
|
readonly label: string;
|
|
5
|
-
readonly
|
|
7
|
+
readonly valueFormat: ValueFormat;
|
|
8
|
+
readonly locale: string;
|
|
6
9
|
};
|
|
7
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The key to a heatmap's colors: what they measure, the domain's two ends and, for a diverging palette, the neutral
|
|
12
|
+
* zero. Matrix and TokenHeatmap draw one; place one beside a custom heatmap that uses the same scale.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ColorLegend({ label, domain, palette, valueFormat, locale }: ColorLegendProps): ReactNode;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { MatrixPresetProps } from './matrix-presets.ts';
|
|
4
|
+
import type { MatrixCellValuesProps } from './matrix-types.ts';
|
|
5
|
+
/** A class a classifier can predict. */
|
|
6
|
+
export type ConfusionClass = {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
};
|
|
10
|
+
export type ConfusionMatrixProps = MatrixPresetProps & MatrixCellValuesProps & {
|
|
11
|
+
/** The classes, in the order both axes list them. */
|
|
12
|
+
readonly classes: ReadonlyArray<ConfusionClass>;
|
|
13
|
+
/** Example counts: one line per actual class, one count per predicted class, both in `classes` order. */
|
|
14
|
+
readonly counts: ReadonlyArray<ReadonlyArray<number>>;
|
|
15
|
+
/**
|
|
16
|
+
* A value of `none` colors each cell by its count. A value of `row` colors it by its share of the actual class, the
|
|
17
|
+
* row's count divided by the row's total, and says so in the legend. Absent means none.
|
|
18
|
+
*/
|
|
19
|
+
readonly normalize?: 'none' | 'row' | undefined;
|
|
20
|
+
/** What one count is: "Examples", "Images". Absent means examples. */
|
|
21
|
+
readonly valueLabel?: string | undefined;
|
|
22
|
+
/** How a count is written. Absent writes whole numbers. */
|
|
23
|
+
readonly valueFormat?: ValueFormat | undefined;
|
|
24
|
+
/** How a share of the actual class is written. Absent writes a percentage with one decimal. */
|
|
25
|
+
readonly shareFormat?: ValueFormat | undefined;
|
|
26
|
+
};
|
|
27
|
+
/** The largest number of classes. Each side of the matrix holds every class. */
|
|
28
|
+
export declare const confusionMatrixLimits: {
|
|
29
|
+
readonly classes: 64;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A classifier's counts of actual against predicted class: rows are the actual class, columns the predicted one, and
|
|
33
|
+
* the outlined diagonal holds the correct predictions. Lightness shows the count, or each count's share of its actual
|
|
34
|
+
* class with `normalize="row"`. The application supplies the counts; the chart only divides a row by its own total.
|
|
35
|
+
*/
|
|
36
|
+
export declare function ConfusionMatrix(props: ConfusionMatrixProps): ReactNode;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { MatrixPresetProps } from './matrix-presets.ts';
|
|
4
|
+
import type { MatrixCellValuesProps } from './matrix-types.ts';
|
|
5
|
+
/** A variable whose pairwise correlations the matrix shows. */
|
|
6
|
+
export type CorrelationVariable = {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
};
|
|
10
|
+
export type CorrelationMatrixProps = MatrixPresetProps & MatrixCellValuesProps & {
|
|
11
|
+
/** The variables, in the order both axes list them. */
|
|
12
|
+
readonly variables: ReadonlyArray<CorrelationVariable>;
|
|
13
|
+
/**
|
|
14
|
+
* Supplied coefficients in [-1, 1]: one line per variable, one value per variable, in `variables` order. The table
|
|
15
|
+
* must be symmetric. Null marks a pair that was not computed.
|
|
16
|
+
*/
|
|
17
|
+
readonly coefficients: ReadonlyArray<ReadonlyArray<number | null>>;
|
|
18
|
+
/** `lower` draws each pair once, below the diagonal. Absent means full. */
|
|
19
|
+
readonly triangle?: 'full' | 'lower' | undefined;
|
|
20
|
+
/** What the coefficient is: "Pearson correlation", "Spearman rank correlation". */
|
|
21
|
+
readonly valueLabel?: string | undefined;
|
|
22
|
+
/** How a coefficient is written. Absent writes two decimals. */
|
|
23
|
+
readonly valueFormat?: ValueFormat | undefined;
|
|
24
|
+
};
|
|
25
|
+
/** The largest number of variables. */
|
|
26
|
+
export declare const correlationMatrixLimits: {
|
|
27
|
+
readonly variables: 64;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Supplied correlation coefficients between variables, such as features, probes or metrics, on a diverging palette
|
|
31
|
+
* fixed at -1 to 1 with zero neutral. The diagonal is drawn in gray as context, and `triangle="lower"` shows each pair
|
|
32
|
+
* once. Asymmetric or out-of-range input is refused; the application computes the coefficients.
|
|
33
|
+
*/
|
|
34
|
+
export declare function CorrelationMatrix(props: CorrelationMatrixProps): ReactNode;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
2
|
+
/** Sequential lightness of one hue for a magnitude, or two hues around a neutral zero for a signed value. */
|
|
1
3
|
export type HeatmapPalette = 'sequential' | 'diverging';
|
|
4
|
+
/** The color domain of a heatmap and how its values map to color. Values outside the domain draw no color. */
|
|
2
5
|
export type HeatmapScale = {
|
|
3
|
-
readonly domain:
|
|
6
|
+
readonly domain: NumericDomain;
|
|
4
7
|
readonly palette: HeatmapPalette;
|
|
5
8
|
};
|
|
9
|
+
/** Why a color scale cannot be drawn, or null when it can. */
|
|
6
10
|
export declare function heatmapScaleProblem({ domain, palette }: HeatmapScale): string | null;
|
|
7
|
-
|
|
11
|
+
/** Whether a value lies inside the color domain, endpoints included. */
|
|
12
|
+
export declare function isHeatmapValueInDomain(value: number, domain: NumericDomain): boolean;
|
|
13
|
+
/** The fill of a value inside the domain: more of the hue for a larger magnitude. */
|
|
8
14
|
export declare function heatmapColor(value: number, { domain, palette }: HeatmapScale): string;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
export type { AttentionMatrixProps, AttentionToken } from './attention-matrix.tsx';
|
|
2
|
+
export { AttentionMatrix, attentionMatrixLimits } from './attention-matrix.tsx';
|
|
3
|
+
export type { CalendarDay, CalendarHeatmapProps, CalendarWeekday } from './calendar-heatmap.tsx';
|
|
4
|
+
export { CalendarHeatmap, calendarHeatmapLimits } from './calendar-heatmap.tsx';
|
|
1
5
|
export type { ColorLegendProps } from './color-legend.tsx';
|
|
2
6
|
export { ColorLegend } from './color-legend.tsx';
|
|
7
|
+
export type { ConfusionClass, ConfusionMatrixProps } from './confusion-matrix.tsx';
|
|
8
|
+
export { ConfusionMatrix, confusionMatrixLimits } from './confusion-matrix.tsx';
|
|
9
|
+
export type { CorrelationMatrixProps, CorrelationVariable } from './correlation-matrix.tsx';
|
|
10
|
+
export { CorrelationMatrix, correlationMatrixLimits } from './correlation-matrix.tsx';
|
|
3
11
|
export type { HeatmapPalette, HeatmapScale } from './heatmap-scale.ts';
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
12
|
+
export { heatmapColor } from './heatmap-scale.ts';
|
|
13
|
+
export { matrixLimits } from './matrix-figure.tsx';
|
|
14
|
+
export type { MatrixAxisItem, MatrixCell, MatrixCellRange, MatrixCellRangeDetails, MatrixCellValuesProps, MatrixCoordinate, } from './matrix-types.ts';
|
|
15
|
+
export { matrixCellId } from './matrix-types.ts';
|
|
16
|
+
export type { MatrixProps } from './matrix.tsx';
|
|
17
|
+
export { Matrix } from './matrix.tsx';
|
|
6
18
|
export type { HeatmapToken, TokenHeatmapProps } from './token-heatmap.tsx';
|
|
7
|
-
export {
|
|
19
|
+
export { TokenHeatmap, tokenHeatmapLimits } from './token-heatmap.tsx';
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
2
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
1
3
|
import type { MatrixCell } from './matrix-types.ts';
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export
|
|
4
|
+
/** How many characters of a value fit inside a square cell of this size without touching its border. */
|
|
5
|
+
export declare function cellTextCapacity(size: number): number;
|
|
6
|
+
export type CellTextInput = {
|
|
7
|
+
readonly value: number;
|
|
8
|
+
readonly locale: string;
|
|
9
|
+
readonly format: ValueFormat;
|
|
10
|
+
/** The most characters the cell holds, from `cellTextCapacity`. */
|
|
11
|
+
readonly capacity: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The text a square cell writes for its value: the supplied format when it fits, else the value rounded to whole units,
|
|
15
|
+
* else in compact notation. Rounding is skipped where it would write a nonzero value as zero. Undefined means no form
|
|
16
|
+
* fits, and the cell shows a dot while the readout keeps the exact value.
|
|
17
|
+
*/
|
|
18
|
+
export declare function cellValueText({ value, locale, format, capacity }: CellTextInput): string | undefined;
|
|
19
|
+
/** What a square cell writes inside itself: its value text, or the glyph for its state. */
|
|
20
|
+
export declare function matrixCellGlyph(cell: MatrixCell, text: string | undefined, isOutsideDomain: boolean): string;
|
|
21
|
+
export type MatrixValueTextInput = {
|
|
22
|
+
readonly cell: MatrixCell | undefined;
|
|
23
|
+
readonly domain: NumericDomain;
|
|
24
|
+
readonly locale: string;
|
|
25
|
+
readonly format: ValueFormat;
|
|
26
|
+
};
|
|
27
|
+
/** A cell's exact value, or its state and reason, as a reader sees it in the readout and the exact-value table. */
|
|
28
|
+
export declare function matrixValueText({ cell, domain, locale, format }: MatrixValueTextInput): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { FigureFrameInput, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
4
|
+
import type { HeatmapScale } from './heatmap-scale.ts';
|
|
5
|
+
import type { MatrixMarking } from './matrix-mark.tsx';
|
|
6
|
+
import type { MatrixAxisItem, MatrixCell, MatrixCellRangeProps, MatrixCellValuesProps } from './matrix-types.ts';
|
|
7
|
+
/** The render limit every matrix shares. Larger input shows an explicit error; the application supplies a window. */
|
|
8
|
+
export declare const matrixLimits: {
|
|
9
|
+
readonly cells: 4096;
|
|
10
|
+
};
|
|
11
|
+
export type MatrixFigureProps = FigureFrameInput & FigureSelectionProps & MatrixCellRangeProps & MatrixCellValuesProps & HeatmapScale & {
|
|
12
|
+
readonly emptyLabel: string;
|
|
13
|
+
readonly rows: ReadonlyArray<MatrixAxisItem>;
|
|
14
|
+
readonly columns: ReadonlyArray<MatrixAxisItem>;
|
|
15
|
+
readonly cells: ReadonlyArray<MatrixCell>;
|
|
16
|
+
/** The exact value format for readouts and the exact-value table. */
|
|
17
|
+
readonly valueFormat: ValueFormat;
|
|
18
|
+
/** What a cell writes inside itself, when it differs from the exact value, such as a share of its row. */
|
|
19
|
+
readonly glyphFormat?: ValueFormat | undefined;
|
|
20
|
+
/** What the color measures, for the legend and the table. */
|
|
21
|
+
readonly valueLabel: string;
|
|
22
|
+
readonly variant: 'values' | 'strip';
|
|
23
|
+
/** What rows and columns stand for, shown at the corner and above the columns: "Actual", "Predicted". */
|
|
24
|
+
readonly rowTitle?: string | undefined;
|
|
25
|
+
readonly columnTitle?: string | undefined;
|
|
26
|
+
/** The nouns a range summary uses for a row and a column. */
|
|
27
|
+
readonly rowNoun?: string | undefined;
|
|
28
|
+
readonly columnNoun?: string | undefined;
|
|
29
|
+
/** Token text and other literals read best in the mono face. */
|
|
30
|
+
readonly axisFont?: 'text' | 'mono' | undefined;
|
|
31
|
+
/** Strip headers clip to their column, or run past it for sparse labels such as months over weeks. */
|
|
32
|
+
readonly headers?: 'clip' | 'overflow' | undefined;
|
|
33
|
+
readonly marking?: ((row: MatrixAxisItem, column: MatrixAxisItem) => MatrixMarking | undefined) | undefined;
|
|
34
|
+
/** The coordinate part of a cell's sentence. Absent writes "row → column". */
|
|
35
|
+
readonly cellLabel?: ((row: MatrixAxisItem, column: MatrixAxisItem) => string) | undefined;
|
|
36
|
+
/** A cell's exact value text. Absent writes the value in the value format, or the cell's state. */
|
|
37
|
+
readonly valueText?: ((cell: MatrixCell | undefined) => string) | undefined;
|
|
38
|
+
/** A cell's copied text. Absent copies the supplied number exactly, and nothing for a cell without one. */
|
|
39
|
+
readonly copyText?: ((cell: MatrixCell | undefined) => string) | undefined;
|
|
40
|
+
/** More lines for the key under the plot, such as "Outlined: correct predictions". */
|
|
41
|
+
readonly notes?: ReadonlyArray<string> | undefined;
|
|
42
|
+
/** The preset's own reason to refuse its input, checked before the shared rules. */
|
|
43
|
+
readonly problem?: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The drawing every matrix shares: headers, cells, the keyboard and pointer inspection, the controlled selection and
|
|
47
|
+
* cell range, copying, the legend, the readout and the exact-value table. Matrix and its presets set what each cell
|
|
48
|
+
* means; this draws it.
|
|
49
|
+
*/
|
|
50
|
+
export declare function MatrixFigure(props: MatrixFigureProps): ReactNode;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as stylex from '@stylexjs/stylex';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { MatrixAxisItem, MatrixCell } from './matrix-types.ts';
|
|
4
|
+
/** How a preset marks a coordinate: left blank, outlined (a confusion diagonal), or drawn in gray as context. */
|
|
5
|
+
export type MatrixMarking = 'hidden' | 'outlined' | 'context';
|
|
6
|
+
/** One drawn coordinate as both matrix drawings read it. */
|
|
7
|
+
export type MatrixCellView = {
|
|
8
|
+
/** The chart item id: the supplied cell's id, or the coordinate's id where no cell was supplied. */
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly row: MatrixAxisItem;
|
|
11
|
+
readonly column: MatrixAxisItem;
|
|
12
|
+
readonly cell: MatrixCell | undefined;
|
|
13
|
+
/** The full sentence: coordinate and exact value. */
|
|
14
|
+
readonly label: string;
|
|
15
|
+
/** The square cell's text: its short value or its state glyph. */
|
|
16
|
+
readonly glyph: string;
|
|
17
|
+
readonly fill: string | undefined;
|
|
18
|
+
readonly isOutside: boolean;
|
|
19
|
+
readonly marking: MatrixMarking | undefined;
|
|
20
|
+
/** The range's outer edges this cell draws, as an inset shadow. */
|
|
21
|
+
readonly edges: string | undefined;
|
|
22
|
+
readonly isSelected: boolean;
|
|
23
|
+
readonly isInspected: boolean;
|
|
24
|
+
readonly isCursor: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type MatrixMarkProps = {
|
|
27
|
+
readonly view: MatrixCellView;
|
|
28
|
+
/** True when the application takes selection requests: a supplied cell is then a button. */
|
|
29
|
+
readonly isSelectable: boolean;
|
|
30
|
+
readonly appearance: ReadonlyArray<stylex.StyleXStyles | false | undefined>;
|
|
31
|
+
readonly children?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
/** One inspectable matrix cell with its range edges, selection and keyboard cursor, in either drawing. */
|
|
34
|
+
export declare function MatrixMark({ view, isSelectable, appearance, children }: MatrixMarkProps): ReactNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
2
|
+
import type { MatrixAxisItem, MatrixCellRangeProps } from './matrix-types.ts';
|
|
3
|
+
/** What every matrix preset accepts besides its own data: the figure, the selected cell and the cell range. */
|
|
4
|
+
export type MatrixPresetProps = FigureProps & FigureSelectionProps & MatrixCellRangeProps;
|
|
5
|
+
export type DenseInput = {
|
|
6
|
+
readonly rows: ReadonlyArray<MatrixAxisItem>;
|
|
7
|
+
readonly columns: ReadonlyArray<MatrixAxisItem>;
|
|
8
|
+
/** One line per row, one value per column. */
|
|
9
|
+
readonly values: ReadonlyArray<ReadonlyArray<number | null>>;
|
|
10
|
+
/** What rows and columns are called in the messages: "classes", "variables". */
|
|
11
|
+
readonly noun: string;
|
|
12
|
+
/** The largest number of rows or columns the preset draws. */
|
|
13
|
+
readonly limit: number;
|
|
14
|
+
};
|
|
15
|
+
/** Why a row-by-column table of values cannot be drawn: too large, duplicate identities or a ragged shape. */
|
|
16
|
+
export declare function denseProblem({ rows, columns, values, noun, limit }: DenseInput): string | undefined;
|
|
17
|
+
/** The value at a row and column of a dense table, or null where the line holds none. */
|
|
18
|
+
export declare function denseValue(values: DenseInput['values'], row: number, column: number): number | null;
|
|
19
|
+
/** Token text with each space, newline and tab drawn as a visible symbol, for a header. Readouts quote exact text. */
|
|
20
|
+
export declare function visibleText(text: string): string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CellBounds } from '@ui-sdk/core';
|
|
2
|
+
import type { MatrixAxisItem, MatrixCellRange, MatrixCoordinate } from './matrix-types.ts';
|
|
3
|
+
/** The rows and columns a range is measured against, in drawn order. */
|
|
4
|
+
export type RangeAxes = {
|
|
5
|
+
readonly rows: ReadonlyArray<MatrixAxisItem>;
|
|
6
|
+
readonly columns: ReadonlyArray<MatrixAxisItem>;
|
|
7
|
+
};
|
|
8
|
+
/** Why a supplied range cannot be drawn, or undefined when every corner names a supplied row and column. */
|
|
9
|
+
export declare function rangeProblem(range: MatrixCellRange | null, { rows, columns }: RangeAxes): string | undefined;
|
|
10
|
+
/** The inclusive rows and columns a range covers, from zero. */
|
|
11
|
+
export declare function rangeBounds(range: MatrixCellRange, { rows, columns }: RangeAxes): CellBounds;
|
|
12
|
+
/** Whether a coordinate lies inside the bounds. */
|
|
13
|
+
export declare function isInBounds(bounds: CellBounds, row: number, column: number): boolean;
|
|
14
|
+
export type RangeKeyInput = RangeAxes & {
|
|
15
|
+
readonly key: string;
|
|
16
|
+
readonly range: MatrixCellRange | null;
|
|
17
|
+
/** The keyboard cursor, where a new range starts. */
|
|
18
|
+
readonly from: MatrixCoordinate;
|
|
19
|
+
/** True in right-to-left text, where Left and Right swap. */
|
|
20
|
+
readonly isReversed: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The range after Shift with a key: an arrow grows or shrinks it by one cell from its far corner, Home and End take it
|
|
24
|
+
* to the row's ends. Undefined for any other key. The far corner stops at the matrix's edges.
|
|
25
|
+
*/
|
|
26
|
+
export declare function extendRange({ key, range, from, isReversed, rows, columns, }: RangeKeyInput): MatrixCellRange | undefined;
|
|
27
|
+
/** The range that covers every row and column. */
|
|
28
|
+
export declare function wholeRange({ rows, columns }: RangeAxes): MatrixCellRange | undefined;
|
|
29
|
+
export type RangeTextInput = RangeAxes & {
|
|
30
|
+
readonly bounds: CellBounds;
|
|
31
|
+
/** A cell's exact value as copied text: empty for a cell with no value. */
|
|
32
|
+
readonly read: (coordinate: MatrixCoordinate) => string;
|
|
33
|
+
};
|
|
34
|
+
/** The range's exact values as tab-separated text, one line per row, ready to paste into a spreadsheet. */
|
|
35
|
+
export declare function rangeText({ bounds, rows, columns, read }: RangeTextInput): string;
|
|
36
|
+
export type RangeSummaryInput = RangeAxes & {
|
|
37
|
+
readonly bounds: CellBounds;
|
|
38
|
+
/** How many drawn cells the range holds. */
|
|
39
|
+
readonly count: number;
|
|
40
|
+
/** What a row and a column are called in this matrix: "actual class", "predicted class". */
|
|
41
|
+
readonly rowNoun?: string | undefined;
|
|
42
|
+
readonly columnNoun?: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
/** The range as a reader hears it: "6 cells selected: rows Cat to Dog, columns Bird to Fish". */
|
|
45
|
+
export declare function rangeSummary({ bounds, rows, columns, count, rowNoun, columnNoun, }: RangeSummaryInput): string;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
import type { MatrixAxisItem, MatrixCell } from './matrix-types.ts';
|
|
6
|
-
type StripProps = HeatmapScale & {
|
|
2
|
+
import type { MatrixCellView } from './matrix-mark.tsx';
|
|
3
|
+
import type { MatrixAxisItem } from './matrix-types.ts';
|
|
4
|
+
export type MatrixStripProps = {
|
|
7
5
|
readonly rows: ReadonlyArray<MatrixAxisItem>;
|
|
8
6
|
readonly columns: ReadonlyArray<MatrixAxisItem>;
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
|
|
7
|
+
readonly rowTitle?: string | undefined;
|
|
8
|
+
readonly columnTitle?: string | undefined;
|
|
9
|
+
readonly font: 'text' | 'mono';
|
|
10
|
+
readonly headers: 'clip' | 'overflow';
|
|
11
|
+
/** The drawn cell at a coordinate, or undefined where the matrix leaves a blank. */
|
|
12
|
+
readonly viewAt: (rowId: string, columnId: string) => MatrixCellView | undefined;
|
|
13
|
+
readonly isSelectable: boolean;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
-
* Draws a matrix as compact intensity rows that fill the available width, such as months across categories
|
|
17
|
-
*
|
|
16
|
+
* Draws a matrix as compact intensity rows that fill the available width, such as months across categories or weeks
|
|
17
|
+
* across weekdays.
|
|
18
18
|
*/
|
|
19
|
-
export declare function MatrixStrip({ rows, columns,
|
|
20
|
-
export {};
|
|
19
|
+
export declare function MatrixStrip({ rows, columns, rowTitle, columnTitle, font, headers, viewAt, isSelectable, }: MatrixStripProps): ReactNode;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { CellRangeReason } from '@ui-sdk/core';
|
|
2
|
+
/** A row or a column of a matrix, with the identity selection and linked views use. */
|
|
1
3
|
export type MatrixAxisItem = {
|
|
2
4
|
readonly id: string;
|
|
3
5
|
/** The full name used in headers, inspection and exact values. */
|
|
@@ -5,6 +7,10 @@ export type MatrixAxisItem = {
|
|
|
5
7
|
/** A concise header, such as "J" for January, that a compact strip shows. Absent uses the label. */
|
|
6
8
|
readonly axisLabel?: string | undefined;
|
|
7
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* One supplied coordinate: a measured value, a value masked by the analysis (such as a future token), or a value that
|
|
12
|
+
* was not recorded. Masked and missing cells name their reason, and neither is ever drawn as zero.
|
|
13
|
+
*/
|
|
8
14
|
export type MatrixCell = {
|
|
9
15
|
readonly id: string;
|
|
10
16
|
readonly rowId: string;
|
|
@@ -19,3 +25,37 @@ export type MatrixCell = {
|
|
|
19
25
|
readonly kind: 'missing';
|
|
20
26
|
readonly reason: string;
|
|
21
27
|
});
|
|
28
|
+
/** A coordinate of a matrix, by its row and column identities. */
|
|
29
|
+
export type MatrixCoordinate = {
|
|
30
|
+
readonly rowId: string;
|
|
31
|
+
readonly columnId: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A rectangular block of cells the reader marked for copying or comparison: from the cell it started at to the cell it
|
|
35
|
+
* reaches, inclusive. It is application state, held by identity so it survives a reorder of rows or columns.
|
|
36
|
+
*/
|
|
37
|
+
export type MatrixCellRange = {
|
|
38
|
+
readonly anchor: MatrixCoordinate;
|
|
39
|
+
readonly end: MatrixCoordinate;
|
|
40
|
+
};
|
|
41
|
+
/** Why the range changed: Shift with an arrow key, a Shift press on a cell, a drag across cells, or Escape. */
|
|
42
|
+
export type MatrixCellRangeDetails = {
|
|
43
|
+
readonly reason: CellRangeReason;
|
|
44
|
+
readonly event?: Event | undefined;
|
|
45
|
+
};
|
|
46
|
+
/** The application's cell range and its request to change it. Without the callback, the matrix offers no range. */
|
|
47
|
+
export type MatrixCellRangeProps = {
|
|
48
|
+
readonly cellRange?: MatrixCellRange | null | undefined;
|
|
49
|
+
readonly onCellRangeChange?: ((range: MatrixCellRange | null, details: MatrixCellRangeDetails) => void) | undefined;
|
|
50
|
+
};
|
|
51
|
+
/** Whether square cells write their values, for one large matrix or many small ones. */
|
|
52
|
+
export type MatrixCellValuesProps = {
|
|
53
|
+
/**
|
|
54
|
+
* A `shown` value writes each cell's value inside it, in a shorter form when the cell is small. A `hidden` value
|
|
55
|
+
* draws color only, with smaller cells, for small multiples such as one panel per attention head. The readout and the
|
|
56
|
+
* exact-value table still give every value, and absent means shown.
|
|
57
|
+
*/
|
|
58
|
+
readonly cellValues?: 'shown' | 'hidden' | undefined;
|
|
59
|
+
};
|
|
60
|
+
/** The identity a preset gives the cell at a coordinate, for `selected` and `onSelectedChange`. */
|
|
61
|
+
export declare function matrixCellId(rowId: string, columnId: string): string;
|