@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
|
@@ -68,9 +68,26 @@ export declare const chartStyles: Readonly<{
|
|
|
68
68
|
readonly strokeWidth: stylex.StyleXClassNameFor<"strokeWidth", 2>;
|
|
69
69
|
readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
|
|
70
70
|
}>;
|
|
71
|
+
readonly inspected: Readonly<{
|
|
72
|
+
readonly stroke: stylex.StyleXClassNameFor<"stroke", string>;
|
|
73
|
+
readonly strokeWidth: stylex.StyleXClassNameFor<"strokeWidth", 1>;
|
|
74
|
+
readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
|
|
75
|
+
}>;
|
|
71
76
|
readonly inspectable: Readonly<{
|
|
72
77
|
readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none">;
|
|
73
78
|
}>;
|
|
79
|
+
readonly cursor: Readonly<{
|
|
80
|
+
readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", string>;
|
|
81
|
+
readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", string>;
|
|
82
|
+
readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "dashed" | "none">;
|
|
83
|
+
readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", 2>;
|
|
84
|
+
}>;
|
|
85
|
+
readonly shapeCursor: Readonly<{
|
|
86
|
+
readonly stroke: stylex.StyleXClassNameFor<"stroke", string>;
|
|
87
|
+
readonly strokeWidth: stylex.StyleXClassNameFor<"strokeWidth", string | 0>;
|
|
88
|
+
readonly strokeDasharray: stylex.StyleXClassNameFor<"strokeDasharray", "4 3">;
|
|
89
|
+
readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
|
|
90
|
+
}>;
|
|
74
91
|
readonly emphasis: Readonly<{
|
|
75
92
|
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
|
|
76
93
|
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", string>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ChangeDetails, SpatialRect } from '@ui-sdk/core';
|
|
2
|
+
import type { PartProps } from '@ui-sdk/react/primitive';
|
|
3
|
+
import type { ComponentType } from 'react';
|
|
4
|
+
export type ChartItem = {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
};
|
|
8
|
+
export type ChartInspectReason = 'item-hover' | 'item-press' | 'list-navigation' | 'focus-in' | 'focus-out' | 'escape-key' | 'outside-press' | 'window-blur' | 'imperative';
|
|
9
|
+
export type ChartInspectDetails = ChangeDetails<ChartInspectReason>;
|
|
10
|
+
export type ChartSelectDetails = ChangeDetails<'item-press'>;
|
|
11
|
+
/** A pointer position inside the plot, in CSS pixels from its top left corner, with the plot's rendered size. */
|
|
12
|
+
export type ChartPoint = {
|
|
13
|
+
readonly x: number;
|
|
14
|
+
readonly y: number;
|
|
15
|
+
readonly width: number;
|
|
16
|
+
readonly height: number;
|
|
17
|
+
};
|
|
18
|
+
export type ChartOptions = {
|
|
19
|
+
/** The marks a reader can inspect, in the order the arrow keys step through them. */
|
|
20
|
+
readonly items: ReadonlyArray<ChartItem>;
|
|
21
|
+
/** One item's exact values as a sentence, for the spoken readout and for agents. Defaults to the item's label. */
|
|
22
|
+
readonly readout?: ((id: string) => string | undefined) | undefined;
|
|
23
|
+
/** Arranges the items row by row in a grid this wide. Up and Down change rows; Home and End stay in the row. */
|
|
24
|
+
readonly columns?: number | undefined;
|
|
25
|
+
/** Whether Up and Down step through a list like Left and Right. Leave it out when the page should keep them. */
|
|
26
|
+
readonly arrows?: 'horizontal' | 'both' | undefined;
|
|
27
|
+
/** Where an item sits, in any one unit. Arrows then move to the nearest item in their direction. */
|
|
28
|
+
readonly place?: ((id: string) => SpatialRect | undefined) | undefined;
|
|
29
|
+
/** The item under a pointer anywhere in the plot. Leave it out when each mark hears its own pointer. */
|
|
30
|
+
readonly locate?: ((point: ChartPoint) => string | undefined) | undefined;
|
|
31
|
+
/** Names the data the readouts describe. An open inspection closes when it changes. */
|
|
32
|
+
readonly revision?: string | undefined;
|
|
33
|
+
/** The item the application has selected, or null. Selection is the application's state. */
|
|
34
|
+
readonly selected?: string | null | undefined;
|
|
35
|
+
/** Asks the application to select an item. Without it, the chart only inspects. */
|
|
36
|
+
readonly onSelect?: ((id: string, details: ChartSelectDetails) => void) | undefined;
|
|
37
|
+
readonly inspected?: string | null | undefined;
|
|
38
|
+
readonly defaultInspected?: string | null | undefined;
|
|
39
|
+
readonly onInspectedChange?: ((id: string | null, details: ChartInspectDetails) => void) | undefined;
|
|
40
|
+
/** Other elements a press counts as inside, such as sibling plots that share one inspection. */
|
|
41
|
+
readonly within?: ((target: Node) => boolean) | undefined;
|
|
42
|
+
};
|
|
43
|
+
type ChartState = {
|
|
44
|
+
readonly items: ReadonlyArray<ChartItem>;
|
|
45
|
+
readonly inspected: string | null;
|
|
46
|
+
readonly selected: string | null;
|
|
47
|
+
readonly cursor: string | null;
|
|
48
|
+
};
|
|
49
|
+
/** What a chart draws from: the open inspection, the application's selection, and where the keyboard cursor rests. */
|
|
50
|
+
export type ChartView = Pick<ChartState, 'inspected' | 'selected' | 'cursor'>;
|
|
51
|
+
type MarkState = {
|
|
52
|
+
readonly isInspected: boolean;
|
|
53
|
+
readonly isSelected: boolean;
|
|
54
|
+
};
|
|
55
|
+
type ChartPart<Tag extends 'figure' | 'div' | 'svg' | 'p' | 'span', State, Named = object> = ComponentType<Omit<PartProps<Tag, State>, 'id' | keyof Named> & Named>;
|
|
56
|
+
/** The chart's figure. It owns inspection, the keyboard cursor and selection requests for the plot inside it. */
|
|
57
|
+
export declare const Chart: ChartPart<'figure', ChartView, ChartOptions>;
|
|
58
|
+
/** The plot as one Tab stop: arrows move the cursor, Enter or Space selects, Escape or an outside press dismisses. */
|
|
59
|
+
export declare const ChartPlot: ChartPart<'div', ChartView>;
|
|
60
|
+
export declare const ChartTextPlot: ChartPart<'p', ChartView>;
|
|
61
|
+
/** One datum a pointer can inspect and press. Pass `render` for a mark that is not a span, such as an SVG shape. */
|
|
62
|
+
export declare const ChartMark: ChartPart<'span', MarkState, {
|
|
63
|
+
readonly value: string;
|
|
64
|
+
}>;
|
|
65
|
+
/** The visible readout for the open inspection, or a space that holds its line. */
|
|
66
|
+
export declare function inspectedLabel(items: ReadonlyArray<ChartItem>, inspected: string | null): string;
|
|
67
|
+
/** Names a plot for a reader who steps through its marks, such as "categories". */
|
|
68
|
+
export declare function plotLabel({ title, marks, isSelectable, }: {
|
|
69
|
+
readonly title: string;
|
|
70
|
+
readonly marks?: string | undefined;
|
|
71
|
+
readonly isSelectable: boolean;
|
|
72
|
+
}): string;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
3
|
+
import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
|
|
4
|
+
/** A qualitative band of the axis, such as "Poor" up to 100. Each band runs from the one before it. */
|
|
5
|
+
export type BulletRange = {
|
|
6
|
+
readonly upTo: number;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
};
|
|
9
|
+
export type BulletRow = {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
/** The measured amount, or null where it was not measured. */
|
|
13
|
+
readonly value: number | null;
|
|
14
|
+
/** The level the measure is held against, such as a service-level objective or a release bar. */
|
|
15
|
+
readonly target?: number | undefined;
|
|
16
|
+
/** The bands behind the bar, in increasing `upTo`. */
|
|
17
|
+
readonly ranges?: ReadonlyArray<BulletRange> | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type BulletBarProps = FigureProps & FigureSelectionProps & {
|
|
20
|
+
readonly rows: ReadonlyArray<BulletRow>;
|
|
21
|
+
/** The measured axis. A bar's length carries its amount, so the domain must start at zero. */
|
|
22
|
+
readonly value: PlotAxis;
|
|
23
|
+
readonly height?: PlotHeight | undefined;
|
|
24
|
+
};
|
|
25
|
+
export declare const bulletLimits: {
|
|
26
|
+
readonly rows: 40;
|
|
27
|
+
readonly ranges: 4;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A measured bar against a target and qualitative ranges, one per row: latency against its objective, or an eval's pass
|
|
31
|
+
* rate against the release bar. The ranges are steps of gray behind the bar, the target is a tick in ink, and the bar
|
|
32
|
+
* starts at zero. The application supplies every value, target and range.
|
|
33
|
+
*/
|
|
34
|
+
export declare function BulletBar(props: BulletBarProps): ReactNode;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartLegendItem } from '../chart-frame.tsx';
|
|
3
|
+
import type { ChartItem } from '../chart.tsx';
|
|
4
|
+
import type { FigureFrameInput, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
5
|
+
import type { PlotGrid } from '../plot/plot-axes.tsx';
|
|
6
|
+
import type { CategoryPlotLayout, PlotAxis, PlotCategory, PlotHeight } from '../plot/plot-layout.ts';
|
|
7
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
8
|
+
/** The height one row gets when it holds a single dot or bar, in pixels. */
|
|
9
|
+
export declare const ROW_STEP = 28;
|
|
10
|
+
export type ComparisonRowsInput = {
|
|
11
|
+
readonly rows: ReadonlyArray<PlotCategory>;
|
|
12
|
+
readonly value: PlotAxis;
|
|
13
|
+
/** The resolved value domain: the axis's own, or the result of `fitDomain`. */
|
|
14
|
+
readonly valueDomain: NumericDomain;
|
|
15
|
+
/** The most rows the chart draws. */
|
|
16
|
+
readonly rowsMax: number;
|
|
17
|
+
};
|
|
18
|
+
/** The first thing wrong with a comparison chart's rows or value axis, or undefined when they can be drawn. */
|
|
19
|
+
export declare function comparisonRowsError({ rows, value, valueDomain, rowsMax }: ComparisonRowsInput): string | undefined;
|
|
20
|
+
/** Every key of a record that names no row. A chart rejects values for rows it does not list. */
|
|
21
|
+
export declare function unknownRowIds(rows: ReadonlyArray<PlotCategory>, keys: ReadonlyArray<string>): ReadonlyArray<string>;
|
|
22
|
+
/** What a chart draws its marks from: the layout, and the rows that are inspected, selected or under the cursor. */
|
|
23
|
+
export type ComparisonState = {
|
|
24
|
+
readonly plot: CategoryPlotLayout;
|
|
25
|
+
readonly inspected: string | undefined;
|
|
26
|
+
readonly selected: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
export type ComparisonFigureProps = FigureSelectionProps & {
|
|
29
|
+
/** The shared figure props: title, description, locale, source and the rest. */
|
|
30
|
+
readonly frame: FigureFrameInput;
|
|
31
|
+
/** True when there is nothing to draw. The figure then shows `emptyLabel` in place of the plot. */
|
|
32
|
+
readonly isEmpty: boolean;
|
|
33
|
+
readonly emptyLabel: string;
|
|
34
|
+
readonly rows: ReadonlyArray<PlotCategory>;
|
|
35
|
+
readonly value: PlotAxis;
|
|
36
|
+
readonly valueDomain: NumericDomain;
|
|
37
|
+
readonly height: PlotHeight;
|
|
38
|
+
/** The height each row needs, in pixels. The plot grows with its rows and never shrinks below its named height. */
|
|
39
|
+
readonly rowStep: number;
|
|
40
|
+
/** One per row, with the row's id: the sentence that gives its exact values. */
|
|
41
|
+
readonly items: ReadonlyArray<ChartItem>;
|
|
42
|
+
readonly legend: ReadonlyArray<ChartLegendItem>;
|
|
43
|
+
/** True to show the legend in the frame's legend slot above the plot. */
|
|
44
|
+
readonly hasLegend: boolean;
|
|
45
|
+
/** Which lines run across the plot. Value lines are vertical; row lines are horizontal. */
|
|
46
|
+
readonly grid: PlotGrid;
|
|
47
|
+
/** Draws the marks of every row inside the axes. */
|
|
48
|
+
readonly renderMarks: (state: ComparisonState) => ReactNode;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* The plot every comparison chart shares: named rows down the side, one measured value along the bottom, a readout of
|
|
52
|
+
* the inspected row, and the keyboard cursor and selection. A chart supplies its rows, its sentences and its marks.
|
|
53
|
+
*/
|
|
54
|
+
export declare function ComparisonFigure({ frame, isEmpty, emptyLabel, rows, value, valueDomain, height, rowStep, items, legend, hasLegend, grid, selected, onSelectedChange, renderMarks, }: ComparisonFigureProps): ReactNode;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
4
|
+
import type { PlotAxis, PlotCategory, PlotHeight } from '../plot/plot-layout.ts';
|
|
5
|
+
/** The bounds of an interval around a value, such as a confidence interval. */
|
|
6
|
+
export type DotPlotInterval = {
|
|
7
|
+
readonly lower: number;
|
|
8
|
+
readonly upper: number;
|
|
9
|
+
};
|
|
10
|
+
export type DotPlotSeries = {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly tone?: ChartTone | undefined;
|
|
14
|
+
/** The value of each row, by row id. A row left out or set to null has no value and draws no dot. */
|
|
15
|
+
readonly values: Readonly<Record<string, number | null>>;
|
|
16
|
+
/** The interval around each row's value, by row id. It is drawn behind the dot. */
|
|
17
|
+
readonly intervals?: Readonly<Record<string, DotPlotInterval>> | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type DotPlotProps = FigureProps & FigureSelectionProps & {
|
|
20
|
+
/** The categories compared, listed down the side in the order given. */
|
|
21
|
+
readonly rows: ReadonlyArray<PlotCategory>;
|
|
22
|
+
readonly series: ReadonlyArray<DotPlotSeries>;
|
|
23
|
+
/** The measured axis. Position carries the value, so it need not start at zero. */
|
|
24
|
+
readonly value: PlotAxis;
|
|
25
|
+
/**
|
|
26
|
+
* The series drawn at full strength while the others fade. Emphasis only. Left out, it follows the enclosing chart
|
|
27
|
+
* link: a table row or a term in the prose that inspects a series id highlights that series.
|
|
28
|
+
*/
|
|
29
|
+
readonly highlighted?: string | null | undefined;
|
|
30
|
+
readonly height?: PlotHeight | undefined;
|
|
31
|
+
};
|
|
32
|
+
export declare const dotPlotLimits: {
|
|
33
|
+
readonly rows: 60;
|
|
34
|
+
readonly series: 6;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* One dot per series on each row, along one shared measured axis: a Cleveland dot plot. Use it to compare named
|
|
38
|
+
* categories, such as the accuracy of several models per task, when position reads better than bar length and the axis
|
|
39
|
+
* need not start at zero. An optional interval is drawn behind its dot, and the application supplies every value.
|
|
40
|
+
*/
|
|
41
|
+
export declare function DotPlot(props: DotPlotProps): ReactNode;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
4
|
+
import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
|
|
5
|
+
export type DumbbellRow = {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
/** The first value, such as the score before. Null where it was not measured. */
|
|
9
|
+
readonly from: number | null;
|
|
10
|
+
/** The second value, such as the score after. Null where it was not measured. */
|
|
11
|
+
readonly to: number | null;
|
|
12
|
+
};
|
|
13
|
+
export type DumbbellPlotProps = FigureProps & FigureSelectionProps & {
|
|
14
|
+
readonly rows: ReadonlyArray<DumbbellRow>;
|
|
15
|
+
/** What the first value is: "Before fine-tuning". */
|
|
16
|
+
readonly fromLabel: string;
|
|
17
|
+
/** What the second value is: "After fine-tuning". */
|
|
18
|
+
readonly toLabel: string;
|
|
19
|
+
readonly fromTone?: ChartTone | undefined;
|
|
20
|
+
readonly toTone?: ChartTone | undefined;
|
|
21
|
+
/** The measured axis. Position carries the value, so it need not start at zero. */
|
|
22
|
+
readonly value: PlotAxis;
|
|
23
|
+
readonly height?: PlotHeight | undefined;
|
|
24
|
+
};
|
|
25
|
+
export declare const dumbbellLimits: {
|
|
26
|
+
readonly rows: 60;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Two values per row joined by a segment, before and after or one condition against another, to show how far each
|
|
30
|
+
* category moved. The joining segment is gray context, and the two ends are dots in two hues named in the legend. A row
|
|
31
|
+
* with one end missing draws the present dot only, and the application supplies every value.
|
|
32
|
+
*/
|
|
33
|
+
export declare function DumbbellPlot(props: DumbbellPlotProps): ReactNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { BulletBarProps, BulletRange, BulletRow } from './bullet-bar.tsx';
|
|
2
|
+
export { BulletBar, bulletLimits } from './bullet-bar.tsx';
|
|
3
|
+
export type { DotPlotInterval, DotPlotProps, DotPlotSeries } from './dot-plot.tsx';
|
|
4
|
+
export { DotPlot, dotPlotLimits } from './dot-plot.tsx';
|
|
5
|
+
export type { DumbbellPlotProps, DumbbellRow } from './dumbbell-plot.tsx';
|
|
6
|
+
export { DumbbellPlot, dumbbellLimits } from './dumbbell-plot.tsx';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { FigureProps } from '../figure/figure-props.ts';
|
|
4
|
+
import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
|
|
5
|
+
import type { GroupDirection } from './group-plot-layout.ts';
|
|
6
|
+
/** One group's five-number summary, computed by the application, with the outliers it left out of the whiskers. */
|
|
7
|
+
export type BoxGroup = {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly tone?: ChartTone | undefined;
|
|
11
|
+
/** The end of the lower whisker. */
|
|
12
|
+
readonly low: number;
|
|
13
|
+
readonly q1: number;
|
|
14
|
+
readonly median: number;
|
|
15
|
+
readonly q3: number;
|
|
16
|
+
/** The end of the upper whisker. */
|
|
17
|
+
readonly high: number;
|
|
18
|
+
/** Observations beyond the whiskers. They are drawn as hollow dots and never extend a whisker. */
|
|
19
|
+
readonly outliers?: ReadonlyArray<number> | undefined;
|
|
20
|
+
/** How many observations the summary covers. */
|
|
21
|
+
readonly count?: number | undefined;
|
|
22
|
+
};
|
|
23
|
+
export type BoxPlotProps = FigureProps & {
|
|
24
|
+
readonly groups: ReadonlyArray<BoxGroup>;
|
|
25
|
+
readonly value: PlotAxis;
|
|
26
|
+
readonly direction?: GroupDirection | undefined;
|
|
27
|
+
/** What the whiskers mean, as a phrase without a final period: "Whiskers reach 1.5 × IQR". */
|
|
28
|
+
readonly whiskerLabel: string;
|
|
29
|
+
readonly height?: PlotHeight | undefined;
|
|
30
|
+
};
|
|
31
|
+
export declare const boxLimits: {
|
|
32
|
+
readonly groups: 40;
|
|
33
|
+
readonly outliers: 200;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* One box per group, with the middle half of its values as a tinted box and the median as a line. Whiskers reach the
|
|
37
|
+
* ends of the ordinary range and hollow dots mark outliers beyond them, and the application computes every number and
|
|
38
|
+
* says what the whiskers mean. Use it to compare spread and center across groups such as models, layers or runs.
|
|
39
|
+
*/
|
|
40
|
+
export declare function BoxPlot(props: BoxPlotProps): ReactNode;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import type { NumericDomain, ScaleType } from '../plot/scale.ts';
|
|
2
|
+
/** The most records each distribution chart draws. Larger input is refused with a message that names the limit. */
|
|
2
3
|
export declare const distributionLimits: {
|
|
3
4
|
readonly bins: 200;
|
|
4
5
|
readonly cumulativePoints: 2000;
|
|
5
6
|
readonly rows: 200;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
/** Why a distribution chart cannot draw its records on a domain, or undefined when it can. */
|
|
9
|
+
export declare function distributionInputError({ items, domain, scale, maxEntries, }: {
|
|
8
10
|
readonly items: ReadonlyArray<{
|
|
9
11
|
readonly id: string;
|
|
10
12
|
}>;
|
|
11
13
|
readonly domain: NumericDomain;
|
|
14
|
+
readonly scale?: ScaleType | undefined;
|
|
12
15
|
readonly maxEntries: number;
|
|
13
16
|
}): string | undefined;
|
|
14
|
-
export declare function outsideDomain(value: number, domain: NumericDomain): boolean;
|
|
@@ -1,162 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
export
|
|
6
|
-
readonly
|
|
1
|
+
import type { ComponentProps, ReactNode, Ref } from 'react';
|
|
2
|
+
import type { ChartItem } from '../chart.tsx';
|
|
3
|
+
import type { FigureFrameInput } from '../figure/figure-props.ts';
|
|
4
|
+
import type { NumericPlotLayout, PlotAxis } from '../plot/plot-layout.ts';
|
|
5
|
+
export type DistributionFigureProps = {
|
|
6
|
+
readonly frame: FigureFrameInput;
|
|
7
|
+
/** The chart part's own props, from `Chart`'s render. */
|
|
8
|
+
readonly figure: ComponentProps<'figure'>;
|
|
9
|
+
readonly items: ReadonlyArray<ChartItem>;
|
|
10
|
+
readonly inspected: string | null;
|
|
11
|
+
readonly plotRef: Ref<HTMLDivElement>;
|
|
12
|
+
readonly plot: NumericPlotLayout;
|
|
13
|
+
readonly x: PlotAxis;
|
|
14
|
+
readonly y: PlotAxis;
|
|
15
|
+
readonly isSelectable: boolean;
|
|
16
|
+
readonly emptyLabel: string;
|
|
17
|
+
/** The marks, drawn inside the axes. */
|
|
18
|
+
readonly children: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Marks drawn over the axes without the clip: dots that may sit on the plot's edge, and the keyboard cursor, whose
|
|
21
|
+
* underline sits below the plot.
|
|
22
|
+
*/
|
|
23
|
+
readonly overlay: ReactNode;
|
|
7
24
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
14
|
-
}>;
|
|
15
|
-
readonly yAxis: Readonly<{
|
|
16
|
-
readonly height: stylex.StyleXClassNameFor<"height", 160>;
|
|
17
|
-
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
18
|
-
readonly flexDirection: stylex.StyleXClassNameFor<"flexDirection", "column">;
|
|
19
|
-
readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "space-between">;
|
|
20
|
-
readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
|
|
21
|
-
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
22
|
-
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
23
|
-
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
24
|
-
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
25
|
-
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|
|
26
|
-
readonly maxWidth: stylex.StyleXClassNameFor<"maxWidth", 120>;
|
|
27
|
-
readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
|
|
28
|
-
}>;
|
|
29
|
-
readonly plotArea: Readonly<{
|
|
30
|
-
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
31
|
-
}>;
|
|
32
|
-
readonly svg: Readonly<{
|
|
33
|
-
readonly display: stylex.StyleXClassNameFor<"display", "block">;
|
|
34
|
-
readonly width: stylex.StyleXClassNameFor<"width", "100%">;
|
|
35
|
-
readonly height: stylex.StyleXClassNameFor<"height", 160>;
|
|
36
|
-
readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
|
|
37
|
-
}>;
|
|
38
|
-
readonly grid: Readonly<{
|
|
39
|
-
readonly stroke: stylex.StyleXClassNameFor<"stroke", string>;
|
|
40
|
-
readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
|
|
41
|
-
}>;
|
|
42
|
-
readonly axis: Readonly<{
|
|
43
|
-
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
44
|
-
readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "space-between">;
|
|
45
|
-
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
46
|
-
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
47
|
-
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
48
|
-
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
49
|
-
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
50
|
-
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|
|
51
|
-
}>;
|
|
52
|
-
readonly tick: Readonly<{
|
|
53
|
-
readonly flex: stylex.StyleXClassNameFor<"flex", "1 1 0">;
|
|
54
|
-
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
55
|
-
readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
|
|
56
|
-
}>;
|
|
57
|
-
readonly middleTick: Readonly<{
|
|
58
|
-
readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "center">;
|
|
59
|
-
}>;
|
|
60
|
-
readonly endTick: Readonly<{
|
|
61
|
-
readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
|
|
62
|
-
}>;
|
|
63
|
-
readonly axisNames: Readonly<{
|
|
64
|
-
readonly gridColumn: stylex.StyleXClassNameFor<"gridColumn", "1 / -1">;
|
|
65
|
-
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
66
|
-
readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "space-between">;
|
|
67
|
-
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
68
|
-
}>;
|
|
69
|
-
readonly label: Readonly<{
|
|
70
|
-
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
71
|
-
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
72
|
-
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
73
|
-
readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
|
|
74
|
-
}>;
|
|
75
|
-
readonly values: Readonly<{
|
|
76
|
-
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
77
|
-
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
78
|
-
readonly containerType: stylex.StyleXClassNameFor<"containerType", "inline-size">;
|
|
79
|
-
}>;
|
|
80
|
-
readonly value: Readonly<{
|
|
81
|
-
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
82
|
-
readonly flexWrap: stylex.StyleXClassNameFor<"flexWrap", "wrap">;
|
|
83
|
-
readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "space-between">;
|
|
84
|
-
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", string>;
|
|
85
|
-
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", string>;
|
|
86
|
-
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
87
|
-
readonly width: stylex.StyleXClassNameFor<"width", "100%">;
|
|
88
|
-
}>;
|
|
89
|
-
readonly summary: Readonly<{
|
|
90
|
-
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
91
|
-
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|
|
92
|
-
readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
|
|
93
|
-
readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
|
|
94
|
-
}>;
|
|
95
|
-
readonly row: Readonly<{
|
|
96
|
-
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
97
|
-
readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "minmax(0, 1fr)" | "minmax(100px, 1fr) minmax(120px, 2fr)">;
|
|
98
|
-
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
99
|
-
readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
|
|
100
|
-
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
101
|
-
readonly width: stylex.StyleXClassNameFor<"width", "100%">;
|
|
102
|
-
}>;
|
|
103
|
-
readonly rowAxis: Readonly<{
|
|
104
|
-
readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
105
|
-
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
|
|
106
|
-
}>;
|
|
107
|
-
readonly axisSpacer: Readonly<{
|
|
108
|
-
readonly display: stylex.StyleXClassNameFor<"display", "block" | "none">;
|
|
109
|
-
}>;
|
|
110
|
-
readonly rowLabel: Readonly<{
|
|
111
|
-
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
112
|
-
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
113
|
-
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
114
|
-
readonly overflowWrap: stylex.StyleXClassNameFor<"overflowWrap", "anywhere">;
|
|
115
|
-
}>;
|
|
116
|
-
readonly rowValue: Readonly<{
|
|
117
|
-
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
118
|
-
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|
|
119
|
-
}>;
|
|
120
|
-
readonly rowSvg: Readonly<{
|
|
121
|
-
readonly display: stylex.StyleXClassNameFor<"display", "block">;
|
|
122
|
-
readonly width: stylex.StyleXClassNameFor<"width", "100%">;
|
|
123
|
-
readonly height: stylex.StyleXClassNameFor<"height", 28>;
|
|
124
|
-
readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
|
|
125
|
-
}>;
|
|
126
|
-
readonly empty: Readonly<{
|
|
127
|
-
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
128
|
-
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
129
|
-
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
130
|
-
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
131
|
-
}>;
|
|
132
|
-
readonly baseline: Readonly<{
|
|
133
|
-
readonly stroke: stylex.StyleXClassNameFor<"stroke", string>;
|
|
134
|
-
readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
|
|
135
|
-
}>;
|
|
136
|
-
readonly track: Readonly<{
|
|
137
|
-
readonly fill: stylex.StyleXClassNameFor<"fill", string>;
|
|
138
|
-
}>;
|
|
139
|
-
readonly missing: Readonly<{
|
|
140
|
-
readonly fill: stylex.StyleXClassNameFor<"fill", string>;
|
|
141
|
-
readonly stroke: stylex.StyleXClassNameFor<"stroke", string>;
|
|
142
|
-
readonly strokeDasharray: stylex.StyleXClassNameFor<"strokeDasharray", "3 3">;
|
|
143
|
-
readonly vectorEffect: stylex.StyleXClassNameFor<"vectorEffect", "non-scaling-stroke">;
|
|
144
|
-
}>;
|
|
145
|
-
}>;
|
|
146
|
-
type NumericPlotProps = {
|
|
147
|
-
readonly navigation: ReturnType<typeof useChartNavigation>['props'];
|
|
148
|
-
readonly onInspectValue?: (value: number) => void;
|
|
149
|
-
readonly xDomain: NumericDomain;
|
|
150
|
-
readonly yDomain: NumericDomain;
|
|
151
|
-
readonly xLabel: string;
|
|
152
|
-
readonly yLabel: string;
|
|
153
|
-
readonly formatX: (value: number) => string;
|
|
154
|
-
readonly formatY: (value: number) => string;
|
|
155
|
-
readonly children: (width: number) => ReactNode;
|
|
156
|
-
};
|
|
157
|
-
export declare function NumericPlot({ navigation, onInspectValue, xDomain, yDomain, xLabel, yLabel, formatX, formatY, children, }: NumericPlotProps): ReactNode;
|
|
158
|
-
export declare function DomainLabels({ domain, formatValue, }: {
|
|
159
|
-
readonly domain: NumericDomain;
|
|
160
|
-
readonly formatValue: (value: number) => string;
|
|
161
|
-
}): ReactNode;
|
|
162
|
-
export {};
|
|
25
|
+
/**
|
|
26
|
+
* The frame, axes, readout and exact-value table that a histogram and a cumulative distribution share. Each chart
|
|
27
|
+
* supplies its own marks.
|
|
28
|
+
*/
|
|
29
|
+
export declare function DistributionFigure({ frame, figure, items, inspected, plotRef, plot, x, y, isSelectable, emptyLabel, children, overlay, }: DistributionFigureProps): ReactNode;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
4
|
+
import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
|
|
5
|
+
/** One prepared step of an empirical cumulative distribution: the share of observations at or below `value`. */
|
|
5
6
|
export type ECDFPoint = {
|
|
6
7
|
readonly id: string;
|
|
7
8
|
readonly value: number;
|
|
8
9
|
readonly probability: number | null;
|
|
9
10
|
};
|
|
10
|
-
export type ECDFProps = {
|
|
11
|
-
|
|
12
|
-
readonly report?: ChartReport | undefined;
|
|
13
|
-
readonly description?: string;
|
|
11
|
+
export type ECDFProps = FigureProps & FigureSelectionProps & {
|
|
12
|
+
/** Points in increasing `value` whose probability never decreases. A null probability breaks the line. */
|
|
14
13
|
readonly points: ReadonlyArray<ECDFPoint>;
|
|
15
|
-
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly selection?: ChartSelection;
|
|
22
|
-
readonly emptyLabel?: string;
|
|
14
|
+
/** The measured variable, with its unit. */
|
|
15
|
+
readonly value: PlotAxis;
|
|
16
|
+
/** The cumulative share. Its domain is zero to one when left out. */
|
|
17
|
+
readonly probability: PlotAxis;
|
|
18
|
+
readonly tone?: ChartTone | undefined;
|
|
19
|
+
readonly height?: PlotHeight | undefined;
|
|
23
20
|
};
|
|
24
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The share of observations at or below each value, drawn as a step line from prepared points: latency percentiles,
|
|
23
|
+
* score thresholds, calibration. Read a percentile across from the probability axis. Use `Histogram` for counts.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ECDF(props: ECDFProps): ReactNode;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { NumericDomain, ScaleType } from '../plot/scale.ts';
|
|
2
|
+
/** One point of a density curve the application computed: how much of the data lies near `value`. */
|
|
3
|
+
export type DensityPoint = {
|
|
4
|
+
readonly value: number;
|
|
5
|
+
readonly density: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Why a chart of named groups cannot draw, or undefined when it can. The reasons are a domain the scale cannot carry,
|
|
9
|
+
* groups that share an identifier, or more groups than the chart draws.
|
|
10
|
+
*/
|
|
11
|
+
export declare function groupFrameError({ records, limit, noun, domain, scale, }: {
|
|
12
|
+
readonly records: ReadonlyArray<{
|
|
13
|
+
readonly id: string;
|
|
14
|
+
}>;
|
|
15
|
+
readonly limit: number;
|
|
16
|
+
/** What the records are, in the plural: "groups" or "rows". */
|
|
17
|
+
readonly noun: string;
|
|
18
|
+
readonly domain: NumericDomain;
|
|
19
|
+
readonly scale?: ScaleType | undefined;
|
|
20
|
+
}): string | undefined;
|
|
21
|
+
/** The first problem in the density curves of a chart, or undefined when each can be drawn. */
|
|
22
|
+
export declare function densitiesError({ records, domain, limit, }: {
|
|
23
|
+
readonly records: ReadonlyArray<{
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly density: ReadonlyArray<DensityPoint>;
|
|
26
|
+
}>;
|
|
27
|
+
readonly domain: NumericDomain;
|
|
28
|
+
readonly limit: number;
|
|
29
|
+
}): string | undefined;
|
|
30
|
+
/** The highest density among all curves. Charts that share one density scale divide by it. */
|
|
31
|
+
export declare function maxDensity(records: ReadonlyArray<{
|
|
32
|
+
readonly density: ReadonlyArray<DensityPoint>;
|
|
33
|
+
}>): number;
|
|
34
|
+
/** The point where a curve is highest, the first one when several tie. It reads a supplied point, computing nothing. */
|
|
35
|
+
export declare function peakPoint(density: ReadonlyArray<DensityPoint>): DensityPoint | undefined;
|