@mechane-ai/elements 0.59.0 → 0.61.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 +54 -53
- package/dist/ai.js +269 -200
- package/dist/catalog.json +41 -1
- package/dist/chart-range-Du1gDxCY.js +163 -0
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/figure.js +2 -2
- package/dist/charts/timeline.js +3 -1
- package/dist/kits/operations.js +2 -2
- package/dist/kits/research.js +1 -1
- package/dist/packages/ai/src/command-activity.d.ts +5 -1
- package/dist/packages/ai/src/index.d.ts +1 -1
- package/dist/packages/ai/src/message.d.ts +9 -1
- package/dist/packages/charts/src/timeline/index.d.ts +5 -1
- package/dist/packages/charts/src/timeline/trace-timeline-layout.d.ts +106 -0
- package/dist/packages/charts/src/timeline/trace-timeline.d.ts +39 -0
- package/dist/packages/charts/src/timeline/waterfall.d.ts +23 -7
- package/dist/styles2.css +67 -7
- package/dist/{time-series-CoAtNizi.js → time-series-BbUBF3IE.js} +521 -679
- package/dist/timeline-kDb6bY7M.js +712 -0
- package/dist/waterfall-Dre6i02Z.js +684 -0
- package/package.json +1 -1
- package/dist/waterfall-BjUXqaWu.js +0 -615
|
@@ -17,14 +17,14 @@ import { a as I, c as L, d as R, f as z, i as fe, l as pe, n as B, o as me, r as
|
|
|
17
17
|
import { n as _e, r as ve, t as ye } from "./plot-surface-BlR44uTL.js";
|
|
18
18
|
import { n as be, t as xe } from "./reference-lines-BDfsv8dy.js";
|
|
19
19
|
import { n as Se, r as H, t as Ce } from "./path-BglsXpnO.js";
|
|
20
|
-
import { t as we } from "./
|
|
21
|
-
import
|
|
22
|
-
import
|
|
20
|
+
import { t as we } from "./chart-range-Du1gDxCY.js";
|
|
21
|
+
import { t as U } from "./locate-Bcg3QcP4.js";
|
|
22
|
+
import * as W from "@stylexjs/stylex";
|
|
23
23
|
import { useEffect as G, useId as Te, useRef as K, useState as Ee } from "react";
|
|
24
|
-
import { bindDrag as De,
|
|
25
|
-
import { Fragment as
|
|
24
|
+
import { bindDrag as De, dispatch as Oe } from "@ui-sdk/core";
|
|
25
|
+
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
26
26
|
// packages/charts/src/cartesian/bar-data.ts
|
|
27
|
-
function
|
|
27
|
+
function ke({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
28
28
|
if (e === void 0) return;
|
|
29
29
|
if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
|
|
30
30
|
let i = e.annotation;
|
|
@@ -41,26 +41,26 @@ function Q({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
var
|
|
45
|
-
function
|
|
44
|
+
var X = 6;
|
|
45
|
+
function Z(e, t) {
|
|
46
46
|
return e === null ? !0 : e === void 0 || !Number.isFinite(e) ? !1 : e >= t[0] && e <= t[1];
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Q({ marker: e, categoryCount: t, domain: n }) {
|
|
49
49
|
let r = e.kind === "tick" ? [e.values] : [e.lower, e.upper];
|
|
50
50
|
if (r.some((e) => e.length !== t)) return "Every bar marker requires one explicit value per category.";
|
|
51
|
-
if (r.some((e) => e.some((e) => !
|
|
51
|
+
if (r.some((e) => e.some((e) => !Z(e, n)))) return "Bar marker values must be finite and within the supplied domain.";
|
|
52
52
|
if (e.kind === "range") for (let [t, n] of e.lower.entries()) {
|
|
53
53
|
let r = e.upper[t] ?? null;
|
|
54
54
|
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.";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
if (e.length >
|
|
57
|
+
function Ae({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r, categoryIds: i, domain: a }) {
|
|
58
|
+
if (e.length > X) return `Supply at most ${X} bar markers.`;
|
|
59
59
|
let o = [...e, ...t];
|
|
60
60
|
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.";
|
|
61
61
|
for (let t of e) {
|
|
62
62
|
if (!r.includes(t.seriesId)) return "Each bar marker must refer to a supplied series.";
|
|
63
|
-
let e =
|
|
63
|
+
let e = Q({
|
|
64
64
|
marker: t,
|
|
65
65
|
categoryCount: i.length,
|
|
66
66
|
domain: a
|
|
@@ -74,25 +74,25 @@ function Ne({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r
|
|
|
74
74
|
if (new Set(t.map((e) => JSON.stringify([e.categoryId, e.seriesId ?? null]))).size !== t.length) return "Each bar can hold one annotation.";
|
|
75
75
|
if (new Set(n).size !== n.length || n.some((e) => !i.includes(e))) return "Emphasized categories must be unique supplied categories.";
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function je({ marker: e, index: t, valueText: n }) {
|
|
78
78
|
if (e.kind === "tick") return n(e.values[t] ?? null);
|
|
79
79
|
let r = e.lower[t] ?? null, i = e.upper[t] ?? null;
|
|
80
80
|
return r === null || i === null ? n(null) : `${n(r)} – ${n(i)}`;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Me(e, t) {
|
|
83
83
|
return e.kind === "tick" ? e.values[t] ?? null : e.upper[t] ?? null;
|
|
84
84
|
}
|
|
85
85
|
// packages/charts/src/cartesian/value-labels.ts
|
|
86
|
-
var
|
|
87
|
-
function
|
|
88
|
-
let n = (e.text.length + t.text.length) *
|
|
89
|
-
return Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) <
|
|
86
|
+
var Ne = 6.5, Pe = 14, Fe = 6, Ie = .5;
|
|
87
|
+
function Le(e, t) {
|
|
88
|
+
let n = (e.text.length + t.text.length) * Ne * Ie + Fe;
|
|
89
|
+
return Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) < Pe;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return e.filter((t, n) => e.slice(0, n).every((e) => !
|
|
91
|
+
function Re(e) {
|
|
92
|
+
return e.filter((t, n) => e.slice(0, n).every((e) => !Le(t, e)));
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
let i = t.length *
|
|
94
|
+
function ze({ x: e, text: t, left: n, right: r }) {
|
|
95
|
+
let i = t.length * Ne * Ie;
|
|
96
96
|
return e - i < n ? {
|
|
97
97
|
x: n,
|
|
98
98
|
anchor: "start"
|
|
@@ -105,16 +105,16 @@ function He({ x: e, text: t, left: n, right: r }) {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
// packages/charts/src/cartesian/bar-overlays.tsx
|
|
108
|
-
var
|
|
109
|
-
function
|
|
110
|
-
let a = n.x + n.width *
|
|
108
|
+
var Be = 3, Ve = 14, He = .6, Ue = .5;
|
|
109
|
+
function We({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
110
|
+
let a = n.x + n.width * Ue;
|
|
111
111
|
if (e.kind === "tick") {
|
|
112
112
|
let o = e.values[t] ?? null;
|
|
113
113
|
if (o === null) return [];
|
|
114
114
|
let s = {
|
|
115
115
|
key: "tick",
|
|
116
|
-
x1: n.x -
|
|
117
|
-
x2: n.x + n.width +
|
|
116
|
+
x1: n.x - Be,
|
|
117
|
+
x2: n.x + n.width + Be,
|
|
118
118
|
y1: i(o),
|
|
119
119
|
y2: i(o)
|
|
120
120
|
};
|
|
@@ -128,7 +128,7 @@ function qe({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
|
128
128
|
}
|
|
129
129
|
let o = e.lower[t] ?? null, s = e.upper[t] ?? null;
|
|
130
130
|
if (o === null || s === null) return [];
|
|
131
|
-
let c = Math.min(
|
|
131
|
+
let c = Math.min(Ve, n.width * He) * Ue;
|
|
132
132
|
return [
|
|
133
133
|
{
|
|
134
134
|
key: "whisker",
|
|
@@ -153,37 +153,37 @@ function qe({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
|
153
153
|
}
|
|
154
154
|
];
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
return /* @__PURE__ */
|
|
158
|
-
let s =
|
|
156
|
+
function Ge({ markers: e, categoryIds: t, span: n, barTop: r, y: i, isReceded: a }) {
|
|
157
|
+
return /* @__PURE__ */ J("g", { children: e.map((e) => /* @__PURE__ */ J("g", { children: t.map((t, o) => {
|
|
158
|
+
let s = We({
|
|
159
159
|
marker: e,
|
|
160
160
|
index: o,
|
|
161
161
|
span: n(t, e.seriesId),
|
|
162
162
|
base: r(o, e.seriesId),
|
|
163
163
|
y: i
|
|
164
164
|
});
|
|
165
|
-
return /* @__PURE__ */
|
|
166
|
-
...
|
|
167
|
-
children: s.map(({ key: t, ...n }) => /* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ J("g", {
|
|
166
|
+
...W.props(P.emphasis, a(t) && P.receded),
|
|
167
|
+
children: s.map(({ key: t, ...n }) => /* @__PURE__ */ J(he, {
|
|
168
168
|
...n,
|
|
169
169
|
tone: e.tone ?? "neutral"
|
|
170
170
|
}, t))
|
|
171
171
|
}, t);
|
|
172
172
|
}) }, e.id)) });
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
return /* @__PURE__ */
|
|
174
|
+
function Ke({ annotations: e, left: t, right: n }) {
|
|
175
|
+
return /* @__PURE__ */ J("g", {
|
|
176
176
|
"aria-hidden": !0,
|
|
177
|
-
children:
|
|
178
|
-
let r =
|
|
177
|
+
children: Re(e).map((e) => {
|
|
178
|
+
let r = ze({
|
|
179
179
|
x: e.x,
|
|
180
180
|
text: e.text,
|
|
181
181
|
left: t,
|
|
182
182
|
right: n
|
|
183
183
|
});
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
-
...
|
|
186
|
-
children: /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ J("g", {
|
|
185
|
+
...W.props(P.emphasis, e.isReceded && P.receded),
|
|
186
|
+
children: /* @__PURE__ */ J(L, {
|
|
187
187
|
x: r.x,
|
|
188
188
|
y: e.y,
|
|
189
189
|
anchor: r.anchor,
|
|
@@ -194,7 +194,7 @@ function Ye({ annotations: e, left: t, right: n }) {
|
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
// packages/charts/src/cartesian/composition-bars.tsx
|
|
197
|
-
var
|
|
197
|
+
var qe = {
|
|
198
198
|
mark: {
|
|
199
199
|
k3nNDw: "x1hj3fc7",
|
|
200
200
|
k1ekBW: "xwcsmn1",
|
|
@@ -210,17 +210,17 @@ var Xe = {
|
|
|
210
210
|
"--x-transform": e ?? void 0,
|
|
211
211
|
"--x-opacity": t ?? void 0
|
|
212
212
|
}]
|
|
213
|
-
},
|
|
214
|
-
function
|
|
213
|
+
}, Je = .18, Ye = .3;
|
|
214
|
+
function Xe({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a, y: o, isSelected: s, isInspected: c, highlighted: l, toneOf: u }) {
|
|
215
215
|
let d = n !== void 0, f = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
|
|
216
216
|
function p(e, t) {
|
|
217
217
|
let n = o(t), r = o(t + e);
|
|
218
218
|
return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0 && t === 0), Math.abs(r - n))})`;
|
|
219
219
|
}
|
|
220
|
-
let m = d ?
|
|
221
|
-
return /* @__PURE__ */
|
|
222
|
-
...
|
|
223
|
-
children: /* @__PURE__ */
|
|
220
|
+
let m = d ? Je : +(e.kind === "total");
|
|
221
|
+
return /* @__PURE__ */ Y(q, { children: [e.kind !== "gap" && /* @__PURE__ */ J("g", {
|
|
222
|
+
...W.props(qe.mark, qe.geometry(p(e.total, 0), m)),
|
|
223
|
+
children: /* @__PURE__ */ J(V, {
|
|
224
224
|
x: i,
|
|
225
225
|
y: 0,
|
|
226
226
|
width: a,
|
|
@@ -232,10 +232,10 @@ function $e({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a,
|
|
|
232
232
|
}), f.map((o, f) => {
|
|
233
233
|
let m = o.values[r];
|
|
234
234
|
if (m == null) return null;
|
|
235
|
-
let h = d ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), ee = d ? n.id === o.id : e.kind === "parts", g = l != null && l !== o.id, _ = ee ? !d && g ?
|
|
236
|
-
return /* @__PURE__ */
|
|
237
|
-
...
|
|
238
|
-
children: /* @__PURE__ */
|
|
235
|
+
let h = d ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), ee = d ? n.id === o.id : e.kind === "parts", g = l != null && l !== o.id, _ = ee ? !d && g ? Ye : 1 : 0;
|
|
236
|
+
return /* @__PURE__ */ J("g", {
|
|
237
|
+
...W.props(qe.mark, qe.geometry(p(m, h), _)),
|
|
238
|
+
children: /* @__PURE__ */ J(V, {
|
|
239
239
|
x: i,
|
|
240
240
|
y: 0,
|
|
241
241
|
width: a,
|
|
@@ -248,16 +248,16 @@ function $e({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a,
|
|
|
248
248
|
})] });
|
|
249
249
|
}
|
|
250
250
|
// packages/charts/src/cartesian/bar-chart.tsx
|
|
251
|
-
var
|
|
251
|
+
var Ze = { placeholder: {
|
|
252
252
|
kqGvvJ: "x1we84gm",
|
|
253
253
|
$$css: !0
|
|
254
|
-
} },
|
|
255
|
-
function
|
|
254
|
+
} }, Qe = 18, $e = 8, et = 14, tt = .08, nt = 8, rt = 8, it = .5;
|
|
255
|
+
function at({ legend: e, layoutLegend: t, notes: n, children: r, inspectionId: i, label: a, summary: o, rows: s = [], x: c = 0, width: l = 0, offset: u, data: d, isLoading: f = !1, ...p }) {
|
|
256
256
|
let m = f && e.length === 0 && p.report?.seriesValues === void 0;
|
|
257
|
-
return /* @__PURE__ */
|
|
257
|
+
return /* @__PURE__ */ Y(ce, {
|
|
258
258
|
...p,
|
|
259
259
|
series: e,
|
|
260
|
-
seriesLegend: m ? /* @__PURE__ */
|
|
260
|
+
seriesLegend: m ? /* @__PURE__ */ J(N, {}) : /* @__PURE__ */ J(M, {
|
|
261
261
|
id: i,
|
|
262
262
|
label: a,
|
|
263
263
|
summary: o,
|
|
@@ -270,10 +270,10 @@ function ct({ legend: e, layoutLegend: t, notes: n, children: r, inspectionId: i
|
|
|
270
270
|
width: l,
|
|
271
271
|
offset: u
|
|
272
272
|
}),
|
|
273
|
-
children: [d !== void 0 && /* @__PURE__ */
|
|
273
|
+
children: [d !== void 0 && /* @__PURE__ */ J(se, { ...d }), r]
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function ot() {
|
|
277
277
|
let e = T();
|
|
278
278
|
return (t) => t.map((t, n) => ({
|
|
279
279
|
id: t.id,
|
|
@@ -285,29 +285,29 @@ function lt() {
|
|
|
285
285
|
})
|
|
286
286
|
}));
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
let a = Te(), o =
|
|
290
|
-
return /* @__PURE__ */
|
|
288
|
+
function st({ title: e = "Loading chart", series: t = [], height: n = "compact", ...r }) {
|
|
289
|
+
let a = Te(), o = ot()(t);
|
|
290
|
+
return /* @__PURE__ */ J("div", {
|
|
291
291
|
"aria-hidden": !0,
|
|
292
292
|
inert: !0,
|
|
293
|
-
children: /* @__PURE__ */
|
|
293
|
+
children: /* @__PURE__ */ J(at, {
|
|
294
294
|
...r,
|
|
295
295
|
title: e,
|
|
296
296
|
status: "loading",
|
|
297
297
|
legend: o,
|
|
298
298
|
inspectionId: a,
|
|
299
299
|
isLoading: !0,
|
|
300
|
-
children: /* @__PURE__ */
|
|
301
|
-
...
|
|
302
|
-
children: /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ J("div", {
|
|
301
|
+
...W.props(P.plot, Ze.placeholder),
|
|
302
|
+
children: /* @__PURE__ */ J(i, { height: m[n] })
|
|
303
303
|
})
|
|
304
304
|
})
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function ct(e, t) {
|
|
308
308
|
return Array.from({ length: t }, (t, n) => e.reduce((e, t) => e + Math.max(0, t.values[n] ?? 0), 0));
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function lt({ categories: e, series: t, domain: n, mode: r }) {
|
|
311
311
|
if (e.length > S.items || t.length > S.series) return `Choose a window with at most ${S.items} categories and ${S.series} series.`;
|
|
312
312
|
if (k(n) !== void 0 || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
|
|
313
313
|
if (!u(e) || !u(t)) return "Bar categories and series require unique identifiers.";
|
|
@@ -316,10 +316,10 @@ function ft({ categories: e, series: t, domain: n, mode: r }) {
|
|
|
316
316
|
if (i.values.some((e) => e !== null && D(e, n))) return "Bar values must be finite and within the supplied domain.";
|
|
317
317
|
if (r === "stacked" && i.values.some((e) => e === null || e < 0)) return "Stacked bars require present nonnegative values.";
|
|
318
318
|
}
|
|
319
|
-
if (r === "stacked" &&
|
|
319
|
+
if (r === "stacked" && ct(t, e.length).some((e) => e > n[1])) return "Stacked bar totals must fit the supplied domain.";
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
let o = n === "stacked" || r !== void 0, s = t.flatMap((e) => e.values), c = o ?
|
|
321
|
+
function ut({ categories: e, series: t, mode: n, composition: r, referenceLines: i, markers: a }) {
|
|
322
|
+
let o = n === "stacked" || r !== void 0, s = t.flatMap((e) => e.values), c = o ? ct(t, e.length) : [], l = r?.focusedSeries?.values ?? [], u = r?.buckets.map((e) => e.kind === "gap" ? null : e.total) ?? [], d = a.flatMap((e) => e.kind === "tick" ? e.values : [...e.lower, ...e.upper]);
|
|
323
323
|
return [
|
|
324
324
|
...s,
|
|
325
325
|
...c,
|
|
@@ -330,15 +330,15 @@ function pt({ categories: e, series: t, mode: n, composition: r, referenceLines:
|
|
|
330
330
|
...r?.annotation === void 0 ? [] : [r.annotation.value]
|
|
331
331
|
];
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
let { emptyLabel: b = "No categories", ...te } = y, { locale: x, title: S } = te, C = p?.focusedSeries, w = Te(), ne = Te(), { ref: E, width: D, height: O } = ve(d), k = T(), A =
|
|
335
|
-
if (te.status === "loading") return /* @__PURE__ */
|
|
333
|
+
function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFormat: i, tickFormat: a, valueLabel: o, highlighted: s, selected: c, onSelectedChange: u, height: d = "compact", composition: p, referenceLines: m = [], markers: g = [], annotations: _ = [], emphasizedCategoryIds: v = [], ...y }) {
|
|
334
|
+
let { emptyLabel: b = "No categories", ...te } = y, { locale: x, title: S } = te, C = p?.focusedSeries, w = Te(), ne = Te(), { ref: E, width: D, height: O } = ve(d), k = T(), A = ot();
|
|
335
|
+
if (te.status === "loading") return /* @__PURE__ */ J(st, {
|
|
336
336
|
...te,
|
|
337
337
|
series: t,
|
|
338
338
|
height: d
|
|
339
339
|
});
|
|
340
340
|
let j = n ?? f({
|
|
341
|
-
values:
|
|
341
|
+
values: ut({
|
|
342
342
|
categories: e,
|
|
343
343
|
series: t,
|
|
344
344
|
mode: r,
|
|
@@ -347,17 +347,17 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
347
347
|
markers: g
|
|
348
348
|
}),
|
|
349
349
|
isZeroBased: !0
|
|
350
|
-
}), se = C === void 0 ? void 0 :
|
|
350
|
+
}), se = C === void 0 ? void 0 : lt({
|
|
351
351
|
categories: e,
|
|
352
352
|
series: [C],
|
|
353
353
|
domain: j,
|
|
354
354
|
mode: "grouped"
|
|
355
|
-
}), ce =
|
|
355
|
+
}), ce = lt({
|
|
356
356
|
categories: e,
|
|
357
357
|
series: t,
|
|
358
358
|
domain: j,
|
|
359
359
|
mode: r
|
|
360
|
-
}) ?? se, M = e.map((e) => e.id), N =
|
|
360
|
+
}) ?? se, M = e.map((e) => e.id), N = Ae({
|
|
361
361
|
markers: g,
|
|
362
362
|
annotations: _,
|
|
363
363
|
emphasizedCategoryIds: v,
|
|
@@ -367,13 +367,13 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
367
367
|
}) ?? be({
|
|
368
368
|
lines: m,
|
|
369
369
|
domain: j
|
|
370
|
-
}), F = ce ??
|
|
370
|
+
}), F = ce ?? ke({
|
|
371
371
|
composition: p,
|
|
372
372
|
series: t,
|
|
373
373
|
categoryIds: M,
|
|
374
374
|
domain: j
|
|
375
375
|
}) ?? N;
|
|
376
|
-
if (F !== void 0) return /* @__PURE__ */
|
|
376
|
+
if (F !== void 0) return /* @__PURE__ */ J(le, {
|
|
377
377
|
...te,
|
|
378
378
|
message: F
|
|
379
379
|
});
|
|
@@ -418,7 +418,7 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
418
418
|
label: e.label,
|
|
419
419
|
tone: e.tone ?? "neutral",
|
|
420
420
|
shape: e.kind,
|
|
421
|
-
value:
|
|
421
|
+
value: je({
|
|
422
422
|
marker: e,
|
|
423
423
|
index: n,
|
|
424
424
|
valueText: I
|
|
@@ -457,21 +457,21 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
457
457
|
},
|
|
458
458
|
valueDomain: j,
|
|
459
459
|
locale: x,
|
|
460
|
-
topInset: Ce ?
|
|
460
|
+
topInset: Ce ? Qe : 0,
|
|
461
461
|
hasValueTitle: o !== void 0
|
|
462
|
-
}), { box:
|
|
462
|
+
}), { box: U, band: G } = we, K = we.value.position, Ee = ie({
|
|
463
463
|
ids: t.map((e) => e.id),
|
|
464
464
|
range: [0, G.bandwidth],
|
|
465
|
-
padding:
|
|
465
|
+
padding: tt
|
|
466
466
|
}), De = r === "stacked" || p !== void 0;
|
|
467
|
-
function q(e) {
|
|
468
|
-
return G.start(e) ?? W.left;
|
|
469
|
-
}
|
|
470
467
|
function Oe(e) {
|
|
471
|
-
return
|
|
468
|
+
return G.start(e) ?? U.left;
|
|
469
|
+
}
|
|
470
|
+
function q(e) {
|
|
471
|
+
return Oe(e) + G.bandwidth * it;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
let n =
|
|
473
|
+
function X(e, t) {
|
|
474
|
+
let n = Oe(e);
|
|
475
475
|
return De ? {
|
|
476
476
|
x: n,
|
|
477
477
|
width: G.bandwidth
|
|
@@ -480,19 +480,19 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
480
480
|
width: Ee.bandwidth
|
|
481
481
|
};
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function Z(e, n) {
|
|
484
484
|
if (!De) return t.find((e) => e.id === n)?.values[e] ?? null;
|
|
485
485
|
let r = t.flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null));
|
|
486
486
|
return r.length === 0 ? null : r.reduce((e, t) => e + t, 0);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
489
|
-
let r = (n === void 0 ? t : t.filter((e) => e.id === n)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), i = De ? r.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...r), a = p?.buckets[e], o = a === void 0 || a.kind === "gap" ? 0 : a.total, s = g.filter((e) => n === void 0 || e.seriesId === n).flatMap((t) => [
|
|
488
|
+
function Q(e, n) {
|
|
489
|
+
let r = (n === void 0 ? t : t.filter((e) => e.id === n)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), i = De ? r.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...r), a = p?.buckets[e], o = a === void 0 || a.kind === "gap" ? 0 : a.total, s = g.filter((e) => n === void 0 || e.seriesId === n).flatMap((t) => [Me(t, e)].filter((e) => e !== null));
|
|
490
490
|
return Math.max(0, i, o, ...s);
|
|
491
491
|
}
|
|
492
|
-
function
|
|
493
|
-
return Math.max(
|
|
492
|
+
function Ne(e) {
|
|
493
|
+
return Math.max(et, K(e) - $e);
|
|
494
494
|
}
|
|
495
|
-
let
|
|
495
|
+
let Pe = {
|
|
496
496
|
label: `${S} observations`,
|
|
497
497
|
columns: [{
|
|
498
498
|
id: "category",
|
|
@@ -505,7 +505,7 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
505
505
|
id: e.id,
|
|
506
506
|
values: [e.label, [
|
|
507
507
|
...me.map((e) => `${e.label}: ${I(e.values[t] ?? null)}`),
|
|
508
|
-
...g.map((e) => `${e.label}: ${
|
|
508
|
+
...g.map((e) => `${e.label}: ${je({
|
|
509
509
|
marker: e,
|
|
510
510
|
index: t,
|
|
511
511
|
valueText: I
|
|
@@ -517,10 +517,10 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
517
517
|
values: [e.label, I(e.value)]
|
|
518
518
|
}))]
|
|
519
519
|
};
|
|
520
|
-
return /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ J(l, {
|
|
521
521
|
items: e,
|
|
522
522
|
readout: (e) => oe(Se(M.indexOf(e))),
|
|
523
|
-
locate: (e) => G.idAt(e.x / e.width *
|
|
523
|
+
locate: (e) => G.idAt(e.x / e.width * U.width),
|
|
524
524
|
selected: c ?? null,
|
|
525
525
|
onSelect: u,
|
|
526
526
|
render: (n, { inspected: i, cursor: a }) => {
|
|
@@ -532,27 +532,27 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
532
532
|
let f = H === void 0 || !M.includes(H.categoryId) ? [] : [{
|
|
533
533
|
id: `composition:${H.categoryId}`,
|
|
534
534
|
text: H.label,
|
|
535
|
-
x:
|
|
536
|
-
y:
|
|
535
|
+
x: q(H.categoryId),
|
|
536
|
+
y: Ne(H.value),
|
|
537
537
|
isReceded: d(H.categoryId)
|
|
538
538
|
}], h = _.map((e) => {
|
|
539
539
|
let t = e.seriesId === void 0 ? {
|
|
540
|
-
x:
|
|
540
|
+
x: Oe(e.categoryId),
|
|
541
541
|
width: G.bandwidth
|
|
542
|
-
} :
|
|
542
|
+
} : X(e.categoryId, e.seriesId);
|
|
543
543
|
return {
|
|
544
544
|
id: e.id,
|
|
545
545
|
text: e.label,
|
|
546
|
-
x: t.x + t.width *
|
|
547
|
-
y:
|
|
546
|
+
x: t.x + t.width * it,
|
|
547
|
+
y: Ne(Q(M.indexOf(e.categoryId), e.seriesId)),
|
|
548
548
|
isReceded: d(e.categoryId)
|
|
549
549
|
};
|
|
550
550
|
}), y = [...f, ...h], x = e.flatMap((e, n) => {
|
|
551
551
|
if (p !== void 0) {
|
|
552
|
-
let t =
|
|
552
|
+
let t = Q(n, void 0), r = K(0), i = K(t);
|
|
553
553
|
return [{
|
|
554
|
-
left:
|
|
555
|
-
right:
|
|
554
|
+
left: Oe(e.id),
|
|
555
|
+
right: Oe(e.id) + G.bandwidth,
|
|
556
556
|
top: Math.min(r, i),
|
|
557
557
|
bottom: Math.max(r, i)
|
|
558
558
|
}];
|
|
@@ -560,7 +560,7 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
560
560
|
return t.flatMap((i, a) => {
|
|
561
561
|
let o = i.values[n];
|
|
562
562
|
if (o == null || r === "stacked" && o === 0) return [];
|
|
563
|
-
let s = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, c = K(s), l = K(s + o), u =
|
|
563
|
+
let s = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, c = K(s), l = K(s + o), u = X(e.id, i.id);
|
|
564
564
|
return [{
|
|
565
565
|
left: u.x,
|
|
566
566
|
right: u.x + u.width,
|
|
@@ -569,7 +569,7 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
569
569
|
}];
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
|
-
return /* @__PURE__ */
|
|
572
|
+
return /* @__PURE__ */ J(at, {
|
|
573
573
|
...te,
|
|
574
574
|
figure: n,
|
|
575
575
|
legend: [...he, ...ge],
|
|
@@ -580,13 +580,13 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
580
580
|
titleDetail: l.category === void 0 ? void 0 : [l.category.axisLabel ?? l.category.label, l.summary].filter(Boolean).join(" · "),
|
|
581
581
|
summary: l.summary,
|
|
582
582
|
rows: l.rows,
|
|
583
|
-
x:
|
|
583
|
+
x: q(i ?? ""),
|
|
584
584
|
width: D,
|
|
585
|
-
offset: G.bandwidth *
|
|
586
|
-
data:
|
|
587
|
-
children: e.length === 0 || t.length === 0 && p === void 0 ? /* @__PURE__ */
|
|
585
|
+
offset: G.bandwidth * it + rt,
|
|
586
|
+
data: Pe,
|
|
587
|
+
children: e.length === 0 || t.length === 0 && p === void 0 ? /* @__PURE__ */ J(ue, { children: b }) : /* @__PURE__ */ Y(_e, {
|
|
588
588
|
plotRef: E,
|
|
589
|
-
box:
|
|
589
|
+
box: U,
|
|
590
590
|
label: ee({
|
|
591
591
|
title: S,
|
|
592
592
|
marks: "categories",
|
|
@@ -594,14 +594,14 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
594
594
|
}),
|
|
595
595
|
readoutId: ne,
|
|
596
596
|
children: [
|
|
597
|
-
/* @__PURE__ */
|
|
598
|
-
box:
|
|
597
|
+
/* @__PURE__ */ J(de, {
|
|
598
|
+
box: U,
|
|
599
599
|
xTicks: we.bandTicks,
|
|
600
600
|
yTicks: we.valueTicks,
|
|
601
601
|
yTitle: o
|
|
602
602
|
}),
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
box:
|
|
603
|
+
/* @__PURE__ */ Y(ye, {
|
|
604
|
+
box: U,
|
|
605
605
|
children: [
|
|
606
606
|
e.map((e, n) => {
|
|
607
607
|
let a = p?.buckets[n], o = {
|
|
@@ -611,8 +611,8 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
611
611
|
return a === void 0 ? t.map((i, a) => {
|
|
612
612
|
let c = i.values[n];
|
|
613
613
|
if (c == null || r === "stacked" && c === 0) return null;
|
|
614
|
-
let l = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u = K(l), f = K(l + c), p = s != null && s !== i.id, m =
|
|
615
|
-
return /* @__PURE__ */
|
|
614
|
+
let l = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u = K(l), f = K(l + c), p = s != null && s !== i.id, m = X(e.id, i.id);
|
|
615
|
+
return /* @__PURE__ */ J(V, {
|
|
616
616
|
...o,
|
|
617
617
|
x: m.x,
|
|
618
618
|
y: Math.min(u, f),
|
|
@@ -622,15 +622,15 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
622
622
|
emphasis: p || d(e.id) ? "receded" : "normal",
|
|
623
623
|
mark: t.length === 1 ? e.id : `${e.id}:${i.id}`
|
|
624
624
|
}, `${e.id}:${i.id}`);
|
|
625
|
-
}) : /* @__PURE__ */
|
|
626
|
-
...
|
|
627
|
-
children: /* @__PURE__ */
|
|
625
|
+
}) : /* @__PURE__ */ J("g", {
|
|
626
|
+
...W.props(P.emphasis, d(e.id) && P.receded),
|
|
627
|
+
children: /* @__PURE__ */ J(Xe, {
|
|
628
628
|
...o,
|
|
629
629
|
bucket: a,
|
|
630
630
|
series: t,
|
|
631
631
|
focusedSeries: C,
|
|
632
632
|
index: n,
|
|
633
|
-
x:
|
|
633
|
+
x: Oe(e.id),
|
|
634
634
|
width: G.bandwidth,
|
|
635
635
|
y: K,
|
|
636
636
|
highlighted: s,
|
|
@@ -638,40 +638,40 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
638
638
|
})
|
|
639
639
|
}, e.id);
|
|
640
640
|
}),
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
x1:
|
|
643
|
-
x2:
|
|
641
|
+
/* @__PURE__ */ J(z, {
|
|
642
|
+
x1: U.left,
|
|
643
|
+
x2: U.right,
|
|
644
644
|
y1: K(0),
|
|
645
645
|
y2: K(0)
|
|
646
646
|
}),
|
|
647
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ J(Ge, {
|
|
648
648
|
markers: g,
|
|
649
649
|
categoryIds: M,
|
|
650
|
-
span:
|
|
651
|
-
barTop:
|
|
650
|
+
span: X,
|
|
651
|
+
barTop: Z,
|
|
652
652
|
y: K,
|
|
653
653
|
isReceded: d
|
|
654
654
|
})
|
|
655
655
|
]
|
|
656
656
|
}),
|
|
657
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ J(xe, {
|
|
658
658
|
lines: m,
|
|
659
|
-
box:
|
|
659
|
+
box: U,
|
|
660
660
|
position: K,
|
|
661
661
|
valueText: I,
|
|
662
|
-
avoid:
|
|
662
|
+
avoid: Re(y),
|
|
663
663
|
marks: x
|
|
664
664
|
}),
|
|
665
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ J(Ke, {
|
|
666
666
|
annotations: y,
|
|
667
|
-
left:
|
|
668
|
-
right:
|
|
667
|
+
left: U.left,
|
|
668
|
+
right: U.right
|
|
669
669
|
}),
|
|
670
|
-
a !== null && /* @__PURE__ */
|
|
671
|
-
x:
|
|
672
|
-
top:
|
|
673
|
-
bottom:
|
|
674
|
-
width: Math.max(
|
|
670
|
+
a !== null && /* @__PURE__ */ J(ae, {
|
|
671
|
+
x: q(a),
|
|
672
|
+
top: U.top,
|
|
673
|
+
bottom: U.bottom,
|
|
674
|
+
width: Math.max(nt, G.bandwidth)
|
|
675
675
|
})
|
|
676
676
|
]
|
|
677
677
|
})
|
|
@@ -680,13 +680,13 @@ function mt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
682
|
// packages/charts/src/cartesian/breakdown-bar.tsx
|
|
683
|
-
var
|
|
683
|
+
var ft = {
|
|
684
684
|
kzqmXN: "x5lhr3w",
|
|
685
685
|
kGVxlE: "x1iotiob",
|
|
686
686
|
kZKoxP: "x5yr21d",
|
|
687
687
|
$$css: !0
|
|
688
|
-
},
|
|
689
|
-
|
|
688
|
+
}, pt = { segment: (e, t, n) => [
|
|
689
|
+
ft,
|
|
690
690
|
{
|
|
691
691
|
kWkggS: t == null ? t : "xl8spv7",
|
|
692
692
|
$$css: !0
|
|
@@ -696,19 +696,19 @@ var ht = {
|
|
|
696
696
|
"--x-backgroundColor": t ?? void 0,
|
|
697
697
|
"--x-boxShadow": `inset 0 0 0 1px ${n}` == null ? void 0 : `inset 0 0 0 1px ${n}`
|
|
698
698
|
}
|
|
699
|
-
] },
|
|
700
|
-
function
|
|
699
|
+
] }, mt = 100;
|
|
700
|
+
function ht({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange: i, ...s }) {
|
|
701
701
|
let { emptyLabel: c = "No values", ...u } = s, { locale: d, title: f } = u, p = T();
|
|
702
|
-
if (u.status === "loading") return /* @__PURE__ */
|
|
702
|
+
if (u.status === "loading") return /* @__PURE__ */ J(j, {
|
|
703
703
|
...u,
|
|
704
704
|
height: "compact"
|
|
705
705
|
});
|
|
706
706
|
let m = te(e), h = e.reduce((e, t) => e + (t.value ?? 0), 0), ee = 2 ** -52 * Math.max(h, t, 1) * e.length;
|
|
707
|
-
if (m !== void 0) return /* @__PURE__ */
|
|
707
|
+
if (m !== void 0) return /* @__PURE__ */ J(le, {
|
|
708
708
|
...u,
|
|
709
709
|
message: m
|
|
710
710
|
});
|
|
711
|
-
if (!Number.isFinite(t) || t < 0 || h - t > ee) return /* @__PURE__ */
|
|
711
|
+
if (!Number.isFinite(t) || t < 0 || h - t > ee) return /* @__PURE__ */ J(le, {
|
|
712
712
|
...u,
|
|
713
713
|
message: "The total must be finite and at least the sum of recorded values."
|
|
714
714
|
});
|
|
@@ -729,29 +729,29 @@ function vt({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange:
|
|
|
729
729
|
index: t
|
|
730
730
|
})
|
|
731
731
|
}));
|
|
732
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ J(l, {
|
|
733
733
|
items: x(_),
|
|
734
734
|
arrows: "both",
|
|
735
735
|
selected: r ?? null,
|
|
736
736
|
onSelect: i,
|
|
737
|
-
render: (n, r) => /* @__PURE__ */
|
|
737
|
+
render: (n, r) => /* @__PURE__ */ J(ce, {
|
|
738
738
|
...u,
|
|
739
739
|
figure: n,
|
|
740
|
-
children: e.length === 0 ? /* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
740
|
+
children: e.length === 0 ? /* @__PURE__ */ J(ue, { children: c }) : /* @__PURE__ */ Y(q, { children: [
|
|
741
|
+
/* @__PURE__ */ J("div", {
|
|
742
742
|
"aria-hidden": !0,
|
|
743
743
|
className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
|
|
744
744
|
children: e.map((e, n) => {
|
|
745
745
|
let r = _[n]?.tone ?? "neutral";
|
|
746
|
-
return e.value === null ? null : /* @__PURE__ */
|
|
746
|
+
return e.value === null ? null : /* @__PURE__ */ J("span", { ...W.props(pt.segment(t === 0 ? 0 : e.value / t * mt, o[r], a[r])) }, e.id);
|
|
747
747
|
})
|
|
748
748
|
}),
|
|
749
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ J(C, {
|
|
750
750
|
title: f,
|
|
751
751
|
items: _,
|
|
752
752
|
view: i === void 0 ? void 0 : r
|
|
753
753
|
}),
|
|
754
|
-
t - h > ee && /* @__PURE__ */
|
|
754
|
+
t - h > ee && /* @__PURE__ */ Y("p", {
|
|
755
755
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
756
756
|
children: [
|
|
757
757
|
"Unassigned portion: ",
|
|
@@ -765,15 +765,15 @@ function vt({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange:
|
|
|
765
765
|
});
|
|
766
766
|
}
|
|
767
767
|
// packages/charts/src/cartesian/bridge-data.ts
|
|
768
|
-
function
|
|
768
|
+
function gt(e) {
|
|
769
769
|
return e.kind !== "change" || e.value === null ? "neutral" : e.value < 0 ? "negative" : "positive";
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function _t(e) {
|
|
772
772
|
let t = e.map((e) => e.kind === "total" ? 0 : e.value);
|
|
773
773
|
return e[0]?.kind !== "start" || t.includes(null) ? null : t.reduce((e, t) => e + (t ?? 0), 0);
|
|
774
774
|
}
|
|
775
|
-
function
|
|
776
|
-
let r = e.tone ??
|
|
775
|
+
function vt({ step: e, before: t, after: n }) {
|
|
776
|
+
let r = e.tone ?? gt(e);
|
|
777
777
|
switch (e.kind) {
|
|
778
778
|
case "start": return {
|
|
779
779
|
step: e,
|
|
@@ -795,18 +795,18 @@ function xt({ step: e, before: t, after: n }) {
|
|
|
795
795
|
};
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
function
|
|
799
|
-
return e.map((t, n) =>
|
|
798
|
+
function yt(e) {
|
|
799
|
+
return e.map((t, n) => vt({
|
|
800
800
|
step: t,
|
|
801
|
-
before:
|
|
802
|
-
after:
|
|
801
|
+
before: _t(e.slice(0, n)),
|
|
802
|
+
after: _t(e.slice(0, n + 1))
|
|
803
803
|
}));
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function bt(e) {
|
|
806
806
|
let t = e.flatMap((e) => [e.from, e.to].filter((e) => e !== null)), n = Math.min(0, ...t), r = Math.max(0, ...t);
|
|
807
807
|
return n === r ? [n, n + 1] : [n, r];
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function xt({ steps: e, domain: t }) {
|
|
810
810
|
if (e.length > S.items) return `Choose a bridge with at most ${S.items} steps.`;
|
|
811
811
|
if (!u(e)) return "Bridge steps require unique identifiers.";
|
|
812
812
|
if (e.length > 0 && e[0]?.kind !== "start") return "A bridge begins with one start step.";
|
|
@@ -815,36 +815,36 @@ function wt({ steps: e, domain: t }) {
|
|
|
815
815
|
let t = e.kind === "total" ? null : e.value;
|
|
816
816
|
return t !== null && !Number.isFinite(t);
|
|
817
817
|
})) return "Bridge values must be finite numbers or explicit missing changes.";
|
|
818
|
-
let n =
|
|
818
|
+
let n = bt(yt(e));
|
|
819
819
|
if (t === void 0) return Number.isFinite(n[0]) && Number.isFinite(n[1]) ? void 0 : "Running totals must stay finite.";
|
|
820
820
|
let r = t[0] <= n[0] && t[1] >= n[1];
|
|
821
821
|
if (!O(t) || !r) return "The bridge domain must be finite, increasing, and contain zero and every running total.";
|
|
822
822
|
}
|
|
823
823
|
// packages/charts/src/cartesian/bridge-chart.tsx
|
|
824
|
-
var
|
|
825
|
-
function
|
|
824
|
+
var St = 12, Ct = 6, wt = 14, Tt = 12, Et = 8, Dt = 8, Ot = .5;
|
|
825
|
+
function kt(e) {
|
|
826
826
|
return typeof e == "function" ? (t) => t === 0 ? e(0) : `${t > 0 ? "+" : "−"}${e(Math.abs(t))}` : {
|
|
827
827
|
...e,
|
|
828
828
|
signDisplay: "exceptZero"
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function At({ level: e, valueText: t, changeText: n }) {
|
|
832
832
|
return e.step.kind === "change" && e.step.value !== null ? n(e.step.value) : e.to === null ? "—" : t(e.to);
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function jt({ level: e, valueText: t, changeText: n }) {
|
|
835
835
|
return e.step.kind === "change" ? e.step.value === null ? E : n(e.step.value) : e.to === null ? E : t(e.to);
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function Mt({ level: e, valueText: t }) {
|
|
838
838
|
return e.from === null || e.to === null ? E : `${t(e.from)} → ${t(e.to)}`;
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function Nt(e, t, n) {
|
|
841
841
|
if (e.from === null || e.to === null) {
|
|
842
|
-
let r = Math.min(n -
|
|
842
|
+
let r = Math.min(n - Tt, t(e.from ?? 0) - Tt * Ot);
|
|
843
843
|
return {
|
|
844
844
|
isKnown: !1,
|
|
845
845
|
top: r,
|
|
846
|
-
height:
|
|
847
|
-
labelY: r -
|
|
846
|
+
height: Tt,
|
|
847
|
+
labelY: r - Ct
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
850
|
let r = Math.max(e.from, e.to), i = Math.min(e.from, e.to), a = t(r), o = r <= 0 && i < 0;
|
|
@@ -852,23 +852,23 @@ function It(e, t, n) {
|
|
|
852
852
|
isKnown: !0,
|
|
853
853
|
top: a,
|
|
854
854
|
height: Math.max(1, t(i) - a),
|
|
855
|
-
labelY: o ? t(i) +
|
|
855
|
+
labelY: o ? t(i) + wt : a - Ct
|
|
856
856
|
};
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r, valueLabel: i, domain: a, referenceLines: o = [], selected: s, onSelectedChange: c, height: u = "regular", ...d }) {
|
|
859
859
|
let { emptyLabel: p = "No steps", ...m } = d, { locale: g, title: _ } = m, v = ve(u), y = Te();
|
|
860
|
-
if (m.status === "loading") return /* @__PURE__ */
|
|
860
|
+
if (m.status === "loading") return /* @__PURE__ */ J(j, {
|
|
861
861
|
...m,
|
|
862
862
|
height: u
|
|
863
863
|
});
|
|
864
|
-
let b =
|
|
864
|
+
let b = yt(e), te = bt(b), x = a ?? f({ values: [...te, ...o.map((e) => e.value)] }), S = xt({
|
|
865
865
|
steps: e,
|
|
866
866
|
domain: a
|
|
867
867
|
}) ?? be({
|
|
868
868
|
lines: o,
|
|
869
869
|
domain: x
|
|
870
870
|
});
|
|
871
|
-
if (S !== void 0) return /* @__PURE__ */
|
|
871
|
+
if (S !== void 0) return /* @__PURE__ */ J(le, {
|
|
872
872
|
...m,
|
|
873
873
|
message: S
|
|
874
874
|
});
|
|
@@ -898,7 +898,7 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
898
898
|
id: "running",
|
|
899
899
|
label: "Running total",
|
|
900
900
|
tone: "neutral",
|
|
901
|
-
value:
|
|
901
|
+
value: Mt({
|
|
902
902
|
level: t,
|
|
903
903
|
valueText: w
|
|
904
904
|
})
|
|
@@ -906,7 +906,7 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
906
906
|
return {
|
|
907
907
|
level: t,
|
|
908
908
|
label: t.step.label,
|
|
909
|
-
summary:
|
|
909
|
+
summary: jt({
|
|
910
910
|
level: t,
|
|
911
911
|
valueText: w,
|
|
912
912
|
changeText: T
|
|
@@ -929,7 +929,7 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
929
929
|
},
|
|
930
930
|
valueDomain: x,
|
|
931
931
|
locale: g,
|
|
932
|
-
topInset:
|
|
932
|
+
topInset: St,
|
|
933
933
|
hasValueTitle: i !== void 0
|
|
934
934
|
}), { box: O, band: k } = D, A = D.value.position, ie = b.map((e) => ({
|
|
935
935
|
id: e.step.id,
|
|
@@ -939,20 +939,20 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
939
939
|
return k.start(e) ?? O.left;
|
|
940
940
|
}
|
|
941
941
|
function P(e) {
|
|
942
|
-
return N(e) + k.bandwidth *
|
|
942
|
+
return N(e) + k.bandwidth * Ot;
|
|
943
943
|
}
|
|
944
|
-
let F =
|
|
944
|
+
let F = Re([...b.filter((e) => e.step.kind !== "change"), ...b.filter((e) => e.step.kind === "change")].map((e) => ({
|
|
945
945
|
id: e.step.id,
|
|
946
946
|
isTotal: e.step.kind !== "change",
|
|
947
|
-
text:
|
|
947
|
+
text: At({
|
|
948
948
|
level: e,
|
|
949
949
|
valueText: w,
|
|
950
950
|
changeText: T
|
|
951
951
|
}),
|
|
952
952
|
x: P(e.step.id),
|
|
953
|
-
y:
|
|
953
|
+
y: Nt(e, A, O.bottom).labelY
|
|
954
954
|
})));
|
|
955
|
-
return /* @__PURE__ */
|
|
955
|
+
return /* @__PURE__ */ J(l, {
|
|
956
956
|
items: ie,
|
|
957
957
|
readout: (e) => oe(E(e)),
|
|
958
958
|
locate: (e) => k.idAt(e.x / e.width * O.width),
|
|
@@ -960,12 +960,12 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
960
960
|
onSelect: c,
|
|
961
961
|
render: (e, { inspected: t, cursor: n }) => {
|
|
962
962
|
let r = E(t);
|
|
963
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ Y(ce, {
|
|
964
964
|
...m,
|
|
965
965
|
figure: e,
|
|
966
966
|
titleDetail: r.level === void 0 ? void 0 : `${r.label} · ${r.summary}`,
|
|
967
967
|
children: [
|
|
968
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ J(se, {
|
|
969
969
|
label: `${_} steps`,
|
|
970
970
|
columns: [
|
|
971
971
|
{
|
|
@@ -985,15 +985,15 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
985
985
|
id: e.step.id,
|
|
986
986
|
values: [
|
|
987
987
|
e.step.label,
|
|
988
|
-
|
|
988
|
+
jt({
|
|
989
989
|
level: e,
|
|
990
990
|
valueText: w,
|
|
991
991
|
changeText: T
|
|
992
992
|
}),
|
|
993
|
-
e.step.kind === "change" ?
|
|
993
|
+
e.step.kind === "change" ? Mt({
|
|
994
994
|
level: e,
|
|
995
995
|
valueText: w
|
|
996
|
-
}) :
|
|
996
|
+
}) : jt({
|
|
997
997
|
level: e,
|
|
998
998
|
valueText: w,
|
|
999
999
|
changeText: T
|
|
@@ -1008,7 +1008,7 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
1008
1008
|
]
|
|
1009
1009
|
}))]
|
|
1010
1010
|
}),
|
|
1011
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ J(M, {
|
|
1012
1012
|
id: y,
|
|
1013
1013
|
label: r.label,
|
|
1014
1014
|
summary: r.summary,
|
|
@@ -1017,9 +1017,9 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
1017
1017
|
rows: r.rows,
|
|
1018
1018
|
x: P(t ?? ""),
|
|
1019
1019
|
width: v.width,
|
|
1020
|
-
offset: k.bandwidth *
|
|
1020
|
+
offset: k.bandwidth * Ot + Dt
|
|
1021
1021
|
}),
|
|
1022
|
-
b.length === 0 ? /* @__PURE__ */
|
|
1022
|
+
b.length === 0 ? /* @__PURE__ */ J(ue, { children: p }) : /* @__PURE__ */ Y(_e, {
|
|
1023
1023
|
plotRef: v.ref,
|
|
1024
1024
|
box: O,
|
|
1025
1025
|
label: ee({
|
|
@@ -1029,18 +1029,18 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
1029
1029
|
}),
|
|
1030
1030
|
readoutId: y,
|
|
1031
1031
|
children: [
|
|
1032
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ J(de, {
|
|
1033
1033
|
box: O,
|
|
1034
1034
|
xTicks: D.bandTicks,
|
|
1035
1035
|
yTicks: D.valueTicks,
|
|
1036
1036
|
yTitle: i
|
|
1037
1037
|
}),
|
|
1038
|
-
/* @__PURE__ */
|
|
1038
|
+
/* @__PURE__ */ Y(ye, {
|
|
1039
1039
|
box: O,
|
|
1040
1040
|
children: [
|
|
1041
1041
|
b.map((e, t) => {
|
|
1042
1042
|
let n = b[t + 1];
|
|
1043
|
-
return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */
|
|
1043
|
+
return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ J(fe, {
|
|
1044
1044
|
x1: N(e.step.id) + k.bandwidth,
|
|
1045
1045
|
x2: N(n.step.id),
|
|
1046
1046
|
y1: A(e.to),
|
|
@@ -1048,8 +1048,8 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
1048
1048
|
}, `connector:${e.step.id}`);
|
|
1049
1049
|
}),
|
|
1050
1050
|
b.map((e) => {
|
|
1051
|
-
let n =
|
|
1052
|
-
return /* @__PURE__ */
|
|
1051
|
+
let n = Nt(e, A, O.bottom);
|
|
1052
|
+
return /* @__PURE__ */ J(V, {
|
|
1053
1053
|
x: N(e.step.id),
|
|
1054
1054
|
y: n.top,
|
|
1055
1055
|
width: k.bandwidth,
|
|
@@ -1060,7 +1060,7 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
1060
1060
|
isInspected: t === e.step.id
|
|
1061
1061
|
}, e.step.id);
|
|
1062
1062
|
}),
|
|
1063
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ J(z, {
|
|
1064
1064
|
x1: O.left,
|
|
1065
1065
|
x2: O.right,
|
|
1066
1066
|
y1: A(0),
|
|
@@ -1068,14 +1068,14 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
1068
1068
|
})
|
|
1069
1069
|
]
|
|
1070
1070
|
}),
|
|
1071
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ J(xe, {
|
|
1072
1072
|
lines: o,
|
|
1073
1073
|
box: O,
|
|
1074
1074
|
position: A,
|
|
1075
1075
|
valueText: w,
|
|
1076
1076
|
avoid: F,
|
|
1077
1077
|
marks: b.map((e) => {
|
|
1078
|
-
let t =
|
|
1078
|
+
let t = Nt(e, A, O.bottom);
|
|
1079
1079
|
return {
|
|
1080
1080
|
left: N(e.step.id),
|
|
1081
1081
|
right: N(e.step.id) + k.bandwidth,
|
|
@@ -1084,9 +1084,9 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
1084
1084
|
};
|
|
1085
1085
|
})
|
|
1086
1086
|
}),
|
|
1087
|
-
/* @__PURE__ */
|
|
1087
|
+
/* @__PURE__ */ J("g", {
|
|
1088
1088
|
"aria-hidden": !0,
|
|
1089
|
-
children: F.map((e) => /* @__PURE__ */
|
|
1089
|
+
children: F.map((e) => /* @__PURE__ */ J(L, {
|
|
1090
1090
|
x: e.x,
|
|
1091
1091
|
y: e.y,
|
|
1092
1092
|
anchor: "middle",
|
|
@@ -1094,11 +1094,11 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
1094
1094
|
children: e.text
|
|
1095
1095
|
}, e.id))
|
|
1096
1096
|
}),
|
|
1097
|
-
n !== null && /* @__PURE__ */
|
|
1097
|
+
n !== null && /* @__PURE__ */ J(ae, {
|
|
1098
1098
|
x: P(n),
|
|
1099
1099
|
top: O.top,
|
|
1100
1100
|
bottom: O.bottom,
|
|
1101
|
-
width: Math.max(
|
|
1101
|
+
width: Math.max(Et, k.bandwidth)
|
|
1102
1102
|
})
|
|
1103
1103
|
]
|
|
1104
1104
|
})
|
|
@@ -1108,7 +1108,7 @@ function Lt({ steps: e, valueFormat: t, changeFormat: n = Mt(t), tickFormat: r,
|
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
1110
|
// packages/charts/src/cartesian/scatter-plot.tsx
|
|
1111
|
-
var
|
|
1111
|
+
var Ft = { points: 1e3 }, It = {
|
|
1112
1112
|
target: {
|
|
1113
1113
|
kVAEAm: "x10l6tqk",
|
|
1114
1114
|
k1xSpc: "xrvj5dj",
|
|
@@ -1147,30 +1147,30 @@ var Rt = { points: 1e3 }, zt = {
|
|
|
1147
1147
|
$$css: !0
|
|
1148
1148
|
}
|
|
1149
1149
|
};
|
|
1150
|
-
function
|
|
1150
|
+
function Lt(e, t) {
|
|
1151
1151
|
return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function Rt(e, t) {
|
|
1154
1154
|
return Number.isFinite(e) && e > 0 && e <= t[1] - t[0];
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1156
|
+
function zt({ points: e, x: t, y: n, xDomain: r, yDomain: i, range: a, onRangeChange: o, rangeStep: s }) {
|
|
1157
1157
|
let c = k(r, t.scale) ?? k(i, n.scale);
|
|
1158
1158
|
if (c !== void 0) return c;
|
|
1159
|
-
if (e.length >
|
|
1159
|
+
if (e.length > Ft.points) return `This plot exceeds the ${Ft.points}-point render limit. Supply a smaller, labelled sample.`;
|
|
1160
1160
|
if (!u(e)) return "Scatter points must have unique identifiers.";
|
|
1161
1161
|
if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
|
|
1162
1162
|
if (e.some((e) => D(e.x, r) || D(e.y, i))) return "Scatter coordinates fall outside the declared domain. Widen the domain or supply a labelled window of points.";
|
|
1163
1163
|
if (o !== void 0) {
|
|
1164
|
-
if (s === void 0 || !
|
|
1165
|
-
if (a != null && (!
|
|
1164
|
+
if (s === void 0 || !Rt(s.x, r) || !Rt(s.y, i)) return "Range selection steps must be finite, positive, and no larger than their domain span.";
|
|
1165
|
+
if (a != null && (!Lt(a.x, r) || !Lt(a.y, i))) return "The selected range must have finite, ordered bounds inside the declared domain.";
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1168
|
+
function Bt(e, t) {
|
|
1169
1169
|
return [Math.min(e, t), Math.max(e, t)];
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function Vt(e) {
|
|
1172
1172
|
let { points: t, x: n, y: r, referenceDiagonal: i, referenceLines: a = [], frontier: o = [], labeledIds: u = [], range: p, onRangeChange: m, rangeStep: h, selected: g, onSelectedChange: y, height: b = "regular", ...te } = e, { emptyLabel: x = "No points were supplied.", ...S } = te, { locale: C, title: ne } = S, E = Te(), D = ve(b), O = T(), k = w(), [A, ie] = Ee(null), ae = K(null);
|
|
1173
|
-
if (G(() => () => ae.current?.(), []), S.status === "loading") return /* @__PURE__ */
|
|
1173
|
+
if (G(() => () => ae.current?.(), []), S.status === "loading") return /* @__PURE__ */ J(j, {
|
|
1174
1174
|
...S,
|
|
1175
1175
|
height: b
|
|
1176
1176
|
});
|
|
@@ -1180,7 +1180,7 @@ function Wt(e) {
|
|
|
1180
1180
|
}), M = r.domain ?? f({
|
|
1181
1181
|
values: t.map((e) => e.y),
|
|
1182
1182
|
scale: r.scale
|
|
1183
|
-
}), N =
|
|
1183
|
+
}), N = zt({
|
|
1184
1184
|
points: t,
|
|
1185
1185
|
x: n,
|
|
1186
1186
|
y: r,
|
|
@@ -1193,7 +1193,7 @@ function Wt(e) {
|
|
|
1193
1193
|
lines: a,
|
|
1194
1194
|
domain: M
|
|
1195
1195
|
}) : void 0), F = p ?? null;
|
|
1196
|
-
if (N !== void 0) return /* @__PURE__ */
|
|
1196
|
+
if (N !== void 0) return /* @__PURE__ */ J(le, {
|
|
1197
1197
|
...S,
|
|
1198
1198
|
message: N
|
|
1199
1199
|
});
|
|
@@ -1238,8 +1238,8 @@ function Wt(e) {
|
|
|
1238
1238
|
right: e.left,
|
|
1239
1239
|
bottom: e.top
|
|
1240
1240
|
}])), ge = A === null ? p : {
|
|
1241
|
-
x:
|
|
1242
|
-
y:
|
|
1241
|
+
x: Bt(A.start.x, A.end.x),
|
|
1242
|
+
y: Bt(A.start.y, A.end.y)
|
|
1243
1243
|
};
|
|
1244
1244
|
function Se(e, t, n) {
|
|
1245
1245
|
let r = e.getBoundingClientRect(), i = (t - r.left) / r.width * z.width, a = (n - r.top) / r.height * z.height;
|
|
@@ -1264,35 +1264,35 @@ function Wt(e) {
|
|
|
1264
1264
|
onEnd: (t, n) => {
|
|
1265
1265
|
if (ae.current = null, ie(null), n) return;
|
|
1266
1266
|
let i = Se(r, t.clientX, t.clientY), a = {
|
|
1267
|
-
x:
|
|
1268
|
-
y:
|
|
1267
|
+
x: Bt(s.x, i.x),
|
|
1268
|
+
y: Bt(s.y, i.y)
|
|
1269
1269
|
};
|
|
1270
|
-
|
|
1270
|
+
Oe({ options: () => e }, "onRangeChange", a, {
|
|
1271
1271
|
reason: "drag",
|
|
1272
1272
|
event: t
|
|
1273
1273
|
});
|
|
1274
1274
|
}
|
|
1275
1275
|
});
|
|
1276
1276
|
}
|
|
1277
|
-
let we = new Map(V.map((e) => [e.id, e])),
|
|
1277
|
+
let we = new Map(V.map((e) => [e.id, e])), U = o.map((e) => we.get(e)).filter((e) => e !== void 0), q = U.length >= 2 ? H(U.map((e) => ({
|
|
1278
1278
|
x: e.left,
|
|
1279
1279
|
y: e.top
|
|
1280
|
-
}))) : "",
|
|
1281
|
-
return /* @__PURE__ */
|
|
1280
|
+
}))) : "", ke = new Set(u), X = i === !0 ? { label: "y = x" } : i === !1 || i === void 0 ? null : i, Z = Math.max(oe[0], M[0]), Q = Math.min(oe[1], M[1]), Ae = X !== null && Q > Z;
|
|
1281
|
+
return /* @__PURE__ */ J(l, {
|
|
1282
1282
|
...k,
|
|
1283
1283
|
items: me,
|
|
1284
1284
|
place: (e) => he.get(e),
|
|
1285
1285
|
selected: g ?? null,
|
|
1286
1286
|
onSelect: y,
|
|
1287
|
-
render: (e, { inspected: i, cursor: o }) => /* @__PURE__ */
|
|
1287
|
+
render: (e, { inspected: i, cursor: o }) => /* @__PURE__ */ Y(ce, {
|
|
1288
1288
|
...S,
|
|
1289
1289
|
figure: e,
|
|
1290
|
-
footer: /* @__PURE__ */
|
|
1290
|
+
footer: /* @__PURE__ */ J(d, {
|
|
1291
1291
|
id: E,
|
|
1292
1292
|
children: s(me, i)
|
|
1293
1293
|
}),
|
|
1294
1294
|
children: [
|
|
1295
|
-
t.length === 0 ? /* @__PURE__ */
|
|
1295
|
+
t.length === 0 ? /* @__PURE__ */ J(ue, { children: x }) : /* @__PURE__ */ Y(_e, {
|
|
1296
1296
|
plotRef: D.ref,
|
|
1297
1297
|
box: z,
|
|
1298
1298
|
label: ee({
|
|
@@ -1301,23 +1301,23 @@ function Wt(e) {
|
|
|
1301
1301
|
}),
|
|
1302
1302
|
readoutId: E,
|
|
1303
1303
|
onPointerDown: Ce,
|
|
1304
|
-
overlay: V.map((e, t) => /* @__PURE__ */
|
|
1304
|
+
overlay: V.map((e, t) => /* @__PURE__ */ J(c, {
|
|
1305
1305
|
value: e.id,
|
|
1306
|
-
render: /* @__PURE__ */
|
|
1306
|
+
render: /* @__PURE__ */ J("button", {
|
|
1307
1307
|
type: "button",
|
|
1308
1308
|
tabIndex: -1,
|
|
1309
1309
|
title: e.label,
|
|
1310
1310
|
"aria-label": me[t]?.label,
|
|
1311
1311
|
"aria-pressed": y === void 0 ? void 0 : g === e.id
|
|
1312
1312
|
}),
|
|
1313
|
-
...
|
|
1314
|
-
children: /* @__PURE__ */
|
|
1313
|
+
...W.props(It.target, It.location(e.left, e.top)),
|
|
1314
|
+
children: /* @__PURE__ */ J("span", {
|
|
1315
1315
|
"aria-hidden": !0,
|
|
1316
|
-
...
|
|
1316
|
+
...W.props(It.ring, o === e.id && P.cursor)
|
|
1317
1317
|
})
|
|
1318
1318
|
}, e.id)),
|
|
1319
1319
|
children: [
|
|
1320
|
-
/* @__PURE__ */
|
|
1320
|
+
/* @__PURE__ */ J(de, {
|
|
1321
1321
|
box: z,
|
|
1322
1322
|
xTicks: R.xTicks,
|
|
1323
1323
|
yTicks: R.yTicks,
|
|
@@ -1325,7 +1325,7 @@ function Wt(e) {
|
|
|
1325
1325
|
yTitle: _(r),
|
|
1326
1326
|
grid: "both"
|
|
1327
1327
|
}),
|
|
1328
|
-
m !== void 0 && /* @__PURE__ */
|
|
1328
|
+
m !== void 0 && /* @__PURE__ */ J("rect", {
|
|
1329
1329
|
"data-brush": "",
|
|
1330
1330
|
x: z.left,
|
|
1331
1331
|
y: z.top,
|
|
@@ -1333,32 +1333,32 @@ function Wt(e) {
|
|
|
1333
1333
|
height: z.innerHeight,
|
|
1334
1334
|
className: "xsid9ct xy6m8k3"
|
|
1335
1335
|
}),
|
|
1336
|
-
/* @__PURE__ */
|
|
1336
|
+
/* @__PURE__ */ Y(ye, {
|
|
1337
1337
|
box: z,
|
|
1338
1338
|
pad: 6,
|
|
1339
1339
|
children: [
|
|
1340
|
-
Ae && /* @__PURE__ */
|
|
1341
|
-
spec:
|
|
1342
|
-
low:
|
|
1340
|
+
Ae && /* @__PURE__ */ J(Ht, {
|
|
1341
|
+
spec: X,
|
|
1342
|
+
low: Z,
|
|
1343
1343
|
high: Q,
|
|
1344
1344
|
plot: R
|
|
1345
1345
|
}),
|
|
1346
|
-
a.length > 0 && /* @__PURE__ */
|
|
1346
|
+
a.length > 0 && /* @__PURE__ */ J(xe, {
|
|
1347
1347
|
lines: a,
|
|
1348
1348
|
box: z,
|
|
1349
1349
|
position: R.y.position,
|
|
1350
1350
|
valueText: B
|
|
1351
1351
|
}),
|
|
1352
|
-
q !== "" && /* @__PURE__ */
|
|
1352
|
+
q !== "" && /* @__PURE__ */ J(pe, {
|
|
1353
1353
|
d: q,
|
|
1354
1354
|
tone: "series1",
|
|
1355
1355
|
stroke: "dashed"
|
|
1356
1356
|
}),
|
|
1357
|
-
ge != null && /* @__PURE__ */
|
|
1357
|
+
ge != null && /* @__PURE__ */ J(Ut, {
|
|
1358
1358
|
range: ge,
|
|
1359
1359
|
plot: R
|
|
1360
1360
|
}),
|
|
1361
|
-
V.map((e) => /* @__PURE__ */
|
|
1361
|
+
V.map((e) => /* @__PURE__ */ J(I, {
|
|
1362
1362
|
mark: e.id,
|
|
1363
1363
|
x: e.left,
|
|
1364
1364
|
y: e.top,
|
|
@@ -1366,9 +1366,9 @@ function Wt(e) {
|
|
|
1366
1366
|
isInspected: i === e.id,
|
|
1367
1367
|
isSelected: g === e.id
|
|
1368
1368
|
}, e.id)),
|
|
1369
|
-
V.filter((e) =>
|
|
1369
|
+
V.filter((e) => ke.has(e.id)).map((e) => {
|
|
1370
1370
|
let t = e.left > z.right - 90, n = e.top < z.top + 18;
|
|
1371
|
-
return /* @__PURE__ */
|
|
1371
|
+
return /* @__PURE__ */ J(L, {
|
|
1372
1372
|
x: e.left + (t ? -8 : 8),
|
|
1373
1373
|
y: e.top + (n ? 14 : -6),
|
|
1374
1374
|
anchor: t ? "end" : "start",
|
|
@@ -1379,7 +1379,7 @@ function Wt(e) {
|
|
|
1379
1379
|
})
|
|
1380
1380
|
]
|
|
1381
1381
|
}),
|
|
1382
|
-
m !== void 0 && h !== void 0 && /* @__PURE__ */
|
|
1382
|
+
m !== void 0 && h !== void 0 && /* @__PURE__ */ J(Gt, {
|
|
1383
1383
|
x: n,
|
|
1384
1384
|
y: r,
|
|
1385
1385
|
xDomain: oe,
|
|
@@ -1389,7 +1389,7 @@ function Wt(e) {
|
|
|
1389
1389
|
locale: C,
|
|
1390
1390
|
onRangeChange: m
|
|
1391
1391
|
}),
|
|
1392
|
-
/* @__PURE__ */
|
|
1392
|
+
/* @__PURE__ */ J(se, {
|
|
1393
1393
|
label: `${ne} points`,
|
|
1394
1394
|
columns: [
|
|
1395
1395
|
{
|
|
@@ -1418,29 +1418,29 @@ function Wt(e) {
|
|
|
1418
1418
|
})
|
|
1419
1419
|
});
|
|
1420
1420
|
}
|
|
1421
|
-
function
|
|
1421
|
+
function Ht({ spec: e, low: t, high: n, plot: r }) {
|
|
1422
1422
|
let { box: i } = r, a = r.x.position(n), o = r.y.position(n);
|
|
1423
|
-
return /* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */
|
|
1423
|
+
return /* @__PURE__ */ Y("g", { children: [
|
|
1424
|
+
/* @__PURE__ */ J("line", {
|
|
1425
1425
|
x1: r.x.position(t),
|
|
1426
1426
|
y1: r.y.position(t),
|
|
1427
1427
|
x2: a,
|
|
1428
1428
|
y2: o,
|
|
1429
1429
|
className: "xhq4mlf xnpr05h xlz5em3 x47corl x13efnbd"
|
|
1430
1430
|
}),
|
|
1431
|
-
e.label !== void 0 && /* @__PURE__ */
|
|
1431
|
+
e.label !== void 0 && /* @__PURE__ */ J(L, {
|
|
1432
1432
|
x: a - 6,
|
|
1433
1433
|
y: o + 14,
|
|
1434
1434
|
anchor: "end",
|
|
1435
1435
|
children: e.label
|
|
1436
1436
|
}),
|
|
1437
|
-
e.aboveLabel !== void 0 && /* @__PURE__ */
|
|
1437
|
+
e.aboveLabel !== void 0 && /* @__PURE__ */ J("text", {
|
|
1438
1438
|
x: i.left + 8,
|
|
1439
1439
|
y: i.top + 14,
|
|
1440
1440
|
className: "x1q7gtio x1hz01jw xy8obcc x47corl",
|
|
1441
1441
|
children: e.aboveLabel
|
|
1442
1442
|
}),
|
|
1443
|
-
e.belowLabel !== void 0 && /* @__PURE__ */
|
|
1443
|
+
e.belowLabel !== void 0 && /* @__PURE__ */ J("text", {
|
|
1444
1444
|
x: i.right - 8,
|
|
1445
1445
|
y: i.bottom - 8,
|
|
1446
1446
|
textAnchor: "end",
|
|
@@ -1449,9 +1449,9 @@ function Gt({ spec: e, low: t, high: n, plot: r }) {
|
|
|
1449
1449
|
})
|
|
1450
1450
|
] });
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function Ut({ range: e, plot: t }) {
|
|
1453
1453
|
let n = t.x.position(e.x[0]), r = t.y.position(e.y[1]);
|
|
1454
|
-
return /* @__PURE__ */
|
|
1454
|
+
return /* @__PURE__ */ J("rect", {
|
|
1455
1455
|
x: n,
|
|
1456
1456
|
y: r,
|
|
1457
1457
|
width: t.x.position(e.x[1]) - n,
|
|
@@ -1459,7 +1459,7 @@ function Kt({ range: e, plot: t }) {
|
|
|
1459
1459
|
className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
|
|
1460
1460
|
});
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function Wt({ axis: e, domain: t, value: r, step: i, locale: a, onChange: o }) {
|
|
1463
1463
|
function s(t) {
|
|
1464
1464
|
return re({
|
|
1465
1465
|
value: t,
|
|
@@ -1467,7 +1467,7 @@ function qt({ axis: e, domain: t, value: r, step: i, locale: a, onChange: o }) {
|
|
|
1467
1467
|
format: e.format
|
|
1468
1468
|
});
|
|
1469
1469
|
}
|
|
1470
|
-
return /* @__PURE__ */
|
|
1470
|
+
return /* @__PURE__ */ Y(n.Root, {
|
|
1471
1471
|
value: [...r],
|
|
1472
1472
|
format: e.format,
|
|
1473
1473
|
min: t[0],
|
|
@@ -1475,39 +1475,39 @@ function qt({ axis: e, domain: t, value: r, step: i, locale: a, onChange: o }) {
|
|
|
1475
1475
|
step: i,
|
|
1476
1476
|
locale: a,
|
|
1477
1477
|
onValueChange: (e, t) => o(e, t),
|
|
1478
|
-
children: [/* @__PURE__ */
|
|
1478
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1479
1479
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
1480
|
-
children: [/* @__PURE__ */
|
|
1480
|
+
children: [/* @__PURE__ */ J(n.Label, { children: e.label }), /* @__PURE__ */ Y("span", { children: [
|
|
1481
1481
|
s(r[0]),
|
|
1482
1482
|
" – ",
|
|
1483
1483
|
s(r[1])
|
|
1484
1484
|
] })]
|
|
1485
|
-
}), /* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1485
|
+
}), /* @__PURE__ */ J(n.Control, { children: /* @__PURE__ */ Y(n.Track, { children: [
|
|
1486
|
+
/* @__PURE__ */ J(n.Indicator, {}),
|
|
1487
|
+
/* @__PURE__ */ J(n.Thumb, {
|
|
1488
1488
|
index: 0,
|
|
1489
1489
|
"aria-label": `${e.label} minimum`
|
|
1490
1490
|
}),
|
|
1491
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ J(n.Thumb, {
|
|
1492
1492
|
index: 1,
|
|
1493
1493
|
"aria-label": `${e.label} maximum`
|
|
1494
1494
|
})
|
|
1495
1495
|
] }) })]
|
|
1496
1496
|
});
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1498
|
+
function Gt({ x: e, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale: s, onRangeChange: c }) {
|
|
1499
1499
|
let l = a ?? {
|
|
1500
1500
|
x: r,
|
|
1501
1501
|
y: i
|
|
1502
1502
|
};
|
|
1503
|
-
return /* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ Y("fieldset", {
|
|
1504
1504
|
className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
|
|
1505
1505
|
children: [
|
|
1506
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ J("legend", {
|
|
1507
1507
|
className: "x153jb6y xy8obcc x1jfksii",
|
|
1508
1508
|
children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
|
|
1509
1509
|
}),
|
|
1510
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ J(Wt, {
|
|
1511
1511
|
axis: e,
|
|
1512
1512
|
domain: r,
|
|
1513
1513
|
value: l.x,
|
|
@@ -1518,7 +1518,7 @@ function Jt({ x: e, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
|
|
|
1518
1518
|
y: l.y
|
|
1519
1519
|
}, t)
|
|
1520
1520
|
}),
|
|
1521
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ J(Wt, {
|
|
1522
1522
|
axis: n,
|
|
1523
1523
|
domain: i,
|
|
1524
1524
|
value: l.y,
|
|
@@ -1529,11 +1529,11 @@ function Jt({ x: e, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
|
|
|
1529
1529
|
y: e
|
|
1530
1530
|
}, t)
|
|
1531
1531
|
}),
|
|
1532
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ J(t, {
|
|
1533
1533
|
type: "button",
|
|
1534
1534
|
disabled: a === null,
|
|
1535
1535
|
onClick: (e) => {
|
|
1536
|
-
|
|
1536
|
+
Oe({ options: () => ({ onRangeChange: c }) }, "onRangeChange", null, {
|
|
1537
1537
|
reason: "clear-press",
|
|
1538
1538
|
event: e.nativeEvent
|
|
1539
1539
|
});
|
|
@@ -1549,14 +1549,14 @@ var $ = {
|
|
|
1549
1549
|
pointsPerSeries: 2e3,
|
|
1550
1550
|
markers: 200,
|
|
1551
1551
|
panels: 12
|
|
1552
|
-
},
|
|
1553
|
-
function
|
|
1552
|
+
}, Kt = .01;
|
|
1553
|
+
function qt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
1554
1554
|
let i = e[0]?.points.map((e) => e.timestamp) ?? r;
|
|
1555
1555
|
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.`;
|
|
1556
1556
|
if (!u(e) || !u(n)) return "Series and markers require unique identifiers.";
|
|
1557
1557
|
for (let n of e) {
|
|
1558
1558
|
if (n.points.length !== i.length) return "Every series must supply the same observation timestamps.";
|
|
1559
|
-
let e =
|
|
1559
|
+
let e = Qt({
|
|
1560
1560
|
points: n.points,
|
|
1561
1561
|
timestamps: i,
|
|
1562
1562
|
isStacked: t
|
|
@@ -1564,7 +1564,7 @@ function Xt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
|
1564
1564
|
if (e !== void 0) return e;
|
|
1565
1565
|
}
|
|
1566
1566
|
for (let t of n) {
|
|
1567
|
-
let n =
|
|
1567
|
+
let n = Jt({
|
|
1568
1568
|
marker: t,
|
|
1569
1569
|
series: e,
|
|
1570
1570
|
timestamps: i
|
|
@@ -1575,7 +1575,7 @@ function Xt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
|
1575
1575
|
if (!Number.isFinite(o) || !Number.isFinite(s)) return "The elapsed-time and value ranges must be finite.";
|
|
1576
1576
|
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.";
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1578
|
+
function Jt({ marker: e, series: t, timestamps: n }) {
|
|
1579
1579
|
if (e.kind === "event") {
|
|
1580
1580
|
let t = n[0] ?? 0, r = n.at(-1) ?? t, i = e.timestamp >= t && e.timestamp <= r;
|
|
1581
1581
|
return Number.isFinite(e.timestamp) && i ? void 0 : "Every event marker must fall inside the observed time range.";
|
|
@@ -1583,7 +1583,7 @@ function Zt({ marker: e, series: t, timestamps: n }) {
|
|
|
1583
1583
|
if (!n.includes(e.timestamp)) return "Every time and point marker must align with an observation timestamp.";
|
|
1584
1584
|
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.";
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function Yt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
1587
1587
|
return JSON.stringify([
|
|
1588
1588
|
n,
|
|
1589
1589
|
r,
|
|
@@ -1603,12 +1603,12 @@ function Qt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
|
1603
1603
|
])
|
|
1604
1604
|
]);
|
|
1605
1605
|
}
|
|
1606
|
-
function
|
|
1606
|
+
function Xt(e, t) {
|
|
1607
1607
|
if (e !== t) return [e, t];
|
|
1608
|
-
let n = Math.max(1, Math.abs(e) *
|
|
1608
|
+
let n = Math.max(1, Math.abs(e) * Kt), r = e - n, i = t + n;
|
|
1609
1609
|
return [Number.isFinite(r) ? r : e, Number.isFinite(i) ? i : t];
|
|
1610
1610
|
}
|
|
1611
|
-
function
|
|
1611
|
+
function Zt({ series: e, isStacked: t, tones: n }) {
|
|
1612
1612
|
let r = e.filter((e) => e.tone === void 0);
|
|
1613
1613
|
return e.map((i, a) => {
|
|
1614
1614
|
let o = r.findIndex((e) => e.id === i.id), s = n({
|
|
@@ -1630,7 +1630,7 @@ function en({ series: e, isStacked: t, tones: n }) {
|
|
|
1630
1630
|
};
|
|
1631
1631
|
});
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1633
|
+
function Qt({ points: e, timestamps: t, isStacked: n }) {
|
|
1634
1634
|
for (let [r, i] of e.entries()) {
|
|
1635
1635
|
let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
|
|
1636
1636
|
if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
|
|
@@ -1639,21 +1639,21 @@ function tn({ points: e, timestamps: t, isStacked: n }) {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
}
|
|
1641
1641
|
// packages/charts/src/cartesian/time-series-line.tsx
|
|
1642
|
-
function
|
|
1642
|
+
function $t({ series: e, x: t, y: n, pointRadius: r = 3 }) {
|
|
1643
1643
|
let i = e.points.findLastIndex((e) => e.value !== null);
|
|
1644
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("path", {
|
|
1645
1645
|
d: H(e.points.map((e) => ({
|
|
1646
1646
|
x: t(e.timestamp),
|
|
1647
1647
|
y: e.value === null ? null : n(e.value + e.base)
|
|
1648
1648
|
}))),
|
|
1649
1649
|
fill: "none",
|
|
1650
1650
|
stroke: o[e.tone],
|
|
1651
|
-
...
|
|
1651
|
+
...W.props(P.mark)
|
|
1652
1652
|
}), e.points.filter((t, n) => {
|
|
1653
1653
|
if (t.value === null) return !1;
|
|
1654
1654
|
let r = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
|
|
1655
1655
|
return e.points.length === 1 || n === i || r;
|
|
1656
|
-
}).map((i) => /* @__PURE__ */
|
|
1656
|
+
}).map((i) => /* @__PURE__ */ J("circle", {
|
|
1657
1657
|
cx: t(i.timestamp),
|
|
1658
1658
|
cy: n((i.value ?? 0) + i.base),
|
|
1659
1659
|
r,
|
|
@@ -1661,18 +1661,18 @@ function nn({ series: e, x: t, y: n, pointRadius: r = 3 }) {
|
|
|
1661
1661
|
}, i.timestamp))] });
|
|
1662
1662
|
}
|
|
1663
1663
|
// packages/charts/src/cartesian/sparkline.tsx
|
|
1664
|
-
var
|
|
1664
|
+
var en = {
|
|
1665
1665
|
minimum: "Lowest",
|
|
1666
1666
|
maximum: "Highest",
|
|
1667
1667
|
last: "Latest"
|
|
1668
|
-
},
|
|
1668
|
+
}, tn = 2.5, nn = 3, rn = {
|
|
1669
1669
|
inline: {
|
|
1670
1670
|
width: 128,
|
|
1671
1671
|
height: 32
|
|
1672
1672
|
},
|
|
1673
1673
|
figure: { height: 48 }
|
|
1674
1674
|
};
|
|
1675
|
-
function
|
|
1675
|
+
function an({ points: e, marked: t }) {
|
|
1676
1676
|
let n = e.flatMap((e) => e.value === null ? [] : [{
|
|
1677
1677
|
...e,
|
|
1678
1678
|
value: e.value
|
|
@@ -1689,8 +1689,8 @@ function cn({ points: e, marked: t }) {
|
|
|
1689
1689
|
}];
|
|
1690
1690
|
});
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1693
|
-
let d = Te(), f = F(), m = u === "figure", h = m ? f.width :
|
|
1692
|
+
function on({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueDomain: s, markedPoints: c = [], baseline: l, layout: u = "inline" }) {
|
|
1693
|
+
let d = Te(), f = F(), m = u === "figure", h = m ? f.width : rn.inline.width, ee = m ? rn.figure.height : rn.inline.height, g = Te(), _ = T(), v = b(), y = sn({
|
|
1694
1694
|
title: t,
|
|
1695
1695
|
summary: n,
|
|
1696
1696
|
unit: r,
|
|
@@ -1699,7 +1699,7 @@ function ln({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueD
|
|
|
1699
1699
|
markedPoints: c,
|
|
1700
1700
|
baseline: l
|
|
1701
1701
|
}), te = a.points.some((e) => e.value !== null);
|
|
1702
|
-
if (y !== void 0 || !te) return /* @__PURE__ */
|
|
1702
|
+
if (y !== void 0 || !te) return /* @__PURE__ */ J("span", {
|
|
1703
1703
|
role: "img",
|
|
1704
1704
|
"aria-label": `${t}. ${n} Values in ${r}; timestamps in ${i}. ${y ?? "No recorded values. Missing observations remain unavailable."}`,
|
|
1705
1705
|
title: y ?? "No recorded values",
|
|
@@ -1707,19 +1707,19 @@ function ln({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueD
|
|
|
1707
1707
|
children: y === void 0 ? "No data" : "Invalid trend"
|
|
1708
1708
|
});
|
|
1709
1709
|
let x = a.points[0]?.timestamp ?? 0, S = a.points.at(-1)?.timestamp ?? x, C = A({
|
|
1710
|
-
domain:
|
|
1711
|
-
range: [
|
|
1710
|
+
domain: Xt(x, S),
|
|
1711
|
+
range: [nn, h - nn]
|
|
1712
1712
|
}).position, w = A({
|
|
1713
1713
|
domain: s,
|
|
1714
|
-
range: [ee -
|
|
1715
|
-
}).position, ne =
|
|
1714
|
+
range: [ee - nn, nn]
|
|
1715
|
+
}).position, ne = Zt({
|
|
1716
1716
|
series: [a],
|
|
1717
1717
|
isStacked: !1,
|
|
1718
1718
|
tones: _
|
|
1719
|
-
})[0], re = o[ne?.tone ?? "series1"], E =
|
|
1719
|
+
})[0], re = o[ne?.tone ?? "series1"], E = an({
|
|
1720
1720
|
points: a.points,
|
|
1721
1721
|
marked: c
|
|
1722
|
-
}), D = E.map(({ kind: e, point: t }) => `${
|
|
1722
|
+
}), D = E.map(({ kind: e, point: t }) => `${en[e]}: ${t.value} ${r}.`).join(" "), O = l === void 0 ? "" : `Reference: ${l} ${r}.`, k = /* @__PURE__ */ Y("svg", {
|
|
1723
1723
|
role: "img",
|
|
1724
1724
|
"aria-labelledby": d,
|
|
1725
1725
|
"aria-describedby": g,
|
|
@@ -1732,11 +1732,11 @@ function ln({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueD
|
|
|
1732
1732
|
1: { className: "x1lliihq xh8yej3 xt7dq6l" }
|
|
1733
1733
|
}[!!m | 0],
|
|
1734
1734
|
children: [
|
|
1735
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ J("title", {
|
|
1736
1736
|
id: d,
|
|
1737
1737
|
children: t
|
|
1738
1738
|
}),
|
|
1739
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ Y("desc", {
|
|
1740
1740
|
id: g,
|
|
1741
1741
|
children: [
|
|
1742
1742
|
n,
|
|
@@ -1757,50 +1757,50 @@ function ln({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueD
|
|
|
1757
1757
|
O
|
|
1758
1758
|
]
|
|
1759
1759
|
}),
|
|
1760
|
-
l !== void 0 && /* @__PURE__ */
|
|
1761
|
-
x1:
|
|
1762
|
-
x2: h -
|
|
1760
|
+
l !== void 0 && /* @__PURE__ */ J("line", {
|
|
1761
|
+
x1: nn,
|
|
1762
|
+
x2: h - nn,
|
|
1763
1763
|
y1: w(l),
|
|
1764
1764
|
y2: w(l),
|
|
1765
1765
|
className: "x1crw9hw xnpr05h xbw2l0c x13efnbd"
|
|
1766
1766
|
}),
|
|
1767
|
-
ne !== void 0 && /* @__PURE__ */
|
|
1767
|
+
ne !== void 0 && /* @__PURE__ */ J($t, {
|
|
1768
1768
|
series: ne,
|
|
1769
1769
|
x: C,
|
|
1770
1770
|
y: w,
|
|
1771
1771
|
pointRadius: 2
|
|
1772
1772
|
}),
|
|
1773
|
-
E.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */
|
|
1773
|
+
E.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */ J("circle", {
|
|
1774
1774
|
cx: C(t.timestamp),
|
|
1775
1775
|
cy: w(t.value),
|
|
1776
|
-
r:
|
|
1776
|
+
r: tn,
|
|
1777
1777
|
fill: re
|
|
1778
|
-
}, e) : /* @__PURE__ */
|
|
1778
|
+
}, e) : /* @__PURE__ */ J("circle", {
|
|
1779
1779
|
cx: C(t.timestamp),
|
|
1780
1780
|
cy: w(t.value),
|
|
1781
|
-
r:
|
|
1781
|
+
r: tn,
|
|
1782
1782
|
stroke: re,
|
|
1783
1783
|
className: "x1fytgo2 x1r6sdyr x13efnbd"
|
|
1784
1784
|
}, e))
|
|
1785
1785
|
]
|
|
1786
1786
|
});
|
|
1787
|
-
return m ? /* @__PURE__ */
|
|
1788
|
-
title: v ? /* @__PURE__ */
|
|
1789
|
-
...
|
|
1787
|
+
return m ? /* @__PURE__ */ J(p, {
|
|
1788
|
+
title: v ? /* @__PURE__ */ J("span", {
|
|
1789
|
+
...W.props(e.hidden),
|
|
1790
1790
|
children: t
|
|
1791
1791
|
}) : t,
|
|
1792
1792
|
description: v ? void 0 : n,
|
|
1793
|
-
children: /* @__PURE__ */
|
|
1793
|
+
children: /* @__PURE__ */ J("div", {
|
|
1794
1794
|
ref: f.ref,
|
|
1795
1795
|
className: "x1lliihq xeuugli",
|
|
1796
1796
|
children: k
|
|
1797
1797
|
})
|
|
1798
1798
|
}) : k;
|
|
1799
1799
|
}
|
|
1800
|
-
function
|
|
1800
|
+
function sn({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPoints: a, baseline: o }) {
|
|
1801
1801
|
if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
|
|
1802
1802
|
if (!O(i)) return "The displayed value domain must have finite, increasing bounds.";
|
|
1803
|
-
let s =
|
|
1803
|
+
let s = qt({
|
|
1804
1804
|
series: [r],
|
|
1805
1805
|
isStacked: !1,
|
|
1806
1806
|
markers: []
|
|
@@ -1811,11 +1811,11 @@ function un({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPo
|
|
|
1811
1811
|
if (!(o === void 0 || o >= i[0] && o <= i[1])) return "The reference value must be inside the declared value domain.";
|
|
1812
1812
|
}
|
|
1813
1813
|
// packages/charts/src/cartesian/time-series-bands.ts
|
|
1814
|
-
var
|
|
1814
|
+
var cn = {
|
|
1815
1815
|
bands: 4,
|
|
1816
1816
|
crossings: 4
|
|
1817
1817
|
};
|
|
1818
|
-
function
|
|
1818
|
+
function ln(e) {
|
|
1819
1819
|
let t = [
|
|
1820
1820
|
e.lower,
|
|
1821
1821
|
e.center,
|
|
@@ -1823,18 +1823,18 @@ function fn(e) {
|
|
|
1823
1823
|
].filter((e) => e !== null);
|
|
1824
1824
|
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.";
|
|
1825
1825
|
}
|
|
1826
|
-
function
|
|
1827
|
-
if (e.length >
|
|
1826
|
+
function un({ bands: e, crossings: t, series: n, timestamps: r }) {
|
|
1827
|
+
if (e.length > cn.bands || t.length > cn.crossings) return `Supply at most ${cn.bands} bands and ${cn.crossings} crossings.`;
|
|
1828
1828
|
if (!u([...n, ...e]) || !u(t)) return "Series, bands, and crossings require unique identifiers.";
|
|
1829
1829
|
for (let t of e) {
|
|
1830
1830
|
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.";
|
|
1831
|
-
let e = t.points.map(
|
|
1831
|
+
let e = t.points.map(ln).find((e) => e !== void 0);
|
|
1832
1832
|
if (e !== void 0) return e;
|
|
1833
1833
|
}
|
|
1834
1834
|
let i = new Set([...n, ...e].map((e) => e.id));
|
|
1835
1835
|
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.";
|
|
1836
1836
|
}
|
|
1837
|
-
function
|
|
1837
|
+
function dn({ series: e, bands: t, tones: n }) {
|
|
1838
1838
|
let r = e.filter((e) => e.tone === void 0).length, i = t.filter((e) => e.tone === void 0);
|
|
1839
1839
|
return t.map((e) => {
|
|
1840
1840
|
let t = r + i.findIndex((t) => t.id === e.id);
|
|
@@ -1848,7 +1848,7 @@ function mn({ series: e, bands: t, tones: n }) {
|
|
|
1848
1848
|
};
|
|
1849
1849
|
});
|
|
1850
1850
|
}
|
|
1851
|
-
function
|
|
1851
|
+
function fn({ start: e, end: t, value: n, direction: r }) {
|
|
1852
1852
|
let i = e > n && t <= n, a = e < n && t >= n;
|
|
1853
1853
|
switch (r) {
|
|
1854
1854
|
case "falling": return i;
|
|
@@ -1856,7 +1856,7 @@ function hn({ start: e, end: t, value: n, direction: r }) {
|
|
|
1856
1856
|
case void 0: return i || a;
|
|
1857
1857
|
}
|
|
1858
1858
|
}
|
|
1859
|
-
function
|
|
1859
|
+
function pn({ points: e, crossing: t }) {
|
|
1860
1860
|
let n = e.flatMap((t, n) => {
|
|
1861
1861
|
let r = e[n + 1];
|
|
1862
1862
|
return t.value === null || r === void 0 || r.value === null ? [] : [{
|
|
@@ -1865,7 +1865,7 @@ function gn({ points: e, crossing: t }) {
|
|
|
1865
1865
|
from: t.value,
|
|
1866
1866
|
to: r.value
|
|
1867
1867
|
}];
|
|
1868
|
-
}).find(({ from: e, to: n }) =>
|
|
1868
|
+
}).find(({ from: e, to: n }) => fn({
|
|
1869
1869
|
start: e,
|
|
1870
1870
|
end: n,
|
|
1871
1871
|
value: t.value,
|
|
@@ -1875,10 +1875,10 @@ function gn({ points: e, crossing: t }) {
|
|
|
1875
1875
|
let r = (t.value - n.from) / (n.to - n.from);
|
|
1876
1876
|
return n.start + r * (n.end - n.start);
|
|
1877
1877
|
}
|
|
1878
|
-
function
|
|
1878
|
+
function mn({ crossings: e, series: t, bands: n }) {
|
|
1879
1879
|
return e.map((e) => ({
|
|
1880
1880
|
crossing: e,
|
|
1881
|
-
timestamp:
|
|
1881
|
+
timestamp: pn({
|
|
1882
1882
|
points: t.find((t) => t.id === e.seriesId)?.points ?? n.find((t) => t.id === e.seriesId)?.points.map((e) => ({
|
|
1883
1883
|
timestamp: e.timestamp,
|
|
1884
1884
|
value: e.center
|
|
@@ -1887,181 +1887,23 @@ function _n({ crossings: e, series: t, bands: n }) {
|
|
|
1887
1887
|
})
|
|
1888
1888
|
}));
|
|
1889
1889
|
}
|
|
1890
|
-
function
|
|
1890
|
+
function hn(e, t) {
|
|
1891
1891
|
let n = Math.min(...e.map((e) => Math.abs(e - t)));
|
|
1892
1892
|
return e.find((e) => Math.abs(e - t) === n);
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1894
|
+
function gn(e) {
|
|
1895
1895
|
return e.flatMap((e) => e.points.flatMap((e) => [
|
|
1896
1896
|
e.lower,
|
|
1897
1897
|
e.center,
|
|
1898
1898
|
e.upper
|
|
1899
1899
|
].filter((e) => e !== null)));
|
|
1900
1900
|
}
|
|
1901
|
-
// packages/charts/src/chart-range.tsx
|
|
1902
|
-
var bn = "axis", xn = "selected", Sn = "drawn";
|
|
1903
|
-
function Cn({ value: e }) {
|
|
1904
|
-
return {
|
|
1905
|
-
value: e,
|
|
1906
|
-
spans: e === null ? [] : [{
|
|
1907
|
-
id: xn,
|
|
1908
|
-
track: bn,
|
|
1909
|
-
start: e[0],
|
|
1910
|
-
end: e[1]
|
|
1911
|
-
}]
|
|
1912
|
-
};
|
|
1913
|
-
}
|
|
1914
|
-
function wn(e, t) {
|
|
1915
|
-
let { draft: n } = e;
|
|
1916
|
-
return n?.action === "draw" ? t.filter((e) => e.id === n.id) : t;
|
|
1917
|
-
}
|
|
1918
|
-
var Tn = J({
|
|
1919
|
-
name: "chart-range",
|
|
1920
|
-
options: {
|
|
1921
|
-
value: "value",
|
|
1922
|
-
onValueChange: "callback",
|
|
1923
|
-
min: "number",
|
|
1924
|
-
max: "number",
|
|
1925
|
-
step: "number",
|
|
1926
|
-
describe: "value"
|
|
1927
|
-
},
|
|
1928
|
-
controlled: ["value"],
|
|
1929
|
-
state: (e) => ({
|
|
1930
|
-
...Cn(e),
|
|
1931
|
-
draft: null
|
|
1932
|
-
}),
|
|
1933
|
-
sync: Cn,
|
|
1934
|
-
api: (e) => {
|
|
1935
|
-
let t = q(e);
|
|
1936
|
-
function n(n, { id: r, action: i, reason: a, event: o }) {
|
|
1937
|
-
let s = i === "delete" ? void 0 : n.find((e) => e.id === r), c = s === void 0 ? null : [s.start, s.end], l = t("value", c, o === void 0 ? { reason: a } : {
|
|
1938
|
-
reason: a,
|
|
1939
|
-
event: o
|
|
1940
|
-
});
|
|
1941
|
-
return l && i === "delete" && e.element("root")?.querySelector("[tabindex=\"0\"]:not([data-span-id])")?.focus(), l;
|
|
1942
|
-
}
|
|
1943
|
-
let r = Oe(e, {
|
|
1944
|
-
key: "spans",
|
|
1945
|
-
draft: "draft",
|
|
1946
|
-
axis: "x",
|
|
1947
|
-
min: () => e.options().min,
|
|
1948
|
-
max: () => e.options().max,
|
|
1949
|
-
step: () => e.options().step,
|
|
1950
|
-
create: (e) => ({
|
|
1951
|
-
...e,
|
|
1952
|
-
id: Sn
|
|
1953
|
-
}),
|
|
1954
|
-
label: (t) => e.options().describe([t.start, t.end]),
|
|
1955
|
-
createAutoScroll: !1,
|
|
1956
|
-
set: (e, t) => n(e, t)
|
|
1957
|
-
});
|
|
1958
|
-
return {
|
|
1959
|
-
spans: r,
|
|
1960
|
-
shown(t) {
|
|
1961
|
-
return wn(t, r.spans(t)).map((t) => ({
|
|
1962
|
-
id: t.id,
|
|
1963
|
-
label: e.options().describe([t.start, t.end])
|
|
1964
|
-
}));
|
|
1965
|
-
},
|
|
1966
|
-
draw(e) {
|
|
1967
|
-
e.button === 0 && e.pointerType !== "touch" && r.trackPointerdown(e, bn);
|
|
1968
|
-
},
|
|
1969
|
-
setRange(n, r) {
|
|
1970
|
-
let { min: i, max: a, step: o } = e.options(), s = [Number(n), Number(r)].map((e) => i + Math.round((e - i) / o) * o), c = Math.max(i, Math.min(...s)), l = Math.min(a, Math.max(...s));
|
|
1971
|
-
if (!Number.isFinite(c) || !Number.isFinite(l) || c >= l) throw Error(`Give a start and a later end between ${i} and ${a}.`);
|
|
1972
|
-
return t("value", [c, l], { reason: "imperative" });
|
|
1973
|
-
},
|
|
1974
|
-
clear() {
|
|
1975
|
-
return t("value", null, { reason: "imperative" });
|
|
1976
|
-
}
|
|
1977
|
-
};
|
|
1978
|
-
},
|
|
1979
|
-
slots: (e) => ({
|
|
1980
|
-
root: e({
|
|
1981
|
-
role: "group",
|
|
1982
|
-
state: (e, { api: t }) => ({ spans: t.shown(e) }),
|
|
1983
|
-
on: { pointerdown: (e, { api: t }) => t.draw(e) }
|
|
1984
|
-
}),
|
|
1985
|
-
track: e({ bind: (e, { api: t }) => t.spans.bindTrack(e, bn) }),
|
|
1986
|
-
span: e({
|
|
1987
|
-
role: "group",
|
|
1988
|
-
props: { value: "string" },
|
|
1989
|
-
attrs: (e, { api: t, key: n }) => {
|
|
1990
|
-
let r = t.spans.spans(e).find((e) => e.id === n);
|
|
1991
|
-
return {
|
|
1992
|
-
...t.spans.spanAttrs(e, n),
|
|
1993
|
-
tabindex: "0",
|
|
1994
|
-
style: r === void 0 ? void 0 : t.spans.spanStyle(r)
|
|
1995
|
-
};
|
|
1996
|
-
},
|
|
1997
|
-
bind: (e, { api: t, key: n }) => t.spans.bindSpan(e, n),
|
|
1998
|
-
on: {
|
|
1999
|
-
pointerdown: (e, { api: t, key: n }) => t.spans.spanPointerdown(e, n),
|
|
2000
|
-
keydown: (e, { api: t, key: n }) => {
|
|
2001
|
-
t.spans.keydown(e, n);
|
|
2002
|
-
}
|
|
2003
|
-
}
|
|
2004
|
-
})
|
|
2005
|
-
}),
|
|
2006
|
-
agent: { actions: ["setRange", "clear"] }
|
|
2007
|
-
}), En = W(Tn, {
|
|
2008
|
-
root: "div",
|
|
2009
|
-
track: "div",
|
|
2010
|
-
span: "div"
|
|
2011
|
-
}), Dn = En.Root, On = En.Track, kn = En.Span, An = {
|
|
2012
|
-
kVAEAm: "x10l6tqk",
|
|
2013
|
-
k87sOh: "x13vifvy",
|
|
2014
|
-
kfzvcC: "x47corl",
|
|
2015
|
-
$$css: !0
|
|
2016
|
-
}, jn = { track: (e, t, n) => [
|
|
2017
|
-
An,
|
|
2018
|
-
{
|
|
2019
|
-
kbCHJM: e == null ? e : "xgq9j65",
|
|
2020
|
-
kzqmXN: t == null ? t : "x5lhr3w",
|
|
2021
|
-
kZKoxP: n == null ? n : "x16ye13r",
|
|
2022
|
-
$$css: !0
|
|
2023
|
-
},
|
|
2024
|
-
{
|
|
2025
|
-
"--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
|
|
2026
|
-
"--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t),
|
|
2027
|
-
"--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(n)
|
|
2028
|
-
}
|
|
2029
|
-
] };
|
|
2030
|
-
function Mn({ left: e, width: t, height: n, label: r, children: i, ...a }) {
|
|
2031
|
-
return /* @__PURE__ */ X(Dn, {
|
|
2032
|
-
...a,
|
|
2033
|
-
"aria-label": r,
|
|
2034
|
-
className: "x1n2onr6 xeuugli",
|
|
2035
|
-
render: (r, { spans: a }) => /* @__PURE__ */ Z("div", {
|
|
2036
|
-
...r,
|
|
2037
|
-
children: [i, /* @__PURE__ */ X(On, {
|
|
2038
|
-
...U.props(jn.track(e, t, n)),
|
|
2039
|
-
children: a.map((e) => /* @__PURE__ */ Z(kn, {
|
|
2040
|
-
value: e.id,
|
|
2041
|
-
"aria-label": `Selected range, ${e.label}. Use arrow keys to move it, Shift and an arrow to move its end, and Delete to clear it.`,
|
|
2042
|
-
className: "x10l6tqk x13vifvy x5yr21d x9f619 x1qatu44 x1l0rsgs x1616tdu xbsl7fq xbm8b0d x1n2ykn x1t137rt x19rmrnh x9v5kkp x13qnu6 x1bqaal",
|
|
2043
|
-
children: [
|
|
2044
|
-
/* @__PURE__ */ X("span", { className: "x10l6tqk x67bb7w x5ve5x3 x7it7wx x1ey2m1c xdk7pt x1jm3nie x1o753nm x1jzqe4 x3onkmb" }),
|
|
2045
|
-
/* @__PURE__ */ X("span", {
|
|
2046
|
-
"data-span-edge": "start",
|
|
2047
|
-
className: "x10l6tqk x67bb7w x5ve5x3 x13vifvy x5yr21d x1fsd2vl x7eptgl x1765b1"
|
|
2048
|
-
}),
|
|
2049
|
-
/* @__PURE__ */ X("span", {
|
|
2050
|
-
"data-span-edge": "end",
|
|
2051
|
-
className: "x10l6tqk x67bb7w x5ve5x3 x13vifvy x5yr21d x1fsd2vl x7eptgl xpa5qit"
|
|
2052
|
-
})
|
|
2053
|
-
]
|
|
2054
|
-
}, e.id))
|
|
2055
|
-
})]
|
|
2056
|
-
})
|
|
2057
|
-
});
|
|
2058
|
-
}
|
|
2059
1901
|
// packages/charts/src/cartesian/time-series-overlays.tsx
|
|
2060
|
-
var
|
|
2061
|
-
function
|
|
1902
|
+
var _n = 16, vn = 6, yn = 6.5, bn = 4;
|
|
1903
|
+
function xn({ instants: e, x: t, right: n, ends: r }) {
|
|
2062
1904
|
let [i, ...a] = e;
|
|
2063
1905
|
if (i === void 0) return [];
|
|
2064
|
-
let o = t(i.timestamp), s = i.label.length *
|
|
1906
|
+
let o = t(i.timestamp), s = i.label.length * yn + vn, 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 = [
|
|
2065
1907
|
...r.slice(0, f),
|
|
2066
1908
|
Math.max(u, r[f] ?? u),
|
|
2067
1909
|
...r.slice(f + 1)
|
|
@@ -2070,26 +1912,26 @@ function Ln({ instants: e, x: t, right: n, ends: r }) {
|
|
|
2070
1912
|
...i,
|
|
2071
1913
|
lane: f,
|
|
2072
1914
|
anchor: c
|
|
2073
|
-
}, ...
|
|
1915
|
+
}, ...xn({
|
|
2074
1916
|
instants: a,
|
|
2075
1917
|
x: t,
|
|
2076
1918
|
right: n,
|
|
2077
1919
|
ends: p
|
|
2078
1920
|
})];
|
|
2079
1921
|
}
|
|
2080
|
-
function
|
|
2081
|
-
return
|
|
1922
|
+
function Sn({ instants: e, x: t, right: n }) {
|
|
1923
|
+
return xn({
|
|
2082
1924
|
instants: e.toSorted((e, t) => e.timestamp - t.timestamp),
|
|
2083
1925
|
x: t,
|
|
2084
1926
|
right: n,
|
|
2085
1927
|
ends: []
|
|
2086
1928
|
});
|
|
2087
1929
|
}
|
|
2088
|
-
function
|
|
2089
|
-
return Math.max(0, ...e.map((e) => e.lane + 1)) *
|
|
1930
|
+
function Cn(e) {
|
|
1931
|
+
return Math.max(0, ...e.map((e) => e.lane + 1)) * _n;
|
|
2090
1932
|
}
|
|
2091
|
-
function
|
|
2092
|
-
return /* @__PURE__ */
|
|
1933
|
+
function wn({ bands: e, x: t, y: n }) {
|
|
1934
|
+
return /* @__PURE__ */ J("g", { children: e.map((e) => {
|
|
2093
1935
|
function r(t) {
|
|
2094
1936
|
return e.points.map((e) => {
|
|
2095
1937
|
let r = t(e);
|
|
@@ -2097,14 +1939,14 @@ function Bn({ bands: e, x: t, y: n }) {
|
|
|
2097
1939
|
});
|
|
2098
1940
|
}
|
|
2099
1941
|
let i = r((e) => e.lower), a = r((e) => e.upper), o = r((e) => e.center), s = e.points.map((e) => t(e.timestamp));
|
|
2100
|
-
return /* @__PURE__ */
|
|
1942
|
+
return /* @__PURE__ */ Y("g", { children: [/* @__PURE__ */ J(B, {
|
|
2101
1943
|
d: Ce(s.map((e, t) => ({
|
|
2102
1944
|
x: e,
|
|
2103
1945
|
y0: i[t] ?? null,
|
|
2104
1946
|
y1: a[t] ?? null
|
|
2105
1947
|
}))),
|
|
2106
1948
|
tone: e.tone
|
|
2107
|
-
}), /* @__PURE__ */
|
|
1949
|
+
}), /* @__PURE__ */ J(pe, {
|
|
2108
1950
|
d: H(s.map((e, t) => ({
|
|
2109
1951
|
x: e,
|
|
2110
1952
|
y: o[t] ?? null
|
|
@@ -2113,25 +1955,25 @@ function Bn({ bands: e, x: t, y: n }) {
|
|
|
2113
1955
|
})] }, e.id);
|
|
2114
1956
|
}) });
|
|
2115
1957
|
}
|
|
2116
|
-
function
|
|
2117
|
-
let a = r -
|
|
2118
|
-
return /* @__PURE__ */
|
|
1958
|
+
function Tn({ placed: e, x: t, y: n, top: r, bottom: i }) {
|
|
1959
|
+
let a = r - Cn(e);
|
|
1960
|
+
return /* @__PURE__ */ J("g", {
|
|
2119
1961
|
"aria-hidden": !0,
|
|
2120
1962
|
children: e.map((e) => {
|
|
2121
|
-
let r = t(e.timestamp), o = a + (e.lane + 1 / 2) *
|
|
2122
|
-
return /* @__PURE__ */
|
|
2123
|
-
/* @__PURE__ */
|
|
1963
|
+
let r = t(e.timestamp), o = a + (e.lane + 1 / 2) * _n, s = e.anchor === "start" ? r + vn : r - vn;
|
|
1964
|
+
return /* @__PURE__ */ Y("g", { children: [
|
|
1965
|
+
/* @__PURE__ */ J(me, {
|
|
2124
1966
|
x: r,
|
|
2125
1967
|
top: o,
|
|
2126
1968
|
bottom: i
|
|
2127
1969
|
}),
|
|
2128
|
-
/* @__PURE__ */
|
|
1970
|
+
/* @__PURE__ */ J(L, {
|
|
2129
1971
|
x: s,
|
|
2130
|
-
y: o +
|
|
1972
|
+
y: o + bn,
|
|
2131
1973
|
anchor: e.anchor,
|
|
2132
1974
|
children: e.label
|
|
2133
1975
|
}),
|
|
2134
|
-
e.value !== void 0 && /* @__PURE__ */
|
|
1976
|
+
e.value !== void 0 && /* @__PURE__ */ J(R, {
|
|
2135
1977
|
x: r,
|
|
2136
1978
|
y: n(e.value)
|
|
2137
1979
|
})
|
|
@@ -2140,35 +1982,35 @@ function Vn({ placed: e, x: t, y: n, top: r, bottom: i }) {
|
|
|
2140
1982
|
});
|
|
2141
1983
|
}
|
|
2142
1984
|
// packages/charts/src/cartesian/time-series.tsx
|
|
2143
|
-
var
|
|
1985
|
+
var En = {
|
|
2144
1986
|
seconds: 1e3,
|
|
2145
1987
|
milliseconds: 1
|
|
2146
|
-
},
|
|
1988
|
+
}, Dn = 24, On = 12, kn = 2.5, An = 4, jn = {
|
|
2147
1989
|
line: "line",
|
|
2148
1990
|
area: "swatch"
|
|
2149
1991
|
};
|
|
2150
|
-
function
|
|
2151
|
-
return e *
|
|
1992
|
+
function Mn(e, t) {
|
|
1993
|
+
return e * En[t];
|
|
2152
1994
|
}
|
|
2153
|
-
function
|
|
1995
|
+
function Nn({ format: e, tickFormat: t, label: n = "" }) {
|
|
2154
1996
|
return {
|
|
2155
1997
|
label: n,
|
|
2156
1998
|
format: e,
|
|
2157
1999
|
tickFormat: t
|
|
2158
2000
|
};
|
|
2159
2001
|
}
|
|
2160
|
-
function
|
|
2002
|
+
function Pn({ series: e, isStacked: t, isZeroBased: n, bands: r, crossings: i }) {
|
|
2161
2003
|
let a = (e[0]?.points ?? []).map((t, n) => e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)), o = t ? a : e.flatMap((e) => e.points.map((e) => e.value));
|
|
2162
2004
|
return f({
|
|
2163
2005
|
values: [
|
|
2164
2006
|
...o,
|
|
2165
|
-
...
|
|
2007
|
+
...gn(r),
|
|
2166
2008
|
...i.map((e) => e.value)
|
|
2167
2009
|
],
|
|
2168
2010
|
isZeroBased: n
|
|
2169
2011
|
});
|
|
2170
2012
|
}
|
|
2171
|
-
function
|
|
2013
|
+
function Fn({ bands: e, crossings: t }) {
|
|
2172
2014
|
return JSON.stringify([e.map((e) => [
|
|
2173
2015
|
e.id,
|
|
2174
2016
|
e.label,
|
|
@@ -2188,7 +2030,7 @@ function Zn({ bands: e, crossings: t }) {
|
|
|
2188
2030
|
e.direction
|
|
2189
2031
|
])]);
|
|
2190
2032
|
}
|
|
2191
|
-
function
|
|
2033
|
+
function In({ bands: e, timestamp: t, valueText: n }) {
|
|
2192
2034
|
return e.flatMap((e) => {
|
|
2193
2035
|
let r = e.points.find((e) => e.timestamp === t), i = r?.center ?? null, a = r?.lower !== null && r?.upper !== null && r !== void 0;
|
|
2194
2036
|
return [{
|
|
@@ -2206,28 +2048,28 @@ function Qn({ bands: e, timestamp: t, valueText: n }) {
|
|
|
2206
2048
|
}];
|
|
2207
2049
|
});
|
|
2208
2050
|
}
|
|
2209
|
-
function
|
|
2051
|
+
function Ln({ found: e, timeText: t }) {
|
|
2210
2052
|
return e.timestamp === void 0 ? `${e.crossing.label} · Not reached in this range` : `About ${t(e.timestamp)} · ${e.crossing.label}`;
|
|
2211
2053
|
}
|
|
2212
|
-
function
|
|
2213
|
-
return /* @__PURE__ */
|
|
2054
|
+
function Rn(e) {
|
|
2055
|
+
return /* @__PURE__ */ J(Wn, {
|
|
2214
2056
|
...e,
|
|
2215
2057
|
kind: "line",
|
|
2216
2058
|
isStacked: !1
|
|
2217
2059
|
});
|
|
2218
2060
|
}
|
|
2219
|
-
function
|
|
2220
|
-
return /* @__PURE__ */
|
|
2061
|
+
function zn({ isStacked: e = !1, ...t }) {
|
|
2062
|
+
return /* @__PURE__ */ J(Wn, {
|
|
2221
2063
|
...t,
|
|
2222
2064
|
kind: "area",
|
|
2223
2065
|
isStacked: e
|
|
2224
2066
|
});
|
|
2225
2067
|
}
|
|
2226
|
-
function
|
|
2227
|
-
return /* @__PURE__ */
|
|
2068
|
+
function Bn(e) {
|
|
2069
|
+
return /* @__PURE__ */ J(Vn, { ...e });
|
|
2228
2070
|
}
|
|
2229
|
-
function
|
|
2230
|
-
let o = Te(), s = T(), c =
|
|
2071
|
+
function Vn({ series: e, height: t = "compact", showTimeAxis: n = !0, ...a }) {
|
|
2072
|
+
let o = Te(), s = T(), c = Zt({
|
|
2231
2073
|
series: e.map((e) => ({
|
|
2232
2074
|
...e,
|
|
2233
2075
|
points: []
|
|
@@ -2235,15 +2077,15 @@ function rr({ series: e, height: t = "compact", showTimeAxis: n = !0, ...a }) {
|
|
|
2235
2077
|
isStacked: !1,
|
|
2236
2078
|
tones: s
|
|
2237
2079
|
});
|
|
2238
|
-
return /* @__PURE__ */
|
|
2080
|
+
return /* @__PURE__ */ J("div", {
|
|
2239
2081
|
"aria-hidden": !0,
|
|
2240
2082
|
inert: !0,
|
|
2241
2083
|
className: "xeuugli",
|
|
2242
|
-
children: /* @__PURE__ */
|
|
2084
|
+
children: /* @__PURE__ */ J(ce, {
|
|
2243
2085
|
...a,
|
|
2244
2086
|
status: "loading",
|
|
2245
2087
|
series: c,
|
|
2246
|
-
seriesLegend: /* @__PURE__ */
|
|
2088
|
+
seriesLegend: /* @__PURE__ */ J(M, {
|
|
2247
2089
|
id: o,
|
|
2248
2090
|
label: void 0,
|
|
2249
2091
|
legend: c,
|
|
@@ -2252,61 +2094,61 @@ function rr({ series: e, height: t = "compact", showTimeAxis: n = !0, ...a }) {
|
|
|
2252
2094
|
width: 0,
|
|
2253
2095
|
hasSeriesSummary: a.report?.seriesValues !== void 0
|
|
2254
2096
|
}),
|
|
2255
|
-
children: /* @__PURE__ */
|
|
2097
|
+
children: /* @__PURE__ */ J("div", {
|
|
2256
2098
|
className: "xrvj5dj x1n8ia3y",
|
|
2257
|
-
children: /* @__PURE__ */
|
|
2099
|
+
children: /* @__PURE__ */ Y("div", {
|
|
2258
2100
|
className: "xeuugli",
|
|
2259
|
-
children: [/* @__PURE__ */
|
|
2101
|
+
children: [/* @__PURE__ */ J(i, { height: m[t] - Dn }), /* @__PURE__ */ J("div", {
|
|
2260
2102
|
className: "x78zum5 x6s0dn4 x1qughib x8zbtdt xxk0z11",
|
|
2261
|
-
children: n && /* @__PURE__ */
|
|
2103
|
+
children: n && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(r, { width: "8ch" }), /* @__PURE__ */ J(r, { width: "8ch" })] })
|
|
2262
2104
|
})]
|
|
2263
2105
|
})
|
|
2264
2106
|
})
|
|
2265
2107
|
})
|
|
2266
2108
|
});
|
|
2267
2109
|
}
|
|
2268
|
-
function
|
|
2110
|
+
function Hn({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact", locale: i, status: a }) {
|
|
2269
2111
|
let o = K(null), [s, c] = Ee(), l = JSON.stringify(e.map((e) => [
|
|
2270
2112
|
e.id,
|
|
2271
2113
|
e.title,
|
|
2272
|
-
|
|
2114
|
+
Yt({
|
|
2273
2115
|
series: e.series,
|
|
2274
2116
|
markers: e.markers ?? [],
|
|
2275
2117
|
timestampUnit: t,
|
|
2276
2118
|
isStacked: !1
|
|
2277
2119
|
})
|
|
2278
2120
|
])), d = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), f = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === d);
|
|
2279
|
-
if (s !== void 0 && s.signature !== l && c(void 0), a === "loading") return /* @__PURE__ */
|
|
2121
|
+
if (s !== void 0 && s.signature !== l && c(void 0), a === "loading") return /* @__PURE__ */ J(Un, {
|
|
2280
2122
|
charts: e,
|
|
2281
2123
|
height: r,
|
|
2282
2124
|
locale: i
|
|
2283
2125
|
});
|
|
2284
|
-
if (!f || !u(e)) return /* @__PURE__ */
|
|
2126
|
+
if (!f || !u(e)) return /* @__PURE__ */ J(le, {
|
|
2285
2127
|
title: "Small multiples",
|
|
2286
2128
|
locale: i,
|
|
2287
2129
|
message: "Charts need unique identifiers and aligned observation timestamps."
|
|
2288
2130
|
});
|
|
2289
|
-
if (e.length > $.panels) return /* @__PURE__ */
|
|
2131
|
+
if (e.length > $.panels) return /* @__PURE__ */ J(le, {
|
|
2290
2132
|
title: "Small multiples",
|
|
2291
2133
|
locale: i,
|
|
2292
2134
|
message: `Choose at most ${$.panels} panels.`
|
|
2293
2135
|
});
|
|
2294
|
-
if (e.length === 0) return /* @__PURE__ */
|
|
2136
|
+
if (e.length === 0) return /* @__PURE__ */ J(ce, {
|
|
2295
2137
|
title: "Small multiples",
|
|
2296
2138
|
locale: i,
|
|
2297
|
-
children: /* @__PURE__ */
|
|
2139
|
+
children: /* @__PURE__ */ J(ue, { children: "No charts" })
|
|
2298
2140
|
});
|
|
2299
2141
|
let p = g({
|
|
2300
2142
|
height: m[r],
|
|
2301
2143
|
locale: i,
|
|
2302
2144
|
hasValueTitle: e.some((e) => e.valueLabel !== void 0),
|
|
2303
2145
|
axes: e.map((e) => ({
|
|
2304
|
-
axis:
|
|
2146
|
+
axis: Nn({
|
|
2305
2147
|
format: e.valueFormat,
|
|
2306
2148
|
tickFormat: e.tickFormat,
|
|
2307
2149
|
label: e.valueLabel
|
|
2308
2150
|
}),
|
|
2309
|
-
domain:
|
|
2151
|
+
domain: Pn({
|
|
2310
2152
|
series: e.series,
|
|
2311
2153
|
isStacked: !1,
|
|
2312
2154
|
isZeroBased: !1,
|
|
@@ -2315,18 +2157,18 @@ function ir({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
|
|
|
2315
2157
|
})
|
|
2316
2158
|
}))
|
|
2317
2159
|
}), h = e.every((e) => e.report !== void 0);
|
|
2318
|
-
return /* @__PURE__ */
|
|
2160
|
+
return /* @__PURE__ */ J("div", {
|
|
2319
2161
|
ref: o,
|
|
2320
2162
|
...{
|
|
2321
2163
|
0: { className: "xrvj5dj x1j825kq" },
|
|
2322
2164
|
1: { className: "xrvj5dj xxhr3t" }
|
|
2323
2165
|
}[!!h | 0],
|
|
2324
|
-
children: e.map(({ id: u, ...d }, f) => /* @__PURE__ */
|
|
2166
|
+
children: e.map(({ id: u, ...d }, f) => /* @__PURE__ */ J("div", {
|
|
2325
2167
|
...{
|
|
2326
2168
|
0: {},
|
|
2327
2169
|
1: { className: "x1y332i5" }
|
|
2328
2170
|
}[!!(h && f > 0) | 0],
|
|
2329
|
-
children: /* @__PURE__ */
|
|
2171
|
+
children: /* @__PURE__ */ J(Wn, {
|
|
2330
2172
|
...d,
|
|
2331
2173
|
locale: i,
|
|
2332
2174
|
status: a,
|
|
@@ -2351,26 +2193,26 @@ function ir({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
|
|
|
2351
2193
|
}, u))
|
|
2352
2194
|
});
|
|
2353
2195
|
}
|
|
2354
|
-
function
|
|
2355
|
-
if (!u(e) || e.length > $.panels) return /* @__PURE__ */
|
|
2196
|
+
function Un({ charts: e, height: t, locale: n }) {
|
|
2197
|
+
if (!u(e) || e.length > $.panels) return /* @__PURE__ */ J(le, {
|
|
2356
2198
|
title: "Small multiples",
|
|
2357
2199
|
locale: n,
|
|
2358
2200
|
message: `Choose at most ${$.panels} panels with unique identifiers.`
|
|
2359
2201
|
});
|
|
2360
2202
|
let r = e.every((e) => e.report !== void 0);
|
|
2361
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ J("div", {
|
|
2362
2204
|
"aria-hidden": !0,
|
|
2363
2205
|
inert: !0,
|
|
2364
2206
|
...{
|
|
2365
2207
|
0: { className: "xrvj5dj x1j825kq" },
|
|
2366
2208
|
1: { className: "xrvj5dj xxhr3t" }
|
|
2367
2209
|
}[!!r | 0],
|
|
2368
|
-
children: e.map(({ id: i, ...a }, o) => /* @__PURE__ */
|
|
2210
|
+
children: e.map(({ id: i, ...a }, o) => /* @__PURE__ */ J("div", {
|
|
2369
2211
|
...{
|
|
2370
2212
|
0: {},
|
|
2371
2213
|
1: { className: "x1y332i5" }
|
|
2372
2214
|
}[!!(r && o > 0) | 0],
|
|
2373
|
-
children: /* @__PURE__ */
|
|
2215
|
+
children: /* @__PURE__ */ J(Vn, {
|
|
2374
2216
|
...a,
|
|
2375
2217
|
locale: n,
|
|
2376
2218
|
height: t,
|
|
@@ -2379,34 +2221,34 @@ function ar({ charts: e, height: t, locale: n }) {
|
|
|
2379
2221
|
}, i))
|
|
2380
2222
|
});
|
|
2381
2223
|
}
|
|
2382
|
-
function
|
|
2383
|
-
let { title: S, locale: C, report: w } = x, E = T(), D = ve(c), O = Te(), k = h[0]?.points.map((e) => e.timestamp) ?? [], A = e[0]?.points.map((e) => e.timestamp) ?? k, ie =
|
|
2224
|
+
function Wn({ series: e, timestampUnit: n, timeFormat: r, valueFormat: i, tickFormat: a, valueLabel: o, markers: s = [], height: c = "compact", kind: u, isStacked: d, sharedInspection: f, gutter: p, showTimeAxis: m = !0, bands: h = [], crossings: g = [], range: _ = null, onRangeChange: v, rangeStep: b, emptyLabel: te = "No observations", ...x }) {
|
|
2225
|
+
let { title: S, locale: C, report: w } = x, E = T(), D = ve(c), O = Te(), k = h[0]?.points.map((e) => e.timestamp) ?? [], A = e[0]?.points.map((e) => e.timestamp) ?? k, ie = qt({
|
|
2384
2226
|
series: e,
|
|
2385
2227
|
isStacked: d,
|
|
2386
2228
|
markers: s,
|
|
2387
2229
|
timeline: k
|
|
2388
|
-
}) ??
|
|
2230
|
+
}) ?? un({
|
|
2389
2231
|
bands: h,
|
|
2390
2232
|
crossings: g,
|
|
2391
2233
|
series: e,
|
|
2392
2234
|
timestamps: A
|
|
2393
|
-
}) ??
|
|
2235
|
+
}) ?? Gn({
|
|
2394
2236
|
range: _,
|
|
2395
2237
|
rangeStep: b,
|
|
2396
2238
|
isSelectable: v !== void 0,
|
|
2397
2239
|
timeline: A
|
|
2398
|
-
}), j = ie === void 0 ?
|
|
2240
|
+
}), j = ie === void 0 ? Zt({
|
|
2399
2241
|
series: e,
|
|
2400
2242
|
isStacked: d,
|
|
2401
2243
|
tones: E
|
|
2402
|
-
}) : [], N = ie === void 0 ?
|
|
2244
|
+
}) : [], N = ie === void 0 ? dn({
|
|
2403
2245
|
series: e,
|
|
2404
2246
|
bands: h,
|
|
2405
2247
|
tones: E
|
|
2406
2248
|
}) : [], P = j[0]?.points ?? N[0]?.points ?? [];
|
|
2407
2249
|
function F(e) {
|
|
2408
2250
|
return ne({
|
|
2409
|
-
timestamp:
|
|
2251
|
+
timestamp: Mn(e, n),
|
|
2410
2252
|
locale: C,
|
|
2411
2253
|
format: r
|
|
2412
2254
|
});
|
|
@@ -2421,51 +2263,51 @@ function or({ series: e, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2421
2263
|
let fe = P.map(({ timestamp: e }) => ({
|
|
2422
2264
|
id: String(e),
|
|
2423
2265
|
label: F(e)
|
|
2424
|
-
})), B = `${
|
|
2266
|
+
})), B = `${Yt({
|
|
2425
2267
|
series: e,
|
|
2426
2268
|
markers: s,
|
|
2427
2269
|
timestampUnit: n,
|
|
2428
2270
|
isStacked: d
|
|
2429
|
-
})}${
|
|
2271
|
+
})}${Fn({
|
|
2430
2272
|
bands: h,
|
|
2431
2273
|
crossings: g
|
|
2432
2274
|
})}`, V = [...j.map(({ id: e, label: t, tone: n }) => ({
|
|
2433
2275
|
id: e,
|
|
2434
2276
|
label: t,
|
|
2435
2277
|
tone: n,
|
|
2436
|
-
shape:
|
|
2278
|
+
shape: jn[u]
|
|
2437
2279
|
})), ...N.map(({ id: e, label: t, tone: n }) => ({
|
|
2438
2280
|
id: e,
|
|
2439
2281
|
label: t,
|
|
2440
2282
|
tone: n,
|
|
2441
2283
|
shape: "band"
|
|
2442
2284
|
}))], he = w?.seriesValues !== void 0;
|
|
2443
|
-
if (x.status === "loading") return /* @__PURE__ */
|
|
2285
|
+
if (x.status === "loading") return /* @__PURE__ */ J(Vn, {
|
|
2444
2286
|
...x,
|
|
2445
2287
|
series: e,
|
|
2446
2288
|
height: c,
|
|
2447
2289
|
showTimeAxis: m
|
|
2448
2290
|
});
|
|
2449
|
-
if (ie !== void 0) return /* @__PURE__ */
|
|
2291
|
+
if (ie !== void 0) return /* @__PURE__ */ J(le, {
|
|
2450
2292
|
...x,
|
|
2451
2293
|
message: ie
|
|
2452
2294
|
});
|
|
2453
|
-
if (P.length === 0) return /* @__PURE__ */
|
|
2295
|
+
if (P.length === 0) return /* @__PURE__ */ J(ce, {
|
|
2454
2296
|
...x,
|
|
2455
2297
|
series: V,
|
|
2456
|
-
children: /* @__PURE__ */
|
|
2298
|
+
children: /* @__PURE__ */ J(ue, { children: te })
|
|
2457
2299
|
});
|
|
2458
|
-
let be = P.map((e) => e.timestamp), xe =
|
|
2300
|
+
let be = P.map((e) => e.timestamp), xe = mn({
|
|
2459
2301
|
crossings: g,
|
|
2460
2302
|
series: e,
|
|
2461
2303
|
bands: h
|
|
2462
|
-
}),
|
|
2304
|
+
}), W = [...s.flatMap((e) => e.kind === "event" ? [e] : []), ...xe.flatMap(({ crossing: e, timestamp: t }) => t === void 0 ? [] : [{
|
|
2463
2305
|
id: e.id,
|
|
2464
2306
|
timestamp: t,
|
|
2465
2307
|
label: e.label,
|
|
2466
2308
|
value: e.value
|
|
2467
2309
|
}])];
|
|
2468
|
-
function
|
|
2310
|
+
function G(e) {
|
|
2469
2311
|
return {
|
|
2470
2312
|
label: e === void 0 ? void 0 : F(e),
|
|
2471
2313
|
rows: [...j.map((t) => {
|
|
@@ -2476,66 +2318,66 @@ function or({ series: e, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2476
2318
|
tone: t.tone,
|
|
2477
2319
|
value: L(n?.value ?? null)
|
|
2478
2320
|
};
|
|
2479
|
-
}), ...
|
|
2321
|
+
}), ...In({
|
|
2480
2322
|
bands: N,
|
|
2481
2323
|
timestamp: e,
|
|
2482
2324
|
valueText: L
|
|
2483
2325
|
})],
|
|
2484
|
-
notes: [...s.filter((t) => t.kind !== "event" && t.timestamp === e).map((e) => e.label), ...
|
|
2326
|
+
notes: [...s.filter((t) => t.kind !== "event" && t.timestamp === e).map((e) => e.label), ...W.filter((t) => hn(be, t.timestamp) === e).map((e) => `${e.label} · ${F(e.timestamp)}`)]
|
|
2485
2327
|
};
|
|
2486
2328
|
}
|
|
2487
|
-
let
|
|
2329
|
+
let K = be[0] ?? 0, Ee = be.at(-1) ?? K, De = {
|
|
2488
2330
|
width: D.width,
|
|
2489
2331
|
height: D.height,
|
|
2490
|
-
value:
|
|
2332
|
+
value: Nn({
|
|
2491
2333
|
format: i,
|
|
2492
2334
|
tickFormat: a,
|
|
2493
2335
|
label: o
|
|
2494
2336
|
}),
|
|
2495
|
-
valueDomain:
|
|
2337
|
+
valueDomain: Pn({
|
|
2496
2338
|
series: e,
|
|
2497
2339
|
isStacked: d,
|
|
2498
2340
|
isZeroBased: u === "area",
|
|
2499
2341
|
bands: h,
|
|
2500
2342
|
crossings: g
|
|
2501
2343
|
}),
|
|
2502
|
-
timeDomain:
|
|
2344
|
+
timeDomain: Xt(Mn(K, n), Mn(Ee, n)),
|
|
2503
2345
|
timeFormat: r,
|
|
2504
2346
|
locale: C,
|
|
2505
2347
|
gutter: p,
|
|
2506
2348
|
hasValueTitle: o !== void 0
|
|
2507
|
-
},
|
|
2508
|
-
instants:
|
|
2509
|
-
x: (e) =>
|
|
2510
|
-
right:
|
|
2511
|
-
}),
|
|
2512
|
-
...
|
|
2513
|
-
topInset:
|
|
2514
|
-
}), { box:
|
|
2515
|
-
function
|
|
2516
|
-
return
|
|
2349
|
+
}, q = y(De), ke = Sn({
|
|
2350
|
+
instants: W,
|
|
2351
|
+
x: (e) => q.x.position(Mn(e, n)),
|
|
2352
|
+
right: q.box.right
|
|
2353
|
+
}), X = y({
|
|
2354
|
+
...De,
|
|
2355
|
+
topInset: Cn(ke)
|
|
2356
|
+
}), { box: Z } = X;
|
|
2357
|
+
function Q(e) {
|
|
2358
|
+
return X.x.position(Mn(e, n));
|
|
2517
2359
|
}
|
|
2518
|
-
let
|
|
2519
|
-
function
|
|
2360
|
+
let Ae = X.y.position;
|
|
2361
|
+
function je(e) {
|
|
2520
2362
|
return `${F(e[0])} to ${F(e[1])}`;
|
|
2521
2363
|
}
|
|
2522
|
-
let
|
|
2364
|
+
let Me = v !== void 0 && b !== void 0 && Ee !== K ? {
|
|
2523
2365
|
onRangeChange: v,
|
|
2524
2366
|
rangeStep: b
|
|
2525
|
-
} : void 0,
|
|
2367
|
+
} : void 0, Ne = be.map((e) => ({
|
|
2526
2368
|
id: String(e),
|
|
2527
|
-
x:
|
|
2369
|
+
x: Q(e),
|
|
2528
2370
|
y: 0
|
|
2529
2371
|
}));
|
|
2530
|
-
return /* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ J("div", {
|
|
2531
2373
|
className: "xeuugli",
|
|
2532
|
-
children: /* @__PURE__ */
|
|
2374
|
+
children: /* @__PURE__ */ J(l, {
|
|
2533
2375
|
items: fe,
|
|
2534
|
-
readout: (e) => oe(
|
|
2535
|
-
locate:
|
|
2536
|
-
marks:
|
|
2537
|
-
width:
|
|
2538
|
-
height:
|
|
2376
|
+
readout: (e) => oe(G(Number(e))),
|
|
2377
|
+
locate: U({
|
|
2378
|
+
marks: Ne,
|
|
2379
|
+
width: Z.width,
|
|
2380
|
+
height: Z.height,
|
|
2539
2381
|
axis: "x"
|
|
2540
2382
|
}),
|
|
2541
2383
|
revision: B,
|
|
@@ -2543,9 +2385,9 @@ function or({ series: e, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2543
2385
|
onInspectedChange: f?.onChange,
|
|
2544
2386
|
within: f?.within,
|
|
2545
2387
|
render: (e, { inspected: r, cursor: i }) => {
|
|
2546
|
-
let a = r === null ? void 0 : Number(r), c =
|
|
2388
|
+
let a = r === null ? void 0 : Number(r), c = G(f === void 0 || f.isSource ? a : void 0), l = /* @__PURE__ */ Y(_e, {
|
|
2547
2389
|
plotRef: D.ref,
|
|
2548
|
-
box:
|
|
2390
|
+
box: Z,
|
|
2549
2391
|
label: ee({
|
|
2550
2392
|
title: S,
|
|
2551
2393
|
marks: "observations",
|
|
@@ -2553,112 +2395,112 @@ function or({ series: e, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2553
2395
|
}),
|
|
2554
2396
|
readoutId: O,
|
|
2555
2397
|
children: [
|
|
2556
|
-
/* @__PURE__ */
|
|
2557
|
-
box:
|
|
2558
|
-
xTicks: m ?
|
|
2559
|
-
yTicks:
|
|
2398
|
+
/* @__PURE__ */ J(de, {
|
|
2399
|
+
box: Z,
|
|
2400
|
+
xTicks: m ? X.xTicks : [],
|
|
2401
|
+
yTicks: X.yTicks,
|
|
2560
2402
|
yTitle: o
|
|
2561
2403
|
}),
|
|
2562
|
-
/* @__PURE__ */
|
|
2563
|
-
box:
|
|
2404
|
+
/* @__PURE__ */ Y(ye, {
|
|
2405
|
+
box: Z,
|
|
2564
2406
|
children: [
|
|
2565
|
-
/* @__PURE__ */
|
|
2407
|
+
/* @__PURE__ */ J(wn, {
|
|
2566
2408
|
bands: N,
|
|
2567
|
-
x:
|
|
2568
|
-
y:
|
|
2409
|
+
x: Q,
|
|
2410
|
+
y: Ae
|
|
2569
2411
|
}),
|
|
2570
2412
|
j.map((e) => {
|
|
2571
2413
|
let t = e.points.map((e) => ({
|
|
2572
|
-
x:
|
|
2573
|
-
y: e.value === null ? null :
|
|
2414
|
+
x: Q(e.timestamp),
|
|
2415
|
+
y: e.value === null ? null : Ae(e.value + e.base)
|
|
2574
2416
|
})), n = e.points.map((e) => ({
|
|
2575
|
-
x:
|
|
2576
|
-
y0: e.value === null ? null :
|
|
2577
|
-
y1: e.value === null ? null :
|
|
2417
|
+
x: Q(e.timestamp),
|
|
2418
|
+
y0: e.value === null ? null : Ae(e.base),
|
|
2419
|
+
y1: e.value === null ? null : Ae(e.value + e.base)
|
|
2578
2420
|
}));
|
|
2579
|
-
return /* @__PURE__ */
|
|
2580
|
-
u === "area" && /* @__PURE__ */
|
|
2421
|
+
return /* @__PURE__ */ Y("g", { children: [
|
|
2422
|
+
u === "area" && /* @__PURE__ */ J(ge, {
|
|
2581
2423
|
d: Ce(n),
|
|
2582
2424
|
tone: e.tone,
|
|
2583
2425
|
isPale: !d
|
|
2584
2426
|
}),
|
|
2585
|
-
/* @__PURE__ */
|
|
2427
|
+
/* @__PURE__ */ J(pe, {
|
|
2586
2428
|
d: H(t),
|
|
2587
2429
|
tone: e.tone
|
|
2588
2430
|
}),
|
|
2589
|
-
Se(t).map((t) => /* @__PURE__ */
|
|
2431
|
+
Se(t).map((t) => /* @__PURE__ */ J(I, {
|
|
2590
2432
|
x: t.x,
|
|
2591
2433
|
y: t.y,
|
|
2592
2434
|
tone: e.tone,
|
|
2593
|
-
radius:
|
|
2435
|
+
radius: kn
|
|
2594
2436
|
}, t.x))
|
|
2595
2437
|
] }, e.id);
|
|
2596
2438
|
}),
|
|
2597
|
-
g.map((e) => /* @__PURE__ */
|
|
2598
|
-
x1:
|
|
2599
|
-
x2:
|
|
2600
|
-
y1:
|
|
2601
|
-
y2:
|
|
2439
|
+
g.map((e) => /* @__PURE__ */ J(z, {
|
|
2440
|
+
x1: Z.left,
|
|
2441
|
+
x2: Z.right,
|
|
2442
|
+
y1: Ae(e.value),
|
|
2443
|
+
y2: Ae(e.value)
|
|
2602
2444
|
}, e.id)),
|
|
2603
2445
|
s.map((e) => {
|
|
2604
|
-
if (e.kind === "time") return /* @__PURE__ */
|
|
2605
|
-
x:
|
|
2606
|
-
top:
|
|
2607
|
-
bottom:
|
|
2446
|
+
if (e.kind === "time") return /* @__PURE__ */ J(me, {
|
|
2447
|
+
x: Q(e.timestamp),
|
|
2448
|
+
top: Z.top,
|
|
2449
|
+
bottom: Z.bottom
|
|
2608
2450
|
}, e.id);
|
|
2609
2451
|
let t = j.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base;
|
|
2610
|
-
return e.kind === "point" ? /* @__PURE__ */
|
|
2611
|
-
x:
|
|
2612
|
-
y:
|
|
2452
|
+
return e.kind === "point" ? /* @__PURE__ */ J(R, {
|
|
2453
|
+
x: Q(e.timestamp),
|
|
2454
|
+
y: Ae(e.value + (t ?? 0))
|
|
2613
2455
|
}, e.id) : void 0;
|
|
2614
2456
|
}),
|
|
2615
|
-
a !== void 0 && /* @__PURE__ */
|
|
2616
|
-
x:
|
|
2617
|
-
top:
|
|
2618
|
-
bottom:
|
|
2457
|
+
a !== void 0 && /* @__PURE__ */ J(me, {
|
|
2458
|
+
x: Q(a),
|
|
2459
|
+
top: Z.top,
|
|
2460
|
+
bottom: Z.bottom
|
|
2619
2461
|
}),
|
|
2620
2462
|
a !== void 0 && j.flatMap((e) => {
|
|
2621
2463
|
let t = e.points.find((e) => e.timestamp === a);
|
|
2622
|
-
return t === void 0 || t.value === null ? [] : [/* @__PURE__ */
|
|
2623
|
-
x:
|
|
2624
|
-
y:
|
|
2464
|
+
return t === void 0 || t.value === null ? [] : [/* @__PURE__ */ J(I, {
|
|
2465
|
+
x: Q(t.timestamp),
|
|
2466
|
+
y: Ae(t.value + t.base),
|
|
2625
2467
|
tone: e.tone,
|
|
2626
2468
|
isInspected: !0
|
|
2627
2469
|
}, e.id)];
|
|
2628
2470
|
})
|
|
2629
2471
|
]
|
|
2630
2472
|
}),
|
|
2631
|
-
/* @__PURE__ */
|
|
2632
|
-
placed:
|
|
2633
|
-
x:
|
|
2634
|
-
y:
|
|
2635
|
-
top:
|
|
2636
|
-
bottom:
|
|
2473
|
+
/* @__PURE__ */ J(Tn, {
|
|
2474
|
+
placed: ke,
|
|
2475
|
+
x: Q,
|
|
2476
|
+
y: Ae,
|
|
2477
|
+
top: Z.top,
|
|
2478
|
+
bottom: Z.bottom
|
|
2637
2479
|
}),
|
|
2638
|
-
i !== null && /* @__PURE__ */
|
|
2639
|
-
x:
|
|
2640
|
-
top:
|
|
2641
|
-
bottom:
|
|
2642
|
-
width:
|
|
2480
|
+
i !== null && /* @__PURE__ */ J(ae, {
|
|
2481
|
+
x: Q(Number(i)),
|
|
2482
|
+
top: Z.top,
|
|
2483
|
+
bottom: Z.bottom,
|
|
2484
|
+
width: On
|
|
2643
2485
|
})
|
|
2644
2486
|
]
|
|
2645
2487
|
});
|
|
2646
|
-
return /* @__PURE__ */
|
|
2488
|
+
return /* @__PURE__ */ Y(ce, {
|
|
2647
2489
|
...x,
|
|
2648
2490
|
figure: e,
|
|
2649
2491
|
titleDetail: he ? void 0 : c.label,
|
|
2650
2492
|
series: V,
|
|
2651
|
-
seriesLegend: /* @__PURE__ */
|
|
2493
|
+
seriesLegend: /* @__PURE__ */ J(M, {
|
|
2652
2494
|
id: O,
|
|
2653
2495
|
label: c.label,
|
|
2654
2496
|
legend: V,
|
|
2655
2497
|
rows: c.rows,
|
|
2656
|
-
x:
|
|
2657
|
-
width:
|
|
2498
|
+
x: Q(a ?? K),
|
|
2499
|
+
width: Z.width,
|
|
2658
2500
|
notes: c.notes,
|
|
2659
2501
|
hasSeriesSummary: he
|
|
2660
2502
|
}),
|
|
2661
|
-
children: [/* @__PURE__ */
|
|
2503
|
+
children: [/* @__PURE__ */ J(se, {
|
|
2662
2504
|
label: `${S} observations`,
|
|
2663
2505
|
columns: [
|
|
2664
2506
|
{
|
|
@@ -2682,48 +2524,48 @@ function or({ series: e, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2682
2524
|
values: [
|
|
2683
2525
|
F(e.timestamp),
|
|
2684
2526
|
...j.map((e) => L(e.points[t]?.value ?? null)),
|
|
2685
|
-
...
|
|
2527
|
+
...In({
|
|
2686
2528
|
bands: N,
|
|
2687
2529
|
timestamp: e.timestamp,
|
|
2688
2530
|
valueText: L
|
|
2689
2531
|
}).map((e) => e.value)
|
|
2690
2532
|
]
|
|
2691
2533
|
}))
|
|
2692
|
-
}), /* @__PURE__ */
|
|
2534
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2693
2535
|
className: "xrvj5dj x1n8ia3y",
|
|
2694
2536
|
children: [
|
|
2695
|
-
|
|
2537
|
+
Me === void 0 ? l : /* @__PURE__ */ J(we, {
|
|
2696
2538
|
value: _,
|
|
2697
|
-
onValueChange:
|
|
2698
|
-
min:
|
|
2699
|
-
max:
|
|
2700
|
-
step:
|
|
2701
|
-
describe:
|
|
2539
|
+
onValueChange: Me.onRangeChange,
|
|
2540
|
+
min: K,
|
|
2541
|
+
max: Ee,
|
|
2542
|
+
step: Me.rangeStep,
|
|
2543
|
+
describe: je,
|
|
2702
2544
|
label: `${S} time range`,
|
|
2703
|
-
left:
|
|
2704
|
-
width:
|
|
2705
|
-
height:
|
|
2545
|
+
left: Q(K),
|
|
2546
|
+
width: Q(Ee) - Q(K),
|
|
2547
|
+
height: Z.bottom,
|
|
2706
2548
|
children: l
|
|
2707
2549
|
}),
|
|
2708
|
-
|
|
2550
|
+
Me !== void 0 && /* @__PURE__ */ Y("div", {
|
|
2709
2551
|
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
2710
|
-
children: [/* @__PURE__ */
|
|
2552
|
+
children: [/* @__PURE__ */ J("span", { children: _ === null ? "Drag on the plot with a mouse to select a range of time." : `Selected range: ${je(_)}` }), _ === null ? /* @__PURE__ */ J(t, {
|
|
2711
2553
|
type: "button",
|
|
2712
2554
|
onClick: (e) => {
|
|
2713
|
-
|
|
2714
|
-
first:
|
|
2715
|
-
last:
|
|
2716
|
-
step:
|
|
2555
|
+
Oe({ options: () => Me }, "onRangeChange", Kn({
|
|
2556
|
+
first: K,
|
|
2557
|
+
last: Ee,
|
|
2558
|
+
step: Me.rangeStep
|
|
2717
2559
|
}), {
|
|
2718
2560
|
reason: "trigger-press",
|
|
2719
2561
|
event: e.nativeEvent
|
|
2720
2562
|
});
|
|
2721
2563
|
},
|
|
2722
2564
|
children: "Select a range"
|
|
2723
|
-
}) : /* @__PURE__ */
|
|
2565
|
+
}) : /* @__PURE__ */ J(t, {
|
|
2724
2566
|
type: "button",
|
|
2725
2567
|
onClick: (e) => {
|
|
2726
|
-
|
|
2568
|
+
Oe({ options: () => Me }, "onRangeChange", null, {
|
|
2727
2569
|
reason: "clear-press",
|
|
2728
2570
|
event: e.nativeEvent
|
|
2729
2571
|
});
|
|
@@ -2731,14 +2573,14 @@ function or({ series: e, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2731
2573
|
children: "Clear range"
|
|
2732
2574
|
})]
|
|
2733
2575
|
}),
|
|
2734
|
-
s.length + xe.length > 0 && /* @__PURE__ */
|
|
2576
|
+
s.length + xe.length > 0 && /* @__PURE__ */ Y("ul", {
|
|
2735
2577
|
className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
|
|
2736
|
-
children: [s.map((e) => /* @__PURE__ */
|
|
2578
|
+
children: [s.map((e) => /* @__PURE__ */ Y("li", { children: [
|
|
2737
2579
|
F(e.timestamp),
|
|
2738
2580
|
" · ",
|
|
2739
2581
|
e.label,
|
|
2740
2582
|
e.kind === "point" && ` · ${L(e.value)}`
|
|
2741
|
-
] }, e.id)), xe.map((e) => /* @__PURE__ */
|
|
2583
|
+
] }, e.id)), xe.map((e) => /* @__PURE__ */ J("li", { children: Ln({
|
|
2742
2584
|
found: e,
|
|
2743
2585
|
timeText: F
|
|
2744
2586
|
}) }, e.crossing.id))]
|
|
@@ -2750,7 +2592,7 @@ function or({ series: e, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2750
2592
|
})
|
|
2751
2593
|
});
|
|
2752
2594
|
}
|
|
2753
|
-
function
|
|
2595
|
+
function Gn({ range: e, rangeStep: t, isSelectable: n, timeline: r }) {
|
|
2754
2596
|
let i = r[0], a = r.at(-1);
|
|
2755
2597
|
if (!n || i === void 0 || a === void 0) return;
|
|
2756
2598
|
let o = a - i;
|
|
@@ -2759,8 +2601,8 @@ function sr({ range: e, rangeStep: t, isSelectable: n, timeline: r }) {
|
|
|
2759
2601
|
if (e !== null && (!(e[0] >= i && e[1] <= a) || e[0] >= e[1])) return "The selected range must have ordered ends inside the observed time.";
|
|
2760
2602
|
}
|
|
2761
2603
|
}
|
|
2762
|
-
function
|
|
2763
|
-
let r = Math.max(1, Math.round((t - e) /
|
|
2604
|
+
function Kn({ first: e, last: t, step: n }) {
|
|
2605
|
+
let r = Math.max(1, Math.round((t - e) / An / n)) * n, i = Math.min(e + r, t - n);
|
|
2764
2606
|
return [i, Math.min(t, Math.max(i + n, t - r))];
|
|
2765
2607
|
}
|
|
2766
|
-
export {
|
|
2608
|
+
export { Bn as a, $ as c, Pt as d, ht as f, Un as i, Vt as l, st as m, Rn as n, cn as o, dt as p, Hn as r, on as s, zn as t, Ft as u };
|