@mechane-ai/elements 0.45.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +353 -50
- package/bin/mechane-elements-catalog.mjs +42 -4
- package/dist/ai.js +268 -202
- package/dist/catalog.json +2480 -71
- package/dist/categorical-values-DdfGIowV.js +107 -0
- package/dist/cells--Bd1fQFR.js +384 -0
- package/dist/chart-cursor-1mFd48Jc.js +23 -0
- package/dist/chart-link-AE_xuxiP.js +35 -0
- package/dist/chart-tones-ei3BC2AL.js +27 -0
- package/dist/charts/cartesian.js +1 -2792
- package/dist/charts/cells.js +1 -0
- package/dist/charts/comparison.js +1 -0
- package/dist/charts/distribution.js +1 -709
- package/dist/charts/figure.js +3404 -0
- package/dist/charts/graph.js +1 -641
- package/dist/charts/hierarchy.js +1 -112
- package/dist/charts/image.js +1 -0
- package/dist/charts/matrix.js +3 -637
- package/dist/charts/plot.js +15 -0
- package/dist/charts/relationship.js +1 -0
- package/dist/charts/text.js +1 -0
- package/dist/charts/timeline.js +1 -233
- package/dist/charts/transforms.js +677 -0
- package/dist/charts/trend.js +1 -0
- package/dist/charts.js +8 -3
- package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
- package/dist/collections.js +1 -1735
- package/dist/color-legend-CIo7DhXB.js +62 -0
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +67 -66
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/csp.js +6 -11
- package/dist/dates-Cww8UR_n.js +810 -0
- package/dist/dumbbell-plot-B2ZTgQaI.js +508 -0
- package/dist/embedding-map-CGM_k6lC.js +1929 -0
- package/dist/feedback.js +1 -1
- package/dist/figure-format-B8kRZMlo.js +36 -0
- package/dist/figure-frame-wRkIEAwe.js +270 -0
- package/dist/forms/dates.js +1 -750
- package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
- package/dist/forms.js +3 -3
- package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
- package/dist/image-grid-CVA4SOy_.js +598 -0
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +431 -0
- package/dist/kits/explainers.js +452 -0
- package/dist/kits/interpretability.js +1033 -0
- package/dist/kits/operations.js +239 -0
- package/dist/kits/training.js +335 -0
- package/dist/label-place-Z0fryBZb.js +42 -0
- package/dist/layout.js +207 -207
- package/dist/locate-Bcg3QcP4.js +11 -0
- package/dist/navigation.js +4 -3
- package/dist/packages/ai/src/conversation.d.ts +2 -0
- package/dist/packages/ai/src/prompt-input.d.ts +7 -2
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
- package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
- package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
- package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
- package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
- package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
- package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
- package/dist/packages/charts/src/cartesian/index.d.ts +6 -5
- package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +37 -26
- package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
- package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
- package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
- package/dist/packages/charts/src/cartesian/time-series.d.ts +61 -27
- package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
- package/dist/packages/charts/src/categorical-values.d.ts +15 -10
- package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
- package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
- package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
- package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
- package/dist/packages/charts/src/cells/index.d.ts +11 -0
- package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
- package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
- package/dist/packages/charts/src/chart-frame.d.ts +17 -12
- package/dist/packages/charts/src/chart-grid.d.ts +19 -0
- package/dist/packages/charts/src/chart-input.d.ts +1 -9
- package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
- package/dist/packages/charts/src/chart-link.d.ts +56 -0
- package/dist/packages/charts/src/chart-range.d.ts +33 -0
- package/dist/packages/charts/src/chart-rows.d.ts +20 -0
- package/dist/packages/charts/src/chart-theme.d.ts +17 -0
- package/dist/packages/charts/src/chart.d.ts +73 -0
- package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
- package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
- package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
- package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
- package/dist/packages/charts/src/comparison/index.d.ts +6 -0
- package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
- package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
- package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
- package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
- package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
- package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
- package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
- package/dist/packages/charts/src/distribution/index.d.ts +11 -0
- package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
- package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
- package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
- package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
- package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
- package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
- package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
- package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
- package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
- package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
- package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
- package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
- package/dist/packages/charts/src/graph/index.d.ts +6 -2
- package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
- package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
- package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
- package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
- package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
- package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
- package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
- package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
- package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
- package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
- package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
- package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
- package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
- package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
- package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
- package/dist/packages/charts/src/image/image-input.d.ts +27 -0
- package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
- package/dist/packages/charts/src/image/index.d.ts +7 -0
- package/dist/packages/charts/src/index.d.ts +16 -1
- package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
- package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
- package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
- package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
- package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
- package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
- package/dist/packages/charts/src/matrix/index.d.ts +14 -3
- package/dist/packages/charts/src/matrix/matrix-cells.d.ts +27 -3
- package/dist/packages/charts/src/matrix/matrix-figure.d.ts +50 -0
- package/dist/packages/charts/src/matrix/matrix-mark.d.ts +34 -0
- package/dist/packages/charts/src/matrix/matrix-presets.d.ts +20 -0
- package/dist/packages/charts/src/matrix/matrix-range.d.ts +45 -0
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +13 -14
- package/dist/packages/charts/src/matrix/matrix-types.d.ts +40 -0
- package/dist/packages/charts/src/matrix/matrix.d.ts +13 -11
- package/dist/packages/charts/src/matrix/token-heatmap.d.ts +16 -10
- package/dist/packages/charts/src/plot/contours.d.ts +45 -0
- package/dist/packages/charts/src/plot/index.d.ts +49 -0
- package/dist/packages/charts/src/plot/label-place.d.ts +35 -0
- package/dist/packages/charts/src/plot/locate.d.ts +18 -0
- package/dist/packages/charts/src/plot/path.d.ts +39 -0
- package/dist/packages/charts/src/plot/plot-axes.d.ts +20 -0
- package/dist/packages/charts/src/plot/plot-layout.d.ts +221 -0
- package/dist/packages/charts/src/plot/plot-marks.d.ts +124 -0
- package/dist/packages/charts/src/plot/plot-surface.d.ts +32 -0
- package/dist/packages/charts/src/plot/render/density-layer.d.ts +17 -0
- package/dist/packages/charts/src/plot/render/hit-index.d.ts +37 -0
- package/dist/packages/charts/src/plot/render/plot-viewport.d.ts +39 -0
- package/dist/packages/charts/src/plot/render/point-layer.d.ts +41 -0
- package/dist/packages/charts/src/plot/render/theme-colors.d.ts +15 -0
- package/dist/packages/charts/src/plot/scale.d.ts +48 -0
- package/dist/packages/charts/src/plot/ticks.d.ts +34 -0
- package/dist/packages/charts/src/plot-width.d.ts +3 -3
- package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
- package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
- package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
- package/dist/packages/charts/src/relationship/index.d.ts +11 -0
- package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
- package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
- package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
- package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
- package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
- package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
- package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
- package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
- package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
- package/dist/packages/charts/src/spec/figure.d.ts +12 -0
- package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
- package/dist/packages/charts/src/spec/index.d.ts +10 -0
- package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
- package/dist/packages/charts/src/text/index.d.ts +11 -0
- package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
- package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
- package/dist/packages/charts/src/text/token-links.d.ts +49 -0
- package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
- package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
- package/dist/packages/charts/src/text/token-text.d.ts +39 -0
- package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
- package/dist/packages/charts/src/timeline/index.d.ts +3 -1
- package/dist/packages/charts/src/timeline/waterfall.d.ts +29 -14
- package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
- package/dist/packages/charts/src/transforms/density.d.ts +53 -0
- package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
- package/dist/packages/charts/src/transforms/index.d.ts +19 -0
- package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
- package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
- package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
- package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
- package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
- package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
- package/dist/packages/charts/src/transforms/values.d.ts +70 -0
- package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
- package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
- package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
- package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
- package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
- package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
- package/dist/packages/charts/src/trend/index.d.ts +10 -0
- package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
- package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
- package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
- package/dist/packages/collections/src/collection-controls.d.ts +5 -1
- package/dist/packages/collections/src/collection-filters.d.ts +4 -1
- package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
- package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
- package/dist/packages/collections/src/data-table-text.d.ts +13 -0
- package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
- package/dist/packages/collections/src/data-table.d.ts +3 -85
- package/dist/packages/collections/src/index.d.ts +11 -6
- package/dist/packages/collections/src/query-controls.d.ts +6 -2
- package/dist/packages/collections/src/table-results.d.ts +47 -13
- package/dist/packages/collections/src/timeline.d.ts +1 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
- package/dist/packages/collections/src/use-table-window.d.ts +25 -0
- package/dist/packages/content/src/viewer.d.ts +8 -0
- package/dist/packages/core/src/disclosure.d.ts +9 -1
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/route-link.d.ts +11 -0
- package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
- package/dist/packages/forms/src/file-picker.d.ts +15 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -6
- package/dist/packages/forms/src/forms.d.ts +4 -1
- package/dist/packages/forms/src/index.d.ts +4 -2
- package/dist/packages/forms/src/selection.d.ts +14 -0
- package/dist/packages/foundations/src/csp/index.d.ts +1 -1
- package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
- package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
- package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
- package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
- package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
- package/dist/packages/kits/src/explainers/bound-value.d.ts +29 -0
- package/dist/packages/kits/src/explainers/figures.d.ts +31 -0
- package/dist/packages/kits/src/explainers/index.d.ts +8 -0
- package/dist/packages/kits/src/explainers/linked-target.d.ts +22 -0
- package/dist/packages/kits/src/explainers/story-steps.d.ts +46 -0
- package/dist/packages/kits/src/explainers/term.d.ts +29 -0
- package/dist/packages/kits/src/interpretability/attention-head-grid.d.ts +56 -0
- package/dist/packages/kits/src/interpretability/attribution-workbench.d.ts +29 -0
- package/dist/packages/kits/src/interpretability/embedding-atlas.d.ts +41 -0
- package/dist/packages/kits/src/interpretability/feature-card.d.ts +33 -0
- package/dist/packages/kits/src/interpretability/feature-list.d.ts +51 -0
- package/dist/packages/kits/src/interpretability/feature-logits.d.ts +23 -0
- package/dist/packages/kits/src/interpretability/features.d.ts +70 -0
- package/dist/packages/kits/src/interpretability/index.d.ts +16 -0
- package/dist/packages/kits/src/interpretability/kit-styles.d.ts +118 -0
- package/dist/packages/kits/src/interpretability/logit-lens.d.ts +50 -0
- package/dist/packages/kits/src/interpretability/node-panel.d.ts +32 -0
- package/dist/packages/kits/src/interpretability/shared-link.d.ts +8 -0
- package/dist/packages/kits/src/interpretability/steering-panel.d.ts +52 -0
- package/dist/packages/kits/src/operations/budget-board.d.ts +49 -0
- package/dist/packages/kits/src/operations/incident-timeline.d.ts +30 -0
- package/dist/packages/kits/src/operations/index.d.ts +6 -0
- package/dist/packages/kits/src/operations/service-health.d.ts +66 -0
- package/dist/packages/kits/src/training/index.d.ts +8 -0
- package/dist/packages/kits/src/training/run-dashboard.d.ts +49 -0
- package/dist/packages/kits/src/training/run-legend.d.ts +21 -0
- package/dist/packages/kits/src/training/run-marker.d.ts +5 -0
- package/dist/packages/kits/src/training/run-state.d.ts +7 -0
- package/dist/packages/kits/src/training/run-table.d.ts +63 -0
- package/dist/packages/kits/src/training/runs-overview.d.ts +20 -0
- package/dist/packages/kits/src/training/runs.d.ts +34 -0
- package/dist/packages/navigation/src/index.d.ts +1 -1
- package/dist/path-BglsXpnO.js +59 -0
- package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
- package/dist/plot-axes-DJkLW4wk.js +100 -0
- package/dist/plot-layout-BEuoOHbs.js +911 -0
- package/dist/plot-marks-A64v7aTw.js +226 -0
- package/dist/plot-surface-CJTIqtck.js +51 -0
- package/dist/{plot-width-CIqBiHcd.js → plot-width-DcqtSgzb.js} +22 -3
- package/dist/point-layer-C-EYETAt.js +655 -0
- package/dist/reference-lines-CWA8VeUR.js +82 -0
- package/dist/scale-C2xgZyZN.js +63 -0
- package/dist/slope-chart-DT22h_ym.js +1279 -0
- package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
- package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
- package/dist/{src-Dcs3SZ9V.js → src-CExIrXPC.js} +170 -194
- package/dist/src-CGc_hjxJ.js +409 -0
- package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
- package/dist/src-D5NXRJZe.js +2195 -0
- package/dist/src-DIS0YOj0.js +44 -0
- package/dist/styles2.css +574 -161
- package/dist/time-series-IB3CB93O.js +2668 -0
- package/dist/token-heatmap-C00DnoNO.js +1354 -0
- package/dist/token-predictions-Cxx29iDr.js +1093 -0
- package/dist/tone-scope-DKiSw-JR.js +32 -0
- package/dist/tree-diagram-DsckNKaW.js +1629 -0
- package/dist/treemap-9_DpLCW9.js +472 -0
- package/dist/values-963L6n1m.js +65 -0
- package/dist/violin-plot-BhPHKXsN.js +1291 -0
- package/dist/waterfall-CGksuTy5.js +576 -0
- package/package.json +57 -7
- package/recipes/allocation-report.tsx +15 -7
- package/skills/extend-elements/SKILL.md +134 -0
- package/skills/review-elements/SKILL.md +118 -0
- package/skills/upgrade-elements/SKILL.md +36 -0
- package/skills/upgrade-elements/references/releases.md +242 -0
- package/skills/use-elements/SKILL.md +70 -13
- package/skills/use-elements/references/agent.md +57 -0
- package/skills/use-elements/references/charts.md +384 -0
- package/skills/use-elements/references/collections.md +89 -0
- package/skills/use-elements/references/conversations.md +47 -0
- package/skills/use-elements/references/figures.md +173 -0
- package/skills/use-elements/references/forms.md +81 -0
- package/skills/use-elements/references/kits.md +198 -0
- package/skills/use-elements/references/styling.md +70 -0
- package/skills/use-elements/references/workspace.md +3 -3
- package/dist/categorical-values-DZLGQVW1.js +0 -63
- package/dist/chart-frame-Ztktqs1b.js +0 -255
- package/dist/chart-input-BO3BqlFO.js +0 -22
- package/dist/chart-navigation-BAbb5PV9.js +0 -154
- package/dist/header-styles-COxCYFZx.js +0 -90
- package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
- package/dist/packages/charts/src/chart-surface.d.ts +0 -27
- package/dist/packages/navigation/src/route-link.d.ts +0 -2
- package/dist/src-Bk7M67zy.js +0 -396
|
@@ -18,18 +18,20 @@ type LaneInput = {
|
|
|
18
18
|
};
|
|
19
19
|
/** Places each label beside its guide in the first lane where it fits, flipping before the plot's right edge. */
|
|
20
20
|
export declare function placeInstants({ instants, x, right }: LaneInput): ReadonlyArray<PlacedInstant>;
|
|
21
|
-
|
|
21
|
+
/** The room the instants' label lanes take above the plot. */
|
|
22
|
+
export declare function instantsInset(placed: ReadonlyArray<PlacedInstant>): number;
|
|
22
23
|
type Scales = {
|
|
23
24
|
readonly x: (timestamp: number) => number;
|
|
24
25
|
readonly y: (value: number) => number;
|
|
25
26
|
};
|
|
26
|
-
/** Shades each band between its bounds
|
|
27
|
+
/** Shades each band between its bounds and draws its center line over the shade. */
|
|
27
28
|
export declare function TimeSeriesBands({ bands, x, y }: Scales & {
|
|
28
29
|
readonly bands: ReadonlyArray<PlotBand>;
|
|
29
30
|
}): ReactNode;
|
|
30
|
-
/** Draws each instant's guide from its label lane to the axis, with a ring where a crossing lands. */
|
|
31
|
-
export declare function TimeInstants({ placed, x, y, bottom, }: Scales & {
|
|
31
|
+
/** Draws each instant's guide from its label lane above the plot to the axis, with a ring where a crossing lands. */
|
|
32
|
+
export declare function TimeInstants({ placed, x, y, top, bottom, }: Scales & {
|
|
32
33
|
readonly placed: ReadonlyArray<PlacedInstant>;
|
|
34
|
+
readonly top: number;
|
|
33
35
|
readonly bottom: number;
|
|
34
36
|
}): ReactNode;
|
|
35
37
|
export {};
|
|
@@ -1,49 +1,83 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ChartRangeDetails, ChartRangeValue } from '../chart-range.tsx';
|
|
3
|
+
import type { TimeFormat, ValueFormat } from '../figure/figure-format.ts';
|
|
4
|
+
import type { FigureFrameInput, SeriesFigureProps } from '../figure/figure-props.ts';
|
|
5
|
+
import type { PlotHeight } from '../plot/plot-layout.ts';
|
|
3
6
|
import type { TimeSeriesBand, TimeSeriesCrossing } from './time-series-bands.ts';
|
|
4
7
|
import type { TimeSeries, TimeSeriesMarker } from './time-series-data.ts';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/** The unit of the supplied timestamps. Formats always receive milliseconds. */
|
|
9
|
+
export type TimestampUnit = 'seconds' | 'milliseconds';
|
|
10
|
+
/**
|
|
11
|
+
* A line chart of measures over time. The series share their observation timestamps; a null value is a gap. Formats
|
|
12
|
+
* write the values and instants in the figure's locale.
|
|
13
|
+
*/
|
|
14
|
+
export type TimeSeriesChartProps = SeriesFigureProps & {
|
|
8
15
|
readonly series: ReadonlyArray<TimeSeries>;
|
|
9
|
-
readonly timestampUnit:
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
|
|
16
|
+
readonly timestampUnit: TimestampUnit;
|
|
17
|
+
/** How readouts, tables and the time axis write an instant. */
|
|
18
|
+
readonly timeFormat: TimeFormat;
|
|
19
|
+
/** How readouts and tables write a value. */
|
|
20
|
+
readonly valueFormat: ValueFormat;
|
|
21
|
+
/** How the value axis writes its ticks. Absent uses the compact form of `valueFormat`. */
|
|
22
|
+
readonly tickFormat?: ValueFormat | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The value axis title, with its unit: "Latency (ms)". With a title the ticks leave a `unit` style out, so the unit
|
|
25
|
+
* is written once. Absent draws no title and keeps the unit in every tick.
|
|
26
|
+
*/
|
|
27
|
+
readonly valueLabel?: string | undefined;
|
|
13
28
|
readonly markers?: ReadonlyArray<TimeSeriesMarker> | undefined;
|
|
14
|
-
readonly height?:
|
|
15
|
-
readonly actions?: ReactNode;
|
|
16
|
-
readonly report?: ChartSeriesReport | undefined;
|
|
29
|
+
readonly height?: PlotHeight | undefined;
|
|
17
30
|
/** Shaded ranges with optional center lines, drawn beneath the line series and listed in the legend. */
|
|
18
31
|
readonly bands?: ReadonlyArray<TimeSeriesBand> | undefined;
|
|
19
32
|
/** Where a series or band center first reaches a value. A crossing that never happens is listed as not reached. */
|
|
20
33
|
readonly crossings?: ReadonlyArray<TimeSeriesCrossing> | undefined;
|
|
34
|
+
/** The selected time range, in the timestamps' unit. The application owns it, for example to filter another view. */
|
|
35
|
+
readonly range?: ChartRangeValue | null | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Lets a reader select a range of time by dragging on the plot, with the keyboard, or with the buttons below it.
|
|
38
|
+
* Requires `rangeStep`.
|
|
39
|
+
*/
|
|
40
|
+
readonly onRangeChange?: ((range: ChartRangeValue | null, details: ChartRangeDetails) => void) | undefined;
|
|
41
|
+
/** What each end of the range snaps to and what an arrow key moves it by, in the timestamps' unit. */
|
|
42
|
+
readonly rangeStep?: number | undefined;
|
|
21
43
|
};
|
|
44
|
+
/** A filled area chart over time. Stacked areas add up supplied nonnegative values from zero. */
|
|
22
45
|
export type AreaChartProps = TimeSeriesChartProps & {
|
|
23
46
|
readonly isStacked?: boolean | undefined;
|
|
24
47
|
};
|
|
25
|
-
|
|
48
|
+
/** The frame of a time-series chart before its first read, with the series it will draw. */
|
|
49
|
+
export type TimeSeriesChartPlaceholderProps = Omit<FigureFrameInput, 'status'> & {
|
|
26
50
|
readonly series: ReadonlyArray<Pick<TimeSeries, 'id' | 'label' | 'tone'>>;
|
|
51
|
+
readonly height?: PlotHeight | undefined;
|
|
27
52
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}>;
|
|
53
|
+
/**
|
|
54
|
+
* One panel of small multiples: its own frame, series, value format, axis title, markers and pale uncertainty bands
|
|
55
|
+
* (the same `TimeSeriesBand` shape a line chart takes).
|
|
56
|
+
*/
|
|
57
|
+
export type SmallMultiplesPanel = Omit<SeriesFigureProps, 'locale' | 'status'> & Pick<TimeSeriesChartProps, 'series' | 'valueFormat' | 'tickFormat' | 'valueLabel' | 'markers' | 'bands'> & {
|
|
58
|
+
readonly id: string;
|
|
59
|
+
};
|
|
60
|
+
/** Panels that share observation timestamps, the time axis and one inspected timestamp. */
|
|
61
|
+
export type SmallMultiplesProps = Pick<TimeSeriesChartProps, 'timestampUnit' | 'timeFormat' | 'height' | 'locale' | 'status'> & {
|
|
62
|
+
readonly charts: ReadonlyArray<SmallMultiplesPanel>;
|
|
39
63
|
};
|
|
40
|
-
|
|
41
|
-
|
|
64
|
+
/** The panels of small multiples before their first read, at the same height. */
|
|
65
|
+
export type SmallMultiplesPlaceholderProps = Pick<SmallMultiplesProps, 'height' | 'locale'> & {
|
|
66
|
+
readonly charts: ReadonlyArray<Omit<TimeSeriesChartPlaceholderProps, 'locale' | 'height'> & {
|
|
42
67
|
readonly id: string;
|
|
43
68
|
}>;
|
|
44
69
|
};
|
|
70
|
+
/** Measures over elapsed time, with gaps, markers, bands, crossings and an optional selected range. */
|
|
45
71
|
export declare function LineChart(props: TimeSeriesChartProps): ReactNode;
|
|
72
|
+
/** Magnitudes over elapsed time, filled from zero, or stacked when the supplied values add up. */
|
|
46
73
|
export declare function AreaChart({ isStacked, ...props }: AreaChartProps): ReactNode;
|
|
74
|
+
/** Holds a time-series chart's frame, legend and height while its first read is under way. */
|
|
47
75
|
export declare function TimeSeriesChartPlaceholder(props: TimeSeriesChartPlaceholderProps): ReactNode;
|
|
48
|
-
|
|
49
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Measures compared on the same observation timestamps, one panel each, with independent value scales and units. The
|
|
78
|
+
* panels share one value gutter and the time axis under the last panel. One inspected timestamp guides every panel; the
|
|
79
|
+
* panel the reader inspects shows the readout.
|
|
80
|
+
*/
|
|
81
|
+
export declare function SmallMultiples({ charts, timestampUnit, timeFormat, height, locale, status, }: SmallMultiplesProps): ReactNode;
|
|
82
|
+
/** Holds the panels of small multiples, their summaries and the bottom time axis while the first read is under way. */
|
|
83
|
+
export declare function SmallMultiplesPlaceholder({ charts, height, locale }: SmallMultiplesPlaceholderProps): ReactNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** A text label placed in a plot, with the position its text is centered on. */
|
|
2
|
+
export type PlacedLabel = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly text: string;
|
|
5
|
+
readonly x: number;
|
|
6
|
+
readonly y: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The labels that fit without touching, in priority order: a label stays only when it clears every label ranked before
|
|
10
|
+
* it. A label left out keeps its text in the readout and the exact-value table, so thinning never hides a value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function clearLabels<Label extends PlacedLabel>(byPriority: ReadonlyArray<Label>): ReadonlyArray<Label>;
|
|
13
|
+
/** Where a centered label sits so it stays between two bounds, and which end it is anchored to there. */
|
|
14
|
+
export declare function labelInside({ x, text, left, right, }: {
|
|
15
|
+
readonly x: number;
|
|
16
|
+
readonly text: string;
|
|
17
|
+
readonly left: number;
|
|
18
|
+
readonly right: number;
|
|
19
|
+
}): {
|
|
20
|
+
readonly x: number;
|
|
21
|
+
readonly anchor: 'start' | 'middle' | 'end';
|
|
22
|
+
};
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChartItem, ChartView } from './chart.tsx';
|
|
4
4
|
export type BreakdownItem = {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly label: string;
|
|
7
7
|
readonly value: number | null;
|
|
8
8
|
readonly tone?: ChartTone | undefined;
|
|
9
9
|
};
|
|
10
|
+
/** The most categories, steps or parts, and the most series, a bar, bridge, breakdown or treemap chart draws. */
|
|
10
11
|
export declare const categoricalLimits: {
|
|
11
12
|
readonly items: 200;
|
|
12
13
|
readonly series: 12;
|
|
13
14
|
};
|
|
14
|
-
export declare function colorTone(tone: ChartTone | undefined, index: number): ChartTone;
|
|
15
15
|
export declare function validateBreakdown(items: ReadonlyArray<BreakdownItem>): string | undefined;
|
|
16
|
-
export
|
|
17
|
-
readonly
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
export type CategoricalValue = {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly label: string;
|
|
19
|
+
readonly valueLabel: string;
|
|
20
|
+
readonly tone: ChartTone;
|
|
21
|
+
};
|
|
22
|
+
/** What a chart of categorical values tells its readers and agents about each item. */
|
|
23
|
+
export declare function categoricalItems(items: ReadonlyArray<CategoricalValue>): ReadonlyArray<ChartItem>;
|
|
24
|
+
export declare function CategoricalValues({ title, items, view, }: {
|
|
25
|
+
readonly title: string;
|
|
26
|
+
readonly items: ReadonlyArray<CategoricalValue>;
|
|
27
|
+
/** The chart's view when its rows can be selected. */
|
|
28
|
+
readonly view: ChartView | undefined;
|
|
24
29
|
}): ReactNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CellDomainProps, CellProps, CellToneProps } from './cell-layout.tsx';
|
|
3
|
+
export type BarCellProps = CellProps & CellDomainProps & CellToneProps & {
|
|
4
|
+
/** The amount, or null for a value that was not recorded. */
|
|
5
|
+
readonly value: number | null;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A bar from zero to the value with the exact value written beside it, for a table column of amounts compared by
|
|
9
|
+
* length, such as accuracy or cost. Pass the column's `domain` to every row so all bars share one scale, and make it
|
|
10
|
+
* include zero. A negative value reaches left of the zero line, and a missing value shows "Unavailable" and no bar,
|
|
11
|
+
* never an empty bar.
|
|
12
|
+
*/
|
|
13
|
+
export declare function BarCell({ value, domain, locale, format, align, textWidth, id, tone }: BarCellProps): ReactNode;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
4
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
5
|
+
/** Which edge of its cell the exact value hugs. Numbers read best at the end, where the digits line up. */
|
|
6
|
+
export type CellAlign = 'start' | 'end';
|
|
7
|
+
/**
|
|
8
|
+
* What every table cell graphic takes, with the value always written beside the graphic so the graphic is never the
|
|
9
|
+
* only carrier of the number. A cell takes a declared `format` and an explicit `locale`, as contract 072 allows for
|
|
10
|
+
* shared display components, rather than already formatted text. One pattern keeps the missing text, the signs and the
|
|
11
|
+
* units the same in all five cells, and the props stay plain data that a figure spec can name.
|
|
12
|
+
*/
|
|
13
|
+
export type CellProps = {
|
|
14
|
+
/** The locale of every number in the cell. It is an input, so a server and a browser render alike. */
|
|
15
|
+
readonly locale: string;
|
|
16
|
+
/** How the value is written. The same format is used in every row of a column. */
|
|
17
|
+
readonly format: ValueFormat;
|
|
18
|
+
/** Which edge of the cell the text hugs. Defaults to the end. */
|
|
19
|
+
readonly align?: CellAlign | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The width kept for the text, in characters. Rows of one column should keep the same width, so graphics start at the
|
|
22
|
+
* same place and share one scale by eye. Each cell has a default that fits its usual text.
|
|
23
|
+
*/
|
|
24
|
+
readonly textWidth?: number | undefined;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* What a cell needs to be drawn on its column's scale. A cell cannot see its column, so the application passes the same
|
|
28
|
+
* `domain` to every row. A value outside it is refused, never clamped.
|
|
29
|
+
*/
|
|
30
|
+
export type CellDomainProps = {
|
|
31
|
+
readonly domain: NumericDomain;
|
|
32
|
+
};
|
|
33
|
+
/** The hue of a cell's mark. */
|
|
34
|
+
export type CellToneProps = {
|
|
35
|
+
/** The thing this row shows, such as a model. With a tone scope, one thing keeps one hue across figures and cells. */
|
|
36
|
+
readonly id?: string | undefined;
|
|
37
|
+
/** Sets the hue directly, beating the scope. Absent takes the scope's hue for `id`, then the first series hue. */
|
|
38
|
+
readonly tone?: ChartTone | undefined;
|
|
39
|
+
};
|
|
40
|
+
type CellState = 'value' | 'missing' | 'invalid';
|
|
41
|
+
export type CellLayoutProps = {
|
|
42
|
+
readonly align?: CellAlign | undefined;
|
|
43
|
+
readonly textWidth?: number | undefined;
|
|
44
|
+
/** The graphic beside the text, built with `CellGraphic`. Absent draws text only. */
|
|
45
|
+
readonly graphic?: ReactNode;
|
|
46
|
+
/** `missing` and `invalid` mute or flag the text. */
|
|
47
|
+
readonly state?: CellState | undefined;
|
|
48
|
+
/** The reason for an invalid cell, shown on hover. */
|
|
49
|
+
readonly title?: string | undefined;
|
|
50
|
+
/** Fills the text's box with this color, as a heat cell does. The text stays ink, so the color must stay legible. */
|
|
51
|
+
readonly background?: string | undefined;
|
|
52
|
+
/** The exact value as text. */
|
|
53
|
+
readonly children: ReactNode;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* One text line: a graphic and the exact value beside it, in tabular numerals. The graphic is hidden from assistive
|
|
57
|
+
* tech.
|
|
58
|
+
*/
|
|
59
|
+
export declare function CellLayout({ align, textWidth, graphic, state, title, background, children, }: CellLayoutProps): ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* The fluid drawing area of a cell: one line tall, as wide as the cell leaves it. It measures itself and hands the
|
|
62
|
+
* pixel width to `children`, which returns the marks.
|
|
63
|
+
*/
|
|
64
|
+
export declare function CellGraphic({ children }: {
|
|
65
|
+
readonly children: (width: number) => ReactNode;
|
|
66
|
+
}): ReactNode;
|
|
67
|
+
/** The height of the drawing area, for marks that center on the line. */
|
|
68
|
+
export declare const cellHeight = 16;
|
|
69
|
+
/** Why the column domain or a value cannot be drawn, or undefined when all can. Missing (null) values are allowed. */
|
|
70
|
+
export declare function cellProblem({ domain, values, }: {
|
|
71
|
+
/** The column domain. Absent for a cell with no scale, which then only needs finite values. */
|
|
72
|
+
readonly domain?: NumericDomain | undefined;
|
|
73
|
+
readonly values: ReadonlyArray<number | null>;
|
|
74
|
+
}): string | undefined;
|
|
75
|
+
/** The cell shown in place of a graphic that cannot be drawn. It names the reason on hover and never repairs input. */
|
|
76
|
+
export declare function InvalidCell({ message, align, textWidth, }: Pick<CellLayoutProps, 'align' | 'textWidth'> & {
|
|
77
|
+
readonly message: string;
|
|
78
|
+
}): ReactNode;
|
|
79
|
+
/** The hue of a cell's mark: its own tone, then the tone scope's hue for its id, then the first series hue. */
|
|
80
|
+
export declare function useCellTone({ id, tone }: CellToneProps): ChartTone;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CellProps } from './cell-layout.tsx';
|
|
3
|
+
/** What a rise means for the reader: an improvement, a regression, or nothing either way. */
|
|
4
|
+
export type ChangeMeaning = 'good' | 'bad' | 'neutral';
|
|
5
|
+
export type ChangeCellProps = CellProps & {
|
|
6
|
+
/** The signed change, or null for a change that could not be computed. */
|
|
7
|
+
readonly value: number | null;
|
|
8
|
+
/** What an increase means. A drop in latency is good and a drop in accuracy is bad, so the cell never assumes. */
|
|
9
|
+
readonly positiveIs: ChangeMeaning;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A signed change with an arrow and a tone, such as a score against the last release, or "Unavailable" with no arrow
|
|
13
|
+
* when the change is missing. The text carries the sign and number so the arrow and color never stand alone, and a
|
|
14
|
+
* function format must write the sign while an options format shows it. Up is not always good, so `positiveIs` says
|
|
15
|
+
* what a rise means: a good change takes the positive hue, a bad one the negative, a neutral or absent one gray.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ChangeCell({ value, positiveIs, locale, format, align, textWidth, }: ChangeCellProps): ReactNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { HeatmapScale } from '../matrix/heatmap-scale.ts';
|
|
3
|
+
import type { CellDomainProps, CellProps } from './cell-layout.tsx';
|
|
4
|
+
export type HeatCellProps = CellProps & CellDomainProps & {
|
|
5
|
+
/** The amount, or null for a value that was not recorded. */
|
|
6
|
+
readonly value: number | null;
|
|
7
|
+
/**
|
|
8
|
+
* `sequential` is one hue that deepens with the value. `diverging` is two hues around a neutral zero, and its
|
|
9
|
+
* domain must hold a negative and a positive bound.
|
|
10
|
+
*/
|
|
11
|
+
readonly palette: HeatmapScale['palette'];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The value written as text on a background whose strength follows it, so color is never the only carrier, with
|
|
15
|
+
* "Unavailable" and no fill when missing. Use it in a table column where readers scan for high and low rows, such as a
|
|
16
|
+
* score per task. Pass the column's `domain` and `palette` to every row so all rows share one ramp, lighter than the
|
|
17
|
+
* `Matrix` heatmap so the ink text stays readable in both themes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function HeatCell({ value, domain, palette, locale, format, align, textWidth }: HeatCellProps): ReactNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { BarCellProps } from './bar-cell.tsx';
|
|
2
|
+
export { BarCell } from './bar-cell.tsx';
|
|
3
|
+
export type { CellAlign, CellDomainProps, CellProps, CellToneProps } from './cell-layout.tsx';
|
|
4
|
+
export type { ChangeCellProps, ChangeMeaning } from './change-cell.tsx';
|
|
5
|
+
export { ChangeCell } from './change-cell.tsx';
|
|
6
|
+
export type { HeatCellProps } from './heat-cell.tsx';
|
|
7
|
+
export { HeatCell } from './heat-cell.tsx';
|
|
8
|
+
export type { IntervalCellProps } from './interval-cell.tsx';
|
|
9
|
+
export { IntervalCell } from './interval-cell.tsx';
|
|
10
|
+
export type { SparkCellProps } from './spark-cell.tsx';
|
|
11
|
+
export { SparkCell, sparkCellLimits } from './spark-cell.tsx';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CellDomainProps, CellProps, CellToneProps } from './cell-layout.tsx';
|
|
3
|
+
export type IntervalCellProps = CellProps & CellDomainProps & CellToneProps & {
|
|
4
|
+
/** The estimate, or null for a value that was not recorded. */
|
|
5
|
+
readonly value: number | null;
|
|
6
|
+
/** The lower and upper bound around the estimate, or null when none was computed. */
|
|
7
|
+
readonly interval?: readonly [lower: number, upper: number] | null | undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* An estimate dot with an interval line, and the estimate and its range written beside it, or "Unavailable" and no mark
|
|
11
|
+
* when the estimate is missing. In a table column of estimates with uncertainty, such as an accuracy with a confidence
|
|
12
|
+
* interval, pass the column's `domain` to every row so all intervals share one scale. The application supplies the
|
|
13
|
+
* bounds, and the cell checks that the lower bound is not above the estimate and the upper bound not below it, and
|
|
14
|
+
* never reorders them.
|
|
15
|
+
*/
|
|
16
|
+
export declare function IntervalCell({ value, interval, domain, locale, format, align, textWidth, id, tone, }: IntervalCellProps): ReactNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CellDomainProps, CellProps, CellToneProps } from './cell-layout.tsx';
|
|
3
|
+
export type SparkCellProps = CellProps & CellDomainProps & CellToneProps & {
|
|
4
|
+
/** Observations in order, equally spaced. A null is a gap: the line breaks there and is never drawn through it. */
|
|
5
|
+
readonly points: ReadonlyArray<number | null>;
|
|
6
|
+
/**
|
|
7
|
+
* Which observation the dot marks and the text writes: `last`, the most recent one, or `peak`, the highest recorded
|
|
8
|
+
* one (the first, when several tie), such as a best score. Absent means last.
|
|
9
|
+
*/
|
|
10
|
+
readonly label?: 'last' | 'peak' | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** The most observations a spark cell draws. A longer series is refused. */
|
|
13
|
+
export declare const sparkCellLimits: {
|
|
14
|
+
readonly points: 240;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A tiny line of equally spaced observations with no axes, and the last value, or the peak with `label="peak"`, marked
|
|
18
|
+
* and written beside it. Use it in a table column showing how a value moved, such as a score over recent runs, and pass
|
|
19
|
+
* the column's `domain` to every row for one shared scale. If the last observation is missing, the text says
|
|
20
|
+
* "Unavailable" while the line keeps what was recorded, and a series with no recorded value draws nothing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function SparkCell({ points, domain, locale, format, align, textWidth, id, tone, label, }: SparkCellProps): ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import type { ChartLegendItem } from './chart-theme.ts';
|
|
3
3
|
type ChartReportHeading = {
|
|
4
4
|
readonly meta?: ReactNode;
|
|
@@ -12,10 +12,6 @@ export type ChartSeriesReport = ChartReport | (ChartReportHeading & {
|
|
|
12
12
|
readonly summary?: never;
|
|
13
13
|
readonly seriesValues: Readonly<Record<string, string | undefined>>;
|
|
14
14
|
});
|
|
15
|
-
export type ChartSelection = {
|
|
16
|
-
readonly selectedId: string | undefined;
|
|
17
|
-
readonly onSelect: (id: string) => void;
|
|
18
|
-
};
|
|
19
15
|
export type ChartFrameProps = {
|
|
20
16
|
readonly title: ReactNode;
|
|
21
17
|
readonly description?: ReactNode;
|
|
@@ -24,6 +20,15 @@ export type ChartFrameProps = {
|
|
|
24
20
|
readonly footer?: ReactNode;
|
|
25
21
|
readonly report?: ChartSeriesReport | undefined;
|
|
26
22
|
readonly series?: ReadonlyArray<ChartLegendItem> | undefined;
|
|
23
|
+
/** The chart part's own props, when this figure is the root of an interactive chart. */
|
|
24
|
+
readonly figure?: ComponentProps<'figure'> | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The legend that names what the plot draws, such as series, models or classes. It sits above the plot, directly
|
|
27
|
+
* under the title block, with the frame's standard gap.
|
|
28
|
+
*/
|
|
29
|
+
readonly seriesLegend?: ReactNode;
|
|
30
|
+
/** The legend that explains a color or size scale. It sits directly below the plot, above the readout and notes. */
|
|
31
|
+
readonly scaleLegend?: ReactNode;
|
|
27
32
|
};
|
|
28
33
|
export type { ChartLegendItem } from './chart-theme.ts';
|
|
29
34
|
export type ChartLegendProps = {
|
|
@@ -31,14 +36,14 @@ export type ChartLegendProps = {
|
|
|
31
36
|
readonly label?: string | undefined;
|
|
32
37
|
readonly isScrollable?: boolean | undefined;
|
|
33
38
|
};
|
|
34
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The figure every chart draws in: the title block, the named legend, the plot, the scale legend, then the footer with
|
|
41
|
+
* the readout and notes. Use `FigureFrame`, which builds it, in a chart.
|
|
42
|
+
*/
|
|
43
|
+
export declare function ChartFrame({ title, description, children, actions, footer, report, series, figure, seriesLegend, scaleLegend, }: ChartFrameProps): ReactNode;
|
|
44
|
+
/** The legend that names a chart's series or groups, each with its mark. Hand it to the frame's `seriesLegend` slot. */
|
|
35
45
|
export declare function ChartLegend({ items, label, isScrollable }: ChartLegendProps): ReactNode;
|
|
36
|
-
|
|
37
|
-
readonly label: string;
|
|
38
|
-
readonly isSelected?: boolean | undefined;
|
|
39
|
-
readonly onSelect?: (() => void) | undefined;
|
|
40
|
-
readonly children: ReactNode;
|
|
41
|
-
}): ReactNode;
|
|
46
|
+
/** The line that states the inspected mark's exact values. A plot names it with `aria-describedby`. */
|
|
42
47
|
export declare function ChartReadout({ children, id }: {
|
|
43
48
|
readonly children: ReactNode;
|
|
44
49
|
readonly id?: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { ChartLinkProps } from './chart-link.tsx';
|
|
4
|
+
export type ChartGridProps = Omit<ChartLinkProps, 'children'> & {
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly description?: string | undefined;
|
|
7
|
+
/** The narrowest a panel may be, in CSS pixels. The grid fits as many columns as that allows. */
|
|
8
|
+
readonly minPanelWidth?: number | undefined;
|
|
9
|
+
/** Every series, model or run the panels draw, so each keeps one hue in every panel. */
|
|
10
|
+
readonly ids?: ReadonlyArray<string> | undefined;
|
|
11
|
+
readonly tones?: Readonly<Record<string, ChartTone>> | undefined;
|
|
12
|
+
/** The figures, one per panel. */
|
|
13
|
+
readonly children: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Figures side by side as one comparison: a panel per metric, layer or split. The panels share one inspection, so
|
|
17
|
+
* pointing at a record in one marks it in all, and one tone scope, so a series keeps its hue across panels.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ChartGrid({ title, description, minPanelWidth, ids, tones, children, ...link }: ChartGridProps): ReactNode;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ChartSeriesReport } from './chart-frame.tsx';
|
|
3
|
-
export declare function isFiniteDomain(domain: readonly [number, number]): boolean;
|
|
1
|
+
/** Whether every record has its own id. Charts refuse input that repeats one. */
|
|
4
2
|
export declare function hasUniqueIds(records: ReadonlyArray<{
|
|
5
3
|
readonly id: string;
|
|
6
4
|
}>): boolean;
|
|
7
|
-
export declare function ChartInputError({ title, description, message, report, }: {
|
|
8
|
-
readonly title: string;
|
|
9
|
-
readonly description?: ReactNode;
|
|
10
|
-
readonly message: string;
|
|
11
|
-
readonly report?: ChartSeriesReport | undefined;
|
|
12
|
-
}): ReactNode;
|
|
@@ -13,7 +13,6 @@ type ChartInspectionProps = {
|
|
|
13
13
|
readonly x: number;
|
|
14
14
|
readonly width: number;
|
|
15
15
|
readonly offset?: number | undefined;
|
|
16
|
-
readonly source: 'pointer' | 'keyboard' | undefined;
|
|
17
16
|
readonly notes?: ReadonlyArray<string> | undefined;
|
|
18
17
|
readonly hasSeriesSummary?: boolean | undefined;
|
|
19
18
|
/** False for a plot whose axis labels name every mark, so the inspector replaces the legend at every width. */
|
|
@@ -25,5 +24,5 @@ export declare function ChartInspectionTitle({ title, detail, }: {
|
|
|
25
24
|
readonly detail: string | undefined;
|
|
26
25
|
}): ReactNode;
|
|
27
26
|
export declare function inspectionReadout({ label, summary, rows, notes, }: Pick<ChartInspectionProps, 'label' | 'summary' | 'rows' | 'notes'>): string | undefined;
|
|
28
|
-
export declare function ChartInspection({ id, label, summary, legend, layoutLegend, rows, x, width, offset,
|
|
27
|
+
export declare function ChartInspection({ id, label, summary, legend, layoutLegend, rows, x, width, offset, notes, hasSeriesSummary, hasLegend, }: ChartInspectionProps): ReactNode;
|
|
29
28
|
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartInspectDetails, ChartInspectReason } from './chart.tsx';
|
|
3
|
+
type Link = {
|
|
4
|
+
readonly inspected: string | null;
|
|
5
|
+
readonly onInspectedChange: (id: string | null, details: ChartInspectDetails) => void;
|
|
6
|
+
};
|
|
7
|
+
export type ChartLinkProps = {
|
|
8
|
+
/** The record every figure inside shows as inspected, when the application holds it. */
|
|
9
|
+
readonly inspected?: string | null | undefined;
|
|
10
|
+
readonly defaultInspected?: string | null | undefined;
|
|
11
|
+
/** Hears each change with its details: which figure's hover, press or key, or an agent's step. */
|
|
12
|
+
readonly onInspectedChange?: ((id: string | null, details: ChartInspectDetails) => void) | undefined;
|
|
13
|
+
readonly children: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Links the figures inside it: inspecting a record in one highlights the record with the same id in the others. Give a
|
|
17
|
+
* model, a run or a token one id everywhere and the page reads as one instrument.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ChartLink({ inspected, defaultInspected, onInspectedChange, children, }: ChartLinkProps): ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The inspection a chart shares with its linked siblings: spread the result into `Chart`. Outside a link it is empty,
|
|
22
|
+
* and the chart keeps its own inspection. An id the chart does not draw reads as nothing inspected.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useLinkedInspection(): Partial<Link>;
|
|
25
|
+
export type LinkedHighlightInput = {
|
|
26
|
+
/** The ids a figure could highlight, such as its series. */
|
|
27
|
+
readonly ids: ReadonlyArray<string>;
|
|
28
|
+
/** The caller's own choice. Null highlights nothing; left out, the link decides. */
|
|
29
|
+
readonly highlighted?: string | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The record a figure draws at full strength while the others fade. That is the one the caller names, or else the
|
|
33
|
+
* record the enclosing link inspects when it is one of the figure's own. So a table row or a term in the prose that
|
|
34
|
+
* inspects a model lights up that model in every linked figure.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useLinkedHighlight({ ids, highlighted }: LinkedHighlightInput): string | null;
|
|
37
|
+
/** Why something outside the charts points them at a record: a hover, a press, focus arriving or leaving, or a call. */
|
|
38
|
+
export type ChartLinkInspectChange = {
|
|
39
|
+
readonly reason: ChartInspectReason;
|
|
40
|
+
/** The DOM event behind it, so the details say whether a pointer, a key or a screen reader caused it. */
|
|
41
|
+
readonly event?: Event | undefined;
|
|
42
|
+
};
|
|
43
|
+
/** The linked inspection as a control outside the charts reads and sets it. */
|
|
44
|
+
export type ChartLinkControl = {
|
|
45
|
+
/** The record every linked figure shows as inspected, or null. */
|
|
46
|
+
readonly inspected: string | null;
|
|
47
|
+
/** Points every linked figure at a record, or at nothing. Returns false when a listener canceled the change. */
|
|
48
|
+
readonly inspect: (id: string | null, change: ChartLinkInspectChange) => boolean;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Lets prose or a diagram point the linked figures at a record, such as a highlighted term that marks its series in
|
|
52
|
+
* every chart. The change reaches the link's listener with the same details a chart's own inspection sends. Outside a
|
|
53
|
+
* link it is undefined.
|
|
54
|
+
*/
|
|
55
|
+
export declare function useChartLinkControl(): ChartLinkControl | undefined;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ChangeDetails, SpansReason } from '@ui-sdk/core';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
/** A range along a plot's axis, in the axis's own units, such as two timestamps. */
|
|
4
|
+
export type ChartRangeValue = readonly [number, number];
|
|
5
|
+
/** Why the range changed: a drag, an arrow key, Delete, a button beside the plot, or a call such as an agent's step. */
|
|
6
|
+
export type ChartRangeDetails = ChangeDetails<SpansReason | 'clear-press' | 'trigger-press'>;
|
|
7
|
+
export type ChartRangeOptions = {
|
|
8
|
+
/** The selected range, or null. The application owns it and passes back what `onValueChange` asks for. */
|
|
9
|
+
readonly value: ChartRangeValue | null;
|
|
10
|
+
readonly onValueChange: (value: ChartRangeValue | null, details: ChartRangeDetails) => void;
|
|
11
|
+
/** Where the axis starts and ends, in its units. */
|
|
12
|
+
readonly min: number;
|
|
13
|
+
readonly max: number;
|
|
14
|
+
/** What each end snaps to, and what an arrow key moves the range by. */
|
|
15
|
+
readonly step: number;
|
|
16
|
+
/** A range as a reader hears it, such as "09:00 to 09:30". */
|
|
17
|
+
readonly describe: (value: ChartRangeValue) => string;
|
|
18
|
+
};
|
|
19
|
+
export type ChartRangeProps = ChartRangeOptions & {
|
|
20
|
+
/** Where the axis sits inside the plot, in CSS pixels from the plot's top left corner. */
|
|
21
|
+
readonly left: number;
|
|
22
|
+
readonly width: number;
|
|
23
|
+
readonly height: number;
|
|
24
|
+
/** Names the plot and its range together, such as "Request latency time range". */
|
|
25
|
+
readonly label: string;
|
|
26
|
+
/** The plot the range is drawn over. A mouse or pen press on it starts a new range. */
|
|
27
|
+
readonly children: ReactNode;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A range a reader draws along a plot's axis and moves with a drag or the arrow keys. Its edges or Shift and an arrow
|
|
31
|
+
* resize it, and Delete clears it. An agent reads the range and sets or clears it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function ChartRange({ left, width, height, label, children, ...options }: ChartRangeProps): ReactNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartItem, ChartView } from './chart.tsx';
|
|
3
|
+
/**
|
|
4
|
+
* The rows of a chart whose exact values are visible text, such as ranked bars. Rows an application can select are one
|
|
5
|
+
* Tab stop: arrow keys move between them and Enter or Space selects. Rows it cannot select stay plain text.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ChartRows({ title, items, view, children, }: {
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly items: ReadonlyArray<ChartItem>;
|
|
10
|
+
/** The chart's view when its rows can be selected. */
|
|
11
|
+
readonly view: ChartView | undefined;
|
|
12
|
+
readonly children: ReactNode;
|
|
13
|
+
}): ReactNode;
|
|
14
|
+
/** One row inside `ChartRows`. With the chart's view it is a mark a reader can select; without, it is text. */
|
|
15
|
+
export declare function ChartDatum({ id, label, view, children, }: {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly label: string;
|
|
18
|
+
readonly view: ChartView | undefined;
|
|
19
|
+
readonly children: ReactNode;
|
|
20
|
+
}): ReactNode;
|