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