@mechane-ai/elements 0.46.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 +306 -33
- package/dist/ai.js +4 -4
- package/dist/catalog.json +2382 -33
- package/dist/categorical-values-DdfGIowV.js +107 -0
- package/dist/cells--Bd1fQFR.js +384 -0
- package/dist/chart-link-AE_xuxiP.js +35 -0
- package/dist/chart-tones-ei3BC2AL.js +27 -0
- package/dist/charts/cartesian.js +1 -2958
- package/dist/charts/cells.js +1 -0
- package/dist/charts/comparison.js +1 -0
- package/dist/charts/distribution.js +1 -781
- package/dist/charts/figure.js +3404 -0
- package/dist/charts/graph.js +1 -655
- package/dist/charts/hierarchy.js +1 -121
- package/dist/charts/image.js +1 -0
- package/dist/charts/matrix.js +3 -644
- package/dist/charts/plot.js +15 -0
- package/dist/charts/relationship.js +1 -0
- package/dist/charts/text.js +1 -0
- package/dist/charts/timeline.js +1 -266
- package/dist/charts/transforms.js +677 -0
- package/dist/charts/trend.js +1 -0
- package/dist/charts.js +8 -3
- package/dist/collections.js +1 -2195
- package/dist/color-legend-CIo7DhXB.js +62 -0
- 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 -810
- package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
- package/dist/image-grid-CVA4SOy_.js +598 -0
- 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/locate-Bcg3QcP4.js +11 -0
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
- package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
- package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
- package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
- package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
- package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
- package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
- package/dist/packages/charts/src/cartesian/index.d.ts +5 -5
- package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +30 -25
- package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
- package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
- package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
- package/dist/packages/charts/src/cartesian/time-series.d.ts +60 -36
- package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
- package/dist/packages/charts/src/categorical-values.d.ts +1 -1
- package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
- package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
- package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
- package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
- package/dist/packages/charts/src/cells/index.d.ts +11 -0
- package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
- package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
- package/dist/packages/charts/src/chart-frame.d.ts +14 -7
- package/dist/packages/charts/src/chart-grid.d.ts +19 -0
- package/dist/packages/charts/src/chart-input.d.ts +1 -9
- package/dist/packages/charts/src/chart-link.d.ts +56 -0
- package/dist/packages/charts/src/chart.d.ts +0 -8
- package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
- package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
- package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
- package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
- package/dist/packages/charts/src/comparison/index.d.ts +6 -0
- package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
- package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
- package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
- package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
- package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
- package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
- package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
- package/dist/packages/charts/src/distribution/index.d.ts +11 -0
- package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
- package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
- package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
- package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
- package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
- package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
- package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
- package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
- package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
- package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
- package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
- package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
- package/dist/packages/charts/src/graph/index.d.ts +6 -2
- package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
- package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
- package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
- package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
- package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
- package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
- package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
- package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
- package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
- package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
- package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
- package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
- package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
- package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
- package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
- package/dist/packages/charts/src/image/image-input.d.ts +27 -0
- package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
- package/dist/packages/charts/src/image/index.d.ts +7 -0
- package/dist/packages/charts/src/index.d.ts +15 -1
- package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
- package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
- package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
- package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
- package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
- package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
- package/dist/packages/charts/src/matrix/index.d.ts +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 -2
- package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
- package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
- package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
- package/dist/packages/charts/src/relationship/index.d.ts +11 -0
- package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
- package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
- package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
- package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
- package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
- package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
- package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
- package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
- package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
- package/dist/packages/charts/src/spec/figure.d.ts +12 -0
- package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
- package/dist/packages/charts/src/spec/index.d.ts +10 -0
- package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
- package/dist/packages/charts/src/text/index.d.ts +11 -0
- package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
- package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
- package/dist/packages/charts/src/text/token-links.d.ts +49 -0
- package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
- package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
- package/dist/packages/charts/src/text/token-text.d.ts +39 -0
- package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
- package/dist/packages/charts/src/timeline/index.d.ts +3 -1
- package/dist/packages/charts/src/timeline/waterfall.d.ts +24 -13
- package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
- package/dist/packages/charts/src/transforms/density.d.ts +53 -0
- package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
- package/dist/packages/charts/src/transforms/index.d.ts +19 -0
- package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
- package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
- package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
- package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
- package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
- package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
- package/dist/packages/charts/src/transforms/values.d.ts +70 -0
- package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
- package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
- package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
- package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
- package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
- package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
- package/dist/packages/charts/src/trend/index.d.ts +10 -0
- package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
- package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
- package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
- package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
- package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
- package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
- package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
- package/dist/packages/kits/src/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/path-BglsXpnO.js +59 -0
- 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-DcqtSgzb.js +124 -0
- 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-DVHlknB6.js → src-CExIrXPC.js} +169 -193
- package/dist/src-D5NXRJZe.js +2195 -0
- package/dist/src-DIS0YOj0.js +44 -0
- package/dist/styles2.css +453 -62
- 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 -4
- package/recipes/allocation-report.tsx +15 -7
- package/skills/extend-elements/SKILL.md +60 -0
- package/skills/review-elements/SKILL.md +43 -1
- package/skills/upgrade-elements/SKILL.md +3 -1
- package/skills/upgrade-elements/references/releases.md +184 -0
- package/skills/use-elements/SKILL.md +19 -13
- package/skills/use-elements/references/charts.md +362 -41
- package/skills/use-elements/references/figures.md +173 -0
- package/skills/use-elements/references/kits.md +198 -0
- package/dist/categorical-values-BXi-rJuv.js +0 -74
- package/dist/chart-data-CIJVWCYt.js +0 -21
- package/dist/chart-frame-BaxKn_MB.js +0 -236
- package/dist/chart-input-Bm82_9Rd.js +0 -22
- package/dist/chart-theme-4zprJ3rW.js +0 -404
- package/dist/plot-width-v2c_rA20.js +0 -63
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { FigureFrameInput, FigureSelectionProps, SeriesFigureProps } from '../figure/figure-props.ts';
|
|
4
|
+
import type { PlotHeight } from '../plot/plot-layout.ts';
|
|
5
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
3
6
|
import type { BarAnnotation, BarComposition, BarMarker, BarSeries } from './bar-data.ts';
|
|
4
7
|
import type { ChartReferenceLine } from './reference-lines.tsx';
|
|
5
8
|
export type { BarSeries, BarBucket, BarComposition, BarMarker, BarAnnotation } from './bar-data.ts';
|
|
6
|
-
export type
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}>;
|
|
9
|
+
export type BarCategory = {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
/** A short name for the axis, such as "Jan". The readout uses the full label. */
|
|
13
|
+
readonly axisLabel?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type BarChartProps = SeriesFigureProps & FigureSelectionProps & {
|
|
16
|
+
readonly categories: ReadonlyArray<BarCategory>;
|
|
15
17
|
readonly series: ReadonlyArray<BarSeries>;
|
|
16
|
-
|
|
18
|
+
/** The value axis. Leave it out to fit zero and every drawn value on round bounds. */
|
|
19
|
+
readonly domain?: NumericDomain | undefined;
|
|
17
20
|
readonly mode?: 'grouped' | 'stacked' | undefined;
|
|
18
21
|
readonly composition?: BarComposition | undefined;
|
|
19
|
-
|
|
20
|
-
readonly
|
|
21
|
-
|
|
22
|
-
readonly
|
|
23
|
-
|
|
22
|
+
/** How the readout and the table write a value. */
|
|
23
|
+
readonly valueFormat: ValueFormat;
|
|
24
|
+
/** How the value axis writes its ticks. Absent uses the compact form of `valueFormat`. */
|
|
25
|
+
readonly tickFormat?: ValueFormat | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The value axis title, with its unit: "Cost (USD)". With a title the ticks leave a `unit` style out, so the unit
|
|
28
|
+
* is written once. Absent draws no title.
|
|
29
|
+
*/
|
|
30
|
+
readonly valueLabel?: string | undefined;
|
|
31
|
+
/** The series drawn at full strength while the others fade. Emphasis only; selection is unchanged. */
|
|
32
|
+
readonly highlighted?: string | null | undefined;
|
|
33
|
+
readonly height?: PlotHeight | undefined;
|
|
24
34
|
/** Labelled values drawn across the plot, such as a target or an average. They join every category's readout. */
|
|
25
35
|
readonly referenceLines?: ReadonlyArray<ChartReferenceLine> | undefined;
|
|
26
36
|
/** Ticks or whiskers drawn on each bar of a series, listed in the legend and the readout. */
|
|
@@ -28,14 +38,23 @@ export type BarChartProps = {
|
|
|
28
38
|
/** Short notes above chosen bars. Notes for a category also join its readout and exact values. */
|
|
29
39
|
readonly annotations?: ReadonlyArray<BarAnnotation> | undefined;
|
|
30
40
|
/**
|
|
31
|
-
* Recedes every other category so these stand out, without changing selection or inspection. Emphasis is visual
|
|
32
|
-
* explain it with an annotation or the description.
|
|
41
|
+
* Recedes every other category so these stand out, without changing selection or inspection. Emphasis is visual
|
|
42
|
+
* only; explain it with an annotation or the description.
|
|
33
43
|
*/
|
|
34
44
|
readonly emphasizedCategoryIds?: ReadonlyArray<string> | undefined;
|
|
35
45
|
};
|
|
36
|
-
export type BarChartPlaceholderProps =
|
|
46
|
+
export type BarChartPlaceholderProps = Omit<FigureFrameInput, 'title' | 'status'> & {
|
|
37
47
|
readonly title?: string | undefined;
|
|
38
48
|
readonly series?: ReadonlyArray<Pick<BarSeries, 'id' | 'label' | 'tone'>> | undefined;
|
|
49
|
+
readonly height?: PlotHeight | undefined;
|
|
39
50
|
};
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The loading state of a bar chart: its heading, its legend for known series and the plot footprint, with no invented
|
|
53
|
+
* bars. The enclosing async region owns the announcement.
|
|
54
|
+
*/
|
|
55
|
+
export declare function BarChartPlaceholder({ title, series, height, ...frame }: BarChartPlaceholderProps): ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Bars that compare an amount across named categories, grouped or stacked by series from a zero baseline. It also draws
|
|
58
|
+
* prepared composition buckets, reference lines, markers and short notes the application supplies.
|
|
59
|
+
*/
|
|
60
|
+
export declare function BarChart({ categories, series, domain, mode, valueFormat, tickFormat, valueLabel, highlighted, selected, onSelectedChange, height: plotHeight, composition, referenceLines, markers, annotations, emphasizedCategoryIds, ...figure }: BarChartProps): ReactNode;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
3
|
+
/** One series of bars: a value per category, in category order, or null where none was recorded. */
|
|
2
4
|
export type BarSeries = {
|
|
3
5
|
readonly id: string;
|
|
4
6
|
readonly label: string;
|
|
5
7
|
readonly values: ReadonlyArray<number | null>;
|
|
6
8
|
readonly tone?: ChartTone | undefined;
|
|
7
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* One category of a composition: `parts` stacks the series under a supplied total, `total` draws only the total, and
|
|
12
|
+
* `gap` draws nothing.
|
|
13
|
+
*/
|
|
8
14
|
export type BarBucket = {
|
|
9
15
|
readonly kind: 'parts' | 'total';
|
|
10
16
|
readonly total: number;
|
|
11
17
|
} | {
|
|
12
18
|
readonly kind: 'gap';
|
|
13
19
|
};
|
|
20
|
+
/** Supplied totals drawn as gray context behind the series, with an optional focused series. */
|
|
14
21
|
export type BarComposition = {
|
|
15
22
|
readonly buckets: ReadonlyArray<BarBucket>;
|
|
16
23
|
readonly contextLabel: string;
|
|
@@ -25,8 +32,9 @@ type CompositionInput = {
|
|
|
25
32
|
readonly composition: BarComposition | undefined;
|
|
26
33
|
readonly series: ReadonlyArray<BarSeries>;
|
|
27
34
|
readonly categoryIds: ReadonlyArray<string>;
|
|
28
|
-
readonly domain:
|
|
35
|
+
readonly domain: NumericDomain;
|
|
29
36
|
};
|
|
37
|
+
/** Why a composition cannot be drawn on the value domain, or undefined when it can. */
|
|
30
38
|
export declare function validateComposition({ composition, series, categoryIds, domain, }: CompositionInput): string | undefined;
|
|
31
39
|
/**
|
|
32
40
|
* A second value drawn on each bar of one series, on the value axis rather than the stack. A tick marks one value, such
|
|
@@ -61,13 +69,16 @@ type OverlayInput = {
|
|
|
61
69
|
readonly emphasizedCategoryIds: ReadonlyArray<string>;
|
|
62
70
|
readonly seriesIds: ReadonlyArray<string>;
|
|
63
71
|
readonly categoryIds: ReadonlyArray<string>;
|
|
64
|
-
readonly domain:
|
|
72
|
+
readonly domain: NumericDomain;
|
|
65
73
|
};
|
|
74
|
+
/** Why bar markers, annotations or emphasis cannot be drawn, or undefined when they can. */
|
|
66
75
|
export declare function validateBarOverlays({ markers, annotations, emphasizedCategoryIds, seriesIds, categoryIds, domain, }: OverlayInput): string | undefined;
|
|
67
|
-
|
|
76
|
+
/** A marker's exact value at one category, as the readout and the table write it. */
|
|
77
|
+
export declare function markerValueLabel({ marker, index, valueText, }: {
|
|
68
78
|
readonly marker: BarMarker;
|
|
69
79
|
readonly index: number;
|
|
70
|
-
|
|
80
|
+
/** Writes one value exactly, and a missing one as unavailable. */
|
|
81
|
+
readonly valueText: (value: number | null) => string;
|
|
71
82
|
}): string;
|
|
72
83
|
/** The highest value a marker draws at one category, so an annotation can clear it. */
|
|
73
84
|
export declare function markerPeak(marker: BarMarker, index: number): number | null;
|
|
@@ -14,16 +14,20 @@ type BarMarkersProps = {
|
|
|
14
14
|
readonly y: (value: number) => number;
|
|
15
15
|
readonly isReceded: (categoryId: string) => boolean;
|
|
16
16
|
};
|
|
17
|
+
/** A note above one bar, positioned in plot pixels. */
|
|
17
18
|
export type PlacedAnnotation = {
|
|
18
19
|
readonly id: string;
|
|
19
|
-
readonly
|
|
20
|
+
readonly text: string;
|
|
20
21
|
readonly x: number;
|
|
21
22
|
readonly y: number;
|
|
22
23
|
readonly isReceded: boolean;
|
|
23
24
|
};
|
|
24
|
-
/** Draws each marker's tick or whisker over its bar
|
|
25
|
+
/** Draws each marker's tick or whisker over its bar, on the value axis rather than the stack. */
|
|
25
26
|
export declare function BarMarkers({ markers, categoryIds, span, barTop, y, isReceded }: BarMarkersProps): ReactNode;
|
|
26
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Notes above their bars, kept inside the plot's horizontal bounds. Where notes would touch, as on a narrow plot, the
|
|
29
|
+
* later ones are left out of the plot; they stay in the readout and the exact values.
|
|
30
|
+
*/
|
|
27
31
|
export declare function BarAnnotations({ annotations, left, right, }: {
|
|
28
32
|
readonly annotations: ReadonlyArray<PlacedAnnotation>;
|
|
29
33
|
readonly left: number;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { BreakdownItem } from '../categorical-values.tsx';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
readonly report?: ChartReport | undefined;
|
|
7
|
-
readonly description?: string | undefined;
|
|
3
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
4
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
5
|
+
export type BreakdownBarProps = FigureProps & FigureSelectionProps & {
|
|
8
6
|
readonly items: ReadonlyArray<BreakdownItem>;
|
|
7
|
+
/** The declared whole. Recorded values may fall short of it; the rest is shown as unassigned. */
|
|
9
8
|
readonly total: number;
|
|
10
|
-
readonly
|
|
11
|
-
readonly selection?: ChartSelection | undefined;
|
|
9
|
+
readonly valueFormat: ValueFormat;
|
|
12
10
|
};
|
|
13
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The parts of one declared total as a single strip with a row per part. Use it when the whole and an unassigned
|
|
13
|
+
* remainder matter; the application supplies every part and the total.
|
|
14
|
+
*/
|
|
15
|
+
export declare function BreakdownBar({ items, total, valueFormat, selected, onSelectedChange, ...figure }: BreakdownBarProps): ReactNode;
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
3
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
4
|
+
import type { PlotHeight } from '../plot/plot-layout.ts';
|
|
5
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
3
6
|
import type { BridgeStep } from './bridge-data.ts';
|
|
4
7
|
import type { ChartReferenceLine } from './reference-lines.tsx';
|
|
5
8
|
export type { BridgeStep } from './bridge-data.ts';
|
|
6
|
-
export type BridgeChartProps = {
|
|
7
|
-
readonly title: string;
|
|
8
|
-
readonly description?: ReactNode;
|
|
9
|
-
readonly report?: ChartReport | undefined;
|
|
9
|
+
export type BridgeChartProps = FigureProps & FigureSelectionProps & {
|
|
10
10
|
readonly steps: ReadonlyArray<BridgeStep>;
|
|
11
|
-
/**
|
|
12
|
-
readonly
|
|
13
|
-
/**
|
|
14
|
-
readonly
|
|
15
|
-
/**
|
|
16
|
-
readonly
|
|
17
|
-
/**
|
|
18
|
-
|
|
11
|
+
/** How totals and running levels are written in labels, inspection and exact values. */
|
|
12
|
+
readonly valueFormat: ValueFormat;
|
|
13
|
+
/** How a signed change is written. Absent writes the value format with its sign. */
|
|
14
|
+
readonly changeFormat?: ValueFormat | undefined;
|
|
15
|
+
/** How the value axis writes its ticks. Absent uses the compact form of `valueFormat`. */
|
|
16
|
+
readonly tickFormat?: ValueFormat | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The value axis title, with its unit: "Cost (USD)". With a title the ticks leave a `unit` style out, so the unit
|
|
19
|
+
* is written once. Absent draws no title.
|
|
20
|
+
*/
|
|
21
|
+
readonly valueLabel?: string | undefined;
|
|
22
|
+
/** A fixed value domain shared with related charts. Absent fits zero and every running total on round bounds. */
|
|
23
|
+
readonly domain?: NumericDomain | undefined;
|
|
19
24
|
/** Labelled values drawn across the plot, such as a target for the final total. */
|
|
20
25
|
readonly referenceLines?: ReadonlyArray<ChartReferenceLine> | undefined;
|
|
21
|
-
readonly
|
|
22
|
-
readonly height?: number | undefined;
|
|
26
|
+
readonly height?: PlotHeight | undefined;
|
|
23
27
|
};
|
|
24
28
|
/**
|
|
25
29
|
* Explains how a starting total becomes a result through signed changes, such as an amount and the deductions that
|
|
26
30
|
* leave a remainder. Columns float from the running total, and dashed connectors carry it to the next step. Use
|
|
27
31
|
* BarChart for independent categories and BreakdownBar for parts of one total; the application supplies every change.
|
|
28
32
|
*/
|
|
29
|
-
export declare function BridgeChart({
|
|
33
|
+
export declare function BridgeChart({ steps, valueFormat, changeFormat, tickFormat, valueLabel, domain, referenceLines, selected, onSelectedChange, height: plotHeight, ...figure }: BridgeChartProps): ReactNode;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
2
3
|
/**
|
|
3
4
|
* One column of a bridge; the first is the start total. A change adds its signed value to the running total, and a
|
|
4
5
|
* missing change leaves later levels unknown. A total shows the running total so far, such as a subtotal or the
|
|
@@ -31,10 +32,10 @@ export type BridgeLevel = {
|
|
|
31
32
|
};
|
|
32
33
|
/** Stacks the supplied changes into running levels; totals start at zero and missing changes stay unknown. */
|
|
33
34
|
export declare function bridgeLevels(steps: ReadonlyArray<BridgeStep>): ReadonlyArray<BridgeLevel>;
|
|
34
|
-
|
|
35
|
-
export declare function bridgeDomain(levels: ReadonlyArray<BridgeLevel>):
|
|
35
|
+
/** The span of zero and every known running level, which any domain for the bridge must contain. */
|
|
36
|
+
export declare function bridgeDomain(levels: ReadonlyArray<BridgeLevel>): NumericDomain;
|
|
37
|
+
/** Why steps cannot form a bridge on the domain, or undefined when they can. */
|
|
36
38
|
export declare function validateBridge({ steps, domain, }: {
|
|
37
39
|
readonly steps: ReadonlyArray<BridgeStep>;
|
|
38
|
-
readonly domain?:
|
|
40
|
+
readonly domain?: NumericDomain | undefined;
|
|
39
41
|
}): string | undefined;
|
|
40
|
-
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { MarkState } from '../plot/plot-marks.tsx';
|
|
2
4
|
import type { BarBucket, BarSeries } from './bar-data.ts';
|
|
3
|
-
type CompositionBarsProps = {
|
|
5
|
+
type CompositionBarsProps = MarkState & {
|
|
4
6
|
readonly bucket: BarBucket;
|
|
5
7
|
readonly series: ReadonlyArray<BarSeries>;
|
|
6
8
|
readonly focusedSeries: BarSeries | undefined;
|
|
@@ -8,8 +10,10 @@ type CompositionBarsProps = {
|
|
|
8
10
|
readonly x: number;
|
|
9
11
|
readonly width: number;
|
|
10
12
|
readonly y: (value: number) => number;
|
|
11
|
-
readonly
|
|
12
|
-
|
|
13
|
+
readonly highlighted?: string | null | undefined;
|
|
14
|
+
/** The resolved tone of a series. */
|
|
15
|
+
readonly toneOf: (id: string) => ChartTone;
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
/** One composition bucket: its supplied total as gray context and its parts or focused series over it. */
|
|
18
|
+
export declare function CompositionBars({ bucket, series, focusedSeries, index, x, width, y, isSelected, isInspected, highlighted, toneOf, }: CompositionBarsProps): ReactNode;
|
|
15
19
|
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export type { BarSeries, BarBucket, BarComposition, BarChartProps, BarChartPlaceholderProps, BarMarker, BarAnnotation, } from './bar-chart.tsx';
|
|
1
|
+
export type { BarSeries, BarBucket, BarCategory, BarComposition, BarChartProps, BarChartPlaceholderProps, BarMarker, BarAnnotation, } from './bar-chart.tsx';
|
|
2
2
|
export { BarChart, BarChartPlaceholder } from './bar-chart.tsx';
|
|
3
3
|
export type { BreakdownBarProps } from './breakdown-bar.tsx';
|
|
4
4
|
export { BreakdownBar } from './breakdown-bar.tsx';
|
|
5
5
|
export type { BridgeChartProps, BridgeStep } from './bridge-chart.tsx';
|
|
6
6
|
export { BridgeChart } from './bridge-chart.tsx';
|
|
7
7
|
export type { ChartReferenceLine } from './reference-lines.tsx';
|
|
8
|
-
export type { ScatterPoint, ScatterRange, ScatterRangeDetails,
|
|
9
|
-
export {
|
|
10
|
-
export type { SparklineProps, SparklinePoint } from './sparkline.tsx';
|
|
8
|
+
export type { ScatterPoint, ScatterRange, ScatterRangeDetails, ScatterPlotProps } from './scatter-plot.tsx';
|
|
9
|
+
export { ScatterPlot, scatterLimits } from './scatter-plot.tsx';
|
|
10
|
+
export type { SparklineLayout, SparklineProps, SparklinePoint } from './sparkline.tsx';
|
|
11
11
|
export { Sparkline } from './sparkline.tsx';
|
|
12
12
|
export type { TimeSeriesPoint, TimeSeries, TimeSeriesMarker } from './time-series-data.ts';
|
|
13
13
|
export { timeSeriesLimits } from './time-series-data.ts';
|
|
14
14
|
export type { TimeSeriesBand, TimeSeriesBandPoint, TimeSeriesCrossing } from './time-series-bands.ts';
|
|
15
15
|
export { timeSeriesBandLimits } from './time-series-bands.ts';
|
|
16
|
-
export type { TimeSeriesChartProps, TimeSeriesChartPlaceholderProps, AreaChartProps, SmallMultiplesProps, SmallMultiplesPlaceholderProps,
|
|
16
|
+
export type { TimeSeriesChartProps, TimeSeriesChartPlaceholderProps, AreaChartProps, SmallMultiplesProps, SmallMultiplesPlaceholderProps, SmallMultiplesPanel, TimestampUnit, } from './time-series.tsx';
|
|
17
17
|
export type { ChartRangeDetails, ChartRangeValue } from '../chart-range.tsx';
|
|
18
18
|
export { LineChart, AreaChart, SmallMultiples, SmallMultiplesPlaceholder, TimeSeriesChartPlaceholder, } from './time-series.tsx';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
3
|
+
import type { LabelBox, LabelObstacle } from '../plot/label-place.ts';
|
|
4
|
+
import type { PlotBox } from '../plot/plot-layout.ts';
|
|
5
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
6
|
+
import type { PlacedLabel } from './value-labels.ts';
|
|
3
7
|
/**
|
|
4
8
|
* A labelled value drawn across the plot, such as a target or a period average. The application supplies the value and
|
|
5
9
|
* its meaning; the chart neither computes nor ranks it.
|
|
@@ -8,27 +12,30 @@ export type ChartReferenceLine = {
|
|
|
8
12
|
readonly id: string;
|
|
9
13
|
readonly label: string;
|
|
10
14
|
readonly value: number;
|
|
11
|
-
/** Colors the line. Absent means
|
|
15
|
+
/** Colors the line. Absent means ink; the label always uses text colors. */
|
|
12
16
|
readonly tone?: ChartTone | undefined;
|
|
13
17
|
};
|
|
18
|
+
/** Why reference lines cannot be drawn on a value axis, or undefined when they can. */
|
|
14
19
|
export declare function validateReferenceLines({ lines, domain, }: {
|
|
15
20
|
readonly lines: ReadonlyArray<ChartReferenceLine>;
|
|
16
|
-
readonly domain:
|
|
21
|
+
readonly domain: NumericDomain;
|
|
17
22
|
}): string | undefined;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Dashed reference lines across a plot, each named with its exact value. A label sits above its line at the plot's
|
|
25
|
+
* right end, or else at the left end, or else further along the line, then below it. It takes the first place that
|
|
26
|
+
* clears the chart's own value labels and the marks it is given, and labels that would touch are spread apart
|
|
27
|
+
* vertically, never dropped.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ReferenceMarks({ lines, box, position, valueText, avoid, marks, obstacles, }: {
|
|
24
30
|
readonly lines: ReadonlyArray<ChartReferenceLine>;
|
|
25
|
-
readonly
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
|
|
30
|
-
readonly
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
readonly box: PlotBox;
|
|
32
|
+
/** Where a value sits on the plot's value axis. */
|
|
33
|
+
readonly position: (value: number) => number;
|
|
34
|
+
readonly valueText: (value: number) => string;
|
|
35
|
+
/** Labels the chart draws in the plot, such as a column's value, that a reference label must not cover. */
|
|
36
|
+
readonly avoid?: ReadonlyArray<PlacedLabel> | undefined;
|
|
37
|
+
/** The boxes of marks a reference label must not sit on, such as the columns of a bridge. */
|
|
38
|
+
readonly marks?: ReadonlyArray<LabelBox> | undefined;
|
|
39
|
+
/** The lines a reference label must not sit on, such as a chart's series, as pixel polylines. */
|
|
40
|
+
readonly obstacles?: ReadonlyArray<ReadonlyArray<LabelObstacle>> | undefined;
|
|
41
|
+
}): ReactNode;
|
|
@@ -2,43 +2,48 @@ import type { ChangeDetails } from '@ui-sdk/core';
|
|
|
2
2
|
import type { ComponentProps, ReactNode } from 'react';
|
|
3
3
|
import { Slider } from '../../../forms/src/index.ts';
|
|
4
4
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
5
|
-
import type {
|
|
5
|
+
import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
|
|
6
|
+
import type { PlotAxis, PlotHeight } from '../plot/plot-layout.ts';
|
|
7
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
8
|
+
/** One supplied coordinate pair with a stable id, so selection survives reordering. */
|
|
6
9
|
export type ScatterPoint = {
|
|
7
10
|
readonly id: string;
|
|
8
11
|
readonly label: string;
|
|
9
12
|
readonly x: number;
|
|
10
13
|
readonly y: number;
|
|
11
|
-
readonly tone
|
|
14
|
+
readonly tone?: ChartTone | undefined;
|
|
12
15
|
};
|
|
16
|
+
/** A rectangle of coordinates, in axis values, that the reader selected. */
|
|
13
17
|
export type ScatterRange = {
|
|
14
|
-
readonly x:
|
|
15
|
-
readonly y:
|
|
18
|
+
readonly x: NumericDomain;
|
|
19
|
+
readonly y: NumericDomain;
|
|
16
20
|
};
|
|
17
21
|
type SliderDetails = Parameters<NonNullable<ComponentProps<typeof Slider.Root<[number, number]>>['onValueChange']>>[1];
|
|
18
22
|
/** Why the range changed: a drag on the plot, one of the bound sliders, or the clear button. */
|
|
19
23
|
export type ScatterRangeDetails = ChangeDetails<'drag' | 'clear-press'> | SliderDetails;
|
|
20
|
-
export type
|
|
21
|
-
readonly value: ScatterRange | null;
|
|
22
|
-
readonly onChange: (range: ScatterRange | null, details: ScatterRangeDetails) => void;
|
|
23
|
-
readonly xStep: number;
|
|
24
|
-
readonly yStep: number;
|
|
25
|
-
readonly locale: string;
|
|
26
|
-
};
|
|
27
|
-
export type ScatterPlotProps = {
|
|
28
|
-
readonly title: string;
|
|
29
|
-
readonly report?: ChartReport | undefined;
|
|
30
|
-
readonly description: string;
|
|
24
|
+
export type ScatterPlotProps = FigureProps & FigureSelectionProps & {
|
|
31
25
|
readonly points: ReadonlyArray<ScatterPoint>;
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
|
|
35
|
-
readonly
|
|
36
|
-
|
|
37
|
-
readonly
|
|
38
|
-
|
|
39
|
-
readonly
|
|
40
|
-
|
|
26
|
+
readonly x: PlotAxis;
|
|
27
|
+
readonly y: PlotAxis;
|
|
28
|
+
/** The coordinate range the application holds, or null for none. */
|
|
29
|
+
readonly range?: ScatterRange | null | undefined;
|
|
30
|
+
/** Asks the application to set or clear the range. With it, the plot offers a drag and two range sliders. */
|
|
31
|
+
readonly onRangeChange?: ((range: ScatterRange | null, details: ScatterRangeDetails) => void) | undefined;
|
|
32
|
+
/** The slider steps on each axis, in axis units. Required with `onRangeChange`. */
|
|
33
|
+
readonly rangeStep?: {
|
|
34
|
+
readonly x: number;
|
|
35
|
+
readonly y: number;
|
|
36
|
+
} | undefined;
|
|
37
|
+
readonly height?: PlotHeight | undefined;
|
|
38
|
+
};
|
|
39
|
+
/** The most points one scatter plot draws. Supply a labelled sample or window for more. */
|
|
40
|
+
export declare const scatterLimits: {
|
|
41
|
+
readonly points: 1000;
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Supplied coordinates as points on two measured axes, such as an embedding projection or cost against quality. Either
|
|
45
|
+
* axis can be linear, log or symlog, points can be selected, and a coordinate range can be drawn by dragging or set
|
|
46
|
+
* with two range sliders. The application computes positions, and the plot never infers similarity or causation.
|
|
47
|
+
*/
|
|
43
48
|
export declare function ScatterPlot(props: ScatterPlotProps): ReactNode;
|
|
44
49
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
2
3
|
import type { TimeSeries } from './time-series-data.ts';
|
|
3
4
|
/** A recorded point a sparkline can mark: the lowest, the highest, or the latest present observation. */
|
|
4
5
|
export type SparklinePoint = 'minimum' | 'maximum' | 'last';
|
|
@@ -8,7 +9,7 @@ export type SparklineProps = {
|
|
|
8
9
|
readonly unit: string;
|
|
9
10
|
readonly timestampUnit: 'seconds' | 'milliseconds';
|
|
10
11
|
readonly series: TimeSeries;
|
|
11
|
-
readonly valueDomain:
|
|
12
|
+
readonly valueDomain: NumericDomain;
|
|
12
13
|
/**
|
|
13
14
|
* Marks these recorded points: hollow rings at the first lowest and highest values, and a solid dot at the latest.
|
|
14
15
|
* Their values join the accessible description. Absent marks nothing.
|
|
@@ -16,5 +17,16 @@ export type SparklineProps = {
|
|
|
16
17
|
readonly markedPoints?: ReadonlyArray<SparklinePoint> | undefined;
|
|
17
18
|
/** Draws a faint reference value, such as a target, inside `valueDomain`. Absent draws none. */
|
|
18
19
|
readonly baseline?: number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* `inline` (the default) draws a 128 by 32 pixel mark to sit beside a number or in a table cell. The `figure` value
|
|
22
|
+
* sets it in the figure frame, with its title and summary shown, filling the width its container gives it.
|
|
23
|
+
*/
|
|
24
|
+
readonly layout?: SparklineLayout | undefined;
|
|
19
25
|
};
|
|
20
|
-
|
|
26
|
+
/** Where a sparkline sits: inline beside text, or as a small figure of its own. */
|
|
27
|
+
export type SparklineLayout = 'inline' | 'figure';
|
|
28
|
+
/**
|
|
29
|
+
* A passive trend of one measure: a line on a supplied value domain, with optional marked points and a reference value.
|
|
30
|
+
* The application supplies the summary sentence that states what the line shows.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Sparkline({ title, summary, unit, timestampUnit, series, valueDomain, markedPoints, baseline, layout, }: SparklineProps): ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
|
-
import type { TimeSeries } from './time-series-data.ts';
|
|
2
|
+
import type { TimeSeries, ToneResolver } from './time-series-data.ts';
|
|
3
3
|
/** One observation of a band. Both bounds are present or both are missing; a missing center draws no line there. */
|
|
4
4
|
export type TimeSeriesBandPoint = {
|
|
5
5
|
readonly timestamp: number;
|
|
@@ -52,9 +52,10 @@ export declare function validateBands({ bands, crossings, series, timestamps, }:
|
|
|
52
52
|
readonly series: ReadonlyArray<TimeSeries>;
|
|
53
53
|
readonly timestamps: ReadonlyArray<number>;
|
|
54
54
|
}): string | undefined;
|
|
55
|
-
export declare function prepareBands({ series, bands, }: {
|
|
55
|
+
export declare function prepareBands({ series, bands, tones, }: {
|
|
56
56
|
readonly series: ReadonlyArray<TimeSeries>;
|
|
57
57
|
readonly bands: ReadonlyArray<TimeSeriesBand>;
|
|
58
|
+
readonly tones: ToneResolver;
|
|
58
59
|
}): ReadonlyArray<PlotBand>;
|
|
59
60
|
export declare function findCrossings({ crossings, series, bands, }: {
|
|
60
61
|
readonly crossings: ReadonlyArray<TimeSeriesCrossing>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
|
+
import type { ToneInput } from '../figure/tone-scope.tsx';
|
|
3
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
2
4
|
export type TimeSeriesPoint = {
|
|
3
5
|
readonly timestamp: number;
|
|
4
6
|
readonly value: number | null;
|
|
@@ -47,6 +49,8 @@ export declare const timeSeriesLimits: {
|
|
|
47
49
|
readonly markers: 200;
|
|
48
50
|
readonly panels: 12;
|
|
49
51
|
};
|
|
52
|
+
/** Resolves a record's tone, as `useTones` returns it. */
|
|
53
|
+
export type ToneResolver = (input: ToneInput) => ChartTone;
|
|
50
54
|
export declare function validateTimeSeries({ series, isStacked, markers, timeline, }: {
|
|
51
55
|
readonly series: ReadonlyArray<TimeSeries>;
|
|
52
56
|
readonly isStacked: boolean;
|
|
@@ -60,5 +64,11 @@ export declare function timeSeriesSignature({ series, markers, timestampUnit, is
|
|
|
60
64
|
readonly timestampUnit: string;
|
|
61
65
|
readonly isStacked: boolean;
|
|
62
66
|
}): string;
|
|
63
|
-
|
|
64
|
-
export declare function
|
|
67
|
+
/** The time an axis spans: the first to the last observation, widened around a lone one so it sits mid-plot. */
|
|
68
|
+
export declare function observationDomain(minimum: number, maximum: number): NumericDomain;
|
|
69
|
+
/** Stacks the series when asked and gives each its tone. An explicit tone takes no automatic slot. */
|
|
70
|
+
export declare function prepareTimeSeries({ series, isStacked, tones, }: {
|
|
71
|
+
readonly series: ReadonlyArray<TimeSeries>;
|
|
72
|
+
readonly isStacked: boolean;
|
|
73
|
+
readonly tones: ToneResolver;
|
|
74
|
+
}): ReadonlyArray<PlotSeries>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { PlotSeries } from './time-series-data.ts';
|
|
3
|
-
|
|
3
|
+
/** A sparkline's line: broken at gaps, with dots beside each gap, on a lone observation and at the latest one. */
|
|
4
|
+
export declare function TimeSeriesLine({ series, x, y, pointRadius, }: {
|
|
4
5
|
readonly series: PlotSeries;
|
|
5
6
|
readonly x: (timestamp: number) => number;
|
|
6
7
|
readonly y: (value: number) => number;
|
|
7
|
-
readonly inspectedTimestamp?: number | undefined;
|
|
8
8
|
readonly pointRadius?: number | undefined;
|
|
9
9
|
}): ReactNode;
|
|
@@ -18,18 +18,20 @@ type LaneInput = {
|
|
|
18
18
|
};
|
|
19
19
|
/** Places each label beside its guide in the first lane where it fits, flipping before the plot's right edge. */
|
|
20
20
|
export declare function placeInstants({ instants, x, right }: LaneInput): ReadonlyArray<PlacedInstant>;
|
|
21
|
-
|
|
21
|
+
/** The room the instants' label lanes take above the plot. */
|
|
22
|
+
export declare function instantsInset(placed: ReadonlyArray<PlacedInstant>): number;
|
|
22
23
|
type Scales = {
|
|
23
24
|
readonly x: (timestamp: number) => number;
|
|
24
25
|
readonly y: (value: number) => number;
|
|
25
26
|
};
|
|
26
|
-
/** Shades each band between its bounds
|
|
27
|
+
/** Shades each band between its bounds and draws its center line over the shade. */
|
|
27
28
|
export declare function TimeSeriesBands({ bands, x, y }: Scales & {
|
|
28
29
|
readonly bands: ReadonlyArray<PlotBand>;
|
|
29
30
|
}): ReactNode;
|
|
30
|
-
/** Draws each instant's guide from its label lane to the axis, with a ring where a crossing lands. */
|
|
31
|
-
export declare function TimeInstants({ placed, x, y, bottom, }: Scales & {
|
|
31
|
+
/** Draws each instant's guide from its label lane above the plot to the axis, with a ring where a crossing lands. */
|
|
32
|
+
export declare function TimeInstants({ placed, x, y, top, bottom, }: Scales & {
|
|
32
33
|
readonly placed: ReadonlyArray<PlacedInstant>;
|
|
34
|
+
readonly top: number;
|
|
33
35
|
readonly bottom: number;
|
|
34
36
|
}): ReactNode;
|
|
35
37
|
export {};
|