@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
|
@@ -2,43 +2,48 @@ import type { ChangeDetails } from '@ui-sdk/core';
|
|
|
2
2
|
import type { ComponentProps, ReactNode } from 'react';
|
|
3
3
|
import { Slider } from '../../../forms/src/index.ts';
|
|
4
4
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
5
|
-
import type {
|
|
5
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
6
|
+
import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
|
|
7
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
8
|
+
/** One supplied coordinate pair with a stable id, so selection survives reordering. */
|
|
6
9
|
export type ScatterPoint = {
|
|
7
10
|
readonly id: string;
|
|
8
11
|
readonly label: string;
|
|
9
12
|
readonly x: number;
|
|
10
13
|
readonly y: number;
|
|
11
|
-
readonly tone
|
|
14
|
+
readonly tone?: ChartTone | undefined;
|
|
12
15
|
};
|
|
16
|
+
/** A rectangle of coordinates, in axis values, that the reader selected. */
|
|
13
17
|
export type ScatterRange = {
|
|
14
|
-
readonly x:
|
|
15
|
-
readonly y:
|
|
18
|
+
readonly x: NumericDomain;
|
|
19
|
+
readonly y: NumericDomain;
|
|
16
20
|
};
|
|
17
21
|
type SliderDetails = Parameters<NonNullable<ComponentProps<typeof Slider.Root<[number, number]>>['onValueChange']>>[1];
|
|
18
22
|
/** Why the range changed: a drag on the plot, one of the bound sliders, or the clear button. */
|
|
19
23
|
export type ScatterRangeDetails = ChangeDetails<'drag' | 'clear-press'> | SliderDetails;
|
|
20
|
-
export type
|
|
21
|
-
readonly value: ScatterRange | null;
|
|
22
|
-
readonly onChange: (range: ScatterRange | null, details: ScatterRangeDetails) => void;
|
|
23
|
-
readonly xStep: number;
|
|
24
|
-
readonly yStep: number;
|
|
25
|
-
readonly locale: string;
|
|
26
|
-
};
|
|
27
|
-
export type ScatterPlotProps = {
|
|
28
|
-
readonly title: string;
|
|
29
|
-
readonly report?: ChartReport | undefined;
|
|
30
|
-
readonly description: string;
|
|
24
|
+
export type ScatterPlotProps = FigureProps & FigureSelectionProps & {
|
|
31
25
|
readonly points: ReadonlyArray<ScatterPoint>;
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
|
|
35
|
-
readonly
|
|
36
|
-
|
|
37
|
-
readonly
|
|
38
|
-
|
|
39
|
-
readonly
|
|
40
|
-
|
|
26
|
+
readonly x: PlotAxis;
|
|
27
|
+
readonly y: PlotAxis;
|
|
28
|
+
/** The coordinate range the application holds, or null for none. */
|
|
29
|
+
readonly range?: ScatterRange | null | undefined;
|
|
30
|
+
/** Asks the application to set or clear the range. With it, the plot offers a drag and two range sliders. */
|
|
31
|
+
readonly onRangeChange?: ((range: ScatterRange | null, details: ScatterRangeDetails) => void) | undefined;
|
|
32
|
+
/** The slider steps on each axis, in axis units. Required with `onRangeChange`. */
|
|
33
|
+
readonly rangeStep?: {
|
|
34
|
+
readonly x: number;
|
|
35
|
+
readonly y: number;
|
|
36
|
+
} | undefined;
|
|
37
|
+
readonly height?: PlotHeight | undefined;
|
|
38
|
+
};
|
|
39
|
+
/** The most points one scatter plot draws. Supply a labelled sample or window for more. */
|
|
40
|
+
export declare const scatterLimits: {
|
|
41
|
+
readonly points: 1000;
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Supplied coordinates as points on two measured axes, such as an embedding projection or cost against quality. Either
|
|
45
|
+
* axis can be linear, log or symlog, points can be selected, and a coordinate range can be drawn by dragging or set
|
|
46
|
+
* with two range sliders. The application computes positions, and the plot never infers similarity or causation.
|
|
47
|
+
*/
|
|
43
48
|
export declare function ScatterPlot(props: ScatterPlotProps): ReactNode;
|
|
44
49
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
2
3
|
import type { TimeSeries } from './time-series-data.ts';
|
|
3
4
|
/** A recorded point a sparkline can mark: the lowest, the highest, or the latest present observation. */
|
|
4
5
|
export type SparklinePoint = 'minimum' | 'maximum' | 'last';
|
|
@@ -8,7 +9,7 @@ export type SparklineProps = {
|
|
|
8
9
|
readonly unit: string;
|
|
9
10
|
readonly timestampUnit: 'seconds' | 'milliseconds';
|
|
10
11
|
readonly series: TimeSeries;
|
|
11
|
-
readonly valueDomain:
|
|
12
|
+
readonly valueDomain: NumericDomain;
|
|
12
13
|
/**
|
|
13
14
|
* Marks these recorded points: hollow rings at the first lowest and highest values, and a solid dot at the latest.
|
|
14
15
|
* Their values join the accessible description. Absent marks nothing.
|
|
@@ -16,5 +17,16 @@ export type SparklineProps = {
|
|
|
16
17
|
readonly markedPoints?: ReadonlyArray<SparklinePoint> | undefined;
|
|
17
18
|
/** Draws a faint reference value, such as a target, inside `valueDomain`. Absent draws none. */
|
|
18
19
|
readonly baseline?: number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* `inline` (the default) draws a 128 by 32 pixel mark to sit beside a number or in a table cell. The `figure` value
|
|
22
|
+
* sets it in the figure frame, with its title and summary shown, filling the width its container gives it.
|
|
23
|
+
*/
|
|
24
|
+
readonly layout?: SparklineLayout | undefined;
|
|
19
25
|
};
|
|
20
|
-
|
|
26
|
+
/** Where a sparkline sits: inline beside text, or as a small figure of its own. */
|
|
27
|
+
export type SparklineLayout = 'inline' | 'figure';
|
|
28
|
+
/**
|
|
29
|
+
* A passive trend of one measure: a line on a supplied value domain, with optional marked points and a reference value.
|
|
30
|
+
* The application supplies the summary sentence that states what the line shows.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Sparkline({ title, summary, unit, timestampUnit, series, valueDomain, markedPoints, baseline, layout, }: SparklineProps): ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
|
-
import type { TimeSeries } from './time-series-data.ts';
|
|
2
|
+
import type { TimeSeries, ToneResolver } from './time-series-data.ts';
|
|
3
3
|
/** One observation of a band. Both bounds are present or both are missing; a missing center draws no line there. */
|
|
4
4
|
export type TimeSeriesBandPoint = {
|
|
5
5
|
readonly timestamp: number;
|
|
@@ -52,9 +52,10 @@ export declare function validateBands({ bands, crossings, series, timestamps, }:
|
|
|
52
52
|
readonly series: ReadonlyArray<TimeSeries>;
|
|
53
53
|
readonly timestamps: ReadonlyArray<number>;
|
|
54
54
|
}): string | undefined;
|
|
55
|
-
export declare function prepareBands({ series, bands, }: {
|
|
55
|
+
export declare function prepareBands({ series, bands, tones, }: {
|
|
56
56
|
readonly series: ReadonlyArray<TimeSeries>;
|
|
57
57
|
readonly bands: ReadonlyArray<TimeSeriesBand>;
|
|
58
|
+
readonly tones: ToneResolver;
|
|
58
59
|
}): ReadonlyArray<PlotBand>;
|
|
59
60
|
export declare function findCrossings({ crossings, series, bands, }: {
|
|
60
61
|
readonly crossings: ReadonlyArray<TimeSeriesCrossing>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
|
+
import type { ToneInput } from '../figure/tone-scope.tsx';
|
|
3
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
2
4
|
export type TimeSeriesPoint = {
|
|
3
5
|
readonly timestamp: number;
|
|
4
6
|
readonly value: number | null;
|
|
@@ -47,6 +49,8 @@ export declare const timeSeriesLimits: {
|
|
|
47
49
|
readonly markers: 200;
|
|
48
50
|
readonly panels: 12;
|
|
49
51
|
};
|
|
52
|
+
/** Resolves a record's tone, as `useTones` returns it. */
|
|
53
|
+
export type ToneResolver = (input: ToneInput) => ChartTone;
|
|
50
54
|
export declare function validateTimeSeries({ series, isStacked, markers, timeline, }: {
|
|
51
55
|
readonly series: ReadonlyArray<TimeSeries>;
|
|
52
56
|
readonly isStacked: boolean;
|
|
@@ -60,5 +64,11 @@ export declare function timeSeriesSignature({ series, markers, timestampUnit, is
|
|
|
60
64
|
readonly timestampUnit: string;
|
|
61
65
|
readonly isStacked: boolean;
|
|
62
66
|
}): string;
|
|
63
|
-
|
|
64
|
-
export declare function
|
|
67
|
+
/** The time an axis spans: the first to the last observation, widened around a lone one so it sits mid-plot. */
|
|
68
|
+
export declare function observationDomain(minimum: number, maximum: number): NumericDomain;
|
|
69
|
+
/** Stacks the series when asked and gives each its tone. An explicit tone takes no automatic slot. */
|
|
70
|
+
export declare function prepareTimeSeries({ series, isStacked, tones, }: {
|
|
71
|
+
readonly series: ReadonlyArray<TimeSeries>;
|
|
72
|
+
readonly isStacked: boolean;
|
|
73
|
+
readonly tones: ToneResolver;
|
|
74
|
+
}): ReadonlyArray<PlotSeries>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { PlotSeries } from './time-series-data.ts';
|
|
3
|
-
|
|
3
|
+
/** A sparkline's line: broken at gaps, with dots beside each gap, on a lone observation and at the latest one. */
|
|
4
|
+
export declare function TimeSeriesLine({ series, x, y, pointRadius, }: {
|
|
4
5
|
readonly series: PlotSeries;
|
|
5
6
|
readonly x: (timestamp: number) => number;
|
|
6
7
|
readonly y: (value: number) => number;
|
|
7
|
-
readonly inspectedTimestamp?: number | undefined;
|
|
8
8
|
readonly pointRadius?: number | undefined;
|
|
9
9
|
}): ReactNode;
|
|
@@ -18,18 +18,20 @@ type LaneInput = {
|
|
|
18
18
|
};
|
|
19
19
|
/** Places each label beside its guide in the first lane where it fits, flipping before the plot's right edge. */
|
|
20
20
|
export declare function placeInstants({ instants, x, right }: LaneInput): ReadonlyArray<PlacedInstant>;
|
|
21
|
-
|
|
21
|
+
/** The room the instants' label lanes take above the plot. */
|
|
22
|
+
export declare function instantsInset(placed: ReadonlyArray<PlacedInstant>): number;
|
|
22
23
|
type Scales = {
|
|
23
24
|
readonly x: (timestamp: number) => number;
|
|
24
25
|
readonly y: (value: number) => number;
|
|
25
26
|
};
|
|
26
|
-
/** Shades each band between its bounds
|
|
27
|
+
/** Shades each band between its bounds and draws its center line over the shade. */
|
|
27
28
|
export declare function TimeSeriesBands({ bands, x, y }: Scales & {
|
|
28
29
|
readonly bands: ReadonlyArray<PlotBand>;
|
|
29
30
|
}): ReactNode;
|
|
30
|
-
/** Draws each instant's guide from its label lane to the axis, with a ring where a crossing lands. */
|
|
31
|
-
export declare function TimeInstants({ placed, x, y, bottom, }: Scales & {
|
|
31
|
+
/** Draws each instant's guide from its label lane above the plot to the axis, with a ring where a crossing lands. */
|
|
32
|
+
export declare function TimeInstants({ placed, x, y, top, bottom, }: Scales & {
|
|
32
33
|
readonly placed: ReadonlyArray<PlacedInstant>;
|
|
34
|
+
readonly top: number;
|
|
33
35
|
readonly bottom: number;
|
|
34
36
|
}): ReactNode;
|
|
35
37
|
export {};
|
|
@@ -1,59 +1,83 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ChartSeriesReport } from '../chart-frame.tsx';
|
|
3
2
|
import type { ChartRangeDetails, ChartRangeValue } from '../chart-range.tsx';
|
|
3
|
+
import type { TimeFormat, ValueFormat } from '../figure/figure-format.ts';
|
|
4
|
+
import type { FigureFrameInput, SeriesFigureProps } from '../figure/figure-props.ts';
|
|
5
|
+
import type { PlotHeight } from '../plot/plot-layout.ts';
|
|
4
6
|
import type { TimeSeriesBand, TimeSeriesCrossing } from './time-series-bands.ts';
|
|
5
7
|
import type { TimeSeries, TimeSeriesMarker } from './time-series-data.ts';
|
|
6
|
-
/**
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export type TimeSeriesChartProps = {
|
|
14
|
-
readonly title: string;
|
|
15
|
-
readonly description?: ReactNode;
|
|
8
|
+
/** The unit of the supplied timestamps. Formats always receive milliseconds. */
|
|
9
|
+
export type TimestampUnit = 'seconds' | 'milliseconds';
|
|
10
|
+
/**
|
|
11
|
+
* A line chart of measures over time. The series share their observation timestamps; a null value is a gap. Formats
|
|
12
|
+
* write the values and instants in the figure's locale.
|
|
13
|
+
*/
|
|
14
|
+
export type TimeSeriesChartProps = SeriesFigureProps & {
|
|
16
15
|
readonly series: ReadonlyArray<TimeSeries>;
|
|
17
|
-
readonly timestampUnit:
|
|
18
|
-
|
|
19
|
-
readonly
|
|
20
|
-
|
|
16
|
+
readonly timestampUnit: TimestampUnit;
|
|
17
|
+
/** How readouts, tables and the time axis write an instant. */
|
|
18
|
+
readonly timeFormat: TimeFormat;
|
|
19
|
+
/** How readouts and tables write a value. */
|
|
20
|
+
readonly valueFormat: ValueFormat;
|
|
21
|
+
/** How the value axis writes its ticks. Absent uses the compact form of `valueFormat`. */
|
|
22
|
+
readonly tickFormat?: ValueFormat | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The value axis title, with its unit: "Latency (ms)". With a title the ticks leave a `unit` style out, so the unit
|
|
25
|
+
* is written once. Absent draws no title and keeps the unit in every tick.
|
|
26
|
+
*/
|
|
27
|
+
readonly valueLabel?: string | undefined;
|
|
21
28
|
readonly markers?: ReadonlyArray<TimeSeriesMarker> | undefined;
|
|
22
|
-
readonly height?:
|
|
23
|
-
readonly actions?: ReactNode;
|
|
24
|
-
readonly report?: ChartSeriesReport | undefined;
|
|
29
|
+
readonly height?: PlotHeight | undefined;
|
|
25
30
|
/** Shaded ranges with optional center lines, drawn beneath the line series and listed in the legend. */
|
|
26
31
|
readonly bands?: ReadonlyArray<TimeSeriesBand> | undefined;
|
|
27
32
|
/** Where a series or band center first reaches a value. A crossing that never happens is listed as not reached. */
|
|
28
33
|
readonly crossings?: ReadonlyArray<TimeSeriesCrossing> | undefined;
|
|
29
|
-
/**
|
|
30
|
-
readonly
|
|
34
|
+
/** The selected time range, in the timestamps' unit. The application owns it, for example to filter another view. */
|
|
35
|
+
readonly range?: ChartRangeValue | null | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Lets a reader select a range of time by dragging on the plot, with the keyboard, or with the buttons below it.
|
|
38
|
+
* Requires `rangeStep`.
|
|
39
|
+
*/
|
|
40
|
+
readonly onRangeChange?: ((range: ChartRangeValue | null, details: ChartRangeDetails) => void) | undefined;
|
|
41
|
+
/** What each end of the range snaps to and what an arrow key moves it by, in the timestamps' unit. */
|
|
42
|
+
readonly rangeStep?: number | undefined;
|
|
31
43
|
};
|
|
44
|
+
/** A filled area chart over time. Stacked areas add up supplied nonnegative values from zero. */
|
|
32
45
|
export type AreaChartProps = TimeSeriesChartProps & {
|
|
33
46
|
readonly isStacked?: boolean | undefined;
|
|
34
47
|
};
|
|
35
|
-
|
|
48
|
+
/** The frame of a time-series chart before its first read, with the series it will draw. */
|
|
49
|
+
export type TimeSeriesChartPlaceholderProps = Omit<FigureFrameInput, 'status'> & {
|
|
36
50
|
readonly series: ReadonlyArray<Pick<TimeSeries, 'id' | 'label' | 'tone'>>;
|
|
51
|
+
readonly height?: PlotHeight | undefined;
|
|
37
52
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}>;
|
|
53
|
+
/**
|
|
54
|
+
* One panel of small multiples: its own frame, series, value format, axis title, markers and pale uncertainty bands
|
|
55
|
+
* (the same `TimeSeriesBand` shape a line chart takes).
|
|
56
|
+
*/
|
|
57
|
+
export type SmallMultiplesPanel = Omit<SeriesFigureProps, 'locale' | 'status'> & Pick<TimeSeriesChartProps, 'series' | 'valueFormat' | 'tickFormat' | 'valueLabel' | 'markers' | 'bands'> & {
|
|
58
|
+
readonly id: string;
|
|
59
|
+
};
|
|
60
|
+
/** Panels that share observation timestamps, the time axis and one inspected timestamp. */
|
|
61
|
+
export type SmallMultiplesProps = Pick<TimeSeriesChartProps, 'timestampUnit' | 'timeFormat' | 'height' | 'locale' | 'status'> & {
|
|
62
|
+
readonly charts: ReadonlyArray<SmallMultiplesPanel>;
|
|
49
63
|
};
|
|
50
|
-
|
|
51
|
-
|
|
64
|
+
/** The panels of small multiples before their first read, at the same height. */
|
|
65
|
+
export type SmallMultiplesPlaceholderProps = Pick<SmallMultiplesProps, 'height' | 'locale'> & {
|
|
66
|
+
readonly charts: ReadonlyArray<Omit<TimeSeriesChartPlaceholderProps, 'locale' | 'height'> & {
|
|
52
67
|
readonly id: string;
|
|
53
68
|
}>;
|
|
54
69
|
};
|
|
70
|
+
/** Measures over elapsed time, with gaps, markers, bands, crossings and an optional selected range. */
|
|
55
71
|
export declare function LineChart(props: TimeSeriesChartProps): ReactNode;
|
|
72
|
+
/** Magnitudes over elapsed time, filled from zero, or stacked when the supplied values add up. */
|
|
56
73
|
export declare function AreaChart({ isStacked, ...props }: AreaChartProps): ReactNode;
|
|
74
|
+
/** Holds a time-series chart's frame, legend and height while its first read is under way. */
|
|
57
75
|
export declare function TimeSeriesChartPlaceholder(props: TimeSeriesChartPlaceholderProps): ReactNode;
|
|
58
|
-
|
|
59
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Measures compared on the same observation timestamps, one panel each, with independent value scales and units. The
|
|
78
|
+
* panels share one value gutter and the time axis under the last panel. One inspected timestamp guides every panel; the
|
|
79
|
+
* panel the reader inspects shows the readout.
|
|
80
|
+
*/
|
|
81
|
+
export declare function SmallMultiples({ charts, timestampUnit, timeFormat, height, locale, status, }: SmallMultiplesProps): ReactNode;
|
|
82
|
+
/** Holds the panels of small multiples, their summaries and the bottom time axis while the first read is under way. */
|
|
83
|
+
export declare function SmallMultiplesPlaceholder({ charts, height, locale }: SmallMultiplesPlaceholderProps): ReactNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** A text label placed in a plot, with the position its text is centered on. */
|
|
2
|
+
export type PlacedLabel = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly text: string;
|
|
5
|
+
readonly x: number;
|
|
6
|
+
readonly y: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The labels that fit without touching, in priority order: a label stays only when it clears every label ranked before
|
|
10
|
+
* it. A label left out keeps its text in the readout and the exact-value table, so thinning never hides a value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function clearLabels<Label extends PlacedLabel>(byPriority: ReadonlyArray<Label>): ReadonlyArray<Label>;
|
|
13
|
+
/** Where a centered label sits so it stays between two bounds, and which end it is anchored to there. */
|
|
14
|
+
export declare function labelInside({ x, text, left, right, }: {
|
|
15
|
+
readonly x: number;
|
|
16
|
+
readonly text: string;
|
|
17
|
+
readonly left: number;
|
|
18
|
+
readonly right: number;
|
|
19
|
+
}): {
|
|
20
|
+
readonly x: number;
|
|
21
|
+
readonly anchor: 'start' | 'middle' | 'end';
|
|
22
|
+
};
|
|
@@ -7,11 +7,11 @@ export type BreakdownItem = {
|
|
|
7
7
|
readonly value: number | null;
|
|
8
8
|
readonly tone?: ChartTone | undefined;
|
|
9
9
|
};
|
|
10
|
+
/** The most categories, steps or parts, and the most series, a bar, bridge, breakdown or treemap chart draws. */
|
|
10
11
|
export declare const categoricalLimits: {
|
|
11
12
|
readonly items: 200;
|
|
12
13
|
readonly series: 12;
|
|
13
14
|
};
|
|
14
|
-
export declare function colorTone(tone: ChartTone | undefined, index: number): ChartTone;
|
|
15
15
|
export declare function validateBreakdown(items: ReadonlyArray<BreakdownItem>): string | undefined;
|
|
16
16
|
export type CategoricalValue = {
|
|
17
17
|
readonly id: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CellDomainProps, CellProps, CellToneProps } from './cell-layout.tsx';
|
|
3
|
+
export type BarCellProps = CellProps & CellDomainProps & CellToneProps & {
|
|
4
|
+
/** The amount, or null for a value that was not recorded. */
|
|
5
|
+
readonly value: number | null;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A bar from zero to the value with the exact value written beside it, for a table column of amounts compared by
|
|
9
|
+
* length, such as accuracy or cost. Pass the column's `domain` to every row so all bars share one scale, and make it
|
|
10
|
+
* include zero. A negative value reaches left of the zero line, and a missing value shows "Unavailable" and no bar,
|
|
11
|
+
* never an empty bar.
|
|
12
|
+
*/
|
|
13
|
+
export declare function BarCell({ value, domain, locale, format, align, textWidth, id, tone }: BarCellProps): ReactNode;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
4
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
5
|
+
/** Which edge of its cell the exact value hugs. Numbers read best at the end, where the digits line up. */
|
|
6
|
+
export type CellAlign = 'start' | 'end';
|
|
7
|
+
/**
|
|
8
|
+
* What every table cell graphic takes, with the value always written beside the graphic so the graphic is never the
|
|
9
|
+
* only carrier of the number. A cell takes a declared `format` and an explicit `locale`, as contract 072 allows for
|
|
10
|
+
* shared display components, rather than already formatted text. One pattern keeps the missing text, the signs and the
|
|
11
|
+
* units the same in all five cells, and the props stay plain data that a figure spec can name.
|
|
12
|
+
*/
|
|
13
|
+
export type CellProps = {
|
|
14
|
+
/** The locale of every number in the cell. It is an input, so a server and a browser render alike. */
|
|
15
|
+
readonly locale: string;
|
|
16
|
+
/** How the value is written. The same format is used in every row of a column. */
|
|
17
|
+
readonly format: ValueFormat;
|
|
18
|
+
/** Which edge of the cell the text hugs. Defaults to the end. */
|
|
19
|
+
readonly align?: CellAlign | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The width kept for the text, in characters. Rows of one column should keep the same width, so graphics start at the
|
|
22
|
+
* same place and share one scale by eye. Each cell has a default that fits its usual text.
|
|
23
|
+
*/
|
|
24
|
+
readonly textWidth?: number | undefined;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* What a cell needs to be drawn on its column's scale. A cell cannot see its column, so the application passes the same
|
|
28
|
+
* `domain` to every row. A value outside it is refused, never clamped.
|
|
29
|
+
*/
|
|
30
|
+
export type CellDomainProps = {
|
|
31
|
+
readonly domain: NumericDomain;
|
|
32
|
+
};
|
|
33
|
+
/** The hue of a cell's mark. */
|
|
34
|
+
export type CellToneProps = {
|
|
35
|
+
/** The thing this row shows, such as a model. With a tone scope, one thing keeps one hue across figures and cells. */
|
|
36
|
+
readonly id?: string | undefined;
|
|
37
|
+
/** Sets the hue directly, beating the scope. Absent takes the scope's hue for `id`, then the first series hue. */
|
|
38
|
+
readonly tone?: ChartTone | undefined;
|
|
39
|
+
};
|
|
40
|
+
type CellState = 'value' | 'missing' | 'invalid';
|
|
41
|
+
export type CellLayoutProps = {
|
|
42
|
+
readonly align?: CellAlign | undefined;
|
|
43
|
+
readonly textWidth?: number | undefined;
|
|
44
|
+
/** The graphic beside the text, built with `CellGraphic`. Absent draws text only. */
|
|
45
|
+
readonly graphic?: ReactNode;
|
|
46
|
+
/** `missing` and `invalid` mute or flag the text. */
|
|
47
|
+
readonly state?: CellState | undefined;
|
|
48
|
+
/** The reason for an invalid cell, shown on hover. */
|
|
49
|
+
readonly title?: string | undefined;
|
|
50
|
+
/** Fills the text's box with this color, as a heat cell does. The text stays ink, so the color must stay legible. */
|
|
51
|
+
readonly background?: string | undefined;
|
|
52
|
+
/** The exact value as text. */
|
|
53
|
+
readonly children: ReactNode;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* One text line: a graphic and the exact value beside it, in tabular numerals. The graphic is hidden from assistive
|
|
57
|
+
* tech.
|
|
58
|
+
*/
|
|
59
|
+
export declare function CellLayout({ align, textWidth, graphic, state, title, background, children, }: CellLayoutProps): ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* The fluid drawing area of a cell: one line tall, as wide as the cell leaves it. It measures itself and hands the
|
|
62
|
+
* pixel width to `children`, which returns the marks.
|
|
63
|
+
*/
|
|
64
|
+
export declare function CellGraphic({ children }: {
|
|
65
|
+
readonly children: (width: number) => ReactNode;
|
|
66
|
+
}): ReactNode;
|
|
67
|
+
/** The height of the drawing area, for marks that center on the line. */
|
|
68
|
+
export declare const cellHeight = 16;
|
|
69
|
+
/** Why the column domain or a value cannot be drawn, or undefined when all can. Missing (null) values are allowed. */
|
|
70
|
+
export declare function cellProblem({ domain, values, }: {
|
|
71
|
+
/** The column domain. Absent for a cell with no scale, which then only needs finite values. */
|
|
72
|
+
readonly domain?: NumericDomain | undefined;
|
|
73
|
+
readonly values: ReadonlyArray<number | null>;
|
|
74
|
+
}): string | undefined;
|
|
75
|
+
/** The cell shown in place of a graphic that cannot be drawn. It names the reason on hover and never repairs input. */
|
|
76
|
+
export declare function InvalidCell({ message, align, textWidth, }: Pick<CellLayoutProps, 'align' | 'textWidth'> & {
|
|
77
|
+
readonly message: string;
|
|
78
|
+
}): ReactNode;
|
|
79
|
+
/** The hue of a cell's mark: its own tone, then the tone scope's hue for its id, then the first series hue. */
|
|
80
|
+
export declare function useCellTone({ id, tone }: CellToneProps): ChartTone;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CellProps } from './cell-layout.tsx';
|
|
3
|
+
/** What a rise means for the reader: an improvement, a regression, or nothing either way. */
|
|
4
|
+
export type ChangeMeaning = 'good' | 'bad' | 'neutral';
|
|
5
|
+
export type ChangeCellProps = CellProps & {
|
|
6
|
+
/** The signed change, or null for a change that could not be computed. */
|
|
7
|
+
readonly value: number | null;
|
|
8
|
+
/** What an increase means. A drop in latency is good and a drop in accuracy is bad, so the cell never assumes. */
|
|
9
|
+
readonly positiveIs: ChangeMeaning;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A signed change with an arrow and a tone, such as a score against the last release, or "Unavailable" with no arrow
|
|
13
|
+
* when the change is missing. The text carries the sign and number so the arrow and color never stand alone, and a
|
|
14
|
+
* function format must write the sign while an options format shows it. Up is not always good, so `positiveIs` says
|
|
15
|
+
* what a rise means: a good change takes the positive hue, a bad one the negative, a neutral or absent one gray.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ChangeCell({ value, positiveIs, locale, format, align, textWidth, }: ChangeCellProps): ReactNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { HeatmapScale } from '../matrix/heatmap-scale.ts';
|
|
3
|
+
import type { CellDomainProps, CellProps } from './cell-layout.tsx';
|
|
4
|
+
export type HeatCellProps = CellProps & CellDomainProps & {
|
|
5
|
+
/** The amount, or null for a value that was not recorded. */
|
|
6
|
+
readonly value: number | null;
|
|
7
|
+
/**
|
|
8
|
+
* `sequential` is one hue that deepens with the value. `diverging` is two hues around a neutral zero, and its
|
|
9
|
+
* domain must hold a negative and a positive bound.
|
|
10
|
+
*/
|
|
11
|
+
readonly palette: HeatmapScale['palette'];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The value written as text on a background whose strength follows it, so color is never the only carrier, with
|
|
15
|
+
* "Unavailable" and no fill when missing. Use it in a table column where readers scan for high and low rows, such as a
|
|
16
|
+
* score per task. Pass the column's `domain` and `palette` to every row so all rows share one ramp, lighter than the
|
|
17
|
+
* `Matrix` heatmap so the ink text stays readable in both themes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function HeatCell({ value, domain, palette, locale, format, align, textWidth }: HeatCellProps): ReactNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { BarCellProps } from './bar-cell.tsx';
|
|
2
|
+
export { BarCell } from './bar-cell.tsx';
|
|
3
|
+
export type { CellAlign, CellDomainProps, CellProps, CellToneProps } from './cell-layout.tsx';
|
|
4
|
+
export type { ChangeCellProps, ChangeMeaning } from './change-cell.tsx';
|
|
5
|
+
export { ChangeCell } from './change-cell.tsx';
|
|
6
|
+
export type { HeatCellProps } from './heat-cell.tsx';
|
|
7
|
+
export { HeatCell } from './heat-cell.tsx';
|
|
8
|
+
export type { IntervalCellProps } from './interval-cell.tsx';
|
|
9
|
+
export { IntervalCell } from './interval-cell.tsx';
|
|
10
|
+
export type { SparkCellProps } from './spark-cell.tsx';
|
|
11
|
+
export { SparkCell, sparkCellLimits } from './spark-cell.tsx';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CellDomainProps, CellProps, CellToneProps } from './cell-layout.tsx';
|
|
3
|
+
export type IntervalCellProps = CellProps & CellDomainProps & CellToneProps & {
|
|
4
|
+
/** The estimate, or null for a value that was not recorded. */
|
|
5
|
+
readonly value: number | null;
|
|
6
|
+
/** The lower and upper bound around the estimate, or null when none was computed. */
|
|
7
|
+
readonly interval?: readonly [lower: number, upper: number] | null | undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* An estimate dot with an interval line, and the estimate and its range written beside it, or "Unavailable" and no mark
|
|
11
|
+
* when the estimate is missing. In a table column of estimates with uncertainty, such as an accuracy with a confidence
|
|
12
|
+
* interval, pass the column's `domain` to every row so all intervals share one scale. The application supplies the
|
|
13
|
+
* bounds, and the cell checks that the lower bound is not above the estimate and the upper bound not below it, and
|
|
14
|
+
* never reorders them.
|
|
15
|
+
*/
|
|
16
|
+
export declare function IntervalCell({ value, interval, domain, locale, format, align, textWidth, id, tone, }: IntervalCellProps): ReactNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CellDomainProps, CellProps, CellToneProps } from './cell-layout.tsx';
|
|
3
|
+
export type SparkCellProps = CellProps & CellDomainProps & CellToneProps & {
|
|
4
|
+
/** Observations in order, equally spaced. A null is a gap: the line breaks there and is never drawn through it. */
|
|
5
|
+
readonly points: ReadonlyArray<number | null>;
|
|
6
|
+
/**
|
|
7
|
+
* Which observation the dot marks and the text writes: `last`, the most recent one, or `peak`, the highest recorded
|
|
8
|
+
* one (the first, when several tie), such as a best score. Absent means last.
|
|
9
|
+
*/
|
|
10
|
+
readonly label?: 'last' | 'peak' | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** The most observations a spark cell draws. A longer series is refused. */
|
|
13
|
+
export declare const sparkCellLimits: {
|
|
14
|
+
readonly points: 240;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A tiny line of equally spaced observations with no axes, and the last value, or the peak with `label="peak"`, marked
|
|
18
|
+
* and written beside it. Use it in a table column showing how a value moved, such as a score over recent runs, and pass
|
|
19
|
+
* the column's `domain` to every row for one shared scale. If the last observation is missing, the text says
|
|
20
|
+
* "Unavailable" while the line keeps what was recorded, and a series with no recorded value draws nothing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function SparkCell({ points, domain, locale, format, align, textWidth, id, tone, label, }: SparkCellProps): ReactNode;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import type { ChartLegendItem } from './chart-theme.ts';
|
|
3
|
-
import type { ChartSelectDetails } from './chart.tsx';
|
|
4
3
|
type ChartReportHeading = {
|
|
5
4
|
readonly meta?: ReactNode;
|
|
6
5
|
readonly actions?: ReactNode;
|
|
@@ -13,11 +12,6 @@ export type ChartSeriesReport = ChartReport | (ChartReportHeading & {
|
|
|
13
12
|
readonly summary?: never;
|
|
14
13
|
readonly seriesValues: Readonly<Record<string, string | undefined>>;
|
|
15
14
|
});
|
|
16
|
-
export type ChartSelection = {
|
|
17
|
-
readonly selectedId: string | undefined;
|
|
18
|
-
/** The details say why and how: a press, a key or an agent's step. */
|
|
19
|
-
readonly onSelect: (id: string, details: ChartSelectDetails) => void;
|
|
20
|
-
};
|
|
21
15
|
export type ChartFrameProps = {
|
|
22
16
|
readonly title: ReactNode;
|
|
23
17
|
readonly description?: ReactNode;
|
|
@@ -28,6 +22,13 @@ export type ChartFrameProps = {
|
|
|
28
22
|
readonly series?: ReadonlyArray<ChartLegendItem> | undefined;
|
|
29
23
|
/** The chart part's own props, when this figure is the root of an interactive chart. */
|
|
30
24
|
readonly figure?: ComponentProps<'figure'> | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The legend that names what the plot draws, such as series, models or classes. It sits above the plot, directly
|
|
27
|
+
* under the title block, with the frame's standard gap.
|
|
28
|
+
*/
|
|
29
|
+
readonly seriesLegend?: ReactNode;
|
|
30
|
+
/** The legend that explains a color or size scale. It sits directly below the plot, above the readout and notes. */
|
|
31
|
+
readonly scaleLegend?: ReactNode;
|
|
31
32
|
};
|
|
32
33
|
export type { ChartLegendItem } from './chart-theme.ts';
|
|
33
34
|
export type ChartLegendProps = {
|
|
@@ -35,8 +36,14 @@ export type ChartLegendProps = {
|
|
|
35
36
|
readonly label?: string | undefined;
|
|
36
37
|
readonly isScrollable?: boolean | undefined;
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The figure every chart draws in: the title block, the named legend, the plot, the scale legend, then the footer with
|
|
41
|
+
* the readout and notes. Use `FigureFrame`, which builds it, in a chart.
|
|
42
|
+
*/
|
|
43
|
+
export declare function ChartFrame({ title, description, children, actions, footer, report, series, figure, seriesLegend, scaleLegend, }: ChartFrameProps): ReactNode;
|
|
44
|
+
/** The legend that names a chart's series or groups, each with its mark. Hand it to the frame's `seriesLegend` slot. */
|
|
39
45
|
export declare function ChartLegend({ items, label, isScrollable }: ChartLegendProps): ReactNode;
|
|
46
|
+
/** The line that states the inspected mark's exact values. A plot names it with `aria-describedby`. */
|
|
40
47
|
export declare function ChartReadout({ children, id }: {
|
|
41
48
|
readonly children: ReactNode;
|
|
42
49
|
readonly id?: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { ChartLinkProps } from './chart-link.tsx';
|
|
4
|
+
export type ChartGridProps = Omit<ChartLinkProps, 'children'> & {
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly description?: string | undefined;
|
|
7
|
+
/** The narrowest a panel may be, in CSS pixels. The grid fits as many columns as that allows. */
|
|
8
|
+
readonly minPanelWidth?: number | undefined;
|
|
9
|
+
/** Every series, model or run the panels draw, so each keeps one hue in every panel. */
|
|
10
|
+
readonly ids?: ReadonlyArray<string> | undefined;
|
|
11
|
+
readonly tones?: Readonly<Record<string, ChartTone>> | undefined;
|
|
12
|
+
/** The figures, one per panel. */
|
|
13
|
+
readonly children: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Figures side by side as one comparison: a panel per metric, layer or split. The panels share one inspection, so
|
|
17
|
+
* pointing at a record in one marks it in all, and one tone scope, so a series keeps its hue across panels.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ChartGrid({ title, description, minPanelWidth, ids, tones, children, ...link }: ChartGridProps): ReactNode;
|