@tensor_1/react 2.55.3 → 2.57.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 +68 -0
- package/component-inventory.json +64 -0
- package/dist/{ChartCore-BKK2HEfi.d.cts → ChartCore-CY5a4teJ.d.cts} +18 -2
- package/dist/GlanceCharts-Cb39RqDC.d.cts +88 -0
- package/dist/chart-analytic-guide.d.ts +1 -0
- package/dist/chart-analytic-guide.js +6 -1
- package/dist/chart-analytic.cjs +11 -1
- package/dist/chart-analytic.d.cts +2 -2
- package/dist/chart-glance.d.ts +65 -0
- package/dist/chart-glance.js +162 -0
- package/dist/chart-preset.cjs +337 -5
- package/dist/chart-preset.d.cts +9 -3
- package/dist/chart-preset.d.ts +8 -1
- package/dist/chart-preset.js +16 -1
- package/dist/chart-theme.d.ts +18 -2
- package/dist/chart-theme.js +6 -1
- package/dist/chart.cjs +337 -5
- package/dist/chart.d.cts +9 -3
- package/dist/chart.d.ts +3 -1
- package/dist/chart.js +9 -2
- package/dist/components/Arrive.d.ts +49 -0
- package/dist/components/Arrive.js +93 -0
- package/dist/components/Attachment.js +2 -2
- package/dist/components/Chart.d.ts +8 -1
- package/dist/components/Chart.js +16 -1
- package/dist/components/ChartCard.d.ts +34 -0
- package/dist/components/ChartCard.js +36 -0
- package/dist/components/ChartPanels.js +5 -0
- package/dist/components/Count.d.ts +10 -4
- package/dist/components/Count.js +35 -3
- package/dist/components/FileDrop.d.ts +51 -0
- package/dist/components/FileDrop.js +183 -0
- package/dist/components/FileGlyph.d.ts +9 -0
- package/dist/components/{FileIcon.js → FileGlyph.js} +2 -2
- package/dist/components/FileKindIcon.d.ts +36 -0
- package/dist/components/FileKindIcon.js +48 -0
- package/dist/components/FileRow.d.ts +102 -0
- package/dist/components/FileRow.js +164 -0
- package/dist/components/FileUpload.js +2 -2
- package/dist/components/GlanceCharts.d.ts +37 -0
- package/dist/components/GlanceCharts.js +128 -0
- package/dist/components/GlanceMarks.d.ts +63 -0
- package/dist/components/GlanceMarks.js +59 -0
- package/dist/components/Heartbeat.d.ts +5 -5
- package/dist/components/Meter.d.ts +12 -2
- package/dist/components/Meter.js +23 -13
- package/dist/components/StatusDot.d.ts +27 -0
- package/dist/components/StatusDot.js +16 -0
- package/dist/file-model.d.ts +41 -3
- package/dist/file-model.js +65 -1
- package/dist/icons/Icon.d.ts +5 -5
- package/dist/icons/components.d.ts +3 -1
- package/dist/icons/components.js +4 -0
- package/dist/icons/glyphs.d.ts +5 -1
- package/dist/icons/glyphs.js +6 -0
- package/dist/icons.cjs +10 -0
- package/dist/icons.d.cts +7 -25
- package/dist/icons.d.ts +1 -1
- package/dist/index.cjs +2807 -2099
- package/dist/index.d.cts +399 -15
- package/dist/index.d.ts +9 -1
- package/dist/index.js +41 -1
- package/dist/labels-context.d.ts +9 -1
- package/dist/types-B593xJNf.d.cts +26 -0
- package/package.json +1 -1
- package/dist/components/FileIcon.d.ts +0 -9
package/README.md
CHANGED
|
@@ -734,6 +734,48 @@ enumerateDateKeys({ start: '2026-10-11', end: '2026-10-12' }); // { d
|
|
|
734
734
|
- **Deprecated:** `zonedDateSpan` (end-inclusive, swaps inverted ends) and `enumerateDateSpan` (stops silently at
|
|
735
735
|
370) are unchanged in 2.x. Use `zonedDaySpan` and `enumerateDateKeys`.
|
|
736
736
|
|
|
737
|
+
### Calm kit: glance cards, quiet status and the arrival (2.56.0)
|
|
738
|
+
|
|
739
|
+
For a home page that greets before it warns: one question per card, red only for what is broken now, and motion once on the first paint. Phase 1 of the TENSOR calm-home proposal (2026-11-04).
|
|
740
|
+
|
|
741
|
+
**Status, quietly.** `StatusDot` is a dot and a word, no box: `neutral` (a fact, in ink), `info`, `warning`, `critical` (`danger` is an alias), and `success` for a service list. The word and the dot both wear the tone's text colour, so the dot clears 3:1 on the surface, the app background and the tone's own tint; `quiet` keeps the word in ink. The `critical` StatusPill is now the danger tint with the danger words (semibold) instead of a solid red fill; the destructive `Button variant="danger"` is the one solid red left.
|
|
742
|
+
|
|
743
|
+
```tsx
|
|
744
|
+
<StatusDot tone="critical">Läuft gerade</StatusDot>
|
|
745
|
+
<StatusDot tone="warning">SLA in 1 Std. 40 Min.</StatusDot>
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
**Glance cards.** `ChartCard` asks a question (`question`, a heading), answers it (`headline` large, `answer` short), holds one chart and a `note` line; `empty` replaces all of it with one sentence. The chart is one of:
|
|
749
|
+
|
|
750
|
+
- `GlanceLineChart` (`@tensor_1/react/chart` or `/chart/preset`): one series in `--uix-chart-series`, labelled at its end, an optional dashed `forecast`, three dashed gridlines, sans tabular axis digits and a dark tooltip with a crosshair. Builds a hidden data table from the data; pass `ariaLabel` and `categoryLabel`.
|
|
751
|
+
- `PairedBarChart` (same entries): per bucket the measure in blue beside its comparison in grey, up to 12 buckets (it warns above). Put the key in `note` with `ChartLegend`.
|
|
752
|
+
- `BarList`: label, bar, value per bucket; every value written out.
|
|
753
|
+
- `Meter target={95} targetLabel="Ziel 95 %"`: an ink mark at the goal, said after the value.
|
|
754
|
+
- `StatusStrip`: one cell per service and only the affected ones listed, critical first.
|
|
755
|
+
- `Sparkline`: an ink-grey line with a dot on the latest value; decoration unless you pass `label`.
|
|
756
|
+
|
|
757
|
+
The option builders are public for your own glance charts: `glanceLineOption`, `pairedBarsOption`, `uixGlanceBase` (pure functions of `uixChartTokens()`).
|
|
758
|
+
|
|
759
|
+
```tsx
|
|
760
|
+
<ChartCard question="Wächst der Rückstand?" headline={<Count value={85} arrive />} answer="offen, Prognose 140 bis 23. Nov."
|
|
761
|
+
note="Gestrichelt: Prognose." arriveIndex={5}>
|
|
762
|
+
<GlanceLineChart ariaLabel="Offener Rückstand, 12 Wochen" categoryLabel="Woche" name="offen"
|
|
763
|
+
categories={weeks} values={backlog} forecast={{ categories, values, name: 'erwartet', label: 'Prognose 140' }} />
|
|
764
|
+
</ChartCard>
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
**The arrival.** Wrap the page in `Arrive` and mark the cards in reading order with `ArriveItem index` (or `ChartCard arriveIndex`). On the first mount the cards fade and rise 8 px, 45 ms apart, over 420 ms; lines trace in (700 ms, 150 ms after their card), bars grow 25 ms apart (500 ms) and `Count arrive` counts up (600 ms). Then the stage rests: a re-render, a refetch or new data never replays it, and the resting state is the finished page. `name="home"` remembers it for the browser session (sessionStorage), so a reload or a route change back does not replay it either; `ready={!loading}` waits for the data. Under reduced motion each card only fades for 160 ms and the marks are drawn at once. `useArrive()` tells your own marks whether the stage is playing; plain markup opts in with `.uix-arrive__item`, `.uix-arrive__trace` (an SVG stroke with `pathLength="1"`), `.uix-arrive__grow` and `.uix-arrive__slide`.
|
|
768
|
+
|
|
769
|
+
```tsx
|
|
770
|
+
<Arrive name="home" ready={!loading}>
|
|
771
|
+
<ArriveItem index={0}><RunningNow /></ArriveItem>
|
|
772
|
+
<ArriveItem index={1}><Stat label="Warten auf Sie" value={<Count value={16} arrive />} /></ArriveItem>
|
|
773
|
+
…
|
|
774
|
+
</Arrive>
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
**Tokens.** The status families are softer in light and dark (fills, words, dots and tints; overdue follows danger), all AA. Palette v2: `--uix-chart-1..8` are blue (the series), teal, violet, green, plum, olive, cyan, moss, with no red and no amber slot; `--uix-chart-1` stays the brand blue (`#0455E6`, dark `#3280FC`); `--uix-chart-series` (= chart-1) and `--uix-chart-series-soft` are new. The arrival timings are `--uix-dur-arrive`, `--uix-stagger-arrive`, `--uix-delay-arrive-trace`, `--uix-dur-arrive-trace`, `--uix-dur-arrive-grow`, `--uix-stagger-arrive-grow`, `--uix-dur-arrive-count` and `--uix-arrive-rise`.
|
|
778
|
+
|
|
737
779
|
### Two-axis grids: MatrixInput and MatrixHeatmap
|
|
738
780
|
|
|
739
781
|
`MatrixInput` fills a grid of choices, one per row and column, from the keyboard alone. `MatrixHeatmap` shows how many items sit in each cell, each cell's named band, and a way to the items behind it. Neither has words of its own: `labels`, the axes, the options and the bands come from you.
|
|
@@ -880,6 +922,32 @@ A full-screen media viewer (HAR-1367; TENSOR's capture viewer, MOTUS's programme
|
|
|
880
922
|
- **Attachment:** the name is the link (`href`, `download`, `renderLink`). It has a quieter `meta` line, a `state` slot (e.g. a "Scanning" `StatusPill`), `actions`, `onRemove`, and `status` `loading` | `error` | `forbidden` (no link, and the reason shown). It's server-renderable.
|
|
881
923
|
- Pure helpers: `formatFileSize`, `fileMatchesAccept`, `partitionFiles`, `fileKind`.
|
|
882
924
|
|
|
925
|
+
### File kit: kinds, the file row and the slim drop row (2.57.0)
|
|
926
|
+
|
|
927
|
+
Attachments that show what they are before you read the name, and an upload you can watch (variation H of the 2026-11-05 attachments study; TENSOR's Anhänge panel). Each kind of file has a hue (`--uix-file-<kind>`) and a Lucide glyph; a row's left edge carries the kind's tint, and that tint becomes the upload fill.
|
|
928
|
+
|
|
929
|
+
```tsx
|
|
930
|
+
<section ref={panel} aria-labelledby="files-h">
|
|
931
|
+
<h3 id="files-h">Anhänge</h3>
|
|
932
|
+
<FileDrop targetRef={panel} accept=".pdf,.log,image/*" onFiles={(files) => files.forEach(startUpload)} />
|
|
933
|
+
<ul className="uix-file-rows">
|
|
934
|
+
{files.map((f) => (
|
|
935
|
+
<FileRow key={f.id} as="li" density="compact" name={f.name} size={f.size} meta={`${f.by}, ${f.at}`}
|
|
936
|
+
state={f.state} progress={f.progress} href={f.url}
|
|
937
|
+
onMoreActions={(e) => openMenu(f, e.currentTarget)} onCancel={() => cancel(f)} onRetry={() => retry(f)} />
|
|
938
|
+
))}
|
|
939
|
+
</ul>
|
|
940
|
+
</section>
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
- **Kinds:** `fileKind(name, mime)` gives one of `img` Bild, `doc` Dokument, `sheet` Tabelle, `mail` E-Mail, `code` Code & Konfiguration, `log` Protokoll, `archive` Archiv, `other` Datei. A known extension wins over the MIME type (a `.log` arrives as `text/plain`); pass `''` as the name when only the type is known, as in a drag event. The lists are `FILE_KIND_EXTENSIONS`. None of the hues is red (red stays for broken) and none is the brand blue (blue stays for actions); in light five of them are the calm chart slots.
|
|
944
|
+
- **`FileKindIcon`:** the glyph in the kind's colour with the extension (`fileTypeLabel`: at most four capitals) as a solid label on the corner, ringed in the surface colour. `size` `sm` 30 px (a compact row), `md` 34 px, `lg` 52 px. Decorative unless you pass `label`. It is server-renderable. (`FileIcon` in `./icons` is the plain `file` glyph, hence the name.)
|
|
945
|
+
- **`FileRow` states:** `idle` (files that were already there), `uploading` (the fill scales to `progress`, 0 to 1, or `loaded / size`, with a thin leading edge; "Wird hochgeladen · 62 % · 1,5 von 2,4 MB" and Abbrechen with `onCancel`), `done` (just finished: a check draws on the icon and the fill fades over 1.2 s; render `idle` afterwards), `scanning` ("Wird auf Schadsoftware geprüft", no motion), `blocked` (amber, Details with `onDetails`) and `failed` (red, Erneut versuchen with `onRetry`). `message` replaces the words of the last two. The outcome of an upload is announced once, never the progress.
|
|
946
|
+
- **Actions:** `href` makes the download a link (`download` sets the saved name), or pass `onDownload`; `onMoreActions` adds "Weitere Aktionen" for your `Menu`; `actions` replaces both. With a fine pointer they appear on hover and focus; on touch they are always there.
|
|
947
|
+
- **`FileDrop`:** one dashed line, "Dateien ablegen oder auswählen", backed by a real file input. The choose button is the one tab stop and opens the chooser; a click anywhere on the row does too. While files are dragged over it (or over `targetRef`, such as the whole panel), it reads their MIME types and names them ("2 Dateien: Bild, Protokoll") and tints itself from the pointer outwards, one colour per kind. A drop hands the files that match `accept` to `onFiles` and the rest to `onReject`.
|
|
948
|
+
- **Motion:** tokens only, transform and opacity, nothing loops. Under reduced motion the fill jumps and the check only fades.
|
|
949
|
+
- **Words:** German by default. For English pass `FILE_ROW_LABELS_EN`, `FILE_DROP_LABELS_EN` and `FILE_KIND_LABELS_EN` to `UixLabelsProvider` (`fileRow`, `fileDrop`, `fileKinds`) or to one instance's `labels` / `kindLabels`. Sizes use `formatFileSize` in `locale` (default `de-DE`), `sizeBase` or `formatSize`.
|
|
950
|
+
|
|
883
951
|
### TextDiff
|
|
884
952
|
|
|
885
953
|
A two-way diff of two texts (HAR-1368; TENSOR's knowledge-article version diff). `DiffViewer` stays the three-way configuration diff.
|
package/component-inventory.json
CHANGED
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
"name": "AppShell",
|
|
14
14
|
"subpath": "."
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
"name": "Arrive",
|
|
18
|
+
"subpath": "."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "ArriveItem",
|
|
22
|
+
"subpath": "."
|
|
23
|
+
},
|
|
16
24
|
{
|
|
17
25
|
"name": "AsyncOperationStatus",
|
|
18
26
|
"subpath": "."
|
|
@@ -37,6 +45,10 @@
|
|
|
37
45
|
"name": "AvatarGroup",
|
|
38
46
|
"subpath": "."
|
|
39
47
|
},
|
|
48
|
+
{
|
|
49
|
+
"name": "BarList",
|
|
50
|
+
"subpath": "."
|
|
51
|
+
},
|
|
40
52
|
{
|
|
41
53
|
"name": "BrandProfileEditor",
|
|
42
54
|
"subpath": "."
|
|
@@ -97,6 +109,10 @@
|
|
|
97
109
|
"name": "ChangeHighlight",
|
|
98
110
|
"subpath": "."
|
|
99
111
|
},
|
|
112
|
+
{
|
|
113
|
+
"name": "ChartCard",
|
|
114
|
+
"subpath": "."
|
|
115
|
+
},
|
|
100
116
|
{
|
|
101
117
|
"name": "Checkbox",
|
|
102
118
|
"subpath": "."
|
|
@@ -277,6 +293,18 @@
|
|
|
277
293
|
"name": "Field",
|
|
278
294
|
"subpath": "."
|
|
279
295
|
},
|
|
296
|
+
{
|
|
297
|
+
"name": "FileDrop",
|
|
298
|
+
"subpath": "."
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "FileKindIcon",
|
|
302
|
+
"subpath": "."
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"name": "FileRow",
|
|
306
|
+
"subpath": "."
|
|
307
|
+
},
|
|
280
308
|
{
|
|
281
309
|
"name": "FileUpload",
|
|
282
310
|
"subpath": "."
|
|
@@ -673,6 +701,10 @@
|
|
|
673
701
|
"name": "SortableList",
|
|
674
702
|
"subpath": "."
|
|
675
703
|
},
|
|
704
|
+
{
|
|
705
|
+
"name": "Sparkline",
|
|
706
|
+
"subpath": "."
|
|
707
|
+
},
|
|
676
708
|
{
|
|
677
709
|
"name": "Spinner",
|
|
678
710
|
"subpath": "."
|
|
@@ -693,6 +725,10 @@
|
|
|
693
725
|
"name": "StatRow",
|
|
694
726
|
"subpath": "."
|
|
695
727
|
},
|
|
728
|
+
{
|
|
729
|
+
"name": "StatusDot",
|
|
730
|
+
"subpath": "."
|
|
731
|
+
},
|
|
696
732
|
{
|
|
697
733
|
"name": "StatusPill",
|
|
698
734
|
"subpath": "."
|
|
@@ -701,6 +737,10 @@
|
|
|
701
737
|
"name": "StatusRow",
|
|
702
738
|
"subpath": "."
|
|
703
739
|
},
|
|
740
|
+
{
|
|
741
|
+
"name": "StatusStrip",
|
|
742
|
+
"subpath": "."
|
|
743
|
+
},
|
|
704
744
|
{
|
|
705
745
|
"name": "Step",
|
|
706
746
|
"subpath": "."
|
|
@@ -829,6 +869,14 @@
|
|
|
829
869
|
"name": "ChartMetric",
|
|
830
870
|
"subpath": "./chart"
|
|
831
871
|
},
|
|
872
|
+
{
|
|
873
|
+
"name": "GlanceLineChart",
|
|
874
|
+
"subpath": "./chart"
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
"name": "PairedBarChart",
|
|
878
|
+
"subpath": "./chart"
|
|
879
|
+
},
|
|
832
880
|
{
|
|
833
881
|
"name": "Chart",
|
|
834
882
|
"subpath": "./chart/analytic"
|
|
@@ -869,6 +917,14 @@
|
|
|
869
917
|
"name": "ChartMetric",
|
|
870
918
|
"subpath": "./chart/preset"
|
|
871
919
|
},
|
|
920
|
+
{
|
|
921
|
+
"name": "GlanceLineChart",
|
|
922
|
+
"subpath": "./chart/preset"
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
"name": "PairedBarChart",
|
|
926
|
+
"subpath": "./chart/preset"
|
|
927
|
+
},
|
|
872
928
|
{
|
|
873
929
|
"name": "EmojiPicker",
|
|
874
930
|
"subpath": "./emoji"
|
|
@@ -1213,6 +1269,10 @@
|
|
|
1213
1269
|
"name": "FileCheckIcon",
|
|
1214
1270
|
"subpath": "./icons"
|
|
1215
1271
|
},
|
|
1272
|
+
{
|
|
1273
|
+
"name": "FileCodeIcon",
|
|
1274
|
+
"subpath": "./icons"
|
|
1275
|
+
},
|
|
1216
1276
|
{
|
|
1217
1277
|
"name": "FileDownIcon",
|
|
1218
1278
|
"subpath": "./icons"
|
|
@@ -1245,6 +1305,10 @@
|
|
|
1245
1305
|
"name": "FileSpreadsheetIcon",
|
|
1246
1306
|
"subpath": "./icons"
|
|
1247
1307
|
},
|
|
1308
|
+
{
|
|
1309
|
+
"name": "FileTerminalIcon",
|
|
1310
|
+
"subpath": "./icons"
|
|
1311
|
+
},
|
|
1248
1312
|
{
|
|
1249
1313
|
"name": "FileTextIcon",
|
|
1250
1314
|
"subpath": "./icons"
|
|
@@ -4,9 +4,21 @@ import { EChartsOption, ECharts } from 'echarts';
|
|
|
4
4
|
|
|
5
5
|
/** Where tokens are read from: an element (its computed style), or a reader for tests and non-DOM use. */
|
|
6
6
|
type ChartTokenSource = Element | ((token: string) => string);
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The analytic chart roles: reference lines, threshold zones, forecast bands, events, partial periods.
|
|
9
|
+
* The calm-kit fields (series, seriesSoft, categories, radius, shadow) are optional, so an object
|
|
10
|
+
* built for 2.55 still type-checks; `uixChartTokens()` always fills them, and the glance charts fall
|
|
11
|
+
* back to `palette[0]` when an object of your own leaves them out.
|
|
12
|
+
*/
|
|
8
13
|
interface UixChartTokens {
|
|
14
|
+
/** The categorical palette, --uix-chart-1..8 (v2, calm kit 2.56): no red slot and no amber slot. */
|
|
9
15
|
palette: string[];
|
|
16
|
+
/** THE series colour of a glance chart (--uix-chart-series, = chart-1). */
|
|
17
|
+
series?: string;
|
|
18
|
+
/** The series colour as a faint wash (an area under a glance line). */
|
|
19
|
+
seriesSoft?: string;
|
|
20
|
+
/** The three quiet category hues (blue, teal, violet) for a chart that truly needs more than one. */
|
|
21
|
+
categories?: string[];
|
|
10
22
|
neutral: string;
|
|
11
23
|
grid: string;
|
|
12
24
|
axis: string;
|
|
@@ -26,9 +38,13 @@ interface UixChartTokens {
|
|
|
26
38
|
border: string;
|
|
27
39
|
fontSans: string;
|
|
28
40
|
fontMono: string;
|
|
41
|
+
/** --uix-radius-md, for a glance tooltip. */
|
|
42
|
+
radius?: string;
|
|
43
|
+
/** --uix-shadow-popover, for a glance tooltip. */
|
|
44
|
+
shadow?: string;
|
|
29
45
|
}
|
|
30
46
|
/** Resolve the chart tokens once (current theme). */
|
|
31
|
-
declare function uixChartTokens(source?: ChartTokenSource): UixChartTokens
|
|
47
|
+
declare function uixChartTokens(source?: ChartTokenSource): UixChartTokens & Required<Pick<UixChartTokens, 'series' | 'seriesSoft' | 'categories' | 'radius' | 'shadow'>>;
|
|
32
48
|
/**
|
|
33
49
|
* The base option every UIx chart merges under the consumer's option (the consumer wins).
|
|
34
50
|
* Axis defaults apply to every x/y axis, whether the consumer passes one axis or an array.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { U as UixChartTokens, C as ChartLabels, c as ChartEventHandler } from './ChartCore-CY5a4teJ.cjs';
|
|
3
|
+
import { EChartsOption } from 'echarts';
|
|
4
|
+
|
|
5
|
+
/** How a glance chart draws in. `play: false` (the default) draws it at rest, with no animation. */
|
|
6
|
+
interface GlanceMotion {
|
|
7
|
+
play: boolean;
|
|
8
|
+
/** When the chart starts drawing, after its card started (ms). */
|
|
9
|
+
delay: number;
|
|
10
|
+
/** A line tracing in (ms). */
|
|
11
|
+
trace: number;
|
|
12
|
+
/** One bar growing (ms). */
|
|
13
|
+
grow: number;
|
|
14
|
+
/** The gap between one bucket starting to grow and the next (ms). */
|
|
15
|
+
stagger: number;
|
|
16
|
+
}
|
|
17
|
+
declare const GLANCE_AT_REST: GlanceMotion;
|
|
18
|
+
/** Formats a value for the tooltip and the end label. */
|
|
19
|
+
type GlanceFormat = (value: number) => string;
|
|
20
|
+
/** The shared frame: grid, dashed gridlines, sans axis digits and the dark tooltip. */
|
|
21
|
+
declare function uixGlanceBase(k: UixChartTokens, motion?: GlanceMotion): EChartsOption;
|
|
22
|
+
interface GlanceLineInput {
|
|
23
|
+
/** The x labels of the measured points (weeks, days). */
|
|
24
|
+
categories: string[];
|
|
25
|
+
values: number[];
|
|
26
|
+
/** The series name, for the tooltip ("offen"). */
|
|
27
|
+
name: string;
|
|
28
|
+
/** A dashed projection that continues from the last measured point. */
|
|
29
|
+
forecast?: {
|
|
30
|
+
categories: string[];
|
|
31
|
+
values: number[];
|
|
32
|
+
name: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
};
|
|
35
|
+
/** Label the line at its end with its last value (default true). */
|
|
36
|
+
endLabel?: boolean;
|
|
37
|
+
/** A faint wash under the line (default true). */
|
|
38
|
+
area?: boolean;
|
|
39
|
+
format?: GlanceFormat;
|
|
40
|
+
/** The tooltip's title for an x label ("Woche ab 2. Nov."). Default the label itself. */
|
|
41
|
+
tooltipTitle?: (category: string) => string;
|
|
42
|
+
}
|
|
43
|
+
/** One line in the series blue, labelled at its end, optionally with a dashed forecast. */
|
|
44
|
+
declare function glanceLineOption(k: UixChartTokens, input: GlanceLineInput, motion?: GlanceMotion): EChartsOption;
|
|
45
|
+
interface PairedBarsInput {
|
|
46
|
+
/** The buckets (days, weeks); at most 12 read at a glance. */
|
|
47
|
+
categories: string[];
|
|
48
|
+
/** The measure, in the series blue ("eröffnet"). */
|
|
49
|
+
series: {
|
|
50
|
+
name: string;
|
|
51
|
+
values: number[];
|
|
52
|
+
};
|
|
53
|
+
/** The comparison, in grey ("gelöst"). */
|
|
54
|
+
comparison: {
|
|
55
|
+
name: string;
|
|
56
|
+
values: number[];
|
|
57
|
+
};
|
|
58
|
+
format?: GlanceFormat;
|
|
59
|
+
tooltipTitle?: (category: string) => string;
|
|
60
|
+
}
|
|
61
|
+
/** The most buckets a paired-bar glance chart should hold. */
|
|
62
|
+
declare const PAIRED_BARS_MAX_BUCKETS = 12;
|
|
63
|
+
/** Two bars per bucket: the measure in blue beside its comparison in grey. */
|
|
64
|
+
declare function pairedBarsOption(k: UixChartTokens, input: PairedBarsInput, motion?: GlanceMotion): EChartsOption;
|
|
65
|
+
|
|
66
|
+
/** The props every glance chart shares with Chart. */
|
|
67
|
+
interface GlanceChartBaseProps {
|
|
68
|
+
/** What the chart shows, in a sentence: its accessible name ("Offener Rückstand der letzten 12 Wochen …"). */
|
|
69
|
+
ariaLabel: string;
|
|
70
|
+
/** The header of the first column of the hidden data table ("Woche"). Default "Period". */
|
|
71
|
+
categoryLabel?: string;
|
|
72
|
+
/** Plot height in px. Default 150 (a line) or 140 (paired bars). */
|
|
73
|
+
height?: number;
|
|
74
|
+
className?: string;
|
|
75
|
+
style?: CSSProperties;
|
|
76
|
+
loading?: boolean;
|
|
77
|
+
empty?: ReactNode;
|
|
78
|
+
labels?: Partial<ChartLabels>;
|
|
79
|
+
/** Charts with the same group share one crosshair and tooltip. */
|
|
80
|
+
group?: string;
|
|
81
|
+
onEvents?: Record<string, ChartEventHandler>;
|
|
82
|
+
}
|
|
83
|
+
interface GlanceLineChartProps extends GlanceLineInput, GlanceChartBaseProps {
|
|
84
|
+
}
|
|
85
|
+
interface PairedBarChartProps extends PairedBarsInput, GlanceChartBaseProps {
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { type GlanceLineChartProps as G, type PairedBarChartProps as P, GLANCE_AT_REST as a, type GlanceChartBaseProps as b, type GlanceFormat as c, type GlanceLineInput as d, type GlanceMotion as e, PAIRED_BARS_MAX_BUCKETS as f, type PairedBarsInput as g, glanceLineOption as h, pairedBarsOption as p, uixGlanceBase as u };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { DEFAULT_CHART_PANELS_LABELS, chartPanelsModel } from './chart-panels-model.js';
|
|
2
2
|
export { DEFAULT_CORRELATION_SCATTER_LABELS, correlationScatterModel, formatCorrelation } from './correlation-scatter-model.js';
|
|
3
|
+
export { GLANCE_AT_REST, glanceLineOption, pairedBarsOption, uixGlanceBase } from './chart-glance.js';
|
|
3
4
|
import 'echarts';
|
|
4
5
|
import './chart-theme.js';
|
|
5
6
|
import './chart-analytic-model.js';
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { chartPanelsModel } from "./chart-panels-model.js";
|
|
2
2
|
import { correlationScatterModel, formatCorrelation, DEFAULT_CORRELATION_SCATTER_LABELS } from "./correlation-scatter-model.js";
|
|
3
3
|
import { DEFAULT_CHART_PANELS_LABELS } from "./chart-panels-model.js";
|
|
4
|
+
import { GLANCE_AT_REST, glanceLineOption, pairedBarsOption, uixGlanceBase } from "./chart-glance.js";
|
|
4
5
|
export {
|
|
5
6
|
DEFAULT_CHART_PANELS_LABELS,
|
|
6
7
|
DEFAULT_CORRELATION_SCATTER_LABELS,
|
|
8
|
+
GLANCE_AT_REST,
|
|
7
9
|
chartPanelsModel,
|
|
8
10
|
correlationScatterModel,
|
|
9
|
-
formatCorrelation
|
|
11
|
+
formatCorrelation,
|
|
12
|
+
glanceLineOption,
|
|
13
|
+
pairedBarsOption,
|
|
14
|
+
uixGlanceBase
|
|
10
15
|
};
|
package/dist/chart-analytic.cjs
CHANGED
|
@@ -93,6 +93,9 @@ function uixChartTokens(source) {
|
|
|
93
93
|
const unquote = (font) => font.replace(/"/g, "");
|
|
94
94
|
return {
|
|
95
95
|
palette: [1, 2, 3, 4, 5, 6, 7, 8].map((i) => t(`chart-${i}`)),
|
|
96
|
+
series: t("chart-series"),
|
|
97
|
+
seriesSoft: t("chart-series-soft"),
|
|
98
|
+
categories: [1, 2, 3].map((i) => t(`chart-${i}`)),
|
|
96
99
|
neutral: t("chart-neutral"),
|
|
97
100
|
grid: t("chart-grid"),
|
|
98
101
|
axis: t("chart-axis"),
|
|
@@ -110,7 +113,9 @@ function uixChartTokens(source) {
|
|
|
110
113
|
textMuted: t("text-muted"),
|
|
111
114
|
border: t("border-strong"),
|
|
112
115
|
fontSans: unquote(t("font-sans")),
|
|
113
|
-
fontMono: unquote(t("font-mono"))
|
|
116
|
+
fontMono: unquote(t("font-mono")),
|
|
117
|
+
radius: t("radius-md"),
|
|
118
|
+
shadow: t("shadow-popover")
|
|
114
119
|
};
|
|
115
120
|
}
|
|
116
121
|
function uixChartTheme(source) {
|
|
@@ -1162,6 +1167,11 @@ function correlationScatterModel(spec, tokens, labelOverrides) {
|
|
|
1162
1167
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1163
1168
|
var CSS_VAR_TOKENS = {
|
|
1164
1169
|
palette: [1, 2, 3, 4, 5, 6, 7, 8].map((i) => `var(--uix-chart-${i})`),
|
|
1170
|
+
series: "var(--uix-chart-series)",
|
|
1171
|
+
seriesSoft: "var(--uix-chart-series-soft)",
|
|
1172
|
+
categories: [1, 2, 3].map((i) => `var(--uix-chart-${i})`),
|
|
1173
|
+
radius: "var(--uix-radius-md)",
|
|
1174
|
+
shadow: "var(--uix-shadow-popover)",
|
|
1165
1175
|
neutral: "var(--uix-chart-neutral)",
|
|
1166
1176
|
grid: "var(--uix-chart-grid)",
|
|
1167
1177
|
axis: "var(--uix-chart-axis)",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { U as UixChartTokens, C as ChartLabels, a as ChartProps } from './ChartCore-
|
|
4
|
-
export { b as ChartEngine, c as ChartEventHandler, d as ChartLegend, e as ChartLegendItem, f as ChartLegendItemProps, g as ChartLegendProps, h as ChartMetric, i as ChartMetricProps, j as ChartOption, k as ChartTable, l as ChartTableRow, m as ChartTokenSource, D as DEFAULT_CHART_LABELS, n as mergeChartTheme, u as uixChartAreaGradient, o as uixChartPalette, p as uixChartTheme, q as uixChartTokens } from './ChartCore-
|
|
3
|
+
import { U as UixChartTokens, C as ChartLabels, a as ChartProps } from './ChartCore-CY5a4teJ.cjs';
|
|
4
|
+
export { b as ChartEngine, c as ChartEventHandler, d as ChartLegend, e as ChartLegendItem, f as ChartLegendItemProps, g as ChartLegendProps, h as ChartMetric, i as ChartMetricProps, j as ChartOption, k as ChartTable, l as ChartTableRow, m as ChartTokenSource, D as DEFAULT_CHART_LABELS, n as mergeChartTheme, u as uixChartAreaGradient, o as uixChartPalette, p as uixChartTheme, q as uixChartTokens } from './ChartCore-CY5a4teJ.cjs';
|
|
5
5
|
import { ScatterSeriesOption, MarkLineComponentOption, MarkAreaComponentOption, MarkPointComponentOption, LineSeriesOption, EChartsOption } from 'echarts';
|
|
6
6
|
import { L as LinearFit } from './chart-stats-o4zDhpVm.cjs';
|
|
7
7
|
export { C as ChartStatPoint, P as PredictionBandPoint, l as linearFit, n as normalQuantile, p as predictionBand, q as quantiles, s as studentTQuantile } from './chart-stats-o4zDhpVm.cjs';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { EChartsOption } from 'echarts';
|
|
2
|
+
import { UixChartTokens } from './chart-theme.js';
|
|
3
|
+
|
|
4
|
+
/** How a glance chart draws in. `play: false` (the default) draws it at rest, with no animation. */
|
|
5
|
+
interface GlanceMotion {
|
|
6
|
+
play: boolean;
|
|
7
|
+
/** When the chart starts drawing, after its card started (ms). */
|
|
8
|
+
delay: number;
|
|
9
|
+
/** A line tracing in (ms). */
|
|
10
|
+
trace: number;
|
|
11
|
+
/** One bar growing (ms). */
|
|
12
|
+
grow: number;
|
|
13
|
+
/** The gap between one bucket starting to grow and the next (ms). */
|
|
14
|
+
stagger: number;
|
|
15
|
+
}
|
|
16
|
+
declare const GLANCE_AT_REST: GlanceMotion;
|
|
17
|
+
/** Formats a value for the tooltip and the end label. */
|
|
18
|
+
type GlanceFormat = (value: number) => string;
|
|
19
|
+
/** The shared frame: grid, dashed gridlines, sans axis digits and the dark tooltip. */
|
|
20
|
+
declare function uixGlanceBase(k: UixChartTokens, motion?: GlanceMotion): EChartsOption;
|
|
21
|
+
interface GlanceLineInput {
|
|
22
|
+
/** The x labels of the measured points (weeks, days). */
|
|
23
|
+
categories: string[];
|
|
24
|
+
values: number[];
|
|
25
|
+
/** The series name, for the tooltip ("offen"). */
|
|
26
|
+
name: string;
|
|
27
|
+
/** A dashed projection that continues from the last measured point. */
|
|
28
|
+
forecast?: {
|
|
29
|
+
categories: string[];
|
|
30
|
+
values: number[];
|
|
31
|
+
name: string;
|
|
32
|
+
label?: string;
|
|
33
|
+
};
|
|
34
|
+
/** Label the line at its end with its last value (default true). */
|
|
35
|
+
endLabel?: boolean;
|
|
36
|
+
/** A faint wash under the line (default true). */
|
|
37
|
+
area?: boolean;
|
|
38
|
+
format?: GlanceFormat;
|
|
39
|
+
/** The tooltip's title for an x label ("Woche ab 2. Nov."). Default the label itself. */
|
|
40
|
+
tooltipTitle?: (category: string) => string;
|
|
41
|
+
}
|
|
42
|
+
/** One line in the series blue, labelled at its end, optionally with a dashed forecast. */
|
|
43
|
+
declare function glanceLineOption(k: UixChartTokens, input: GlanceLineInput, motion?: GlanceMotion): EChartsOption;
|
|
44
|
+
interface PairedBarsInput {
|
|
45
|
+
/** The buckets (days, weeks); at most 12 read at a glance. */
|
|
46
|
+
categories: string[];
|
|
47
|
+
/** The measure, in the series blue ("eröffnet"). */
|
|
48
|
+
series: {
|
|
49
|
+
name: string;
|
|
50
|
+
values: number[];
|
|
51
|
+
};
|
|
52
|
+
/** The comparison, in grey ("gelöst"). */
|
|
53
|
+
comparison: {
|
|
54
|
+
name: string;
|
|
55
|
+
values: number[];
|
|
56
|
+
};
|
|
57
|
+
format?: GlanceFormat;
|
|
58
|
+
tooltipTitle?: (category: string) => string;
|
|
59
|
+
}
|
|
60
|
+
/** The most buckets a paired-bar glance chart should hold. */
|
|
61
|
+
declare const PAIRED_BARS_MAX_BUCKETS = 12;
|
|
62
|
+
/** Two bars per bucket: the measure in blue beside its comparison in grey. */
|
|
63
|
+
declare function pairedBarsOption(k: UixChartTokens, input: PairedBarsInput, motion?: GlanceMotion): EChartsOption;
|
|
64
|
+
|
|
65
|
+
export { GLANCE_AT_REST, type GlanceFormat, type GlanceLineInput, type GlanceMotion, PAIRED_BARS_MAX_BUCKETS, type PairedBarsInput, glanceLineOption, pairedBarsOption, uixGlanceBase };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
const GLANCE_AT_REST = { play: false, delay: 0, trace: 0, grow: 0, stagger: 0 };
|
|
2
|
+
const escapeHtml = (value) => String(value).replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
|
|
3
|
+
const plain = (value) => value.toLocaleString();
|
|
4
|
+
function tooltipHtml(title, rows) {
|
|
5
|
+
return `<div class="uix-glance-tooltip"><div class="uix-glance-tooltip__title">${escapeHtml(title)}</div>${rows.map((row) => `<div class="uix-glance-tooltip__row"><span class="uix-glance-tooltip__swatch" style="--swatch:${escapeHtml(row.color)}"></span>${escapeHtml(row.name)}<span class="uix-glance-tooltip__value">${escapeHtml(row.value)}</span></div>`).join("")}</div>`;
|
|
6
|
+
}
|
|
7
|
+
const seriesColor = (k) => k.series ?? k.palette[0] ?? "";
|
|
8
|
+
function uixGlanceBase(k, motion = GLANCE_AT_REST) {
|
|
9
|
+
return {
|
|
10
|
+
backgroundColor: "transparent",
|
|
11
|
+
animation: motion.play,
|
|
12
|
+
animationDurationUpdate: 0,
|
|
13
|
+
textStyle: { color: k.textMuted, fontFamily: k.fontSans, fontSize: 11 },
|
|
14
|
+
grid: { top: 10, right: 12, bottom: 4, left: 4, containLabel: true },
|
|
15
|
+
tooltip: {
|
|
16
|
+
trigger: "axis",
|
|
17
|
+
confine: true,
|
|
18
|
+
backgroundColor: k.text,
|
|
19
|
+
borderWidth: 0,
|
|
20
|
+
padding: [6, 10],
|
|
21
|
+
textStyle: { color: k.surface, fontFamily: k.fontSans, fontSize: 12 },
|
|
22
|
+
extraCssText: [k.radius ? `border-radius:${k.radius}` : "", k.shadow ? `box-shadow:${k.shadow}` : ""].filter(Boolean).join(";"),
|
|
23
|
+
transitionDuration: 0
|
|
24
|
+
},
|
|
25
|
+
xAxis: {
|
|
26
|
+
type: "category",
|
|
27
|
+
axisLine: { lineStyle: { color: k.axis } },
|
|
28
|
+
axisTick: { show: false },
|
|
29
|
+
axisLabel: { color: k.textMuted, fontFamily: k.fontSans, fontSize: 11, hideOverlap: true },
|
|
30
|
+
splitLine: { show: false }
|
|
31
|
+
},
|
|
32
|
+
yAxis: {
|
|
33
|
+
type: "value",
|
|
34
|
+
splitNumber: 3,
|
|
35
|
+
minInterval: 1,
|
|
36
|
+
axisLine: { show: false },
|
|
37
|
+
axisTick: { show: false },
|
|
38
|
+
axisLabel: { color: k.textMuted, fontFamily: k.fontSans, fontSize: 11 },
|
|
39
|
+
splitLine: { lineStyle: { color: k.axis, type: [3, 4], width: 1 } }
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function glanceLineOption(k, input, motion = GLANCE_AT_REST) {
|
|
44
|
+
const format = input.format ?? plain;
|
|
45
|
+
const last = input.values.length - 1;
|
|
46
|
+
const forecast = input.forecast;
|
|
47
|
+
const categories = [...input.categories, ...forecast?.categories ?? []];
|
|
48
|
+
const labelled = (value, text, color2, dot) => ({
|
|
49
|
+
value,
|
|
50
|
+
symbolSize: dot ? 8 : 0,
|
|
51
|
+
label: { show: true, position: "right", distance: 6, color: color2, fontFamily: k.fontSans, fontSize: 11, fontWeight: 600, formatter: () => text }
|
|
52
|
+
});
|
|
53
|
+
const showEnd = input.endLabel !== false && !forecast && last >= 0;
|
|
54
|
+
const measured = forecast ? [
|
|
55
|
+
...input.values.map((v, i) => i === last ? { value: v, symbolSize: 8 } : v),
|
|
56
|
+
...forecast.values.map(() => null)
|
|
57
|
+
] : [
|
|
58
|
+
...input.values.map((v, i) => showEnd && i === last ? labelled(v, format(v), k.text, true) : v)
|
|
59
|
+
];
|
|
60
|
+
const projected = forecast ? [...input.values.map((v, i) => i === last ? v : null), ...forecast.values.map((v, i) => i === forecast.values.length - 1 ? labelled(v, forecast.label ?? format(v), k.textMuted, false) : v)] : [];
|
|
61
|
+
const color = seriesColor(k);
|
|
62
|
+
const base = uixGlanceBase(k, motion);
|
|
63
|
+
const title = input.tooltipTitle ?? ((c) => c);
|
|
64
|
+
const endText = forecast ? forecast.label ?? format(forecast.values[forecast.values.length - 1] ?? 0) : showEnd ? format(input.values[last]) : "";
|
|
65
|
+
const series = [{
|
|
66
|
+
name: input.name,
|
|
67
|
+
type: "line",
|
|
68
|
+
data: measured,
|
|
69
|
+
color,
|
|
70
|
+
// symbols at size 0 so the last point can carry its dot and its label
|
|
71
|
+
showSymbol: true,
|
|
72
|
+
symbol: "circle",
|
|
73
|
+
symbolSize: 0,
|
|
74
|
+
lineStyle: { width: 2.2, cap: "round", join: "round" },
|
|
75
|
+
itemStyle: { color, borderColor: k.surface, borderWidth: 2 },
|
|
76
|
+
areaStyle: input.area === false ? void 0 : k.seriesSoft ? { color: k.seriesSoft, opacity: 1 } : { color, opacity: 0.14 },
|
|
77
|
+
emphasis: { disabled: true },
|
|
78
|
+
animationDuration: motion.trace,
|
|
79
|
+
animationDelay: motion.delay,
|
|
80
|
+
animationEasing: "cubicOut"
|
|
81
|
+
}];
|
|
82
|
+
if (forecast) {
|
|
83
|
+
series.push({
|
|
84
|
+
name: forecast.name,
|
|
85
|
+
type: "line",
|
|
86
|
+
data: projected,
|
|
87
|
+
color,
|
|
88
|
+
showSymbol: true,
|
|
89
|
+
symbolSize: 0,
|
|
90
|
+
connectNulls: false,
|
|
91
|
+
lineStyle: { width: 2, type: [4, 5], opacity: 0.75, cap: "round" },
|
|
92
|
+
itemStyle: { color },
|
|
93
|
+
emphasis: { disabled: true },
|
|
94
|
+
// the projection continues the measured line, at half its pace
|
|
95
|
+
animationDuration: Math.round(motion.trace / 2),
|
|
96
|
+
animationDelay: motion.delay + motion.trace,
|
|
97
|
+
animationEasing: "cubicOut"
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
...base,
|
|
102
|
+
// the gutter fits the end label ("Prognose 140"): about 6.5 px a character at 11 px
|
|
103
|
+
grid: { ...base.grid, right: endText ? Math.max(24, Math.ceil(endText.length * 6.5) + 14) : 12 },
|
|
104
|
+
tooltip: {
|
|
105
|
+
...base.tooltip,
|
|
106
|
+
axisPointer: { type: "line", lineStyle: { color: k.textMuted, type: [2, 3], width: 1 } },
|
|
107
|
+
formatter: (params) => {
|
|
108
|
+
const list = (Array.isArray(params) ? params : [params]).filter((p) => p.value != null);
|
|
109
|
+
if (!list.length) return "";
|
|
110
|
+
const point = list.find((p) => p.seriesIndex === 0) ?? list[0];
|
|
111
|
+
const value = typeof point.value === "object" && point.value !== null ? point.value.value : point.value;
|
|
112
|
+
return tooltipHtml(title(point.name), [{ color, name: point.seriesName, value: format(value) }]);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
xAxis: { ...base.xAxis, data: categories, boundaryGap: false },
|
|
116
|
+
series
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const PAIRED_BARS_MAX_BUCKETS = 12;
|
|
120
|
+
function pairedBarsOption(k, input, motion = GLANCE_AT_REST) {
|
|
121
|
+
const format = input.format ?? plain;
|
|
122
|
+
const base = uixGlanceBase(k, motion);
|
|
123
|
+
const title = input.tooltipTitle ?? ((c) => c);
|
|
124
|
+
const bar = (name, values, color, offset) => ({
|
|
125
|
+
name,
|
|
126
|
+
type: "bar",
|
|
127
|
+
data: values,
|
|
128
|
+
color,
|
|
129
|
+
barMaxWidth: 16,
|
|
130
|
+
barGap: "18%",
|
|
131
|
+
barCategoryGap: "38%",
|
|
132
|
+
itemStyle: { color, borderRadius: [3, 3, 0, 0] },
|
|
133
|
+
emphasis: { disabled: true },
|
|
134
|
+
animationDuration: motion.grow,
|
|
135
|
+
animationDelay: (index) => motion.delay + index * motion.stagger + offset,
|
|
136
|
+
animationEasing: "cubicOut"
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
...base,
|
|
140
|
+
tooltip: {
|
|
141
|
+
...base.tooltip,
|
|
142
|
+
axisPointer: { type: "shadow", shadowStyle: { color: k.forecastBand } },
|
|
143
|
+
formatter: (params) => {
|
|
144
|
+
const list = Array.isArray(params) ? params : [params];
|
|
145
|
+
if (!list.length) return "";
|
|
146
|
+
return tooltipHtml(title(list[0].name), list.map((p) => ({ color: p.color, name: p.seriesName, value: format(p.value) })));
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
xAxis: { ...base.xAxis, data: input.categories },
|
|
150
|
+
series: [
|
|
151
|
+
bar(input.series.name, input.series.values, seriesColor(k), 0),
|
|
152
|
+
bar(input.comparison.name, input.comparison.values, k.comparison, motion.stagger)
|
|
153
|
+
]
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export {
|
|
157
|
+
GLANCE_AT_REST,
|
|
158
|
+
PAIRED_BARS_MAX_BUCKETS,
|
|
159
|
+
glanceLineOption,
|
|
160
|
+
pairedBarsOption,
|
|
161
|
+
uixGlanceBase
|
|
162
|
+
};
|