@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
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
3
4
|
import type { HeatmapScale } from './heatmap-scale.ts';
|
|
4
|
-
import type { MatrixAxisItem, MatrixCell } from './matrix-types.ts';
|
|
5
|
+
import type { MatrixAxisItem, MatrixCell, MatrixCellRangeProps, MatrixCellValuesProps } from './matrix-types.ts';
|
|
5
6
|
export type { MatrixAxisItem, MatrixCell } from './matrix-types.ts';
|
|
6
|
-
export type MatrixProps = HeatmapScale & {
|
|
7
|
-
readonly title: string;
|
|
8
|
-
readonly report?: ChartReport | undefined;
|
|
9
|
-
readonly description: string;
|
|
7
|
+
export type MatrixProps = FigureProps & FigureSelectionProps & MatrixCellRangeProps & MatrixCellValuesProps & HeatmapScale & {
|
|
10
8
|
readonly rows: ReadonlyArray<MatrixAxisItem>;
|
|
11
9
|
readonly columns: ReadonlyArray<MatrixAxisItem>;
|
|
12
10
|
readonly cells: ReadonlyArray<MatrixCell>;
|
|
11
|
+
/** What the color measures, with its unit and any normalization the application applied. */
|
|
13
12
|
readonly valueLabel: string;
|
|
14
|
-
readonly
|
|
15
|
-
readonly selection?: ChartSelection;
|
|
16
|
-
readonly emptyLabel: string;
|
|
13
|
+
readonly valueFormat: ValueFormat;
|
|
17
14
|
/**
|
|
18
15
|
* The values variant draws square cells with short values for exact comparison. The strip variant draws compact
|
|
19
16
|
* intensity rows that fill the width, such as months across categories. Absent means values.
|
|
20
17
|
*/
|
|
21
18
|
readonly variant?: 'values' | 'strip' | undefined;
|
|
22
19
|
};
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Supplied values at explicit row and column identities, colored on a declared domain: attention weights, a metric by
|
|
22
|
+
* model and benchmark, monthly shares by category. A reader steps through cells with the arrow keys, marks a block with
|
|
23
|
+
* Shift and the arrows or a drag, and copies it as tab-separated exact values. Masked, missing and out-of-domain cells
|
|
24
|
+
* stay distinct from zero, and a preset such as ConfusionMatrix suits a matrix with a fixed meaning.
|
|
25
|
+
*/
|
|
26
|
+
export declare function Matrix({ variant, emptyLabel, ...props }: MatrixProps): ReactNode;
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
3
4
|
import type { HeatmapScale } from './heatmap-scale.ts';
|
|
5
|
+
/** One token of a supplied text window, with its index in the full sequence and its score. */
|
|
4
6
|
export type HeatmapToken = {
|
|
5
7
|
readonly id: string;
|
|
6
8
|
readonly index: number;
|
|
7
9
|
readonly text: string;
|
|
10
|
+
/** The score, or null where none was computed. Null draws a dotted underline, never zero. */
|
|
8
11
|
readonly score: number | null;
|
|
9
12
|
};
|
|
10
|
-
export type TokenHeatmapProps = HeatmapScale & {
|
|
11
|
-
readonly title: string;
|
|
12
|
-
readonly report?: ChartReport | undefined;
|
|
13
|
-
readonly description: string;
|
|
13
|
+
export type TokenHeatmapProps = FigureProps & FigureSelectionProps & HeatmapScale & {
|
|
14
14
|
readonly tokens: ReadonlyArray<HeatmapToken>;
|
|
15
|
+
/** What the score measures, with its unit. */
|
|
15
16
|
readonly valueLabel: string;
|
|
16
|
-
readonly
|
|
17
|
-
readonly selection?: ChartSelection;
|
|
18
|
-
readonly emptyLabel: string;
|
|
17
|
+
readonly valueFormat: ValueFormat;
|
|
19
18
|
};
|
|
20
|
-
|
|
21
|
-
export declare
|
|
19
|
+
/** The render limit. A longer window shows an explicit error; the application supplies a labelled window. */
|
|
20
|
+
export declare const tokenHeatmapLimits: {
|
|
21
|
+
readonly tokens: 2048;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A text window with each token's score as a colored underline: attributions, surprisal, probe outputs. The text stays
|
|
25
|
+
* exact, whitespace included, and each token keeps its supplied index. Scores come from the application.
|
|
26
|
+
*/
|
|
27
|
+
export declare function TokenHeatmap(props: TokenHeatmapProps): ReactNode;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A surface sampled on a regular grid. `values` holds `columns * rows` samples, row by row. Each row starts at its left
|
|
3
|
+
* edge and the first row is the bottom edge, so a row index grows upward like a value on a y axis.
|
|
4
|
+
*/
|
|
5
|
+
export type ContourGrid = {
|
|
6
|
+
readonly columns: number;
|
|
7
|
+
readonly rows: number;
|
|
8
|
+
readonly values: ReadonlyArray<number>;
|
|
9
|
+
};
|
|
10
|
+
/** A place on the grid in sample units: whole numbers are samples, fractions lie between them. */
|
|
11
|
+
export type GridPoint = {
|
|
12
|
+
readonly column: number;
|
|
13
|
+
readonly row: number;
|
|
14
|
+
};
|
|
15
|
+
/** One piece of a level line, between two points on the edges of one grid cell. */
|
|
16
|
+
export type ContourSegment = {
|
|
17
|
+
readonly from: GridPoint;
|
|
18
|
+
readonly to: GridPoint;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The line where a sampled surface crosses a level, by marching squares. Each grid cell with samples on both sides of
|
|
22
|
+
* the level contributes one or two straight pieces, placed along its edges by linear interpolation between the two
|
|
23
|
+
* samples. A saddle cell is resolved by the average of its four samples, and a sample equal to the level counts as
|
|
24
|
+
* above.
|
|
25
|
+
*/
|
|
26
|
+
export declare function contourSegments({ grid, level, }: {
|
|
27
|
+
readonly grid: ContourGrid;
|
|
28
|
+
readonly level: number;
|
|
29
|
+
}): ReadonlyArray<ContourSegment>;
|
|
30
|
+
/**
|
|
31
|
+
* The surface at a place between samples, by linear interpolation along the grid's rows and columns. It is undefined
|
|
32
|
+
* outside the grid.
|
|
33
|
+
*/
|
|
34
|
+
export declare function sampleGrid({ grid, point, }: {
|
|
35
|
+
readonly grid: ContourGrid;
|
|
36
|
+
readonly point: GridPoint;
|
|
37
|
+
}): number | undefined;
|
|
38
|
+
/** The SVG path of level-line pieces, each drawn from its own start, after `position` places grid points in pixels. */
|
|
39
|
+
export declare function segmentsPath({ segments, position, }: {
|
|
40
|
+
readonly segments: ReadonlyArray<ContourSegment>;
|
|
41
|
+
readonly position: (point: GridPoint) => {
|
|
42
|
+
readonly x: number;
|
|
43
|
+
readonly y: number;
|
|
44
|
+
};
|
|
45
|
+
}): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plot kernel is what every chart in Elements is built from, and the way to build a chart the library lacks. Such a
|
|
3
|
+
* chart shares the axes, marks, readout, keyboard cursor, states and tones of the others. `CurveChart` in
|
|
4
|
+
* `charts/trend` is the reference for how the parts fit together.
|
|
5
|
+
*/
|
|
6
|
+
export type { ChartDataProps, ChartDataRow } from '../chart-data.tsx';
|
|
7
|
+
export { ChartData } from '../chart-data.tsx';
|
|
8
|
+
export { ChartCursor } from '../chart-cursor.tsx';
|
|
9
|
+
export { ChartReadout } from '../chart-frame.tsx';
|
|
10
|
+
export { hasUniqueIds } from '../chart-input.ts';
|
|
11
|
+
export type { ChartInspectionRow } from '../chart-inspection.tsx';
|
|
12
|
+
export { ChartInspection } from '../chart-inspection.tsx';
|
|
13
|
+
export { chartStyles } from '../chart-theme.ts';
|
|
14
|
+
export type { ChartInspectDetails, ChartInspectReason, ChartItem, ChartOptions, ChartPoint, ChartView, } from '../chart.tsx';
|
|
15
|
+
export { Chart, ChartMark, ChartPlot, inspectedLabel, plotLabel } from '../chart.tsx';
|
|
16
|
+
export type { FigureFrameProps } from '../figure/figure-frame.tsx';
|
|
17
|
+
export { FigureEmpty, FigureFrame, FigureInvalid, FigureLoading, coverageText } from '../figure/figure-frame.tsx';
|
|
18
|
+
export type { FigureFrameInput } from '../figure/figure-props.ts';
|
|
19
|
+
export type { ToneInput } from '../figure/tone-scope.tsx';
|
|
20
|
+
export { assignTones, automaticTone, useTones } from '../figure/tone-scope.tsx';
|
|
21
|
+
export { zoneOffset } from '../figure/figure-format.ts';
|
|
22
|
+
export type { ContourGrid, ContourSegment, GridPoint } from './contours.ts';
|
|
23
|
+
export { contourSegments, sampleGrid, segmentsPath } from './contours.ts';
|
|
24
|
+
export type { LabelBox, LabelObstacle, LabelSpot } from './label-place.ts';
|
|
25
|
+
export { freeLabelSpot, labelBox } from './label-place.ts';
|
|
26
|
+
export type { MarkPosition } from './locate.ts';
|
|
27
|
+
export { locateNearest } from './locate.ts';
|
|
28
|
+
export type { AreaPoint, LinkPathInput, LinkShape, PathCurve, PathPoint } from './path.ts';
|
|
29
|
+
export { areaPath, isolatedPoints, linePath, linkPath } from './path.ts';
|
|
30
|
+
export type { PlotAxesProps, PlotGrid } from './plot-axes.tsx';
|
|
31
|
+
export { PlotAxes } from './plot-axes.tsx';
|
|
32
|
+
export type { AxisTicks, AxisTicksInput, CategoryPlotLayout, FitDomainInput, NumericPlotLayout, PlotBox, PlotCategory, PlotMargins, PlotTick, TimeAxisTicksInput, TimePlotInput, ValueGutterInput, } from './plot-layout.ts';
|
|
33
|
+
export { axisTicks, axisTitle, bandTicks, categoryPlot, fitDomain, numericPlot, plotBox, plotMargins, tickTexts, ticksMinimum, timeAxisTicks, timePlot, valueGutter, } from './plot-layout.ts';
|
|
34
|
+
export type { AreaMarkProps, BarMarkProps, DotMarkProps, LabelMarkProps, LineMarkProps, LinkMarkProps, MarkEmphasis, MarkState, MarkStroke, Segment, SymbolMarkProps, SymbolShape, } from './plot-marks.tsx';
|
|
35
|
+
export { AreaMark, BandMark, BarMark, ConnectorMark, DotMark, GuideMark, IntervalMark, LabelMark, LineMark, LinkMark, RingMark, RuleMark, SymbolMark, } from './plot-marks.tsx';
|
|
36
|
+
export type { PlotSurfaceProps } from './plot-surface.tsx';
|
|
37
|
+
export { PlotClip, PlotSurface, usePlotSize } from './plot-surface.tsx';
|
|
38
|
+
export type { DensityLayerProps } from './render/density-layer.tsx';
|
|
39
|
+
export { DensityLayer } from './render/density-layer.tsx';
|
|
40
|
+
export type { DataRect, HitIndex, HitQuery, PointColumns } from './render/hit-index.ts';
|
|
41
|
+
export { countInside, hitIndex } from './render/hit-index.ts';
|
|
42
|
+
export type { PlotView, PlotViewDetails, PlotViewportOptions, PlotViewportRootProps } from './render/plot-viewport.tsx';
|
|
43
|
+
export { PlotViewportRoot, PlotViewportSurface, WHOLE_VIEW, visibleDomains } from './render/plot-viewport.tsx';
|
|
44
|
+
export type { PointAxis, PointDraw, PointLayerProps, PointRenderer } from './render/point-layer.tsx';
|
|
45
|
+
export { PointLayer } from './render/point-layer.tsx';
|
|
46
|
+
export type { BandScale, BandScaleInput, ContinuousScale, ContinuousScaleInput } from './scale.ts';
|
|
47
|
+
export { bandScale, columnExtent, continuousScale, isFiniteDomain, outsideDomain, scaleDomainError } from './scale.ts';
|
|
48
|
+
export type { TickInput, TimeTickInput } from './ticks.ts';
|
|
49
|
+
export { linearTicks, logTicks, scaleTicks, symlogTicks, timeTicks } from './ticks.ts';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** A label a chart could draw: where its baseline starts, how it is anchored, and its text. */
|
|
2
|
+
export type LabelSpot = {
|
|
3
|
+
readonly x: number;
|
|
4
|
+
/** The text's baseline. */
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly anchor: 'start' | 'middle' | 'end';
|
|
7
|
+
readonly text: string;
|
|
8
|
+
};
|
|
9
|
+
/** A point in plot pixels on a line a label must avoid. */
|
|
10
|
+
export type LabelObstacle = {
|
|
11
|
+
readonly x: number;
|
|
12
|
+
readonly y: number;
|
|
13
|
+
};
|
|
14
|
+
/** A box in plot pixels. */
|
|
15
|
+
export type LabelBox = {
|
|
16
|
+
readonly left: number;
|
|
17
|
+
readonly right: number;
|
|
18
|
+
readonly top: number;
|
|
19
|
+
readonly bottom: number;
|
|
20
|
+
};
|
|
21
|
+
/** The box a label's text covers, with a few pixels of clearance on every side. */
|
|
22
|
+
export declare function labelBox(spot: LabelSpot): LabelBox;
|
|
23
|
+
export type FreeLabelSpotInput = {
|
|
24
|
+
/** Where the label may go, in order of preference. */
|
|
25
|
+
readonly spots: ReadonlyArray<LabelSpot>;
|
|
26
|
+
/** The lines and marks the label must not sit on, as pixel polylines. A single point stands for a dot. */
|
|
27
|
+
readonly lines: ReadonlyArray<ReadonlyArray<LabelObstacle>>;
|
|
28
|
+
/** Boxes already taken, such as other labels. */
|
|
29
|
+
readonly taken?: ReadonlyArray<LabelBox> | undefined;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The first spot where a label touches no line and no taken box, or else the spot it touches least. Use it for a
|
|
33
|
+
* reference or marker label that may sit at either end of its line, so it never covers a series.
|
|
34
|
+
*/
|
|
35
|
+
export declare function freeLabelSpot({ spots, lines, taken }: FreeLabelSpotInput): LabelSpot | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChartPoint } from '../chart.tsx';
|
|
2
|
+
/** Where a mark sits in the plot's drawn pixels. */
|
|
3
|
+
export type MarkPosition = {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly x: number;
|
|
6
|
+
readonly y: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A chart `locate` for marks at known positions: the pointer inspects the nearest one. The `axis` option limits the
|
|
10
|
+
* distance to one direction, for marks a reader scans along a single axis such as the steps of a curve.
|
|
11
|
+
*/
|
|
12
|
+
export declare function locateNearest({ marks, width, height, axis, }: {
|
|
13
|
+
readonly marks: ReadonlyArray<MarkPosition>;
|
|
14
|
+
/** The size the marks were laid out in. The pointer arrives in rendered pixels and is rescaled to it. */
|
|
15
|
+
readonly width: number;
|
|
16
|
+
readonly height: number;
|
|
17
|
+
readonly axis?: 'x' | 'y' | 'both' | undefined;
|
|
18
|
+
}): (point: ChartPoint) => string | undefined;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** A vertex of a line. A null `y` is a missing observation: the line breaks there and is never drawn through it. */
|
|
2
|
+
export type PathPoint = {
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number | null;
|
|
5
|
+
};
|
|
6
|
+
/** A vertex of a filled region between two edges. A null edge breaks the region. */
|
|
7
|
+
export type AreaPoint = {
|
|
8
|
+
readonly x: number;
|
|
9
|
+
readonly y0: number | null;
|
|
10
|
+
readonly y1: number | null;
|
|
11
|
+
};
|
|
12
|
+
type Vertex = {
|
|
13
|
+
readonly x: number;
|
|
14
|
+
readonly y: number;
|
|
15
|
+
};
|
|
16
|
+
/** How neighbors join: a straight segment, or a step that holds each value until the next observation. */
|
|
17
|
+
export type PathCurve = 'linear' | 'step';
|
|
18
|
+
/** The SVG path of a line through the present points, broken at each missing one. */
|
|
19
|
+
export declare function linePath(points: ReadonlyArray<PathPoint>, curve?: PathCurve): string;
|
|
20
|
+
/** The present points with a missing or absent neighbor on both sides. A line cannot show them, so charts draw dots. */
|
|
21
|
+
export declare function isolatedPoints(points: ReadonlyArray<PathPoint>): ReadonlyArray<Vertex>;
|
|
22
|
+
/** The SVG path of the region between two edges, joined by straight segments and broken where an edge is missing. */
|
|
23
|
+
export declare function areaPath(points: ReadonlyArray<AreaPoint>): string;
|
|
24
|
+
/** How a link joins two marks: a smooth curve, or right-angled elbows that turn halfway along. */
|
|
25
|
+
export type LinkShape = 'curve' | 'elbow';
|
|
26
|
+
type Segment = {
|
|
27
|
+
readonly x1: number;
|
|
28
|
+
readonly y1: number;
|
|
29
|
+
readonly x2: number;
|
|
30
|
+
readonly y2: number;
|
|
31
|
+
};
|
|
32
|
+
export type LinkPathInput = Segment & {
|
|
33
|
+
/** The axis the link advances along, from its source to its target: `y` for a link that runs up or down. */
|
|
34
|
+
readonly axis: 'x' | 'y';
|
|
35
|
+
readonly shape?: LinkShape | undefined;
|
|
36
|
+
};
|
|
37
|
+
/** The SVG path of a link from one mark to another, such as a graph edge or a tree branch. */
|
|
38
|
+
export declare function linkPath({ x1, y1, x2, y2, axis, shape }: LinkPathInput): string;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PlotBox, PlotTick } from './plot-layout.ts';
|
|
3
|
+
export type PlotAxesProps = {
|
|
4
|
+
readonly box: PlotBox;
|
|
5
|
+
/** The ticks along the bottom, at horizontal positions. */
|
|
6
|
+
readonly xTicks: ReadonlyArray<PlotTick>;
|
|
7
|
+
/** The ticks down the side, at vertical positions. */
|
|
8
|
+
readonly yTicks: ReadonlyArray<PlotTick>;
|
|
9
|
+
readonly xTitle?: string | undefined;
|
|
10
|
+
readonly yTitle?: string | undefined;
|
|
11
|
+
/** Which ticks draw a line across the plot. Lines follow the measured axis: horizontal ones by default. */
|
|
12
|
+
readonly grid?: PlotGrid | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type PlotGrid = 'x' | 'y' | 'both' | 'none';
|
|
15
|
+
/**
|
|
16
|
+
* The grid, tick labels and axis titles of a plot, which every chart draws here so its axes all read alike. A side
|
|
17
|
+
* label longer than the left margin is cut with an ellipsis and keeps its full text in a title. Bottom labels that
|
|
18
|
+
* would touch are thinned, and the readout still names every category.
|
|
19
|
+
*/
|
|
20
|
+
export declare function PlotAxes({ box, xTicks, yTicks, xTitle, yTitle, grid }: PlotAxesProps): ReactNode;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import type { TimeFormat, ValueFormat } from '../figure/figure-format.ts';
|
|
2
|
+
import type { BandScale, ContinuousScale, NumericDomain, ScaleType } from './scale.ts';
|
|
3
|
+
/** The named plot heights, in CSS pixels. A figure picks one, so charts side by side share a baseline. */
|
|
4
|
+
export declare const plotHeights: {
|
|
5
|
+
readonly compact: 160;
|
|
6
|
+
readonly regular: 260;
|
|
7
|
+
readonly tall: 380;
|
|
8
|
+
};
|
|
9
|
+
export type PlotHeight = keyof typeof plotHeights;
|
|
10
|
+
export type PlotMargins = {
|
|
11
|
+
readonly top: number;
|
|
12
|
+
readonly right: number;
|
|
13
|
+
readonly bottom: number;
|
|
14
|
+
readonly left: number;
|
|
15
|
+
};
|
|
16
|
+
/** The drawing area inside the axes, in the CSS pixels of the plot's own top left corner. */
|
|
17
|
+
export type PlotBox = {
|
|
18
|
+
readonly width: number;
|
|
19
|
+
readonly height: number;
|
|
20
|
+
readonly left: number;
|
|
21
|
+
readonly right: number;
|
|
22
|
+
readonly top: number;
|
|
23
|
+
readonly bottom: number;
|
|
24
|
+
readonly innerWidth: number;
|
|
25
|
+
readonly innerHeight: number;
|
|
26
|
+
};
|
|
27
|
+
/** One labelled position on an axis. A category label wrapped by `categoryPlot` holds one line break. */
|
|
28
|
+
export type PlotTick = {
|
|
29
|
+
readonly key: string;
|
|
30
|
+
readonly position: number;
|
|
31
|
+
readonly label: string;
|
|
32
|
+
};
|
|
33
|
+
/** A measured axis as a chart's caller declares it. */
|
|
34
|
+
export type PlotAxis = {
|
|
35
|
+
/** The axis title, with its unit: "Latency (ms)". */
|
|
36
|
+
readonly label: string;
|
|
37
|
+
/** The values the axis spans. Leave it out to fit the supplied values on round bounds. */
|
|
38
|
+
readonly domain?: NumericDomain | undefined;
|
|
39
|
+
readonly scale?: ScaleType | undefined;
|
|
40
|
+
/** How readouts and tables write a value on this axis. Ticks use its compact form unless `tickFormat` is set. */
|
|
41
|
+
readonly format: ValueFormat;
|
|
42
|
+
readonly tickFormat?: ValueFormat | undefined;
|
|
43
|
+
};
|
|
44
|
+
export type PlotCategory = {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly label: string;
|
|
47
|
+
};
|
|
48
|
+
/** The axis title a reader sees. A log axis always says so, because equal distances no longer mean equal amounts. */
|
|
49
|
+
export declare function axisTitle(axis: Pick<PlotAxis, 'label' | 'scale'>): string;
|
|
50
|
+
export type FitDomainInput = {
|
|
51
|
+
readonly values: ReadonlyArray<number | null>;
|
|
52
|
+
/** True for marks whose length carries the amount, such as bars: their axis always starts at zero. */
|
|
53
|
+
readonly isZeroBased?: boolean | undefined;
|
|
54
|
+
readonly scale?: ScaleType | undefined;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The domain a chart uses when its caller declares none: the finite values, widened to round bounds. A linear axis with
|
|
58
|
+
* no spread gets one unit on each side; a log axis rounds out to powers of ten.
|
|
59
|
+
*/
|
|
60
|
+
export declare function fitDomain({ values, isZeroBased, scale }: FitDomainInput): NumericDomain;
|
|
61
|
+
/** The margins that hold a plot's tick labels and axis titles. The left one grows with the longest value label. */
|
|
62
|
+
export declare function plotMargins({ width, valueLabels, hasXTitle, hasYTitle, leftShare, }: {
|
|
63
|
+
readonly width: number;
|
|
64
|
+
/** The labels drawn beside the vertical axis. */
|
|
65
|
+
readonly valueLabels: ReadonlyArray<string>;
|
|
66
|
+
readonly hasXTitle: boolean;
|
|
67
|
+
readonly hasYTitle: boolean;
|
|
68
|
+
/** The largest share of the width the left margin may take. Rows of named categories may take more than values. */
|
|
69
|
+
readonly leftShare?: number | undefined;
|
|
70
|
+
}): PlotMargins;
|
|
71
|
+
export declare function plotBox({ width, height, margins, }: {
|
|
72
|
+
readonly width: number;
|
|
73
|
+
readonly height: number;
|
|
74
|
+
readonly margins: PlotMargins;
|
|
75
|
+
}): PlotBox;
|
|
76
|
+
/** Tick values with the text each one shows. */
|
|
77
|
+
export type AxisTicks = {
|
|
78
|
+
readonly values: ReadonlyArray<number>;
|
|
79
|
+
readonly labels: ReadonlyArray<string>;
|
|
80
|
+
};
|
|
81
|
+
export type AxisTicksInput = {
|
|
82
|
+
readonly axis: PlotAxis;
|
|
83
|
+
readonly domain: NumericDomain;
|
|
84
|
+
/** The axis length in pixels: the plot's height for a vertical axis, its inner width for a horizontal one. */
|
|
85
|
+
readonly length: number;
|
|
86
|
+
/** About how many pixels apart neighbouring ticks sit. */
|
|
87
|
+
readonly spacing: number;
|
|
88
|
+
readonly locale: string;
|
|
89
|
+
/**
|
|
90
|
+
* True when the axis draws its title. The title names the unit, so the ticks leave out a `unit` style and stay short;
|
|
91
|
+
* currency and percent signs remain.
|
|
92
|
+
*/
|
|
93
|
+
readonly hasTitle: boolean;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The text of each tick, raised in precision until no two read the same. The order is the compact form, then the
|
|
97
|
+
* compact form with one to four digits after the point, then the full form with as many. A function format is used as
|
|
98
|
+
* supplied.
|
|
99
|
+
*/
|
|
100
|
+
export declare function tickTexts({ values, axis, locale, hasTitle, }: Pick<AxisTicksInput, 'axis' | 'locale' | 'hasTitle'> & {
|
|
101
|
+
readonly values: ReadonlyArray<number>;
|
|
102
|
+
}): ReadonlyArray<string>;
|
|
103
|
+
/**
|
|
104
|
+
* The fewest ticks an axis of this length shows: three once it is longer than 120 pixels, two below. Charts that place
|
|
105
|
+
* their own ticks use it, so every axis agrees.
|
|
106
|
+
*/
|
|
107
|
+
export declare function ticksMinimum(length: number): number;
|
|
108
|
+
/**
|
|
109
|
+
* The ticks of a measured axis: round values on its scale, at least three on an axis longer than 120 pixels, each
|
|
110
|
+
* labelled so that no two read the same. Ticks that land on both ends of the domain win when they fit, so the lowest
|
|
111
|
+
* and highest marks never sit beyond the outer ticks. Every kernel layout labels its axes with it; a chart that draws
|
|
112
|
+
* an axis of its own calls it too.
|
|
113
|
+
*/
|
|
114
|
+
export declare function axisTicks({ axis, domain, length, spacing, locale, hasTitle }: AxisTicksInput): AxisTicks;
|
|
115
|
+
/**
|
|
116
|
+
* The ticks of a band axis: one at the center of each category, labelled with its name. A label may hold a line break,
|
|
117
|
+
* which `PlotAxes` draws as a second line.
|
|
118
|
+
*/
|
|
119
|
+
export declare function bandTicks(scale: BandScale, categories: ReadonlyArray<PlotCategory>): ReadonlyArray<PlotTick>;
|
|
120
|
+
export type NumericPlotLayout = {
|
|
121
|
+
readonly box: PlotBox;
|
|
122
|
+
readonly x: ContinuousScale;
|
|
123
|
+
readonly y: ContinuousScale;
|
|
124
|
+
readonly xTicks: ReadonlyArray<PlotTick>;
|
|
125
|
+
readonly yTicks: ReadonlyArray<PlotTick>;
|
|
126
|
+
};
|
|
127
|
+
/** The layout of a plot with a measured axis on both sides: margins from the tick labels, then scales and ticks. */
|
|
128
|
+
export declare function numericPlot({ width, height, x, y, xDomain, yDomain, locale, rightGutter, }: {
|
|
129
|
+
readonly width: number;
|
|
130
|
+
readonly height: number;
|
|
131
|
+
readonly x: PlotAxis;
|
|
132
|
+
readonly y: PlotAxis;
|
|
133
|
+
/** The resolved domains: the caller's own, or the result of `fitDomain`. */
|
|
134
|
+
readonly xDomain: NumericDomain;
|
|
135
|
+
readonly yDomain: NumericDomain;
|
|
136
|
+
readonly locale: string;
|
|
137
|
+
/** Extra room right of the plot, in pixels, for labels at the end of lines. */
|
|
138
|
+
readonly rightGutter?: number | undefined;
|
|
139
|
+
}): NumericPlotLayout;
|
|
140
|
+
export type CategoryPlotLayout = {
|
|
141
|
+
readonly box: PlotBox;
|
|
142
|
+
readonly band: BandScale;
|
|
143
|
+
readonly value: ContinuousScale;
|
|
144
|
+
readonly bandTicks: ReadonlyArray<PlotTick>;
|
|
145
|
+
readonly valueTicks: ReadonlyArray<PlotTick>;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* The layout of a plot with named categories on one axis and a measured value on the other. The `columns` direction
|
|
149
|
+
* stands the categories along the bottom. The `rows` direction lists them down the side, which suits long names.
|
|
150
|
+
*/
|
|
151
|
+
export declare function categoryPlot({ width, height, direction, categories, value, valueDomain, locale, padding, topInset, rightGutter, hasValueTitle, }: {
|
|
152
|
+
readonly width: number;
|
|
153
|
+
readonly height: number;
|
|
154
|
+
readonly direction: 'columns' | 'rows';
|
|
155
|
+
readonly categories: ReadonlyArray<PlotCategory>;
|
|
156
|
+
readonly value: PlotAxis;
|
|
157
|
+
readonly valueDomain: NumericDomain;
|
|
158
|
+
readonly locale: string;
|
|
159
|
+
readonly padding?: number | undefined;
|
|
160
|
+
/** Extra room above the plot, in pixels, for notes drawn over the tallest marks. */
|
|
161
|
+
readonly topInset?: number | undefined;
|
|
162
|
+
/** Extra room right of the plot, in pixels, for labels at the end of reference lines. */
|
|
163
|
+
readonly rightGutter?: number | undefined;
|
|
164
|
+
/** False when the value axis draws no title, so its margin holds only the tick labels. */
|
|
165
|
+
readonly hasValueTitle?: boolean | undefined;
|
|
166
|
+
}): CategoryPlotLayout;
|
|
167
|
+
export type ValueGutterInput = {
|
|
168
|
+
readonly height: number;
|
|
169
|
+
/** The value axis of each plot that shares the gutter, with its resolved domain. */
|
|
170
|
+
readonly axes: ReadonlyArray<{
|
|
171
|
+
readonly axis: PlotAxis;
|
|
172
|
+
readonly domain: NumericDomain;
|
|
173
|
+
}>;
|
|
174
|
+
readonly locale: string;
|
|
175
|
+
/** True when the plots draw their value-axis titles, as `timePlot` does with `hasValueTitle`. */
|
|
176
|
+
readonly hasValueTitle?: boolean | undefined;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* The left margin that holds the value tick labels of every listed plot. Plots stacked in a column, such as small
|
|
180
|
+
* multiples, pass it to `timePlot` so their value axes line up on one gutter.
|
|
181
|
+
*/
|
|
182
|
+
export declare function valueGutter({ height, axes, locale, hasValueTitle }: ValueGutterInput): number;
|
|
183
|
+
export type TimePlotInput = {
|
|
184
|
+
readonly width: number;
|
|
185
|
+
readonly height: number;
|
|
186
|
+
readonly value: PlotAxis;
|
|
187
|
+
readonly valueDomain: NumericDomain;
|
|
188
|
+
/** The first and last instant the plot spans, in milliseconds since the epoch. */
|
|
189
|
+
readonly timeDomain: NumericDomain;
|
|
190
|
+
/** How the time axis writes its ticks. A format with a time zone puts the ticks on that zone's clock steps. */
|
|
191
|
+
readonly timeFormat: TimeFormat;
|
|
192
|
+
readonly locale: string;
|
|
193
|
+
/** Extra room above the plot, in pixels, for labels drawn along its top edge. */
|
|
194
|
+
readonly topInset?: number | undefined;
|
|
195
|
+
/** A left margin shared with other plots, from `valueGutter`. The plot never takes less. */
|
|
196
|
+
readonly gutter?: number | undefined;
|
|
197
|
+
/** True when the plot draws its value-axis title, so the margin holds it and the ticks leave the unit to it. */
|
|
198
|
+
readonly hasValueTitle?: boolean | undefined;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* The layout of a plot of values over time: elapsed time along the bottom, on round clock steps, and a measured value
|
|
202
|
+
* up the side. Its scales and ticks match `numericPlot`, so a time series and a curve placed side by side read alike.
|
|
203
|
+
*/
|
|
204
|
+
export declare function timePlot({ width, height, value, valueDomain, timeDomain, timeFormat, locale, topInset, gutter, hasValueTitle, }: TimePlotInput): NumericPlotLayout;
|
|
205
|
+
export type TimeAxisTicksInput = {
|
|
206
|
+
/** The first and last instant, in milliseconds since the epoch. */
|
|
207
|
+
readonly domain: NumericDomain;
|
|
208
|
+
/** The axis length in pixels. */
|
|
209
|
+
readonly length: number;
|
|
210
|
+
readonly timeFormat: TimeFormat;
|
|
211
|
+
readonly locale: string;
|
|
212
|
+
/** The zone whose clock steps the ticks land on, for a function format. Options formats name their own zone. */
|
|
213
|
+
readonly timeZone?: string | undefined;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* The ticks of a time axis: instants on round clock steps in the format's zone, at least three on an axis longer than
|
|
217
|
+
* 120 pixels. When two ticks would read alike, such as two midnights written "00:00", the labels gain the date, then
|
|
218
|
+
* the year, then seconds. Fields the format sets itself stay as it sets them, and a function format is used as
|
|
219
|
+
* supplied.
|
|
220
|
+
*/
|
|
221
|
+
export declare function timeAxisTicks({ domain, length, timeFormat, locale, timeZone }: TimeAxisTicksInput): AxisTicks;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
/** A solid stroke is an observation. A dashed one is modelled: a fit, a projection, a baseline or a target. */
|
|
4
|
+
export type MarkStroke = 'solid' | 'dashed';
|
|
5
|
+
/** How much a mark asks for attention: itself, gray context behind the subject, or receded while another is focused. */
|
|
6
|
+
export type MarkEmphasis = 'normal' | 'context' | 'receded';
|
|
7
|
+
/** What a pointer or the application has done to a mark. */
|
|
8
|
+
export type MarkState = {
|
|
9
|
+
readonly isInspected?: boolean | undefined;
|
|
10
|
+
readonly isSelected?: boolean | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type LineMarkProps = {
|
|
13
|
+
/** The path from `linePath`. */
|
|
14
|
+
readonly d: string;
|
|
15
|
+
readonly tone: ChartTone;
|
|
16
|
+
readonly stroke?: MarkStroke | undefined;
|
|
17
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
18
|
+
};
|
|
19
|
+
/** A line through ordered observations. Its hue names the series. */
|
|
20
|
+
export declare function LineMark({ d, tone, stroke, emphasis }: LineMarkProps): ReactNode;
|
|
21
|
+
export type AreaMarkProps = Omit<LineMarkProps, 'stroke'> & {
|
|
22
|
+
/** True for areas drawn over one another, not stacked. A pale fill under the series line keeps each visible. */
|
|
23
|
+
readonly isPale?: boolean | undefined;
|
|
24
|
+
};
|
|
25
|
+
/** A filled amount, such as a stacked area or a density. Its height carries the value. */
|
|
26
|
+
export declare function AreaMark({ d, tone, emphasis, isPale }: AreaMarkProps): ReactNode;
|
|
27
|
+
/** A pale band of uncertainty around a line: an interval, a spread across seeds or a range of runs. */
|
|
28
|
+
export declare function BandMark({ d, tone, emphasis }: Omit<LineMarkProps, 'stroke'>): ReactNode;
|
|
29
|
+
export type DotMarkProps = MarkState & {
|
|
30
|
+
readonly x: number;
|
|
31
|
+
readonly y: number;
|
|
32
|
+
readonly tone: ChartTone;
|
|
33
|
+
readonly radius?: number | undefined;
|
|
34
|
+
/** True for a value that is missing, masked or excluded: an outline with no fill. */
|
|
35
|
+
readonly isHollow?: boolean | undefined;
|
|
36
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
37
|
+
/** The record's id, written as `data-chart-mark` so a figure outside the chart can find this mark. */
|
|
38
|
+
readonly mark?: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
/** One observation at a position. */
|
|
41
|
+
export declare function DotMark({ x, y, tone, radius, isHollow, emphasis, isInspected, isSelected, mark, }: DotMarkProps): ReactNode;
|
|
42
|
+
export type BarMarkProps = MarkState & {
|
|
43
|
+
readonly x: number;
|
|
44
|
+
readonly y: number;
|
|
45
|
+
readonly width: number;
|
|
46
|
+
readonly height: number;
|
|
47
|
+
readonly tone: ChartTone;
|
|
48
|
+
readonly isHollow?: boolean | undefined;
|
|
49
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
50
|
+
/** The record's id, written as `data-chart-mark` so a figure outside the chart can find this mark. */
|
|
51
|
+
readonly mark?: string | undefined;
|
|
52
|
+
};
|
|
53
|
+
/** A rectangle whose length carries an amount from a zero baseline, or whose area fills a cell. */
|
|
54
|
+
export declare function BarMark({ x, y, width, height, tone, isHollow, emphasis, isInspected, isSelected, mark, }: BarMarkProps): ReactNode;
|
|
55
|
+
/** The outline of a symbol: a shape names a kind of record, so it never relies on hue alone. */
|
|
56
|
+
export type SymbolShape = 'circle' | 'square' | 'diamond';
|
|
57
|
+
export type SymbolMarkProps = DotMarkProps & {
|
|
58
|
+
readonly shape: SymbolShape;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* One record drawn as a circle, a square or a diamond, such as a node whose kind the shape names. A hollow symbol is
|
|
62
|
+
* missing, masked or unexplained. Use `DotMark` when every record has the same kind.
|
|
63
|
+
*/
|
|
64
|
+
export declare function SymbolMark({ shape, x, y, tone, radius, isHollow, emphasis, isInspected, isSelected, mark, }: SymbolMarkProps): ReactNode;
|
|
65
|
+
export type LinkMarkProps = {
|
|
66
|
+
/** The path from `linkPath`. */
|
|
67
|
+
readonly d: string;
|
|
68
|
+
readonly tone: ChartTone;
|
|
69
|
+
/** The stroke width in CSS pixels. A width that carries a magnitude, such as an edge weight, needs a legend. */
|
|
70
|
+
readonly width?: number | undefined;
|
|
71
|
+
readonly stroke?: MarkStroke | undefined;
|
|
72
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* A link between two marks: an edge of a graph or a branch of a tree. Gray context suits a structure; two hues around
|
|
76
|
+
* neutral suit a signed weight. Draw only links the application supplied: position never implies one.
|
|
77
|
+
*/
|
|
78
|
+
export declare function LinkMark({ d, tone, width, stroke, emphasis, }: LinkMarkProps): ReactNode;
|
|
79
|
+
export type Segment = {
|
|
80
|
+
readonly x1: number;
|
|
81
|
+
readonly y1: number;
|
|
82
|
+
readonly x2: number;
|
|
83
|
+
readonly y2: number;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* A straight guide in ink: a threshold, a target or a reference value. Dashed when the value is modelled. A tone colors
|
|
87
|
+
* a guide the legend names, such as a budget drawn in the same hue as its legend entry.
|
|
88
|
+
*/
|
|
89
|
+
export declare function RuleMark({ x1, y1, x2, y2, stroke, tone, }: Segment & {
|
|
90
|
+
readonly stroke?: MarkStroke | undefined;
|
|
91
|
+
readonly tone?: ChartTone | undefined;
|
|
92
|
+
}): ReactNode;
|
|
93
|
+
/**
|
|
94
|
+
* A faint dotted segment that carries a level from one mark to the next, such as a running total between the columns of
|
|
95
|
+
* a bridge. It claims no value of its own, so it stays lighter than a `RuleMark`.
|
|
96
|
+
*/
|
|
97
|
+
export declare function ConnectorMark({ x1, y1, x2, y2 }: Segment): ReactNode;
|
|
98
|
+
/** A segment in a series' hue: an interval between two bounds, a whisker, or the link between two paired values. */
|
|
99
|
+
export declare function IntervalMark({ x1, y1, x2, y2, tone, emphasis, }: Segment & {
|
|
100
|
+
readonly tone: ChartTone;
|
|
101
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
102
|
+
}): ReactNode;
|
|
103
|
+
export type LabelMarkProps = {
|
|
104
|
+
readonly x: number;
|
|
105
|
+
readonly y: number;
|
|
106
|
+
readonly anchor?: 'start' | 'middle' | 'end' | undefined;
|
|
107
|
+
/** The series the label names, when it sits at the end of that series' line in place of a legend entry. */
|
|
108
|
+
readonly tone?: ChartTone | undefined;
|
|
109
|
+
/** True for a label that states a total rather than a part, such as the start and end columns of a bridge. */
|
|
110
|
+
readonly isStrong?: boolean | undefined;
|
|
111
|
+
readonly children: string;
|
|
112
|
+
};
|
|
113
|
+
/** Text drawn in the plot beside the mark it names, with a halo so it stays readable over marks and grid lines. */
|
|
114
|
+
export declare function LabelMark({ x, y, anchor, tone, isStrong, children }: LabelMarkProps): ReactNode;
|
|
115
|
+
/**
|
|
116
|
+
* A faint dotted vertical guide: the position a reader inspects, a flagged period, or an event named beside it. It
|
|
117
|
+
* claims no value, so it stays lighter than a `RuleMark`.
|
|
118
|
+
*/
|
|
119
|
+
export declare function GuideMark({ x, top, bottom, }: {
|
|
120
|
+
readonly x: number;
|
|
121
|
+
readonly top: number;
|
|
122
|
+
readonly bottom: number;
|
|
123
|
+
}): ReactNode;
|
|
124
|
+
/** A ring in ink that points out one spot on a line: an annotated observation, or where the line reaches a value. */
|
|
125
|
+
export declare function RingMark({ x, y }: {
|
|
126
|
+
readonly x: number;
|
|
127
|
+
readonly y: number;
|
|
128
|
+
}): ReactNode;
|