@mechane-ai/elements 0.42.0 → 0.44.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 +32 -32
- package/dist/ai.js +1 -1
- package/dist/catalog.json +89 -1
- package/dist/{categorical-values-B6lGI7BH.js → categorical-values-ByvFLaNE.js} +3 -3
- package/dist/{chart-frame-D0enjyj9.js → chart-frame-Bcd9Tpt5.js} +75 -23
- package/dist/{chart-input-D4_Awave.js → chart-input-B6_HXFDP.js} +2 -2
- package/dist/{chart-navigation-D4-pdgpj.js → chart-navigation-BAbb5PV9.js} +56 -32
- package/dist/charts/cartesian.js +1701 -551
- package/dist/charts/distribution.js +41 -28
- package/dist/charts/graph.js +443 -76
- package/dist/charts/hierarchy.js +5 -5
- package/dist/charts/matrix.js +232 -63
- package/dist/charts/timeline.js +2 -2
- package/dist/charts.js +2 -2
- package/dist/collections.js +2 -2
- package/dist/{constants.stylex-BILvnwUk.js → constants.stylex-CaVa9yGN.js} +9 -9
- package/dist/content/tree.js +1 -1
- package/dist/feedback.js +1 -1
- package/dist/label-spacing-BncjePGb.js +6 -0
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +15 -3
- package/dist/packages/charts/src/cartesian/bar-data.d.ts +43 -0
- package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +32 -0
- package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +29 -0
- package/dist/packages/charts/src/cartesian/bridge-data.d.ts +40 -0
- package/dist/packages/charts/src/cartesian/index.d.ts +7 -2
- package/dist/packages/charts/src/cartesian/reference-lines.d.ts +34 -0
- package/dist/packages/charts/src/cartesian/sparkline.d.ts +10 -1
- package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +66 -0
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +11 -1
- package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +35 -0
- package/dist/packages/charts/src/cartesian/time-series.d.ts +6 -1
- package/dist/packages/charts/src/chart-inspection.d.ts +3 -1
- package/dist/packages/charts/src/chart-navigation.d.ts +3 -1
- package/dist/packages/charts/src/chart-series-marker.d.ts +8 -1
- package/dist/packages/charts/src/chart-surface.d.ts +2 -0
- package/dist/packages/charts/src/chart-theme.d.ts +29 -2
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +3 -1
- package/dist/packages/charts/src/graph/flow-diagram.d.ts +26 -0
- package/dist/packages/charts/src/graph/flow-layout.d.ts +70 -0
- package/dist/packages/charts/src/graph/index.d.ts +2 -0
- package/dist/packages/charts/src/index.d.ts +1 -1
- package/dist/packages/charts/src/label-spacing.d.ts +15 -0
- package/dist/packages/charts/src/matrix/matrix-cells.d.ts +4 -0
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +20 -0
- package/dist/packages/charts/src/matrix/matrix-types.d.ts +21 -0
- package/dist/packages/charts/src/matrix/matrix.d.ts +8 -19
- package/dist/{plot-width-BQQS-mw9.js → plot-width-8cXdAjoD.js} +31 -2
- package/dist/{src-BpvnBWrF.js → src-CDp1JtwC.js} +1 -1
- package/dist/styles2.css +141 -18
- package/dist/tokens.js +1 -1
- package/package.json +1 -1
- package/packages/foundations/src/constants.stylex.ts +9 -9
- package/packages/foundations/src/tokens.stylex.ts +9 -9
- package/recipes/allocation-report.tsx +115 -0
package/dist/charts/cartesian.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { c as e, d as t, f as n } from "../src-
|
|
2
|
-
import { i as r, n as i, r as a, t as o } from "../categorical-values-
|
|
3
|
-
import { a as s, n as c, r as l, t as u } from "../chart-navigation-
|
|
4
|
-
import { a as d, i as f, n as p } from "../chart-frame-
|
|
5
|
-
import { n as m, r as h, t as g } from "../chart-input-
|
|
1
|
+
import { c as e, d as t, f as n } from "../src-CDp1JtwC.js";
|
|
2
|
+
import { i as r, n as i, r as a, t as o } from "../categorical-values-ByvFLaNE.js";
|
|
3
|
+
import { a as s, n as c, r as l, t as u } from "../chart-navigation-BAbb5PV9.js";
|
|
4
|
+
import { a as d, i as f, n as p } from "../chart-frame-Bcd9Tpt5.js";
|
|
5
|
+
import { n as m, r as h, t as g } from "../chart-input-B6_HXFDP.js";
|
|
6
6
|
import { r as _ } from "../tokens.stylex-dF5CACEJ.js";
|
|
7
|
-
import { n as v, t as ee } from "../plot-width-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
7
|
+
import { n as v, t as ee } from "../plot-width-8cXdAjoD.js";
|
|
8
|
+
import { t as y } from "../label-spacing-BncjePGb.js";
|
|
9
|
+
import { O as b } from "../src-DcW_gMX8.js";
|
|
10
|
+
import { h as x } from "../src-gqEebHEa.js";
|
|
11
|
+
import * as S from "@stylexjs/stylex";
|
|
12
|
+
import { Button as C } from "@ui-sdk/react/button";
|
|
13
|
+
import { useEffect as te, useId as w, useMemo as T, useRef as ne, useState as E } from "react";
|
|
14
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
15
|
+
import { bindDrag as A } from "@ui-sdk/core";
|
|
16
|
+
import { scaleBand as re, scaleLinear as j } from "@visx/scale";
|
|
17
|
+
import { Area as ie, AreaClosed as M, Bar as N, LinePath as P } from "@visx/shape";
|
|
17
18
|
// packages/charts/src/chart-cursor.tsx
|
|
18
19
|
function ae({ x: e, top: t, bottom: n, width: r }) {
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ k("g", {
|
|
20
21
|
"aria-hidden": !0,
|
|
21
22
|
className: "xlshs6z xgs60n x17y187c xbabvq0 x47corl",
|
|
22
|
-
children: [/* @__PURE__ */
|
|
23
|
+
children: [/* @__PURE__ */ O("line", {
|
|
23
24
|
x1: e,
|
|
24
25
|
x2: e,
|
|
25
26
|
y1: t,
|
|
26
27
|
y2: n,
|
|
27
28
|
className: "xnpr05h x1ntoi03 x13efnbd"
|
|
28
|
-
}), /* @__PURE__ */
|
|
29
|
+
}), /* @__PURE__ */ O("line", {
|
|
29
30
|
x1: e - r / 2,
|
|
30
31
|
x2: e + r / 2,
|
|
31
32
|
y1: n + 4,
|
|
@@ -35,14 +36,14 @@ function ae({ x: e, top: t, bottom: n, width: r }) {
|
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
// packages/charts/src/chart-inspection.tsx
|
|
38
|
-
var
|
|
39
|
+
var F = {
|
|
39
40
|
kzqmXN: "x1xc55vz",
|
|
40
41
|
kZKoxP: "xdk7pt",
|
|
41
42
|
kmuXW: "x2lah0s",
|
|
42
43
|
$$css: !0
|
|
43
|
-
},
|
|
44
|
+
}, I = {
|
|
44
45
|
swatch: (e) => [
|
|
45
|
-
|
|
46
|
+
F,
|
|
46
47
|
{
|
|
47
48
|
kWkggS: e == null ? e : "xl8spv7",
|
|
48
49
|
$$css: !0
|
|
@@ -84,43 +85,43 @@ var N = {
|
|
|
84
85
|
}]
|
|
85
86
|
}, oe = 4;
|
|
86
87
|
function se() {
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ O("ul", {
|
|
88
89
|
"aria-hidden": !0,
|
|
89
90
|
inert: !0,
|
|
90
91
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k",
|
|
91
|
-
children: Array.from({ length: oe }, (e, t) => /* @__PURE__ */
|
|
92
|
+
children: Array.from({ length: oe }, (e, t) => /* @__PURE__ */ k("li", {
|
|
92
93
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe x1f394nn x43dure",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ O("span", { ...S.props(I.swatch(_.line)) }), /* @__PURE__ */ k("span", {
|
|
94
95
|
className: "x1cqoux5 xeuugli",
|
|
95
96
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ O(n, {}),
|
|
98
|
+
/* @__PURE__ */ O("span", {
|
|
98
99
|
className: "x1s85apg xannxpe",
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ O(n, {})
|
|
100
101
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ O("span", {
|
|
102
103
|
className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ O(n, {})
|
|
104
105
|
})
|
|
105
106
|
]
|
|
106
107
|
})]
|
|
107
108
|
}, t))
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
-
return t === void 0 ? e : /* @__PURE__ */
|
|
111
|
+
function ce({ title: e, detail: t }) {
|
|
112
|
+
return t === void 0 ? e : /* @__PURE__ */ k("span", {
|
|
112
113
|
"aria-label": e,
|
|
113
114
|
className: "x1lliihq xb3r6kr xlyipyv xuxw1ft",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ O("span", {
|
|
115
116
|
className: "xt0psk2 x1boff50",
|
|
116
117
|
children: e
|
|
117
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ O("span", {
|
|
118
119
|
className: "x1s85apg xfodcyb",
|
|
119
120
|
children: t
|
|
120
121
|
})]
|
|
121
122
|
});
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function le({ label: e, summary: t, rows: n, notes: r = [] }) {
|
|
124
125
|
if (e !== void 0) return [
|
|
125
126
|
e,
|
|
126
127
|
t,
|
|
@@ -128,32 +129,38 @@ function ce({ label: e, summary: t, rows: n, notes: r = [] }) {
|
|
|
128
129
|
...r
|
|
129
130
|
].filter((e) => e !== void 0).join(" · ");
|
|
130
131
|
}
|
|
131
|
-
function
|
|
132
|
-
let p = Math.min(260, s),
|
|
133
|
-
return /* @__PURE__ */
|
|
132
|
+
function ue({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [], hasSeriesSummary: f = !1, hasLegend: p = !0 }) {
|
|
133
|
+
let m = p && !f, h = Math.min(260, s), g = o > s / 2 ? o - h - c : o + c, _ = Math.max(0, Math.min(s - h, g));
|
|
134
|
+
return /* @__PURE__ */ k("div", {
|
|
134
135
|
className: "xeuugli",
|
|
135
136
|
children: [
|
|
136
|
-
|
|
137
|
+
m && /* @__PURE__ */ k("div", {
|
|
137
138
|
className: "xrvj5dj xeuugli",
|
|
138
|
-
children: [i !== void 0 && /* @__PURE__ */
|
|
139
|
+
children: [i !== void 0 && /* @__PURE__ */ O("ul", {
|
|
139
140
|
"aria-hidden": !0,
|
|
140
141
|
inert: !0,
|
|
141
142
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc xlshs6z x47corl",
|
|
142
|
-
children: i.map((e) => /* @__PURE__ */
|
|
143
|
+
children: i.map((e) => /* @__PURE__ */ k("li", {
|
|
143
144
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ O(d, {
|
|
146
|
+
tone: e.tone,
|
|
147
|
+
shape: e.shape
|
|
148
|
+
}), /* @__PURE__ */ k("span", {
|
|
145
149
|
className: "xeuugli",
|
|
146
|
-
children: [e.label, /* @__PURE__ */
|
|
150
|
+
children: [e.label, /* @__PURE__ */ O("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
|
|
147
151
|
})]
|
|
148
152
|
}, e.id))
|
|
149
|
-
}), /* @__PURE__ */
|
|
153
|
+
}), /* @__PURE__ */ O("ul", {
|
|
150
154
|
"aria-label": "Legend",
|
|
151
155
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc",
|
|
152
|
-
children: r.map((e) => /* @__PURE__ */
|
|
156
|
+
children: r.map((e) => /* @__PURE__ */ k("li", {
|
|
153
157
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ O(d, {
|
|
159
|
+
tone: e.tone,
|
|
160
|
+
shape: e.shape
|
|
161
|
+
}), /* @__PURE__ */ k("span", {
|
|
155
162
|
className: "xeuugli",
|
|
156
|
-
children: [e.label, /* @__PURE__ */
|
|
163
|
+
children: [e.label, /* @__PURE__ */ O("span", {
|
|
157
164
|
className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
|
|
158
165
|
children: t === void 0 ? "" : a.find((t) => t.id === e.id)?.value ?? "—"
|
|
159
166
|
})]
|
|
@@ -161,41 +168,44 @@ function le({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
|
|
|
161
168
|
}, e.id))
|
|
162
169
|
})]
|
|
163
170
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ O("span", {
|
|
165
172
|
id: e,
|
|
166
173
|
"aria-live": l === "keyboard" ? "polite" : "off",
|
|
167
174
|
className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xb3r6kr x1hyvwdk xuxw1ft",
|
|
168
|
-
children:
|
|
175
|
+
children: le({
|
|
169
176
|
label: t,
|
|
170
177
|
summary: n,
|
|
171
178
|
rows: a,
|
|
172
179
|
notes: u
|
|
173
180
|
})
|
|
174
181
|
}),
|
|
175
|
-
t !== void 0 && /* @__PURE__ */
|
|
182
|
+
t !== void 0 && /* @__PURE__ */ O("div", {
|
|
176
183
|
"aria-hidden": !0,
|
|
177
184
|
className: "x1n2onr6 xqtp20y x1vjfegm",
|
|
178
|
-
children: /* @__PURE__ */
|
|
179
|
-
...
|
|
185
|
+
children: /* @__PURE__ */ k("div", {
|
|
186
|
+
...S.props(I.inspector, !m && I.summaryInspector, I.position(_, h)),
|
|
180
187
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ k("div", {
|
|
182
189
|
className: "x78zum5 x1qughib x1hnptsi xk4h15q",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ O("span", { children: t }), n !== void 0 && /* @__PURE__ */ O("span", { children: n })]
|
|
184
191
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ O("dl", {
|
|
186
193
|
className: "xrvj5dj xunmzkg x1ghz6dp",
|
|
187
|
-
children: a.map((e) => /* @__PURE__ */
|
|
194
|
+
children: a.map((e) => /* @__PURE__ */ k("div", {
|
|
188
195
|
className: "x78zum5 x1qughib x1pha0wt x1hnptsi",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ k("dt", {
|
|
190
197
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
192
|
-
|
|
198
|
+
children: [/* @__PURE__ */ O(d, {
|
|
199
|
+
tone: e.tone,
|
|
200
|
+
shape: e.shape
|
|
201
|
+
}), e.label]
|
|
202
|
+
}), /* @__PURE__ */ O("dd", {
|
|
193
203
|
className: "x1ghz6dp xuxw1ft",
|
|
194
204
|
children: e.value
|
|
195
205
|
})]
|
|
196
206
|
}, e.id))
|
|
197
207
|
}),
|
|
198
|
-
u.map((e) => /* @__PURE__ */
|
|
208
|
+
u.map((e) => /* @__PURE__ */ O("span", { children: e }, e))
|
|
199
209
|
]
|
|
200
210
|
})
|
|
201
211
|
})
|
|
@@ -203,7 +213,7 @@ function le({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
|
|
|
203
213
|
});
|
|
204
214
|
}
|
|
205
215
|
// packages/charts/src/cartesian/bar-data.ts
|
|
206
|
-
function
|
|
216
|
+
function de({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
207
217
|
if (e === void 0) return;
|
|
208
218
|
if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
|
|
209
219
|
let i = e.annotation;
|
|
@@ -220,28 +230,157 @@ function ue({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
|
220
230
|
}
|
|
221
231
|
}
|
|
222
232
|
}
|
|
233
|
+
var L = 6;
|
|
234
|
+
function fe(e, t) {
|
|
235
|
+
return e === null ? !0 : e === void 0 || !Number.isFinite(e) ? !1 : e >= t[0] && e <= t[1];
|
|
236
|
+
}
|
|
237
|
+
function R({ marker: e, categoryCount: t, domain: n }) {
|
|
238
|
+
let r = e.kind === "tick" ? [e.values] : [e.lower, e.upper];
|
|
239
|
+
if (r.some((e) => e.length !== t)) return "Every bar marker requires one explicit value per category.";
|
|
240
|
+
if (r.some((e) => e.some((e) => !fe(e, n)))) return "Bar marker values must be finite and within the supplied domain.";
|
|
241
|
+
if (e.kind === "range") for (let [t, n] of e.lower.entries()) {
|
|
242
|
+
let r = e.upper[t] ?? null;
|
|
243
|
+
if (n === null != (r === null) || n !== null && r !== null && n > r) return "A range marker needs both bounds, with the lower bound at most the upper bound, or neither.";
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function pe({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r, categoryIds: i, domain: a }) {
|
|
247
|
+
if (e.length > L) return `Supply at most ${L} bar markers.`;
|
|
248
|
+
let o = [...e, ...t];
|
|
249
|
+
if (new Set(o.map((e) => e.id)).size !== o.length || r.some((e) => o.some((t) => t.id === e))) return "Bar series, markers, and annotations require distinct identifiers.";
|
|
250
|
+
for (let t of e) {
|
|
251
|
+
if (!r.includes(t.seriesId)) return "Each bar marker must refer to a supplied series.";
|
|
252
|
+
let e = R({
|
|
253
|
+
marker: t,
|
|
254
|
+
categoryCount: i.length,
|
|
255
|
+
domain: a
|
|
256
|
+
});
|
|
257
|
+
if (e !== void 0) return e;
|
|
258
|
+
}
|
|
259
|
+
for (let e of t) {
|
|
260
|
+
let t = e.seriesId === void 0 || r.includes(e.seriesId), n = e.label.trim() !== "";
|
|
261
|
+
if (!(i.includes(e.categoryId) && t && n)) return "Each bar annotation needs a label, a supplied category, and a supplied series when it names one.";
|
|
262
|
+
}
|
|
263
|
+
if (new Set(t.map((e) => JSON.stringify([e.categoryId, e.seriesId ?? null]))).size !== t.length) return "Each bar can hold one annotation.";
|
|
264
|
+
if (new Set(n).size !== n.length || n.some((e) => !i.includes(e))) return "Emphasized categories must be unique supplied categories.";
|
|
265
|
+
}
|
|
266
|
+
function z({ marker: e, index: t, formatValue: n }) {
|
|
267
|
+
if (e.kind === "tick") {
|
|
268
|
+
let r = e.values[t] ?? null;
|
|
269
|
+
return r === null ? "Unavailable" : n(r);
|
|
270
|
+
}
|
|
271
|
+
let r = e.lower[t] ?? null, i = e.upper[t] ?? null;
|
|
272
|
+
return r === null || i === null ? "Unavailable" : `${n(r)} – ${n(i)}`;
|
|
273
|
+
}
|
|
274
|
+
function B(e, t) {
|
|
275
|
+
return e.kind === "tick" ? e.values[t] ?? null : e.upper[t] ?? null;
|
|
276
|
+
}
|
|
277
|
+
// packages/charts/src/cartesian/bar-overlays.tsx
|
|
278
|
+
var me = {
|
|
279
|
+
kU5bRw: "x5lxx2x",
|
|
280
|
+
kREpy8: "x13efnbd",
|
|
281
|
+
$$css: !0
|
|
282
|
+
}, V = { stroke: (e) => [
|
|
283
|
+
me,
|
|
284
|
+
{
|
|
285
|
+
kjVXCG: e == null ? e : "x6mkzkt",
|
|
286
|
+
$$css: !0
|
|
287
|
+
},
|
|
288
|
+
{ "--x-stroke": e ?? void 0 }
|
|
289
|
+
] }, he = 3, H = 1, U = 1.5, ge = 3, W = 14, _e = 6.5;
|
|
290
|
+
function ve({ path: e, color: t, width: n }) {
|
|
291
|
+
return /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("path", {
|
|
292
|
+
d: e,
|
|
293
|
+
strokeWidth: n + 4,
|
|
294
|
+
className: "xaep1og x5lxx2x x13efnbd"
|
|
295
|
+
}), /* @__PURE__ */ O("path", {
|
|
296
|
+
d: e,
|
|
297
|
+
strokeWidth: n,
|
|
298
|
+
...S.props(V.stroke(t))
|
|
299
|
+
})] });
|
|
300
|
+
}
|
|
301
|
+
function ye({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
302
|
+
let a = e.kind === "tick" ? e.values[t] ?? null : null;
|
|
303
|
+
if (a !== null && r !== null && a !== r) return `M${n.x + n.width / 2},${i(r)} V${i(a)}`;
|
|
304
|
+
}
|
|
305
|
+
function be({ marker: e, index: t, span: n, y: r }) {
|
|
306
|
+
if (e.kind === "tick") {
|
|
307
|
+
let i = e.values[t] ?? null;
|
|
308
|
+
if (i === null) return;
|
|
309
|
+
let a = r(i);
|
|
310
|
+
return `M${n.x - ge},${a} H${n.x + n.width + ge}`;
|
|
311
|
+
}
|
|
312
|
+
let i = e.lower[t] ?? null, a = e.upper[t] ?? null;
|
|
313
|
+
if (i === null || a === null) return;
|
|
314
|
+
let o = n.x + n.width / 2, s = Math.min(W, n.width * .6) / 2, c = r(i), l = r(a);
|
|
315
|
+
return `M${o - s},${l} H${o + s} M${o},${l} V${c} M${o - s},${c} H${o + s}`;
|
|
316
|
+
}
|
|
317
|
+
function xe({ markers: t, categoryIds: n, span: r, barTop: i, y: a, isReceded: o }) {
|
|
318
|
+
return /* @__PURE__ */ O("g", { children: t.map((t) => /* @__PURE__ */ O("g", { children: n.map((n, s) => {
|
|
319
|
+
let c = r(n, t.seriesId), l = be({
|
|
320
|
+
marker: t,
|
|
321
|
+
index: s,
|
|
322
|
+
span: c,
|
|
323
|
+
y: a
|
|
324
|
+
});
|
|
325
|
+
if (l === void 0) return null;
|
|
326
|
+
let u = e[t.tone ?? "neutral"], d = ye({
|
|
327
|
+
marker: t,
|
|
328
|
+
index: s,
|
|
329
|
+
span: c,
|
|
330
|
+
base: i(s, t.seriesId),
|
|
331
|
+
y: a
|
|
332
|
+
});
|
|
333
|
+
return /* @__PURE__ */ k("g", {
|
|
334
|
+
...S.props(v.emphasis, o(n) && v.receded),
|
|
335
|
+
children: [d !== void 0 && /* @__PURE__ */ O(ve, {
|
|
336
|
+
path: d,
|
|
337
|
+
color: u,
|
|
338
|
+
width: H
|
|
339
|
+
}), /* @__PURE__ */ O(ve, {
|
|
340
|
+
path: l,
|
|
341
|
+
color: u,
|
|
342
|
+
width: t.kind === "tick" ? he : U
|
|
343
|
+
})]
|
|
344
|
+
}, n);
|
|
345
|
+
}) }, t.id)) });
|
|
346
|
+
}
|
|
347
|
+
function Se({ annotations: e, left: t, right: n }) {
|
|
348
|
+
return /* @__PURE__ */ O("g", {
|
|
349
|
+
"aria-hidden": !0,
|
|
350
|
+
children: e.map((e) => {
|
|
351
|
+
let r = e.label.length * _e / 2, i = e.x - r < t, a = e.x + r > n, o = i ? "start" : a ? "end" : "middle", s = i ? t : a ? n : e.x;
|
|
352
|
+
return /* @__PURE__ */ O("text", {
|
|
353
|
+
x: s,
|
|
354
|
+
y: e.y,
|
|
355
|
+
textAnchor: o,
|
|
356
|
+
...S.props(v.label, v.strongLabel, v.haloLabel, v.emphasis, e.isReceded && v.receded),
|
|
357
|
+
children: e.label
|
|
358
|
+
}, e.id);
|
|
359
|
+
})
|
|
360
|
+
});
|
|
361
|
+
}
|
|
223
362
|
// packages/charts/src/cartesian/composition-bars.tsx
|
|
224
|
-
var
|
|
363
|
+
var G = { mark: {
|
|
225
364
|
k3nNDw: "x1hj3fc7",
|
|
226
365
|
k1ekBW: "xwcsmn1",
|
|
227
366
|
kIyJzY: "xtitasy x12w9bfk",
|
|
228
367
|
kAMwcw: "x1faw7qm",
|
|
229
368
|
$$css: !0
|
|
230
369
|
} };
|
|
231
|
-
function
|
|
370
|
+
function Ce({ bucket: t, series: n, focusedSeries: r, index: i, x: o, width: s, y: c, isHighlighted: l, highlightedSeriesId: u }) {
|
|
232
371
|
let d = r !== void 0, f = r !== void 0 && !n.some((e) => e.id === r.id) ? [...n, r] : n;
|
|
233
372
|
function p(e, t) {
|
|
234
373
|
let n = c(t), r = c(t + e);
|
|
235
374
|
return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
|
|
236
375
|
}
|
|
237
|
-
return /* @__PURE__ */
|
|
376
|
+
return /* @__PURE__ */ k(D, { children: [t.kind !== "gap" && /* @__PURE__ */ O("rect", {
|
|
238
377
|
x: o,
|
|
239
378
|
y: 0,
|
|
240
379
|
width: s,
|
|
241
380
|
height: 1,
|
|
242
381
|
vectorEffect: "non-scaling-stroke",
|
|
243
382
|
fill: e.neutral,
|
|
244
|
-
...
|
|
383
|
+
...S.props(G.mark, l && v.selected),
|
|
245
384
|
style: {
|
|
246
385
|
transform: p(t.total, 0),
|
|
247
386
|
opacity: d ? .18 : +(t.kind === "total")
|
|
@@ -250,14 +389,14 @@ function de({ bucket: t, series: n, focusedSeries: r, index: i, x: o, width: s,
|
|
|
250
389
|
let m = c.values[i];
|
|
251
390
|
if (m == null) return null;
|
|
252
391
|
let h = r?.id === c.id, g = d ? 0 : n.slice(0, f).reduce((e, t) => e + (t.values[i] ?? 0), 0), _ = d ? h : t.kind === "parts", ee = !d && u !== void 0 && u !== c.id;
|
|
253
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ O("rect", {
|
|
254
393
|
x: o,
|
|
255
394
|
y: 0,
|
|
256
395
|
width: s,
|
|
257
396
|
height: 1,
|
|
258
397
|
vectorEffect: "non-scaling-stroke",
|
|
259
398
|
fill: e[a(c.tone, f)],
|
|
260
|
-
...
|
|
399
|
+
...S.props(G.mark, l && v.selected),
|
|
261
400
|
style: {
|
|
262
401
|
transform: p(m, g),
|
|
263
402
|
opacity: _ ? ee ? .3 : 1 : 0
|
|
@@ -265,8 +404,100 @@ function de({ bucket: t, series: n, focusedSeries: r, index: i, x: o, width: s,
|
|
|
265
404
|
}, c.id);
|
|
266
405
|
})] });
|
|
267
406
|
}
|
|
407
|
+
// packages/charts/src/cartesian/reference-lines.tsx
|
|
408
|
+
var we = {
|
|
409
|
+
kfJifR: "xhr4kjn",
|
|
410
|
+
k5rJSQ: "x1dz65qj",
|
|
411
|
+
kREpy8: "x13efnbd",
|
|
412
|
+
$$css: !0
|
|
413
|
+
}, Te = {
|
|
414
|
+
kfJifR: "xnpr05h",
|
|
415
|
+
kREpy8: "x13efnbd",
|
|
416
|
+
$$css: !0
|
|
417
|
+
}, K = {
|
|
418
|
+
line: (e) => [
|
|
419
|
+
we,
|
|
420
|
+
{
|
|
421
|
+
kjVXCG: e == null ? e : "x6mkzkt",
|
|
422
|
+
$$css: !0
|
|
423
|
+
},
|
|
424
|
+
{ "--x-stroke": e ?? void 0 }
|
|
425
|
+
],
|
|
426
|
+
leader: (e) => [
|
|
427
|
+
Te,
|
|
428
|
+
{
|
|
429
|
+
kjVXCG: e == null ? e : "x6mkzkt",
|
|
430
|
+
$$css: !0
|
|
431
|
+
},
|
|
432
|
+
{ "--x-stroke": e ?? void 0 }
|
|
433
|
+
]
|
|
434
|
+
}, Ee = 30, De = 13, q = 8, Oe = 4, J = 6.5, Y = 40, X = 112, ke = 16, Z = 8;
|
|
435
|
+
function Q({ lines: e, domain: t }) {
|
|
436
|
+
if (e.length > Z) return `Supply at most ${Z} reference lines.`;
|
|
437
|
+
if (!m(e)) return "Reference lines require unique identifiers.";
|
|
438
|
+
for (let n of e) if (!(Number.isFinite(n.value) && n.value >= t[0] && n.value <= t[1]) || n.label.trim() === "") return "Each reference line needs a label and a finite value inside the value domain.";
|
|
439
|
+
}
|
|
440
|
+
function Ae(e) {
|
|
441
|
+
return e.length > ke ? `${e.slice(0, 15)}…` : e;
|
|
442
|
+
}
|
|
443
|
+
function je({ lines: e, formatValue: t }) {
|
|
444
|
+
if (e.length === 0) return 0;
|
|
445
|
+
let n = Math.max(...e.map((e) => Math.max(Ae(e.label).length, t(e.value).length)));
|
|
446
|
+
return Math.min(X, Math.max(Y, n * J)) + q;
|
|
447
|
+
}
|
|
448
|
+
function Me({ lines: e, y: t, top: n, bottom: r }) {
|
|
449
|
+
let i = e.map((e) => ({
|
|
450
|
+
line: e,
|
|
451
|
+
position: t(e.value)
|
|
452
|
+
})).toSorted((e, t) => e.position - t.position), a = y({
|
|
453
|
+
positions: i.map((e) => e.position),
|
|
454
|
+
gap: Ee,
|
|
455
|
+
start: n + Ee / 2,
|
|
456
|
+
end: r - Ee / 2
|
|
457
|
+
});
|
|
458
|
+
return i.map((e, t) => ({
|
|
459
|
+
...e,
|
|
460
|
+
center: a[t] ?? e.position
|
|
461
|
+
}));
|
|
462
|
+
}
|
|
463
|
+
function Ne({ lines: t, y: n, left: r, right: i, top: a, bottom: o, formatValue: s }) {
|
|
464
|
+
return /* @__PURE__ */ O("g", { children: Me({
|
|
465
|
+
lines: t,
|
|
466
|
+
y: n,
|
|
467
|
+
top: a,
|
|
468
|
+
bottom: o
|
|
469
|
+
}).map(({ line: t, position: n, center: a }) => {
|
|
470
|
+
let o = e[t.tone ?? "neutral"], c = i + q;
|
|
471
|
+
return /* @__PURE__ */ k("g", { children: [
|
|
472
|
+
/* @__PURE__ */ O("line", {
|
|
473
|
+
x1: r,
|
|
474
|
+
x2: i,
|
|
475
|
+
y1: n,
|
|
476
|
+
y2: n,
|
|
477
|
+
...S.props(K.line(o))
|
|
478
|
+
}),
|
|
479
|
+
/* @__PURE__ */ O("path", {
|
|
480
|
+
d: `M${i},${n} L${i + Oe},${a} H${i + Oe + 1}`,
|
|
481
|
+
fill: "none",
|
|
482
|
+
...S.props(K.leader(o))
|
|
483
|
+
}),
|
|
484
|
+
/* @__PURE__ */ O("text", {
|
|
485
|
+
x: c,
|
|
486
|
+
y: a - 2,
|
|
487
|
+
...S.props(v.label, v.strongLabel),
|
|
488
|
+
children: Ae(t.label)
|
|
489
|
+
}),
|
|
490
|
+
/* @__PURE__ */ O("text", {
|
|
491
|
+
x: c,
|
|
492
|
+
y: a + De - 2,
|
|
493
|
+
...S.props(v.label),
|
|
494
|
+
children: s(t.value)
|
|
495
|
+
})
|
|
496
|
+
] }, t.id);
|
|
497
|
+
}) });
|
|
498
|
+
}
|
|
268
499
|
// packages/charts/src/cartesian/bar-chart.tsx
|
|
269
|
-
var
|
|
500
|
+
var Pe = {
|
|
270
501
|
plot: {
|
|
271
502
|
kqGvvJ: "x1we84gm",
|
|
272
503
|
$$css: !0
|
|
@@ -275,72 +506,73 @@ var L = {
|
|
|
275
506
|
kSiTet: "xuzhngd",
|
|
276
507
|
$$css: !0
|
|
277
508
|
}
|
|
278
|
-
},
|
|
279
|
-
function
|
|
280
|
-
let
|
|
509
|
+
}, Fe = 200, Ie = 12, Le = 30, Re = 8, ze = 14;
|
|
510
|
+
function Be({ title: e, description: t, report: n, series: r, layoutSeries: i, markerLegend: o = [], notes: c, children: l, inspectionId: u, label: d, detail: f, summary: m, rows: h = [], x: g = 0, width: _ = 0, offset: v, source: ee, data: y, isLoading: b = !1 }) {
|
|
511
|
+
let x = r.map((e, t) => ({
|
|
281
512
|
id: e.id,
|
|
282
513
|
label: e.label,
|
|
283
514
|
tone: a(e.tone, t)
|
|
284
|
-
})),
|
|
515
|
+
})), S = i?.map((e, t) => ({
|
|
285
516
|
id: e.id,
|
|
286
517
|
label: e.label,
|
|
287
518
|
tone: a(e.tone, t)
|
|
288
|
-
})),
|
|
289
|
-
return /* @__PURE__ */
|
|
290
|
-
title: /* @__PURE__ */
|
|
519
|
+
})), C = b && r.length === 0 && n?.seriesValues === void 0;
|
|
520
|
+
return /* @__PURE__ */ k(p, {
|
|
521
|
+
title: /* @__PURE__ */ O(ce, {
|
|
291
522
|
title: e,
|
|
292
|
-
detail:
|
|
523
|
+
detail: f
|
|
293
524
|
}),
|
|
294
525
|
description: t,
|
|
295
526
|
report: n,
|
|
296
|
-
series:
|
|
527
|
+
series: x,
|
|
297
528
|
children: [
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
id:
|
|
301
|
-
label:
|
|
302
|
-
summary:
|
|
303
|
-
legend:
|
|
529
|
+
y !== void 0 && /* @__PURE__ */ O(s, { ...y }),
|
|
530
|
+
C ? /* @__PURE__ */ O(se, {}) : /* @__PURE__ */ O(ue, {
|
|
531
|
+
id: u,
|
|
532
|
+
label: d,
|
|
533
|
+
summary: m,
|
|
534
|
+
legend: [...x, ...o],
|
|
304
535
|
hasSeriesSummary: n?.seriesValues !== void 0,
|
|
305
|
-
layoutLegend:
|
|
306
|
-
rows:
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
536
|
+
layoutLegend: S === void 0 ? void 0 : [...S, ...o],
|
|
537
|
+
rows: h,
|
|
538
|
+
notes: c,
|
|
539
|
+
x: g,
|
|
540
|
+
width: _,
|
|
541
|
+
offset: v,
|
|
542
|
+
source: ee
|
|
311
543
|
}),
|
|
312
|
-
|
|
544
|
+
l
|
|
313
545
|
]
|
|
314
546
|
});
|
|
315
547
|
}
|
|
316
|
-
function
|
|
317
|
-
let o =
|
|
318
|
-
return o === void 0 ? /* @__PURE__ */
|
|
548
|
+
function Ve({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = Fe }) {
|
|
549
|
+
let o = He(a), s = w();
|
|
550
|
+
return o === void 0 ? /* @__PURE__ */ O("div", {
|
|
319
551
|
"aria-hidden": !0,
|
|
320
552
|
inert: !0,
|
|
321
|
-
children: /* @__PURE__ */
|
|
553
|
+
children: /* @__PURE__ */ O(Be, {
|
|
322
554
|
title: e,
|
|
323
555
|
description: n,
|
|
324
556
|
report: r,
|
|
325
557
|
series: i,
|
|
326
558
|
inspectionId: s,
|
|
327
559
|
isLoading: !0,
|
|
328
|
-
children: /* @__PURE__ */
|
|
329
|
-
...
|
|
330
|
-
children: /* @__PURE__ */
|
|
560
|
+
children: /* @__PURE__ */ O("div", {
|
|
561
|
+
...S.props(v.plot, Pe.plot),
|
|
562
|
+
children: /* @__PURE__ */ O(t, { height: a })
|
|
331
563
|
})
|
|
332
564
|
})
|
|
333
|
-
}) : /* @__PURE__ */
|
|
565
|
+
}) : /* @__PURE__ */ O(g, {
|
|
334
566
|
title: e,
|
|
335
567
|
description: n,
|
|
336
568
|
report: r,
|
|
337
569
|
message: o
|
|
338
570
|
});
|
|
339
571
|
}
|
|
340
|
-
function
|
|
572
|
+
function He(e) {
|
|
341
573
|
if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
|
|
342
574
|
}
|
|
343
|
-
function
|
|
575
|
+
function Ue({ categories: e, series: t, domain: n, mode: r }) {
|
|
344
576
|
if (e.length > i.items || t.length > i.series) return `Choose a window with at most ${i.items} categories and ${i.series} series.`;
|
|
345
577
|
if (!h(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
|
|
346
578
|
if (!m(e) || !m(t)) return "Bar categories and series require unique identifiers.";
|
|
@@ -353,91 +585,167 @@ function pe({ categories: e, series: t, domain: n, mode: r }) {
|
|
|
353
585
|
}
|
|
354
586
|
if (r === "stacked" && e.some((e, r) => t.reduce((e, t) => e + (t.values[r] ?? 0), 0) > n[1])) return "Stacked bar totals must fit the supplied domain.";
|
|
355
587
|
}
|
|
356
|
-
var
|
|
588
|
+
var We = {
|
|
357
589
|
"x-default-marker": "x-default-marker",
|
|
358
590
|
$$css: !0
|
|
359
591
|
};
|
|
360
|
-
function
|
|
361
|
-
let
|
|
592
|
+
function Ge({ title: t, description: n, report: r, categories: i, series: o, domain: s, mode: c = "grouped", formatValue: u, formatTick: d = u, highlightedSeriesId: f, selection: p, height: m = Fe, composition: h, referenceLines: _ = [], markers: y = [], annotations: b = [], emphasizedCategoryIds: x = [] }) {
|
|
593
|
+
let C = h?.focusedSeries, T = w(), ne = C === void 0 ? void 0 : Ue({
|
|
362
594
|
categories: i,
|
|
363
|
-
series: [
|
|
595
|
+
series: [C],
|
|
364
596
|
domain: s,
|
|
365
597
|
mode: "grouped"
|
|
366
|
-
}),
|
|
598
|
+
}), D = Ue({
|
|
367
599
|
categories: i,
|
|
368
600
|
series: o,
|
|
369
601
|
domain: s,
|
|
370
602
|
mode: c
|
|
371
|
-
}) ??
|
|
603
|
+
}) ?? ne, A = i.map((e) => e.id), ie = pe({
|
|
604
|
+
markers: y,
|
|
605
|
+
annotations: b,
|
|
606
|
+
emphasizedCategoryIds: x,
|
|
607
|
+
seriesIds: [...o, ...C === void 0 ? [] : [C]].map((e) => e.id),
|
|
608
|
+
categoryIds: A,
|
|
609
|
+
domain: s
|
|
610
|
+
}) ?? Q({
|
|
611
|
+
lines: _,
|
|
612
|
+
domain: s
|
|
613
|
+
}), M = de({
|
|
372
614
|
composition: h,
|
|
373
615
|
series: o,
|
|
374
|
-
categoryIds:
|
|
616
|
+
categoryIds: A,
|
|
375
617
|
domain: s
|
|
376
|
-
}) ??
|
|
377
|
-
id:
|
|
618
|
+
}) ?? ie ?? He(m), P = D ?? M, F = h === void 0 ? void 0 : {
|
|
619
|
+
id: T,
|
|
378
620
|
label: h.contextLabel,
|
|
379
621
|
tone: "neutral",
|
|
380
622
|
values: h.buckets.map((e) => e.kind === "gap" ? null : e.total)
|
|
381
|
-
},
|
|
382
|
-
|
|
623
|
+
}, I = F === void 0 ? o : [
|
|
624
|
+
F,
|
|
383
625
|
...o,
|
|
384
|
-
...
|
|
385
|
-
],
|
|
386
|
-
|
|
626
|
+
...C === void 0 || o.some((e) => e.id === C.id) ? [] : [C]
|
|
627
|
+
], oe = C !== void 0 && F !== void 0 ? [C, F] : o, { ref: se, width: ce, element: ue } = ee(), L = w(), [fe, R] = E(), [me, V] = E();
|
|
628
|
+
te(() => {
|
|
387
629
|
function e(e) {
|
|
388
|
-
e.target instanceof Node &&
|
|
630
|
+
e.target instanceof Node && ue?.contains(e.target) !== !0 && R(void 0);
|
|
389
631
|
}
|
|
390
632
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
391
|
-
}, [
|
|
392
|
-
let
|
|
393
|
-
if (
|
|
633
|
+
}, [ue]);
|
|
634
|
+
let he = i.findIndex((e) => e.id === fe?.id), H = i[he], U = i[i.findIndex((e) => e.id === p?.selectedId)], ge = i.find((e) => e.id === me) ?? U ?? i[0], W = H, _e = he, ve = h?.buckets[_e], ye = C !== void 0 && F !== void 0 ? [C, F] : F === void 0 || ve?.kind === "parts" ? o : [], be = ve === void 0 ? void 0 : ve.kind === "gap" ? "No reported value" : u(ve.total);
|
|
635
|
+
if (P !== void 0) return /* @__PURE__ */ O(g, {
|
|
394
636
|
title: t,
|
|
395
637
|
description: n,
|
|
396
638
|
report: r,
|
|
397
|
-
message:
|
|
639
|
+
message: P
|
|
398
640
|
});
|
|
399
|
-
let
|
|
400
|
-
let n = e.values[
|
|
641
|
+
let G = ye.map((e, t) => {
|
|
642
|
+
let n = e.values[_e];
|
|
401
643
|
return {
|
|
402
644
|
id: e.id,
|
|
403
645
|
label: e.label,
|
|
404
646
|
tone: a(e.tone, t),
|
|
405
647
|
value: n == null ? "Unavailable" : u(n)
|
|
406
648
|
};
|
|
407
|
-
}),
|
|
649
|
+
}), we = y.map((e) => ({
|
|
650
|
+
id: e.id,
|
|
651
|
+
label: e.label,
|
|
652
|
+
tone: e.tone ?? "neutral",
|
|
653
|
+
shape: e.kind
|
|
654
|
+
})), Te = y.map((e) => ({
|
|
655
|
+
id: e.id,
|
|
656
|
+
label: e.label,
|
|
657
|
+
tone: e.tone ?? "neutral",
|
|
658
|
+
shape: e.kind,
|
|
659
|
+
value: z({
|
|
660
|
+
marker: e,
|
|
661
|
+
index: _e,
|
|
662
|
+
formatValue: u
|
|
663
|
+
})
|
|
664
|
+
})), K = _.map((e) => ({
|
|
665
|
+
id: e.id,
|
|
666
|
+
label: e.label,
|
|
667
|
+
tone: e.tone ?? "neutral",
|
|
668
|
+
shape: "dashed",
|
|
669
|
+
value: u(e.value)
|
|
670
|
+
})), Ee = W === void 0 ? [] : [
|
|
671
|
+
...G,
|
|
672
|
+
...Te,
|
|
673
|
+
...K
|
|
674
|
+
], De = b.filter((e) => e.categoryId === W?.id).map((e) => e.label), q = b.length > 0 ? Le : Ie, Oe = m - 28, J = j({
|
|
408
675
|
domain: [...s],
|
|
409
|
-
range: [
|
|
410
|
-
}), Y = Math.max(44, ...J.ticks(3).map((e) => d(e).length * 7 + 12)), X =
|
|
676
|
+
range: [Oe, q]
|
|
677
|
+
}), Y = Math.max(44, ...J.ticks(3).map((e) => d(e).length * 7 + 12)), X = je({
|
|
678
|
+
lines: _,
|
|
679
|
+
formatValue: d
|
|
680
|
+
}), ke = Math.max(Y + 1, ce - 16 - X), Z = re({
|
|
411
681
|
domain: i.map((e) => e.id),
|
|
412
|
-
range: [Y,
|
|
682
|
+
range: [Y, ke],
|
|
413
683
|
padding: .3
|
|
414
|
-
}),
|
|
684
|
+
}), Ae = re({
|
|
415
685
|
domain: o.map((e) => e.id),
|
|
416
686
|
range: [0, Z.bandwidth()],
|
|
417
687
|
padding: .08
|
|
418
|
-
}),
|
|
419
|
-
function
|
|
420
|
-
let
|
|
421
|
-
|
|
688
|
+
}), Me = Math.min(120, Math.max(40, ...i.map((e) => (e.axisLabel ?? e.label).length * 7))), Ve = Math.max(1, Math.ceil((Me + 16) / Z.step())), Ge = c === "stacked" || h !== void 0;
|
|
689
|
+
function qe(e, t) {
|
|
690
|
+
let n = Z(e) ?? Y;
|
|
691
|
+
return Ge ? {
|
|
692
|
+
x: n,
|
|
693
|
+
width: Z.bandwidth()
|
|
694
|
+
} : {
|
|
695
|
+
x: n + (Ae(t) ?? 0),
|
|
696
|
+
width: Ae.bandwidth()
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
function Je(e, t) {
|
|
700
|
+
if (!Ge) return o.find((e) => e.id === t)?.values[e] ?? null;
|
|
701
|
+
let n = o.flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null));
|
|
702
|
+
return n.length === 0 ? null : n.reduce((e, t) => e + t, 0);
|
|
703
|
+
}
|
|
704
|
+
function Ye(e) {
|
|
705
|
+
let t = x.includes(e);
|
|
706
|
+
return x.length > 0 && !t && H?.id !== e;
|
|
707
|
+
}
|
|
708
|
+
function Xe(e, t) {
|
|
709
|
+
let n = (t === void 0 ? o : o.filter((e) => e.id === t)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), r = Ge ? n.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...n), i = h?.buckets[e], a = i === void 0 || i.kind === "gap" ? 0 : i.total, s = y.filter((e) => t === void 0 || e.seriesId === t).flatMap((t) => [B(t, e)].filter((e) => e !== null));
|
|
710
|
+
return Math.max(0, r, a, ...s);
|
|
711
|
+
}
|
|
712
|
+
let Ze = b.map((e) => {
|
|
713
|
+
let t = Xe(A.indexOf(e.categoryId), e.seriesId), n = e.seriesId === void 0 ? {
|
|
714
|
+
x: Z(e.categoryId) ?? Y,
|
|
715
|
+
width: Z.bandwidth()
|
|
716
|
+
} : qe(e.categoryId, e.seriesId);
|
|
717
|
+
return {
|
|
718
|
+
id: e.id,
|
|
719
|
+
label: e.label,
|
|
720
|
+
x: n.x + n.width / 2,
|
|
721
|
+
y: Math.max(ze, J(t) - Re),
|
|
722
|
+
isReceded: Ye(e.categoryId)
|
|
723
|
+
};
|
|
724
|
+
}), Qe = Math.max(1, Math.floor((Z.step() * Ve - 16) / 7));
|
|
725
|
+
function $e(e) {
|
|
726
|
+
let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * ce, r = Math.floor((n - Y) / Z.step()), a = i[Math.max(0, Math.min(i.length - 1, r))];
|
|
727
|
+
a !== void 0 && (e.type === "pointerdown" && V(a.id), R({
|
|
422
728
|
id: a.id,
|
|
423
729
|
source: "pointer"
|
|
424
730
|
}));
|
|
425
731
|
}
|
|
426
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ O(Be, {
|
|
427
733
|
title: t,
|
|
428
734
|
description: n,
|
|
429
735
|
report: r,
|
|
430
|
-
series:
|
|
736
|
+
series: oe,
|
|
431
737
|
layoutSeries: o,
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
738
|
+
markerLegend: we,
|
|
739
|
+
notes: De,
|
|
740
|
+
inspectionId: L,
|
|
741
|
+
label: W?.label,
|
|
742
|
+
detail: W === void 0 ? void 0 : [W.axisLabel ?? W.label, be].filter(Boolean).join(" · "),
|
|
743
|
+
summary: be,
|
|
744
|
+
rows: Ee,
|
|
745
|
+
x: (Z(W?.id ?? "") ?? Y) + Z.bandwidth() / 2,
|
|
746
|
+
width: ce,
|
|
439
747
|
offset: Z.bandwidth() / 2 + 8,
|
|
440
|
-
source:
|
|
748
|
+
source: fe?.source,
|
|
441
749
|
data: {
|
|
442
750
|
label: `${t} observations`,
|
|
443
751
|
columns: [{
|
|
@@ -447,128 +755,165 @@ function V({ title: t, description: n, report: r, categories: i, series: o, doma
|
|
|
447
755
|
id: "value",
|
|
448
756
|
label: "Value"
|
|
449
757
|
}],
|
|
450
|
-
rows: i.map((e, t) => ({
|
|
758
|
+
rows: [...i.map((e, t) => ({
|
|
451
759
|
id: e.id,
|
|
452
|
-
values: [e.label,
|
|
453
|
-
|
|
760
|
+
values: [e.label, [
|
|
761
|
+
Ke(I, t, u),
|
|
762
|
+
...y.map((e) => `${e.label}: ${z({
|
|
763
|
+
marker: e,
|
|
764
|
+
index: t,
|
|
765
|
+
formatValue: u
|
|
766
|
+
})}`),
|
|
767
|
+
...b.filter((t) => t.categoryId === e.id).map((e) => e.label)
|
|
768
|
+
].join(" · ")]
|
|
769
|
+
})), ..._.map((e) => ({
|
|
770
|
+
id: `reference:${e.id}`,
|
|
771
|
+
values: [e.label, u(e.value)]
|
|
772
|
+
}))]
|
|
454
773
|
},
|
|
455
|
-
children: /* @__PURE__ */
|
|
456
|
-
ref:
|
|
457
|
-
...
|
|
458
|
-
children: i.length === 0 || o.length === 0 && h === void 0 ? /* @__PURE__ */
|
|
774
|
+
children: /* @__PURE__ */ O("div", {
|
|
775
|
+
ref: se,
|
|
776
|
+
...S.props(v.plot, Pe.plot),
|
|
777
|
+
children: i.length === 0 || o.length === 0 && h === void 0 ? /* @__PURE__ */ O("p", {
|
|
459
778
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
460
779
|
children: "No categories"
|
|
461
|
-
}) : /* @__PURE__ */
|
|
780
|
+
}) : /* @__PURE__ */ k(l, {
|
|
462
781
|
role: "img",
|
|
463
782
|
"aria-label": `${t}. Use arrow keys to inspect categories.${p === void 0 ? "" : " Press Enter to select."}`,
|
|
464
|
-
"aria-describedby":
|
|
783
|
+
"aria-describedby": L,
|
|
465
784
|
tabIndex: 0,
|
|
466
|
-
viewBox: `0 0 ${
|
|
785
|
+
viewBox: `0 0 ${ce} ${m}`,
|
|
467
786
|
height: m,
|
|
468
787
|
controls: {
|
|
469
788
|
items: i,
|
|
470
789
|
cursor: ge?.id,
|
|
471
|
-
inspected:
|
|
472
|
-
selected:
|
|
473
|
-
readout:
|
|
474
|
-
label:
|
|
475
|
-
summary:
|
|
476
|
-
rows:
|
|
790
|
+
inspected: H?.id,
|
|
791
|
+
selected: U?.id,
|
|
792
|
+
readout: le({
|
|
793
|
+
label: H?.label,
|
|
794
|
+
summary: be,
|
|
795
|
+
rows: Ee,
|
|
796
|
+
notes: De
|
|
477
797
|
}),
|
|
478
798
|
onInspect: (e) => {
|
|
479
|
-
|
|
799
|
+
V(e), R({
|
|
480
800
|
id: e,
|
|
481
801
|
source: "keyboard"
|
|
482
802
|
});
|
|
483
803
|
},
|
|
484
|
-
onDismiss: () =>
|
|
804
|
+
onDismiss: () => R(void 0),
|
|
485
805
|
onSelect: p?.onSelect
|
|
486
806
|
},
|
|
487
807
|
onFocus: (e) => {
|
|
488
808
|
if (e.currentTarget.matches(":focus-visible")) {
|
|
489
|
-
let e =
|
|
490
|
-
|
|
809
|
+
let e = U ?? i[0];
|
|
810
|
+
V(e?.id), R(e === void 0 ? void 0 : {
|
|
491
811
|
id: e.id,
|
|
492
812
|
source: "keyboard"
|
|
493
813
|
});
|
|
494
814
|
}
|
|
495
815
|
},
|
|
496
816
|
onPointerMove: (e) => {
|
|
497
|
-
e.pointerType === "mouse" &&
|
|
817
|
+
e.pointerType === "mouse" && $e(e);
|
|
498
818
|
},
|
|
499
|
-
onPointerDown:
|
|
819
|
+
onPointerDown: $e,
|
|
500
820
|
onPointerLeave: (e) => {
|
|
501
|
-
e.pointerType === "mouse" &&
|
|
821
|
+
e.pointerType === "mouse" && fe?.source === "pointer" && R(void 0);
|
|
502
822
|
},
|
|
503
|
-
onBlur: () =>
|
|
823
|
+
onBlur: () => R(void 0),
|
|
504
824
|
onClick: () => {
|
|
505
|
-
|
|
825
|
+
H !== void 0 && p?.onSelect(H.id);
|
|
506
826
|
},
|
|
507
|
-
...
|
|
827
|
+
...S.props(v.svg, v.inspectable, We),
|
|
508
828
|
children: [
|
|
509
|
-
|
|
510
|
-
x: (Z(
|
|
511
|
-
y:
|
|
829
|
+
H !== void 0 && /* @__PURE__ */ O("rect", {
|
|
830
|
+
x: (Z(H.id) ?? Y) - (Z.step() - Z.bandwidth()) / 2,
|
|
831
|
+
y: q,
|
|
512
832
|
width: Z.step(),
|
|
513
|
-
height:
|
|
833
|
+
height: Oe - q,
|
|
514
834
|
className: "x2wnxhi"
|
|
515
835
|
}),
|
|
516
|
-
J.ticks(3).map((e) => /* @__PURE__ */
|
|
836
|
+
J.ticks(3).map((e) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
|
|
517
837
|
x1: Y,
|
|
518
|
-
x2:
|
|
838
|
+
x2: ke,
|
|
519
839
|
y1: J(e),
|
|
520
840
|
y2: J(e),
|
|
521
|
-
...
|
|
522
|
-
}), /* @__PURE__ */
|
|
841
|
+
...S.props(v.grid)
|
|
842
|
+
}), /* @__PURE__ */ O("text", {
|
|
523
843
|
x: Y - 8,
|
|
524
844
|
y: J(e),
|
|
525
845
|
textAnchor: "end",
|
|
526
846
|
dominantBaseline: "middle",
|
|
527
|
-
...
|
|
847
|
+
...S.props(v.label),
|
|
528
848
|
children: d(e)
|
|
529
849
|
})] }, e)),
|
|
530
|
-
h?.annotation !== void 0 && i.some((e) => e.id === h.annotation?.categoryId) && /* @__PURE__ */
|
|
850
|
+
h?.annotation !== void 0 && i.some((e) => e.id === h.annotation?.categoryId) && /* @__PURE__ */ O("text", {
|
|
531
851
|
x: Z(h.annotation.categoryId),
|
|
532
|
-
y: Math.max(
|
|
533
|
-
...
|
|
852
|
+
y: Math.max(q, J(h.annotation.value) - 8),
|
|
853
|
+
...S.props(v.label),
|
|
534
854
|
children: h.annotation.label
|
|
535
855
|
}),
|
|
536
856
|
i.map((t, n) => {
|
|
537
857
|
let r = t.axisLabel ?? t.label, i = h?.buckets[n];
|
|
538
|
-
return /* @__PURE__ */
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
858
|
+
return /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("g", {
|
|
859
|
+
...S.props(v.emphasis, Ye(t.id) && v.receded),
|
|
860
|
+
children: i === void 0 ? o.map((r, i) => {
|
|
861
|
+
let s = r.values[n];
|
|
862
|
+
if (s == null) return null;
|
|
863
|
+
let l = c === "stacked" ? o.slice(0, i).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u = J(l), d = J(l + s), m = p?.selectedId === t.id || H?.id === t.id;
|
|
864
|
+
return /* @__PURE__ */ O(N, {
|
|
865
|
+
x: (Z(t.id) ?? Y) + (c === "stacked" ? 0 : Ae(r.id) ?? 0),
|
|
866
|
+
y: Math.min(u, d),
|
|
867
|
+
width: c === "stacked" ? Z.bandwidth() : Ae.bandwidth(),
|
|
868
|
+
height: Math.max(+(s === 0), Math.abs(d - u)),
|
|
869
|
+
fill: e[a(r.tone, i)],
|
|
870
|
+
...S.props(m && v.selected, f !== void 0 && f !== r.id && Pe.mutedMark)
|
|
871
|
+
}, r.id);
|
|
872
|
+
}) : /* @__PURE__ */ O(Ce, {
|
|
873
|
+
bucket: i,
|
|
874
|
+
series: o,
|
|
875
|
+
focusedSeries: C,
|
|
876
|
+
index: n,
|
|
877
|
+
x: Z(t.id) ?? Y,
|
|
878
|
+
width: Z.bandwidth(),
|
|
879
|
+
y: J,
|
|
880
|
+
isHighlighted: p?.selectedId === t.id || H?.id === t.id,
|
|
881
|
+
highlightedSeriesId: f
|
|
882
|
+
})
|
|
883
|
+
}), n % Ve === 0 && /* @__PURE__ */ O("text", {
|
|
561
884
|
x: (Z(t.id) ?? Y) + Z.bandwidth() / 2,
|
|
562
885
|
y: m - 4,
|
|
563
886
|
textAnchor: "middle",
|
|
564
|
-
...
|
|
565
|
-
children: r.length >
|
|
887
|
+
...S.props(v.label),
|
|
888
|
+
children: r.length > Qe ? `${r.slice(0, Qe - 1)}…` : r
|
|
566
889
|
})] }, t.id);
|
|
567
890
|
}),
|
|
568
|
-
|
|
891
|
+
/* @__PURE__ */ O(Ne, {
|
|
892
|
+
lines: _,
|
|
893
|
+
y: J,
|
|
894
|
+
left: Y,
|
|
895
|
+
right: ke,
|
|
896
|
+
top: q,
|
|
897
|
+
bottom: Oe,
|
|
898
|
+
formatValue: d
|
|
899
|
+
}),
|
|
900
|
+
/* @__PURE__ */ O(xe, {
|
|
901
|
+
markers: y,
|
|
902
|
+
categoryIds: A,
|
|
903
|
+
span: qe,
|
|
904
|
+
barTop: Je,
|
|
905
|
+
y: J,
|
|
906
|
+
isReceded: Ye
|
|
907
|
+
}),
|
|
908
|
+
/* @__PURE__ */ O(Se, {
|
|
909
|
+
annotations: Ze,
|
|
910
|
+
left: Y,
|
|
911
|
+
right: ke
|
|
912
|
+
}),
|
|
913
|
+
ge !== void 0 && /* @__PURE__ */ O(ae, {
|
|
569
914
|
x: (Z(ge.id) ?? Y) + Z.bandwidth() / 2,
|
|
570
|
-
top:
|
|
571
|
-
bottom:
|
|
915
|
+
top: q,
|
|
916
|
+
bottom: Oe,
|
|
572
917
|
width: Math.max(8, Z.bandwidth())
|
|
573
918
|
})
|
|
574
919
|
]
|
|
@@ -576,19 +921,19 @@ function V({ title: t, description: n, report: r, categories: i, series: o, doma
|
|
|
576
921
|
})
|
|
577
922
|
});
|
|
578
923
|
}
|
|
579
|
-
function
|
|
924
|
+
function Ke(e, t, n) {
|
|
580
925
|
return e.map((e) => {
|
|
581
926
|
let r = e.values[t];
|
|
582
927
|
return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
|
|
583
928
|
}).join(" · ");
|
|
584
929
|
}
|
|
585
930
|
// packages/charts/src/cartesian/breakdown-bar.tsx
|
|
586
|
-
var
|
|
931
|
+
var qe = {
|
|
587
932
|
kzqmXN: "x5lhr3w",
|
|
588
933
|
kZKoxP: "x5yr21d",
|
|
589
934
|
$$css: !0
|
|
590
|
-
},
|
|
591
|
-
|
|
935
|
+
}, Je = { segment: (e, t) => [
|
|
936
|
+
qe,
|
|
592
937
|
{
|
|
593
938
|
kWkggS: t == null ? t : "xl8spv7",
|
|
594
939
|
$$css: !0
|
|
@@ -598,27 +943,27 @@ var H = {
|
|
|
598
943
|
"--x-backgroundColor": t ?? void 0
|
|
599
944
|
}
|
|
600
945
|
] };
|
|
601
|
-
function
|
|
946
|
+
function Ye({ title: t, report: n, description: i, items: s, total: c, formatValue: l, selection: u }) {
|
|
602
947
|
let d = r(s), f = s.reduce((e, t) => e + (t.value ?? 0), 0), m = 2 ** -52 * Math.max(f, c, 1) * s.length;
|
|
603
|
-
return d === void 0 ? !Number.isFinite(c) || c < 0 || f - c > m ? /* @__PURE__ */
|
|
948
|
+
return d === void 0 ? !Number.isFinite(c) || c < 0 || f - c > m ? /* @__PURE__ */ O(g, {
|
|
604
949
|
title: t,
|
|
605
950
|
report: n,
|
|
606
951
|
description: i,
|
|
607
952
|
message: "The total must be finite and at least the sum of recorded values."
|
|
608
|
-
}) : /* @__PURE__ */
|
|
953
|
+
}) : /* @__PURE__ */ O(p, {
|
|
609
954
|
title: t,
|
|
610
955
|
report: n,
|
|
611
956
|
description: i,
|
|
612
|
-
children: s.length === 0 ? /* @__PURE__ */
|
|
957
|
+
children: s.length === 0 ? /* @__PURE__ */ O("p", {
|
|
613
958
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
614
959
|
children: "No values"
|
|
615
|
-
}) : /* @__PURE__ */
|
|
616
|
-
/* @__PURE__ */
|
|
960
|
+
}) : /* @__PURE__ */ k(D, { children: [
|
|
961
|
+
/* @__PURE__ */ O("div", {
|
|
617
962
|
"aria-hidden": !0,
|
|
618
963
|
className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
|
|
619
|
-
children: s.map((t, n) => t.value === null ? null : /* @__PURE__ */
|
|
964
|
+
children: s.map((t, n) => t.value === null ? null : /* @__PURE__ */ O("span", { ...S.props(Je.segment(c === 0 ? 0 : t.value / c * 100, e[a(t.tone, n)])) }, t.id))
|
|
620
965
|
}),
|
|
621
|
-
/* @__PURE__ */
|
|
966
|
+
/* @__PURE__ */ O(o, {
|
|
622
967
|
items: s.map((e, t) => ({
|
|
623
968
|
id: e.id,
|
|
624
969
|
label: e.label,
|
|
@@ -627,7 +972,7 @@ function U({ title: t, report: n, description: i, items: s, total: c, formatValu
|
|
|
627
972
|
})),
|
|
628
973
|
selection: u
|
|
629
974
|
}),
|
|
630
|
-
c - f > m && /* @__PURE__ */
|
|
975
|
+
c - f > m && /* @__PURE__ */ k("p", {
|
|
631
976
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
632
977
|
children: [
|
|
633
978
|
"Unassigned portion: ",
|
|
@@ -637,20 +982,402 @@ function U({ title: t, report: n, description: i, items: s, total: c, formatValu
|
|
|
637
982
|
]
|
|
638
983
|
})
|
|
639
984
|
] })
|
|
640
|
-
}) : /* @__PURE__ */
|
|
985
|
+
}) : /* @__PURE__ */ O(g, {
|
|
641
986
|
title: t,
|
|
642
987
|
report: n,
|
|
643
988
|
description: i,
|
|
644
989
|
message: d
|
|
645
990
|
});
|
|
646
991
|
}
|
|
992
|
+
// packages/charts/src/cartesian/bridge-data.ts
|
|
993
|
+
function Xe(e) {
|
|
994
|
+
return e.kind !== "change" || e.value === null ? "neutral" : e.value < 0 ? "negative" : "positive";
|
|
995
|
+
}
|
|
996
|
+
function Ze(e) {
|
|
997
|
+
let t = e.map((e) => e.kind === "total" ? 0 : e.value);
|
|
998
|
+
return e[0]?.kind !== "start" || t.includes(null) ? null : t.reduce((e, t) => e + (t ?? 0), 0);
|
|
999
|
+
}
|
|
1000
|
+
function Qe({ step: e, before: t, after: n }) {
|
|
1001
|
+
let r = e.tone ?? Xe(e);
|
|
1002
|
+
switch (e.kind) {
|
|
1003
|
+
case "start": return {
|
|
1004
|
+
step: e,
|
|
1005
|
+
from: 0,
|
|
1006
|
+
to: e.value,
|
|
1007
|
+
tone: r
|
|
1008
|
+
};
|
|
1009
|
+
case "total": return {
|
|
1010
|
+
step: e,
|
|
1011
|
+
from: n === null ? null : 0,
|
|
1012
|
+
to: n,
|
|
1013
|
+
tone: r
|
|
1014
|
+
};
|
|
1015
|
+
case "change": return {
|
|
1016
|
+
step: e,
|
|
1017
|
+
from: t,
|
|
1018
|
+
to: n,
|
|
1019
|
+
tone: r
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
function $e(e) {
|
|
1024
|
+
return e.map((t, n) => Qe({
|
|
1025
|
+
step: t,
|
|
1026
|
+
before: Ze(e.slice(0, n)),
|
|
1027
|
+
after: Ze(e.slice(0, n + 1))
|
|
1028
|
+
}));
|
|
1029
|
+
}
|
|
1030
|
+
function et(e) {
|
|
1031
|
+
let t = e.flatMap((e) => [e.from, e.to].filter((e) => e !== null)), n = Math.min(0, ...t), r = Math.max(0, ...t);
|
|
1032
|
+
return n === r ? [n, n + 1] : [n, r];
|
|
1033
|
+
}
|
|
1034
|
+
function tt({ steps: e, domain: t }) {
|
|
1035
|
+
if (e.length > i.items) return `Choose a bridge with at most ${i.items} steps.`;
|
|
1036
|
+
if (!m(e)) return "Bridge steps require unique identifiers.";
|
|
1037
|
+
if (e.length > 0 && e[0]?.kind !== "start") return "A bridge begins with one start step.";
|
|
1038
|
+
if (e.filter((e) => e.kind === "start").length > 1) return "A bridge has exactly one start step.";
|
|
1039
|
+
if (e.some((e) => {
|
|
1040
|
+
let t = e.kind === "total" ? null : e.value;
|
|
1041
|
+
return t !== null && !Number.isFinite(t);
|
|
1042
|
+
})) return "Bridge values must be finite numbers or explicit missing changes.";
|
|
1043
|
+
let n = et($e(e));
|
|
1044
|
+
if (t === void 0) return Number.isFinite(n[0]) && Number.isFinite(n[1]) ? void 0 : "Running totals must stay finite.";
|
|
1045
|
+
let r = t[0] <= n[0] && t[1] >= n[1];
|
|
1046
|
+
if (!h(t) || !r) return "The bridge domain must be finite, increasing, and contain zero and every running total.";
|
|
1047
|
+
}
|
|
1048
|
+
// packages/charts/src/cartesian/bridge-chart.tsx
|
|
1049
|
+
var nt = {
|
|
1050
|
+
plot: {
|
|
1051
|
+
kqGvvJ: "x1we84gm",
|
|
1052
|
+
$$css: !0
|
|
1053
|
+
},
|
|
1054
|
+
bar: (e) => [{
|
|
1055
|
+
kDwRjp: e == null ? e : "x19zyb68",
|
|
1056
|
+
$$css: !0
|
|
1057
|
+
}, { "--x-fill": e ?? void 0 }]
|
|
1058
|
+
}, rt = 240, it = 24, at = 28, ot = 6, st = 14, ct = 12, lt = 7, ut = {
|
|
1059
|
+
start: v.strongLabel,
|
|
1060
|
+
change: void 0,
|
|
1061
|
+
total: v.strongLabel
|
|
1062
|
+
};
|
|
1063
|
+
function dt(e) {
|
|
1064
|
+
return (t) => t === 0 ? e(0) : `${t > 0 ? "+" : "−"}${e(Math.abs(t))}`;
|
|
1065
|
+
}
|
|
1066
|
+
function ft({ level: e, formatValue: t, formatChange: n }) {
|
|
1067
|
+
return e.step.kind === "change" && e.step.value !== null ? n(e.step.value) : e.to === null ? "—" : t(e.to);
|
|
1068
|
+
}
|
|
1069
|
+
function pt({ level: e, formatValue: t, formatChange: n }) {
|
|
1070
|
+
return e.step.kind === "change" ? e.step.value === null ? "Unavailable" : n(e.step.value) : e.to === null ? "Unavailable" : t(e.to);
|
|
1071
|
+
}
|
|
1072
|
+
function mt({ level: e, formatValue: t }) {
|
|
1073
|
+
return e.from === null || e.to === null ? "Unavailable" : `${t(e.from)} → ${t(e.to)}`;
|
|
1074
|
+
}
|
|
1075
|
+
var ht = {
|
|
1076
|
+
"x-default-marker": "x-default-marker",
|
|
1077
|
+
$$css: !0
|
|
1078
|
+
};
|
|
1079
|
+
function gt({ title: e, description: t, report: n, steps: r, formatValue: i, formatChange: a = dt(i), formatTick: o = i, domain: c, referenceLines: u = [], selection: d, height: f = rt }) {
|
|
1080
|
+
let { ref: m, width: h, element: _ } = ee(), y = w(), [b, x] = E(), [C, T] = E();
|
|
1081
|
+
te(() => {
|
|
1082
|
+
function e(e) {
|
|
1083
|
+
e.target instanceof Node && _?.contains(e.target) !== !0 && x(void 0);
|
|
1084
|
+
}
|
|
1085
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1086
|
+
}, [_]);
|
|
1087
|
+
let ne = !Number.isFinite(f) || f < 96 ? "Chart height must be at least 96 pixels." : void 0, D = $e(r), A = c ?? et(D), ie = ne ?? tt({
|
|
1088
|
+
steps: r,
|
|
1089
|
+
domain: c
|
|
1090
|
+
}) ?? Q({
|
|
1091
|
+
lines: u,
|
|
1092
|
+
domain: A
|
|
1093
|
+
});
|
|
1094
|
+
if (ie !== void 0) return /* @__PURE__ */ O(g, {
|
|
1095
|
+
title: e,
|
|
1096
|
+
description: t,
|
|
1097
|
+
report: n,
|
|
1098
|
+
message: ie
|
|
1099
|
+
});
|
|
1100
|
+
let M = D.find((e) => e.step.id === b?.id), N = D.find((e) => e.step.id === d?.selectedId), P = D.find((e) => e.step.id === C) ?? N ?? D[0], F = M === void 0 ? void 0 : pt({
|
|
1101
|
+
level: M,
|
|
1102
|
+
formatValue: i,
|
|
1103
|
+
formatChange: a
|
|
1104
|
+
}), I = M?.step.kind === "change" ? [{
|
|
1105
|
+
id: "running",
|
|
1106
|
+
label: "Running total",
|
|
1107
|
+
tone: "neutral",
|
|
1108
|
+
value: mt({
|
|
1109
|
+
level: M,
|
|
1110
|
+
formatValue: i
|
|
1111
|
+
})
|
|
1112
|
+
}] : [], oe = u.map((e) => ({
|
|
1113
|
+
id: e.id,
|
|
1114
|
+
label: e.label,
|
|
1115
|
+
tone: e.tone ?? "neutral",
|
|
1116
|
+
shape: "dashed",
|
|
1117
|
+
value: i(e.value)
|
|
1118
|
+
})), se = M === void 0 ? [] : [...I, ...oe], de = f - at, L = j({
|
|
1119
|
+
domain: [...A],
|
|
1120
|
+
range: [de, it]
|
|
1121
|
+
}), fe = L.ticks(4), R = Math.max(44, ...fe.map((e) => o(e).length * lt + 12)), pe = je({
|
|
1122
|
+
lines: u,
|
|
1123
|
+
formatValue: o
|
|
1124
|
+
}), z = Math.max(R + 1, h - 16 - pe), B = re({
|
|
1125
|
+
domain: D.map((e) => e.step.id),
|
|
1126
|
+
range: [R, z],
|
|
1127
|
+
padding: .28
|
|
1128
|
+
}), me = D.map((e) => ({
|
|
1129
|
+
id: e.step.id,
|
|
1130
|
+
label: e.step.label
|
|
1131
|
+
})), V = Math.max(1, Math.floor((B.step() - 8) / lt));
|
|
1132
|
+
function he(e) {
|
|
1133
|
+
let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * h, r = Math.floor((n - R) / B.step()), i = D[Math.max(0, Math.min(D.length - 1, r))];
|
|
1134
|
+
i !== void 0 && (e.type === "pointerdown" && T(i.step.id), x({
|
|
1135
|
+
id: i.step.id,
|
|
1136
|
+
source: "pointer"
|
|
1137
|
+
}));
|
|
1138
|
+
}
|
|
1139
|
+
function H(e) {
|
|
1140
|
+
let t = e.axisLabel ?? e.label;
|
|
1141
|
+
return t.length > V ? `${t.slice(0, V - 1)}…` : t;
|
|
1142
|
+
}
|
|
1143
|
+
return /* @__PURE__ */ k(p, {
|
|
1144
|
+
title: /* @__PURE__ */ O(ce, {
|
|
1145
|
+
title: e,
|
|
1146
|
+
detail: M === void 0 ? void 0 : `${M.step.label} · ${F ?? ""}`
|
|
1147
|
+
}),
|
|
1148
|
+
description: t,
|
|
1149
|
+
report: n,
|
|
1150
|
+
children: [
|
|
1151
|
+
/* @__PURE__ */ O(s, {
|
|
1152
|
+
label: `${e} steps`,
|
|
1153
|
+
columns: [
|
|
1154
|
+
{
|
|
1155
|
+
id: "step",
|
|
1156
|
+
label: "Step"
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
id: "value",
|
|
1160
|
+
label: "Value"
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
id: "running",
|
|
1164
|
+
label: "Running total"
|
|
1165
|
+
}
|
|
1166
|
+
],
|
|
1167
|
+
rows: [...D.map((e) => ({
|
|
1168
|
+
id: e.step.id,
|
|
1169
|
+
values: [
|
|
1170
|
+
e.step.label,
|
|
1171
|
+
pt({
|
|
1172
|
+
level: e,
|
|
1173
|
+
formatValue: i,
|
|
1174
|
+
formatChange: a
|
|
1175
|
+
}),
|
|
1176
|
+
e.step.kind === "change" ? mt({
|
|
1177
|
+
level: e,
|
|
1178
|
+
formatValue: i
|
|
1179
|
+
}) : pt({
|
|
1180
|
+
level: e,
|
|
1181
|
+
formatValue: i,
|
|
1182
|
+
formatChange: a
|
|
1183
|
+
})
|
|
1184
|
+
]
|
|
1185
|
+
})), ...u.map((e) => ({
|
|
1186
|
+
id: `reference:${e.id}`,
|
|
1187
|
+
values: [
|
|
1188
|
+
e.label,
|
|
1189
|
+
i(e.value),
|
|
1190
|
+
""
|
|
1191
|
+
]
|
|
1192
|
+
}))]
|
|
1193
|
+
}),
|
|
1194
|
+
/* @__PURE__ */ O(ue, {
|
|
1195
|
+
id: y,
|
|
1196
|
+
label: M?.step.label,
|
|
1197
|
+
summary: F,
|
|
1198
|
+
legend: [],
|
|
1199
|
+
hasLegend: !1,
|
|
1200
|
+
rows: se,
|
|
1201
|
+
x: (B(M?.step.id ?? "") ?? R) + B.bandwidth() / 2,
|
|
1202
|
+
width: h,
|
|
1203
|
+
offset: B.bandwidth() / 2 + 8,
|
|
1204
|
+
source: b?.source
|
|
1205
|
+
}),
|
|
1206
|
+
/* @__PURE__ */ O("div", {
|
|
1207
|
+
ref: m,
|
|
1208
|
+
...S.props(v.plot, nt.plot),
|
|
1209
|
+
children: D.length === 0 ? /* @__PURE__ */ O("p", {
|
|
1210
|
+
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
1211
|
+
children: "No steps"
|
|
1212
|
+
}) : /* @__PURE__ */ k(l, {
|
|
1213
|
+
role: "img",
|
|
1214
|
+
"aria-label": `${e}. Use arrow keys to inspect steps.${d === void 0 ? "" : " Press Enter to select."}`,
|
|
1215
|
+
"aria-describedby": y,
|
|
1216
|
+
tabIndex: 0,
|
|
1217
|
+
viewBox: `0 0 ${h} ${f}`,
|
|
1218
|
+
height: f,
|
|
1219
|
+
controls: {
|
|
1220
|
+
items: me,
|
|
1221
|
+
cursor: P?.step.id,
|
|
1222
|
+
inspected: M?.step.id,
|
|
1223
|
+
selected: N?.step.id,
|
|
1224
|
+
readout: le({
|
|
1225
|
+
label: M?.step.label,
|
|
1226
|
+
summary: F,
|
|
1227
|
+
rows: se
|
|
1228
|
+
}),
|
|
1229
|
+
onInspect: (e) => {
|
|
1230
|
+
T(e), x({
|
|
1231
|
+
id: e,
|
|
1232
|
+
source: "keyboard"
|
|
1233
|
+
});
|
|
1234
|
+
},
|
|
1235
|
+
onDismiss: () => x(void 0),
|
|
1236
|
+
onSelect: d?.onSelect
|
|
1237
|
+
},
|
|
1238
|
+
onFocus: (e) => {
|
|
1239
|
+
if (e.currentTarget.matches(":focus-visible")) {
|
|
1240
|
+
let e = N ?? D[0];
|
|
1241
|
+
T(e?.step.id), x(e === void 0 ? void 0 : {
|
|
1242
|
+
id: e.step.id,
|
|
1243
|
+
source: "keyboard"
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
onPointerMove: (e) => {
|
|
1248
|
+
e.pointerType === "mouse" && he(e);
|
|
1249
|
+
},
|
|
1250
|
+
onPointerDown: he,
|
|
1251
|
+
onPointerLeave: (e) => {
|
|
1252
|
+
e.pointerType === "mouse" && b?.source === "pointer" && x(void 0);
|
|
1253
|
+
},
|
|
1254
|
+
onBlur: () => x(void 0),
|
|
1255
|
+
onClick: () => {
|
|
1256
|
+
M !== void 0 && d?.onSelect(M.step.id);
|
|
1257
|
+
},
|
|
1258
|
+
...S.props(v.svg, v.inspectable, ht),
|
|
1259
|
+
children: [
|
|
1260
|
+
M !== void 0 && /* @__PURE__ */ O("rect", {
|
|
1261
|
+
x: (B(M.step.id) ?? R) - (B.step() - B.bandwidth()) / 2,
|
|
1262
|
+
y: it,
|
|
1263
|
+
width: B.step(),
|
|
1264
|
+
height: de - it,
|
|
1265
|
+
className: "x2wnxhi"
|
|
1266
|
+
}),
|
|
1267
|
+
fe.map((e) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
|
|
1268
|
+
x1: R,
|
|
1269
|
+
x2: z,
|
|
1270
|
+
y1: L(e),
|
|
1271
|
+
y2: L(e),
|
|
1272
|
+
...S.props(e === 0 ? v.baseline : v.grid)
|
|
1273
|
+
}), /* @__PURE__ */ O("text", {
|
|
1274
|
+
x: R - 8,
|
|
1275
|
+
y: L(e),
|
|
1276
|
+
textAnchor: "end",
|
|
1277
|
+
dominantBaseline: "middle",
|
|
1278
|
+
...S.props(v.label),
|
|
1279
|
+
children: o(e)
|
|
1280
|
+
})] }, e)),
|
|
1281
|
+
D.map((e, t) => {
|
|
1282
|
+
let n = D[t + 1], r = B(e.step.id) ?? R;
|
|
1283
|
+
return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ O("line", {
|
|
1284
|
+
x1: r + B.bandwidth(),
|
|
1285
|
+
x2: B(n.step.id) ?? r,
|
|
1286
|
+
y1: L(e.to),
|
|
1287
|
+
y2: L(e.to),
|
|
1288
|
+
className: "x1crw9hw xnpr05h x1ypbokr x13efnbd"
|
|
1289
|
+
}, `connector:${e.step.id}`);
|
|
1290
|
+
}),
|
|
1291
|
+
D.map((e) => /* @__PURE__ */ O(_t, {
|
|
1292
|
+
level: e,
|
|
1293
|
+
x: B(e.step.id) ?? R,
|
|
1294
|
+
width: B.bandwidth(),
|
|
1295
|
+
y: L,
|
|
1296
|
+
bottom: de,
|
|
1297
|
+
height: f,
|
|
1298
|
+
label: ft({
|
|
1299
|
+
level: e,
|
|
1300
|
+
formatValue: i,
|
|
1301
|
+
formatChange: a
|
|
1302
|
+
}),
|
|
1303
|
+
axisLabel: H(e.step),
|
|
1304
|
+
isHighlighted: M?.step.id === e.step.id || N?.step.id === e.step.id
|
|
1305
|
+
}, e.step.id)),
|
|
1306
|
+
/* @__PURE__ */ O(Ne, {
|
|
1307
|
+
lines: u,
|
|
1308
|
+
y: L,
|
|
1309
|
+
left: R,
|
|
1310
|
+
right: z,
|
|
1311
|
+
top: it,
|
|
1312
|
+
bottom: de,
|
|
1313
|
+
formatValue: o
|
|
1314
|
+
}),
|
|
1315
|
+
P !== void 0 && /* @__PURE__ */ O(ae, {
|
|
1316
|
+
x: (B(P.step.id) ?? R) + B.bandwidth() / 2,
|
|
1317
|
+
top: it,
|
|
1318
|
+
bottom: de,
|
|
1319
|
+
width: Math.max(8, B.bandwidth())
|
|
1320
|
+
})
|
|
1321
|
+
]
|
|
1322
|
+
})
|
|
1323
|
+
})
|
|
1324
|
+
]
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1327
|
+
function _t({ level: t, x: n, width: r, y: i, bottom: a, height: o, label: s, axisLabel: c, isHighlighted: l }) {
|
|
1328
|
+
let u = n + r / 2, d = /* @__PURE__ */ O("text", {
|
|
1329
|
+
x: u,
|
|
1330
|
+
y: o - 4,
|
|
1331
|
+
textAnchor: "middle",
|
|
1332
|
+
...S.props(v.label),
|
|
1333
|
+
children: c
|
|
1334
|
+
});
|
|
1335
|
+
if (t.from === null || t.to === null) {
|
|
1336
|
+
let e = t.from ?? 0, o = Math.min(a - ct, i(e) - ct / 2);
|
|
1337
|
+
return /* @__PURE__ */ k("g", { children: [
|
|
1338
|
+
/* @__PURE__ */ O("rect", {
|
|
1339
|
+
x: n,
|
|
1340
|
+
y: o,
|
|
1341
|
+
width: r,
|
|
1342
|
+
height: ct,
|
|
1343
|
+
className: "xbh8q5q x1crw9hw xnpr05h x1ypbokr x13efnbd"
|
|
1344
|
+
}),
|
|
1345
|
+
/* @__PURE__ */ O("text", {
|
|
1346
|
+
x: u,
|
|
1347
|
+
y: o - ot,
|
|
1348
|
+
textAnchor: "middle",
|
|
1349
|
+
...S.props(v.label),
|
|
1350
|
+
children: s
|
|
1351
|
+
}),
|
|
1352
|
+
d
|
|
1353
|
+
] });
|
|
1354
|
+
}
|
|
1355
|
+
let f = Math.max(t.from, t.to), p = Math.min(t.from, t.to), m = i(f), h = Math.max(1, i(p) - m), g = f <= 0 && p < 0 ? i(p) + st : m - ot;
|
|
1356
|
+
return /* @__PURE__ */ k("g", { children: [
|
|
1357
|
+
/* @__PURE__ */ O("rect", {
|
|
1358
|
+
x: n,
|
|
1359
|
+
y: m,
|
|
1360
|
+
width: r,
|
|
1361
|
+
height: h,
|
|
1362
|
+
...S.props(nt.bar(e[t.tone]), l && v.selected)
|
|
1363
|
+
}),
|
|
1364
|
+
/* @__PURE__ */ O("text", {
|
|
1365
|
+
x: u,
|
|
1366
|
+
y: g,
|
|
1367
|
+
textAnchor: "middle",
|
|
1368
|
+
...S.props(v.label, ut[t.step.kind], v.haloLabel),
|
|
1369
|
+
children: s
|
|
1370
|
+
}),
|
|
1371
|
+
d
|
|
1372
|
+
] });
|
|
1373
|
+
}
|
|
647
1374
|
// packages/charts/src/cartesian/scatter-plot.tsx
|
|
648
|
-
var
|
|
1375
|
+
var vt = 260, yt = 56, bt = 20, xt = 12, St = 1e3, Ct = {
|
|
649
1376
|
kzqmXN: "x1xc55vz",
|
|
650
1377
|
kZKoxP: "xdk7pt",
|
|
651
1378
|
kaIpWk: "x16rqkct",
|
|
652
1379
|
$$css: !0
|
|
653
|
-
},
|
|
1380
|
+
}, wt = {
|
|
654
1381
|
brush: {
|
|
655
1382
|
kFalU9: "xx69xxh",
|
|
656
1383
|
kkrTdU: "xsid9ct",
|
|
@@ -688,7 +1415,7 @@ var W = 260, G = 56, K = 20, q = 12, _e = 1e3, ve = {
|
|
|
688
1415
|
"--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
689
1416
|
}],
|
|
690
1417
|
dot: (e) => [
|
|
691
|
-
|
|
1418
|
+
Ct,
|
|
692
1419
|
{
|
|
693
1420
|
kWkggS: e == null ? e : "xl8spv7",
|
|
694
1421
|
$$css: !0
|
|
@@ -703,77 +1430,77 @@ var W = 260, G = 56, K = 20, q = 12, _e = 1e3, ve = {
|
|
|
703
1430
|
$$css: !0
|
|
704
1431
|
}
|
|
705
1432
|
};
|
|
706
|
-
function
|
|
707
|
-
let { title: n, report: r, description: i, points: a, xDomain: o, yDomain: l, xLabel: d, yLabel: m, formatX: h, formatY: _, selection: v, rangeSelection: y, emptyLabel: b } = t,
|
|
1433
|
+
function Tt(t) {
|
|
1434
|
+
let { title: n, report: r, description: i, points: a, xDomain: o, yDomain: l, xLabel: d, yLabel: m, formatX: h, formatY: _, selection: v, rangeSelection: y, emptyLabel: b } = t, x = u({
|
|
708
1435
|
title: n,
|
|
709
1436
|
selection: v,
|
|
710
1437
|
items: a.map((e) => ({
|
|
711
1438
|
id: e.id,
|
|
712
1439
|
label: `${e.label}, ${d}: ${h(e.x)}, ${m}: ${_(e.y)}`
|
|
713
1440
|
}))
|
|
714
|
-
}), { ref:
|
|
715
|
-
if (
|
|
1441
|
+
}), { ref: te, width: w } = ee(), T = Ot(t);
|
|
1442
|
+
if (T !== null) return /* @__PURE__ */ O(g, {
|
|
716
1443
|
title: n,
|
|
717
1444
|
report: r,
|
|
718
1445
|
description: i,
|
|
719
|
-
message:
|
|
1446
|
+
message: T
|
|
720
1447
|
});
|
|
721
|
-
let
|
|
1448
|
+
let ne = j({
|
|
722
1449
|
domain: [...o],
|
|
723
|
-
range: [
|
|
1450
|
+
range: [yt, Math.max(yt, w - bt)]
|
|
724
1451
|
}), E = j({
|
|
725
1452
|
domain: [...l],
|
|
726
|
-
range: [216,
|
|
1453
|
+
range: [216, xt]
|
|
727
1454
|
});
|
|
728
|
-
return /* @__PURE__ */
|
|
1455
|
+
return /* @__PURE__ */ k(p, {
|
|
729
1456
|
title: n,
|
|
730
1457
|
report: r,
|
|
731
1458
|
description: i,
|
|
732
|
-
footer: /* @__PURE__ */
|
|
733
|
-
id:
|
|
734
|
-
children:
|
|
1459
|
+
footer: /* @__PURE__ */ O(f, {
|
|
1460
|
+
id: x.id,
|
|
1461
|
+
children: x.label ?? "\xA0"
|
|
735
1462
|
}),
|
|
736
1463
|
children: [
|
|
737
|
-
a.length === 0 ? /* @__PURE__ */
|
|
1464
|
+
a.length === 0 ? /* @__PURE__ */ O("p", {
|
|
738
1465
|
className: "x1ghz6dp x153jb6y",
|
|
739
1466
|
children: b
|
|
740
|
-
}) : /* @__PURE__ */
|
|
741
|
-
ref:
|
|
742
|
-
...
|
|
1467
|
+
}) : /* @__PURE__ */ k(c, {
|
|
1468
|
+
ref: te,
|
|
1469
|
+
...x.props,
|
|
743
1470
|
className: "x1n2onr6 xeuugli",
|
|
744
|
-
children: [/* @__PURE__ */
|
|
745
|
-
width:
|
|
746
|
-
scaleX:
|
|
1471
|
+
children: [/* @__PURE__ */ O(Et, {
|
|
1472
|
+
width: w,
|
|
1473
|
+
scaleX: ne,
|
|
747
1474
|
scaleY: E,
|
|
748
1475
|
...t
|
|
749
|
-
}, `${o[0]}:${o[1]}:${l[0]}:${l[1]}:${
|
|
1476
|
+
}, `${o[0]}:${o[1]}:${l[0]}:${l[1]}:${w}`), a.length > 0 && /* @__PURE__ */ O("div", {
|
|
750
1477
|
className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
|
|
751
1478
|
children: a.map((t) => {
|
|
752
|
-
let n =
|
|
753
|
-
return /* @__PURE__ */
|
|
1479
|
+
let n = x.label !== void 0 && x.activeId === t.id;
|
|
1480
|
+
return /* @__PURE__ */ O(C, {
|
|
754
1481
|
type: "button",
|
|
755
1482
|
tabIndex: -1,
|
|
756
|
-
onPointerEnter: () =>
|
|
1483
|
+
onPointerEnter: () => x.inspect(t.id),
|
|
757
1484
|
title: t.label,
|
|
758
1485
|
"aria-label": `${t.label}, ${d}: ${h(t.x)}, ${m}: ${_(t.y)}`,
|
|
759
1486
|
"aria-pressed": v === void 0 ? void 0 : v.selectedId === t.id,
|
|
760
1487
|
onClick: () => {
|
|
761
|
-
|
|
1488
|
+
x.inspect(t.id), v?.onSelect(t.id);
|
|
762
1489
|
},
|
|
763
|
-
...
|
|
764
|
-
children: /* @__PURE__ */
|
|
1490
|
+
...S.props(wt.target, wt.location(ne(t.x), E(t.y))),
|
|
1491
|
+
children: /* @__PURE__ */ O("span", {
|
|
765
1492
|
"aria-hidden": !0,
|
|
766
|
-
...
|
|
1493
|
+
...S.props(wt.dot(e[t.tone]), (v?.selectedId === t.id || n) && wt.selected)
|
|
767
1494
|
})
|
|
768
1495
|
}, t.id);
|
|
769
1496
|
})
|
|
770
1497
|
})]
|
|
771
1498
|
}),
|
|
772
|
-
y !== void 0 && /* @__PURE__ */
|
|
1499
|
+
y !== void 0 && /* @__PURE__ */ O(Dt, {
|
|
773
1500
|
...t,
|
|
774
1501
|
rangeSelection: y
|
|
775
1502
|
}),
|
|
776
|
-
/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ O(s, {
|
|
777
1504
|
label: `${n} points`,
|
|
778
1505
|
columns: [
|
|
779
1506
|
{
|
|
@@ -801,9 +1528,9 @@ function Y(t) {
|
|
|
801
1528
|
]
|
|
802
1529
|
});
|
|
803
1530
|
}
|
|
804
|
-
function
|
|
805
|
-
let c =
|
|
806
|
-
|
|
1531
|
+
function Et({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, formatY: o, rangeSelection: s }) {
|
|
1532
|
+
let c = w(), [l, u] = E(null), d = ne(null);
|
|
1533
|
+
te(() => () => d.current?.(), []);
|
|
807
1534
|
let f = l === null ? s?.value : {
|
|
808
1535
|
x: [Math.min(l.start.x, l.end.x), Math.max(l.start.x, l.end.x)],
|
|
809
1536
|
y: [Math.min(l.start.y, l.end.y), Math.max(l.start.y, l.end.y)]
|
|
@@ -811,21 +1538,21 @@ function X({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, f
|
|
|
811
1538
|
function p(r, i, a) {
|
|
812
1539
|
return {
|
|
813
1540
|
x: t.copy().clamp(!0).invert((i - r.left) / r.width * e),
|
|
814
|
-
y: n.copy().clamp(!0).invert((a - r.top) / r.height *
|
|
1541
|
+
y: n.copy().clamp(!0).invert((a - r.top) / r.height * vt)
|
|
815
1542
|
};
|
|
816
1543
|
}
|
|
817
1544
|
function m(t) {
|
|
818
1545
|
let n = t.button === 0 && t.pointerType !== "touch";
|
|
819
1546
|
if (s === void 0 || d.current !== null || !n) return;
|
|
820
|
-
let r = t.currentTarget.getBoundingClientRect(), i = (t.clientX - r.left) / r.width * e, a = (t.clientY - r.top) / r.height *
|
|
821
|
-
if (i <
|
|
1547
|
+
let r = t.currentTarget.getBoundingClientRect(), i = (t.clientX - r.left) / r.width * e, a = (t.clientY - r.top) / r.height * vt;
|
|
1548
|
+
if (i < yt || i > e - bt || a < xt || a > 216) return;
|
|
822
1549
|
let o = t.currentTarget, c = o.parentElement;
|
|
823
1550
|
if (c === null) return;
|
|
824
1551
|
let l = p(r, t.clientX, t.clientY);
|
|
825
1552
|
u({
|
|
826
1553
|
start: l,
|
|
827
1554
|
end: l
|
|
828
|
-
}), d.current =
|
|
1555
|
+
}), d.current = A(c, t.nativeEvent, {
|
|
829
1556
|
cancelOnEscape: !0,
|
|
830
1557
|
onMove: ({ x: e, y: t }) => u({
|
|
831
1558
|
start: l,
|
|
@@ -841,67 +1568,67 @@ function X({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, f
|
|
|
841
1568
|
}
|
|
842
1569
|
});
|
|
843
1570
|
}
|
|
844
|
-
return /* @__PURE__ */
|
|
1571
|
+
return /* @__PURE__ */ k("svg", {
|
|
845
1572
|
width: e,
|
|
846
|
-
height:
|
|
847
|
-
viewBox: `0 0 ${e} ${
|
|
1573
|
+
height: vt,
|
|
1574
|
+
viewBox: `0 0 ${e} ${vt}`,
|
|
848
1575
|
"aria-hidden": !0,
|
|
849
1576
|
onPointerDown: m,
|
|
850
|
-
...
|
|
1577
|
+
...S.props(v.svg, s !== void 0 && wt.brush),
|
|
851
1578
|
children: [
|
|
852
|
-
/* @__PURE__ */
|
|
1579
|
+
/* @__PURE__ */ O("defs", { children: /* @__PURE__ */ O("clipPath", {
|
|
853
1580
|
id: c,
|
|
854
|
-
children: /* @__PURE__ */
|
|
855
|
-
x:
|
|
856
|
-
y:
|
|
857
|
-
width: Math.max(0, e -
|
|
1581
|
+
children: /* @__PURE__ */ O("rect", {
|
|
1582
|
+
x: yt,
|
|
1583
|
+
y: xt,
|
|
1584
|
+
width: Math.max(0, e - yt - bt),
|
|
858
1585
|
height: 204
|
|
859
1586
|
})
|
|
860
1587
|
}) }),
|
|
861
|
-
t.ticks(5).map((e) => /* @__PURE__ */
|
|
1588
|
+
t.ticks(5).map((e) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
|
|
862
1589
|
x1: t(e),
|
|
863
1590
|
x2: t(e),
|
|
864
|
-
y1:
|
|
1591
|
+
y1: xt,
|
|
865
1592
|
y2: 216,
|
|
866
|
-
...
|
|
867
|
-
}), /* @__PURE__ */
|
|
1593
|
+
...S.props(v.grid)
|
|
1594
|
+
}), /* @__PURE__ */ O("text", {
|
|
868
1595
|
x: t(e),
|
|
869
1596
|
y: 234,
|
|
870
1597
|
textAnchor: "middle",
|
|
871
|
-
...
|
|
1598
|
+
...S.props(v.label),
|
|
872
1599
|
children: a(e)
|
|
873
1600
|
})] }, e)),
|
|
874
|
-
n.ticks(4).map((t) => /* @__PURE__ */
|
|
875
|
-
x1:
|
|
876
|
-
x2: e -
|
|
1601
|
+
n.ticks(4).map((t) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
|
|
1602
|
+
x1: yt,
|
|
1603
|
+
x2: e - bt,
|
|
877
1604
|
y1: n(t),
|
|
878
1605
|
y2: n(t),
|
|
879
|
-
...
|
|
880
|
-
}), /* @__PURE__ */
|
|
1606
|
+
...S.props(v.grid)
|
|
1607
|
+
}), /* @__PURE__ */ O("text", {
|
|
881
1608
|
x: 48,
|
|
882
1609
|
y: n(t) + 4,
|
|
883
1610
|
textAnchor: "end",
|
|
884
|
-
...
|
|
1611
|
+
...S.props(v.label),
|
|
885
1612
|
children: o(t)
|
|
886
1613
|
})] }, t)),
|
|
887
|
-
/* @__PURE__ */
|
|
888
|
-
x: (
|
|
1614
|
+
/* @__PURE__ */ O("text", {
|
|
1615
|
+
x: (yt + e - bt) / 2,
|
|
889
1616
|
y: 256,
|
|
890
1617
|
textAnchor: "middle",
|
|
891
|
-
...
|
|
1618
|
+
...S.props(v.label),
|
|
892
1619
|
children: r
|
|
893
1620
|
}),
|
|
894
|
-
/* @__PURE__ */
|
|
1621
|
+
/* @__PURE__ */ O("text", {
|
|
895
1622
|
x: 12,
|
|
896
1623
|
y: 108,
|
|
897
1624
|
textAnchor: "middle",
|
|
898
1625
|
transform: "rotate(-90 12 108)",
|
|
899
|
-
...
|
|
1626
|
+
...S.props(v.label),
|
|
900
1627
|
children: i
|
|
901
1628
|
}),
|
|
902
|
-
/* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ O("g", {
|
|
903
1630
|
clipPath: `url(#${c})`,
|
|
904
|
-
children: f != null && /* @__PURE__ */
|
|
1631
|
+
children: f != null && /* @__PURE__ */ O("rect", {
|
|
905
1632
|
x: t(f.x[0]),
|
|
906
1633
|
y: n(f.y[1]),
|
|
907
1634
|
width: t(f.x[1]) - t(f.x[0]),
|
|
@@ -912,19 +1639,19 @@ function X({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, f
|
|
|
912
1639
|
]
|
|
913
1640
|
});
|
|
914
1641
|
}
|
|
915
|
-
function
|
|
1642
|
+
function Dt({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: a, formatY: o }) {
|
|
916
1643
|
let s = e.value ?? {
|
|
917
1644
|
x: t,
|
|
918
1645
|
y: n
|
|
919
1646
|
};
|
|
920
|
-
return /* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ k("fieldset", {
|
|
921
1648
|
className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
|
|
922
1649
|
children: [
|
|
923
|
-
/* @__PURE__ */
|
|
1650
|
+
/* @__PURE__ */ O("legend", {
|
|
924
1651
|
className: "x153jb6y xy8obcc x1jfksii",
|
|
925
1652
|
children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
|
|
926
1653
|
}),
|
|
927
|
-
/* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ k(x.Root, {
|
|
928
1655
|
value: [...s.x],
|
|
929
1656
|
format: a,
|
|
930
1657
|
min: t[0],
|
|
@@ -935,26 +1662,26 @@ function Z({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
935
1662
|
x: t,
|
|
936
1663
|
y: s.y
|
|
937
1664
|
}),
|
|
938
|
-
children: [/* @__PURE__ */
|
|
1665
|
+
children: [/* @__PURE__ */ k("div", {
|
|
939
1666
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
940
|
-
children: [/* @__PURE__ */
|
|
1667
|
+
children: [/* @__PURE__ */ O(x.Label, { children: r }), /* @__PURE__ */ k("span", { children: [
|
|
941
1668
|
a(s.x[0]),
|
|
942
1669
|
" – ",
|
|
943
1670
|
a(s.x[1])
|
|
944
1671
|
] })]
|
|
945
|
-
}), /* @__PURE__ */
|
|
946
|
-
/* @__PURE__ */
|
|
947
|
-
/* @__PURE__ */
|
|
1672
|
+
}), /* @__PURE__ */ O(x.Control, { children: /* @__PURE__ */ k(x.Track, { children: [
|
|
1673
|
+
/* @__PURE__ */ O(x.Indicator, {}),
|
|
1674
|
+
/* @__PURE__ */ O(x.Thumb, {
|
|
948
1675
|
index: 0,
|
|
949
1676
|
"aria-label": `${r} minimum`
|
|
950
1677
|
}),
|
|
951
|
-
/* @__PURE__ */
|
|
1678
|
+
/* @__PURE__ */ O(x.Thumb, {
|
|
952
1679
|
index: 1,
|
|
953
1680
|
"aria-label": `${r} maximum`
|
|
954
1681
|
})
|
|
955
1682
|
] }) })]
|
|
956
1683
|
}),
|
|
957
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ k(x.Root, {
|
|
958
1685
|
value: [...s.y],
|
|
959
1686
|
format: o,
|
|
960
1687
|
min: n[0],
|
|
@@ -965,26 +1692,26 @@ function Z({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
965
1692
|
x: s.x,
|
|
966
1693
|
y: t
|
|
967
1694
|
}),
|
|
968
|
-
children: [/* @__PURE__ */
|
|
1695
|
+
children: [/* @__PURE__ */ k("div", {
|
|
969
1696
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
970
|
-
children: [/* @__PURE__ */
|
|
1697
|
+
children: [/* @__PURE__ */ O(x.Label, { children: i }), /* @__PURE__ */ k("span", { children: [
|
|
971
1698
|
o(s.y[0]),
|
|
972
1699
|
" – ",
|
|
973
1700
|
o(s.y[1])
|
|
974
1701
|
] })]
|
|
975
|
-
}), /* @__PURE__ */
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
1702
|
+
}), /* @__PURE__ */ O(x.Control, { children: /* @__PURE__ */ k(x.Track, { children: [
|
|
1703
|
+
/* @__PURE__ */ O(x.Indicator, {}),
|
|
1704
|
+
/* @__PURE__ */ O(x.Thumb, {
|
|
978
1705
|
index: 0,
|
|
979
1706
|
"aria-label": `${i} minimum`
|
|
980
1707
|
}),
|
|
981
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ O(x.Thumb, {
|
|
982
1709
|
index: 1,
|
|
983
1710
|
"aria-label": `${i} maximum`
|
|
984
1711
|
})
|
|
985
1712
|
] }) })]
|
|
986
1713
|
}),
|
|
987
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ O(b, {
|
|
988
1715
|
type: "button",
|
|
989
1716
|
disabled: e.value === null,
|
|
990
1717
|
onClick: () => e.onChange(null),
|
|
@@ -993,9 +1720,9 @@ function Z({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
993
1720
|
]
|
|
994
1721
|
});
|
|
995
1722
|
}
|
|
996
|
-
function
|
|
1723
|
+
function Ot({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
|
|
997
1724
|
if (!h(t) || !h(n)) return "Scatter domains must contain finite, increasing endpoints.";
|
|
998
|
-
if (e.length > 1e3) return `This plot exceeds the ${
|
|
1725
|
+
if (e.length > 1e3) return `This plot exceeds the ${St}-point render limit. Supply a smaller, labelled sample.`;
|
|
999
1726
|
if (!m(e)) return "Scatter points must have unique identifiers.";
|
|
1000
1727
|
if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
|
|
1001
1728
|
if (e.some((e) => {
|
|
@@ -1006,9 +1733,9 @@ function Q({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
|
|
|
1006
1733
|
let i = Number.isFinite(r.xStep) && r.xStep > 0 && r.xStep <= t[1] - t[0], a = Number.isFinite(r.yStep) && r.yStep > 0 && r.yStep <= n[1] - n[0];
|
|
1007
1734
|
if (!i || !a) return "Range selection steps must be finite, positive, and no larger than their domain span.";
|
|
1008
1735
|
let o = r.value;
|
|
1009
|
-
return o === null ? null : !
|
|
1736
|
+
return o === null ? null : !kt(o.x, t) || !kt(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
|
|
1010
1737
|
}
|
|
1011
|
-
function
|
|
1738
|
+
function kt(e, t) {
|
|
1012
1739
|
return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
|
|
1013
1740
|
}
|
|
1014
1741
|
// packages/charts/src/cartesian/time-series-data.ts
|
|
@@ -1017,7 +1744,7 @@ var $ = {
|
|
|
1017
1744
|
pointsPerSeries: 2e3,
|
|
1018
1745
|
markers: 200,
|
|
1019
1746
|
panels: 12
|
|
1020
|
-
},
|
|
1747
|
+
}, At = .01, jt = [
|
|
1021
1748
|
"series1",
|
|
1022
1749
|
"series2",
|
|
1023
1750
|
"series3",
|
|
@@ -1025,31 +1752,40 @@ var $ = {
|
|
|
1025
1752
|
"series5",
|
|
1026
1753
|
"series6"
|
|
1027
1754
|
];
|
|
1028
|
-
function
|
|
1029
|
-
let
|
|
1030
|
-
if (e.length > $.series ||
|
|
1755
|
+
function Mt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
1756
|
+
let i = e[0]?.points.map((e) => e.timestamp) ?? r;
|
|
1757
|
+
if (e.length > $.series || i.length > $.pointsPerSeries || n.length > $.markers) return `Choose a window with at most ${$.series} series, ${$.pointsPerSeries} observations per series, and ${$.markers} markers.`;
|
|
1031
1758
|
if (!m(e) || !m(n)) return "Series and markers require unique identifiers.";
|
|
1032
1759
|
for (let n of e) {
|
|
1033
|
-
if (n.points.length !==
|
|
1034
|
-
let e =
|
|
1760
|
+
if (n.points.length !== i.length) return "Every series must supply the same observation timestamps.";
|
|
1761
|
+
let e = Lt({
|
|
1035
1762
|
points: n.points,
|
|
1036
|
-
timestamps:
|
|
1763
|
+
timestamps: i,
|
|
1037
1764
|
isStacked: t
|
|
1038
1765
|
});
|
|
1039
1766
|
if (e !== void 0) return e;
|
|
1040
1767
|
}
|
|
1041
1768
|
for (let t of n) {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
}
|
|
1769
|
+
let n = Nt({
|
|
1770
|
+
marker: t,
|
|
1771
|
+
series: e,
|
|
1772
|
+
timestamps: i
|
|
1773
|
+
});
|
|
1774
|
+
if (n !== void 0) return n;
|
|
1775
|
+
}
|
|
1776
|
+
let a = e.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value])), o = Math.max(0, ...a) - Math.min(0, ...a), s = (i.at(-1) ?? 0) - (i[0] ?? 0);
|
|
1777
|
+
if (!Number.isFinite(o) || !Number.isFinite(s)) return "The elapsed-time and value ranges must be finite.";
|
|
1778
|
+
if (t && i.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
|
|
1779
|
+
}
|
|
1780
|
+
function Nt({ marker: e, series: t, timestamps: n }) {
|
|
1781
|
+
if (e.kind === "event") {
|
|
1782
|
+
let t = n[0] ?? 0, r = n.at(-1) ?? t, i = e.timestamp >= t && e.timestamp <= r;
|
|
1783
|
+
return Number.isFinite(e.timestamp) && i ? void 0 : "Every event marker must fall inside the observed time range.";
|
|
1047
1784
|
}
|
|
1048
|
-
|
|
1049
|
-
if (
|
|
1050
|
-
if (t && r.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
|
|
1785
|
+
if (!n.includes(e.timestamp)) return "Every time and point marker must align with an observation timestamp.";
|
|
1786
|
+
if (e.kind !== "time") return t.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.value === e.value ? void 0 : "Point markers must reference the recorded series value.";
|
|
1051
1787
|
}
|
|
1052
|
-
function
|
|
1788
|
+
function Pt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
1053
1789
|
return JSON.stringify([
|
|
1054
1790
|
n,
|
|
1055
1791
|
r,
|
|
@@ -1069,15 +1805,15 @@ function Ce({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
|
1069
1805
|
])
|
|
1070
1806
|
]);
|
|
1071
1807
|
}
|
|
1072
|
-
function
|
|
1808
|
+
function Ft(e, t, n = !1) {
|
|
1073
1809
|
if (e !== t) return [e, t];
|
|
1074
|
-
let r = Math.max(1, Math.abs(e) *
|
|
1810
|
+
let r = Math.max(1, Math.abs(e) * At), i = n ? 0 : e - r, a = t + r;
|
|
1075
1811
|
return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
|
|
1076
1812
|
}
|
|
1077
|
-
function
|
|
1813
|
+
function It(e, t) {
|
|
1078
1814
|
let n = e.filter((e) => e.tone === void 0);
|
|
1079
1815
|
return e.map((r, i) => {
|
|
1080
|
-
let a = n.findIndex((e) => e.id === r.id), o = r.tone ??
|
|
1816
|
+
let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? jt[a % jt.length] ?? "series1", s = r.points.map((n, r) => {
|
|
1081
1817
|
let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
|
|
1082
1818
|
return {
|
|
1083
1819
|
...n,
|
|
@@ -1092,7 +1828,7 @@ function Te(e, t) {
|
|
|
1092
1828
|
};
|
|
1093
1829
|
});
|
|
1094
1830
|
}
|
|
1095
|
-
function
|
|
1831
|
+
function Lt({ points: e, timestamps: t, isStacked: n }) {
|
|
1096
1832
|
for (let [r, i] of e.entries()) {
|
|
1097
1833
|
let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
|
|
1098
1834
|
if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
|
|
@@ -1101,19 +1837,20 @@ function Ee({ points: e, timestamps: t, isStacked: n }) {
|
|
|
1101
1837
|
}
|
|
1102
1838
|
}
|
|
1103
1839
|
// packages/charts/src/cartesian/time-series-line.tsx
|
|
1104
|
-
function
|
|
1105
|
-
|
|
1840
|
+
function Rt({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }) {
|
|
1841
|
+
let o = t.points.findLastIndex((e) => e.value !== null);
|
|
1842
|
+
return /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(P, {
|
|
1106
1843
|
data: [...t.points],
|
|
1107
1844
|
defined: (e) => e.value !== null,
|
|
1108
1845
|
x: (e) => n(e.timestamp),
|
|
1109
1846
|
y: (e) => r((e.value ?? 0) + e.base),
|
|
1110
1847
|
stroke: e[t.tone],
|
|
1111
|
-
...
|
|
1848
|
+
...S.props(v.mark)
|
|
1112
1849
|
}), t.points.filter((e, n) => {
|
|
1113
1850
|
if (e.value === null) return !1;
|
|
1114
|
-
let r = t.points[n - 1]?.value === null || t.points[n + 1]?.value === null;
|
|
1115
|
-
return
|
|
1116
|
-
}).map((i) => /* @__PURE__ */
|
|
1851
|
+
let r = t.points[n - 1]?.value === null || t.points[n + 1]?.value === null, a = t.points.length === 1, s = n === o, c = e.timestamp === i;
|
|
1852
|
+
return a || s ? !0 : r || c;
|
|
1853
|
+
}).map((i) => /* @__PURE__ */ O("circle", {
|
|
1117
1854
|
cx: n(i.timestamp),
|
|
1118
1855
|
cy: r((i.value ?? 0) + i.base),
|
|
1119
1856
|
r: a,
|
|
@@ -1121,82 +1858,370 @@ function De({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }
|
|
|
1121
1858
|
}, i.timestamp))] });
|
|
1122
1859
|
}
|
|
1123
1860
|
// packages/charts/src/cartesian/sparkline.tsx
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1861
|
+
var zt = {
|
|
1862
|
+
minimum: "Lowest",
|
|
1863
|
+
maximum: "Highest",
|
|
1864
|
+
last: "Latest"
|
|
1865
|
+
}, Bt = 2.5;
|
|
1866
|
+
function Vt({ points: e, marked: t }) {
|
|
1867
|
+
let n = e.flatMap((e) => e.value === null ? [] : [{
|
|
1868
|
+
...e,
|
|
1869
|
+
value: e.value
|
|
1870
|
+
}]), r = n.map((e) => e.value), i = {
|
|
1871
|
+
minimum: n.find((e) => e.value === Math.min(...r)),
|
|
1872
|
+
maximum: n.find((e) => e.value === Math.max(...r)),
|
|
1873
|
+
last: n.at(-1)
|
|
1874
|
+
};
|
|
1875
|
+
return t.flatMap((e) => {
|
|
1876
|
+
let t = i[e];
|
|
1877
|
+
return t === void 0 ? [] : [{
|
|
1878
|
+
kind: e,
|
|
1879
|
+
point: t
|
|
1880
|
+
}];
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
function Ht({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueDomain: o, markedPoints: s = [], baseline: c }) {
|
|
1884
|
+
let l = w(), u = w(), d = Ut({
|
|
1885
|
+
title: t,
|
|
1886
|
+
summary: n,
|
|
1887
|
+
unit: r,
|
|
1888
|
+
series: a,
|
|
1889
|
+
valueDomain: o,
|
|
1890
|
+
markedPoints: s,
|
|
1891
|
+
baseline: c
|
|
1892
|
+
}), f = a.points.some((e) => e.value !== null);
|
|
1893
|
+
if (d !== void 0 || !f) return /* @__PURE__ */ O("span", {
|
|
1133
1894
|
role: "img",
|
|
1134
|
-
"aria-label": `${
|
|
1135
|
-
title:
|
|
1895
|
+
"aria-label": `${t}. ${n} Values in ${r}; timestamps in ${i}. ${d ?? "No recorded values. Missing observations remain unavailable."}`,
|
|
1896
|
+
title: d ?? "No recorded values",
|
|
1136
1897
|
className: "x2pejg6 x10w6t97 x2lah0s xxymvpz x3nfvp2 x6s0dn4 xl56j7k x153jb6y x1hz01jw xy8obcc",
|
|
1137
|
-
children:
|
|
1898
|
+
children: d === void 0 ? "No data" : "Invalid trend"
|
|
1138
1899
|
});
|
|
1139
|
-
let
|
|
1140
|
-
domain: [...
|
|
1900
|
+
let p = a.points[0]?.timestamp ?? 0, m = a.points.at(-1)?.timestamp ?? p, h = j({
|
|
1901
|
+
domain: [...Ft(p, m)],
|
|
1141
1902
|
range: [3, 125]
|
|
1142
|
-
}),
|
|
1143
|
-
domain: [...
|
|
1903
|
+
}), g = j({
|
|
1904
|
+
domain: [...o],
|
|
1144
1905
|
range: [29, 3]
|
|
1145
|
-
}),
|
|
1146
|
-
|
|
1906
|
+
}), _ = It([a], !1)[0], v = e[_?.tone ?? "series1"], ee = Vt({
|
|
1907
|
+
points: a.points,
|
|
1908
|
+
marked: s
|
|
1909
|
+
}), y = ee.map(({ kind: e, point: t }) => `${zt[e]}: ${t.value} ${r}.`).join(" "), b = c === void 0 ? "" : `Reference: ${c} ${r}.`;
|
|
1910
|
+
return /* @__PURE__ */ k("svg", {
|
|
1147
1911
|
role: "img",
|
|
1148
|
-
"aria-labelledby":
|
|
1149
|
-
"aria-describedby":
|
|
1912
|
+
"aria-labelledby": l,
|
|
1913
|
+
"aria-describedby": u,
|
|
1150
1914
|
focusable: "false",
|
|
1151
1915
|
viewBox: "0 0 128 32",
|
|
1152
1916
|
width: 128,
|
|
1153
1917
|
height: 32,
|
|
1154
1918
|
className: "x1rg5ohu x2pejg6 x10w6t97 x2lah0s xxymvpz",
|
|
1155
1919
|
children: [
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
id:
|
|
1158
|
-
children:
|
|
1920
|
+
/* @__PURE__ */ O("title", {
|
|
1921
|
+
id: l,
|
|
1922
|
+
children: t
|
|
1159
1923
|
}),
|
|
1160
|
-
/* @__PURE__ */
|
|
1161
|
-
id:
|
|
1924
|
+
/* @__PURE__ */ k("desc", {
|
|
1925
|
+
id: u,
|
|
1162
1926
|
children: [
|
|
1163
|
-
t,
|
|
1164
|
-
" Values in ",
|
|
1165
1927
|
n,
|
|
1166
|
-
"
|
|
1928
|
+
" Values in ",
|
|
1167
1929
|
r,
|
|
1930
|
+
"; timestamps in ",
|
|
1931
|
+
i,
|
|
1168
1932
|
". Displayed value domain: ",
|
|
1169
|
-
|
|
1933
|
+
o[0],
|
|
1170
1934
|
" to",
|
|
1171
1935
|
" ",
|
|
1172
|
-
|
|
1936
|
+
o[1],
|
|
1173
1937
|
" ",
|
|
1174
|
-
|
|
1175
|
-
"."
|
|
1938
|
+
r,
|
|
1939
|
+
". ",
|
|
1940
|
+
y,
|
|
1941
|
+
" ",
|
|
1942
|
+
b
|
|
1176
1943
|
]
|
|
1177
1944
|
}),
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1945
|
+
c !== void 0 && /* @__PURE__ */ O("line", {
|
|
1946
|
+
x1: 3,
|
|
1947
|
+
x2: 125,
|
|
1948
|
+
y1: g(c),
|
|
1949
|
+
y2: g(c),
|
|
1950
|
+
className: "x1crw9hw xnpr05h xbw2l0c x13efnbd"
|
|
1951
|
+
}),
|
|
1952
|
+
_ !== void 0 && /* @__PURE__ */ O(Rt, {
|
|
1953
|
+
series: _,
|
|
1954
|
+
x: h,
|
|
1955
|
+
y: g,
|
|
1182
1956
|
pointRadius: 2
|
|
1183
|
-
})
|
|
1957
|
+
}),
|
|
1958
|
+
ee.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */ O("circle", {
|
|
1959
|
+
cx: h(t.timestamp),
|
|
1960
|
+
cy: g(t.value),
|
|
1961
|
+
r: Bt,
|
|
1962
|
+
fill: v
|
|
1963
|
+
}, e) : /* @__PURE__ */ O("circle", {
|
|
1964
|
+
cx: h(t.timestamp),
|
|
1965
|
+
cy: g(t.value),
|
|
1966
|
+
r: Bt,
|
|
1967
|
+
stroke: v,
|
|
1968
|
+
className: "x1fytgo2 x1r6sdyr x13efnbd"
|
|
1969
|
+
}, e))
|
|
1184
1970
|
]
|
|
1185
1971
|
});
|
|
1186
1972
|
}
|
|
1187
|
-
function
|
|
1973
|
+
function Ut({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPoints: a, baseline: o }) {
|
|
1188
1974
|
if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
|
|
1189
1975
|
if (!h(i)) return "The displayed value domain must have finite, increasing bounds.";
|
|
1190
|
-
let
|
|
1976
|
+
let s = Mt({
|
|
1191
1977
|
series: [r],
|
|
1192
1978
|
isStacked: !1,
|
|
1193
1979
|
markers: []
|
|
1194
1980
|
});
|
|
1195
|
-
if (
|
|
1981
|
+
if (s !== void 0) return s;
|
|
1196
1982
|
if (r.points.some((e) => e.value !== null && (e.value < i[0] || e.value > i[1]))) return "Every recorded value must be inside the declared value domain.";
|
|
1983
|
+
if (new Set(a).size !== a.length) return "Mark each recorded point at most once.";
|
|
1984
|
+
if (!(o === void 0 || o >= i[0] && o <= i[1])) return "The reference value must be inside the declared value domain.";
|
|
1985
|
+
}
|
|
1986
|
+
// packages/charts/src/cartesian/time-series-bands.ts
|
|
1987
|
+
var Wt = {
|
|
1988
|
+
bands: 4,
|
|
1989
|
+
crossings: 4
|
|
1990
|
+
}, Gt = [
|
|
1991
|
+
"series1",
|
|
1992
|
+
"series2",
|
|
1993
|
+
"series3",
|
|
1994
|
+
"series4",
|
|
1995
|
+
"series5",
|
|
1996
|
+
"series6"
|
|
1997
|
+
];
|
|
1998
|
+
function Kt(e) {
|
|
1999
|
+
let t = [
|
|
2000
|
+
e.lower,
|
|
2001
|
+
e.center,
|
|
2002
|
+
e.upper
|
|
2003
|
+
].filter((e) => e !== null);
|
|
2004
|
+
return t.some((e) => !Number.isFinite(e)) ? "Band values must be finite numbers or explicit missing values." : e.lower === null == (e.upper === null) ? t.every((e, n) => n === 0 || (t[n - 1] ?? e) <= e) ? void 0 : "Band values must satisfy lower ≤ center ≤ upper." : "A band observation needs both bounds or neither.";
|
|
2005
|
+
}
|
|
2006
|
+
function qt({ bands: e, crossings: t, series: n, timestamps: r }) {
|
|
2007
|
+
if (e.length > Wt.bands || t.length > Wt.crossings) return `Supply at most ${Wt.bands} bands and ${Wt.crossings} crossings.`;
|
|
2008
|
+
if (!m([...n, ...e]) || !m(t)) return "Series, bands, and crossings require unique identifiers.";
|
|
2009
|
+
for (let t of e) {
|
|
2010
|
+
if (t.points.length !== r.length || t.points.some((e, t) => e.timestamp !== r[t])) return "Every band must supply the same observation timestamps as the series.";
|
|
2011
|
+
let e = t.points.map(Kt).find((e) => e !== void 0);
|
|
2012
|
+
if (e !== void 0) return e;
|
|
2013
|
+
}
|
|
2014
|
+
let i = new Set([...n, ...e].map((e) => e.id));
|
|
2015
|
+
for (let e of t) if (!(i.has(e.seriesId) && e.label.trim() !== "") || !Number.isFinite(e.value)) return "Each crossing needs a label, a finite value, and a supplied series or band.";
|
|
2016
|
+
}
|
|
2017
|
+
function Jt({ series: e, bands: t }) {
|
|
2018
|
+
let n = e.filter((e) => e.tone === void 0).length, r = t.filter((e) => e.tone === void 0);
|
|
2019
|
+
return t.map((e) => {
|
|
2020
|
+
let t = n + r.findIndex((t) => t.id === e.id);
|
|
2021
|
+
return {
|
|
2022
|
+
...e,
|
|
2023
|
+
tone: e.tone ?? Gt[t % Gt.length] ?? "series1"
|
|
2024
|
+
};
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
function Yt({ start: e, end: t, value: n, direction: r }) {
|
|
2028
|
+
let i = e > n && t <= n, a = e < n && t >= n;
|
|
2029
|
+
switch (r) {
|
|
2030
|
+
case "falling": return i;
|
|
2031
|
+
case "rising": return a;
|
|
2032
|
+
case void 0: return i || a;
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
function Xt({ points: e, crossing: t }) {
|
|
2036
|
+
let n = e.flatMap((t, n) => {
|
|
2037
|
+
let r = e[n + 1];
|
|
2038
|
+
return t.value === null || r === void 0 || r.value === null ? [] : [{
|
|
2039
|
+
start: t.timestamp,
|
|
2040
|
+
end: r.timestamp,
|
|
2041
|
+
from: t.value,
|
|
2042
|
+
to: r.value
|
|
2043
|
+
}];
|
|
2044
|
+
}).find(({ from: e, to: n }) => Yt({
|
|
2045
|
+
start: e,
|
|
2046
|
+
end: n,
|
|
2047
|
+
value: t.value,
|
|
2048
|
+
direction: t.direction
|
|
2049
|
+
}));
|
|
2050
|
+
if (n === void 0) return;
|
|
2051
|
+
let r = (t.value - n.from) / (n.to - n.from);
|
|
2052
|
+
return n.start + r * (n.end - n.start);
|
|
2053
|
+
}
|
|
2054
|
+
function Zt({ crossings: e, series: t, bands: n }) {
|
|
2055
|
+
return e.map((e) => ({
|
|
2056
|
+
crossing: e,
|
|
2057
|
+
timestamp: Xt({
|
|
2058
|
+
points: t.find((t) => t.id === e.seriesId)?.points ?? n.find((t) => t.id === e.seriesId)?.points.map((e) => ({
|
|
2059
|
+
timestamp: e.timestamp,
|
|
2060
|
+
value: e.center
|
|
2061
|
+
})) ?? [],
|
|
2062
|
+
crossing: e
|
|
2063
|
+
})
|
|
2064
|
+
}));
|
|
2065
|
+
}
|
|
2066
|
+
function Qt(e, t) {
|
|
2067
|
+
let n = Math.min(...e.map((e) => Math.abs(e - t)));
|
|
2068
|
+
return e.find((e) => Math.abs(e - t) === n);
|
|
2069
|
+
}
|
|
2070
|
+
function $t(e) {
|
|
2071
|
+
return e.flatMap((e) => e.points.flatMap((e) => [
|
|
2072
|
+
e.lower,
|
|
2073
|
+
e.center,
|
|
2074
|
+
e.upper
|
|
2075
|
+
].filter((e) => e !== null)));
|
|
2076
|
+
}
|
|
2077
|
+
// packages/charts/src/cartesian/time-series-overlays.tsx
|
|
2078
|
+
var en = {
|
|
2079
|
+
kDd8S0: "x1bsw5e1",
|
|
2080
|
+
kfJifR: "xnpr05h",
|
|
2081
|
+
kDwRjp: "xbh8q5q",
|
|
2082
|
+
$$css: !0
|
|
2083
|
+
}, tn = {
|
|
2084
|
+
kVYP8I: "xd6etog",
|
|
2085
|
+
$$css: !0
|
|
2086
|
+
}, nn = {
|
|
2087
|
+
kfJifR: "xvlca1e",
|
|
2088
|
+
kDwRjp: "xbh8q5q",
|
|
2089
|
+
kREpy8: "x13efnbd",
|
|
2090
|
+
$$css: !0
|
|
2091
|
+
}, rn = {
|
|
2092
|
+
bandEdge: (e) => [
|
|
2093
|
+
en,
|
|
2094
|
+
{
|
|
2095
|
+
kjVXCG: e == null ? e : "x6mkzkt",
|
|
2096
|
+
$$css: !0
|
|
2097
|
+
},
|
|
2098
|
+
{ "--x-stroke": e ?? void 0 }
|
|
2099
|
+
],
|
|
2100
|
+
bandFill: (e) => [
|
|
2101
|
+
tn,
|
|
2102
|
+
{
|
|
2103
|
+
kDwRjp: e == null ? e : "x19zyb68",
|
|
2104
|
+
$$css: !0
|
|
2105
|
+
},
|
|
2106
|
+
{ "--x-fill": e ?? void 0 }
|
|
2107
|
+
],
|
|
2108
|
+
center: (e) => [
|
|
2109
|
+
nn,
|
|
2110
|
+
{
|
|
2111
|
+
kjVXCG: e == null ? e : "x6mkzkt",
|
|
2112
|
+
$$css: !0
|
|
2113
|
+
},
|
|
2114
|
+
{ "--x-stroke": e ?? void 0 }
|
|
2115
|
+
]
|
|
2116
|
+
}, an = 16, on = 6, sn = 6.5, cn = 2.5, ln = 4, un = 12;
|
|
2117
|
+
function dn({ instants: e, x: t, right: n, ends: r }) {
|
|
2118
|
+
let [i, ...a] = e;
|
|
2119
|
+
if (i === void 0) return [];
|
|
2120
|
+
let o = t(i.timestamp), s = i.label.length * sn + on, c = o + s > n ? "end" : "start", l = c === "start" ? o : o - s, u = c === "start" ? o + s : o, d = r.findIndex((e) => l > e), f = d === -1 ? Math.min(r.length, 1) : d, p = [
|
|
2121
|
+
...r.slice(0, f),
|
|
2122
|
+
Math.max(u, r[f] ?? u),
|
|
2123
|
+
...r.slice(f + 1)
|
|
2124
|
+
];
|
|
2125
|
+
return [{
|
|
2126
|
+
...i,
|
|
2127
|
+
lane: f,
|
|
2128
|
+
anchor: c
|
|
2129
|
+
}, ...dn({
|
|
2130
|
+
instants: a,
|
|
2131
|
+
x: t,
|
|
2132
|
+
right: n,
|
|
2133
|
+
ends: p
|
|
2134
|
+
})];
|
|
2135
|
+
}
|
|
2136
|
+
function fn({ instants: e, x: t, right: n }) {
|
|
2137
|
+
return dn({
|
|
2138
|
+
instants: e.toSorted((e, t) => e.timestamp - t.timestamp),
|
|
2139
|
+
x: t,
|
|
2140
|
+
right: n,
|
|
2141
|
+
ends: []
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
function pn(e) {
|
|
2145
|
+
return un + Math.max(0, ...e.map((e) => e.lane + 1)) * an;
|
|
2146
|
+
}
|
|
2147
|
+
function mn(e) {
|
|
2148
|
+
return e.lower !== null && e.upper !== null;
|
|
2149
|
+
}
|
|
2150
|
+
function hn({ bands: t, x: n, y: r }) {
|
|
2151
|
+
return /* @__PURE__ */ O("g", { children: t.map((t) => {
|
|
2152
|
+
let i = e[t.tone], a = [...t.points];
|
|
2153
|
+
return /* @__PURE__ */ k("g", { children: [
|
|
2154
|
+
/* @__PURE__ */ O(ie, {
|
|
2155
|
+
data: a,
|
|
2156
|
+
defined: mn,
|
|
2157
|
+
x: (e) => n(e.timestamp),
|
|
2158
|
+
y0: (e) => r(e.lower ?? 0),
|
|
2159
|
+
y1: (e) => r(e.upper ?? 0),
|
|
2160
|
+
...S.props(rn.bandFill(i))
|
|
2161
|
+
}),
|
|
2162
|
+
/* @__PURE__ */ O(P, {
|
|
2163
|
+
data: a,
|
|
2164
|
+
defined: mn,
|
|
2165
|
+
x: (e) => n(e.timestamp),
|
|
2166
|
+
y: (e) => r(e.upper ?? 0),
|
|
2167
|
+
...S.props(rn.bandEdge(i))
|
|
2168
|
+
}),
|
|
2169
|
+
/* @__PURE__ */ O(P, {
|
|
2170
|
+
data: a,
|
|
2171
|
+
defined: mn,
|
|
2172
|
+
x: (e) => n(e.timestamp),
|
|
2173
|
+
y: (e) => r(e.lower ?? 0),
|
|
2174
|
+
...S.props(rn.bandEdge(i))
|
|
2175
|
+
}),
|
|
2176
|
+
/* @__PURE__ */ O(P, {
|
|
2177
|
+
data: a,
|
|
2178
|
+
defined: (e) => e.center !== null,
|
|
2179
|
+
x: (e) => n(e.timestamp),
|
|
2180
|
+
y: (e) => r(e.center ?? 0),
|
|
2181
|
+
...S.props(rn.center(i))
|
|
2182
|
+
})
|
|
2183
|
+
] }, t.id);
|
|
2184
|
+
}) });
|
|
2185
|
+
}
|
|
2186
|
+
function gn({ placed: e, x: t, y: n, bottom: r }) {
|
|
2187
|
+
return /* @__PURE__ */ O("g", {
|
|
2188
|
+
"aria-hidden": !0,
|
|
2189
|
+
children: e.map((e) => {
|
|
2190
|
+
let i = t(e.timestamp), a = un + e.lane * an, o = e.anchor === "start" ? i + on : i - on;
|
|
2191
|
+
return /* @__PURE__ */ k("g", { children: [
|
|
2192
|
+
/* @__PURE__ */ O("line", {
|
|
2193
|
+
x1: i,
|
|
2194
|
+
x2: i,
|
|
2195
|
+
y1: a,
|
|
2196
|
+
y2: r,
|
|
2197
|
+
className: "xhq4mlf xnpr05h x1bpwu3k x13efnbd"
|
|
2198
|
+
}),
|
|
2199
|
+
/* @__PURE__ */ O("circle", {
|
|
2200
|
+
cx: i,
|
|
2201
|
+
cy: a,
|
|
2202
|
+
r: cn,
|
|
2203
|
+
className: "xlrhuyr"
|
|
2204
|
+
}),
|
|
2205
|
+
/* @__PURE__ */ O("text", {
|
|
2206
|
+
x: o,
|
|
2207
|
+
y: a,
|
|
2208
|
+
textAnchor: e.anchor,
|
|
2209
|
+
dominantBaseline: "middle",
|
|
2210
|
+
...S.props(v.label, v.strongLabel, v.haloLabel),
|
|
2211
|
+
children: e.label
|
|
2212
|
+
}),
|
|
2213
|
+
e.value !== void 0 && /* @__PURE__ */ O("circle", {
|
|
2214
|
+
cx: i,
|
|
2215
|
+
cy: n(e.value),
|
|
2216
|
+
r: ln,
|
|
2217
|
+
className: "x1fytgo2 x17y187c xvlca1e x13efnbd"
|
|
2218
|
+
})
|
|
2219
|
+
] }, e.id);
|
|
2220
|
+
})
|
|
2221
|
+
});
|
|
1197
2222
|
}
|
|
1198
2223
|
// packages/charts/src/cartesian/time-series.tsx
|
|
1199
|
-
var
|
|
2224
|
+
var _n = {
|
|
1200
2225
|
timeAxis: {
|
|
1201
2226
|
k1xSpc: "x78zum5",
|
|
1202
2227
|
kjj79g: "x1qughib",
|
|
@@ -1217,46 +2242,87 @@ var Ae = {
|
|
|
1217
2242
|
"--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
1218
2243
|
}]
|
|
1219
2244
|
};
|
|
1220
|
-
function
|
|
1221
|
-
return
|
|
2245
|
+
function vn({ bands: e, crossings: t }) {
|
|
2246
|
+
return JSON.stringify([e.map((e) => [
|
|
2247
|
+
e.id,
|
|
2248
|
+
e.label,
|
|
2249
|
+
e.rangeLabel,
|
|
2250
|
+
e.tone,
|
|
2251
|
+
e.points.map((e) => [
|
|
2252
|
+
e.timestamp,
|
|
2253
|
+
e.lower,
|
|
2254
|
+
e.center,
|
|
2255
|
+
e.upper
|
|
2256
|
+
])
|
|
2257
|
+
]), t.map((e) => [
|
|
2258
|
+
e.id,
|
|
2259
|
+
e.seriesId,
|
|
2260
|
+
e.value,
|
|
2261
|
+
e.label,
|
|
2262
|
+
e.direction
|
|
2263
|
+
])]);
|
|
2264
|
+
}
|
|
2265
|
+
function yn({ bands: e, timestamp: t, formatValue: n }) {
|
|
2266
|
+
return e.flatMap((e) => {
|
|
2267
|
+
let r = e.points.find((e) => e.timestamp === t), i = r?.center ?? null, a = r?.lower !== null && r?.upper !== null && r !== void 0;
|
|
2268
|
+
return [{
|
|
2269
|
+
id: e.id,
|
|
2270
|
+
label: e.label,
|
|
2271
|
+
tone: e.tone,
|
|
2272
|
+
shape: "band",
|
|
2273
|
+
value: i === null ? "Unavailable" : n(i)
|
|
2274
|
+
}, {
|
|
2275
|
+
id: `${e.id}:range`,
|
|
2276
|
+
label: e.rangeLabel,
|
|
2277
|
+
tone: e.tone,
|
|
2278
|
+
shape: "band",
|
|
2279
|
+
value: a ? `${n(r.lower)} – ${n(r.upper)}` : "Unavailable"
|
|
2280
|
+
}];
|
|
2281
|
+
});
|
|
2282
|
+
}
|
|
2283
|
+
function bn({ found: e, formatTimestamp: t }) {
|
|
2284
|
+
return e.timestamp === void 0 ? `${e.crossing.label} · Not reached in this range` : `About ${t(e.timestamp)} · ${e.crossing.label}`;
|
|
2285
|
+
}
|
|
2286
|
+
function xn(e) {
|
|
2287
|
+
return /* @__PURE__ */ O(On, {
|
|
1222
2288
|
...e,
|
|
1223
2289
|
kind: "line",
|
|
1224
2290
|
isStacked: !1
|
|
1225
2291
|
});
|
|
1226
2292
|
}
|
|
1227
|
-
function
|
|
1228
|
-
return /* @__PURE__ */
|
|
2293
|
+
function Sn({ isStacked: e = !1, ...t }) {
|
|
2294
|
+
return /* @__PURE__ */ O(On, {
|
|
1229
2295
|
...t,
|
|
1230
2296
|
kind: "area",
|
|
1231
2297
|
isStacked: e
|
|
1232
2298
|
});
|
|
1233
2299
|
}
|
|
1234
|
-
function
|
|
1235
|
-
return /* @__PURE__ */
|
|
2300
|
+
function Cn(e) {
|
|
2301
|
+
return /* @__PURE__ */ O(wn, { ...e });
|
|
1236
2302
|
}
|
|
1237
|
-
function
|
|
1238
|
-
let l =
|
|
2303
|
+
function wn({ title: e, description: r, series: i, actions: a, report: o, height: s = 180, showTimeAxis: c = !0 }) {
|
|
2304
|
+
let l = w(), u = It(i.map((e) => ({
|
|
1239
2305
|
...e,
|
|
1240
2306
|
points: []
|
|
1241
2307
|
})), !1);
|
|
1242
|
-
return !Number.isFinite(s) || s < 48 ? /* @__PURE__ */
|
|
2308
|
+
return !Number.isFinite(s) || s < 48 ? /* @__PURE__ */ O(g, {
|
|
1243
2309
|
title: e,
|
|
1244
2310
|
description: r,
|
|
1245
2311
|
report: o,
|
|
1246
2312
|
message: "Chart height must be at least 48 pixels."
|
|
1247
|
-
}) : /* @__PURE__ */
|
|
2313
|
+
}) : /* @__PURE__ */ O("div", {
|
|
1248
2314
|
"aria-hidden": !0,
|
|
1249
2315
|
inert: !0,
|
|
1250
2316
|
className: "xeuugli",
|
|
1251
|
-
children: /* @__PURE__ */
|
|
2317
|
+
children: /* @__PURE__ */ O(p, {
|
|
1252
2318
|
title: e,
|
|
1253
2319
|
description: r,
|
|
1254
2320
|
report: o,
|
|
1255
2321
|
series: u,
|
|
1256
2322
|
actions: a,
|
|
1257
|
-
children: /* @__PURE__ */
|
|
2323
|
+
children: /* @__PURE__ */ k("div", {
|
|
1258
2324
|
className: "xrvj5dj x1n8ia3y",
|
|
1259
|
-
children: [/* @__PURE__ */
|
|
2325
|
+
children: [/* @__PURE__ */ O(ue, {
|
|
1260
2326
|
id: l,
|
|
1261
2327
|
label: void 0,
|
|
1262
2328
|
legend: u,
|
|
@@ -1265,61 +2331,61 @@ function Pe({ title: e, description: r, series: i, actions: a, report: o, height
|
|
|
1265
2331
|
width: 0,
|
|
1266
2332
|
source: void 0,
|
|
1267
2333
|
hasSeriesSummary: o?.seriesValues !== void 0
|
|
1268
|
-
}), /* @__PURE__ */
|
|
1269
|
-
...
|
|
1270
|
-
children: [/* @__PURE__ */
|
|
2334
|
+
}), /* @__PURE__ */ k("div", {
|
|
2335
|
+
...S.props(v.plot),
|
|
2336
|
+
children: [/* @__PURE__ */ O(t, { height: s - 16 }), c && /* @__PURE__ */ k("div", {
|
|
1271
2337
|
className: "x78zum5 x1qughib x8zbtdt x1c87qhr xy8obcc xas2l8k x153jb6y xss6m8b",
|
|
1272
|
-
children: [/* @__PURE__ */
|
|
2338
|
+
children: [/* @__PURE__ */ O(n, { width: "8ch" }), /* @__PURE__ */ O(n, { width: "8ch" })]
|
|
1273
2339
|
})]
|
|
1274
2340
|
})]
|
|
1275
2341
|
})
|
|
1276
2342
|
})
|
|
1277
2343
|
});
|
|
1278
2344
|
}
|
|
1279
|
-
function
|
|
1280
|
-
let n =
|
|
2345
|
+
function Tn({ charts: e, ...t }) {
|
|
2346
|
+
let n = ne(null), [r, i] = E(), a = JSON.stringify(e.map((e) => [
|
|
1281
2347
|
e.id,
|
|
1282
2348
|
e.title,
|
|
1283
|
-
|
|
2349
|
+
Pt({
|
|
1284
2350
|
series: e.series,
|
|
1285
2351
|
markers: e.markers ?? [],
|
|
1286
2352
|
timestampUnit: t.timestampUnit,
|
|
1287
2353
|
isStacked: !1
|
|
1288
2354
|
})
|
|
1289
2355
|
])), o = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), s = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === o);
|
|
1290
|
-
if (r !== void 0 && r.signature !== a && i(void 0),
|
|
2356
|
+
if (r !== void 0 && r.signature !== a && i(void 0), te(() => {
|
|
1291
2357
|
function e(e) {
|
|
1292
2358
|
e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
|
|
1293
2359
|
}
|
|
1294
2360
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1295
|
-
}, []), !s || !m(e)) return /* @__PURE__ */
|
|
2361
|
+
}, []), !s || !m(e)) return /* @__PURE__ */ O(g, {
|
|
1296
2362
|
title: "Small multiples",
|
|
1297
2363
|
message: "Charts need unique identifiers and aligned observation timestamps."
|
|
1298
2364
|
});
|
|
1299
|
-
if (e.length > $.panels) return /* @__PURE__ */
|
|
2365
|
+
if (e.length > $.panels) return /* @__PURE__ */ O(g, {
|
|
1300
2366
|
title: "Small multiples",
|
|
1301
2367
|
message: `Choose at most ${$.panels} panels.`
|
|
1302
2368
|
});
|
|
1303
|
-
if (e.length === 0) return /* @__PURE__ */
|
|
2369
|
+
if (e.length === 0) return /* @__PURE__ */ O(p, {
|
|
1304
2370
|
title: "Small multiples",
|
|
1305
|
-
children: /* @__PURE__ */
|
|
2371
|
+
children: /* @__PURE__ */ O("p", {
|
|
1306
2372
|
className: "x153jb6y",
|
|
1307
2373
|
children: "No charts"
|
|
1308
2374
|
})
|
|
1309
2375
|
});
|
|
1310
2376
|
let c = Math.max(52, ...e.flatMap((e) => e.series.flatMap((t) => t.points.flatMap((t) => t.value === null || !Number.isFinite(t.value) ? [] : [(e.formatTick ?? e.formatValue)(t.value).length * 7 + 12])))), l = e.every((e) => e.report !== void 0);
|
|
1311
|
-
return /* @__PURE__ */
|
|
2377
|
+
return /* @__PURE__ */ O("div", {
|
|
1312
2378
|
ref: n,
|
|
1313
2379
|
...{
|
|
1314
2380
|
0: { className: "xrvj5dj x1j825kq" },
|
|
1315
2381
|
1: { className: "xrvj5dj xxhr3t" }
|
|
1316
2382
|
}[!!l | 0],
|
|
1317
|
-
children: e.map((n, o) => /* @__PURE__ */
|
|
2383
|
+
children: e.map((n, o) => /* @__PURE__ */ O("div", {
|
|
1318
2384
|
...{
|
|
1319
2385
|
0: {},
|
|
1320
2386
|
1: { className: "x1y332i5" }
|
|
1321
2387
|
}[!!(l && o > 0) | 0],
|
|
1322
|
-
children: /* @__PURE__ */
|
|
2388
|
+
children: /* @__PURE__ */ O(On, {
|
|
1323
2389
|
...t,
|
|
1324
2390
|
title: n.title,
|
|
1325
2391
|
description: n.description,
|
|
@@ -1345,25 +2411,25 @@ function Fe({ charts: e, ...t }) {
|
|
|
1345
2411
|
}, n.id))
|
|
1346
2412
|
});
|
|
1347
2413
|
}
|
|
1348
|
-
function
|
|
1349
|
-
if (!m(e) || e.length > $.panels) return /* @__PURE__ */
|
|
2414
|
+
function En({ charts: e, height: t }) {
|
|
2415
|
+
if (!m(e) || e.length > $.panels) return /* @__PURE__ */ O(g, {
|
|
1350
2416
|
title: "Small multiples",
|
|
1351
2417
|
message: `Choose at most ${$.panels} panels with unique identifiers.`
|
|
1352
2418
|
});
|
|
1353
2419
|
let n = e.every((e) => e.report !== void 0);
|
|
1354
|
-
return /* @__PURE__ */
|
|
2420
|
+
return /* @__PURE__ */ O("div", {
|
|
1355
2421
|
"aria-hidden": !0,
|
|
1356
2422
|
inert: !0,
|
|
1357
2423
|
...{
|
|
1358
2424
|
0: { className: "xrvj5dj x1j825kq" },
|
|
1359
2425
|
1: { className: "xrvj5dj xxhr3t" }
|
|
1360
2426
|
}[!!n | 0],
|
|
1361
|
-
children: e.map((r, i) => /* @__PURE__ */
|
|
2427
|
+
children: e.map((r, i) => /* @__PURE__ */ O("div", {
|
|
1362
2428
|
...{
|
|
1363
2429
|
0: {},
|
|
1364
2430
|
1: { className: "x1y332i5" }
|
|
1365
2431
|
}[!!(n && i > 0) | 0],
|
|
1366
|
-
children: /* @__PURE__ */
|
|
2432
|
+
children: /* @__PURE__ */ O(wn, {
|
|
1367
2433
|
...r,
|
|
1368
2434
|
height: t,
|
|
1369
2435
|
showTimeAxis: i === e.length - 1
|
|
@@ -1371,256 +2437,340 @@ function Ie({ charts: e, height: t }) {
|
|
|
1371
2437
|
}, r.id))
|
|
1372
2438
|
});
|
|
1373
2439
|
}
|
|
1374
|
-
var
|
|
2440
|
+
var Dn = {
|
|
1375
2441
|
"x-default-marker": "x-default-marker",
|
|
1376
2442
|
$$css: !0
|
|
1377
2443
|
};
|
|
1378
|
-
function
|
|
1379
|
-
let
|
|
2444
|
+
function On({ title: t, description: n, series: r, timestampUnit: i, formatTimestamp: a, formatValue: o, formatTick: c = o, markers: u = [], height: d = 180, actions: f, report: m, kind: h, isStacked: y, sharedInspection: b, axisWidth: x, showTimeAxis: C = !0, bands: D = [], crossings: A = [] }) {
|
|
2445
|
+
let re = D[0]?.points.map((e) => e.timestamp) ?? [], ie = r[0]?.points.map((e) => e.timestamp) ?? re, N = !Number.isFinite(d) || d < 48 ? "Chart height must be at least 48 pixels." : Mt({
|
|
1380
2446
|
series: r,
|
|
1381
2447
|
isStacked: y,
|
|
1382
|
-
markers: u
|
|
1383
|
-
|
|
2448
|
+
markers: u,
|
|
2449
|
+
timeline: re
|
|
2450
|
+
}) ?? qt({
|
|
2451
|
+
bands: D,
|
|
2452
|
+
crossings: A,
|
|
2453
|
+
series: r,
|
|
2454
|
+
timestamps: ie
|
|
2455
|
+
}), P = T(() => N === void 0 ? It(r, y) : [], [
|
|
1384
2456
|
r,
|
|
1385
2457
|
y,
|
|
1386
|
-
|
|
1387
|
-
]),
|
|
2458
|
+
N
|
|
2459
|
+
]), F = T(() => N === void 0 ? Jt({
|
|
2460
|
+
series: r,
|
|
2461
|
+
bands: D
|
|
2462
|
+
}) : [], [
|
|
2463
|
+
r,
|
|
2464
|
+
D,
|
|
2465
|
+
N
|
|
2466
|
+
]), I = P[0]?.points ?? F[0]?.points ?? [], { ref: oe, width: se, element: de } = ee(), L = ne(null), [fe, R] = E(), pe = T(() => I.map(({ timestamp: e }) => ({
|
|
1388
2467
|
id: String(e),
|
|
1389
2468
|
label: a(e)
|
|
1390
|
-
})), [
|
|
2469
|
+
})), [I, a]), z = I.find((e) => e.timestamp === fe) ?? I[0], [B, me] = E(), V = `${Pt({
|
|
1391
2470
|
series: r,
|
|
1392
2471
|
markers: u,
|
|
1393
2472
|
timestampUnit: i,
|
|
1394
2473
|
isStacked: y
|
|
1395
|
-
})
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
2474
|
+
})}${vn({
|
|
2475
|
+
bands: D,
|
|
2476
|
+
crossings: A
|
|
2477
|
+
})}`, he = [...P.map(({ id: e, label: t, tone: n }) => ({
|
|
2478
|
+
id: e,
|
|
2479
|
+
label: t,
|
|
2480
|
+
tone: n
|
|
2481
|
+
})), ...F.map(({ id: e, label: t, tone: n }) => ({
|
|
2482
|
+
id: e,
|
|
2483
|
+
label: t,
|
|
2484
|
+
tone: n,
|
|
2485
|
+
shape: "band"
|
|
2486
|
+
}))], H = b === void 0 ? B?.signature === V ? B : void 0 : b.value, U = b === void 0 || b.isSource ? H : void 0, ge = m?.seriesValues !== void 0, W = w();
|
|
2487
|
+
B !== void 0 && (B.signature !== V || N !== void 0) && me(void 0);
|
|
2488
|
+
let _e = b !== void 0;
|
|
2489
|
+
if (te(() => {
|
|
2490
|
+
if (_e) return;
|
|
1400
2491
|
function e(e) {
|
|
1401
|
-
e.target instanceof Node &&
|
|
2492
|
+
e.target instanceof Node && L.current?.contains(e.target) !== !0 && me(void 0);
|
|
1402
2493
|
}
|
|
1403
2494
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1404
|
-
}, [
|
|
2495
|
+
}, [_e]), N !== void 0) return /* @__PURE__ */ O(g, {
|
|
1405
2496
|
title: t,
|
|
1406
2497
|
description: n,
|
|
1407
2498
|
report: m,
|
|
1408
|
-
message:
|
|
2499
|
+
message: N
|
|
1409
2500
|
});
|
|
1410
|
-
if (
|
|
2501
|
+
if (I.length === 0) return /* @__PURE__ */ O(p, {
|
|
1411
2502
|
title: t,
|
|
1412
2503
|
description: n,
|
|
1413
2504
|
actions: f,
|
|
1414
2505
|
report: m,
|
|
1415
|
-
series:
|
|
1416
|
-
children: /* @__PURE__ */
|
|
2506
|
+
series: he,
|
|
2507
|
+
children: /* @__PURE__ */ O("p", {
|
|
1417
2508
|
className: "x153jb6y",
|
|
1418
2509
|
children: "No observations"
|
|
1419
2510
|
})
|
|
1420
2511
|
});
|
|
1421
|
-
let
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
2512
|
+
let ve = I.map((e) => e.timestamp), ye = Zt({
|
|
2513
|
+
crossings: A,
|
|
2514
|
+
series: r,
|
|
2515
|
+
bands: D
|
|
2516
|
+
}), be = [...u.flatMap((e) => e.kind === "event" ? [e] : []), ...ye.flatMap(({ crossing: e, timestamp: t }) => t === void 0 ? [] : [{
|
|
2517
|
+
id: e.id,
|
|
2518
|
+
timestamp: t,
|
|
2519
|
+
label: e.label,
|
|
2520
|
+
value: e.value
|
|
2521
|
+
}])], xe = be.filter((e) => Qt(ve, e.timestamp) === U?.timestamp).map((e) => `${e.label} · ${a(e.timestamp)}`), Se = {
|
|
2522
|
+
label: U === void 0 ? void 0 : a(U.timestamp),
|
|
2523
|
+
rows: [...P.map((e) => {
|
|
2524
|
+
let t = e.points.find((e) => e.timestamp === U?.timestamp);
|
|
1425
2525
|
return {
|
|
1426
2526
|
id: e.id,
|
|
1427
2527
|
label: e.label,
|
|
1428
2528
|
tone: e.tone,
|
|
1429
2529
|
value: t?.value === null || t === void 0 ? "Unavailable" : o(t.value)
|
|
1430
2530
|
};
|
|
1431
|
-
}),
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
2531
|
+
}), ...yn({
|
|
2532
|
+
bands: F,
|
|
2533
|
+
timestamp: U?.timestamp,
|
|
2534
|
+
formatValue: o
|
|
2535
|
+
})],
|
|
2536
|
+
notes: [...u.filter((e) => e.kind !== "event" && e.timestamp === U?.timestamp).map((e) => e.label), ...xe]
|
|
2537
|
+
}, G = d - 28, Ce = G + 12, we = I[0]?.timestamp ?? 0, Te = I.at(-1)?.timestamp ?? we, K = [
|
|
2538
|
+
...P.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])),
|
|
2539
|
+
...$t(D),
|
|
2540
|
+
...A.map((e) => e.value)
|
|
2541
|
+
], Ee = h === "area" ? Math.min(0, ...K) : Math.min(...K), De = h === "area" ? Math.max(0, ...K) : Math.max(...K), q = Ft(K.length === 0 ? 0 : Ee, K.length === 0 ? 1 : De, h === "area"), Oe = j({
|
|
2542
|
+
domain: [...q],
|
|
2543
|
+
range: [G, 0]
|
|
2544
|
+
}), J = x ?? Math.max(44, ...Oe.ticks(3).map((e) => c(e).length * 7 + 12)), Y = Math.max(J + 1, se - 16), X = j({
|
|
2545
|
+
domain: [...Ft(we, Te)],
|
|
2546
|
+
range: [J, Y]
|
|
2547
|
+
}), ke = fn({
|
|
2548
|
+
instants: be,
|
|
2549
|
+
x: X,
|
|
2550
|
+
right: Y
|
|
2551
|
+
}), Z = pn(ke), Q = j({
|
|
2552
|
+
domain: [...q],
|
|
2553
|
+
range: [G, Z]
|
|
2554
|
+
}), Ae = Q.ticks(3);
|
|
2555
|
+
function je(e) {
|
|
2556
|
+
let t = de?.getBoundingClientRect();
|
|
1442
2557
|
if (t === void 0) return;
|
|
1443
|
-
let n =
|
|
1444
|
-
let r =
|
|
2558
|
+
let n = X.invert(e - t.left), r = I.find((e, t) => {
|
|
2559
|
+
let r = I[t + 1];
|
|
1445
2560
|
return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
|
|
1446
2561
|
});
|
|
1447
|
-
r !== void 0 &&
|
|
1448
|
-
signature:
|
|
2562
|
+
r !== void 0 && Me({
|
|
2563
|
+
signature: V,
|
|
1449
2564
|
timestamp: r.timestamp,
|
|
1450
2565
|
source: "pointer"
|
|
1451
2566
|
});
|
|
1452
2567
|
}
|
|
1453
|
-
function
|
|
1454
|
-
b === void 0 ?
|
|
2568
|
+
function Me(e) {
|
|
2569
|
+
b === void 0 ? me(e) : b.onChange(e);
|
|
1455
2570
|
}
|
|
1456
|
-
return /* @__PURE__ */
|
|
1457
|
-
ref:
|
|
2571
|
+
return /* @__PURE__ */ O("div", {
|
|
2572
|
+
ref: L,
|
|
1458
2573
|
className: "xeuugli",
|
|
1459
|
-
children: /* @__PURE__ */
|
|
1460
|
-
title:
|
|
2574
|
+
children: /* @__PURE__ */ k(p, {
|
|
2575
|
+
title: ge ? t : /* @__PURE__ */ O(ce, {
|
|
1461
2576
|
title: t,
|
|
1462
|
-
detail:
|
|
2577
|
+
detail: U === void 0 ? void 0 : a(U.timestamp)
|
|
1463
2578
|
}),
|
|
1464
2579
|
description: n,
|
|
1465
2580
|
report: m,
|
|
1466
|
-
series:
|
|
2581
|
+
series: he,
|
|
1467
2582
|
actions: f,
|
|
1468
|
-
children: [/* @__PURE__ */
|
|
2583
|
+
children: [/* @__PURE__ */ O(s, {
|
|
1469
2584
|
label: `${t} observations`,
|
|
1470
|
-
columns: [
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
2585
|
+
columns: [
|
|
2586
|
+
{
|
|
2587
|
+
id: "time",
|
|
2588
|
+
label: `Time (${i})`
|
|
2589
|
+
},
|
|
2590
|
+
...P.map((e) => ({
|
|
2591
|
+
id: `series:${e.id}`,
|
|
2592
|
+
label: e.label
|
|
2593
|
+
})),
|
|
2594
|
+
...F.flatMap((e) => [{
|
|
2595
|
+
id: `band:${e.id}`,
|
|
2596
|
+
label: e.label
|
|
2597
|
+
}, {
|
|
2598
|
+
id: `band-range:${e.id}`,
|
|
2599
|
+
label: `${e.label}: ${e.rangeLabel}`
|
|
2600
|
+
}])
|
|
2601
|
+
],
|
|
2602
|
+
rows: I.map((e, t) => ({
|
|
1478
2603
|
id: e.timestamp,
|
|
1479
|
-
values: [
|
|
2604
|
+
values: [
|
|
2605
|
+
a(e.timestamp),
|
|
2606
|
+
...P.map((e) => e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : o(e.points[t].value)),
|
|
2607
|
+
...yn({
|
|
2608
|
+
bands: F,
|
|
2609
|
+
timestamp: e.timestamp,
|
|
2610
|
+
formatValue: o
|
|
2611
|
+
}).map((e) => e.value)
|
|
2612
|
+
]
|
|
1480
2613
|
}))
|
|
1481
|
-
}), /* @__PURE__ */
|
|
2614
|
+
}), /* @__PURE__ */ k("div", {
|
|
1482
2615
|
className: "xrvj5dj x1n8ia3y",
|
|
1483
2616
|
children: [
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
id:
|
|
1486
|
-
label:
|
|
1487
|
-
legend:
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
width: N,
|
|
1495
|
-
source: B?.source,
|
|
1496
|
-
notes: he.notes,
|
|
1497
|
-
hasSeriesSummary: pe
|
|
2617
|
+
/* @__PURE__ */ O(ue, {
|
|
2618
|
+
id: W,
|
|
2619
|
+
label: Se.label,
|
|
2620
|
+
legend: he,
|
|
2621
|
+
rows: Se.rows,
|
|
2622
|
+
x: X(H?.timestamp ?? we),
|
|
2623
|
+
width: se,
|
|
2624
|
+
source: U?.source,
|
|
2625
|
+
notes: Se.notes,
|
|
2626
|
+
hasSeriesSummary: ge
|
|
1498
2627
|
}),
|
|
1499
|
-
/* @__PURE__ */
|
|
1500
|
-
ref:
|
|
1501
|
-
...
|
|
1502
|
-
children: [/* @__PURE__ */
|
|
2628
|
+
/* @__PURE__ */ k("div", {
|
|
2629
|
+
ref: oe,
|
|
2630
|
+
...S.props(v.plot),
|
|
2631
|
+
children: [/* @__PURE__ */ k(l, {
|
|
1503
2632
|
role: "img",
|
|
1504
2633
|
"aria-label": `${t}. Use arrow keys to inspect observations.`,
|
|
1505
|
-
"aria-describedby":
|
|
2634
|
+
"aria-describedby": W,
|
|
1506
2635
|
tabIndex: 0,
|
|
1507
|
-
viewBox: `0 0 ${
|
|
1508
|
-
height:
|
|
2636
|
+
viewBox: `0 0 ${se} ${Ce}`,
|
|
2637
|
+
height: Ce,
|
|
1509
2638
|
controls: {
|
|
1510
|
-
items:
|
|
1511
|
-
cursor:
|
|
1512
|
-
inspected:
|
|
1513
|
-
readout:
|
|
2639
|
+
items: pe,
|
|
2640
|
+
cursor: z === void 0 ? void 0 : String(z.timestamp),
|
|
2641
|
+
inspected: U === void 0 ? void 0 : String(U.timestamp),
|
|
2642
|
+
readout: le(Se),
|
|
1514
2643
|
onInspect: (e) => {
|
|
1515
2644
|
let t = Number(e);
|
|
1516
|
-
|
|
1517
|
-
signature:
|
|
2645
|
+
R(t), Me({
|
|
2646
|
+
signature: V,
|
|
1518
2647
|
timestamp: t,
|
|
1519
2648
|
source: "keyboard"
|
|
1520
2649
|
});
|
|
1521
2650
|
},
|
|
1522
|
-
onDismiss: () =>
|
|
2651
|
+
onDismiss: () => Me(void 0)
|
|
1523
2652
|
},
|
|
1524
2653
|
onFocus: (e) => {
|
|
1525
2654
|
if (e.currentTarget.matches(":focus-visible")) {
|
|
1526
|
-
let e =
|
|
1527
|
-
|
|
1528
|
-
signature:
|
|
2655
|
+
let e = H?.timestamp ?? we;
|
|
2656
|
+
R(e), Me({
|
|
2657
|
+
signature: V,
|
|
1529
2658
|
timestamp: e,
|
|
1530
2659
|
source: "keyboard"
|
|
1531
2660
|
});
|
|
1532
2661
|
}
|
|
1533
2662
|
},
|
|
1534
2663
|
onPointerMove: (e) => {
|
|
1535
|
-
e.pointerType === "mouse" &&
|
|
2664
|
+
e.pointerType === "mouse" && je(e.clientX);
|
|
1536
2665
|
},
|
|
1537
|
-
onPointerDown: (e) =>
|
|
2666
|
+
onPointerDown: (e) => je(e.clientX),
|
|
1538
2667
|
onPointerLeave: (e) => {
|
|
1539
|
-
e.pointerType === "mouse" &&
|
|
2668
|
+
e.pointerType === "mouse" && H?.source === "pointer" && Me(void 0);
|
|
1540
2669
|
},
|
|
1541
|
-
onBlur: () =>
|
|
1542
|
-
...
|
|
2670
|
+
onBlur: () => Me(void 0),
|
|
2671
|
+
...S.props(v.svg, v.inspectable, Dn),
|
|
1543
2672
|
children: [
|
|
1544
|
-
|
|
1545
|
-
x1:
|
|
1546
|
-
x2:
|
|
1547
|
-
y1:
|
|
1548
|
-
y2:
|
|
1549
|
-
...
|
|
1550
|
-
}), /* @__PURE__ */
|
|
1551
|
-
x:
|
|
1552
|
-
y:
|
|
2673
|
+
Ae.map((e) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
|
|
2674
|
+
x1: J,
|
|
2675
|
+
x2: Y,
|
|
2676
|
+
y1: Q(e),
|
|
2677
|
+
y2: Q(e),
|
|
2678
|
+
...S.props(v.grid)
|
|
2679
|
+
}), /* @__PURE__ */ O("text", {
|
|
2680
|
+
x: J - 8,
|
|
2681
|
+
y: Q(e),
|
|
1553
2682
|
textAnchor: "end",
|
|
1554
2683
|
dominantBaseline: "middle",
|
|
1555
|
-
...
|
|
2684
|
+
...S.props(v.label),
|
|
1556
2685
|
children: c(e)
|
|
1557
2686
|
})] }, e)),
|
|
1558
|
-
A.map((
|
|
2687
|
+
A.map((e) => /* @__PURE__ */ O("line", {
|
|
2688
|
+
x1: J,
|
|
2689
|
+
x2: Y,
|
|
2690
|
+
y1: Q(e.value),
|
|
2691
|
+
y2: Q(e.value),
|
|
2692
|
+
...S.props(v.baseline)
|
|
2693
|
+
}, e.id)),
|
|
2694
|
+
/* @__PURE__ */ O(hn, {
|
|
2695
|
+
bands: F,
|
|
2696
|
+
x: X,
|
|
2697
|
+
y: Q
|
|
2698
|
+
}),
|
|
2699
|
+
P.map((t) => /* @__PURE__ */ k("g", { children: [h === "area" && /* @__PURE__ */ O(M, {
|
|
1559
2700
|
data: [...t.points],
|
|
1560
2701
|
defined: (e) => e.value !== null,
|
|
1561
|
-
x: (e) =>
|
|
1562
|
-
y0: (e) =>
|
|
1563
|
-
y1: (e) =>
|
|
1564
|
-
yScale:
|
|
2702
|
+
x: (e) => X(e.timestamp),
|
|
2703
|
+
y0: (e) => Q(e.base),
|
|
2704
|
+
y1: (e) => Q((e.value ?? 0) + e.base),
|
|
2705
|
+
yScale: Q,
|
|
1565
2706
|
fill: e[t.tone],
|
|
1566
|
-
fillOpacity: y ? .65 : .
|
|
1567
|
-
}), /* @__PURE__ */
|
|
2707
|
+
fillOpacity: y ? .65 : .12
|
|
2708
|
+
}), /* @__PURE__ */ O(Rt, {
|
|
1568
2709
|
series: t,
|
|
1569
|
-
x:
|
|
1570
|
-
y:
|
|
1571
|
-
inspectedTimestamp:
|
|
2710
|
+
x: X,
|
|
2711
|
+
y: Q,
|
|
2712
|
+
inspectedTimestamp: H?.timestamp
|
|
1572
2713
|
})] }, t.id)),
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
2714
|
+
/* @__PURE__ */ O(gn, {
|
|
2715
|
+
placed: ke,
|
|
2716
|
+
x: X,
|
|
2717
|
+
y: Q,
|
|
2718
|
+
bottom: G
|
|
2719
|
+
}),
|
|
2720
|
+
u.filter((e) => e.kind !== "event").map((e) => /* @__PURE__ */ k("g", { children: [e.kind === "time" ? /* @__PURE__ */ O("line", {
|
|
2721
|
+
x1: X(e.timestamp),
|
|
2722
|
+
x2: X(e.timestamp),
|
|
2723
|
+
y1: Z,
|
|
2724
|
+
y2: G,
|
|
1578
2725
|
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
1579
|
-
}) : /* @__PURE__ */
|
|
1580
|
-
cx:
|
|
1581
|
-
cy:
|
|
2726
|
+
}) : /* @__PURE__ */ O("circle", {
|
|
2727
|
+
cx: X(e.timestamp),
|
|
2728
|
+
cy: Q(e.value + (P.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
|
|
1582
2729
|
r: 4,
|
|
1583
2730
|
fill: _.surface,
|
|
1584
|
-
...
|
|
1585
|
-
}), /* @__PURE__ */
|
|
1586
|
-
|
|
1587
|
-
x1:
|
|
1588
|
-
x2:
|
|
1589
|
-
y1:
|
|
1590
|
-
y2:
|
|
2731
|
+
...S.props(v.selected)
|
|
2732
|
+
}), /* @__PURE__ */ O("title", { children: e.kind === "point" ? `${e.label}: ${o(e.value)}` : e.label })] }, e.id)),
|
|
2733
|
+
H !== void 0 && /* @__PURE__ */ O("line", {
|
|
2734
|
+
x1: X(H.timestamp),
|
|
2735
|
+
x2: X(H.timestamp),
|
|
2736
|
+
y1: Z,
|
|
2737
|
+
y2: G,
|
|
1591
2738
|
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
1592
2739
|
}),
|
|
1593
|
-
|
|
1594
|
-
x:
|
|
1595
|
-
top:
|
|
1596
|
-
bottom:
|
|
1597
|
-
width: Math.min(16, (
|
|
2740
|
+
z !== void 0 && /* @__PURE__ */ O(ae, {
|
|
2741
|
+
x: X(z.timestamp),
|
|
2742
|
+
top: Z,
|
|
2743
|
+
bottom: G,
|
|
2744
|
+
width: Math.min(16, (Y - J) / 2)
|
|
1598
2745
|
})
|
|
1599
2746
|
]
|
|
1600
|
-
}),
|
|
2747
|
+
}), C && /* @__PURE__ */ k("div", {
|
|
1601
2748
|
"aria-hidden": !0,
|
|
1602
|
-
...
|
|
1603
|
-
children: [/* @__PURE__ */
|
|
2749
|
+
...S.props(_n.timeAxis, _n.timeAxisInset(J, Math.max(0, se - Y))),
|
|
2750
|
+
children: [/* @__PURE__ */ O("span", {
|
|
1604
2751
|
className: "x1cqoux5 xeuugli xj0a0fe",
|
|
1605
|
-
children: a(
|
|
1606
|
-
}),
|
|
2752
|
+
children: a(we)
|
|
2753
|
+
}), Te !== we && /* @__PURE__ */ O("span", {
|
|
1607
2754
|
className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
|
|
1608
|
-
children: a(
|
|
2755
|
+
children: a(Te)
|
|
1609
2756
|
})]
|
|
1610
2757
|
})]
|
|
1611
2758
|
}),
|
|
1612
|
-
u.length > 0 && /* @__PURE__ */
|
|
2759
|
+
u.length + ye.length > 0 && /* @__PURE__ */ k("ul", {
|
|
1613
2760
|
className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
|
|
1614
|
-
children: u.map((e) => /* @__PURE__ */
|
|
2761
|
+
children: [u.map((e) => /* @__PURE__ */ k("li", { children: [
|
|
1615
2762
|
a(e.timestamp),
|
|
1616
2763
|
" · ",
|
|
1617
2764
|
e.label,
|
|
1618
2765
|
e.kind === "point" && ` · ${o(e.value)}`
|
|
1619
|
-
] }, e.id))
|
|
2766
|
+
] }, e.id)), ye.map((e) => /* @__PURE__ */ O("li", { children: bn({
|
|
2767
|
+
found: e,
|
|
2768
|
+
formatTimestamp: a
|
|
2769
|
+
}) }, e.crossing.id))]
|
|
1620
2770
|
})
|
|
1621
2771
|
]
|
|
1622
2772
|
})]
|
|
1623
2773
|
})
|
|
1624
2774
|
});
|
|
1625
2775
|
}
|
|
1626
|
-
export {
|
|
2776
|
+
export { Sn as AreaChart, Ge as BarChart, Ve as BarChartPlaceholder, Ye as BreakdownBar, gt as BridgeChart, xn as LineChart, St as MAX_SCATTER_POINTS, Tt as ScatterPlot, Tn as SmallMultiples, En as SmallMultiplesPlaceholder, Ht as Sparkline, Cn as TimeSeriesChartPlaceholder, Wt as timeSeriesBandLimits, $ as timeSeriesLimits };
|