@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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { FigureCoverage } from '../figure/figure-props.ts';
|
|
2
|
+
import type { SeriesPoint, TransformOk, TransformResult } from './values.ts';
|
|
3
|
+
/** A sample of a long list: the indices kept, in increasing order, and the figure coverage that states the share. */
|
|
4
|
+
export type SampleResult = TransformResult<{
|
|
5
|
+
readonly indices: ReadonlyArray<number>;
|
|
6
|
+
readonly coverage: FigureCoverage;
|
|
7
|
+
/** The seed of a random sample; null for an even one. */
|
|
8
|
+
readonly seed: number | null;
|
|
9
|
+
}>;
|
|
10
|
+
export type DownsampleResult = TransformResult<{
|
|
11
|
+
readonly points: ReadonlyArray<SeriesPoint>;
|
|
12
|
+
readonly coverage: FigureCoverage;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Thin a long series to about `target` points before drawing it, with largest-triangle-three-buckets (Steinarsson,
|
|
16
|
+
* 2013), so peaks, dips and the first and last points survive. The points are split into equal buckets, and each bucket
|
|
17
|
+
* keeps the point that makes the largest triangle with its chosen neighbours. Gaps are kept: each run of missing points
|
|
18
|
+
* stays as one missing point, and the budget is shared among the runs between gaps by their length.
|
|
19
|
+
*/
|
|
20
|
+
export declare function downsample({ points, target, unit, }: {
|
|
21
|
+
/** The series in order of x, which must not decrease. */
|
|
22
|
+
readonly points: ReadonlyArray<SeriesPoint>;
|
|
23
|
+
/** About how many points to keep; at least 3. */
|
|
24
|
+
readonly target: number;
|
|
25
|
+
/** What the coverage counts, in the plural. Defaults to "points". */
|
|
26
|
+
readonly unit?: string | undefined;
|
|
27
|
+
}): DownsampleResult;
|
|
28
|
+
/** The footnote for `downsample`, as in "1,000 of 50,000 points shown (largest triangle three buckets)." */
|
|
29
|
+
export declare function describeDownsample({ result, locale, }: {
|
|
30
|
+
readonly result: TransformOk<DownsampleResult>;
|
|
31
|
+
readonly locale: string;
|
|
32
|
+
}): string;
|
|
33
|
+
/**
|
|
34
|
+
* The footnote for `sampleEvenly` and `reservoirIndices`, as in "2,000 of 80,000 points shown (evenly spaced)." or
|
|
35
|
+
* "2,000 of 80,000 points shown (random sample, seed 7)."
|
|
36
|
+
*/
|
|
37
|
+
export declare function describeSample({ result, locale, }: {
|
|
38
|
+
readonly result: TransformOk<SampleResult>;
|
|
39
|
+
readonly locale: string;
|
|
40
|
+
}): string;
|
|
41
|
+
/**
|
|
42
|
+
* Choose about `target` of `count` indices spread evenly from the first to the last, for drawing a sample of a large
|
|
43
|
+
* point set. Index i of the sample is round(i × (count − 1) / (target − 1)), so the first and last are always kept.
|
|
44
|
+
* Draw `points[index]` for each index and pass `coverage` to the figure.
|
|
45
|
+
*/
|
|
46
|
+
export declare function sampleEvenly({ count, target, unit, }: {
|
|
47
|
+
/** How many items the full set has. */
|
|
48
|
+
readonly count: number;
|
|
49
|
+
readonly target: number;
|
|
50
|
+
/** What the coverage counts, in the plural. Defaults to "points". */
|
|
51
|
+
readonly unit?: string | undefined;
|
|
52
|
+
}): SampleResult;
|
|
53
|
+
/**
|
|
54
|
+
* `count` pseudo-random numbers between 0 and 1 from the "minimal standard" Lehmer generator (Park and Miller, with
|
|
55
|
+
* multiplier 48271): each number is the previous one times 48271, modulo 2³¹ − 1. It is small and plain arithmetic, so
|
|
56
|
+
* the same seed always gives the same numbers on every machine, and a longer sequence starts with the shorter one.
|
|
57
|
+
*/
|
|
58
|
+
export declare function seededUniforms({ seed, count, }: {
|
|
59
|
+
readonly seed: number;
|
|
60
|
+
readonly count: number;
|
|
61
|
+
}): ReadonlyArray<number>;
|
|
62
|
+
/**
|
|
63
|
+
* Choose `target` of `count` indices at random, each equally likely, and the same ones every time for the same seed.
|
|
64
|
+
* Index i gets the i-th number of `seededUniforms` as its key, and the indices with the `target` smallest keys are kept
|
|
65
|
+
* (random-key reservoir sampling), returned in increasing order. Growing `count` keeps an earlier sample's indices
|
|
66
|
+
* unless a new key undercuts them.
|
|
67
|
+
*/
|
|
68
|
+
export declare function reservoirIndices({ count, target, seed, unit, }: {
|
|
69
|
+
readonly count: number;
|
|
70
|
+
readonly target: number;
|
|
71
|
+
/** Any whole number. The same seed gives the same sample. */
|
|
72
|
+
readonly seed: number;
|
|
73
|
+
/** What the coverage counts, in the plural. Defaults to "points". */
|
|
74
|
+
readonly unit?: string | undefined;
|
|
75
|
+
}): SampleResult;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { SeriesPoint, TransformOk, TransformResult } from './values.ts';
|
|
2
|
+
export type MovingAverageResult = TransformResult<{
|
|
3
|
+
readonly points: ReadonlyArray<SeriesPoint>;
|
|
4
|
+
/** How many points each mean spans. */
|
|
5
|
+
readonly size: number;
|
|
6
|
+
}>;
|
|
7
|
+
export type ExponentialSmoothingResult = TransformResult<{
|
|
8
|
+
readonly points: ReadonlyArray<SeriesPoint>;
|
|
9
|
+
readonly weight: number;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* A trailing moving average: each point becomes the mean of the observed values among itself and the `size − 1` points
|
|
13
|
+
* before it. The first points average over fewer values, and a missing point (null, NaN or infinite) stays missing. It
|
|
14
|
+
* is not counted in its neighbours' means, so gaps in the line are kept.
|
|
15
|
+
*/
|
|
16
|
+
export declare function movingAverage({ points, size, }: {
|
|
17
|
+
readonly points: ReadonlyArray<SeriesPoint>;
|
|
18
|
+
/** How many points each mean spans, the point itself included. */
|
|
19
|
+
readonly size: number;
|
|
20
|
+
}): MovingAverageResult;
|
|
21
|
+
/** The footnote for `movingAverage`, as in "Trailing mean over 10 points." */
|
|
22
|
+
export declare function describeMovingAverage({ result, locale, }: {
|
|
23
|
+
readonly result: TransformOk<MovingAverageResult>;
|
|
24
|
+
readonly locale: string;
|
|
25
|
+
}): string;
|
|
26
|
+
/**
|
|
27
|
+
* The exponential moving average that training dashboards draw over a noisy loss: each smoothed value is `weight` times
|
|
28
|
+
* the previous one plus `1 − weight` times the new value. Because the average starts from zero, each value is then
|
|
29
|
+
* divided by 1 − weight^n (n = values seen so far), the debiased form TensorBoard uses. That removes the pull toward
|
|
30
|
+
* zero at the start, and a missing point stays missing and does not move the average.
|
|
31
|
+
*/
|
|
32
|
+
export declare function exponentialSmoothing({ points, weight, }: {
|
|
33
|
+
readonly points: ReadonlyArray<SeriesPoint>;
|
|
34
|
+
/** How much of the previous average each step keeps, from 0 (no smoothing) up to but not including 1. */
|
|
35
|
+
readonly weight: number;
|
|
36
|
+
}): ExponentialSmoothingResult;
|
|
37
|
+
/** The footnote for `exponentialSmoothing`, as in "Exponential moving average, weight 0.9, debiased." */
|
|
38
|
+
export declare function describeExponentialSmoothing({ result, locale, }: {
|
|
39
|
+
readonly result: TransformOk<ExponentialSmoothingResult>;
|
|
40
|
+
readonly locale: string;
|
|
41
|
+
}): string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** Why a transform could not use its input, in a sentence the application can show or log. */
|
|
2
|
+
export type TransformInvalid = {
|
|
3
|
+
readonly kind: 'invalid';
|
|
4
|
+
readonly message: string;
|
|
5
|
+
};
|
|
6
|
+
/** What a transform returns when its input may be unusable: its result, or the reason it could not compute one. */
|
|
7
|
+
export type TransformResult<T> = ({
|
|
8
|
+
readonly kind: 'ok';
|
|
9
|
+
} & T) | TransformInvalid;
|
|
10
|
+
/** One observation of an ordered series. A `y` of null is a gap: the series has no value there. */
|
|
11
|
+
export type SeriesPoint = {
|
|
12
|
+
readonly x: number;
|
|
13
|
+
readonly y: number | null;
|
|
14
|
+
};
|
|
15
|
+
/** A point with a value: an observation a fit, a smoother or a sampler can use. */
|
|
16
|
+
export type ObservedPoint = {
|
|
17
|
+
readonly x: number;
|
|
18
|
+
readonly y: number;
|
|
19
|
+
};
|
|
20
|
+
/** The successful case of a transform's result, for helpers such as the `describe…` footnotes that read it. */
|
|
21
|
+
export type TransformOk<R> = Extract<R, {
|
|
22
|
+
readonly kind: 'ok';
|
|
23
|
+
}>;
|
|
24
|
+
/** The reason a transform rejected its input. */
|
|
25
|
+
export declare function invalid(message: string): TransformInvalid;
|
|
26
|
+
/** A finite number as it is, and null for a missing one. Null, NaN and infinities are missing to every transform. */
|
|
27
|
+
export declare function finiteOrNull(value: number | null | undefined): number | null;
|
|
28
|
+
/** The finite numbers of a list, in their order. Missing entries are dropped, never read as zero. */
|
|
29
|
+
export declare function observedValues(values: ReadonlyArray<number | null>): ReadonlyArray<number>;
|
|
30
|
+
/** The finite numbers of a list from smallest to largest. */
|
|
31
|
+
export declare function sortedValues(values: ReadonlyArray<number | null>): ReadonlyArray<number>;
|
|
32
|
+
/** The points of a series whose x and y are both finite, in their order. */
|
|
33
|
+
export declare function observedPoints(points: ReadonlyArray<SeriesPoint>): ReadonlyArray<ObservedPoint>;
|
|
34
|
+
export type ScanInput<T, S> = {
|
|
35
|
+
readonly items: ReadonlyArray<T>;
|
|
36
|
+
readonly initial: S;
|
|
37
|
+
readonly step: (state: S, item: T, index: number) => S;
|
|
38
|
+
};
|
|
39
|
+
/** Every intermediate state of a left-to-right pass over a list: the running form of a fold. */
|
|
40
|
+
export declare function scan<T, S>({ items, initial, step }: ScanInput<T, S>): ReadonlyArray<S>;
|
|
41
|
+
/** The total of a list; zero for an empty one. */
|
|
42
|
+
export declare function sum(values: ReadonlyArray<number>): number;
|
|
43
|
+
/** The arithmetic mean of a list that has at least one value. */
|
|
44
|
+
export declare function mean(values: ReadonlyArray<number>): number;
|
|
45
|
+
/** The sum of squared distances from the mean. */
|
|
46
|
+
export declare function squaredDeviation(values: ReadonlyArray<number>): number;
|
|
47
|
+
/** How often each index from 0 to `size - 1` occurs in a list. */
|
|
48
|
+
export declare function tally(indices: ReadonlyArray<number>, size: number): ReadonlyArray<number>;
|
|
49
|
+
/** True for a whole number from `low` to `high`. */
|
|
50
|
+
export declare function isCount(value: number, bounds: readonly [low: number, high: number]): boolean;
|
|
51
|
+
/** True when every id in a list is different. */
|
|
52
|
+
export declare function hasDistinctIds(ids: ReadonlyArray<string>): boolean;
|
|
53
|
+
/** The distinct values of a list in increasing order. */
|
|
54
|
+
export declare function distinctSorted(values: ReadonlyArray<number>): ReadonlyArray<number>;
|
|
55
|
+
/** A number as a footnote writes it in the reader's locale: whole in full, others to three significant digits. */
|
|
56
|
+
export declare function noteNumber(value: number, locale: string): string;
|
|
57
|
+
/** The singular and plural names of what a note counts. */
|
|
58
|
+
export type NoteNoun = {
|
|
59
|
+
readonly one: string;
|
|
60
|
+
readonly other: string;
|
|
61
|
+
};
|
|
62
|
+
/** A sentence that counts the entries a transform left out, or nothing when it left none out. */
|
|
63
|
+
export declare function leftOutNote({ count, noun, reason, locale, }: {
|
|
64
|
+
readonly count: number;
|
|
65
|
+
/** What was left out. Defaults to missing values. */
|
|
66
|
+
readonly noun?: NoteNoun | undefined;
|
|
67
|
+
/** What happened to them. Defaults to "skipped". */
|
|
68
|
+
readonly reason?: string | undefined;
|
|
69
|
+
readonly locale: string;
|
|
70
|
+
}): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { PlotHeight } from '../plot/plot-layout.ts';
|
|
5
|
+
/** One stage the ranks are given at, such as a month or a checkpoint. */
|
|
6
|
+
export type BumpStage = {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
};
|
|
10
|
+
export type BumpItem = {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
/** One whole-number rank per stage, from 1 for the best. Null where the item is not ranked at that stage. */
|
|
14
|
+
readonly ranks: ReadonlyArray<number | null>;
|
|
15
|
+
readonly tone?: ChartTone | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type BumpChartProps = FigureProps & {
|
|
18
|
+
/** The ordered stages, drawn as evenly spaced columns. */
|
|
19
|
+
readonly stages: ReadonlyArray<BumpStage>;
|
|
20
|
+
readonly items: ReadonlyArray<BumpItem>;
|
|
21
|
+
readonly height?: PlotHeight | undefined;
|
|
22
|
+
};
|
|
23
|
+
export declare const bumpLimits: {
|
|
24
|
+
readonly items: 30;
|
|
25
|
+
readonly stages: 24;
|
|
26
|
+
readonly rank: 100;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Rank over ordered stages, such as a model leaderboard by month. Rank 1 is at the top, each item is one line, and
|
|
30
|
+
* inspecting an item makes the others recede so its path stands out. The application supplies the ranks, one item per
|
|
31
|
+
* rank at each stage, and an item with no rank at a stage leaves a gap in its line.
|
|
32
|
+
*/
|
|
33
|
+
export declare function BumpChart(props: BumpChartProps): ReactNode;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { ChartLegendItem } from '../chart-frame.tsx';
|
|
4
|
+
import type { ChartItem } from '../chart.tsx';
|
|
5
|
+
import type { FigureFrameInput, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
6
|
+
import type { PlotBox, PlotTick } from '../plot/plot-layout.ts';
|
|
7
|
+
/** One line across ordered columns, already placed in the plot's pixels. */
|
|
8
|
+
export type ColumnLine = {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly tone: ChartTone;
|
|
11
|
+
/** The vertical position at each column, or null where nothing was recorded. */
|
|
12
|
+
readonly ys: ReadonlyArray<number | null>;
|
|
13
|
+
/** The label at the first column, and the one at the last. */
|
|
14
|
+
readonly startLabel: string;
|
|
15
|
+
readonly endLabel: string;
|
|
16
|
+
};
|
|
17
|
+
export type ColumnFigureProps = FigureSelectionProps & {
|
|
18
|
+
readonly frame: FigureFrameInput;
|
|
19
|
+
readonly emptyLabel: string;
|
|
20
|
+
readonly plotRef: Ref<HTMLDivElement>;
|
|
21
|
+
readonly box: PlotBox;
|
|
22
|
+
/** The horizontal position of each column. */
|
|
23
|
+
readonly xs: ReadonlyArray<number>;
|
|
24
|
+
readonly xTicks: ReadonlyArray<PlotTick>;
|
|
25
|
+
readonly yTicks: ReadonlyArray<PlotTick>;
|
|
26
|
+
readonly yTitle: string;
|
|
27
|
+
readonly lines: ReadonlyArray<ColumnLine>;
|
|
28
|
+
/** What the arrow keys step through, with each one's exact values as a sentence. */
|
|
29
|
+
readonly items: ReadonlyArray<ChartItem>;
|
|
30
|
+
readonly legend: ReadonlyArray<ChartLegendItem>;
|
|
31
|
+
/** What the plot's lines are called in its accessible name: "items". */
|
|
32
|
+
readonly marks: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The shared body of the charts that join one thing's values across a few ordered columns. It draws lines and dots at
|
|
36
|
+
* each recorded value and names at both ends, and the others recede while one line is inspected or selected.
|
|
37
|
+
*/
|
|
38
|
+
export declare function ColumnFigure({ frame, emptyLabel, plotRef, box, xs, xTicks, yTicks, yTitle, lines, items, legend, marks, selected, onSelectedChange, }: ColumnFigureProps): ReactNode;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PlotBox } from '../plot/plot-layout.ts';
|
|
2
|
+
export type ColumnPositionsInput = {
|
|
3
|
+
readonly box: PlotBox;
|
|
4
|
+
/** The column labels under the axis, one per column, in order. */
|
|
5
|
+
readonly columnLabels: ReadonlyArray<string>;
|
|
6
|
+
/** The room the labels beside the first and last column ask for at the left and right ends of the plot. */
|
|
7
|
+
readonly leftGutter: number;
|
|
8
|
+
readonly rightGutter: number;
|
|
9
|
+
};
|
|
10
|
+
/** Evenly spaced columns, and the end gutters they leave for the labels beside the first and last column. */
|
|
11
|
+
export type ColumnPositions = {
|
|
12
|
+
readonly xs: ReadonlyArray<number>;
|
|
13
|
+
readonly leftGutter: number;
|
|
14
|
+
readonly rightGutter: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Evenly spaced columns between the gutters that hold the end labels. When the plot is too narrow for both, the gutters
|
|
18
|
+
* give up room in proportion to their size, up to half the plot. This keeps neighbouring column labels from touching,
|
|
19
|
+
* and an end label then shortens.
|
|
20
|
+
*/
|
|
21
|
+
export declare function columnPositions({ box, columnLabels, leftGutter, rightGutter }: ColumnPositionsInput): ColumnPositions;
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { PathCurve } from '../plot/path.ts';
|
|
5
|
+
import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
|
|
6
|
+
import type { MarkStroke } from '../plot/plot-marks.tsx';
|
|
7
|
+
export type CurvePoint = {
|
|
8
|
+
readonly x: number;
|
|
9
|
+
/** The observed value, or null where none was recorded. The line breaks there. */
|
|
10
|
+
readonly y: number | null;
|
|
11
|
+
/** The bounds of an interval around the value, such as a spread across seeds. Supply both or neither. */
|
|
12
|
+
readonly lower?: number | null | undefined;
|
|
13
|
+
readonly upper?: number | null | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type CurveSeries = {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly label: string;
|
|
18
|
+
/** Observations in increasing `x`. Series need not share their `x` values. */
|
|
19
|
+
readonly points: ReadonlyArray<CurvePoint>;
|
|
20
|
+
readonly tone?: ChartTone | undefined;
|
|
21
|
+
/** Dashed for a series that is modelled, not observed: a fit, a projection or a baseline. */
|
|
22
|
+
readonly stroke?: MarkStroke | undefined;
|
|
23
|
+
/** True for a series drawn in gray behind the others, as context. */
|
|
24
|
+
readonly isContext?: boolean | undefined;
|
|
25
|
+
};
|
|
26
|
+
/** A level a reader compares the curves against, such as a target. The application computes it. */
|
|
27
|
+
export type CurveReference = {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly label: string;
|
|
30
|
+
readonly y: number;
|
|
31
|
+
};
|
|
32
|
+
/** A position on the ordered variable the reader should find, such as the selected layer. Drawn as a labelled guide. */
|
|
33
|
+
export type CurveMarker = {
|
|
34
|
+
readonly x: number;
|
|
35
|
+
readonly label: string;
|
|
36
|
+
};
|
|
37
|
+
export type CurveChartProps = FigureProps & {
|
|
38
|
+
readonly series: ReadonlyArray<CurveSeries>;
|
|
39
|
+
/** The ordered variable: a training step, a layer, a dose, a context length. */
|
|
40
|
+
readonly x: PlotAxis;
|
|
41
|
+
readonly y: PlotAxis;
|
|
42
|
+
readonly references?: ReadonlyArray<CurveReference> | undefined;
|
|
43
|
+
/** Vertical guides at chosen `x` values, each named at the top of the plot. Values must lie inside the x domain. */
|
|
44
|
+
readonly markers?: ReadonlyArray<CurveMarker> | undefined;
|
|
45
|
+
readonly curve?: PathCurve | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Where series are named: in the legend, or beside the plot at the end of each line, spread apart so none overlap.
|
|
48
|
+
* Choose nowhere when one legend beside a grid of panels already names them.
|
|
49
|
+
*/
|
|
50
|
+
readonly labels?: 'legend' | 'inline' | 'none' | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The series drawn at full strength, on top, while the others fade. Emphasis only. Left out, it follows the enclosing
|
|
53
|
+
* chart link: a term in the prose or a table row that inspects a series id highlights that series.
|
|
54
|
+
*/
|
|
55
|
+
readonly highlighted?: string | null | undefined;
|
|
56
|
+
readonly height?: PlotHeight | undefined;
|
|
57
|
+
};
|
|
58
|
+
export declare const curveLimits: {
|
|
59
|
+
readonly series: 12;
|
|
60
|
+
readonly pointsPerSeries: 2000;
|
|
61
|
+
readonly references: 8;
|
|
62
|
+
readonly markers: 8;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Curves of a measure over an ordered variable that is not time: loss over training steps, accuracy over layers, an
|
|
66
|
+
* effect over a dose. Either axis can be linear, log or symlog, each series can carry an uncertainty band, and a
|
|
67
|
+
* modelled series is dashed. Use `LineChart` when the ordered variable is a timestamp.
|
|
68
|
+
*/
|
|
69
|
+
export declare function CurveChart(props: CurveChartProps): ReactNode;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The pixels a column of end labels needs beside the plot: the longest label, but never more than about a third of the
|
|
5
|
+
* width.
|
|
6
|
+
*/
|
|
7
|
+
export declare function labelGutter({ labels, width, }: {
|
|
8
|
+
readonly labels: ReadonlyArray<string>;
|
|
9
|
+
readonly width: number;
|
|
10
|
+
}): number;
|
|
11
|
+
/** How many characters fit in a gutter from `labelGutter`. */
|
|
12
|
+
export declare function gutterChars(gutter: number): number;
|
|
13
|
+
/** Shortens a label to `maxChars`, ending it with an ellipsis. The full name stays in the readout. */
|
|
14
|
+
export declare function truncateLabel(text: string, maxChars: number): string;
|
|
15
|
+
/** The room a stack of labels needs, so a plot can grow tall enough to keep every label apart. */
|
|
16
|
+
export declare function labelsHeight(count: number): number;
|
|
17
|
+
export type EndLabel = {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly text: string;
|
|
20
|
+
readonly tone: ChartTone;
|
|
21
|
+
/** Where the line ends, in plot pixels. The label sits there unless a neighbor needs the room. */
|
|
22
|
+
readonly y: number;
|
|
23
|
+
};
|
|
24
|
+
export type EndLabelsProps = {
|
|
25
|
+
readonly labels: ReadonlyArray<EndLabel>;
|
|
26
|
+
readonly x: number;
|
|
27
|
+
readonly anchor: 'start' | 'end';
|
|
28
|
+
/** The top and bottom of the room the labels may use. */
|
|
29
|
+
readonly top: number;
|
|
30
|
+
readonly bottom: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Names lines where they end. Labels keep their order and move apart just enough that none overlap, so a crowded end
|
|
34
|
+
* reads as a list beside its lines.
|
|
35
|
+
*/
|
|
36
|
+
export declare function EndLabels({ labels, x, anchor, top, bottom }: EndLabelsProps): ReactNode;
|
|
37
|
+
/** The dashed edge that shows where the keyboard cursor rests on a line. It appears only while the plot has focus. */
|
|
38
|
+
export declare function LineCursor({ d }: {
|
|
39
|
+
readonly d: string;
|
|
40
|
+
}): ReactNode;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FigureProps } from '../figure/figure-props.ts';
|
|
3
|
+
import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
|
|
4
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
5
|
+
export type HorizonPoint = {
|
|
6
|
+
readonly x: number;
|
|
7
|
+
readonly y: number | null;
|
|
8
|
+
};
|
|
9
|
+
export type HorizonSeries = {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
/** Observations in increasing `x`. Rows share the chart's x axis, but need not share their positions. */
|
|
13
|
+
readonly points: ReadonlyArray<HorizonPoint>;
|
|
14
|
+
};
|
|
15
|
+
export type HorizonBands = 2 | 3 | 4;
|
|
16
|
+
export type HorizonChartProps = FigureProps & {
|
|
17
|
+
readonly series: ReadonlyArray<HorizonSeries>;
|
|
18
|
+
readonly x: PlotAxis;
|
|
19
|
+
/** The values every row folds, on one linear domain that holds zero. The domain is required, so rows compare. */
|
|
20
|
+
readonly value: PlotAxis & {
|
|
21
|
+
readonly domain: NumericDomain;
|
|
22
|
+
};
|
|
23
|
+
/** How many layers each row folds its values into. */
|
|
24
|
+
readonly bands: HorizonBands;
|
|
25
|
+
/** The height of each row: compact 16, regular 24 or tall 36 pixels. */
|
|
26
|
+
readonly height?: PlotHeight | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare const horizonLimits: {
|
|
29
|
+
readonly series: 40;
|
|
30
|
+
readonly pointsPerSeries: 1000;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Many series in little vertical space, such as per-layer activation statistics. Each series is a short row that folds
|
|
34
|
+
* its values into layers: every layer is a darker step of one hue above zero and of a second hue below zero. The rows
|
|
35
|
+
* share one x axis and one value domain so their colors compare, and the legend states where each band starts.
|
|
36
|
+
*/
|
|
37
|
+
export declare function HorizonChart(props: HorizonChartProps): ReactNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { BumpChart, bumpLimits } from './bump-chart.tsx';
|
|
2
|
+
export type { BumpChartProps, BumpItem, BumpStage } from './bump-chart.tsx';
|
|
3
|
+
export { CurveChart, curveLimits } from './curve-chart.tsx';
|
|
4
|
+
export type { CurveChartProps, CurvePoint, CurveReference, CurveSeries } from './curve-chart.tsx';
|
|
5
|
+
export { HorizonChart, horizonLimits } from './horizon-chart.tsx';
|
|
6
|
+
export type { HorizonBands, HorizonChartProps, HorizonPoint, HorizonSeries } from './horizon-chart.tsx';
|
|
7
|
+
export { RunsChart, runsLimits } from './runs-chart.tsx';
|
|
8
|
+
export type { RunPoint, RunsChartProps, RunsSummary, TrainingRun } from './runs-chart.tsx';
|
|
9
|
+
export { SlopeChart, slopeLimits } from './slope-chart.tsx';
|
|
10
|
+
export type { SlopeChartProps, SlopeCondition, SlopeItem } from './slope-chart.tsx';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ChartPoint } from '../chart.tsx';
|
|
2
|
+
/** A vertex of a drawn line, in the plot's pixels. A null `y` is a missing value: the line breaks there. */
|
|
3
|
+
export type LocatedPoint = {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number | null;
|
|
6
|
+
};
|
|
7
|
+
/** A line the pointer can inspect, by the id of the thing it draws. */
|
|
8
|
+
export type LocatedLine = {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly points: ReadonlyArray<LocatedPoint>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A chart `locate` for lines: the pointer inspects the line whose drawn path is nearest, between its vertices as well
|
|
14
|
+
* as at them. A line is never a target where it has no value.
|
|
15
|
+
*/
|
|
16
|
+
export declare function locateNearestLine({ lines, width, height, }: {
|
|
17
|
+
readonly lines: ReadonlyArray<LocatedLine>;
|
|
18
|
+
/** The size the lines were laid out in. The pointer arrives in rendered pixels and is rescaled to it. */
|
|
19
|
+
readonly width: number;
|
|
20
|
+
readonly height: number;
|
|
21
|
+
}): (point: ChartPoint) => string | undefined;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 RunPoint = {
|
|
6
|
+
readonly x: number;
|
|
7
|
+
/** The value recorded at this step, or null where none was. The line breaks there. */
|
|
8
|
+
readonly y: number | null;
|
|
9
|
+
};
|
|
10
|
+
export type TrainingRun = {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
/** Records in strictly increasing `x`. Runs need not share their steps. */
|
|
14
|
+
readonly points: ReadonlyArray<RunPoint>;
|
|
15
|
+
/** The hue this run takes when it is featured, inspected or selected. */
|
|
16
|
+
readonly tone?: ChartTone | undefined;
|
|
17
|
+
};
|
|
18
|
+
/** A line with a band that summarizes all runs, such as their median and quartiles. The application computes it. */
|
|
19
|
+
export type RunsSummary = {
|
|
20
|
+
readonly label: string;
|
|
21
|
+
readonly points: ReadonlyArray<{
|
|
22
|
+
readonly x: number;
|
|
23
|
+
readonly center: number;
|
|
24
|
+
readonly lower: number;
|
|
25
|
+
readonly upper: number;
|
|
26
|
+
}>;
|
|
27
|
+
/** The summary's hue. It defaults to the sixth series hue, so it never shares a color with the gray runs. */
|
|
28
|
+
readonly tone?: ChartTone | undefined;
|
|
29
|
+
};
|
|
30
|
+
export type RunsChartProps = FigureProps & FigureSelectionProps & {
|
|
31
|
+
readonly runs: ReadonlyArray<TrainingRun>;
|
|
32
|
+
/** The ordered variable: a training step or a token count. */
|
|
33
|
+
readonly x: PlotAxis;
|
|
34
|
+
readonly y: PlotAxis;
|
|
35
|
+
/** The ids of the runs to draw in their hue with a name at the end. Every other run stays gray context. */
|
|
36
|
+
readonly featured: ReadonlyArray<string>;
|
|
37
|
+
readonly summary?: RunsSummary | undefined;
|
|
38
|
+
readonly height?: PlotHeight | undefined;
|
|
39
|
+
};
|
|
40
|
+
export declare const runsLimits: {
|
|
41
|
+
readonly runs: 200;
|
|
42
|
+
readonly pointsPerRun: 500;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Many training runs over a step axis, as thin gray lines for context, with the runs named in `featured` drawn on top
|
|
46
|
+
* in their hue and labeled at the end. A summary the application supplies, such as the median and quartiles across
|
|
47
|
+
* runs, is drawn as a line with a band. Pointing at a run, or stepping to it with the arrow keys, shows its name and
|
|
48
|
+
* last recorded value, and `CurveChart` suits a handful of named series.
|
|
49
|
+
*/
|
|
50
|
+
export declare function RunsChart(props: RunsChartProps): ReactNode;
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
/** One condition the items are measured under, such as before and after fine-tuning. */
|
|
6
|
+
export type SlopeCondition = {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
};
|
|
10
|
+
export type SlopeItem = {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
/** One value per condition, in the conditions' order. Null where the item was not measured. The line breaks there. */
|
|
14
|
+
readonly values: ReadonlyArray<number | null>;
|
|
15
|
+
readonly tone?: ChartTone | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type SlopeChartProps = FigureProps & FigureSelectionProps & {
|
|
18
|
+
/** Two to six ordered conditions, drawn as evenly spaced columns. */
|
|
19
|
+
readonly conditions: ReadonlyArray<SlopeCondition>;
|
|
20
|
+
readonly items: ReadonlyArray<SlopeItem>;
|
|
21
|
+
readonly value: PlotAxis;
|
|
22
|
+
readonly height?: PlotHeight | undefined;
|
|
23
|
+
};
|
|
24
|
+
export declare const slopeLimits: {
|
|
25
|
+
readonly items: 40;
|
|
26
|
+
readonly conditionsMin: 2;
|
|
27
|
+
readonly conditionsMax: 6;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The same things measured under two or a few ordered conditions, such as benchmark scores before and after
|
|
31
|
+
* fine-tuning. Each item is one line across the conditions with its value written at both ends, so a reader sees who
|
|
32
|
+
* rose, who fell and by how much. A missing value breaks the line and is said in the readout, and `CurveChart` fits
|
|
33
|
+
* better when the conditions are many or measured along a continuous variable.
|
|
34
|
+
*/
|
|
35
|
+
export declare function SlopeChart(props: SlopeChartProps): ReactNode;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
+
import type { ChangeDetails } from '@ui-sdk/core';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
export type CollectionToolbarProps = {
|
|
3
4
|
readonly label: string;
|
|
4
5
|
readonly children?: ReactNode;
|
|
5
6
|
readonly actions?: ReactNode;
|
|
6
7
|
};
|
|
8
|
+
/** The control row above a collection, on the UI SDK toolbar: filter chips and actions share one Tab stop. */
|
|
7
9
|
export declare function CollectionToolbar({ label, children, actions }: CollectionToolbarProps): ReactNode;
|
|
8
10
|
export type FilterChip = {
|
|
9
11
|
readonly id: string;
|
|
10
12
|
readonly label: string;
|
|
11
13
|
};
|
|
14
|
+
export type FilterRemoveDetails = ChangeDetails<'remove-press'>;
|
|
12
15
|
export type FilterChipsProps = {
|
|
13
16
|
readonly filters: ReadonlyArray<FilterChip>;
|
|
14
|
-
readonly onRemove: (id: string) => void;
|
|
17
|
+
readonly onRemove: (id: string, details: FilterRemoveDetails) => void;
|
|
15
18
|
readonly label?: string;
|
|
16
19
|
};
|
|
20
|
+
/** The applied filters, each with a remove button. The buttons share one Tab stop on the UI SDK toolbar. */
|
|
17
21
|
export declare function FilterChips({ filters, onRemove, label }: FilterChipsProps): ReactNode;
|
|
18
22
|
export type DisplayOption = {
|
|
19
23
|
readonly id: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChangeDetails } from '@ui-sdk/core';
|
|
1
2
|
import type { ComponentProps, ReactNode } from 'react';
|
|
2
3
|
import type { Badge } from '../../core/src/index.ts';
|
|
3
4
|
export type FilterOption = {
|
|
@@ -6,6 +7,8 @@ export type FilterOption = {
|
|
|
6
7
|
readonly icon?: ReactNode;
|
|
7
8
|
tone?: ComponentProps<typeof Badge>['tone'];
|
|
8
9
|
};
|
|
10
|
+
/** Why a filter changed: a menu option, its chip's remove button, or a call such as an agent's step. */
|
|
11
|
+
export type CollectionFilterDetails = ChangeDetails<'item-press' | 'remove-press' | 'imperative'>;
|
|
9
12
|
export type CollectionFilter = {
|
|
10
13
|
readonly id: string;
|
|
11
14
|
readonly label: string;
|
|
@@ -13,7 +16,7 @@ export type CollectionFilter = {
|
|
|
13
16
|
readonly value: string;
|
|
14
17
|
readonly defaultValue: string;
|
|
15
18
|
readonly options: ReadonlyArray<FilterOption>;
|
|
16
|
-
readonly onChange: (value: string) => void;
|
|
19
|
+
readonly onChange: (value: string, details: CollectionFilterDetails) => void;
|
|
17
20
|
};
|
|
18
21
|
export declare function CollectionFilters({ groups }: {
|
|
19
22
|
groups: ReadonlyArray<CollectionFilter>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ToolbarGroup } from '@ui-sdk/react/toolbar';
|
|
2
|
+
import type { ComponentProps, ReactElement, ReactNode } from 'react';
|
|
3
|
+
type ControlToolbarProps = ComponentProps<typeof ToolbarGroup> & {
|
|
4
|
+
readonly 'aria-label': string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A named set of controls on the UI SDK toolbar: Tab enters once and the arrow keys move between the controls. Inside
|
|
8
|
+
* another set it becomes a group of that toolbar, so a row of sets still has one Tab stop.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ControlToolbar(props: ControlToolbarProps): ReactNode;
|
|
11
|
+
/** Joins a button to the toolbar around it. Outside a toolbar the button renders as given. */
|
|
12
|
+
export declare function useToolbarButton(button: ReactElement): ReactElement;
|
|
13
|
+
export {};
|