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