@umriss-ui/charts 0.6.0 → 0.8.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/CHANGELOG.md +115 -8
- package/README.md +21 -12
- package/dist/charts.css +1 -1
- package/dist/charts.js +1662 -1075
- package/dist/de.d.ts +18 -0
- package/dist/index.d.ts +168 -96
- package/dist/wording/de.js +13 -5
- package/docs/llms-full.md +5318 -0
- package/package.json +4 -3
package/dist/de.d.ts
CHANGED
|
@@ -18,10 +18,28 @@ declare interface ChartsWording {
|
|
|
18
18
|
value: string;
|
|
19
19
|
x: string;
|
|
20
20
|
}[]) => string;
|
|
21
|
+
/** The last row of a stack in the tooltip and the readout: the sum of its
|
|
22
|
+
members at the point (charts-stacking K4). */
|
|
23
|
+
stackTotal: string;
|
|
24
|
+
/** A share in a normalised stack, its number already formatted (K5). */
|
|
25
|
+
percent: (value: string) => string;
|
|
21
26
|
/** The keys that walk the chart. */
|
|
22
27
|
walkHelp: string;
|
|
23
28
|
/** The keys that zoom and pan it - only where the chart can be zoomed. */
|
|
24
29
|
zoomHelp: string;
|
|
30
|
+
/** The data table's disclosure key, closed and open (charts-alternatives
|
|
31
|
+
C1). */
|
|
32
|
+
showData: string;
|
|
33
|
+
hideData: string;
|
|
34
|
+
/** The heading of the table's x column where its axis has no `label`, and
|
|
35
|
+
of a matrix' row column where its y axis has none. */
|
|
36
|
+
positionColumn: string;
|
|
37
|
+
rowColumn: string;
|
|
38
|
+
/** The table's caption: the visible stretch it lists, both ends formatted. */
|
|
39
|
+
tableCaption: (from: string, to: string) => string;
|
|
40
|
+
/** Added to the caption where the table shows the downsampled course (C2):
|
|
41
|
+
how many readings its rows stand for. */
|
|
42
|
+
downsampled: (readings: number) => string;
|
|
25
43
|
}
|
|
26
44
|
|
|
27
45
|
export declare const GERMAN_CHARTS_WORDING: ChartsWording;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ export declare function Area<T>(props: AreaProps<T>): null;
|
|
|
12
12
|
export declare interface AreaProps<T> {
|
|
13
13
|
/** Upper edge; null/undefined/NaN/±Infinity means a gap (R-2.5). */
|
|
14
14
|
accessor: Accessor<T>;
|
|
15
|
-
/** Lower edge; without a value the fixed baseline 0.
|
|
15
|
+
/** Lower edge; without a value the fixed baseline 0. In a `stack` the stack
|
|
16
|
+
below is the lower edge, and this is not read. */
|
|
16
17
|
baseline?: Accessor<T>;
|
|
17
18
|
/** Binding to an x axis (R-4.12). */
|
|
18
19
|
xAxisId?: string;
|
|
@@ -36,6 +37,16 @@ export declare interface AreaProps<T> {
|
|
|
36
37
|
/** A role instead of a colour value; the theme resolves it. `color` beats
|
|
37
38
|
it. */
|
|
38
39
|
tone?: "ok" | "warning" | "alarm";
|
|
40
|
+
/** The stack this series stands in: every Bar and Area with the same id on
|
|
41
|
+
the same x and y axis stands on the ones registered before it. A gap
|
|
42
|
+
stacks as zero; negative values stack downward from zero. The tooltip
|
|
43
|
+
names each series' own value and the stack's total. */
|
|
44
|
+
stack?: string;
|
|
45
|
+
/** On any member of a stack, every x of the stack sums to 100 %: each value
|
|
46
|
+
becomes its share, and the y axis reads in percent unless it has a
|
|
47
|
+
`tickFormat`. The total stays the readings' own sum, written in the
|
|
48
|
+
series' `format`. */
|
|
49
|
+
normalize?: boolean;
|
|
39
50
|
/** Opacity of the fill, from 0 to 1; the outline stays fully opaque. */
|
|
40
51
|
fillOpacity?: number;
|
|
41
52
|
/** Width of the outline along the upper edge in CSS pixels; 0 leaves it
|
|
@@ -46,7 +57,7 @@ export declare interface AreaProps<T> {
|
|
|
46
57
|
dash?: readonly number[];
|
|
47
58
|
}
|
|
48
59
|
|
|
49
|
-
export declare interface AreaSeriesConfig<T = unknown> extends SeriesBase<T
|
|
60
|
+
export declare interface AreaSeriesConfig<T = unknown> extends SeriesBase<T>, Stackable {
|
|
50
61
|
kind: "area";
|
|
51
62
|
/** Lower edge; without a value the fixed baseline 0. */
|
|
52
63
|
baseline?: Accessor<T>;
|
|
@@ -116,10 +127,10 @@ export declare interface AxisConfig<T = unknown> {
|
|
|
116
127
|
/** The values are instants in milliseconds: ticks on local boundaries,
|
|
117
128
|
labels by level. A calendar implies it. */
|
|
118
129
|
time?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
materialisation maps wall clock time onto
|
|
130
|
+
/** Working calendar: the intervals in which time counts. With it,
|
|
131
|
+
materialisation maps wall clock time onto working time before the scale
|
|
121
132
|
calculates - the scale stays affine (ADR-0001). */
|
|
122
|
-
calendar?: readonly
|
|
133
|
+
calendar?: readonly WorkingInterval[];
|
|
123
134
|
/** y axes only: this axis' ticks on the first y axis' grid. */
|
|
124
135
|
alignTicks?: boolean;
|
|
125
136
|
/** x axes only: where wheel, drag, pinch and double click propose a
|
|
@@ -158,28 +169,38 @@ export declare interface BarProps<T> {
|
|
|
158
169
|
/** A role instead of a colour value; the theme resolves it. `color` beats
|
|
159
170
|
it. */
|
|
160
171
|
tone?: "ok" | "warning" | "alarm";
|
|
172
|
+
/** The stack this series stands in: every Bar and Area with the same id on
|
|
173
|
+
the same x and y axis stands on the ones registered before it. A gap
|
|
174
|
+
stacks as zero; negative values stack downward from zero. The tooltip
|
|
175
|
+
names each series' own value and the stack's total. */
|
|
176
|
+
stack?: string;
|
|
177
|
+
/** On any member of a stack, every x of the stack sums to 100 %: each value
|
|
178
|
+
becomes its share, and the y axis reads in percent unless it has a
|
|
179
|
+
`tickFormat`. The total stays the readings' own sum, written in the
|
|
180
|
+
series' `format`. */
|
|
181
|
+
normalize?: boolean;
|
|
161
182
|
/** Width as a fraction of the step; just under 1, so that neighbours do not
|
|
162
183
|
touch. Several bar series share this fraction. */
|
|
163
184
|
barWidth?: number;
|
|
164
185
|
}
|
|
165
186
|
|
|
166
|
-
export declare interface BarSeriesConfig<T = unknown> extends SeriesBase<T
|
|
187
|
+
export declare interface BarSeriesConfig<T = unknown> extends SeriesBase<T>, Stackable {
|
|
167
188
|
kind: "bar";
|
|
168
189
|
/** Width as a fraction of the step; the group shares this fraction. */
|
|
169
190
|
barWidth: number;
|
|
170
191
|
}
|
|
171
192
|
|
|
172
|
-
/** The breaks in
|
|
193
|
+
/** The breaks in working time that lie within the extent [from, to] - what the
|
|
173
194
|
axis must mark, in domain units. */
|
|
174
195
|
export declare function breaks(input: CalendarInput, from: number, to: number): number[];
|
|
175
196
|
|
|
176
197
|
/** Calendar from an input - a built calendar is passed straight through, a raw
|
|
177
198
|
list is built once and remembered. */
|
|
178
|
-
export declare function calendarFrom(input: CalendarInput):
|
|
199
|
+
export declare function calendarFrom(input: CalendarInput): WorkingCalendar;
|
|
179
200
|
|
|
180
201
|
/** Every function of this module takes either: the raw list as it stands on the
|
|
181
202
|
axis, or the calendar built from it. */
|
|
182
|
-
export declare type CalendarInput =
|
|
203
|
+
export declare type CalendarInput = WorkingCalendar | readonly WorkingInterval[];
|
|
183
204
|
|
|
184
205
|
export declare function Chart<T>(props: ChartProps<T>): ReactNode;
|
|
185
206
|
|
|
@@ -217,6 +238,13 @@ export declare interface ChartProps<T> {
|
|
|
217
238
|
fall back to English. German: `GERMAN_CHARTS_WORDING` from
|
|
218
239
|
`@umriss-ui/charts/wording/de`. */
|
|
219
240
|
wording?: Partial<ChartsWording>;
|
|
241
|
+
/** How series are told apart. `"color"` (the default): by their colour.
|
|
242
|
+
`"marks"`: by a dash and a marker shape as well - a line, an area and a
|
|
243
|
+
scatter -, and by a hatch - a bar, a state, a matrix cell, a limit band -,
|
|
244
|
+
chosen by the same palette place as the colour, so that a reader who does
|
|
245
|
+
not see the colours still tells them apart; the legend's chips show the
|
|
246
|
+
same. A caller's own `dash` wins over the place's. */
|
|
247
|
+
encoding?: "color" | "marks";
|
|
220
248
|
/** Charts with the same id share the pointer's x position, in domain units:
|
|
221
249
|
each draws its crosshair there, the tooltip stays with the chart under
|
|
222
250
|
the pointer. Zoom is not shared - give every chart the same controlled
|
|
@@ -250,10 +278,28 @@ export declare interface ChartsWording {
|
|
|
250
278
|
value: string;
|
|
251
279
|
x: string;
|
|
252
280
|
}[]) => string;
|
|
281
|
+
/** The last row of a stack in the tooltip and the readout: the sum of its
|
|
282
|
+
members at the point (charts-stacking K4). */
|
|
283
|
+
stackTotal: string;
|
|
284
|
+
/** A share in a normalised stack, its number already formatted (K5). */
|
|
285
|
+
percent: (value: string) => string;
|
|
253
286
|
/** The keys that walk the chart. */
|
|
254
287
|
walkHelp: string;
|
|
255
288
|
/** The keys that zoom and pan it - only where the chart can be zoomed. */
|
|
256
289
|
zoomHelp: string;
|
|
290
|
+
/** The data table's disclosure key, closed and open (charts-alternatives
|
|
291
|
+
C1). */
|
|
292
|
+
showData: string;
|
|
293
|
+
hideData: string;
|
|
294
|
+
/** The heading of the table's x column where its axis has no `label`, and
|
|
295
|
+
of a matrix' row column where its y axis has none. */
|
|
296
|
+
positionColumn: string;
|
|
297
|
+
rowColumn: string;
|
|
298
|
+
/** The table's caption: the visible stretch it lists, both ends formatted. */
|
|
299
|
+
tableCaption: (from: string, to: string) => string;
|
|
300
|
+
/** Added to the caption where the table shows the downsampled course (C2):
|
|
301
|
+
how many readings its rows stand for. */
|
|
302
|
+
downsampled: (readings: number) => string;
|
|
257
303
|
}
|
|
258
304
|
|
|
259
305
|
declare interface CommonProps {
|
|
@@ -264,7 +310,7 @@ declare interface CommonProps {
|
|
|
264
310
|
is nearly always a value and not a moment. */
|
|
265
311
|
orientation?: "x" | "y";
|
|
266
312
|
/** Two severities, not five: five urgencies are five colours, and five colours
|
|
267
|
-
on a
|
|
313
|
+
on a dense screen are noise. */
|
|
268
314
|
severity?: Severity;
|
|
269
315
|
/** What the value means. A line at 90 does not say what 90 is. */
|
|
270
316
|
label?: string;
|
|
@@ -383,6 +429,18 @@ export declare interface ControlLimits {
|
|
|
383
429
|
chart then draws no line instead of bursting. */
|
|
384
430
|
export declare function controlLimits(values: readonly number[], origin: ControlLimitOrigin): ControlLimits;
|
|
385
431
|
|
|
432
|
+
export declare function DataTable(): ReactNode;
|
|
433
|
+
|
|
434
|
+
/** One table of the data table: the series of one x axis, or one matrix. Every
|
|
435
|
+
cell is text already, in the format the tooltip writes. */
|
|
436
|
+
export declare interface DataTableGroup {
|
|
437
|
+
key: string;
|
|
438
|
+
caption: string;
|
|
439
|
+
columns: readonly string[];
|
|
440
|
+
/** The first cell of each row is its x - the row's heading. */
|
|
441
|
+
rows: readonly (readonly string[])[];
|
|
442
|
+
}
|
|
443
|
+
|
|
386
444
|
export declare const DAY: number;
|
|
387
445
|
|
|
388
446
|
export declare const DEFAULT_CHARTS_WORDING: ChartsWording;
|
|
@@ -543,7 +601,7 @@ export declare interface LineProps<T> {
|
|
|
543
601
|
to be seen by - `always`, or `never`, not even that one. */
|
|
544
602
|
markers?: "auto" | "always" | "never";
|
|
545
603
|
/** Sample-and-hold: each value holds as a horizontal until the next sample
|
|
546
|
-
and jumps there - a
|
|
604
|
+
and jumps there - a target, a digital signal. A gap ends the hold at
|
|
547
605
|
its x. The tooltip reports the sample the hold began with. */
|
|
548
606
|
step?: boolean;
|
|
549
607
|
}
|
|
@@ -638,70 +696,6 @@ export declare interface MatrixSeriesConfig<T = unknown> extends SeriesBase<T> {
|
|
|
638
696
|
|
|
639
697
|
export declare const MINUTE: number;
|
|
640
698
|
|
|
641
|
-
/** An operating calendar: sorted, merged intervals with the operating time
|
|
642
|
-
accumulated before each one begins. An empty calendar is no calendar: it maps
|
|
643
|
-
unchanged.
|
|
644
|
-
|
|
645
|
-
Build once, then pass around: the mapping runs once per point, and were it to
|
|
646
|
-
sort and accumulate every time, the calendar would be the most expensive
|
|
647
|
-
thing about the frame. */
|
|
648
|
-
export declare interface OperatingCalendar {
|
|
649
|
-
readonly intervals: readonly OperatingInterval[];
|
|
650
|
-
/** Operating time accumulated before the respective interval begins. */
|
|
651
|
-
readonly offsets: readonly number[];
|
|
652
|
-
/** The whole operating time - the axis' extent is [0, total]. */
|
|
653
|
-
readonly total: number;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
/** Builds a calendar: sorts, merges overlapping and abutting intervals and
|
|
657
|
-
throws away empty, reversed and non-finite ones. Merging is not a courtesy
|
|
658
|
-
but a precondition: only over separated intervals is the reverse mapping
|
|
659
|
-
unambiguous. */
|
|
660
|
-
export declare function operatingCalendar(intervals: readonly OperatingInterval[]): OperatingCalendar;
|
|
661
|
-
|
|
662
|
-
/** An interval in which time counts; thought of as half-open, but mappable from
|
|
663
|
-
both sides at its edges: both `from` and `to` have an operating time. */
|
|
664
|
-
export declare interface OperatingInterval {
|
|
665
|
-
readonly from: number;
|
|
666
|
-
readonly to: number;
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
/** Tick values for an axis extent that already stands in OPERATING TIME - the
|
|
670
|
-
route the axis layout takes.
|
|
671
|
-
|
|
672
|
-
The extent is trimmed to the operating time that exists (an extent widened to
|
|
673
|
-
nice boundaries reaches beyond it), calculated back into wall clock time, and
|
|
674
|
-
the candidates arise there. The step comes from the span in operating time and
|
|
675
|
-
not from the one in wall clock time: roughly one candidate per step of
|
|
676
|
-
operating time survives, and calculated from the wall clock span, four out of
|
|
677
|
-
ten wanted ticks would be left. */
|
|
678
|
-
export declare function operatingTicks(input: CalendarInput, from: number, to: number, count: number, offset?: number): number[];
|
|
679
|
-
|
|
680
|
-
/** A tick: where it stands on the clock and where it lies on the axis. */
|
|
681
|
-
export declare interface OperatingTimeTick {
|
|
682
|
-
readonly wallClock: number;
|
|
683
|
-
readonly operatingTime: number;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
/** Ticks for an operating time axis, from an extent in WALL CLOCK TIME.
|
|
687
|
-
|
|
688
|
-
The candidates arise in wall clock time on multiples of the step - hours,
|
|
689
|
-
shift changes, days - whatever lies in removed time falls away, the rest is
|
|
690
|
-
mapped. Never the other way round: ticks generated in operating time land in
|
|
691
|
-
the middle of a shift and yield an axis labelled 14.5 and 29.0 which nobody
|
|
692
|
-
can read.
|
|
693
|
-
|
|
694
|
-
The offset shifts the grid; with it a local time hits its own midnight without
|
|
695
|
-
this module having to know about time zones.
|
|
696
|
-
|
|
697
|
-
If two candidates fall on the same operating time - the end of one shift and
|
|
698
|
-
the beginning of the next - the earlier one stays: two labels on the same
|
|
699
|
-
pixel would be one too many.
|
|
700
|
-
|
|
701
|
-
Both times come back, because the axis needs both: the operating time to
|
|
702
|
-
place the tick, the wall clock time to label it. */
|
|
703
|
-
export declare function operatingTimeTicks(input: CalendarInput, from: number, to: number, step: number, offset?: number): OperatingTimeTick[];
|
|
704
|
-
|
|
705
699
|
export declare interface Padding {
|
|
706
700
|
top: number;
|
|
707
701
|
right: number;
|
|
@@ -792,7 +786,7 @@ export declare interface Rect {
|
|
|
792
786
|
height: number;
|
|
793
787
|
}
|
|
794
788
|
|
|
795
|
-
/** The removed spans between the
|
|
789
|
+
/** The removed spans between the working intervals, for the mark in the axis
|
|
796
790
|
band. A chart that takes a weekend out and does not say so claims a
|
|
797
791
|
continuity it does not have. Before the first and after the last interval
|
|
798
792
|
there is nothing to mark: that lies outside the axis' extent. */
|
|
@@ -802,8 +796,8 @@ export declare function removedIntervals(input: CalendarInput): RemovedSpan[];
|
|
|
802
796
|
export declare interface RemovedSpan {
|
|
803
797
|
readonly from: number;
|
|
804
798
|
readonly to: number;
|
|
805
|
-
/**
|
|
806
|
-
readonly
|
|
799
|
+
/** Working time on which the whole span lies - a point, not a stretch. */
|
|
800
|
+
readonly workingTime: number;
|
|
807
801
|
}
|
|
808
802
|
|
|
809
803
|
/** Any number of CSS colours - a token, `light-dark(…)`, `var(--…)`, a
|
|
@@ -833,6 +827,9 @@ export declare interface ResolvedTheme {
|
|
|
833
827
|
font: string;
|
|
834
828
|
fontMono: string;
|
|
835
829
|
series: readonly string[];
|
|
830
|
+
/** The page is in forced colours: every colour above is a system colour, and
|
|
831
|
+
the chart encodes by marks whatever its `encoding`. */
|
|
832
|
+
forced: boolean;
|
|
836
833
|
}
|
|
837
834
|
|
|
838
835
|
/** Name of a rule, the way it is switched on and off in `violations`. */
|
|
@@ -951,7 +948,7 @@ export declare type SeriesKind = SeriesConfig["kind"];
|
|
|
951
948
|
|
|
952
949
|
/** How seriously a violation weighs. Exactly two: one severity that advises and
|
|
953
950
|
one that calls for action. Five severities would be five colours, and five
|
|
954
|
-
colours on a
|
|
951
|
+
colours on a dense screen are noise. Whoever needs a third
|
|
955
952
|
distinction sets a second limit. */
|
|
956
953
|
export declare type Severity = "warning" | "alarm";
|
|
957
954
|
|
|
@@ -962,6 +959,15 @@ export declare type Side = "upper" | "lower";
|
|
|
962
959
|
baseline has been handed down as a centre line and a control limit. */
|
|
963
960
|
export declare function sigmaFromLimit(center: number, upper: number): number;
|
|
964
961
|
|
|
962
|
+
/** What the two filled kinds share: a place in a stack (charts-stacking). */
|
|
963
|
+
declare interface Stackable {
|
|
964
|
+
/** The stack this series stands in: series with the same id, on the same x
|
|
965
|
+
and y axis, stack in registration order (K1). */
|
|
966
|
+
stack?: string;
|
|
967
|
+
/** On any member, the whole stack sums to 100 at every x (K5). */
|
|
968
|
+
normalize?: boolean;
|
|
969
|
+
}
|
|
970
|
+
|
|
965
971
|
/** A band of states: each point's state holds from its x until the next
|
|
966
972
|
point's. The last one holds until the latest reading of the chart - the
|
|
967
973
|
last x of any visible series on the same x axis - and where the band itself
|
|
@@ -1049,6 +1055,8 @@ export declare interface TooltipPoint<T = unknown> {
|
|
|
1049
1055
|
/** The point's x value on its own x axis - with several x axes it can
|
|
1050
1056
|
differ from the hit's. */
|
|
1051
1057
|
xValue: number;
|
|
1058
|
+
/** The point's y value; in a stack its own value, not its top - in a
|
|
1059
|
+
normalised stack its share in percent. */
|
|
1052
1060
|
yValue: number;
|
|
1053
1061
|
datum: T;
|
|
1054
1062
|
index: number;
|
|
@@ -1077,7 +1085,15 @@ export declare interface TooltipProps<T> {
|
|
|
1077
1085
|
render?: (hit: TooltipHit<T>) => ReactNode;
|
|
1078
1086
|
}
|
|
1079
1087
|
|
|
1080
|
-
/**
|
|
1088
|
+
/** Working time → wall clock time; outside [0, total] there is none.
|
|
1089
|
+
|
|
1090
|
+
At a seam - the end of an interval which is at the same time the beginning of
|
|
1091
|
+
the next - the beginning of the next comes out: from there time counts again,
|
|
1092
|
+
and a pointer aiming there aims at the coming interval. Only the end of the last
|
|
1093
|
+
interval has no next and comes back as itself. */
|
|
1094
|
+
export declare function toWallClock(workingTime: number, input: CalendarInput): number;
|
|
1095
|
+
|
|
1096
|
+
/** Wall clock time → working time.
|
|
1081
1097
|
|
|
1082
1098
|
A point in a removed interval is a gap and becomes `NaN` - the encoding every
|
|
1083
1099
|
gap of this library already uses, and the drawing loop breaks the mark at it
|
|
@@ -1087,30 +1103,22 @@ export declare interface TooltipProps<T> {
|
|
|
1087
1103
|
before the first and after the last interval.
|
|
1088
1104
|
|
|
1089
1105
|
The end of one interval and the beginning of the next fall on the same value:
|
|
1090
|
-
in
|
|
1106
|
+
in working time they are neighbours, and the line between two points on
|
|
1091
1107
|
either side is drawn. That is not a lie but the whole purpose of the axis; the
|
|
1092
1108
|
mark in the axis band tells the reader that time was taken out there. */
|
|
1093
|
-
export declare function
|
|
1109
|
+
export declare function toWorkingTime(wallClock: number, input: CalendarInput): number;
|
|
1094
1110
|
|
|
1095
|
-
/** Wall clock time →
|
|
1111
|
+
/** Wall clock time → working time, but without NaN: whatever lies in removed
|
|
1096
1112
|
time falls onto the seam that this span collapses onto anyway; whatever lies
|
|
1097
1113
|
before the first or after the last interval onto 0 or onto the whole
|
|
1098
|
-
|
|
1114
|
+
working time respectively.
|
|
1099
1115
|
|
|
1100
1116
|
Why this exists: the materialised x values must stay ascending. Binary search
|
|
1101
1117
|
- for a hit as for a segment boundary - assumes that, and every comparison
|
|
1102
1118
|
with NaN is false, so that a search over a block of NaN silently lands on the
|
|
1103
1119
|
wrong point. The clamped value is a POSITION, not a statement: the point
|
|
1104
1120
|
itself is carried as a gap and is never drawn and never hit. */
|
|
1105
|
-
export declare function
|
|
1106
|
-
|
|
1107
|
-
/** Operating time → wall clock time; outside [0, total] there is none.
|
|
1108
|
-
|
|
1109
|
-
At a seam - the end of an interval which is at the same time the beginning of
|
|
1110
|
-
the next - the beginning of the next comes out: from there time counts again,
|
|
1111
|
-
and a pointer aiming there aims at the coming shift. Only the end of the last
|
|
1112
|
-
interval has no next and comes back as itself. */
|
|
1113
|
-
export declare function toWallClock(operatingTime: number, input: CalendarInput): number;
|
|
1121
|
+
export declare function toWorkingTimeClamped(wallClock: number, input: CalendarInput): number;
|
|
1114
1122
|
|
|
1115
1123
|
/** What a value is. Four outcomes, not three.
|
|
1116
1124
|
|
|
@@ -1140,6 +1148,70 @@ export declare interface Violation {
|
|
|
1140
1148
|
listed beside the chart as well as marked on it. */
|
|
1141
1149
|
export declare function violations(values: readonly number[], limits: ControlLimits, options?: Partial<RuleOptions>): Violation[];
|
|
1142
1150
|
|
|
1151
|
+
/** A working calendar: sorted, merged intervals with the working time
|
|
1152
|
+
accumulated before each one begins. An empty calendar is no calendar: it maps
|
|
1153
|
+
unchanged.
|
|
1154
|
+
|
|
1155
|
+
Build once, then pass around: the mapping runs once per point, and were it to
|
|
1156
|
+
sort and accumulate every time, the calendar would be the most expensive
|
|
1157
|
+
thing about the frame. */
|
|
1158
|
+
export declare interface WorkingCalendar {
|
|
1159
|
+
readonly intervals: readonly WorkingInterval[];
|
|
1160
|
+
/** Working time accumulated before the respective interval begins. */
|
|
1161
|
+
readonly offsets: readonly number[];
|
|
1162
|
+
/** The whole working time - the axis' extent is [0, total]. */
|
|
1163
|
+
readonly total: number;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
/** Builds a calendar: sorts, merges overlapping and abutting intervals and
|
|
1167
|
+
throws away empty, reversed and non-finite ones. Merging is not a courtesy
|
|
1168
|
+
but a precondition: only over separated intervals is the reverse mapping
|
|
1169
|
+
unambiguous. */
|
|
1170
|
+
export declare function workingCalendar(intervals: readonly WorkingInterval[]): WorkingCalendar;
|
|
1171
|
+
|
|
1172
|
+
/** An interval in which time counts; thought of as half-open, but mappable from
|
|
1173
|
+
both sides at its edges: both `from` and `to` have a working time. */
|
|
1174
|
+
export declare interface WorkingInterval {
|
|
1175
|
+
readonly from: number;
|
|
1176
|
+
readonly to: number;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
/** Tick values for an axis extent that already stands in WORKING TIME - the
|
|
1180
|
+
route the axis layout takes.
|
|
1181
|
+
|
|
1182
|
+
The extent is trimmed to the working time that exists (an extent widened to
|
|
1183
|
+
nice boundaries reaches beyond it), calculated back into wall clock time, and
|
|
1184
|
+
the candidates arise there. The step comes from the span in working time and
|
|
1185
|
+
not from the one in wall clock time: roughly one candidate per step of
|
|
1186
|
+
working time survives, and calculated from the wall clock span, four out of
|
|
1187
|
+
ten wanted ticks would be left. */
|
|
1188
|
+
export declare function workingTicks(input: CalendarInput, from: number, to: number, count: number, offset?: number): number[];
|
|
1189
|
+
|
|
1190
|
+
/** A tick: where it stands on the clock and where it lies on the axis. */
|
|
1191
|
+
export declare interface WorkingTimeTick {
|
|
1192
|
+
readonly wallClock: number;
|
|
1193
|
+
readonly workingTime: number;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
/** Ticks for a working time axis, from an extent in WALL CLOCK TIME.
|
|
1197
|
+
|
|
1198
|
+
The candidates arise in wall clock time on multiples of the step - hours,
|
|
1199
|
+
interval changes, days - whatever lies in removed time falls away, the rest is
|
|
1200
|
+
mapped. Never the other way round: ticks generated in working time land in
|
|
1201
|
+
the middle of an interval and yield an axis labelled 14.5 and 29.0 which nobody
|
|
1202
|
+
can read.
|
|
1203
|
+
|
|
1204
|
+
The offset shifts the grid; with it a local time hits its own midnight without
|
|
1205
|
+
this module having to know about time zones.
|
|
1206
|
+
|
|
1207
|
+
If two candidates fall on the same working time - the end of one interval and
|
|
1208
|
+
the beginning of the next - the earlier one stays: two labels on the same
|
|
1209
|
+
pixel would be one too many.
|
|
1210
|
+
|
|
1211
|
+
Both times come back, because the axis needs both: the working time to
|
|
1212
|
+
place the tick, the wall clock time to label it. */
|
|
1213
|
+
export declare function workingTimeTicks(input: CalendarInput, from: number, to: number, step: number, offset?: number): WorkingTimeTick[];
|
|
1214
|
+
|
|
1143
1215
|
export declare function XAxis<T>(props: XAxisProps<T>): null;
|
|
1144
1216
|
|
|
1145
1217
|
export declare interface XAxisProps<T> extends CommonProps_2<T> {
|
|
@@ -1157,11 +1229,11 @@ export declare interface XAxisProps<T> extends CommonProps_2<T> {
|
|
|
1157
1229
|
readings lie less than a minute apart. Another language is a `tickFormat`,
|
|
1158
1230
|
which is handed the instant. `calendar` implies it. */
|
|
1159
1231
|
time?: boolean;
|
|
1160
|
-
/**
|
|
1161
|
-
stands in
|
|
1232
|
+
/** Working calendar: the intervals in which time counts. With it the axis
|
|
1233
|
+
stands in working time - nights and weekends are out, and every
|
|
1162
1234
|
removed span gets a break mark. The scale stays affine; the mapping happens
|
|
1163
1235
|
in materialisation (ADR-0001). */
|
|
1164
|
-
calendar?: readonly
|
|
1236
|
+
calendar?: readonly WorkingInterval[];
|
|
1165
1237
|
/** Zoom and pan, controlled: Ctrl or ⌘ with the wheel - and a pinch - zoom
|
|
1166
1238
|
around the pointer, a drag, a horizontal wheel or Shift with the wheel pan,
|
|
1167
1239
|
a double click proposes the whole data range. Each proposes a domain in
|
package/dist/wording/de.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i = {
|
|
2
2
|
roleDescription: "Diagramm",
|
|
3
3
|
empty: "Keine Daten",
|
|
4
4
|
seriesList: (e) => `${e.length === 1 ? "1 Serie" : `${e.length} Serien`}: ${e.join(", ")}.`,
|
|
5
5
|
visibleRange: (e, n) => `Von ${e} bis ${n}.`,
|
|
6
|
-
seriesExtent: (e, n,
|
|
7
|
-
readout: (e, n) => [`${e}.`, ...n.map((
|
|
6
|
+
seriesExtent: (e, n, t) => `${e} von ${n} bis ${t}.`,
|
|
7
|
+
readout: (e, n) => [`${e}.`, ...n.map((t) => `${t.name} ${t.value}${t.x === "" ? "" : ` bei ${t.x}`}.`)].join(" "),
|
|
8
|
+
stackTotal: "Summe",
|
|
9
|
+
percent: (e) => `${e} %`,
|
|
8
10
|
walkHelp: "Pfeil links und rechts gehen durch die Werte, Pfeil hoch und runter wechseln die Serie, Pos1 und Ende springen zum ersten und letzten Wert, Escape hebt die Markierung auf.",
|
|
9
|
-
zoomHelp: "Plus und Minus zoomen, Umschalt mit Pfeil links oder rechts verschiebt, 0 zeigt alles."
|
|
11
|
+
zoomHelp: "Plus und Minus zoomen, Umschalt mit Pfeil links oder rechts verschiebt, 0 zeigt alles.",
|
|
12
|
+
showData: "Daten zeigen",
|
|
13
|
+
hideData: "Daten verbergen",
|
|
14
|
+
positionColumn: "Position",
|
|
15
|
+
rowColumn: "Zeile",
|
|
16
|
+
tableCaption: (e, n) => `Werte von ${e} bis ${n}.`,
|
|
17
|
+
downsampled: (e) => `Ausgedünnt aus ${e.toLocaleString("de-DE")} Messwerten: erster, kleinster, größter und letzter Wert je Abschnitt.`
|
|
10
18
|
};
|
|
11
19
|
export {
|
|
12
|
-
|
|
20
|
+
i as GERMAN_CHARTS_WORDING
|
|
13
21
|
};
|