@mechane-ai/elements 0.34.0 → 0.35.1
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 +3 -1
- package/dist/ai.js +1 -1
- package/dist/{categorical-values-bWZBzMpX.js → categorical-values-DpnNvPkc.js} +2 -2
- package/dist/{chart-frame-Cr4P6MF5.js → chart-frame-BV0IPZtQ.js} +1 -1
- package/dist/{chart-input-3wX0JoPE.js → chart-input-CN8PMrni.js} +2 -2
- package/dist/charts/cartesian.js +543 -572
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +2 -2
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +2 -2
- package/dist/charts/timeline.js +2 -2
- package/dist/charts.js +1 -1
- package/dist/collections.js +1 -1
- package/dist/elements.css +12 -0
- package/dist/feedback.js +1 -1
- package/dist/packages/charts/src/chart-data.d.ts +1 -2
- package/dist/{src-BOZsJ8td.js → src-BHllGfI8.js} +4 -4
- package/package.json +1 -1
package/dist/charts/cartesian.js
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { d as e, u as t } from "../src-
|
|
2
|
-
import { i as n, n as r, r as i, t as a } from "../categorical-values-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { AreaClosed as ie, Bar as ae, LinePath as O } from "@visx/shape";
|
|
1
|
+
import { d as e, u as t } from "../src-BHllGfI8.js";
|
|
2
|
+
import { i as n, n as r, r as i, t as a } from "../categorical-values-DpnNvPkc.js";
|
|
3
|
+
import { t as o } from "../accessibility-C-aIZ1Yx.js";
|
|
4
|
+
import { a as s, n as c, o as l, r as u, s as d, t as f } from "../chart-frame-BV0IPZtQ.js";
|
|
5
|
+
import { n as p, r as m, t as h } from "../chart-input-CN8PMrni.js";
|
|
6
|
+
import { r as g } from "../tokens.stylex-CJbIDPB9.js";
|
|
7
|
+
import { t as _ } from "../plot-width--OgdohB5.js";
|
|
8
|
+
import { D as v } from "../src-C-Sx37kz.js";
|
|
9
|
+
import { p as y } from "../src-BYKjPC-0.js";
|
|
10
|
+
import * as b from "@stylexjs/stylex";
|
|
11
|
+
import { useEffect as x, useId as S, useMemo as C, useRef as ee, useState as w } from "react";
|
|
12
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
13
|
+
import { scaleBand as O, scaleLinear as k } from "@visx/scale";
|
|
14
|
+
import { AreaClosed as te, Bar as A, LinePath as j } from "@visx/shape";
|
|
16
15
|
// packages/charts/src/chart-cursor.tsx
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */
|
|
16
|
+
function ne({ x: e, top: t, bottom: n, width: r }) {
|
|
17
|
+
return /* @__PURE__ */ D("g", {
|
|
19
18
|
"aria-hidden": !0,
|
|
20
19
|
className: "xlshs6z xgs60n x17y187c xbabvq0 x47corl",
|
|
21
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ E("line", {
|
|
22
21
|
x1: e,
|
|
23
22
|
x2: e,
|
|
24
23
|
y1: t,
|
|
25
24
|
y2: n,
|
|
26
25
|
className: "xnpr05h x1ntoi03 x13efnbd"
|
|
27
|
-
}), /* @__PURE__ */
|
|
26
|
+
}), /* @__PURE__ */ E("line", {
|
|
28
27
|
x1: e - r / 2,
|
|
29
28
|
x2: e + r / 2,
|
|
30
29
|
y1: n + 4,
|
|
@@ -34,36 +33,21 @@ function oe({ x: e, top: t, bottom: n, width: r }) {
|
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
35
|
// packages/charts/src/chart-data.tsx
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}), /* @__PURE__ */ E(c.Portal, { children: [/* @__PURE__ */ T(c.Backdrop, {}), /* @__PURE__ */ E(c.Popup, { children: [
|
|
43
|
-
/* @__PURE__ */ T(c.Title, { children: e }),
|
|
44
|
-
/* @__PURE__ */ T("div", {
|
|
45
|
-
ref: n.ref,
|
|
46
|
-
role: "region",
|
|
47
|
-
"aria-label": "Chart values",
|
|
48
|
-
tabIndex: n.tabIndex,
|
|
49
|
-
className: "xeuugli x1phlbz0 xysyzu8 x1we84gm",
|
|
50
|
-
children: t
|
|
51
|
-
}),
|
|
52
|
-
/* @__PURE__ */ T(c.Close, {
|
|
53
|
-
render: /* @__PURE__ */ T(o, {}),
|
|
54
|
-
children: "Close"
|
|
55
|
-
})
|
|
56
|
-
] })] })] });
|
|
36
|
+
function M({ children: e }) {
|
|
37
|
+
return /* @__PURE__ */ E("div", {
|
|
38
|
+
...b.props(o.hidden),
|
|
39
|
+
children: e
|
|
40
|
+
});
|
|
57
41
|
}
|
|
58
42
|
// packages/charts/src/chart-inspection.tsx
|
|
59
|
-
var
|
|
43
|
+
var N = {
|
|
60
44
|
kzqmXN: "x1xc55vz",
|
|
61
45
|
kZKoxP: "xdk7pt",
|
|
62
46
|
kmuXW: "x2lah0s",
|
|
63
47
|
$$css: !0
|
|
64
|
-
},
|
|
48
|
+
}, P = {
|
|
65
49
|
swatch: (e) => [
|
|
66
|
-
|
|
50
|
+
N,
|
|
67
51
|
{
|
|
68
52
|
kWkggS: e == null ? e : "xl8spv7",
|
|
69
53
|
$$css: !0
|
|
@@ -103,78 +87,78 @@ var k = {
|
|
|
103
87
|
"--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
|
|
104
88
|
"--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
105
89
|
}]
|
|
106
|
-
},
|
|
107
|
-
function
|
|
108
|
-
return /* @__PURE__ */
|
|
90
|
+
}, re = 4;
|
|
91
|
+
function ie() {
|
|
92
|
+
return /* @__PURE__ */ E("ul", {
|
|
109
93
|
"aria-hidden": !0,
|
|
110
94
|
inert: !0,
|
|
111
95
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k",
|
|
112
|
-
children: Array.from({ length:
|
|
96
|
+
children: Array.from({ length: re }, (t, n) => /* @__PURE__ */ D("li", {
|
|
113
97
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe x1f394nn x43dure",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ E("span", { ...b.props(P.swatch(g.line)) }), /* @__PURE__ */ D("span", {
|
|
115
99
|
className: "x1cqoux5 xeuugli",
|
|
116
100
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ E(e, {}),
|
|
102
|
+
/* @__PURE__ */ E("span", {
|
|
119
103
|
className: "x1s85apg xannxpe",
|
|
120
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ E(e, {})
|
|
121
105
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ E("span", {
|
|
123
107
|
className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
|
|
124
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ E(e, {})
|
|
125
109
|
})
|
|
126
110
|
]
|
|
127
111
|
})]
|
|
128
112
|
}, n))
|
|
129
113
|
});
|
|
130
114
|
}
|
|
131
|
-
function
|
|
132
|
-
return t === void 0 ? e : /* @__PURE__ */
|
|
115
|
+
function ae({ title: e, detail: t }) {
|
|
116
|
+
return t === void 0 ? e : /* @__PURE__ */ D("span", {
|
|
133
117
|
"aria-label": e,
|
|
134
118
|
className: "x1lliihq xb3r6kr xlyipyv xuxw1ft",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ E("span", {
|
|
136
120
|
className: "xt0psk2 x1boff50",
|
|
137
121
|
children: e
|
|
138
|
-
}), /* @__PURE__ */
|
|
122
|
+
}), /* @__PURE__ */ E("span", {
|
|
139
123
|
className: "x1s85apg xfodcyb",
|
|
140
124
|
children: t
|
|
141
125
|
})]
|
|
142
126
|
});
|
|
143
127
|
}
|
|
144
|
-
function
|
|
145
|
-
let
|
|
128
|
+
function oe({ 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 }) {
|
|
129
|
+
let p = Math.min(260, s), m = o > s / 2 ? o - p - c : o + c, h = Math.max(0, Math.min(s - p, m)), g = t === void 0 ? [] : [
|
|
146
130
|
t,
|
|
147
131
|
n,
|
|
148
132
|
...a.map((e) => `${e.label}: ${e.value}`),
|
|
149
133
|
...u
|
|
150
134
|
].filter((e) => e !== void 0);
|
|
151
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ D("div", {
|
|
152
136
|
className: "xeuugli",
|
|
153
137
|
children: [
|
|
154
|
-
!
|
|
138
|
+
!f && /* @__PURE__ */ D("div", {
|
|
155
139
|
className: "xrvj5dj xeuugli",
|
|
156
|
-
children: [i !== void 0 && /* @__PURE__ */
|
|
140
|
+
children: [i !== void 0 && /* @__PURE__ */ E("ul", {
|
|
157
141
|
"aria-hidden": !0,
|
|
158
142
|
inert: !0,
|
|
159
143
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc xlshs6z x47corl",
|
|
160
|
-
children: i.map((e) => /* @__PURE__ */
|
|
144
|
+
children: i.map((e) => /* @__PURE__ */ D("li", {
|
|
161
145
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ E("span", { ...b.props(P.swatch(d[e.tone])) }), /* @__PURE__ */ D("span", {
|
|
163
147
|
className: "xeuugli",
|
|
164
|
-
children: [e.label, /* @__PURE__ */
|
|
148
|
+
children: [e.label, /* @__PURE__ */ E("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
|
|
165
149
|
})]
|
|
166
150
|
}, e.id))
|
|
167
|
-
}), /* @__PURE__ */
|
|
151
|
+
}), /* @__PURE__ */ E("ul", {
|
|
168
152
|
"aria-label": "Legend",
|
|
169
153
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc",
|
|
170
|
-
children: r.map((e) => /* @__PURE__ */
|
|
154
|
+
children: r.map((e) => /* @__PURE__ */ D("li", {
|
|
171
155
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
156
|
+
children: [/* @__PURE__ */ E("span", {
|
|
173
157
|
"aria-hidden": !0,
|
|
174
|
-
...
|
|
175
|
-
}), /* @__PURE__ */
|
|
158
|
+
...b.props(P.swatch(d[e.tone]))
|
|
159
|
+
}), /* @__PURE__ */ D("span", {
|
|
176
160
|
className: "xeuugli",
|
|
177
|
-
children: [e.label, /* @__PURE__ */
|
|
161
|
+
children: [e.label, /* @__PURE__ */ E("span", {
|
|
178
162
|
className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
|
|
179
163
|
children: t === void 0 ? "" : a.find((t) => t.id === e.id)?.value ?? "—"
|
|
180
164
|
})]
|
|
@@ -182,36 +166,36 @@ function M({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x
|
|
|
182
166
|
}, e.id))
|
|
183
167
|
})]
|
|
184
168
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ E("span", {
|
|
186
170
|
id: e,
|
|
187
171
|
"aria-live": l === "keyboard" ? "polite" : "off",
|
|
188
172
|
className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xb3r6kr x1hyvwdk xuxw1ft",
|
|
189
173
|
children: g.join(" · ")
|
|
190
174
|
}),
|
|
191
|
-
t !== void 0 && /* @__PURE__ */
|
|
175
|
+
t !== void 0 && /* @__PURE__ */ E("div", {
|
|
192
176
|
"aria-hidden": !0,
|
|
193
177
|
className: "x1n2onr6 xqtp20y x1vjfegm",
|
|
194
|
-
children: /* @__PURE__ */
|
|
195
|
-
...
|
|
178
|
+
children: /* @__PURE__ */ D("div", {
|
|
179
|
+
...b.props(P.inspector, f && P.summaryInspector, P.position(h, p)),
|
|
196
180
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ D("div", {
|
|
198
182
|
className: "x78zum5 x1qughib x1hnptsi xk4h15q",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ E("span", { children: t }), n !== void 0 && /* @__PURE__ */ E("span", { children: n })]
|
|
200
184
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ E("dl", {
|
|
202
186
|
className: "xrvj5dj xunmzkg x1ghz6dp",
|
|
203
|
-
children: a.map((e) => /* @__PURE__ */
|
|
187
|
+
children: a.map((e) => /* @__PURE__ */ D("div", {
|
|
204
188
|
className: "x78zum5 x1qughib x1pha0wt x1hnptsi",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ D("dt", {
|
|
206
190
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
208
|
-
}), /* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ E("span", { ...b.props(P.swatch(d[e.tone])) }), e.label]
|
|
192
|
+
}), /* @__PURE__ */ E("dd", {
|
|
209
193
|
className: "x1ghz6dp xuxw1ft",
|
|
210
194
|
children: e.value
|
|
211
195
|
})]
|
|
212
196
|
}, e.id))
|
|
213
197
|
}),
|
|
214
|
-
u.map((e) => /* @__PURE__ */
|
|
198
|
+
u.map((e) => /* @__PURE__ */ E("span", { children: e }, e))
|
|
215
199
|
]
|
|
216
200
|
})
|
|
217
201
|
})
|
|
@@ -219,7 +203,7 @@ function M({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x
|
|
|
219
203
|
});
|
|
220
204
|
}
|
|
221
205
|
// packages/charts/src/cartesian/bar-data.ts
|
|
222
|
-
function
|
|
206
|
+
function se({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
223
207
|
if (e === void 0) return;
|
|
224
208
|
if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
|
|
225
209
|
let i = e.annotation;
|
|
@@ -237,43 +221,43 @@ function ue({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
|
237
221
|
}
|
|
238
222
|
}
|
|
239
223
|
// packages/charts/src/cartesian/composition-bars.tsx
|
|
240
|
-
var
|
|
224
|
+
var ce = { mark: {
|
|
241
225
|
k3nNDw: "x1hj3fc7",
|
|
242
226
|
k1ekBW: "xwcsmn1",
|
|
243
227
|
kIyJzY: "xtitasy x12w9bfk",
|
|
244
228
|
kAMwcw: "x1faw7qm",
|
|
245
229
|
$$css: !0
|
|
246
230
|
} };
|
|
247
|
-
function
|
|
248
|
-
let
|
|
231
|
+
function le({ bucket: e, series: t, focusedSeries: n, index: r, x: a, width: o, y: s, isHighlighted: c, highlightedSeriesId: u }) {
|
|
232
|
+
let f = n !== void 0, p = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
|
|
249
233
|
function m(e, t) {
|
|
250
234
|
let n = s(t), r = s(t + e);
|
|
251
235
|
return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
|
|
252
236
|
}
|
|
253
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ D(T, { children: [e.kind !== "gap" && /* @__PURE__ */ E("rect", {
|
|
254
238
|
x: a,
|
|
255
239
|
y: 0,
|
|
256
240
|
width: o,
|
|
257
241
|
height: 1,
|
|
258
242
|
vectorEffect: "non-scaling-stroke",
|
|
259
|
-
fill:
|
|
260
|
-
...
|
|
243
|
+
fill: d.neutral,
|
|
244
|
+
...b.props(ce.mark, c && l.selected),
|
|
261
245
|
style: {
|
|
262
246
|
transform: m(e.total, 0),
|
|
263
|
-
opacity:
|
|
247
|
+
opacity: f ? .18 : +(e.kind === "total")
|
|
264
248
|
}
|
|
265
|
-
}),
|
|
249
|
+
}), p.map((s, p) => {
|
|
266
250
|
let h = s.values[r];
|
|
267
251
|
if (h == null) return null;
|
|
268
|
-
let g = n?.id === s.id, _ =
|
|
269
|
-
return /* @__PURE__ */
|
|
252
|
+
let g = n?.id === s.id, _ = f ? 0 : t.slice(0, p).reduce((e, t) => e + (t.values[r] ?? 0), 0), v = f ? g : e.kind === "parts", y = !f && u !== void 0 && u !== s.id;
|
|
253
|
+
return /* @__PURE__ */ E("rect", {
|
|
270
254
|
x: a,
|
|
271
255
|
y: 0,
|
|
272
256
|
width: o,
|
|
273
257
|
height: 1,
|
|
274
258
|
vectorEffect: "non-scaling-stroke",
|
|
275
|
-
fill:
|
|
276
|
-
...
|
|
259
|
+
fill: d[i(s.tone, p)],
|
|
260
|
+
...b.props(ce.mark, c && l.selected),
|
|
277
261
|
style: {
|
|
278
262
|
transform: m(h, _),
|
|
279
263
|
opacity: v ? y ? .3 : 1 : 0
|
|
@@ -282,7 +266,7 @@ function de({ bucket: e, series: t, focusedSeries: n, index: r, x: a, width: o,
|
|
|
282
266
|
})] });
|
|
283
267
|
}
|
|
284
268
|
// packages/charts/src/cartesian/bar-chart.tsx
|
|
285
|
-
var
|
|
269
|
+
var ue = {
|
|
286
270
|
plot: {
|
|
287
271
|
kqGvvJ: "x1we84gm",
|
|
288
272
|
$$css: !0
|
|
@@ -291,67 +275,67 @@ var P = {
|
|
|
291
275
|
kSiTet: "xuzhngd",
|
|
292
276
|
$$css: !0
|
|
293
277
|
}
|
|
294
|
-
},
|
|
295
|
-
function F({ title: e, description: t, report: n, series: r, layoutSeries: a, children: o, inspectionId: s, label: c, detail: l, summary:
|
|
278
|
+
}, de = /* @__PURE__ */ new Set(["Enter", " "]), fe = 200;
|
|
279
|
+
function F({ title: e, description: t, report: n, series: r, layoutSeries: a, children: o, inspectionId: s, label: c, detail: l, summary: d, rows: f = [], index: p = -1, formatValue: m = String, x: h = 0, width: g = 0, offset: _, source: v, data: y, isLoading: b = !1 }) {
|
|
296
280
|
let x = r.map((e, t) => ({
|
|
297
281
|
id: e.id,
|
|
298
282
|
label: e.label,
|
|
299
283
|
tone: i(e.tone, t)
|
|
300
|
-
})),
|
|
284
|
+
})), S = a?.map((e, t) => ({
|
|
301
285
|
id: e.id,
|
|
302
286
|
label: e.label,
|
|
303
287
|
tone: i(e.tone, t)
|
|
304
|
-
})),
|
|
305
|
-
return /* @__PURE__ */
|
|
306
|
-
title: /* @__PURE__ */
|
|
288
|
+
})), C = b && r.length === 0 && n?.seriesValues === void 0;
|
|
289
|
+
return /* @__PURE__ */ D(u, {
|
|
290
|
+
title: /* @__PURE__ */ E(ae, {
|
|
307
291
|
title: e,
|
|
308
292
|
detail: l
|
|
309
293
|
}),
|
|
310
294
|
description: t,
|
|
311
295
|
report: n,
|
|
312
296
|
series: x,
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
297
|
+
children: [
|
|
298
|
+
/* @__PURE__ */ E(M, { children: y }),
|
|
299
|
+
C ? /* @__PURE__ */ E(ie, {}) : /* @__PURE__ */ E(oe, {
|
|
300
|
+
id: s,
|
|
301
|
+
label: c,
|
|
302
|
+
summary: d,
|
|
303
|
+
legend: x,
|
|
304
|
+
hasSeriesSummary: n?.seriesValues !== void 0,
|
|
305
|
+
layoutLegend: S,
|
|
306
|
+
rows: f.map((e, t) => ({
|
|
307
|
+
id: e.id,
|
|
308
|
+
label: e.label,
|
|
309
|
+
tone: i(e.tone, t),
|
|
310
|
+
value: e.values[p] === null || e.values[p] === void 0 ? "Unavailable" : m(e.values[p])
|
|
311
|
+
})),
|
|
312
|
+
x: h,
|
|
313
|
+
width: g,
|
|
314
|
+
offset: _,
|
|
315
|
+
source: v
|
|
316
|
+
}),
|
|
317
|
+
o
|
|
318
|
+
]
|
|
335
319
|
});
|
|
336
320
|
}
|
|
337
|
-
function I({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a =
|
|
321
|
+
function I({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = fe }) {
|
|
338
322
|
let o = L(a), s = S();
|
|
339
|
-
return o === void 0 ? /* @__PURE__ */
|
|
323
|
+
return o === void 0 ? /* @__PURE__ */ E("div", {
|
|
340
324
|
"aria-hidden": !0,
|
|
341
325
|
inert: !0,
|
|
342
|
-
children: /* @__PURE__ */
|
|
326
|
+
children: /* @__PURE__ */ E(F, {
|
|
343
327
|
title: e,
|
|
344
328
|
description: n,
|
|
345
329
|
report: r,
|
|
346
330
|
series: i,
|
|
347
331
|
inspectionId: s,
|
|
348
332
|
isLoading: !0,
|
|
349
|
-
children: /* @__PURE__ */
|
|
350
|
-
...
|
|
351
|
-
children: /* @__PURE__ */
|
|
333
|
+
children: /* @__PURE__ */ E("div", {
|
|
334
|
+
...b.props(l.plot, ue.plot),
|
|
335
|
+
children: /* @__PURE__ */ E(t, { height: a })
|
|
352
336
|
})
|
|
353
337
|
})
|
|
354
|
-
}) : /* @__PURE__ */
|
|
338
|
+
}) : /* @__PURE__ */ E(h, {
|
|
355
339
|
title: e,
|
|
356
340
|
description: n,
|
|
357
341
|
report: r,
|
|
@@ -361,10 +345,10 @@ function I({ title: e = "Loading chart", description: n, report: r, series: i =
|
|
|
361
345
|
function L(e) {
|
|
362
346
|
if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
|
|
363
347
|
}
|
|
364
|
-
function
|
|
348
|
+
function pe({ categories: e, series: t, domain: n, mode: i }) {
|
|
365
349
|
if (e.length > r.items || t.length > r.series) return `Choose a window with at most ${r.items} categories and ${r.series} series.`;
|
|
366
|
-
if (!
|
|
367
|
-
if (!
|
|
350
|
+
if (!m(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
|
|
351
|
+
if (!p(e) || !p(t)) return "Bar categories and series require unique identifiers.";
|
|
368
352
|
for (let r of t) {
|
|
369
353
|
if (r.values.length !== e.length) return "Every series requires one explicit value per category.";
|
|
370
354
|
for (let e of r.values) {
|
|
@@ -374,64 +358,64 @@ function me({ categories: e, series: t, domain: n, mode: i }) {
|
|
|
374
358
|
}
|
|
375
359
|
if (i === "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.";
|
|
376
360
|
}
|
|
377
|
-
var
|
|
361
|
+
var me = {
|
|
378
362
|
"x-default-marker": "x-default-marker",
|
|
379
363
|
$$css: !0
|
|
380
364
|
};
|
|
381
|
-
function
|
|
382
|
-
let
|
|
365
|
+
function he({ title: e, description: t, report: n, categories: r, series: o, domain: s, mode: c = "grouped", formatValue: u, formatTick: f = u, highlightedSeriesId: p, selection: m, height: g = fe, composition: v }) {
|
|
366
|
+
let y = v?.focusedSeries, C = S(), ee = y === void 0 ? void 0 : pe({
|
|
383
367
|
categories: r,
|
|
384
|
-
series: [
|
|
368
|
+
series: [y],
|
|
385
369
|
domain: s,
|
|
386
370
|
mode: "grouped"
|
|
387
|
-
}),
|
|
371
|
+
}), T = pe({
|
|
388
372
|
categories: r,
|
|
389
373
|
series: o,
|
|
390
374
|
domain: s,
|
|
391
375
|
mode: c
|
|
392
|
-
}) ??
|
|
393
|
-
composition:
|
|
376
|
+
}) ?? ee, te = se({
|
|
377
|
+
composition: v,
|
|
394
378
|
series: o,
|
|
395
379
|
categoryIds: r.map((e) => e.id),
|
|
396
380
|
domain: s
|
|
397
|
-
}) ?? L(
|
|
398
|
-
id:
|
|
399
|
-
label:
|
|
381
|
+
}) ?? L(g), j = T ?? te, M = v === void 0 ? void 0 : {
|
|
382
|
+
id: C,
|
|
383
|
+
label: v.contextLabel,
|
|
400
384
|
tone: "neutral",
|
|
401
|
-
values:
|
|
402
|
-
},
|
|
403
|
-
|
|
385
|
+
values: v.buckets.map((e) => e.kind === "gap" ? null : e.total)
|
|
386
|
+
}, N = M === void 0 ? o : [
|
|
387
|
+
M,
|
|
404
388
|
...o,
|
|
405
|
-
...
|
|
406
|
-
],
|
|
407
|
-
|
|
389
|
+
...y === void 0 || o.some((e) => e.id === y.id) ? [] : [y]
|
|
390
|
+
], P = y !== void 0 && M !== void 0 ? [y, M] : o, { ref: re, width: ie, element: ae } = _(), oe = S(), [ce, I] = w(), [he, z] = w();
|
|
391
|
+
x(() => {
|
|
408
392
|
function e(e) {
|
|
409
|
-
e.target instanceof Node &&
|
|
393
|
+
e.target instanceof Node && ae?.contains(e.target) !== !0 && I(void 0);
|
|
410
394
|
}
|
|
411
395
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
412
|
-
}, [
|
|
413
|
-
let
|
|
414
|
-
if (
|
|
396
|
+
}, [ae]);
|
|
397
|
+
let B = r.findIndex((e) => e.id === ce?.id), V = r[B], H = r[r.findIndex((e) => e.id === m?.selectedId)], U = r.find((e) => e.id === he) ?? H ?? r[0], W = r.findIndex((e) => e.id === U?.id), G = V, ge = B, K = v?.buckets[ge], q = y !== void 0 && M !== void 0 ? [y, M] : M === void 0 || K?.kind === "parts" ? o : [], J = K === void 0 ? void 0 : K.kind === "gap" ? "No reported value" : u(K.total);
|
|
398
|
+
if (j !== void 0) return /* @__PURE__ */ E(h, {
|
|
415
399
|
title: e,
|
|
416
400
|
description: t,
|
|
417
401
|
report: n,
|
|
418
|
-
message:
|
|
402
|
+
message: j
|
|
419
403
|
});
|
|
420
|
-
let Y =
|
|
404
|
+
let Y = g - 28, X = k({
|
|
421
405
|
domain: [...s],
|
|
422
406
|
range: [Y, 12]
|
|
423
|
-
}), Z = Math.max(44, ...X.ticks(3).map((e) =>
|
|
407
|
+
}), Z = Math.max(44, ...X.ticks(3).map((e) => f(e).length * 7 + 12)), Q = Math.max(Z + 1, ie - 16), $ = O({
|
|
424
408
|
domain: r.map((e) => e.id),
|
|
425
|
-
range: [Z,
|
|
409
|
+
range: [Z, Q],
|
|
426
410
|
padding: .3
|
|
427
|
-
}),
|
|
411
|
+
}), _e = O({
|
|
428
412
|
domain: o.map((e) => e.id),
|
|
429
|
-
range: [0,
|
|
413
|
+
range: [0, $.bandwidth()],
|
|
430
414
|
padding: .08
|
|
431
|
-
}), ve = Math.min(120, Math.max(40, ...r.map((e) => (e.axisLabel ?? e.label).length * 7))), ye = Math.max(1, Math.ceil((ve + 16) /
|
|
415
|
+
}), ve = Math.min(120, Math.max(40, ...r.map((e) => (e.axisLabel ?? e.label).length * 7))), ye = Math.max(1, Math.ceil((ve + 16) / $.step())), be = Math.max(1, Math.floor(($.step() * ye - 16) / 7));
|
|
432
416
|
function xe(e) {
|
|
433
|
-
let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width *
|
|
434
|
-
a !== void 0 && (e.type === "pointerdown" &&
|
|
417
|
+
let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * ie, i = Math.floor((n - Z) / $.step()), a = r[Math.max(0, Math.min(r.length - 1, i))];
|
|
418
|
+
a !== void 0 && (e.type === "pointerdown" && z(a.id), I({
|
|
435
419
|
id: a.id,
|
|
436
420
|
source: "pointer"
|
|
437
421
|
}));
|
|
@@ -439,68 +423,65 @@ function R({ title: e, description: t, report: n, categories: r, series: o, doma
|
|
|
439
423
|
function Se(e) {
|
|
440
424
|
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
441
425
|
if (e.key === "Escape") {
|
|
442
|
-
e.preventDefault(), e.stopPropagation(),
|
|
426
|
+
e.preventDefault(), e.stopPropagation(), I(void 0);
|
|
443
427
|
return;
|
|
444
428
|
}
|
|
445
|
-
if (
|
|
446
|
-
|
|
429
|
+
if (de.has(e.key)) {
|
|
430
|
+
U !== void 0 && m !== void 0 && (e.preventDefault(), m.onSelect(U.id));
|
|
447
431
|
return;
|
|
448
432
|
}
|
|
449
433
|
let t = {
|
|
450
|
-
ArrowRight: Math.min(r.length - 1,
|
|
451
|
-
ArrowLeft: Math.max(0,
|
|
434
|
+
ArrowRight: Math.min(r.length - 1, W + 1),
|
|
435
|
+
ArrowLeft: Math.max(0, W - 1),
|
|
452
436
|
Home: 0,
|
|
453
437
|
End: r.length - 1
|
|
454
438
|
}[e.key], n = t === void 0 ? void 0 : r[t];
|
|
455
|
-
n !== void 0 && (e.preventDefault(),
|
|
439
|
+
n !== void 0 && (e.preventDefault(), z(n.id), I({
|
|
456
440
|
id: n.id,
|
|
457
441
|
source: "keyboard"
|
|
458
442
|
}));
|
|
459
443
|
}
|
|
460
|
-
return /* @__PURE__ */
|
|
444
|
+
return /* @__PURE__ */ E(F, {
|
|
461
445
|
title: e,
|
|
462
446
|
description: t,
|
|
463
447
|
report: n,
|
|
464
|
-
series:
|
|
448
|
+
series: P,
|
|
465
449
|
layoutSeries: o,
|
|
466
|
-
inspectionId:
|
|
467
|
-
label:
|
|
468
|
-
detail:
|
|
450
|
+
inspectionId: oe,
|
|
451
|
+
label: G?.label,
|
|
452
|
+
detail: G === void 0 ? void 0 : [G.axisLabel ?? G.label, J].filter(Boolean).join(" · "),
|
|
469
453
|
summary: J,
|
|
470
454
|
rows: q,
|
|
471
|
-
index:
|
|
472
|
-
formatValue:
|
|
473
|
-
x: (
|
|
474
|
-
width:
|
|
475
|
-
offset:
|
|
476
|
-
source:
|
|
477
|
-
data: /* @__PURE__ */
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
ref: A,
|
|
488
|
-
...x.props(d.plot, P.plot),
|
|
489
|
-
children: r.length === 0 || o.length === 0 && g === void 0 ? /* @__PURE__ */ T("p", {
|
|
455
|
+
index: ge,
|
|
456
|
+
formatValue: u,
|
|
457
|
+
x: ($(G?.id ?? "") ?? Z) + $.bandwidth() / 2,
|
|
458
|
+
width: ie,
|
|
459
|
+
offset: $.bandwidth() / 2 + 8,
|
|
460
|
+
source: ce?.source,
|
|
461
|
+
data: /* @__PURE__ */ E(a, { items: r.map((e, t) => ({
|
|
462
|
+
id: e.id,
|
|
463
|
+
label: e.label,
|
|
464
|
+
valueLabel: R(N, t, u),
|
|
465
|
+
tone: "neutral"
|
|
466
|
+
})) }),
|
|
467
|
+
children: /* @__PURE__ */ E("div", {
|
|
468
|
+
ref: re,
|
|
469
|
+
...b.props(l.plot, ue.plot),
|
|
470
|
+
children: r.length === 0 || o.length === 0 && v === void 0 ? /* @__PURE__ */ E("p", {
|
|
490
471
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
491
472
|
children: "No categories"
|
|
492
|
-
}) : /* @__PURE__ */
|
|
473
|
+
}) : /* @__PURE__ */ D("svg", {
|
|
493
474
|
role: "img",
|
|
494
475
|
"aria-label": `${e}. Use arrow keys to inspect categories.${m === void 0 ? "" : " Press Enter to select."}`,
|
|
495
|
-
"aria-describedby":
|
|
476
|
+
"aria-describedby": oe,
|
|
496
477
|
tabIndex: 0,
|
|
497
|
-
viewBox: `0 0 ${
|
|
498
|
-
height:
|
|
478
|
+
viewBox: `0 0 ${ie} ${g}`,
|
|
479
|
+
height: g,
|
|
499
480
|
onKeyDown: Se,
|
|
500
481
|
onFocus: (e) => {
|
|
501
482
|
if (e.currentTarget.matches(":focus-visible")) {
|
|
502
|
-
let e =
|
|
503
|
-
|
|
483
|
+
let e = H ?? r[0];
|
|
484
|
+
z(e?.id), I(e === void 0 ? void 0 : {
|
|
504
485
|
id: e.id,
|
|
505
486
|
source: "keyboard"
|
|
506
487
|
});
|
|
@@ -511,97 +492,97 @@ function R({ title: e, description: t, report: n, categories: r, series: o, doma
|
|
|
511
492
|
},
|
|
512
493
|
onPointerDown: xe,
|
|
513
494
|
onPointerLeave: (e) => {
|
|
514
|
-
e.pointerType === "mouse" &&
|
|
495
|
+
e.pointerType === "mouse" && ce?.source === "pointer" && I(void 0);
|
|
515
496
|
},
|
|
516
|
-
onBlur: () =>
|
|
497
|
+
onBlur: () => I(void 0),
|
|
517
498
|
onClick: () => {
|
|
518
|
-
|
|
499
|
+
V !== void 0 && m?.onSelect(V.id);
|
|
519
500
|
},
|
|
520
|
-
...
|
|
501
|
+
...b.props(l.svg, l.inspectable, me),
|
|
521
502
|
children: [
|
|
522
|
-
|
|
523
|
-
x: (
|
|
503
|
+
V !== void 0 && /* @__PURE__ */ E("rect", {
|
|
504
|
+
x: ($(V.id) ?? Z) - ($.step() - $.bandwidth()) / 2,
|
|
524
505
|
y: 12,
|
|
525
|
-
width:
|
|
506
|
+
width: $.step(),
|
|
526
507
|
height: Y - 12,
|
|
527
508
|
className: "x2wnxhi"
|
|
528
509
|
}),
|
|
529
|
-
X.ticks(3).map((e) => /* @__PURE__ */
|
|
510
|
+
X.ticks(3).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
|
|
530
511
|
x1: Z,
|
|
531
|
-
x2:
|
|
512
|
+
x2: Q,
|
|
532
513
|
y1: X(e),
|
|
533
514
|
y2: X(e),
|
|
534
|
-
...
|
|
535
|
-
}), /* @__PURE__ */
|
|
515
|
+
...b.props(l.grid)
|
|
516
|
+
}), /* @__PURE__ */ E("text", {
|
|
536
517
|
x: Z - 8,
|
|
537
518
|
y: X(e),
|
|
538
519
|
textAnchor: "end",
|
|
539
520
|
dominantBaseline: "middle",
|
|
540
|
-
...
|
|
541
|
-
children:
|
|
521
|
+
...b.props(l.label),
|
|
522
|
+
children: f(e)
|
|
542
523
|
})] }, e)),
|
|
543
|
-
|
|
544
|
-
x:
|
|
545
|
-
y: Math.max(12, X(
|
|
546
|
-
...
|
|
547
|
-
children:
|
|
524
|
+
v?.annotation !== void 0 && r.some((e) => e.id === v.annotation?.categoryId) && /* @__PURE__ */ E("text", {
|
|
525
|
+
x: $(v.annotation.categoryId),
|
|
526
|
+
y: Math.max(12, X(v.annotation.value) - 8),
|
|
527
|
+
...b.props(l.label),
|
|
528
|
+
children: v.annotation.label
|
|
548
529
|
}),
|
|
549
530
|
r.map((e, t) => {
|
|
550
|
-
let n = e.axisLabel ?? e.label, r =
|
|
551
|
-
return /* @__PURE__ */
|
|
531
|
+
let n = e.axisLabel ?? e.label, r = v?.buckets[t];
|
|
532
|
+
return /* @__PURE__ */ D("g", { children: [r === void 0 ? o.map((n, r) => {
|
|
552
533
|
let a = n.values[t];
|
|
553
534
|
if (a == null) return null;
|
|
554
|
-
let s = c === "stacked" ? o.slice(0, r).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0,
|
|
555
|
-
return /* @__PURE__ */
|
|
556
|
-
x: (
|
|
557
|
-
y: Math.min(
|
|
558
|
-
width: c === "stacked" ?
|
|
559
|
-
height: Math.max(+(a === 0), Math.abs(
|
|
560
|
-
fill:
|
|
561
|
-
...
|
|
535
|
+
let s = c === "stacked" ? o.slice(0, r).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, u = X(s), f = X(s + a), h = m?.selectedId === e.id || V?.id === e.id;
|
|
536
|
+
return /* @__PURE__ */ E(A, {
|
|
537
|
+
x: ($(e.id) ?? Z) + (c === "stacked" ? 0 : _e(n.id) ?? 0),
|
|
538
|
+
y: Math.min(u, f),
|
|
539
|
+
width: c === "stacked" ? $.bandwidth() : _e.bandwidth(),
|
|
540
|
+
height: Math.max(+(a === 0), Math.abs(f - u)),
|
|
541
|
+
fill: d[i(n.tone, r)],
|
|
542
|
+
...b.props(h && l.selected, p !== void 0 && p !== n.id && ue.mutedMark)
|
|
562
543
|
}, n.id);
|
|
563
|
-
}) : /* @__PURE__ */
|
|
544
|
+
}) : /* @__PURE__ */ E(le, {
|
|
564
545
|
bucket: r,
|
|
565
546
|
series: o,
|
|
566
|
-
focusedSeries:
|
|
547
|
+
focusedSeries: y,
|
|
567
548
|
index: t,
|
|
568
|
-
x:
|
|
569
|
-
width:
|
|
549
|
+
x: $(e.id) ?? Z,
|
|
550
|
+
width: $.bandwidth(),
|
|
570
551
|
y: X,
|
|
571
|
-
isHighlighted: m?.selectedId === e.id ||
|
|
572
|
-
highlightedSeriesId:
|
|
573
|
-
}), t % ye === 0 && /* @__PURE__ */
|
|
574
|
-
x: (
|
|
575
|
-
y:
|
|
552
|
+
isHighlighted: m?.selectedId === e.id || V?.id === e.id,
|
|
553
|
+
highlightedSeriesId: p
|
|
554
|
+
}), t % ye === 0 && /* @__PURE__ */ E("text", {
|
|
555
|
+
x: ($(e.id) ?? Z) + $.bandwidth() / 2,
|
|
556
|
+
y: g - 4,
|
|
576
557
|
textAnchor: "middle",
|
|
577
|
-
...
|
|
558
|
+
...b.props(l.label),
|
|
578
559
|
children: n.length > be ? `${n.slice(0, be - 1)}…` : n
|
|
579
560
|
})] }, e.id);
|
|
580
561
|
}),
|
|
581
|
-
|
|
582
|
-
x: (
|
|
562
|
+
U !== void 0 && /* @__PURE__ */ E(ne, {
|
|
563
|
+
x: ($(U.id) ?? Z) + $.bandwidth() / 2,
|
|
583
564
|
top: 12,
|
|
584
565
|
bottom: Y,
|
|
585
|
-
width: Math.max(8,
|
|
566
|
+
width: Math.max(8, $.bandwidth())
|
|
586
567
|
})
|
|
587
568
|
]
|
|
588
569
|
})
|
|
589
570
|
})
|
|
590
571
|
});
|
|
591
572
|
}
|
|
592
|
-
function
|
|
573
|
+
function R(e, t, n) {
|
|
593
574
|
return e.map((e) => {
|
|
594
575
|
let r = e.values[t];
|
|
595
576
|
return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
|
|
596
577
|
}).join(" · ");
|
|
597
578
|
}
|
|
598
579
|
// packages/charts/src/cartesian/breakdown-bar.tsx
|
|
599
|
-
var
|
|
580
|
+
var z = {
|
|
600
581
|
kzqmXN: "x5lhr3w",
|
|
601
582
|
kZKoxP: "x5yr21d",
|
|
602
583
|
$$css: !0
|
|
603
584
|
}, B = { segment: (e, t) => [
|
|
604
|
-
|
|
585
|
+
z,
|
|
605
586
|
{
|
|
606
587
|
kWkggS: t == null ? t : "xl8spv7",
|
|
607
588
|
$$css: !0
|
|
@@ -612,26 +593,26 @@ var ge = {
|
|
|
612
593
|
}
|
|
613
594
|
] };
|
|
614
595
|
function V({ title: e, report: t, description: r, items: o, total: s, formatValue: c, selection: l }) {
|
|
615
|
-
let
|
|
616
|
-
return
|
|
596
|
+
let f = n(o), p = o.reduce((e, t) => e + (t.value ?? 0), 0), m = 2 ** -52 * Math.max(p, s, 1) * o.length;
|
|
597
|
+
return f === void 0 ? !Number.isFinite(s) || s < 0 || p - s > m ? /* @__PURE__ */ E(h, {
|
|
617
598
|
title: e,
|
|
618
599
|
report: t,
|
|
619
600
|
description: r,
|
|
620
601
|
message: "The total must be finite and at least the sum of recorded values."
|
|
621
|
-
}) : /* @__PURE__ */
|
|
602
|
+
}) : /* @__PURE__ */ E(u, {
|
|
622
603
|
title: e,
|
|
623
604
|
report: t,
|
|
624
605
|
description: r,
|
|
625
|
-
children: o.length === 0 ? /* @__PURE__ */
|
|
606
|
+
children: o.length === 0 ? /* @__PURE__ */ E("p", {
|
|
626
607
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
627
608
|
children: "No values"
|
|
628
|
-
}) : /* @__PURE__ */
|
|
629
|
-
/* @__PURE__ */
|
|
609
|
+
}) : /* @__PURE__ */ D(T, { children: [
|
|
610
|
+
/* @__PURE__ */ E("div", {
|
|
630
611
|
"aria-hidden": !0,
|
|
631
612
|
className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
|
|
632
|
-
children: o.map((e, t) => e.value === null ? null : /* @__PURE__ */
|
|
613
|
+
children: o.map((e, t) => e.value === null ? null : /* @__PURE__ */ E("span", { ...b.props(B.segment(s === 0 ? 0 : e.value / s * 100, d[i(e.tone, t)])) }, e.id))
|
|
633
614
|
}),
|
|
634
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ E(a, {
|
|
635
616
|
items: o.map((e, t) => ({
|
|
636
617
|
id: e.id,
|
|
637
618
|
label: e.label,
|
|
@@ -640,30 +621,30 @@ function V({ title: e, report: t, description: r, items: o, total: s, formatValu
|
|
|
640
621
|
})),
|
|
641
622
|
selection: l
|
|
642
623
|
}),
|
|
643
|
-
s -
|
|
624
|
+
s - p > m && /* @__PURE__ */ D("p", {
|
|
644
625
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
645
626
|
children: [
|
|
646
627
|
"Unassigned portion: ",
|
|
647
|
-
c(s -
|
|
628
|
+
c(s - p),
|
|
648
629
|
" of ",
|
|
649
630
|
c(s)
|
|
650
631
|
]
|
|
651
632
|
})
|
|
652
633
|
] })
|
|
653
|
-
}) : /* @__PURE__ */
|
|
634
|
+
}) : /* @__PURE__ */ E(h, {
|
|
654
635
|
title: e,
|
|
655
636
|
report: t,
|
|
656
637
|
description: r,
|
|
657
|
-
message:
|
|
638
|
+
message: f
|
|
658
639
|
});
|
|
659
640
|
}
|
|
660
641
|
// packages/charts/src/cartesian/scatter-plot.tsx
|
|
661
|
-
var H = 260, U = 56, W = 20, G = 12,
|
|
642
|
+
var H = 260, U = 56, W = 20, G = 12, ge = 1e3, K = {
|
|
662
643
|
kzqmXN: "x1xc55vz",
|
|
663
644
|
kZKoxP: "xdk7pt",
|
|
664
645
|
kaIpWk: "x16rqkct",
|
|
665
646
|
$$css: !0
|
|
666
|
-
},
|
|
647
|
+
}, q = {
|
|
667
648
|
brush: {
|
|
668
649
|
kFalU9: "xx69xxh",
|
|
669
650
|
kkrTdU: "xsid9ct",
|
|
@@ -701,7 +682,7 @@ var H = 260, U = 56, W = 20, G = 12, K = 1e3, q = {
|
|
|
701
682
|
"--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
702
683
|
}],
|
|
703
684
|
dot: (e) => [
|
|
704
|
-
|
|
685
|
+
K,
|
|
705
686
|
{
|
|
706
687
|
kWkggS: e == null ? e : "xl8spv7",
|
|
707
688
|
$$css: !0
|
|
@@ -716,78 +697,78 @@ var H = 260, U = 56, W = 20, G = 12, K = 1e3, q = {
|
|
|
716
697
|
$$css: !0
|
|
717
698
|
}
|
|
718
699
|
};
|
|
719
|
-
function
|
|
720
|
-
let { title: t, report: n, description: r, points: i, xDomain: a, yDomain: o, xLabel:
|
|
721
|
-
if (
|
|
700
|
+
function J(e) {
|
|
701
|
+
let { title: t, report: n, description: r, points: i, xDomain: a, yDomain: o, xLabel: l, yLabel: p, formatX: m, formatY: g, selection: v, rangeSelection: y, emptyLabel: x } = e, { ref: S, width: C } = _(), ee = Z(e);
|
|
702
|
+
if (ee !== null) return /* @__PURE__ */ E(h, {
|
|
722
703
|
title: t,
|
|
723
704
|
report: n,
|
|
724
705
|
description: r,
|
|
725
|
-
message:
|
|
706
|
+
message: ee
|
|
726
707
|
});
|
|
727
|
-
let
|
|
708
|
+
let w = k({
|
|
728
709
|
domain: [...a],
|
|
729
|
-
range: [U, Math.max(U,
|
|
730
|
-
}),
|
|
710
|
+
range: [U, Math.max(U, C - W)]
|
|
711
|
+
}), T = k({
|
|
731
712
|
domain: [...o],
|
|
732
713
|
range: [216, G]
|
|
733
|
-
}),
|
|
734
|
-
return /* @__PURE__ */
|
|
714
|
+
}), O = i.find((e) => e.id === v?.selectedId);
|
|
715
|
+
return /* @__PURE__ */ D(u, {
|
|
735
716
|
title: t,
|
|
736
717
|
report: n,
|
|
737
718
|
description: r,
|
|
738
|
-
footer:
|
|
719
|
+
footer: v !== void 0 && i.length > 0 ? /* @__PURE__ */ E(s, { children: O === void 0 ? "Select a point to inspect its label and coordinates." : `${O.label}, ${l}: ${m(O.x)}, ${p}: ${g(O.y)}` }) : void 0,
|
|
739
720
|
children: [
|
|
740
|
-
i.length === 0 ? /* @__PURE__ */
|
|
721
|
+
i.length === 0 ? /* @__PURE__ */ E("p", {
|
|
741
722
|
className: "x1ghz6dp x153jb6y",
|
|
742
|
-
children:
|
|
743
|
-
}) : /* @__PURE__ */
|
|
744
|
-
ref:
|
|
723
|
+
children: x
|
|
724
|
+
}) : /* @__PURE__ */ D("div", {
|
|
725
|
+
ref: S,
|
|
745
726
|
className: "x1n2onr6 xeuugli",
|
|
746
|
-
children: [/* @__PURE__ */
|
|
747
|
-
width:
|
|
748
|
-
scaleX:
|
|
749
|
-
scaleY:
|
|
727
|
+
children: [/* @__PURE__ */ E(Y, {
|
|
728
|
+
width: C,
|
|
729
|
+
scaleX: w,
|
|
730
|
+
scaleY: T,
|
|
750
731
|
...e
|
|
751
|
-
}, `${a[0]}:${a[1]}:${o[0]}:${o[1]}:${
|
|
732
|
+
}, `${a[0]}:${a[1]}:${o[0]}:${o[1]}:${C}`), v !== void 0 && /* @__PURE__ */ E("div", {
|
|
752
733
|
className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
|
|
753
|
-
children: i.map((e) => /* @__PURE__ */
|
|
734
|
+
children: i.map((e) => /* @__PURE__ */ E("button", {
|
|
754
735
|
type: "button",
|
|
755
736
|
title: e.label,
|
|
756
|
-
"aria-label": `${e.label}, ${
|
|
757
|
-
"aria-pressed":
|
|
758
|
-
onClick: () =>
|
|
759
|
-
...
|
|
760
|
-
children: /* @__PURE__ */
|
|
737
|
+
"aria-label": `${e.label}, ${l}: ${m(e.x)}, ${p}: ${g(e.y)}`,
|
|
738
|
+
"aria-pressed": v.selectedId === e.id,
|
|
739
|
+
onClick: () => v.onSelect(e.id),
|
|
740
|
+
...b.props(q.target, q.location(w(e.x), T(e.y))),
|
|
741
|
+
children: /* @__PURE__ */ E("span", {
|
|
761
742
|
"aria-hidden": !0,
|
|
762
|
-
...
|
|
743
|
+
...b.props(q.dot(d[e.tone]), v.selectedId === e.id && q.selected)
|
|
763
744
|
})
|
|
764
745
|
}, e.id))
|
|
765
746
|
})]
|
|
766
747
|
}),
|
|
767
|
-
|
|
748
|
+
y !== void 0 && /* @__PURE__ */ E(X, {
|
|
768
749
|
...e,
|
|
769
|
-
rangeSelection:
|
|
750
|
+
rangeSelection: y
|
|
770
751
|
}),
|
|
771
|
-
i.length > 0 && /* @__PURE__ */
|
|
772
|
-
label: `${e.label}, ${
|
|
773
|
-
isSelected:
|
|
774
|
-
onSelect:
|
|
775
|
-
children: [/* @__PURE__ */
|
|
752
|
+
i.length > 0 && /* @__PURE__ */ E(f, { children: i.map((e) => /* @__PURE__ */ D(c, {
|
|
753
|
+
label: `${e.label}, ${l}: ${m(e.x)}, ${p}: ${g(e.y)}`,
|
|
754
|
+
isSelected: v?.selectedId === e.id,
|
|
755
|
+
onSelect: v === void 0 ? void 0 : () => v.onSelect(e.id),
|
|
756
|
+
children: [/* @__PURE__ */ E("span", { children: e.label }), /* @__PURE__ */ D("span", {
|
|
776
757
|
className: "xeuugli xss6m8b xj0a0fe x153jb6y",
|
|
777
758
|
children: [
|
|
778
|
-
|
|
759
|
+
m(e.x),
|
|
779
760
|
" · ",
|
|
780
|
-
|
|
761
|
+
g(e.y)
|
|
781
762
|
]
|
|
782
763
|
})]
|
|
783
764
|
}, e.id)) })
|
|
784
765
|
]
|
|
785
766
|
});
|
|
786
767
|
}
|
|
787
|
-
function
|
|
788
|
-
let
|
|
789
|
-
x: [Math.min(
|
|
790
|
-
y: [Math.min(
|
|
768
|
+
function Y({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, formatX: o, formatY: s, selection: c, rangeSelection: u }) {
|
|
769
|
+
let f = S(), [p, m] = w(null), h = p === null ? u?.value : {
|
|
770
|
+
x: [Math.min(p.start.x, p.end.x), Math.max(p.start.x, p.end.x)],
|
|
771
|
+
y: [Math.min(p.start.y, p.end.y), Math.max(p.start.y, p.end.y)]
|
|
791
772
|
};
|
|
792
773
|
function g(r) {
|
|
793
774
|
let i = r.currentTarget.getBoundingClientRect();
|
|
@@ -797,7 +778,7 @@ function X({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
|
|
|
797
778
|
};
|
|
798
779
|
}
|
|
799
780
|
function _(t) {
|
|
800
|
-
if (
|
|
781
|
+
if (u === void 0 || t.button !== 0 || t.pointerType === "touch") return;
|
|
801
782
|
let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * H;
|
|
802
783
|
if (r < U || r > e - W || i < G || i > 216) return;
|
|
803
784
|
let a = g(t);
|
|
@@ -808,20 +789,20 @@ function X({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
|
|
|
808
789
|
});
|
|
809
790
|
}
|
|
810
791
|
function v(e) {
|
|
811
|
-
|
|
812
|
-
...
|
|
792
|
+
p !== null && p.pointerId === e.pointerId && m({
|
|
793
|
+
...p,
|
|
813
794
|
end: g(e)
|
|
814
795
|
});
|
|
815
796
|
}
|
|
816
797
|
function y(e) {
|
|
817
|
-
if (
|
|
798
|
+
if (p === null || p.pointerId !== e.pointerId) return;
|
|
818
799
|
let t = g(e), n = {
|
|
819
|
-
x: [Math.min(
|
|
820
|
-
y: [Math.min(
|
|
800
|
+
x: [Math.min(p.start.x, t.x), Math.max(p.start.x, t.x)],
|
|
801
|
+
y: [Math.min(p.start.y, t.y), Math.max(p.start.y, t.y)]
|
|
821
802
|
};
|
|
822
|
-
m(null), e.currentTarget.releasePointerCapture(e.pointerId),
|
|
803
|
+
m(null), e.currentTarget.releasePointerCapture(e.pointerId), u?.onChange(n);
|
|
823
804
|
}
|
|
824
|
-
return /* @__PURE__ */
|
|
805
|
+
return /* @__PURE__ */ D("svg", {
|
|
825
806
|
width: e,
|
|
826
807
|
height: H,
|
|
827
808
|
viewBox: `0 0 ${e} ${H}`,
|
|
@@ -831,90 +812,90 @@ function X({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
|
|
|
831
812
|
onPointerUp: y,
|
|
832
813
|
onPointerCancel: () => m(null),
|
|
833
814
|
onLostPointerCapture: () => m(null),
|
|
834
|
-
...
|
|
815
|
+
...b.props(l.svg, u !== void 0 && q.brush),
|
|
835
816
|
children: [
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
id:
|
|
838
|
-
children: /* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ E("defs", { children: /* @__PURE__ */ E("clipPath", {
|
|
818
|
+
id: f,
|
|
819
|
+
children: /* @__PURE__ */ E("rect", {
|
|
839
820
|
x: U,
|
|
840
821
|
y: G,
|
|
841
822
|
width: Math.max(0, e - U - W),
|
|
842
823
|
height: 204
|
|
843
824
|
})
|
|
844
825
|
}) }),
|
|
845
|
-
t.ticks(5).map((e) => /* @__PURE__ */
|
|
826
|
+
t.ticks(5).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
|
|
846
827
|
x1: t(e),
|
|
847
828
|
x2: t(e),
|
|
848
829
|
y1: G,
|
|
849
830
|
y2: 216,
|
|
850
|
-
...
|
|
851
|
-
}), /* @__PURE__ */
|
|
831
|
+
...b.props(l.grid)
|
|
832
|
+
}), /* @__PURE__ */ E("text", {
|
|
852
833
|
x: t(e),
|
|
853
834
|
y: 234,
|
|
854
835
|
textAnchor: "middle",
|
|
855
|
-
...
|
|
836
|
+
...b.props(l.label),
|
|
856
837
|
children: o(e)
|
|
857
838
|
})] }, e)),
|
|
858
|
-
n.ticks(4).map((t) => /* @__PURE__ */
|
|
839
|
+
n.ticks(4).map((t) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
|
|
859
840
|
x1: U,
|
|
860
841
|
x2: e - W,
|
|
861
842
|
y1: n(t),
|
|
862
843
|
y2: n(t),
|
|
863
|
-
...
|
|
864
|
-
}), /* @__PURE__ */
|
|
844
|
+
...b.props(l.grid)
|
|
845
|
+
}), /* @__PURE__ */ E("text", {
|
|
865
846
|
x: 48,
|
|
866
847
|
y: n(t) + 4,
|
|
867
848
|
textAnchor: "end",
|
|
868
|
-
...
|
|
849
|
+
...b.props(l.label),
|
|
869
850
|
children: s(t)
|
|
870
851
|
})] }, t)),
|
|
871
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ E("text", {
|
|
872
853
|
x: (U + e - W) / 2,
|
|
873
854
|
y: 256,
|
|
874
855
|
textAnchor: "middle",
|
|
875
|
-
...
|
|
856
|
+
...b.props(l.label),
|
|
876
857
|
children: i
|
|
877
858
|
}),
|
|
878
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ E("text", {
|
|
879
860
|
x: 12,
|
|
880
861
|
y: 108,
|
|
881
862
|
textAnchor: "middle",
|
|
882
863
|
transform: "rotate(-90 12 108)",
|
|
883
|
-
...
|
|
864
|
+
...b.props(l.label),
|
|
884
865
|
children: a
|
|
885
866
|
}),
|
|
886
|
-
/* @__PURE__ */
|
|
887
|
-
clipPath: `url(#${
|
|
888
|
-
children: [h != null && /* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ D("g", {
|
|
868
|
+
clipPath: `url(#${f})`,
|
|
869
|
+
children: [h != null && /* @__PURE__ */ E("rect", {
|
|
889
870
|
x: t(h.x[0]),
|
|
890
871
|
y: n(h.y[1]),
|
|
891
872
|
width: t(h.x[1]) - t(h.x[0]),
|
|
892
873
|
height: n(h.y[0]) - n(h.y[1]),
|
|
893
874
|
className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
|
|
894
|
-
}), c === void 0 && r.map((e) => /* @__PURE__ */
|
|
875
|
+
}), c === void 0 && r.map((e) => /* @__PURE__ */ E("circle", {
|
|
895
876
|
cx: t(e.x),
|
|
896
877
|
cy: n(e.y),
|
|
897
878
|
r: 4,
|
|
898
|
-
fill:
|
|
879
|
+
fill: d[e.tone]
|
|
899
880
|
}, e.id))]
|
|
900
881
|
})
|
|
901
882
|
]
|
|
902
883
|
});
|
|
903
884
|
}
|
|
904
|
-
function
|
|
905
|
-
let
|
|
885
|
+
function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: a, formatY: o }) {
|
|
886
|
+
let s = e.value ?? {
|
|
906
887
|
x: t,
|
|
907
888
|
y: n
|
|
908
889
|
};
|
|
909
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ D("fieldset", {
|
|
910
891
|
className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
|
|
911
892
|
children: [
|
|
912
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ E("legend", {
|
|
913
894
|
className: "x153jb6y xy8obcc x1jfksii",
|
|
914
895
|
children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
|
|
915
896
|
}),
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
value:
|
|
897
|
+
/* @__PURE__ */ D(y.Root, {
|
|
898
|
+
value: s.x,
|
|
918
899
|
min: t[0],
|
|
919
900
|
max: t[1],
|
|
920
901
|
step: e.xStep,
|
|
@@ -922,62 +903,62 @@ function Z({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
922
903
|
thumbCollisionBehavior: "none",
|
|
923
904
|
onValueChange: (t) => e.onChange({
|
|
924
905
|
x: t,
|
|
925
|
-
y:
|
|
906
|
+
y: s.y
|
|
926
907
|
}),
|
|
927
|
-
children: [/* @__PURE__ */
|
|
908
|
+
children: [/* @__PURE__ */ D("div", {
|
|
928
909
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
929
|
-
children: [/* @__PURE__ */
|
|
930
|
-
a(
|
|
910
|
+
children: [/* @__PURE__ */ E(y.Label, { children: r }), /* @__PURE__ */ D("span", { children: [
|
|
911
|
+
a(s.x[0]),
|
|
931
912
|
" – ",
|
|
932
|
-
a(
|
|
913
|
+
a(s.x[1])
|
|
933
914
|
] })]
|
|
934
|
-
}), /* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
915
|
+
}), /* @__PURE__ */ E(y.Control, { children: /* @__PURE__ */ D(y.Track, { children: [
|
|
916
|
+
/* @__PURE__ */ E(y.Indicator, {}),
|
|
917
|
+
/* @__PURE__ */ E(y.Thumb, {
|
|
937
918
|
index: 0,
|
|
938
919
|
"aria-label": `${r} minimum`,
|
|
939
920
|
getAriaValueText: (e, t) => a(t)
|
|
940
921
|
}),
|
|
941
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ E(y.Thumb, {
|
|
942
923
|
index: 1,
|
|
943
924
|
"aria-label": `${r} maximum`,
|
|
944
925
|
getAriaValueText: (e, t) => a(t)
|
|
945
926
|
})
|
|
946
927
|
] }) })]
|
|
947
928
|
}),
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
value:
|
|
929
|
+
/* @__PURE__ */ D(y.Root, {
|
|
930
|
+
value: s.y,
|
|
950
931
|
min: n[0],
|
|
951
932
|
max: n[1],
|
|
952
933
|
step: e.yStep,
|
|
953
934
|
locale: e.locale,
|
|
954
935
|
thumbCollisionBehavior: "none",
|
|
955
936
|
onValueChange: (t) => e.onChange({
|
|
956
|
-
x:
|
|
937
|
+
x: s.x,
|
|
957
938
|
y: t
|
|
958
939
|
}),
|
|
959
|
-
children: [/* @__PURE__ */
|
|
940
|
+
children: [/* @__PURE__ */ D("div", {
|
|
960
941
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
961
|
-
children: [/* @__PURE__ */
|
|
962
|
-
s
|
|
942
|
+
children: [/* @__PURE__ */ E(y.Label, { children: i }), /* @__PURE__ */ D("span", { children: [
|
|
943
|
+
o(s.y[0]),
|
|
963
944
|
" – ",
|
|
964
|
-
s
|
|
945
|
+
o(s.y[1])
|
|
965
946
|
] })]
|
|
966
|
-
}), /* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
947
|
+
}), /* @__PURE__ */ E(y.Control, { children: /* @__PURE__ */ D(y.Track, { children: [
|
|
948
|
+
/* @__PURE__ */ E(y.Indicator, {}),
|
|
949
|
+
/* @__PURE__ */ E(y.Thumb, {
|
|
969
950
|
index: 0,
|
|
970
951
|
"aria-label": `${i} minimum`,
|
|
971
|
-
getAriaValueText: (e, t) =>
|
|
952
|
+
getAriaValueText: (e, t) => o(t)
|
|
972
953
|
}),
|
|
973
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ E(y.Thumb, {
|
|
974
955
|
index: 1,
|
|
975
956
|
"aria-label": `${i} maximum`,
|
|
976
|
-
getAriaValueText: (e, t) =>
|
|
957
|
+
getAriaValueText: (e, t) => o(t)
|
|
977
958
|
})
|
|
978
959
|
] }) })]
|
|
979
960
|
}),
|
|
980
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ E(v, {
|
|
981
962
|
type: "button",
|
|
982
963
|
disabled: e.value === null,
|
|
983
964
|
onClick: () => e.onChange(null),
|
|
@@ -986,10 +967,10 @@ function Z({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
986
967
|
]
|
|
987
968
|
});
|
|
988
969
|
}
|
|
989
|
-
function
|
|
990
|
-
if (!
|
|
991
|
-
if (e.length > 1e3) return `This plot exceeds the ${
|
|
992
|
-
if (!
|
|
970
|
+
function Z({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
|
|
971
|
+
if (!m(t) || !m(n)) return "Scatter domains must contain finite, increasing endpoints.";
|
|
972
|
+
if (e.length > 1e3) return `This plot exceeds the ${ge}-point render limit. Supply a smaller, labelled sample.`;
|
|
973
|
+
if (!p(e)) return "Scatter points must have unique identifiers.";
|
|
993
974
|
if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
|
|
994
975
|
if (e.some((e) => {
|
|
995
976
|
let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
|
|
@@ -1010,7 +991,7 @@ var $ = {
|
|
|
1010
991
|
pointsPerSeries: 2e3,
|
|
1011
992
|
markers: 200,
|
|
1012
993
|
panels: 12
|
|
1013
|
-
},
|
|
994
|
+
}, _e = .01, ve = [
|
|
1014
995
|
"series1",
|
|
1015
996
|
"series2",
|
|
1016
997
|
"series3",
|
|
@@ -1018,13 +999,13 @@ var $ = {
|
|
|
1018
999
|
"series5",
|
|
1019
1000
|
"series6"
|
|
1020
1001
|
];
|
|
1021
|
-
function
|
|
1002
|
+
function ye({ series: e, isStacked: t, markers: n }) {
|
|
1022
1003
|
let r = e[0]?.points.map((e) => e.timestamp) ?? [];
|
|
1023
1004
|
if (e.length > $.series || r.length > $.pointsPerSeries || n.length > $.markers) return `Choose a window with at most ${$.series} series, ${$.pointsPerSeries} observations per series, and ${$.markers} markers.`;
|
|
1024
|
-
if (!
|
|
1005
|
+
if (!p(e) || !p(n)) return "Series and markers require unique identifiers.";
|
|
1025
1006
|
for (let n of e) {
|
|
1026
1007
|
if (n.points.length !== r.length) return "Every series must supply the same observation timestamps.";
|
|
1027
|
-
let e =
|
|
1008
|
+
let e = Ce({
|
|
1028
1009
|
points: n.points,
|
|
1029
1010
|
timestamps: r,
|
|
1030
1011
|
isStacked: t
|
|
@@ -1042,7 +1023,7 @@ function be({ series: e, isStacked: t, markers: n }) {
|
|
|
1042
1023
|
if (!Number.isFinite(a) || !Number.isFinite(o)) return "The elapsed-time and value ranges must be finite.";
|
|
1043
1024
|
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.";
|
|
1044
1025
|
}
|
|
1045
|
-
function
|
|
1026
|
+
function be({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
1046
1027
|
return JSON.stringify([
|
|
1047
1028
|
n,
|
|
1048
1029
|
r,
|
|
@@ -1062,15 +1043,15 @@ function xe({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
|
1062
1043
|
])
|
|
1063
1044
|
]);
|
|
1064
1045
|
}
|
|
1065
|
-
function
|
|
1046
|
+
function xe(e, t, n = !1) {
|
|
1066
1047
|
if (e !== t) return [e, t];
|
|
1067
|
-
let r = Math.max(1, Math.abs(e) *
|
|
1048
|
+
let r = Math.max(1, Math.abs(e) * _e), i = n ? 0 : e - r, a = t + r;
|
|
1068
1049
|
return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
|
|
1069
1050
|
}
|
|
1070
|
-
function
|
|
1051
|
+
function Se(e, t) {
|
|
1071
1052
|
let n = e.filter((e) => e.tone === void 0);
|
|
1072
1053
|
return e.map((r, i) => {
|
|
1073
|
-
let a = n.findIndex((e) => e.id === r.id), o = r.tone ??
|
|
1054
|
+
let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? ve[a % ve.length] ?? "series1", s = r.points.map((n, r) => {
|
|
1074
1055
|
let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
|
|
1075
1056
|
return {
|
|
1076
1057
|
...n,
|
|
@@ -1085,7 +1066,7 @@ function Ce(e, t) {
|
|
|
1085
1066
|
};
|
|
1086
1067
|
});
|
|
1087
1068
|
}
|
|
1088
|
-
function
|
|
1069
|
+
function Ce({ points: e, timestamps: t, isStacked: n }) {
|
|
1089
1070
|
for (let [r, i] of e.entries()) {
|
|
1090
1071
|
let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
|
|
1091
1072
|
if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
|
|
@@ -1094,49 +1075,49 @@ function we({ points: e, timestamps: t, isStacked: n }) {
|
|
|
1094
1075
|
}
|
|
1095
1076
|
}
|
|
1096
1077
|
// packages/charts/src/cartesian/time-series-line.tsx
|
|
1097
|
-
function
|
|
1098
|
-
return /* @__PURE__ */
|
|
1078
|
+
function we({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }) {
|
|
1079
|
+
return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(j, {
|
|
1099
1080
|
data: [...e.points],
|
|
1100
1081
|
defined: (e) => e.value !== null,
|
|
1101
1082
|
x: (e) => t(e.timestamp),
|
|
1102
1083
|
y: (e) => n((e.value ?? 0) + e.base),
|
|
1103
|
-
stroke:
|
|
1104
|
-
...
|
|
1084
|
+
stroke: d[e.tone],
|
|
1085
|
+
...b.props(l.mark)
|
|
1105
1086
|
}), e.points.filter((t, n) => {
|
|
1106
1087
|
if (t.value === null) return !1;
|
|
1107
1088
|
let i = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
|
|
1108
1089
|
return e.points.length === 1 || i || t.timestamp === r;
|
|
1109
|
-
}).map((r) => /* @__PURE__ */
|
|
1090
|
+
}).map((r) => /* @__PURE__ */ E("circle", {
|
|
1110
1091
|
cx: t(r.timestamp),
|
|
1111
1092
|
cy: n((r.value ?? 0) + r.base),
|
|
1112
1093
|
r: i,
|
|
1113
|
-
fill:
|
|
1094
|
+
fill: d[e.tone]
|
|
1114
1095
|
}, r.timestamp))] });
|
|
1115
1096
|
}
|
|
1116
1097
|
// packages/charts/src/cartesian/sparkline.tsx
|
|
1117
|
-
function
|
|
1118
|
-
let o = S(), s = S(), c =
|
|
1098
|
+
function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
|
|
1099
|
+
let o = S(), s = S(), c = Ee({
|
|
1119
1100
|
title: e,
|
|
1120
1101
|
summary: t,
|
|
1121
1102
|
unit: n,
|
|
1122
1103
|
series: i,
|
|
1123
1104
|
valueDomain: a
|
|
1124
1105
|
}), l = i.points.some((e) => e.value !== null);
|
|
1125
|
-
if (c !== void 0 || !l) return /* @__PURE__ */
|
|
1106
|
+
if (c !== void 0 || !l) return /* @__PURE__ */ E("span", {
|
|
1126
1107
|
role: "img",
|
|
1127
1108
|
"aria-label": `${e}. ${t} Values in ${n}; timestamps in ${r}. ${c ?? "No recorded values. Missing observations remain unavailable."}`,
|
|
1128
1109
|
title: c ?? "No recorded values",
|
|
1129
1110
|
className: "x2pejg6 x10w6t97 x2lah0s xxymvpz x3nfvp2 x6s0dn4 xl56j7k x153jb6y x1hz01jw xy8obcc",
|
|
1130
1111
|
children: c === void 0 ? "No data" : "Invalid trend"
|
|
1131
1112
|
});
|
|
1132
|
-
let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f =
|
|
1133
|
-
domain: [...
|
|
1113
|
+
let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = k({
|
|
1114
|
+
domain: [...xe(u, d)],
|
|
1134
1115
|
range: [3, 125]
|
|
1135
|
-
}), p =
|
|
1116
|
+
}), p = k({
|
|
1136
1117
|
domain: [...a],
|
|
1137
1118
|
range: [29, 3]
|
|
1138
|
-
}), m =
|
|
1139
|
-
return /* @__PURE__ */
|
|
1119
|
+
}), m = Se([i], !1)[0];
|
|
1120
|
+
return /* @__PURE__ */ D("svg", {
|
|
1140
1121
|
role: "img",
|
|
1141
1122
|
"aria-labelledby": o,
|
|
1142
1123
|
"aria-describedby": s,
|
|
@@ -1146,11 +1127,11 @@ function Ee({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1146
1127
|
height: 32,
|
|
1147
1128
|
className: "x1rg5ohu x2pejg6 x10w6t97 x2lah0s xxymvpz",
|
|
1148
1129
|
children: [
|
|
1149
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ E("title", {
|
|
1150
1131
|
id: o,
|
|
1151
1132
|
children: e
|
|
1152
1133
|
}),
|
|
1153
|
-
/* @__PURE__ */
|
|
1134
|
+
/* @__PURE__ */ D("desc", {
|
|
1154
1135
|
id: s,
|
|
1155
1136
|
children: [
|
|
1156
1137
|
t,
|
|
@@ -1168,7 +1149,7 @@ function Ee({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1168
1149
|
"."
|
|
1169
1150
|
]
|
|
1170
1151
|
}),
|
|
1171
|
-
m !== void 0 && /* @__PURE__ */
|
|
1152
|
+
m !== void 0 && /* @__PURE__ */ E(we, {
|
|
1172
1153
|
series: m,
|
|
1173
1154
|
x: f,
|
|
1174
1155
|
y: p,
|
|
@@ -1177,10 +1158,10 @@ function Ee({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1177
1158
|
]
|
|
1178
1159
|
});
|
|
1179
1160
|
}
|
|
1180
|
-
function
|
|
1161
|
+
function Ee({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
|
|
1181
1162
|
if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
|
|
1182
|
-
if (!
|
|
1183
|
-
let a =
|
|
1163
|
+
if (!m(i)) return "The displayed value domain must have finite, increasing bounds.";
|
|
1164
|
+
let a = ye({
|
|
1184
1165
|
series: [r],
|
|
1185
1166
|
isStacked: !1,
|
|
1186
1167
|
markers: []
|
|
@@ -1189,7 +1170,7 @@ function De({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
|
|
|
1189
1170
|
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.";
|
|
1190
1171
|
}
|
|
1191
1172
|
// packages/charts/src/cartesian/time-series.tsx
|
|
1192
|
-
var
|
|
1173
|
+
var De = {
|
|
1193
1174
|
timeAxis: {
|
|
1194
1175
|
k1xSpc: "x78zum5",
|
|
1195
1176
|
kjj79g: "x1qughib",
|
|
@@ -1210,112 +1191,109 @@ var Oe = {
|
|
|
1210
1191
|
"--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
1211
1192
|
}]
|
|
1212
1193
|
};
|
|
1213
|
-
function
|
|
1214
|
-
return /* @__PURE__ */
|
|
1194
|
+
function Oe(e) {
|
|
1195
|
+
return /* @__PURE__ */ E(Fe, {
|
|
1215
1196
|
...e,
|
|
1216
1197
|
kind: "line",
|
|
1217
1198
|
isStacked: !1
|
|
1218
1199
|
});
|
|
1219
1200
|
}
|
|
1220
|
-
function
|
|
1221
|
-
return /* @__PURE__ */
|
|
1201
|
+
function ke({ isStacked: e = !1, ...t }) {
|
|
1202
|
+
return /* @__PURE__ */ E(Fe, {
|
|
1222
1203
|
...t,
|
|
1223
1204
|
kind: "area",
|
|
1224
1205
|
isStacked: e
|
|
1225
1206
|
});
|
|
1226
1207
|
}
|
|
1227
|
-
function
|
|
1228
|
-
return /* @__PURE__ */
|
|
1208
|
+
function Ae(e) {
|
|
1209
|
+
return /* @__PURE__ */ E(je, { ...e });
|
|
1229
1210
|
}
|
|
1230
|
-
function
|
|
1231
|
-
let
|
|
1211
|
+
function je({ title: n, description: r, series: i, actions: a, report: o, height: s = 180, showTimeAxis: c = !0 }) {
|
|
1212
|
+
let d = S(), f = Se(i.map((e) => ({
|
|
1232
1213
|
...e,
|
|
1233
1214
|
points: []
|
|
1234
1215
|
})), !1);
|
|
1235
|
-
return !Number.isFinite(s) || s < 48 ? /* @__PURE__ */
|
|
1216
|
+
return !Number.isFinite(s) || s < 48 ? /* @__PURE__ */ E(h, {
|
|
1236
1217
|
title: n,
|
|
1237
1218
|
description: r,
|
|
1238
1219
|
report: o,
|
|
1239
1220
|
message: "Chart height must be at least 48 pixels."
|
|
1240
|
-
}) : /* @__PURE__ */
|
|
1221
|
+
}) : /* @__PURE__ */ E("div", {
|
|
1241
1222
|
"aria-hidden": !0,
|
|
1242
1223
|
inert: !0,
|
|
1243
1224
|
className: "xeuugli",
|
|
1244
|
-
children: /* @__PURE__ */
|
|
1225
|
+
children: /* @__PURE__ */ E(u, {
|
|
1245
1226
|
title: n,
|
|
1246
1227
|
description: r,
|
|
1247
1228
|
report: o,
|
|
1248
|
-
series:
|
|
1249
|
-
actions:
|
|
1250
|
-
|
|
1251
|
-
children: null
|
|
1252
|
-
})] }),
|
|
1253
|
-
children: /* @__PURE__ */ E("div", {
|
|
1229
|
+
series: f,
|
|
1230
|
+
actions: a,
|
|
1231
|
+
children: /* @__PURE__ */ D("div", {
|
|
1254
1232
|
className: "xrvj5dj x1n8ia3y",
|
|
1255
|
-
children: [/* @__PURE__ */
|
|
1256
|
-
id:
|
|
1233
|
+
children: [/* @__PURE__ */ E(oe, {
|
|
1234
|
+
id: d,
|
|
1257
1235
|
label: void 0,
|
|
1258
|
-
legend:
|
|
1236
|
+
legend: f,
|
|
1259
1237
|
rows: [],
|
|
1260
1238
|
x: 0,
|
|
1261
1239
|
width: 0,
|
|
1262
1240
|
source: void 0,
|
|
1263
1241
|
hasSeriesSummary: o?.seriesValues !== void 0
|
|
1264
|
-
}), /* @__PURE__ */
|
|
1265
|
-
...
|
|
1266
|
-
children: [/* @__PURE__ */
|
|
1242
|
+
}), /* @__PURE__ */ D("div", {
|
|
1243
|
+
...b.props(l.plot),
|
|
1244
|
+
children: [/* @__PURE__ */ E(t, { height: s - 16 }), c && /* @__PURE__ */ D("div", {
|
|
1267
1245
|
className: "x78zum5 x1qughib x8zbtdt x1c87qhr xy8obcc xas2l8k x153jb6y xss6m8b",
|
|
1268
|
-
children: [/* @__PURE__ */
|
|
1246
|
+
children: [/* @__PURE__ */ E(e, { width: "8ch" }), /* @__PURE__ */ E(e, { width: "8ch" })]
|
|
1269
1247
|
})]
|
|
1270
1248
|
})]
|
|
1271
1249
|
})
|
|
1272
1250
|
})
|
|
1273
1251
|
});
|
|
1274
1252
|
}
|
|
1275
|
-
function
|
|
1276
|
-
let n =
|
|
1253
|
+
function Me({ charts: e, ...t }) {
|
|
1254
|
+
let n = ee(null), [r, i] = w(), a = JSON.stringify(e.map((e) => [
|
|
1277
1255
|
e.id,
|
|
1278
1256
|
e.title,
|
|
1279
|
-
|
|
1257
|
+
be({
|
|
1280
1258
|
series: e.series,
|
|
1281
1259
|
markers: e.markers ?? [],
|
|
1282
1260
|
timestampUnit: t.timestampUnit,
|
|
1283
1261
|
isStacked: !1
|
|
1284
1262
|
})
|
|
1285
1263
|
])), 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);
|
|
1286
|
-
if (r !== void 0 && r.signature !== a && i(void 0),
|
|
1264
|
+
if (r !== void 0 && r.signature !== a && i(void 0), x(() => {
|
|
1287
1265
|
function e(e) {
|
|
1288
1266
|
e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
|
|
1289
1267
|
}
|
|
1290
1268
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1291
|
-
}, []), !s || !
|
|
1269
|
+
}, []), !s || !p(e)) return /* @__PURE__ */ E(h, {
|
|
1292
1270
|
title: "Small multiples",
|
|
1293
1271
|
message: "Charts need unique identifiers and aligned observation timestamps."
|
|
1294
1272
|
});
|
|
1295
|
-
if (e.length > $.panels) return /* @__PURE__ */
|
|
1273
|
+
if (e.length > $.panels) return /* @__PURE__ */ E(h, {
|
|
1296
1274
|
title: "Small multiples",
|
|
1297
1275
|
message: `Choose at most ${$.panels} panels.`
|
|
1298
1276
|
});
|
|
1299
|
-
if (e.length === 0) return /* @__PURE__ */
|
|
1277
|
+
if (e.length === 0) return /* @__PURE__ */ E(u, {
|
|
1300
1278
|
title: "Small multiples",
|
|
1301
|
-
children: /* @__PURE__ */
|
|
1279
|
+
children: /* @__PURE__ */ E("p", {
|
|
1302
1280
|
className: "x153jb6y",
|
|
1303
1281
|
children: "No charts"
|
|
1304
1282
|
})
|
|
1305
1283
|
});
|
|
1306
1284
|
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);
|
|
1307
|
-
return /* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ E("div", {
|
|
1308
1286
|
ref: n,
|
|
1309
1287
|
...{
|
|
1310
1288
|
0: { className: "xrvj5dj x1j825kq" },
|
|
1311
1289
|
1: { className: "xrvj5dj xxhr3t" }
|
|
1312
1290
|
}[!!l | 0],
|
|
1313
|
-
children: e.map((n, o) => /* @__PURE__ */
|
|
1291
|
+
children: e.map((n, o) => /* @__PURE__ */ E("div", {
|
|
1314
1292
|
...{
|
|
1315
1293
|
0: {},
|
|
1316
1294
|
1: { className: "x1y332i5" }
|
|
1317
1295
|
}[!!(l && o > 0) | 0],
|
|
1318
|
-
children: /* @__PURE__ */
|
|
1296
|
+
children: /* @__PURE__ */ E(Fe, {
|
|
1319
1297
|
...t,
|
|
1320
1298
|
title: n.title,
|
|
1321
1299
|
description: n.description,
|
|
@@ -1341,25 +1319,25 @@ function Ne({ charts: e, ...t }) {
|
|
|
1341
1319
|
}, n.id))
|
|
1342
1320
|
});
|
|
1343
1321
|
}
|
|
1344
|
-
function
|
|
1345
|
-
if (!
|
|
1322
|
+
function Ne({ charts: e, height: t }) {
|
|
1323
|
+
if (!p(e) || e.length > $.panels) return /* @__PURE__ */ E(h, {
|
|
1346
1324
|
title: "Small multiples",
|
|
1347
1325
|
message: `Choose at most ${$.panels} panels with unique identifiers.`
|
|
1348
1326
|
});
|
|
1349
1327
|
let n = e.every((e) => e.report !== void 0);
|
|
1350
|
-
return /* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ E("div", {
|
|
1351
1329
|
"aria-hidden": !0,
|
|
1352
1330
|
inert: !0,
|
|
1353
1331
|
...{
|
|
1354
1332
|
0: { className: "xrvj5dj x1j825kq" },
|
|
1355
1333
|
1: { className: "xrvj5dj xxhr3t" }
|
|
1356
1334
|
}[!!n | 0],
|
|
1357
|
-
children: e.map((r, i) => /* @__PURE__ */
|
|
1335
|
+
children: e.map((r, i) => /* @__PURE__ */ E("div", {
|
|
1358
1336
|
...{
|
|
1359
1337
|
0: {},
|
|
1360
1338
|
1: { className: "x1y332i5" }
|
|
1361
1339
|
}[!!(n && i > 0) | 0],
|
|
1362
|
-
children: /* @__PURE__ */
|
|
1340
|
+
children: /* @__PURE__ */ E(je, {
|
|
1363
1341
|
...r,
|
|
1364
1342
|
height: t,
|
|
1365
1343
|
showTimeAxis: i === e.length - 1
|
|
@@ -1367,62 +1345,62 @@ function Pe({ charts: e, height: t }) {
|
|
|
1367
1345
|
}, r.id))
|
|
1368
1346
|
});
|
|
1369
1347
|
}
|
|
1370
|
-
var
|
|
1348
|
+
var Pe = {
|
|
1371
1349
|
"x-default-marker": "x-default-marker",
|
|
1372
1350
|
$$css: !0
|
|
1373
1351
|
};
|
|
1374
|
-
function
|
|
1375
|
-
let
|
|
1352
|
+
function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: i, formatValue: a, formatTick: o = a, markers: s = [], height: c = 180, actions: f, report: p, kind: m, isStacked: v, sharedInspection: y, axisWidth: T, showTimeAxis: O = !0 }) {
|
|
1353
|
+
let A = !Number.isFinite(c) || c < 48 ? "Chart height must be at least 48 pixels." : ye({
|
|
1376
1354
|
series: n,
|
|
1377
|
-
isStacked:
|
|
1355
|
+
isStacked: v,
|
|
1378
1356
|
markers: s
|
|
1379
|
-
}),
|
|
1357
|
+
}), j = C(() => A === void 0 ? Se(n, v) : [], [
|
|
1380
1358
|
n,
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
]),
|
|
1359
|
+
v,
|
|
1360
|
+
A
|
|
1361
|
+
]), N = j[0]?.points ?? [], { ref: P, width: re, element: ie } = _(), se = ee(null), [ce, le] = w(), ue = N.find((e) => e.timestamp === ce) ?? N[0], [de, fe] = w(), F = be({
|
|
1384
1362
|
series: n,
|
|
1385
1363
|
markers: s,
|
|
1386
1364
|
timestampUnit: r,
|
|
1387
|
-
isStacked:
|
|
1388
|
-
}), I =
|
|
1389
|
-
|
|
1390
|
-
let
|
|
1391
|
-
if (
|
|
1392
|
-
if (
|
|
1365
|
+
isStacked: v
|
|
1366
|
+
}), I = y === void 0 ? de?.signature === F ? de : void 0 : y.value, L = y === void 0 || y.isSource ? I : void 0, pe = p?.seriesValues !== void 0, me = S();
|
|
1367
|
+
de !== void 0 && (de.signature !== F || A !== void 0) && fe(void 0);
|
|
1368
|
+
let he = y !== void 0;
|
|
1369
|
+
if (x(() => {
|
|
1370
|
+
if (he) return;
|
|
1393
1371
|
function e(e) {
|
|
1394
|
-
e.target instanceof Node &&
|
|
1372
|
+
e.target instanceof Node && se.current?.contains(e.target) !== !0 && fe(void 0);
|
|
1395
1373
|
}
|
|
1396
1374
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1397
|
-
}, [
|
|
1375
|
+
}, [he]), A !== void 0) return /* @__PURE__ */ E(h, {
|
|
1398
1376
|
title: e,
|
|
1399
1377
|
description: t,
|
|
1400
|
-
report:
|
|
1401
|
-
message:
|
|
1378
|
+
report: p,
|
|
1379
|
+
message: A
|
|
1402
1380
|
});
|
|
1403
|
-
if (
|
|
1381
|
+
if (N.length === 0) return /* @__PURE__ */ E(u, {
|
|
1404
1382
|
title: e,
|
|
1405
1383
|
description: t,
|
|
1406
|
-
actions:
|
|
1407
|
-
report:
|
|
1408
|
-
series:
|
|
1409
|
-
children: /* @__PURE__ */
|
|
1384
|
+
actions: f,
|
|
1385
|
+
report: p,
|
|
1386
|
+
series: j,
|
|
1387
|
+
children: /* @__PURE__ */ E("p", {
|
|
1410
1388
|
className: "x153jb6y",
|
|
1411
1389
|
children: "No observations"
|
|
1412
1390
|
})
|
|
1413
1391
|
});
|
|
1414
|
-
let
|
|
1415
|
-
domain: [...
|
|
1416
|
-
range: [
|
|
1417
|
-
}),
|
|
1418
|
-
domain: [...
|
|
1419
|
-
range: [
|
|
1392
|
+
let R = c - 28, z = R + 12, B = N[0]?.timestamp ?? 0, V = N.at(-1)?.timestamp ?? B, H = j.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), U = m === "area" ? Math.min(0, ...H) : Math.min(...H), W = m === "area" ? Math.max(0, ...H) : Math.max(...H), G = H.length === 0 ? 0 : U, ge = H.length === 0 ? 1 : W, K = k({
|
|
1393
|
+
domain: [...xe(G, ge, m === "area")],
|
|
1394
|
+
range: [R, 12]
|
|
1395
|
+
}), q = K.ticks(3), J = T ?? Math.max(44, ...q.map((e) => o(e).length * 7 + 12)), Y = Math.max(J + 1, re - 16), X = k({
|
|
1396
|
+
domain: [...xe(B, V)],
|
|
1397
|
+
range: [J, Y]
|
|
1420
1398
|
});
|
|
1421
|
-
function
|
|
1422
|
-
let t =
|
|
1399
|
+
function Z(e) {
|
|
1400
|
+
let t = ie?.getBoundingClientRect();
|
|
1423
1401
|
if (t === void 0) return;
|
|
1424
|
-
let n =
|
|
1425
|
-
let r =
|
|
1402
|
+
let n = X.invert(e - t.left), r = N.find((e, t) => {
|
|
1403
|
+
let r = N[t + 1];
|
|
1426
1404
|
return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
|
|
1427
1405
|
});
|
|
1428
1406
|
r !== void 0 && Q({
|
|
@@ -1432,15 +1410,15 @@ function Ie({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1432
1410
|
});
|
|
1433
1411
|
}
|
|
1434
1412
|
function Q(e) {
|
|
1435
|
-
|
|
1413
|
+
y === void 0 ? fe(e) : y.onChange(e);
|
|
1436
1414
|
}
|
|
1437
1415
|
function $(e) {
|
|
1438
1416
|
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
1439
|
-
let t =
|
|
1440
|
-
ArrowRight: Math.min(
|
|
1417
|
+
let t = N.findIndex((e) => e.timestamp === ue?.timestamp), n = {
|
|
1418
|
+
ArrowRight: Math.min(N.length - 1, t + 1),
|
|
1441
1419
|
ArrowLeft: Math.max(0, t - 1),
|
|
1442
1420
|
Home: 0,
|
|
1443
|
-
End:
|
|
1421
|
+
End: N.length - 1
|
|
1444
1422
|
};
|
|
1445
1423
|
switch (e.key) {
|
|
1446
1424
|
case "Escape":
|
|
@@ -1451,8 +1429,8 @@ function Ie({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1451
1429
|
case "Home":
|
|
1452
1430
|
case "End": {
|
|
1453
1431
|
e.preventDefault();
|
|
1454
|
-
let t =
|
|
1455
|
-
t !== void 0 && (
|
|
1432
|
+
let t = N[n[e.key]];
|
|
1433
|
+
t !== void 0 && (le(t.timestamp), Q({
|
|
1456
1434
|
signature: F,
|
|
1457
1435
|
timestamp: t.timestamp,
|
|
1458
1436
|
source: "keyboard"
|
|
@@ -1461,63 +1439,56 @@ function Ie({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1461
1439
|
}
|
|
1462
1440
|
}
|
|
1463
1441
|
}
|
|
1464
|
-
return /* @__PURE__ */
|
|
1465
|
-
ref:
|
|
1442
|
+
return /* @__PURE__ */ E("div", {
|
|
1443
|
+
ref: se,
|
|
1466
1444
|
className: "xeuugli",
|
|
1467
|
-
children: /* @__PURE__ */
|
|
1468
|
-
title:
|
|
1445
|
+
children: /* @__PURE__ */ D(u, {
|
|
1446
|
+
title: pe ? e : /* @__PURE__ */ E(ae, {
|
|
1469
1447
|
title: e,
|
|
1470
1448
|
detail: L === void 0 ? void 0 : i(L.timestamp)
|
|
1471
1449
|
}),
|
|
1472
1450
|
description: t,
|
|
1473
|
-
report:
|
|
1474
|
-
series:
|
|
1475
|
-
actions:
|
|
1476
|
-
|
|
1477
|
-
" ",
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
children: /* @__PURE__ */
|
|
1481
|
-
|
|
1451
|
+
report: p,
|
|
1452
|
+
series: j,
|
|
1453
|
+
actions: f,
|
|
1454
|
+
children: [/* @__PURE__ */ E(M, { children: /* @__PURE__ */ D("table", {
|
|
1455
|
+
className: "xh8yej3 x1mwwwfo xy8obcc x1yc453h xss6m8b",
|
|
1456
|
+
children: [
|
|
1457
|
+
/* @__PURE__ */ D("caption", { children: [e, " observations"] }),
|
|
1458
|
+
/* @__PURE__ */ E("thead", { children: /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ D("th", {
|
|
1459
|
+
scope: "col",
|
|
1460
|
+
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1482
1461
|
children: [
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1487
|
-
children: [
|
|
1488
|
-
"Time (",
|
|
1489
|
-
r,
|
|
1490
|
-
")"
|
|
1491
|
-
]
|
|
1492
|
-
}), O.map((e) => /* @__PURE__ */ T("th", {
|
|
1493
|
-
scope: "col",
|
|
1494
|
-
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1495
|
-
children: e.label
|
|
1496
|
-
}, e.id))] }) }),
|
|
1497
|
-
/* @__PURE__ */ T("tbody", { children: k.map((e, t) => /* @__PURE__ */ E("tr", { children: [/* @__PURE__ */ T("th", {
|
|
1498
|
-
scope: "row",
|
|
1499
|
-
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1500
|
-
children: i(e.timestamp)
|
|
1501
|
-
}), O.map((e) => /* @__PURE__ */ T("td", {
|
|
1502
|
-
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1503
|
-
children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : a(e.points[t].value)
|
|
1504
|
-
}, e.id))] }, e.timestamp)) })
|
|
1462
|
+
"Time (",
|
|
1463
|
+
r,
|
|
1464
|
+
")"
|
|
1505
1465
|
]
|
|
1506
|
-
})
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1466
|
+
}), j.map((e) => /* @__PURE__ */ E("th", {
|
|
1467
|
+
scope: "col",
|
|
1468
|
+
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1469
|
+
children: e.label
|
|
1470
|
+
}, e.id))] }) }),
|
|
1471
|
+
/* @__PURE__ */ E("tbody", { children: N.map((e, t) => /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ E("th", {
|
|
1472
|
+
scope: "row",
|
|
1473
|
+
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1474
|
+
children: i(e.timestamp)
|
|
1475
|
+
}), j.map((e) => /* @__PURE__ */ E("td", {
|
|
1476
|
+
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1477
|
+
children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : a(e.points[t].value)
|
|
1478
|
+
}, e.id))] }, e.timestamp)) })
|
|
1479
|
+
]
|
|
1480
|
+
}) }), /* @__PURE__ */ D("div", {
|
|
1510
1481
|
className: "xrvj5dj x1n8ia3y",
|
|
1511
1482
|
children: [
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
-
id:
|
|
1483
|
+
/* @__PURE__ */ E(oe, {
|
|
1484
|
+
id: me,
|
|
1514
1485
|
label: L === void 0 ? void 0 : i(L.timestamp),
|
|
1515
|
-
legend:
|
|
1486
|
+
legend: j.map(({ id: e, label: t, tone: n }) => ({
|
|
1516
1487
|
id: e,
|
|
1517
1488
|
label: t,
|
|
1518
1489
|
tone: n
|
|
1519
1490
|
})),
|
|
1520
|
-
rows:
|
|
1491
|
+
rows: j.map((e) => {
|
|
1521
1492
|
let t = e.points.find((e) => e.timestamp === L?.timestamp);
|
|
1522
1493
|
return {
|
|
1523
1494
|
id: e.id,
|
|
@@ -1526,27 +1497,27 @@ function Ie({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1526
1497
|
value: t?.value === null || t === void 0 ? "Unavailable" : a(t.value)
|
|
1527
1498
|
};
|
|
1528
1499
|
}),
|
|
1529
|
-
x:
|
|
1530
|
-
width:
|
|
1500
|
+
x: X(I?.timestamp ?? B),
|
|
1501
|
+
width: re,
|
|
1531
1502
|
source: L?.source,
|
|
1532
1503
|
notes: s.filter((e) => e.timestamp === L?.timestamp).map((e) => e.label),
|
|
1533
|
-
hasSeriesSummary:
|
|
1504
|
+
hasSeriesSummary: pe
|
|
1534
1505
|
}),
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
ref:
|
|
1537
|
-
...
|
|
1538
|
-
children: [/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ D("div", {
|
|
1507
|
+
ref: P,
|
|
1508
|
+
...b.props(l.plot),
|
|
1509
|
+
children: [/* @__PURE__ */ D("svg", {
|
|
1539
1510
|
role: "img",
|
|
1540
1511
|
"aria-label": `${e}. Use arrow keys to inspect observations.`,
|
|
1541
|
-
"aria-describedby":
|
|
1512
|
+
"aria-describedby": me,
|
|
1542
1513
|
tabIndex: 0,
|
|
1543
|
-
viewBox: `0 0 ${
|
|
1544
|
-
height:
|
|
1514
|
+
viewBox: `0 0 ${re} ${z}`,
|
|
1515
|
+
height: z,
|
|
1545
1516
|
onKeyDown: $,
|
|
1546
1517
|
onFocus: (e) => {
|
|
1547
1518
|
if (e.currentTarget.matches(":focus-visible")) {
|
|
1548
1519
|
let e = I?.timestamp ?? B;
|
|
1549
|
-
|
|
1520
|
+
le(e), Q({
|
|
1550
1521
|
signature: F,
|
|
1551
1522
|
timestamp: e,
|
|
1552
1523
|
source: "keyboard"
|
|
@@ -1554,86 +1525,86 @@ function Ie({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1554
1525
|
}
|
|
1555
1526
|
},
|
|
1556
1527
|
onPointerMove: (e) => {
|
|
1557
|
-
e.pointerType === "mouse" &&
|
|
1528
|
+
e.pointerType === "mouse" && Z(e.clientX);
|
|
1558
1529
|
},
|
|
1559
|
-
onPointerDown: (e) =>
|
|
1530
|
+
onPointerDown: (e) => Z(e.clientX),
|
|
1560
1531
|
onPointerLeave: (e) => {
|
|
1561
1532
|
e.pointerType === "mouse" && I?.source === "pointer" && Q(void 0);
|
|
1562
1533
|
},
|
|
1563
1534
|
onBlur: () => Q(void 0),
|
|
1564
|
-
...
|
|
1535
|
+
...b.props(l.svg, l.inspectable, Pe),
|
|
1565
1536
|
children: [
|
|
1566
|
-
|
|
1567
|
-
x1:
|
|
1568
|
-
x2:
|
|
1569
|
-
y1:
|
|
1570
|
-
y2:
|
|
1571
|
-
...
|
|
1572
|
-
}), /* @__PURE__ */
|
|
1573
|
-
x:
|
|
1574
|
-
y:
|
|
1537
|
+
q.map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
|
|
1538
|
+
x1: J,
|
|
1539
|
+
x2: Y,
|
|
1540
|
+
y1: K(e),
|
|
1541
|
+
y2: K(e),
|
|
1542
|
+
...b.props(l.grid)
|
|
1543
|
+
}), /* @__PURE__ */ E("text", {
|
|
1544
|
+
x: J - 8,
|
|
1545
|
+
y: K(e),
|
|
1575
1546
|
textAnchor: "end",
|
|
1576
1547
|
dominantBaseline: "middle",
|
|
1577
|
-
...
|
|
1548
|
+
...b.props(l.label),
|
|
1578
1549
|
children: o(e)
|
|
1579
1550
|
})] }, e)),
|
|
1580
|
-
|
|
1551
|
+
j.map((e) => /* @__PURE__ */ D("g", { children: [m === "area" && /* @__PURE__ */ E(te, {
|
|
1581
1552
|
data: [...e.points],
|
|
1582
1553
|
defined: (e) => e.value !== null,
|
|
1583
|
-
x: (e) =>
|
|
1584
|
-
y0: (e) =>
|
|
1585
|
-
y1: (e) =>
|
|
1586
|
-
yScale:
|
|
1587
|
-
fill:
|
|
1588
|
-
fillOpacity:
|
|
1589
|
-
}), /* @__PURE__ */
|
|
1554
|
+
x: (e) => X(e.timestamp),
|
|
1555
|
+
y0: (e) => K(e.base),
|
|
1556
|
+
y1: (e) => K((e.value ?? 0) + e.base),
|
|
1557
|
+
yScale: K,
|
|
1558
|
+
fill: d[e.tone],
|
|
1559
|
+
fillOpacity: v ? .65 : .15
|
|
1560
|
+
}), /* @__PURE__ */ E(we, {
|
|
1590
1561
|
series: e,
|
|
1591
|
-
x:
|
|
1592
|
-
y:
|
|
1562
|
+
x: X,
|
|
1563
|
+
y: K,
|
|
1593
1564
|
inspectedTimestamp: I?.timestamp
|
|
1594
1565
|
})] }, e.id)),
|
|
1595
|
-
s.map((e) => /* @__PURE__ */
|
|
1596
|
-
x1:
|
|
1597
|
-
x2:
|
|
1566
|
+
s.map((e) => /* @__PURE__ */ D("g", { children: [e.kind === "time" ? /* @__PURE__ */ E("line", {
|
|
1567
|
+
x1: X(e.timestamp),
|
|
1568
|
+
x2: X(e.timestamp),
|
|
1598
1569
|
y1: 12,
|
|
1599
|
-
y2:
|
|
1570
|
+
y2: R,
|
|
1600
1571
|
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
1601
|
-
}) : /* @__PURE__ */
|
|
1602
|
-
cx:
|
|
1603
|
-
cy:
|
|
1572
|
+
}) : /* @__PURE__ */ E("circle", {
|
|
1573
|
+
cx: X(e.timestamp),
|
|
1574
|
+
cy: K(e.value + (j.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
|
|
1604
1575
|
r: 4,
|
|
1605
|
-
fill:
|
|
1606
|
-
...
|
|
1607
|
-
}), /* @__PURE__ */
|
|
1608
|
-
I !== void 0 && /* @__PURE__ */
|
|
1609
|
-
x1:
|
|
1610
|
-
x2:
|
|
1576
|
+
fill: g.surface,
|
|
1577
|
+
...b.props(l.selected)
|
|
1578
|
+
}), /* @__PURE__ */ E("title", { children: e.kind === "point" ? `${e.label}: ${a(e.value)}` : e.label })] }, e.id)),
|
|
1579
|
+
I !== void 0 && /* @__PURE__ */ E("line", {
|
|
1580
|
+
x1: X(I.timestamp),
|
|
1581
|
+
x2: X(I.timestamp),
|
|
1611
1582
|
y1: 12,
|
|
1612
|
-
y2:
|
|
1583
|
+
y2: R,
|
|
1613
1584
|
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
1614
1585
|
}),
|
|
1615
|
-
|
|
1616
|
-
x:
|
|
1586
|
+
ue !== void 0 && /* @__PURE__ */ E(ne, {
|
|
1587
|
+
x: X(ue.timestamp),
|
|
1617
1588
|
top: 12,
|
|
1618
|
-
bottom:
|
|
1619
|
-
width: Math.min(16, (
|
|
1589
|
+
bottom: R,
|
|
1590
|
+
width: Math.min(16, (Y - J) / 2)
|
|
1620
1591
|
})
|
|
1621
1592
|
]
|
|
1622
|
-
}),
|
|
1593
|
+
}), O && /* @__PURE__ */ D("div", {
|
|
1623
1594
|
"aria-hidden": !0,
|
|
1624
|
-
...
|
|
1625
|
-
children: [/* @__PURE__ */
|
|
1595
|
+
...b.props(De.timeAxis, De.timeAxisInset(J, Math.max(0, re - Y))),
|
|
1596
|
+
children: [/* @__PURE__ */ E("span", {
|
|
1626
1597
|
className: "x1cqoux5 xeuugli xj0a0fe",
|
|
1627
1598
|
children: i(B)
|
|
1628
|
-
}), V !== B && /* @__PURE__ */
|
|
1599
|
+
}), V !== B && /* @__PURE__ */ E("span", {
|
|
1629
1600
|
className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
|
|
1630
1601
|
children: i(V)
|
|
1631
1602
|
})]
|
|
1632
1603
|
})]
|
|
1633
1604
|
}),
|
|
1634
|
-
s.length > 0 && /* @__PURE__ */
|
|
1605
|
+
s.length > 0 && /* @__PURE__ */ E("ul", {
|
|
1635
1606
|
className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
|
|
1636
|
-
children: s.map((e) => /* @__PURE__ */
|
|
1607
|
+
children: s.map((e) => /* @__PURE__ */ D("li", { children: [
|
|
1637
1608
|
i(e.timestamp),
|
|
1638
1609
|
" · ",
|
|
1639
1610
|
e.label,
|
|
@@ -1641,8 +1612,8 @@ function Ie({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1641
1612
|
] }, e.id))
|
|
1642
1613
|
})
|
|
1643
1614
|
]
|
|
1644
|
-
})
|
|
1615
|
+
})]
|
|
1645
1616
|
})
|
|
1646
1617
|
});
|
|
1647
1618
|
}
|
|
1648
|
-
export {
|
|
1619
|
+
export { ke as AreaChart, he as BarChart, I as BarChartPlaceholder, V as BreakdownBar, Oe as LineChart, ge as MAX_SCATTER_POINTS, J as ScatterPlot, Me as SmallMultiples, Ne as SmallMultiplesPlaceholder, Te as Sparkline, Ae as TimeSeriesChartPlaceholder, $ as timeSeriesLimits };
|