@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,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone, ValueFormat } from '../../../../charts/src/index.ts';
|
|
3
|
+
import type { Pace } from '../../time/tween.ts';
|
|
4
|
+
import type { ScenePosition } from '../scene-geometry.ts';
|
|
5
|
+
import type { ScenePlaneLabels } from './plane-labels.ts';
|
|
6
|
+
export type SceneProjectionProps = {
|
|
7
|
+
/** Stable across states. */
|
|
8
|
+
readonly id: string;
|
|
9
|
+
/** The id of a `ScenePoint`, or any placed object, to follow. The lines stay under it. Give this or `at`. */
|
|
10
|
+
readonly of?: string | undefined;
|
|
11
|
+
/** A fixed position to project, in the scene's data units. Give this or `of`. */
|
|
12
|
+
readonly at?: ScenePosition | undefined;
|
|
13
|
+
/** How the values written on the axes are formatted. Defaults to at most two decimals. */
|
|
14
|
+
readonly format?: ValueFormat | undefined;
|
|
15
|
+
/** The hue of the dashed lines. Left out, the tone scope's tone for the id, or neutral. */
|
|
16
|
+
readonly tone?: ChartTone | undefined;
|
|
17
|
+
/** False fades the projection out. */
|
|
18
|
+
readonly isShown?: boolean | undefined;
|
|
19
|
+
/** Overrides the scene's pace for this projection. */
|
|
20
|
+
readonly pace?: Pace | undefined;
|
|
21
|
+
readonly labels?: Partial<ScenePlaneLabels> | undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Dashed lines from a point down to the x axis and across to the y axis, with its two values written where they meet
|
|
25
|
+
* the axes. Use it to show what a point's position means: the input that went in and the value that came out.
|
|
26
|
+
*/
|
|
27
|
+
export declare function SceneProjection({ id, of, at, format, tone, isShown, pace, labels: labelInput, }: SceneProjectionProps): ReactNode;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../../charts/src/index.ts';
|
|
3
|
+
import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
|
|
4
|
+
import type { Pace } from '../../time/tween.ts';
|
|
5
|
+
import type { ScenePosition } from '../scene-geometry.ts';
|
|
6
|
+
import type { ScenePlaneLabels } from './plane-labels.ts';
|
|
7
|
+
export type SceneRegionProps = {
|
|
8
|
+
/** Stable across states: the region with this id eases its corners to their new places. */
|
|
9
|
+
readonly id: string;
|
|
10
|
+
/** The band between two x values, over the box's whole height. Give one of this, `above`, `below` or `points`. */
|
|
11
|
+
readonly between?: readonly [number, number] | undefined;
|
|
12
|
+
/** Everything above this y value. */
|
|
13
|
+
readonly above?: number | undefined;
|
|
14
|
+
/** Everything below this y value. */
|
|
15
|
+
readonly below?: number | undefined;
|
|
16
|
+
/** A polygon, as corners in order. */
|
|
17
|
+
readonly points?: ReadonlyArray<ScenePosition> | undefined;
|
|
18
|
+
/** The readout sentence. With one, the arrow keys reach the region. */
|
|
19
|
+
readonly label?: string | undefined;
|
|
20
|
+
/** Short text inside the region, placed where it touches no curve. */
|
|
21
|
+
readonly text?: string | undefined;
|
|
22
|
+
/** The hue of the wash. Left out, the tone scope's tone for the id, or neutral. */
|
|
23
|
+
readonly tone?: ChartTone | undefined;
|
|
24
|
+
/** `context` draws the region gray; the others yield to inspection. */
|
|
25
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
26
|
+
/** False fades the region out and takes it out of the keyboard order. */
|
|
27
|
+
readonly isShown?: boolean | undefined;
|
|
28
|
+
/** True keeps the region at full strength while the rest recede. */
|
|
29
|
+
readonly isActive?: boolean | undefined;
|
|
30
|
+
/** Overrides the scene's pace for this region. */
|
|
31
|
+
readonly pace?: Pace | undefined;
|
|
32
|
+
readonly labels?: Partial<ScenePlaneLabels> | undefined;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A filled region of the plane: a band between two x values, everything above or below a value, or a polygon. It is a
|
|
36
|
+
* pale wash in its tone, behind the curves. Use it for a zone a lesson names, such as overfitting or a safe range.
|
|
37
|
+
*/
|
|
38
|
+
export declare function SceneRegion({ id, between, above, below, points, label, text, tone, emphasis, isShown, isActive, pace, labels: labelInput, }: SceneRegionProps): ReactNode;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../../charts/src/index.ts';
|
|
3
|
+
import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
|
|
4
|
+
import type { Pace } from '../../time/tween.ts';
|
|
5
|
+
import type { ScenePlaneLabels } from './plane-labels.ts';
|
|
6
|
+
export type SceneRuleProps = {
|
|
7
|
+
/** Stable across states: the rule with this id eases to its new value. */
|
|
8
|
+
readonly id: string;
|
|
9
|
+
/** Draws a vertical line at this x value. Give this or `y`. */
|
|
10
|
+
readonly x?: number | undefined;
|
|
11
|
+
/** Draws a horizontal line at this y value. Give this or `x`. */
|
|
12
|
+
readonly y?: number | undefined;
|
|
13
|
+
/** The readout sentence. With one, the arrow keys reach the rule. */
|
|
14
|
+
readonly label?: string | undefined;
|
|
15
|
+
/** Short text at the rule's end, such as "threshold" or "limit", placed where it touches no curve. */
|
|
16
|
+
readonly text?: string | undefined;
|
|
17
|
+
/** The hue of the line. Left out, the tone scope's tone for the id, or the reference gray. */
|
|
18
|
+
readonly tone?: ChartTone | undefined;
|
|
19
|
+
/** `context` draws the rule gray; the others yield to inspection. */
|
|
20
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
21
|
+
/** A rule is a reference, so it is dashed. Pass false for a solid one. */
|
|
22
|
+
readonly isDashed?: boolean | undefined;
|
|
23
|
+
/** False fades the rule out and takes it out of the keyboard order. */
|
|
24
|
+
readonly isShown?: boolean | undefined;
|
|
25
|
+
/** True keeps the rule at full strength while the rest recede. */
|
|
26
|
+
readonly isActive?: boolean | undefined;
|
|
27
|
+
/** Overrides the scene's pace for this rule. */
|
|
28
|
+
readonly pace?: Pace | undefined;
|
|
29
|
+
readonly labels?: Partial<ScenePlaneLabels> | undefined;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A horizontal or vertical reference line at a value, with a short label at its end: a threshold, a limit, an
|
|
33
|
+
* asymptote. It is dashed because it is a reference, not an observation. Move its value and it eases there.
|
|
34
|
+
*/
|
|
35
|
+
export declare function SceneRule({ id, x, y, label, text, tone, emphasis, isDashed, isShown, isActive, pace, labels: labelInput, }: SceneRuleProps): ReactNode;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../../charts/src/index.ts';
|
|
3
|
+
import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
|
|
4
|
+
import type { Pace } from '../../time/tween.ts';
|
|
5
|
+
import type { ScenePosition } from '../scene-geometry.ts';
|
|
6
|
+
import type { ScenePlaneLabels } from './plane-labels.ts';
|
|
7
|
+
import type { ScenePlaneThickness } from './plane-math.ts';
|
|
8
|
+
export type SceneVectorProps = {
|
|
9
|
+
/** Stable across states: the vector with this id eases its ends to their new places. */
|
|
10
|
+
readonly id: string;
|
|
11
|
+
/** Where the arrow points, in the scene's data units. */
|
|
12
|
+
readonly to: ScenePosition;
|
|
13
|
+
/** Where the arrow starts. Defaults to the origin. */
|
|
14
|
+
readonly from?: ScenePosition | undefined;
|
|
15
|
+
/** The readout sentence. With one, the arrow keys reach the vector. */
|
|
16
|
+
readonly label?: string | undefined;
|
|
17
|
+
/** Short text beside the arrow's head, placed where it touches no curve. */
|
|
18
|
+
readonly text?: string | undefined;
|
|
19
|
+
/** The hue of the arrow. Left out, the tone scope's tone for the id, or the second series hue. */
|
|
20
|
+
readonly tone?: ChartTone | undefined;
|
|
21
|
+
/** `context` draws the vector gray; the others yield to inspection. */
|
|
22
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
23
|
+
/** Dashed for a vector that is modelled or proposed, such as a step not yet taken. */
|
|
24
|
+
readonly isDashed?: boolean | undefined;
|
|
25
|
+
/** The stroke width by name. Defaults to `regular`. */
|
|
26
|
+
readonly thickness?: ScenePlaneThickness | undefined;
|
|
27
|
+
/** False fades the vector out and takes it out of the keyboard order. */
|
|
28
|
+
readonly isShown?: boolean | undefined;
|
|
29
|
+
/** True keeps the vector at full strength while the rest recede. */
|
|
30
|
+
readonly isActive?: boolean | undefined;
|
|
31
|
+
/** Overrides the scene's pace for this vector. */
|
|
32
|
+
readonly pace?: Pace | undefined;
|
|
33
|
+
readonly labels?: Partial<ScenePlaneLabels> | undefined;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* An arrow in the scene from one position to another: a gradient, a step, a velocity. Move either end and the arrow
|
|
37
|
+
* eases there. Give it `text` to name its head, and a `label` to make it an item the reader can inspect.
|
|
38
|
+
*/
|
|
39
|
+
export declare function SceneVector({ id, to, from, label, text, tone, emphasis, isDashed, thickness, isShown, isActive, pace, labels: labelInput, }: SceneVectorProps): ReactNode;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** The side of its members a bracket runs along. */
|
|
3
|
+
export type SceneBracketSide = 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
export type SceneBracketProps = {
|
|
5
|
+
/** The ids the bracket spans. It follows them as they move. */
|
|
6
|
+
readonly of: ReadonlyArray<string>;
|
|
7
|
+
/** Defaults to `bracket:` and the first id. */
|
|
8
|
+
readonly id?: string | undefined;
|
|
9
|
+
/** The readout sentence and, unless `text` is set, the words drawn beside the bracket. */
|
|
10
|
+
readonly label?: string | undefined;
|
|
11
|
+
/** Shorter words to draw, when the label is a full sentence. */
|
|
12
|
+
readonly text?: string | undefined;
|
|
13
|
+
/** Defaults to `bottom`. A bracket with no room on its side moves to the opposite one. */
|
|
14
|
+
readonly side?: SceneBracketSide | undefined;
|
|
15
|
+
/** The room between the members and the bracket, in pixels. Defaults to 8. */
|
|
16
|
+
readonly padding?: number | undefined;
|
|
17
|
+
/** False fades the bracket out. */
|
|
18
|
+
readonly isShown?: boolean | undefined;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A bracket along one side of a set of scene objects, with words beside it: "the hidden layer", "three inputs". It
|
|
22
|
+
* follows its members as they move. Use a group for an outline around them instead.
|
|
23
|
+
*/
|
|
24
|
+
export declare function SceneBracket({ of, id, label, text, side, padding, isShown, }: SceneBracketProps): ReactNode;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The side a callout prefers. `auto` prefers right, then left, below and above. A callout leaves its preferred side
|
|
4
|
+
* when that side would cover another object.
|
|
5
|
+
*/
|
|
6
|
+
export type SceneCalloutSide = 'auto' | 'top' | 'right' | 'bottom' | 'left';
|
|
7
|
+
export type SceneCalloutProps = {
|
|
8
|
+
/** The id of the object the callout explains. */
|
|
9
|
+
readonly to: string;
|
|
10
|
+
/** Defaults to `callout:` and the target id. */
|
|
11
|
+
readonly id?: string | undefined;
|
|
12
|
+
/** The side the callout prefers. Defaults to `auto`. */
|
|
13
|
+
readonly side?: SceneCalloutSide | undefined;
|
|
14
|
+
/** The callout's widest width in pixels. Defaults to 176; the prose wraps inside it, and it narrows to find room. */
|
|
15
|
+
readonly width?: number | undefined;
|
|
16
|
+
/** False fades the callout and its leader out. Defaults to true. */
|
|
17
|
+
readonly isShown?: boolean | undefined;
|
|
18
|
+
/** The prose. */
|
|
19
|
+
readonly children: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Prose attached to a scene object by a leader line: "the weighted sum", "this weight just flipped sign". It sits
|
|
23
|
+
* beside its object and inside the frame, keeping off other objects, labels, wires and curves, narrowing when it must.
|
|
24
|
+
* It follows the object as it moves.
|
|
25
|
+
*/
|
|
26
|
+
export declare function SceneCallout({ to, id, side, width, isShown, children, }: SceneCalloutProps): ReactNode;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type { ChartTone, NumericDomain } from '../../../charts/src/index.ts';
|
|
2
|
+
import type { ContinuousScale, MarkEmphasis, PlotBox, ToneInput } from '../../../charts/src/plot/index.ts';
|
|
3
|
+
import type { Pace } from '../time/tween.ts';
|
|
4
|
+
import type { SceneFrame, SceneMargins, SceneRect, SceneShape, SceneView } from './scene-geometry.ts';
|
|
5
|
+
import type { SceneFrameKey, SceneFrameValues, SceneMember, SceneRegistry } from './scene-registry.ts';
|
|
6
|
+
import type { SceneDelay, SceneStaggerPlace } from './scene-stagger.ts';
|
|
7
|
+
import type { SceneLabels } from './scene-validate.ts';
|
|
8
|
+
/** The camera's animated view of the data box. */
|
|
9
|
+
export type SceneCamera = {
|
|
10
|
+
readonly get: () => SceneView;
|
|
11
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
12
|
+
};
|
|
13
|
+
/** The SVG groups under the HTML layer that SVG parts draw into, back to front. Null until the scene mounts. */
|
|
14
|
+
export type SceneLayerElements = {
|
|
15
|
+
readonly back: SVGGElement | null;
|
|
16
|
+
readonly wires: SVGGElement | null;
|
|
17
|
+
readonly front: SVGGElement | null;
|
|
18
|
+
};
|
|
19
|
+
/** What a scene shares with its parts that changes only with its props or its width, never per frame. */
|
|
20
|
+
export type SceneSetup = {
|
|
21
|
+
/** False for a part rendered outside any `Scene`. Such a part shows an inline error instead of drawing. */
|
|
22
|
+
readonly isInScene: boolean;
|
|
23
|
+
readonly registry: SceneRegistry;
|
|
24
|
+
readonly camera: SceneCamera;
|
|
25
|
+
/** The drawing area in the plot's CSS pixels. A node centered on the data box's edge stays whole inside the plot. */
|
|
26
|
+
readonly box: PlotBox;
|
|
27
|
+
/** The whole data box the scene declares. */
|
|
28
|
+
readonly domain: {
|
|
29
|
+
readonly x: NumericDomain;
|
|
30
|
+
readonly y: NumericDomain;
|
|
31
|
+
};
|
|
32
|
+
readonly pace: Pace;
|
|
33
|
+
readonly locale: string;
|
|
34
|
+
/** Resolves a record's tone: its own, then the enclosing tone scope's, then its place. */
|
|
35
|
+
readonly tone: (input: ToneInput) => ChartTone;
|
|
36
|
+
/** The weight magnitude that draws the thickest wire. */
|
|
37
|
+
readonly weightMax: number;
|
|
38
|
+
readonly layers: SceneLayerElements;
|
|
39
|
+
/** The scene's words, so parts write their errors in the author's language. */
|
|
40
|
+
readonly labels: SceneLabels;
|
|
41
|
+
/** The camera's scales for a view, computed once per frame and shared by every part. */
|
|
42
|
+
readonly scalesFor: (view: SceneView) => SceneScales;
|
|
43
|
+
};
|
|
44
|
+
/** The camera's scales for one view, with the pixel rectangle of an animated frame under them. */
|
|
45
|
+
export type SceneScales = {
|
|
46
|
+
readonly x: ContinuousScale;
|
|
47
|
+
readonly y: ContinuousScale;
|
|
48
|
+
readonly rectOf: (values: SceneFrameValues) => SceneRect;
|
|
49
|
+
};
|
|
50
|
+
/** The inspection state the scene's `Chart` holds, shared with every part. It changes only on inspection. */
|
|
51
|
+
export type SceneMarks = {
|
|
52
|
+
readonly inspected: string | null;
|
|
53
|
+
readonly selected: string | null;
|
|
54
|
+
readonly cursor: string | null;
|
|
55
|
+
/** The ids drawn at full strength while something is inspected or active, or null when nothing recedes. */
|
|
56
|
+
readonly lit: ReadonlySet<string> | null;
|
|
57
|
+
/** Whether the plot has keyboard focus, so the keyboard cursor is drawn. */
|
|
58
|
+
readonly isKeyboardFocused: boolean;
|
|
59
|
+
/** Moves focus to the plot, so the arrow keys carry on from a pressed object. */
|
|
60
|
+
readonly focusPlot: () => void;
|
|
61
|
+
};
|
|
62
|
+
/** The scene as a part sees it in this frame: the setup, plus the camera's current scales. */
|
|
63
|
+
export type SceneContextValue = SceneSetup & {
|
|
64
|
+
/** Maps data x to plot pixels through the camera. A position outside the view lands outside the box. */
|
|
65
|
+
readonly x: ContinuousScale;
|
|
66
|
+
/** Maps data y to plot pixels through the camera. y grows upward, as on a chart. */
|
|
67
|
+
readonly y: ContinuousScale;
|
|
68
|
+
readonly view: SceneView;
|
|
69
|
+
/** An object's pixel rectangle from its animated frame values. */
|
|
70
|
+
readonly rectOf: (values: SceneFrameValues) => SceneRect;
|
|
71
|
+
};
|
|
72
|
+
/** The scene's setup. `Scene` provides it; the default is a detached scene, so a part outside one never throws. */
|
|
73
|
+
export declare const SceneSetupContext: import("react").Context<SceneSetup>;
|
|
74
|
+
/** The scene's inspection state. `Scene` provides it from its `Chart`. */
|
|
75
|
+
export declare const SceneMarksContext: import("react").Context<SceneMarks>;
|
|
76
|
+
/** The pixel rectangle of an animated frame under two scales. */
|
|
77
|
+
export declare function frameRect({ values, x, y, }: {
|
|
78
|
+
readonly values: SceneFrameValues;
|
|
79
|
+
readonly x: ContinuousScale;
|
|
80
|
+
readonly y: ContinuousScale;
|
|
81
|
+
}): SceneRect;
|
|
82
|
+
/** `sceneScales` for one box, remembering the last view, so the parts drawn in a frame share one set of scales. */
|
|
83
|
+
export declare function cachedScales(setup: Pick<SceneSetup, 'box' | 'domain'>): (view: SceneView) => SceneScales;
|
|
84
|
+
/**
|
|
85
|
+
* The scene a part is drawn in, with the camera's scales for this frame. A part that calls it redraws while the camera
|
|
86
|
+
* moves. Outside a scene `isInScene` is false and the part should show an inline error.
|
|
87
|
+
*/
|
|
88
|
+
export declare function useSceneContext(): SceneContextValue;
|
|
89
|
+
/** What a part tells the scene about one of its objects. Every field but `id`, `kind` and `values` is optional. */
|
|
90
|
+
export type SceneObjectInput<Key extends string> = {
|
|
91
|
+
/** Stable across renders. A change of any other field eases the object to the new state. */
|
|
92
|
+
readonly id: string;
|
|
93
|
+
/** The part's name for its objects, such as `node` or `card`. */
|
|
94
|
+
readonly kind: string;
|
|
95
|
+
/**
|
|
96
|
+
* The target center in data units, pixel shift and pixel size. Leave it out for objects placed by others, such as
|
|
97
|
+
* wires.
|
|
98
|
+
*/
|
|
99
|
+
readonly frame?: SceneFrame | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* True when the frame only draws, so the scene makes no room for it: a point on a curve, or a card its stack makes
|
|
102
|
+
* room for. Left false, the margins keep the frame whole and the derived minimum width keeps it off its neighbours.
|
|
103
|
+
*/
|
|
104
|
+
readonly isFloating?: boolean | undefined;
|
|
105
|
+
/** The room the object needs outside the data box, per side in pixels, such as an axis's tick labels. */
|
|
106
|
+
readonly margins?: SceneMargins | undefined;
|
|
107
|
+
/** The stacking order, 0 by default. Higher draws above and comes later among keyboard items that share a place. */
|
|
108
|
+
readonly order?: number | undefined;
|
|
109
|
+
/** How long every change waits before it starts. Defaults to 0. */
|
|
110
|
+
readonly delay?: SceneDelay | undefined;
|
|
111
|
+
/** The object's place in a stagger group: changes in one update start one step apart, a lone change at once. */
|
|
112
|
+
readonly stagger?: SceneStaggerPlace | undefined;
|
|
113
|
+
/** More numbers to ease with the frame, such as a card's `turn`. Pass `{}` when there are none. */
|
|
114
|
+
readonly values: Readonly<Record<Key, number>>;
|
|
115
|
+
/** The outline wires attach to. Defaults to `box`. */
|
|
116
|
+
readonly shape?: SceneShape | undefined;
|
|
117
|
+
/** The readout sentence. With one, the object is an item the arrow keys step through. */
|
|
118
|
+
readonly label?: string | undefined;
|
|
119
|
+
/** The ids the object attaches to. The scene reports one that does not exist. */
|
|
120
|
+
readonly attaches?: ReadonlyArray<string> | undefined;
|
|
121
|
+
/** The pixels an object that joins two others keeps between them, such as a wire's room for its arrow and text. */
|
|
122
|
+
readonly room?: number | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* What the object draws around the objects it attaches to, in pixels per side, such as a group's outline and name.
|
|
125
|
+
* The scene keeps it inside the margins.
|
|
126
|
+
*/
|
|
127
|
+
readonly surround?: SceneMargins | undefined;
|
|
128
|
+
/** False fades the object out and takes it out of the keyboard order. Defaults to true. */
|
|
129
|
+
readonly isShown?: boolean | undefined;
|
|
130
|
+
/** True keeps the object at full strength while others recede, like an inspected one. */
|
|
131
|
+
readonly isActive?: boolean | undefined;
|
|
132
|
+
/** The emphasis the author chose. `context` always draws gray; the others yield to inspection. */
|
|
133
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
134
|
+
/** Why this object's own input cannot be drawn, naming its id. The scene shows it as invalid. */
|
|
135
|
+
readonly problem?: string | undefined;
|
|
136
|
+
/** Overrides the scene's pace for this object. */
|
|
137
|
+
readonly pace?: Pace | undefined;
|
|
138
|
+
};
|
|
139
|
+
/** One object as a part draws it in this frame. */
|
|
140
|
+
export type SceneObjectState<Key extends string> = {
|
|
141
|
+
/** The eased values on screen now: the frame keys, `opacity`, and the part's own `values`. */
|
|
142
|
+
readonly values: Readonly<Record<Key | SceneFrameKey, number>>;
|
|
143
|
+
/** The pixel rectangle now, or undefined for an object without a frame. */
|
|
144
|
+
readonly rect: SceneRect | undefined;
|
|
145
|
+
/** False once a hidden object has faded out completely. Draw nothing, or keep it invisible to save its state. */
|
|
146
|
+
readonly isVisible: boolean;
|
|
147
|
+
readonly isInspected: boolean;
|
|
148
|
+
readonly isSelected: boolean;
|
|
149
|
+
/** Whether the keyboard cursor rests here while the plot has keyboard focus. */
|
|
150
|
+
readonly isCursor: boolean;
|
|
151
|
+
/** The emphasis to draw with, from the author's choice, inspection and active objects. */
|
|
152
|
+
readonly emphasis: MarkEmphasis;
|
|
153
|
+
/**
|
|
154
|
+
* How strongly to draw now: 1 at full strength, less while the object recedes. It eases on the shared clock; multiply
|
|
155
|
+
* it into the opacity of a part drawn in HTML.
|
|
156
|
+
*/
|
|
157
|
+
readonly strength: number;
|
|
158
|
+
/** Moves focus to the scene's plot, so the arrow keys carry on from a pressed object. */
|
|
159
|
+
readonly focusPlot: () => void;
|
|
160
|
+
readonly scene: SceneContextValue;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Registers an object with the nearest scene and returns its animated state. The first render shows the target with no
|
|
164
|
+
* motion; a later change eases there on the shared clock, and an object first rendered after the scene's first paint
|
|
165
|
+
* fades in. Only the calling part redraws while its object moves.
|
|
166
|
+
*/
|
|
167
|
+
export declare function useSceneObject<Key extends string>(input: SceneObjectInput<Key>): SceneObjectState<Key>;
|
|
168
|
+
/** Another object as a follower sees it in this frame, such as a node a wire attaches to. */
|
|
169
|
+
export type SceneFollowed = {
|
|
170
|
+
readonly member: SceneMember;
|
|
171
|
+
readonly values: SceneFrameValues;
|
|
172
|
+
/** The pixel rectangle now, or undefined for an object without a frame. */
|
|
173
|
+
readonly rect: SceneRect | undefined;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Follows other objects by id: their members and animated geometry, redrawn on each frame any of them moves. Use it in
|
|
177
|
+
* a part that attaches to others, as wires, groups and callouts do. An id with no object yields undefined.
|
|
178
|
+
*/
|
|
179
|
+
export declare function useSceneFrames(ids: ReadonlyArray<string>): ReadonlyArray<SceneFollowed | undefined>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../charts/src/index.ts';
|
|
3
|
+
import type { ContinuousScale, PlotBox, ToneInput } from '../../../charts/src/plot/index.ts';
|
|
4
|
+
import type { SceneView } from './scene-geometry.ts';
|
|
5
|
+
import type { SceneLayerName } from './scene-layer.tsx';
|
|
6
|
+
/** What a custom drawing receives, in this frame. */
|
|
7
|
+
export type SceneDrawing = {
|
|
8
|
+
/** Data x to plot pixels, through the camera. */
|
|
9
|
+
readonly x: ContinuousScale;
|
|
10
|
+
/** Data y to plot pixels, through the camera. y grows upward. */
|
|
11
|
+
readonly y: ContinuousScale;
|
|
12
|
+
/** The drawing area in plot pixels. */
|
|
13
|
+
readonly box: PlotBox;
|
|
14
|
+
/** The part of the data box the camera shows. */
|
|
15
|
+
readonly view: SceneView;
|
|
16
|
+
/** Resolves a record's tone through the tone scope, as the scene's own parts do. */
|
|
17
|
+
readonly tone: (input: ToneInput) => ChartTone;
|
|
18
|
+
/** The color of a tone, for a `fill` or `stroke`. */
|
|
19
|
+
readonly color: (tone: ChartTone) => string;
|
|
20
|
+
};
|
|
21
|
+
export type SceneCustomProps = {
|
|
22
|
+
/** Under the wires, or above them. Both lie under the nodes. Defaults to `front`. */
|
|
23
|
+
readonly layer?: Exclude<SceneLayerName, 'wires'> | undefined;
|
|
24
|
+
/** Returns SVG in plot pixels. It is called again on every camera frame. */
|
|
25
|
+
readonly children: (drawing: SceneDrawing) => ReactNode;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* SVG the scene lacks, drawn with the scene's scales, box and tones so it moves with the camera: an axis, a decision
|
|
29
|
+
* boundary, a shaded region. Use the kernel marks inside it so channels keep their meaning.
|
|
30
|
+
*/
|
|
31
|
+
export declare function SceneCustom({ layer, children }: SceneCustomProps): ReactNode;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { NumericDomain } from '../../../charts/src/index.ts';
|
|
2
|
+
import type { PlotMargins } from '../../../charts/src/plot/index.ts';
|
|
3
|
+
/** The outline of a node: a box, a pill, a circle, or text with no outline. Wires attach at this outline. */
|
|
4
|
+
export type SceneShape = 'box' | 'pill' | 'circle' | 'plain';
|
|
5
|
+
/** A named node size. Each is a fixed pixel box that fits a short label, so layout never depends on measuring. */
|
|
6
|
+
export type SceneSizeName = 'small' | 'medium' | 'large';
|
|
7
|
+
/** A node size by name, or an exact box in CSS pixels. */
|
|
8
|
+
export type SceneSize = SceneSizeName | {
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
};
|
|
12
|
+
/** A position in the scene's data units, as `[x, y]`. */
|
|
13
|
+
export type ScenePosition = readonly [across: number, up: number];
|
|
14
|
+
/** A position in data units, with named parts. */
|
|
15
|
+
export type SceneDataPoint = {
|
|
16
|
+
readonly x: number;
|
|
17
|
+
readonly y: number;
|
|
18
|
+
};
|
|
19
|
+
/** A data box in data units on each axis. */
|
|
20
|
+
type SceneDomain = {
|
|
21
|
+
readonly x: NumericDomain;
|
|
22
|
+
readonly y: NumericDomain;
|
|
23
|
+
};
|
|
24
|
+
/** A shift in CSS pixels from a data position: across to the right, then down. */
|
|
25
|
+
export type SceneOffset = readonly [across: number, down: number];
|
|
26
|
+
/**
|
|
27
|
+
* Where an object sits: its center in data units, an optional shift in pixels from there, and its size in pixels. A
|
|
28
|
+
* part that lays objects out in pixels, such as a pile of cards, shifts each from one data position.
|
|
29
|
+
*/
|
|
30
|
+
export type SceneFrame = {
|
|
31
|
+
readonly x: number;
|
|
32
|
+
readonly y: number;
|
|
33
|
+
readonly width: number;
|
|
34
|
+
readonly height: number;
|
|
35
|
+
readonly offset?: SceneOffset | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* What the object draws outside its box, in pixels per side, such as a caption or row labels. The scene makes room
|
|
38
|
+
* for it, and wires still meet the box.
|
|
39
|
+
*/
|
|
40
|
+
readonly outset?: SceneMargins | undefined;
|
|
41
|
+
};
|
|
42
|
+
/** The room an object needs outside the data box, in pixels per side, such as the tick labels of an axis. */
|
|
43
|
+
export type SceneMargins = Partial<PlotMargins>;
|
|
44
|
+
/** A rectangle in the plot's CSS pixels, measured from its top left corner. */
|
|
45
|
+
export type SceneRect = {
|
|
46
|
+
readonly left: number;
|
|
47
|
+
readonly top: number;
|
|
48
|
+
readonly right: number;
|
|
49
|
+
readonly bottom: number;
|
|
50
|
+
};
|
|
51
|
+
/** A point in the plot's CSS pixels. */
|
|
52
|
+
export type ScenePixel = {
|
|
53
|
+
readonly x: number;
|
|
54
|
+
readonly y: number;
|
|
55
|
+
};
|
|
56
|
+
/** The part of the data box the camera shows. */
|
|
57
|
+
export type SceneView = {
|
|
58
|
+
readonly x0: number;
|
|
59
|
+
readonly x1: number;
|
|
60
|
+
readonly y0: number;
|
|
61
|
+
readonly y1: number;
|
|
62
|
+
};
|
|
63
|
+
/** The pixel boxes of the named node sizes for every shape but the circle. */
|
|
64
|
+
export declare const sceneNodeSizes: {
|
|
65
|
+
readonly small: {
|
|
66
|
+
readonly width: 64;
|
|
67
|
+
readonly height: 28;
|
|
68
|
+
};
|
|
69
|
+
readonly medium: {
|
|
70
|
+
readonly width: 120;
|
|
71
|
+
readonly height: 40;
|
|
72
|
+
};
|
|
73
|
+
readonly large: {
|
|
74
|
+
readonly width: 184;
|
|
75
|
+
readonly height: 64;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/** The diameters of the named circle sizes, in CSS pixels. */
|
|
79
|
+
export declare const sceneCircleSizes: {
|
|
80
|
+
readonly small: 32;
|
|
81
|
+
readonly medium: 48;
|
|
82
|
+
readonly large: 72;
|
|
83
|
+
};
|
|
84
|
+
/** The pixel box of a node of this size and shape. */
|
|
85
|
+
export declare function nodeBox(size: SceneSize, shape: SceneShape): {
|
|
86
|
+
readonly width: number;
|
|
87
|
+
readonly height: number;
|
|
88
|
+
};
|
|
89
|
+
/** The center of a rectangle. */
|
|
90
|
+
export declare function rectCenter(rect: SceneRect): ScenePixel;
|
|
91
|
+
/** The smallest rectangle around all of `rects`, or undefined when there are none. */
|
|
92
|
+
export declare function unionRect(rects: ReadonlyArray<SceneRect>): SceneRect | undefined;
|
|
93
|
+
/** A rectangle grown by `padding` pixels on every side. */
|
|
94
|
+
export declare function padRect(rect: SceneRect, padding: number): SceneRect;
|
|
95
|
+
/** Whether two rectangles share any area. */
|
|
96
|
+
export declare function rectsOverlap(first: SceneRect, second: SceneRect): boolean;
|
|
97
|
+
/** The area two rectangles share, in square pixels. */
|
|
98
|
+
export declare function sharedArea(first: SceneRect, second: SceneRect): number;
|
|
99
|
+
/** How long the part of the segment from `from` to `to` that lies inside `rect` is, in pixels. */
|
|
100
|
+
export declare function segmentInside({ rect, from, to, }: {
|
|
101
|
+
readonly rect: SceneRect;
|
|
102
|
+
readonly from: ScenePixel;
|
|
103
|
+
readonly to: ScenePixel;
|
|
104
|
+
}): number;
|
|
105
|
+
type EdgeInput = {
|
|
106
|
+
readonly rect: SceneRect;
|
|
107
|
+
readonly shape: SceneShape;
|
|
108
|
+
/** The point the edge faces, such as the other end of a wire. */
|
|
109
|
+
readonly toward: ScenePixel;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Where a line from the center of a node toward `toward` crosses the node's outline. Wires end there, so they meet the
|
|
113
|
+
* edge of a box, pill or circle and never its middle.
|
|
114
|
+
*/
|
|
115
|
+
export declare function edgePoint({ rect, shape, toward }: EdgeInput): ScenePixel;
|
|
116
|
+
/** The midpoint of the side of a node that faces along an axis, where a curved or elbowed wire leaves it. */
|
|
117
|
+
export declare function sidePoint({ rect, axis, sign, }: {
|
|
118
|
+
readonly rect: SceneRect;
|
|
119
|
+
readonly axis: 'x' | 'y';
|
|
120
|
+
/** 1 for the right or bottom side, -1 for the left or top side. */
|
|
121
|
+
readonly sign: number;
|
|
122
|
+
}): ScenePixel;
|
|
123
|
+
type CameraInput = {
|
|
124
|
+
/** The whole data box. */
|
|
125
|
+
readonly domain: SceneDomain;
|
|
126
|
+
/** The drawing area in pixels. */
|
|
127
|
+
readonly width: number;
|
|
128
|
+
readonly height: number;
|
|
129
|
+
/** The frames the camera must show. Empty shows the whole box. */
|
|
130
|
+
readonly frames: ReadonlyArray<SceneFrame>;
|
|
131
|
+
/** The room left around the framed objects, in pixels. */
|
|
132
|
+
readonly padding: number;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* The part of the data box that shows `frames` as large as it can with `padding` around them, keeping the box's aspect
|
|
136
|
+
* ratio and staying inside it. It zooms in at most eight times.
|
|
137
|
+
*/
|
|
138
|
+
export declare function cameraView({ domain, width, height, frames, padding }: CameraInput): SceneView;
|
|
139
|
+
/** A pair of objects a wire joins, with the pixels the wire keeps between them. */
|
|
140
|
+
type SceneLink = {
|
|
141
|
+
readonly from: SceneFrame;
|
|
142
|
+
readonly to: SceneFrame;
|
|
143
|
+
readonly room: number | undefined;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* The margins around the data box of a plot `width` by `height` pixels. Each side keeps whole the frames that reach
|
|
147
|
+
* past it and holds the largest room any of `reserved` asks for there.
|
|
148
|
+
*/
|
|
149
|
+
export declare function sceneMargins({ frames, reserved, domain, width, height, }: {
|
|
150
|
+
readonly frames: ReadonlyArray<SceneFrame>;
|
|
151
|
+
readonly reserved: ReadonlyArray<SceneMargins>;
|
|
152
|
+
readonly domain: SceneDomain;
|
|
153
|
+
readonly width: number;
|
|
154
|
+
readonly height: number;
|
|
155
|
+
}): PlotMargins;
|
|
156
|
+
/**
|
|
157
|
+
* The plot width below which two frames on the same row would touch, or two wired frames would leave no room for the
|
|
158
|
+
* wire. Rows are pixel bands, because the plot height is fixed. The result is capped at 2400 pixels.
|
|
159
|
+
*/
|
|
160
|
+
export declare function sceneMinWidth({ frames, edged, links, domain, innerHeight, reserved, }: {
|
|
161
|
+
readonly frames: ReadonlyArray<SceneFrame>;
|
|
162
|
+
/** The frames the margins keep whole: `frames`, and the room drawn around some of them, such as a group's outline. */
|
|
163
|
+
readonly edged: ReadonlyArray<SceneFrame>;
|
|
164
|
+
/** The ends of each wire. Wired nodes keep room between them for the wire, its arrow and its text. */
|
|
165
|
+
readonly links: ReadonlyArray<SceneLink>;
|
|
166
|
+
readonly domain: SceneDomain;
|
|
167
|
+
readonly innerHeight: number;
|
|
168
|
+
readonly reserved: ReadonlyArray<SceneMargins>;
|
|
169
|
+
}): number;
|
|
170
|
+
/** One item the arrow keys reach, where it sits now, with the stacking order that orders items sharing a place. */
|
|
171
|
+
export type SceneKeyboardItem = {
|
|
172
|
+
readonly id: string;
|
|
173
|
+
readonly rect: SceneRect;
|
|
174
|
+
readonly order: number;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Where the arrow keys find each item. Items whose centers lie a few pixels from an earlier one, such as piled cards,
|
|
178
|
+
* line up on a short row through its center in stacking order. Left and Right then step through them.
|
|
179
|
+
*/
|
|
180
|
+
export declare function keyboardPlaces(items: ReadonlyArray<SceneKeyboardItem>): ReadonlyMap<string, SceneRect>;
|
|
181
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../charts/src/index.ts';
|
|
3
|
+
import type { MarkEmphasis } from '../../../charts/src/plot/index.ts';
|
|
4
|
+
export type SceneGroupProps = {
|
|
5
|
+
/** Stable across states: the outline with this id eases to its new members. */
|
|
6
|
+
readonly id: string;
|
|
7
|
+
/** The readout sentence and, unless `text` is set, the name drawn on the outline. */
|
|
8
|
+
readonly label?: string | undefined;
|
|
9
|
+
/** A shorter name to draw, when the label is a full sentence. */
|
|
10
|
+
readonly text?: string | undefined;
|
|
11
|
+
/** The ids of the objects the outline surrounds. It follows them as they move. */
|
|
12
|
+
readonly around: ReadonlyArray<string>;
|
|
13
|
+
/** A hue for the outline, when it should match a thing the prose names. Left out, it is drawn in ink. */
|
|
14
|
+
readonly tone?: ChartTone | undefined;
|
|
15
|
+
/** The room between the members and the outline, in pixels. Defaults to 10. */
|
|
16
|
+
readonly padding?: number | undefined;
|
|
17
|
+
/** False fades the outline out and takes it out of the keyboard order. */
|
|
18
|
+
readonly isShown?: boolean | undefined;
|
|
19
|
+
/** True keeps the outline and its members at full strength while the rest recede. */
|
|
20
|
+
readonly isActive?: boolean | undefined;
|
|
21
|
+
/** `context` draws the outline gray; the others yield to inspection. */
|
|
22
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A labelled outline around a set of scene objects, such as a layer of a network. It follows its members as they move
|
|
26
|
+
* and resize. Give it a label to make it an item; focusing the camera on its id frames its members.
|
|
27
|
+
*/
|
|
28
|
+
export declare function SceneGroup({ id, label, text, around, tone, padding, isShown, isActive, emphasis, }: SceneGroupProps): ReactNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../charts/src/index.ts';
|
|
3
|
+
export type SceneHighlightProps = {
|
|
4
|
+
/** The id or ids to draw attention to. The objects themselves are not changed. */
|
|
5
|
+
readonly of: string | ReadonlyArray<string>;
|
|
6
|
+
/** Defaults to `highlight:` and the ids. */
|
|
7
|
+
readonly id?: string | undefined;
|
|
8
|
+
/** A hue for the halo, when it should match a thing the prose names. Left out, the halo is drawn in ink. */
|
|
9
|
+
readonly tone?: ChartTone | undefined;
|
|
10
|
+
/** The halo's reach beyond each object, in pixels. Defaults to 6. */
|
|
11
|
+
readonly padding?: number | undefined;
|
|
12
|
+
/** False fades the halo out. Toggle it to point at the objects the prose names. */
|
|
13
|
+
readonly isShown?: boolean | undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A halo behind scene objects that draws the reader's eye without changing them: the node a sentence is about, or the
|
|
17
|
+
* path a value takes. It follows its objects and fades in and out with `isShown`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function SceneHighlight({ of, id, tone, padding, isShown }: SceneHighlightProps): ReactNode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** SVG layers under the nodes, back to front: outlines and halos, wires, then brackets, leaders and custom marks. */
|
|
3
|
+
export type SceneLayerName = 'back' | 'wires' | 'front';
|
|
4
|
+
/**
|
|
5
|
+
* Draws SVG for the parts that draw lines and outlines into one of the scene's layers, under the HTML nodes, in plot
|
|
6
|
+
* pixels. Before the scene mounts, as on the server, it draws in its own SVG element, so the first markup holds every
|
|
7
|
+
* wire and curve. It draws nothing outside a scene.
|
|
8
|
+
*/
|
|
9
|
+
export declare function SceneLayer({ layer, children, }: {
|
|
10
|
+
readonly layer?: SceneLayerName | undefined;
|
|
11
|
+
readonly children: ReactNode;
|
|
12
|
+
}): ReactNode;
|
|
13
|
+
/** The inline error a scene part shows when it is rendered outside any `Scene`. */
|
|
14
|
+
export declare function SceneOutside({ part }: {
|
|
15
|
+
readonly part: string;
|
|
16
|
+
}): ReactNode;
|