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