@umriss-ui/charts 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/dist/de.d.ts CHANGED
@@ -82,6 +82,9 @@ declare interface ChartsWording {
82
82
  /** Added to the caption where the table shows the downsampled course:
83
83
  how many readings its rows stand for. */
84
84
  downsampled: (readings: number) => string;
85
+ /** Added to the name of a matrix' legend entry that has a colour bar: the range its colours span, both ends
86
+ written in the matrix' format. The bar's own values are hidden from assistive technology. */
87
+ levelRange: (from: string, to: string) => string;
85
88
  }
86
89
 
87
90
  /** The German instance, for a chart's `wording`. Complete, because it is
package/dist/index.d.ts CHANGED
@@ -50,6 +50,13 @@ export declare interface AreaProps<T> {
50
50
  stays whole.
51
51
  @default a solid outline */
52
52
  dash?: readonly number[];
53
+ /** The longest step between two readings that is still filled through, in
54
+ the x axis' units: milliseconds on a time axis, working time on a
55
+ calendar axis, places on a category axis. A longer step is a gap: the
56
+ area closes on both sides of it. A pointer farther than this from the
57
+ nearest reading finds no hit. In a `stack` this is not read.
58
+ @default no limit, a stretch without rows is bridged */
59
+ maxGap?: number;
53
60
  }
54
61
 
55
62
  /** An `Area` as the chart holds it once registered. */
@@ -62,6 +69,8 @@ export declare interface AreaSeriesConfig<T = unknown> extends SeriesBase<T>, St
62
69
  strokeWidth: number;
63
70
  /** Dash pattern of the outline. */
64
71
  dash?: readonly number[];
72
+ /** A step between readings longer than this is a gap; not read in a stack. */
73
+ maxGap?: number;
65
74
  }
66
75
 
67
76
  /** What the value is, given the limit set. A pure function of the two.
@@ -176,6 +185,12 @@ export declare interface BarProps<T> {
176
185
  /** Height - a number field of the row or a function of it;
177
186
  null/undefined/NaN/±Infinity means a gap. */
178
187
  value: Value<T>;
188
+ /** Lower edge - a number field of the row or a function of it: the bar
189
+ floats from here to `value`, either way up. A gap in either edge leaves
190
+ the bar out. In a `stack` the stack below is the lower edge, and this is
191
+ not read.
192
+ @default a fixed baseline at 0 */
193
+ baseline?: Value<T>;
179
194
  /** Binding to an x axis. */
180
195
  xAxisId?: string;
181
196
  /** Binding to a y axis. */
@@ -213,6 +228,8 @@ export declare interface BarProps<T> {
213
228
  /** A `Bar` as the chart holds it once registered. */
214
229
  export declare interface BarSeriesConfig<T = unknown> extends SeriesBase<T>, Stackable {
215
230
  kind: "bar";
231
+ /** Lower edge; without a value the fixed baseline 0. */
232
+ baseline?: ValueFunction<T>;
216
233
  /** Width as a fraction of the step; the group shares this fraction. */
217
234
  barWidth: number;
218
235
  }
@@ -234,9 +251,10 @@ export declare interface Bin {
234
251
  A value on an edge belongs to the bin that edge starts - `[from, to)` - but
235
252
  the last bin is closed, so the greatest value of a domain is counted and not
236
253
  lost. Values that are not finite (`NaN`, ±Infinity, `null`, `undefined`)
237
- are skipped, as a gap is on a chart. Without values there are no bins; with
254
+ are skipped, as a gap is on a chart. The values may be a typed array
255
+ (`Float64Array`, `Int32Array`): they are read by index. Without values there are no bins; with
238
256
  values there is at least one, even when they are all equal. */
239
- export declare function bin(values: readonly (number | null | undefined)[], options?: BinOptions): Bin[];
257
+ export declare function bin(values: ArrayLike<number | null | undefined>, options?: BinOptions): Bin[];
240
258
 
241
259
  export declare function bin<T>(rows: readonly T[], value: (row: T) => number | null | undefined, options?: BinOptions): Bin[];
242
260
 
@@ -630,6 +648,9 @@ export declare interface ChartsWording {
630
648
  /** Added to the caption where the table shows the downsampled course:
631
649
  how many readings its rows stand for. */
632
650
  downsampled: (readings: number) => string;
651
+ /** Added to the name of a matrix' legend entry that has a colour bar: the range its colours span, both ends
652
+ written in the matrix' format. The bar's own values are hidden from assistive technology. */
653
+ levelRange: (from: string, to: string) => string;
633
654
  }
634
655
 
635
656
  /** How a reader is looking at a chart. Whatever is at its default is absent. */
@@ -816,14 +837,16 @@ export declare function Legend({ placement }: LegendProps): ReactNode;
816
837
 
817
838
  /** A `Legend` as the chart holds it once registered. */
818
839
  export declare interface LegendConfig {
819
- placement: "top" | "bottom";
840
+ placement: "top" | "bottom" | "left" | "right";
820
841
  }
821
842
 
822
843
  /** The props of `Legend`. */
823
844
  export declare interface LegendProps {
824
- /** Which side of the plot area the legend stands on.
845
+ /** Which side of the plot area the legend stands on. `"left"` and `"right"` set the entries in a column beside
846
+ the plot, as wide as the longest name up to a quarter of the chart, scrolling where they do not fit; in a
847
+ chart narrower than 480 px they stand above the plot, as `"top"`.
825
848
  @default "top" */
826
- placement?: "top" | "bottom";
849
+ placement?: "top" | "bottom" | "left" | "right";
827
850
  }
828
851
 
829
852
  /** A bound: a value, a side and a severity. No more - a tolerance band is
@@ -999,6 +1022,13 @@ export declare interface LineProps<T> {
999
1022
  and jumps there - a target, a digital signal. A gap ends the hold at
1000
1023
  its x. The tooltip reports the sample the hold began with. */
1001
1024
  step?: boolean;
1025
+ /** The longest step between two readings that is still drawn through, in the
1026
+ x axis' units: milliseconds on a time axis, working time on a calendar
1027
+ axis, places on a category axis. A longer step is a gap: the line breaks
1028
+ and a `step` hold ends `maxGap` after its reading. A pointer farther than
1029
+ this from the nearest reading finds no hit on the series.
1030
+ @default no limit, a stretch without rows is bridged */
1031
+ maxGap?: number;
1002
1032
  }
1003
1033
 
1004
1034
  /** A `Line` as the chart holds it once registered. */
@@ -1009,6 +1039,8 @@ export declare interface LineSeriesConfig<T = unknown> extends SeriesBase<T> {
1009
1039
  markers: "auto" | "always" | "never";
1010
1040
  /** Sample-and-hold: each value holds until the next sample. */
1011
1041
  step?: boolean;
1042
+ /** A step between readings longer than this is a gap. */
1043
+ maxGap?: number;
1012
1044
  }
1013
1045
 
1014
1046
  /** The fields of a row whose value is a list of numbers, or absent. */
@@ -1079,7 +1111,8 @@ export declare interface MatrixProps<T> {
1079
1111
  function of it. A missing level is a hole, not a zero. */
1080
1112
  level: Value<T>;
1081
1113
  /** How the level colours a cell: by assessment against limits, or across
1082
- a gradient.
1114
+ a gradient. A gradient's legend entry shows a colour bar: its steps, with the range's two ends written under
1115
+ them in `format` and the inner edges where they fit. An assessment keeps its three colours.
1083
1116
  @default { kind: "gradient", stops: DEFAULT_GRADIENT } */
1084
1117
  coloring?: MatrixColoring;
1085
1118
  /** Binding to an x axis. */
@@ -1096,6 +1129,13 @@ export declare interface MatrixProps<T> {
1096
1129
  row, not the level.
1097
1130
  @default the built-in number format */
1098
1131
  format?: ValueFormat;
1132
+ /** Each cell writes its level in `format`, in the tick size, in the text
1133
+ colour over a halo of the ground colour - legible on every stop, in both
1134
+ themes and in forced colours. A cell too small for its text is left
1135
+ without one, never truncated; a hole has none. Off by default: a dense
1136
+ heat map would be all clipped text.
1137
+ @default false */
1138
+ labels?: boolean;
1099
1139
  }
1100
1140
 
1101
1141
  /** A `Matrix` as the chart holds it once registered: its base accessor is the
@@ -1108,6 +1148,8 @@ export declare interface MatrixSeriesConfig<T = unknown> extends SeriesBase<T> {
1108
1148
  The base accessor yields the row position, not this level. */
1109
1149
  level: ValueFunction<T>;
1110
1150
  coloring: MatrixColoring;
1151
+ /** Each cell writes its level. */
1152
+ labels?: boolean;
1111
1153
  }
1112
1154
 
1113
1155
  /** One minute in milliseconds. */
@@ -1271,6 +1313,8 @@ export declare interface ResolvedTheme {
1271
1313
  colorOk: string;
1272
1314
  font: string;
1273
1315
  fontMono: string;
1316
+ /** The tick label's size in pixels (`--uc-size-tick`). */
1317
+ sizeTick: number;
1274
1318
  series: readonly string[];
1275
1319
  /** The page is in forced colours: every colour above is a system colour, and
1276
1320
  the chart encodes by marks whatever its `encoding`. */
@@ -1496,6 +1540,11 @@ export declare interface TooltipPoint<T = unknown> {
1496
1540
  yValue: number;
1497
1541
  datum: T;
1498
1542
  index: number;
1543
+ /** The lower edge, where the series has a baseline of its own - a `Bar` or
1544
+ an `Area` outside a stack; `yValue` is the upper one. A stack's foot is no
1545
+ reading and never stands here. A field of its own, as `level` and `box`
1546
+ have (ADR-0011). */
1547
+ baseline?: number;
1499
1548
  /** Only for the matrix: its level, out of the level channel. It stands here and
1500
1549
  not in yValue, because yValue is the position on the y axis - for a matrix
1501
1550
  therefore the row. Putting both into one field would be exactly the
@@ -35,6 +35,7 @@ const r = {
35
35
  notch: "Notch",
36
36
  count: "n",
37
37
  outlierList: (e, n) => `${e.length + n}: ${e.join(", ")}${n > 0 ? ` und ${n} weitere` : ""}`,
38
+ levelRange: (e, n) => `von ${e} bis ${n}`,
38
39
  downsampled: (e) => `Ausgedünnt aus ${e.toLocaleString("de-DE")} Messwerten: erster, kleinster, größter und letzter Wert je Abschnitt.`
39
40
  };
40
41
  export {