@mechane-ai/elements 0.35.0 → 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 +617 -623
- 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,173 +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__ */
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
ref: re,
|
|
472
|
-
...b.props(l.plot, ue.plot),
|
|
473
|
-
children: r.length === 0 || o.length === 0 && v === void 0 ? /* @__PURE__ */ E("p", {
|
|
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) => ({
|
|
459
|
+
id: e.id,
|
|
460
|
+
label: e.label,
|
|
461
|
+
valueLabel: ge(ae, t, d),
|
|
462
|
+
tone: "neutral"
|
|
463
|
+
})) }),
|
|
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", {
|
|
474
468
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
475
469
|
children: "No categories"
|
|
476
|
-
}) : /* @__PURE__ */
|
|
470
|
+
}) : /* @__PURE__ */ E("svg", {
|
|
477
471
|
role: "img",
|
|
478
|
-
"aria-label": `${
|
|
479
|
-
"aria-describedby":
|
|
472
|
+
"aria-label": `${t}. Use arrow keys to inspect categories.${m === void 0 ? "" : " Press Enter to select."}`,
|
|
473
|
+
"aria-describedby": ce,
|
|
480
474
|
tabIndex: 0,
|
|
481
|
-
viewBox: `0 0 ${
|
|
482
|
-
height:
|
|
475
|
+
viewBox: `0 0 ${M} ${h}`,
|
|
476
|
+
height: h,
|
|
483
477
|
onKeyDown: Se,
|
|
484
478
|
onFocus: (e) => {
|
|
485
479
|
if (e.currentTarget.matches(":focus-visible")) {
|
|
486
|
-
let e =
|
|
487
|
-
|
|
480
|
+
let e = V ?? o[0];
|
|
481
|
+
R(e?.id), N(e === void 0 ? void 0 : {
|
|
488
482
|
id: e.id,
|
|
489
483
|
source: "keyboard"
|
|
490
484
|
});
|
|
@@ -495,85 +489,85 @@ function he({ title: e, description: t, report: n, categories: r, series: o, dom
|
|
|
495
489
|
},
|
|
496
490
|
onPointerDown: xe,
|
|
497
491
|
onPointerLeave: (e) => {
|
|
498
|
-
e.pointerType === "mouse" &&
|
|
492
|
+
e.pointerType === "mouse" && le?.source === "pointer" && N(void 0);
|
|
499
493
|
},
|
|
500
|
-
onBlur: () =>
|
|
494
|
+
onBlur: () => N(void 0),
|
|
501
495
|
onClick: () => {
|
|
502
|
-
|
|
496
|
+
B !== void 0 && m?.onSelect(B.id);
|
|
503
497
|
},
|
|
504
|
-
...
|
|
498
|
+
...x.props(s.svg, s.inspectable, he),
|
|
505
499
|
children: [
|
|
506
|
-
|
|
507
|
-
x: (
|
|
500
|
+
B !== void 0 && /* @__PURE__ */ T("rect", {
|
|
501
|
+
x: (Q(B.id) ?? X) - (Q.step() - Q.bandwidth()) / 2,
|
|
508
502
|
y: 12,
|
|
509
|
-
width:
|
|
510
|
-
height:
|
|
503
|
+
width: Q.step(),
|
|
504
|
+
height: J - 12,
|
|
511
505
|
className: "x2wnxhi"
|
|
512
506
|
}),
|
|
513
|
-
|
|
514
|
-
x1:
|
|
515
|
-
x2:
|
|
516
|
-
y1:
|
|
517
|
-
y2:
|
|
518
|
-
...
|
|
519
|
-
}), /* @__PURE__ */
|
|
520
|
-
x:
|
|
521
|
-
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),
|
|
522
516
|
textAnchor: "end",
|
|
523
517
|
dominantBaseline: "middle",
|
|
524
|
-
...
|
|
518
|
+
...x.props(s.label),
|
|
525
519
|
children: f(e)
|
|
526
520
|
})] }, e)),
|
|
527
|
-
|
|
528
|
-
x:
|
|
529
|
-
y: Math.max(12,
|
|
530
|
-
...
|
|
531
|
-
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
|
|
532
526
|
}),
|
|
533
|
-
|
|
534
|
-
let
|
|
535
|
-
return /* @__PURE__ */
|
|
536
|
-
let
|
|
537
|
-
if (
|
|
538
|
-
let
|
|
539
|
-
return /* @__PURE__ */
|
|
540
|
-
x: (
|
|
541
|
-
y: Math.min(
|
|
542
|
-
width:
|
|
543
|
-
height: Math.max(+(
|
|
544
|
-
fill:
|
|
545
|
-
...
|
|
546
|
-
},
|
|
547
|
-
}) : /* @__PURE__ */
|
|
548
|
-
bucket:
|
|
549
|
-
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,
|
|
550
544
|
focusedSeries: y,
|
|
551
|
-
index:
|
|
552
|
-
x:
|
|
553
|
-
width:
|
|
554
|
-
y:
|
|
555
|
-
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,
|
|
556
550
|
highlightedSeriesId: p
|
|
557
|
-
}),
|
|
558
|
-
x: (
|
|
559
|
-
y:
|
|
551
|
+
}), n % ye === 0 && /* @__PURE__ */ T("text", {
|
|
552
|
+
x: (Q(t.id) ?? X) + Q.bandwidth() / 2,
|
|
553
|
+
y: h - 4,
|
|
560
554
|
textAnchor: "middle",
|
|
561
|
-
...
|
|
562
|
-
children:
|
|
563
|
-
})] },
|
|
555
|
+
...x.props(s.label),
|
|
556
|
+
children: r.length > be ? `${r.slice(0, be - 1)}…` : r
|
|
557
|
+
})] }, t.id);
|
|
564
558
|
}),
|
|
565
|
-
|
|
566
|
-
x: (
|
|
559
|
+
H !== void 0 && /* @__PURE__ */ T(ie, {
|
|
560
|
+
x: (Q(H.id) ?? X) + Q.bandwidth() / 2,
|
|
567
561
|
top: 12,
|
|
568
|
-
bottom:
|
|
569
|
-
width: Math.max(8,
|
|
562
|
+
bottom: J,
|
|
563
|
+
width: Math.max(8, Q.bandwidth())
|
|
570
564
|
})
|
|
571
565
|
]
|
|
572
566
|
})
|
|
573
567
|
})
|
|
574
568
|
});
|
|
575
569
|
}
|
|
576
|
-
function
|
|
570
|
+
function ge(e, t, n) {
|
|
577
571
|
return e.map((e) => {
|
|
578
572
|
let r = e.values[t];
|
|
579
573
|
return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
|
|
@@ -595,54 +589,54 @@ var z = {
|
|
|
595
589
|
"--x-backgroundColor": t ?? void 0
|
|
596
590
|
}
|
|
597
591
|
] };
|
|
598
|
-
function V({ title:
|
|
599
|
-
let
|
|
600
|
-
return
|
|
601
|
-
title:
|
|
602
|
-
report:
|
|
603
|
-
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,
|
|
604
598
|
message: "The total must be finite and at least the sum of recorded values."
|
|
605
|
-
}) : /* @__PURE__ */
|
|
606
|
-
title:
|
|
607
|
-
report:
|
|
608
|
-
description:
|
|
609
|
-
children:
|
|
599
|
+
}) : /* @__PURE__ */ T(f, {
|
|
600
|
+
title: t,
|
|
601
|
+
report: n,
|
|
602
|
+
description: o,
|
|
603
|
+
children: s.length === 0 ? /* @__PURE__ */ T("p", {
|
|
610
604
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
611
605
|
children: "No values"
|
|
612
|
-
}) : /* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
606
|
+
}) : /* @__PURE__ */ E(w, { children: [
|
|
607
|
+
/* @__PURE__ */ T("div", {
|
|
614
608
|
"aria-hidden": !0,
|
|
615
609
|
className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
|
|
616
|
-
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))
|
|
617
611
|
}),
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
-
items:
|
|
612
|
+
/* @__PURE__ */ T(a, {
|
|
613
|
+
items: s.map((e, t) => ({
|
|
620
614
|
id: e.id,
|
|
621
615
|
label: e.label,
|
|
622
|
-
valueLabel: e.value === null ? "Unavailable" :
|
|
616
|
+
valueLabel: e.value === null ? "Unavailable" : l(e.value),
|
|
623
617
|
tone: i(e.tone, t)
|
|
624
618
|
})),
|
|
625
|
-
selection:
|
|
619
|
+
selection: u
|
|
626
620
|
}),
|
|
627
|
-
|
|
621
|
+
c - p > m && /* @__PURE__ */ E("p", {
|
|
628
622
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
629
623
|
children: [
|
|
630
624
|
"Unassigned portion: ",
|
|
631
|
-
c
|
|
625
|
+
l(c - p),
|
|
632
626
|
" of ",
|
|
633
|
-
c
|
|
627
|
+
l(c)
|
|
634
628
|
]
|
|
635
629
|
})
|
|
636
630
|
] })
|
|
637
|
-
}) : /* @__PURE__ */
|
|
638
|
-
title:
|
|
639
|
-
report:
|
|
640
|
-
description:
|
|
641
|
-
message:
|
|
631
|
+
}) : /* @__PURE__ */ T(g, {
|
|
632
|
+
title: t,
|
|
633
|
+
report: n,
|
|
634
|
+
description: o,
|
|
635
|
+
message: d
|
|
642
636
|
});
|
|
643
637
|
}
|
|
644
638
|
// packages/charts/src/cartesian/scatter-plot.tsx
|
|
645
|
-
var H = 260, U = 56, W = 20, G = 12,
|
|
639
|
+
var H = 260, U = 56, W = 20, G = 12, K = 1e3, _e = {
|
|
646
640
|
kzqmXN: "x1xc55vz",
|
|
647
641
|
kZKoxP: "xdk7pt",
|
|
648
642
|
kaIpWk: "x16rqkct",
|
|
@@ -685,7 +679,7 @@ var H = 260, U = 56, W = 20, G = 12, ge = 1e3, K = {
|
|
|
685
679
|
"--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
686
680
|
}],
|
|
687
681
|
dot: (e) => [
|
|
688
|
-
|
|
682
|
+
_e,
|
|
689
683
|
{
|
|
690
684
|
kWkggS: e == null ? e : "xl8spv7",
|
|
691
685
|
$$css: !0
|
|
@@ -700,95 +694,95 @@ var H = 260, U = 56, W = 20, G = 12, ge = 1e3, K = {
|
|
|
700
694
|
$$css: !0
|
|
701
695
|
}
|
|
702
696
|
};
|
|
703
|
-
function J(
|
|
704
|
-
let { title:
|
|
705
|
-
if (
|
|
706
|
-
title:
|
|
707
|
-
report:
|
|
708
|
-
description:
|
|
709
|
-
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
|
|
710
704
|
});
|
|
711
|
-
let
|
|
712
|
-
domain: [...a],
|
|
713
|
-
range: [U, Math.max(U, C - W)]
|
|
714
|
-
}), T = k({
|
|
705
|
+
let ne = O({
|
|
715
706
|
domain: [...o],
|
|
707
|
+
range: [U, Math.max(U, S - W)]
|
|
708
|
+
}), C = O({
|
|
709
|
+
domain: [...s],
|
|
716
710
|
range: [216, G]
|
|
717
|
-
}),
|
|
718
|
-
return /* @__PURE__ */
|
|
719
|
-
title:
|
|
720
|
-
report:
|
|
721
|
-
description:
|
|
722
|
-
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,
|
|
723
717
|
children: [
|
|
724
|
-
|
|
718
|
+
a.length === 0 ? /* @__PURE__ */ T("p", {
|
|
725
719
|
className: "x1ghz6dp x153jb6y",
|
|
726
|
-
children:
|
|
727
|
-
}) : /* @__PURE__ */
|
|
728
|
-
ref:
|
|
720
|
+
children: b
|
|
721
|
+
}) : /* @__PURE__ */ E("div", {
|
|
722
|
+
ref: ee,
|
|
729
723
|
className: "x1n2onr6 xeuugli",
|
|
730
|
-
children: [/* @__PURE__ */
|
|
731
|
-
width:
|
|
732
|
-
scaleX:
|
|
733
|
-
scaleY:
|
|
734
|
-
...
|
|
735
|
-
}, `${
|
|
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", {
|
|
736
730
|
className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
|
|
737
|
-
children:
|
|
731
|
+
children: a.map((t) => /* @__PURE__ */ T("button", {
|
|
738
732
|
type: "button",
|
|
739
|
-
title:
|
|
740
|
-
"aria-label": `${
|
|
741
|
-
"aria-pressed":
|
|
742
|
-
onClick: () =>
|
|
743
|
-
...
|
|
744
|
-
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", {
|
|
745
739
|
"aria-hidden": !0,
|
|
746
|
-
...
|
|
740
|
+
...x.props(q.dot(e[t.tone]), _.selectedId === t.id && q.selected)
|
|
747
741
|
})
|
|
748
|
-
},
|
|
742
|
+
}, t.id))
|
|
749
743
|
})]
|
|
750
744
|
}),
|
|
751
|
-
y !== void 0 && /* @__PURE__ */
|
|
752
|
-
...
|
|
745
|
+
y !== void 0 && /* @__PURE__ */ T(X, {
|
|
746
|
+
...t,
|
|
753
747
|
rangeSelection: y
|
|
754
748
|
}),
|
|
755
|
-
|
|
756
|
-
label: `${e.label}, ${
|
|
757
|
-
isSelected:
|
|
758
|
-
onSelect:
|
|
759
|
-
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", {
|
|
760
754
|
className: "xeuugli xss6m8b xj0a0fe x153jb6y",
|
|
761
755
|
children: [
|
|
762
756
|
m(e.x),
|
|
763
757
|
" · ",
|
|
764
|
-
|
|
758
|
+
h(e.y)
|
|
765
759
|
]
|
|
766
760
|
})]
|
|
767
761
|
}, e.id)) })
|
|
768
762
|
]
|
|
769
763
|
});
|
|
770
764
|
}
|
|
771
|
-
function Y({ width:
|
|
772
|
-
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 : {
|
|
773
767
|
x: [Math.min(p.start.x, p.end.x), Math.max(p.start.x, p.end.x)],
|
|
774
768
|
y: [Math.min(p.start.y, p.end.y), Math.max(p.start.y, p.end.y)]
|
|
775
769
|
};
|
|
776
|
-
function g(
|
|
777
|
-
let i =
|
|
770
|
+
function g(e) {
|
|
771
|
+
let i = e.currentTarget.getBoundingClientRect();
|
|
778
772
|
return {
|
|
779
|
-
x:
|
|
780
|
-
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)
|
|
781
775
|
};
|
|
782
776
|
}
|
|
783
|
-
function _(
|
|
784
|
-
if (
|
|
785
|
-
let n =
|
|
786
|
-
if (r < U || r >
|
|
787
|
-
let a = g(
|
|
788
|
-
|
|
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({
|
|
789
783
|
start: a,
|
|
790
784
|
end: a,
|
|
791
|
-
pointerId:
|
|
785
|
+
pointerId: e.pointerId
|
|
792
786
|
});
|
|
793
787
|
}
|
|
794
788
|
function v(e) {
|
|
@@ -803,84 +797,84 @@ function Y({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
|
|
|
803
797
|
x: [Math.min(p.start.x, t.x), Math.max(p.start.x, t.x)],
|
|
804
798
|
y: [Math.min(p.start.y, t.y), Math.max(p.start.y, t.y)]
|
|
805
799
|
};
|
|
806
|
-
m(null), e.currentTarget.releasePointerCapture(e.pointerId),
|
|
800
|
+
m(null), e.currentTarget.releasePointerCapture(e.pointerId), d?.onChange(n);
|
|
807
801
|
}
|
|
808
|
-
return /* @__PURE__ */
|
|
809
|
-
width:
|
|
802
|
+
return /* @__PURE__ */ E("svg", {
|
|
803
|
+
width: t,
|
|
810
804
|
height: H,
|
|
811
|
-
viewBox: `0 0 ${
|
|
805
|
+
viewBox: `0 0 ${t} ${H}`,
|
|
812
806
|
"aria-hidden": !0,
|
|
813
807
|
onPointerDown: _,
|
|
814
808
|
onPointerMove: v,
|
|
815
809
|
onPointerUp: y,
|
|
816
810
|
onPointerCancel: () => m(null),
|
|
817
811
|
onLostPointerCapture: () => m(null),
|
|
818
|
-
...
|
|
812
|
+
...x.props(s.svg, d !== void 0 && q.brush),
|
|
819
813
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ T("defs", { children: /* @__PURE__ */ T("clipPath", {
|
|
821
815
|
id: f,
|
|
822
|
-
children: /* @__PURE__ */
|
|
816
|
+
children: /* @__PURE__ */ T("rect", {
|
|
823
817
|
x: U,
|
|
824
818
|
y: G,
|
|
825
|
-
width: Math.max(0,
|
|
819
|
+
width: Math.max(0, t - U - W),
|
|
826
820
|
height: 204
|
|
827
821
|
})
|
|
828
822
|
}) }),
|
|
829
|
-
|
|
830
|
-
x1:
|
|
831
|
-
x2:
|
|
823
|
+
n.ticks(5).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
|
|
824
|
+
x1: n(e),
|
|
825
|
+
x2: n(e),
|
|
832
826
|
y1: G,
|
|
833
827
|
y2: 216,
|
|
834
|
-
...
|
|
835
|
-
}), /* @__PURE__ */
|
|
836
|
-
x:
|
|
828
|
+
...x.props(s.grid)
|
|
829
|
+
}), /* @__PURE__ */ T("text", {
|
|
830
|
+
x: n(e),
|
|
837
831
|
y: 234,
|
|
838
832
|
textAnchor: "middle",
|
|
839
|
-
...
|
|
840
|
-
children:
|
|
833
|
+
...x.props(s.label),
|
|
834
|
+
children: c(e)
|
|
841
835
|
})] }, e)),
|
|
842
|
-
|
|
836
|
+
r.ticks(4).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
|
|
843
837
|
x1: U,
|
|
844
|
-
x2:
|
|
845
|
-
y1:
|
|
846
|
-
y2:
|
|
847
|
-
...
|
|
848
|
-
}), /* @__PURE__ */
|
|
838
|
+
x2: t - W,
|
|
839
|
+
y1: r(e),
|
|
840
|
+
y2: r(e),
|
|
841
|
+
...x.props(s.grid)
|
|
842
|
+
}), /* @__PURE__ */ T("text", {
|
|
849
843
|
x: 48,
|
|
850
|
-
y:
|
|
844
|
+
y: r(e) + 4,
|
|
851
845
|
textAnchor: "end",
|
|
852
|
-
...
|
|
853
|
-
children:
|
|
854
|
-
})] },
|
|
855
|
-
/* @__PURE__ */
|
|
856
|
-
x: (U +
|
|
846
|
+
...x.props(s.label),
|
|
847
|
+
children: l(e)
|
|
848
|
+
})] }, e)),
|
|
849
|
+
/* @__PURE__ */ T("text", {
|
|
850
|
+
x: (U + t - W) / 2,
|
|
857
851
|
y: 256,
|
|
858
852
|
textAnchor: "middle",
|
|
859
|
-
...
|
|
860
|
-
children:
|
|
853
|
+
...x.props(s.label),
|
|
854
|
+
children: a
|
|
861
855
|
}),
|
|
862
|
-
/* @__PURE__ */
|
|
856
|
+
/* @__PURE__ */ T("text", {
|
|
863
857
|
x: 12,
|
|
864
858
|
y: 108,
|
|
865
859
|
textAnchor: "middle",
|
|
866
860
|
transform: "rotate(-90 12 108)",
|
|
867
|
-
...
|
|
868
|
-
children:
|
|
861
|
+
...x.props(s.label),
|
|
862
|
+
children: o
|
|
869
863
|
}),
|
|
870
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ E("g", {
|
|
871
865
|
clipPath: `url(#${f})`,
|
|
872
|
-
children: [h != null && /* @__PURE__ */
|
|
873
|
-
x:
|
|
874
|
-
y:
|
|
875
|
-
width:
|
|
876
|
-
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]),
|
|
877
871
|
className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
|
|
878
|
-
}),
|
|
879
|
-
cx: t
|
|
880
|
-
cy:
|
|
872
|
+
}), u === void 0 && i.map((t) => /* @__PURE__ */ T("circle", {
|
|
873
|
+
cx: n(t.x),
|
|
874
|
+
cy: r(t.y),
|
|
881
875
|
r: 4,
|
|
882
|
-
fill:
|
|
883
|
-
},
|
|
876
|
+
fill: e[t.tone]
|
|
877
|
+
}, t.id))]
|
|
884
878
|
})
|
|
885
879
|
]
|
|
886
880
|
});
|
|
@@ -890,14 +884,14 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
890
884
|
x: t,
|
|
891
885
|
y: n
|
|
892
886
|
};
|
|
893
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ E("fieldset", {
|
|
894
888
|
className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
|
|
895
889
|
children: [
|
|
896
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ T("legend", {
|
|
897
891
|
className: "x153jb6y xy8obcc x1jfksii",
|
|
898
892
|
children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
|
|
899
893
|
}),
|
|
900
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ E(b.Root, {
|
|
901
895
|
value: s.x,
|
|
902
896
|
min: t[0],
|
|
903
897
|
max: t[1],
|
|
@@ -908,28 +902,28 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
908
902
|
x: t,
|
|
909
903
|
y: s.y
|
|
910
904
|
}),
|
|
911
|
-
children: [/* @__PURE__ */
|
|
905
|
+
children: [/* @__PURE__ */ E("div", {
|
|
912
906
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
913
|
-
children: [/* @__PURE__ */
|
|
907
|
+
children: [/* @__PURE__ */ T(b.Label, { children: r }), /* @__PURE__ */ E("span", { children: [
|
|
914
908
|
a(s.x[0]),
|
|
915
909
|
" – ",
|
|
916
910
|
a(s.x[1])
|
|
917
911
|
] })]
|
|
918
|
-
}), /* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
912
|
+
}), /* @__PURE__ */ T(b.Control, { children: /* @__PURE__ */ E(b.Track, { children: [
|
|
913
|
+
/* @__PURE__ */ T(b.Indicator, {}),
|
|
914
|
+
/* @__PURE__ */ T(b.Thumb, {
|
|
921
915
|
index: 0,
|
|
922
916
|
"aria-label": `${r} minimum`,
|
|
923
917
|
getAriaValueText: (e, t) => a(t)
|
|
924
918
|
}),
|
|
925
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ T(b.Thumb, {
|
|
926
920
|
index: 1,
|
|
927
921
|
"aria-label": `${r} maximum`,
|
|
928
922
|
getAriaValueText: (e, t) => a(t)
|
|
929
923
|
})
|
|
930
924
|
] }) })]
|
|
931
925
|
}),
|
|
932
|
-
/* @__PURE__ */
|
|
926
|
+
/* @__PURE__ */ E(b.Root, {
|
|
933
927
|
value: s.y,
|
|
934
928
|
min: n[0],
|
|
935
929
|
max: n[1],
|
|
@@ -940,28 +934,28 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
940
934
|
x: s.x,
|
|
941
935
|
y: t
|
|
942
936
|
}),
|
|
943
|
-
children: [/* @__PURE__ */
|
|
937
|
+
children: [/* @__PURE__ */ E("div", {
|
|
944
938
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
945
|
-
children: [/* @__PURE__ */
|
|
939
|
+
children: [/* @__PURE__ */ T(b.Label, { children: i }), /* @__PURE__ */ E("span", { children: [
|
|
946
940
|
o(s.y[0]),
|
|
947
941
|
" – ",
|
|
948
942
|
o(s.y[1])
|
|
949
943
|
] })]
|
|
950
|
-
}), /* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
944
|
+
}), /* @__PURE__ */ T(b.Control, { children: /* @__PURE__ */ E(b.Track, { children: [
|
|
945
|
+
/* @__PURE__ */ T(b.Indicator, {}),
|
|
946
|
+
/* @__PURE__ */ T(b.Thumb, {
|
|
953
947
|
index: 0,
|
|
954
948
|
"aria-label": `${i} minimum`,
|
|
955
949
|
getAriaValueText: (e, t) => o(t)
|
|
956
950
|
}),
|
|
957
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ T(b.Thumb, {
|
|
958
952
|
index: 1,
|
|
959
953
|
"aria-label": `${i} maximum`,
|
|
960
954
|
getAriaValueText: (e, t) => o(t)
|
|
961
955
|
})
|
|
962
956
|
] }) })]
|
|
963
957
|
}),
|
|
964
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ T(y, {
|
|
965
959
|
type: "button",
|
|
966
960
|
disabled: e.value === null,
|
|
967
961
|
onClick: () => e.onChange(null),
|
|
@@ -971,9 +965,9 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
971
965
|
});
|
|
972
966
|
}
|
|
973
967
|
function Z({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
|
|
974
|
-
if (!
|
|
975
|
-
if (e.length > 1e3) return `This plot exceeds the ${
|
|
976
|
-
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.";
|
|
977
971
|
if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
|
|
978
972
|
if (e.some((e) => {
|
|
979
973
|
let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
|
|
@@ -994,7 +988,7 @@ var $ = {
|
|
|
994
988
|
pointsPerSeries: 2e3,
|
|
995
989
|
markers: 200,
|
|
996
990
|
panels: 12
|
|
997
|
-
},
|
|
991
|
+
}, ve = .01, ye = [
|
|
998
992
|
"series1",
|
|
999
993
|
"series2",
|
|
1000
994
|
"series3",
|
|
@@ -1002,13 +996,13 @@ var $ = {
|
|
|
1002
996
|
"series5",
|
|
1003
997
|
"series6"
|
|
1004
998
|
];
|
|
1005
|
-
function
|
|
999
|
+
function be({ series: e, isStacked: t, markers: n }) {
|
|
1006
1000
|
let r = e[0]?.points.map((e) => e.timestamp) ?? [];
|
|
1007
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.`;
|
|
1008
|
-
if (!
|
|
1002
|
+
if (!m(e) || !m(n)) return "Series and markers require unique identifiers.";
|
|
1009
1003
|
for (let n of e) {
|
|
1010
1004
|
if (n.points.length !== r.length) return "Every series must supply the same observation timestamps.";
|
|
1011
|
-
let e =
|
|
1005
|
+
let e = we({
|
|
1012
1006
|
points: n.points,
|
|
1013
1007
|
timestamps: r,
|
|
1014
1008
|
isStacked: t
|
|
@@ -1026,7 +1020,7 @@ function ye({ series: e, isStacked: t, markers: n }) {
|
|
|
1026
1020
|
if (!Number.isFinite(a) || !Number.isFinite(o)) return "The elapsed-time and value ranges must be finite.";
|
|
1027
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.";
|
|
1028
1022
|
}
|
|
1029
|
-
function
|
|
1023
|
+
function xe({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
1030
1024
|
return JSON.stringify([
|
|
1031
1025
|
n,
|
|
1032
1026
|
r,
|
|
@@ -1046,15 +1040,15 @@ function be({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
|
1046
1040
|
])
|
|
1047
1041
|
]);
|
|
1048
1042
|
}
|
|
1049
|
-
function
|
|
1043
|
+
function Se(e, t, n = !1) {
|
|
1050
1044
|
if (e !== t) return [e, t];
|
|
1051
|
-
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;
|
|
1052
1046
|
return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
|
|
1053
1047
|
}
|
|
1054
|
-
function
|
|
1048
|
+
function Ce(e, t) {
|
|
1055
1049
|
let n = e.filter((e) => e.tone === void 0);
|
|
1056
1050
|
return e.map((r, i) => {
|
|
1057
|
-
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) => {
|
|
1058
1052
|
let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
|
|
1059
1053
|
return {
|
|
1060
1054
|
...n,
|
|
@@ -1069,7 +1063,7 @@ function Se(e, t) {
|
|
|
1069
1063
|
};
|
|
1070
1064
|
});
|
|
1071
1065
|
}
|
|
1072
|
-
function
|
|
1066
|
+
function we({ points: e, timestamps: t, isStacked: n }) {
|
|
1073
1067
|
for (let [r, i] of e.entries()) {
|
|
1074
1068
|
let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
|
|
1075
1069
|
if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
|
|
@@ -1078,49 +1072,49 @@ function Ce({ points: e, timestamps: t, isStacked: n }) {
|
|
|
1078
1072
|
}
|
|
1079
1073
|
}
|
|
1080
1074
|
// packages/charts/src/cartesian/time-series-line.tsx
|
|
1081
|
-
function
|
|
1082
|
-
return /* @__PURE__ */
|
|
1083
|
-
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],
|
|
1084
1078
|
defined: (e) => e.value !== null,
|
|
1085
|
-
x: (e) =>
|
|
1086
|
-
y: (e) =>
|
|
1087
|
-
stroke:
|
|
1088
|
-
...
|
|
1089
|
-
}),
|
|
1090
|
-
if (
|
|
1091
|
-
let
|
|
1092
|
-
return
|
|
1093
|
-
}).map((
|
|
1094
|
-
cx:
|
|
1095
|
-
cy:
|
|
1096
|
-
r:
|
|
1097
|
-
fill:
|
|
1098
|
-
},
|
|
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))] });
|
|
1099
1093
|
}
|
|
1100
1094
|
// packages/charts/src/cartesian/sparkline.tsx
|
|
1101
|
-
function
|
|
1102
|
-
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({
|
|
1103
1097
|
title: e,
|
|
1104
1098
|
summary: t,
|
|
1105
1099
|
unit: n,
|
|
1106
1100
|
series: i,
|
|
1107
1101
|
valueDomain: a
|
|
1108
1102
|
}), l = i.points.some((e) => e.value !== null);
|
|
1109
|
-
if (c !== void 0 || !l) return /* @__PURE__ */
|
|
1103
|
+
if (c !== void 0 || !l) return /* @__PURE__ */ T("span", {
|
|
1110
1104
|
role: "img",
|
|
1111
1105
|
"aria-label": `${e}. ${t} Values in ${n}; timestamps in ${r}. ${c ?? "No recorded values. Missing observations remain unavailable."}`,
|
|
1112
1106
|
title: c ?? "No recorded values",
|
|
1113
1107
|
className: "x2pejg6 x10w6t97 x2lah0s xxymvpz x3nfvp2 x6s0dn4 xl56j7k x153jb6y x1hz01jw xy8obcc",
|
|
1114
1108
|
children: c === void 0 ? "No data" : "Invalid trend"
|
|
1115
1109
|
});
|
|
1116
|
-
let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f =
|
|
1117
|
-
domain: [...
|
|
1110
|
+
let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = O({
|
|
1111
|
+
domain: [...Se(u, d)],
|
|
1118
1112
|
range: [3, 125]
|
|
1119
|
-
}), p =
|
|
1113
|
+
}), p = O({
|
|
1120
1114
|
domain: [...a],
|
|
1121
1115
|
range: [29, 3]
|
|
1122
|
-
}), m =
|
|
1123
|
-
return /* @__PURE__ */
|
|
1116
|
+
}), m = Ce([i], !1)[0];
|
|
1117
|
+
return /* @__PURE__ */ E("svg", {
|
|
1124
1118
|
role: "img",
|
|
1125
1119
|
"aria-labelledby": o,
|
|
1126
1120
|
"aria-describedby": s,
|
|
@@ -1130,11 +1124,11 @@ function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1130
1124
|
height: 32,
|
|
1131
1125
|
className: "x1rg5ohu x2pejg6 x10w6t97 x2lah0s xxymvpz",
|
|
1132
1126
|
children: [
|
|
1133
|
-
/* @__PURE__ */
|
|
1127
|
+
/* @__PURE__ */ T("title", {
|
|
1134
1128
|
id: o,
|
|
1135
1129
|
children: e
|
|
1136
1130
|
}),
|
|
1137
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ E("desc", {
|
|
1138
1132
|
id: s,
|
|
1139
1133
|
children: [
|
|
1140
1134
|
t,
|
|
@@ -1152,7 +1146,7 @@ function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1152
1146
|
"."
|
|
1153
1147
|
]
|
|
1154
1148
|
}),
|
|
1155
|
-
m !== void 0 && /* @__PURE__ */
|
|
1149
|
+
m !== void 0 && /* @__PURE__ */ T(Te, {
|
|
1156
1150
|
series: m,
|
|
1157
1151
|
x: f,
|
|
1158
1152
|
y: p,
|
|
@@ -1161,10 +1155,10 @@ function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1161
1155
|
]
|
|
1162
1156
|
});
|
|
1163
1157
|
}
|
|
1164
|
-
function
|
|
1158
|
+
function De({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
|
|
1165
1159
|
if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
|
|
1166
|
-
if (!
|
|
1167
|
-
let a =
|
|
1160
|
+
if (!h(i)) return "The displayed value domain must have finite, increasing bounds.";
|
|
1161
|
+
let a = be({
|
|
1168
1162
|
series: [r],
|
|
1169
1163
|
isStacked: !1,
|
|
1170
1164
|
markers: []
|
|
@@ -1173,7 +1167,7 @@ function Ee({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
|
|
|
1173
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.";
|
|
1174
1168
|
}
|
|
1175
1169
|
// packages/charts/src/cartesian/time-series.tsx
|
|
1176
|
-
var
|
|
1170
|
+
var Oe = {
|
|
1177
1171
|
timeAxis: {
|
|
1178
1172
|
k1xSpc: "x78zum5",
|
|
1179
1173
|
kjj79g: "x1qughib",
|
|
@@ -1194,109 +1188,109 @@ var De = {
|
|
|
1194
1188
|
"--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
1195
1189
|
}]
|
|
1196
1190
|
};
|
|
1197
|
-
function
|
|
1198
|
-
return /* @__PURE__ */
|
|
1191
|
+
function ke(e) {
|
|
1192
|
+
return /* @__PURE__ */ T(Ie, {
|
|
1199
1193
|
...e,
|
|
1200
1194
|
kind: "line",
|
|
1201
1195
|
isStacked: !1
|
|
1202
1196
|
});
|
|
1203
1197
|
}
|
|
1204
|
-
function
|
|
1205
|
-
return /* @__PURE__ */
|
|
1198
|
+
function Ae({ isStacked: e = !1, ...t }) {
|
|
1199
|
+
return /* @__PURE__ */ T(Ie, {
|
|
1206
1200
|
...t,
|
|
1207
1201
|
kind: "area",
|
|
1208
1202
|
isStacked: e
|
|
1209
1203
|
});
|
|
1210
1204
|
}
|
|
1211
|
-
function
|
|
1212
|
-
return /* @__PURE__ */
|
|
1205
|
+
function je(e) {
|
|
1206
|
+
return /* @__PURE__ */ T(Me, { ...e });
|
|
1213
1207
|
}
|
|
1214
|
-
function
|
|
1215
|
-
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) => ({
|
|
1216
1210
|
...e,
|
|
1217
1211
|
points: []
|
|
1218
1212
|
})), !1);
|
|
1219
|
-
return !Number.isFinite(
|
|
1220
|
-
title:
|
|
1213
|
+
return !Number.isFinite(c) || c < 48 ? /* @__PURE__ */ T(g, {
|
|
1214
|
+
title: e,
|
|
1221
1215
|
description: r,
|
|
1222
1216
|
report: o,
|
|
1223
1217
|
message: "Chart height must be at least 48 pixels."
|
|
1224
|
-
}) : /* @__PURE__ */
|
|
1218
|
+
}) : /* @__PURE__ */ T("div", {
|
|
1225
1219
|
"aria-hidden": !0,
|
|
1226
1220
|
inert: !0,
|
|
1227
1221
|
className: "xeuugli",
|
|
1228
|
-
children: /* @__PURE__ */
|
|
1229
|
-
title:
|
|
1222
|
+
children: /* @__PURE__ */ T(f, {
|
|
1223
|
+
title: e,
|
|
1230
1224
|
description: r,
|
|
1231
1225
|
report: o,
|
|
1232
|
-
series:
|
|
1226
|
+
series: d,
|
|
1233
1227
|
actions: a,
|
|
1234
|
-
children: /* @__PURE__ */
|
|
1228
|
+
children: /* @__PURE__ */ E("div", {
|
|
1235
1229
|
className: "xrvj5dj x1n8ia3y",
|
|
1236
|
-
children: [/* @__PURE__ */
|
|
1237
|
-
id:
|
|
1230
|
+
children: [/* @__PURE__ */ T(le, {
|
|
1231
|
+
id: u,
|
|
1238
1232
|
label: void 0,
|
|
1239
|
-
legend:
|
|
1233
|
+
legend: d,
|
|
1240
1234
|
rows: [],
|
|
1241
1235
|
x: 0,
|
|
1242
1236
|
width: 0,
|
|
1243
1237
|
source: void 0,
|
|
1244
1238
|
hasSeriesSummary: o?.seriesValues !== void 0
|
|
1245
|
-
}), /* @__PURE__ */
|
|
1246
|
-
...
|
|
1247
|
-
children: [/* @__PURE__ */
|
|
1239
|
+
}), /* @__PURE__ */ E("div", {
|
|
1240
|
+
...x.props(s.plot),
|
|
1241
|
+
children: [/* @__PURE__ */ T(t, { height: c - 16 }), l && /* @__PURE__ */ E("div", {
|
|
1248
1242
|
className: "x78zum5 x1qughib x8zbtdt x1c87qhr xy8obcc xas2l8k x153jb6y xss6m8b",
|
|
1249
|
-
children: [/* @__PURE__ */
|
|
1243
|
+
children: [/* @__PURE__ */ T(n, { width: "8ch" }), /* @__PURE__ */ T(n, { width: "8ch" })]
|
|
1250
1244
|
})]
|
|
1251
1245
|
})]
|
|
1252
1246
|
})
|
|
1253
1247
|
})
|
|
1254
1248
|
});
|
|
1255
1249
|
}
|
|
1256
|
-
function
|
|
1257
|
-
let n =
|
|
1250
|
+
function Ne({ charts: e, ...t }) {
|
|
1251
|
+
let n = ne(null), [r, i] = C(), a = JSON.stringify(e.map((e) => [
|
|
1258
1252
|
e.id,
|
|
1259
1253
|
e.title,
|
|
1260
|
-
|
|
1254
|
+
xe({
|
|
1261
1255
|
series: e.series,
|
|
1262
1256
|
markers: e.markers ?? [],
|
|
1263
1257
|
timestampUnit: t.timestampUnit,
|
|
1264
1258
|
isStacked: !1
|
|
1265
1259
|
})
|
|
1266
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);
|
|
1267
|
-
if (r !== void 0 && r.signature !== a && i(void 0),
|
|
1261
|
+
if (r !== void 0 && r.signature !== a && i(void 0), ee(() => {
|
|
1268
1262
|
function e(e) {
|
|
1269
1263
|
e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
|
|
1270
1264
|
}
|
|
1271
1265
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1272
|
-
}, []), !s || !
|
|
1266
|
+
}, []), !s || !m(e)) return /* @__PURE__ */ T(g, {
|
|
1273
1267
|
title: "Small multiples",
|
|
1274
1268
|
message: "Charts need unique identifiers and aligned observation timestamps."
|
|
1275
1269
|
});
|
|
1276
|
-
if (e.length > $.panels) return /* @__PURE__ */
|
|
1270
|
+
if (e.length > $.panels) return /* @__PURE__ */ T(g, {
|
|
1277
1271
|
title: "Small multiples",
|
|
1278
1272
|
message: `Choose at most ${$.panels} panels.`
|
|
1279
1273
|
});
|
|
1280
|
-
if (e.length === 0) return /* @__PURE__ */
|
|
1274
|
+
if (e.length === 0) return /* @__PURE__ */ T(f, {
|
|
1281
1275
|
title: "Small multiples",
|
|
1282
|
-
children: /* @__PURE__ */
|
|
1276
|
+
children: /* @__PURE__ */ T("p", {
|
|
1283
1277
|
className: "x153jb6y",
|
|
1284
1278
|
children: "No charts"
|
|
1285
1279
|
})
|
|
1286
1280
|
});
|
|
1287
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);
|
|
1288
|
-
return /* @__PURE__ */
|
|
1282
|
+
return /* @__PURE__ */ T("div", {
|
|
1289
1283
|
ref: n,
|
|
1290
1284
|
...{
|
|
1291
1285
|
0: { className: "xrvj5dj x1j825kq" },
|
|
1292
1286
|
1: { className: "xrvj5dj xxhr3t" }
|
|
1293
1287
|
}[!!l | 0],
|
|
1294
|
-
children: e.map((n, o) => /* @__PURE__ */
|
|
1288
|
+
children: e.map((n, o) => /* @__PURE__ */ T("div", {
|
|
1295
1289
|
...{
|
|
1296
1290
|
0: {},
|
|
1297
1291
|
1: { className: "x1y332i5" }
|
|
1298
1292
|
}[!!(l && o > 0) | 0],
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1293
|
+
children: /* @__PURE__ */ T(Ie, {
|
|
1300
1294
|
...t,
|
|
1301
1295
|
title: n.title,
|
|
1302
1296
|
description: n.description,
|
|
@@ -1322,25 +1316,25 @@ function Me({ charts: e, ...t }) {
|
|
|
1322
1316
|
}, n.id))
|
|
1323
1317
|
});
|
|
1324
1318
|
}
|
|
1325
|
-
function
|
|
1326
|
-
if (!
|
|
1319
|
+
function Pe({ charts: e, height: t }) {
|
|
1320
|
+
if (!m(e) || e.length > $.panels) return /* @__PURE__ */ T(g, {
|
|
1327
1321
|
title: "Small multiples",
|
|
1328
1322
|
message: `Choose at most ${$.panels} panels with unique identifiers.`
|
|
1329
1323
|
});
|
|
1330
1324
|
let n = e.every((e) => e.report !== void 0);
|
|
1331
|
-
return /* @__PURE__ */
|
|
1325
|
+
return /* @__PURE__ */ T("div", {
|
|
1332
1326
|
"aria-hidden": !0,
|
|
1333
1327
|
inert: !0,
|
|
1334
1328
|
...{
|
|
1335
1329
|
0: { className: "xrvj5dj x1j825kq" },
|
|
1336
1330
|
1: { className: "xrvj5dj xxhr3t" }
|
|
1337
1331
|
}[!!n | 0],
|
|
1338
|
-
children: e.map((r, i) => /* @__PURE__ */
|
|
1332
|
+
children: e.map((r, i) => /* @__PURE__ */ T("div", {
|
|
1339
1333
|
...{
|
|
1340
1334
|
0: {},
|
|
1341
1335
|
1: { className: "x1y332i5" }
|
|
1342
1336
|
}[!!(n && i > 0) | 0],
|
|
1343
|
-
children: /* @__PURE__ */
|
|
1337
|
+
children: /* @__PURE__ */ T(Me, {
|
|
1344
1338
|
...r,
|
|
1345
1339
|
height: t,
|
|
1346
1340
|
showTimeAxis: i === e.length - 1
|
|
@@ -1348,92 +1342,92 @@ function Ne({ charts: e, height: t }) {
|
|
|
1348
1342
|
}, r.id))
|
|
1349
1343
|
});
|
|
1350
1344
|
}
|
|
1351
|
-
var
|
|
1345
|
+
var Fe = {
|
|
1352
1346
|
"x-default-marker": "x-default-marker",
|
|
1353
1347
|
$$css: !0
|
|
1354
1348
|
};
|
|
1355
|
-
function
|
|
1356
|
-
let
|
|
1357
|
-
series:
|
|
1358
|
-
isStacked:
|
|
1359
|
-
markers:
|
|
1360
|
-
}),
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
]),
|
|
1365
|
-
series:
|
|
1366
|
-
markers:
|
|
1367
|
-
timestampUnit:
|
|
1368
|
-
isStacked:
|
|
1369
|
-
}), I = y === void 0 ?
|
|
1370
|
-
|
|
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);
|
|
1371
1365
|
let he = y !== void 0;
|
|
1372
|
-
if (
|
|
1366
|
+
if (ee(() => {
|
|
1373
1367
|
if (he) return;
|
|
1374
1368
|
function e(e) {
|
|
1375
1369
|
e.target instanceof Node && se.current?.contains(e.target) !== !0 && fe(void 0);
|
|
1376
1370
|
}
|
|
1377
1371
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1378
|
-
}, [he]),
|
|
1379
|
-
title:
|
|
1380
|
-
description:
|
|
1372
|
+
}, [he]), D !== void 0) return /* @__PURE__ */ T(g, {
|
|
1373
|
+
title: t,
|
|
1374
|
+
description: n,
|
|
1381
1375
|
report: p,
|
|
1382
|
-
message:
|
|
1376
|
+
message: D
|
|
1383
1377
|
});
|
|
1384
|
-
if (
|
|
1385
|
-
title:
|
|
1386
|
-
description:
|
|
1387
|
-
actions:
|
|
1378
|
+
if (A.length === 0) return /* @__PURE__ */ T(f, {
|
|
1379
|
+
title: t,
|
|
1380
|
+
description: n,
|
|
1381
|
+
actions: d,
|
|
1388
1382
|
report: p,
|
|
1389
|
-
series:
|
|
1390
|
-
children: /* @__PURE__ */
|
|
1383
|
+
series: k,
|
|
1384
|
+
children: /* @__PURE__ */ T("p", {
|
|
1391
1385
|
className: "x153jb6y",
|
|
1392
1386
|
children: "No observations"
|
|
1393
1387
|
})
|
|
1394
1388
|
});
|
|
1395
|
-
let R =
|
|
1396
|
-
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")],
|
|
1397
1391
|
range: [R, 12]
|
|
1398
|
-
}),
|
|
1399
|
-
domain: [...
|
|
1400
|
-
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]
|
|
1401
1395
|
});
|
|
1402
|
-
function
|
|
1403
|
-
let t =
|
|
1396
|
+
function X(e) {
|
|
1397
|
+
let t = M?.getBoundingClientRect();
|
|
1404
1398
|
if (t === void 0) return;
|
|
1405
|
-
let n =
|
|
1406
|
-
let r =
|
|
1399
|
+
let n = Y.invert(e - t.left), r = A.find((e, t) => {
|
|
1400
|
+
let r = A[t + 1];
|
|
1407
1401
|
return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
|
|
1408
1402
|
});
|
|
1409
|
-
r !== void 0 &&
|
|
1403
|
+
r !== void 0 && Z({
|
|
1410
1404
|
signature: F,
|
|
1411
1405
|
timestamp: r.timestamp,
|
|
1412
1406
|
source: "pointer"
|
|
1413
1407
|
});
|
|
1414
1408
|
}
|
|
1415
|
-
function
|
|
1409
|
+
function Z(e) {
|
|
1416
1410
|
y === void 0 ? fe(e) : y.onChange(e);
|
|
1417
1411
|
}
|
|
1418
|
-
function
|
|
1412
|
+
function Q(e) {
|
|
1419
1413
|
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
1420
|
-
let t =
|
|
1421
|
-
ArrowRight: Math.min(
|
|
1414
|
+
let t = A.findIndex((e) => e.timestamp === de?.timestamp), n = {
|
|
1415
|
+
ArrowRight: Math.min(A.length - 1, t + 1),
|
|
1422
1416
|
ArrowLeft: Math.max(0, t - 1),
|
|
1423
1417
|
Home: 0,
|
|
1424
|
-
End:
|
|
1418
|
+
End: A.length - 1
|
|
1425
1419
|
};
|
|
1426
1420
|
switch (e.key) {
|
|
1427
1421
|
case "Escape":
|
|
1428
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1422
|
+
e.preventDefault(), e.stopPropagation(), Z(void 0);
|
|
1429
1423
|
break;
|
|
1430
1424
|
case "ArrowRight":
|
|
1431
1425
|
case "ArrowLeft":
|
|
1432
1426
|
case "Home":
|
|
1433
1427
|
case "End": {
|
|
1434
1428
|
e.preventDefault();
|
|
1435
|
-
let t =
|
|
1436
|
-
t !== void 0 && (
|
|
1429
|
+
let t = A[n[e.key]];
|
|
1430
|
+
t !== void 0 && (N(t.timestamp), Z({
|
|
1437
1431
|
signature: F,
|
|
1438
1432
|
timestamp: t.timestamp,
|
|
1439
1433
|
source: "keyboard"
|
|
@@ -1442,85 +1436,85 @@ function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1442
1436
|
}
|
|
1443
1437
|
}
|
|
1444
1438
|
}
|
|
1445
|
-
return /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ T("div", {
|
|
1446
1440
|
ref: se,
|
|
1447
1441
|
className: "xeuugli",
|
|
1448
|
-
children: /* @__PURE__ */
|
|
1449
|
-
title: pe ?
|
|
1450
|
-
title:
|
|
1451
|
-
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)
|
|
1452
1446
|
}),
|
|
1453
|
-
description:
|
|
1447
|
+
description: n,
|
|
1454
1448
|
report: p,
|
|
1455
|
-
series:
|
|
1456
|
-
actions:
|
|
1457
|
-
children: [/* @__PURE__ */
|
|
1449
|
+
series: k,
|
|
1450
|
+
actions: d,
|
|
1451
|
+
children: [/* @__PURE__ */ T(ae, { children: /* @__PURE__ */ E("table", {
|
|
1458
1452
|
className: "xh8yej3 x1mwwwfo xy8obcc x1yc453h xss6m8b",
|
|
1459
1453
|
children: [
|
|
1460
|
-
/* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */
|
|
1454
|
+
/* @__PURE__ */ E("caption", { children: [t, " observations"] }),
|
|
1455
|
+
/* @__PURE__ */ T("thead", { children: /* @__PURE__ */ E("tr", { children: [/* @__PURE__ */ E("th", {
|
|
1462
1456
|
scope: "col",
|
|
1463
1457
|
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1464
1458
|
children: [
|
|
1465
1459
|
"Time (",
|
|
1466
|
-
|
|
1460
|
+
i,
|
|
1467
1461
|
")"
|
|
1468
1462
|
]
|
|
1469
|
-
}),
|
|
1463
|
+
}), k.map((e) => /* @__PURE__ */ T("th", {
|
|
1470
1464
|
scope: "col",
|
|
1471
1465
|
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1472
1466
|
children: e.label
|
|
1473
1467
|
}, e.id))] }) }),
|
|
1474
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ T("tbody", { children: A.map((e, t) => /* @__PURE__ */ E("tr", { children: [/* @__PURE__ */ T("th", {
|
|
1475
1469
|
scope: "row",
|
|
1476
1470
|
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1477
|
-
children:
|
|
1478
|
-
}),
|
|
1471
|
+
children: a(e.timestamp)
|
|
1472
|
+
}), k.map((e) => /* @__PURE__ */ T("td", {
|
|
1479
1473
|
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1480
|
-
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)
|
|
1481
1475
|
}, e.id))] }, e.timestamp)) })
|
|
1482
1476
|
]
|
|
1483
|
-
}) }), /* @__PURE__ */
|
|
1477
|
+
}) }), /* @__PURE__ */ E("div", {
|
|
1484
1478
|
className: "xrvj5dj x1n8ia3y",
|
|
1485
1479
|
children: [
|
|
1486
|
-
/* @__PURE__ */
|
|
1480
|
+
/* @__PURE__ */ T(le, {
|
|
1487
1481
|
id: me,
|
|
1488
|
-
label: L === void 0 ? void 0 :
|
|
1489
|
-
legend:
|
|
1482
|
+
label: L === void 0 ? void 0 : a(L.timestamp),
|
|
1483
|
+
legend: k.map(({ id: e, label: t, tone: n }) => ({
|
|
1490
1484
|
id: e,
|
|
1491
1485
|
label: t,
|
|
1492
1486
|
tone: n
|
|
1493
1487
|
})),
|
|
1494
|
-
rows:
|
|
1488
|
+
rows: k.map((e) => {
|
|
1495
1489
|
let t = e.points.find((e) => e.timestamp === L?.timestamp);
|
|
1496
1490
|
return {
|
|
1497
1491
|
id: e.id,
|
|
1498
1492
|
label: e.label,
|
|
1499
1493
|
tone: e.tone,
|
|
1500
|
-
value: t?.value === null || t === void 0 ? "Unavailable" :
|
|
1494
|
+
value: t?.value === null || t === void 0 ? "Unavailable" : o(t.value)
|
|
1501
1495
|
};
|
|
1502
1496
|
}),
|
|
1503
|
-
x:
|
|
1504
|
-
width:
|
|
1497
|
+
x: Y(I?.timestamp ?? z),
|
|
1498
|
+
width: j,
|
|
1505
1499
|
source: L?.source,
|
|
1506
|
-
notes:
|
|
1500
|
+
notes: l.filter((e) => e.timestamp === L?.timestamp).map((e) => e.label),
|
|
1507
1501
|
hasSeriesSummary: pe
|
|
1508
1502
|
}),
|
|
1509
|
-
/* @__PURE__ */
|
|
1510
|
-
ref:
|
|
1511
|
-
...
|
|
1512
|
-
children: [/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ E("div", {
|
|
1504
|
+
ref: oe,
|
|
1505
|
+
...x.props(s.plot),
|
|
1506
|
+
children: [/* @__PURE__ */ E("svg", {
|
|
1513
1507
|
role: "img",
|
|
1514
|
-
"aria-label": `${
|
|
1508
|
+
"aria-label": `${t}. Use arrow keys to inspect observations.`,
|
|
1515
1509
|
"aria-describedby": me,
|
|
1516
1510
|
tabIndex: 0,
|
|
1517
|
-
viewBox: `0 0 ${
|
|
1518
|
-
height:
|
|
1519
|
-
onKeyDown:
|
|
1511
|
+
viewBox: `0 0 ${j} ${ge}`,
|
|
1512
|
+
height: ge,
|
|
1513
|
+
onKeyDown: Q,
|
|
1520
1514
|
onFocus: (e) => {
|
|
1521
1515
|
if (e.currentTarget.matches(":focus-visible")) {
|
|
1522
|
-
let e = I?.timestamp ??
|
|
1523
|
-
|
|
1516
|
+
let e = I?.timestamp ?? z;
|
|
1517
|
+
N(e), Z({
|
|
1524
1518
|
signature: F,
|
|
1525
1519
|
timestamp: e,
|
|
1526
1520
|
source: "keyboard"
|
|
@@ -1528,90 +1522,90 @@ function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1528
1522
|
}
|
|
1529
1523
|
},
|
|
1530
1524
|
onPointerMove: (e) => {
|
|
1531
|
-
e.pointerType === "mouse" &&
|
|
1525
|
+
e.pointerType === "mouse" && X(e.clientX);
|
|
1532
1526
|
},
|
|
1533
|
-
onPointerDown: (e) =>
|
|
1527
|
+
onPointerDown: (e) => X(e.clientX),
|
|
1534
1528
|
onPointerLeave: (e) => {
|
|
1535
|
-
e.pointerType === "mouse" && I?.source === "pointer" &&
|
|
1529
|
+
e.pointerType === "mouse" && I?.source === "pointer" && Z(void 0);
|
|
1536
1530
|
},
|
|
1537
|
-
onBlur: () =>
|
|
1538
|
-
...
|
|
1531
|
+
onBlur: () => Z(void 0),
|
|
1532
|
+
...x.props(s.svg, s.inspectable, Fe),
|
|
1539
1533
|
children: [
|
|
1540
|
-
|
|
1541
|
-
x1:
|
|
1542
|
-
x2:
|
|
1534
|
+
_e.map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
|
|
1535
|
+
x1: q,
|
|
1536
|
+
x2: J,
|
|
1543
1537
|
y1: K(e),
|
|
1544
1538
|
y2: K(e),
|
|
1545
|
-
...
|
|
1546
|
-
}), /* @__PURE__ */
|
|
1547
|
-
x:
|
|
1539
|
+
...x.props(s.grid)
|
|
1540
|
+
}), /* @__PURE__ */ T("text", {
|
|
1541
|
+
x: q - 8,
|
|
1548
1542
|
y: K(e),
|
|
1549
1543
|
textAnchor: "end",
|
|
1550
1544
|
dominantBaseline: "middle",
|
|
1551
|
-
...
|
|
1552
|
-
children:
|
|
1545
|
+
...x.props(s.label),
|
|
1546
|
+
children: c(e)
|
|
1553
1547
|
})] }, e)),
|
|
1554
|
-
|
|
1555
|
-
data: [...
|
|
1548
|
+
k.map((t) => /* @__PURE__ */ E("g", { children: [m === "area" && /* @__PURE__ */ T(re, {
|
|
1549
|
+
data: [...t.points],
|
|
1556
1550
|
defined: (e) => e.value !== null,
|
|
1557
|
-
x: (e) =>
|
|
1551
|
+
x: (e) => Y(e.timestamp),
|
|
1558
1552
|
y0: (e) => K(e.base),
|
|
1559
1553
|
y1: (e) => K((e.value ?? 0) + e.base),
|
|
1560
1554
|
yScale: K,
|
|
1561
|
-
fill:
|
|
1562
|
-
fillOpacity:
|
|
1563
|
-
}), /* @__PURE__ */
|
|
1564
|
-
series:
|
|
1565
|
-
x:
|
|
1555
|
+
fill: e[t.tone],
|
|
1556
|
+
fillOpacity: h ? .65 : .15
|
|
1557
|
+
}), /* @__PURE__ */ T(Te, {
|
|
1558
|
+
series: t,
|
|
1559
|
+
x: Y,
|
|
1566
1560
|
y: K,
|
|
1567
1561
|
inspectedTimestamp: I?.timestamp
|
|
1568
|
-
})] },
|
|
1569
|
-
|
|
1570
|
-
x1:
|
|
1571
|
-
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),
|
|
1572
1566
|
y1: 12,
|
|
1573
1567
|
y2: R,
|
|
1574
1568
|
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
1575
|
-
}) : /* @__PURE__ */
|
|
1576
|
-
cx:
|
|
1577
|
-
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)),
|
|
1578
1572
|
r: 4,
|
|
1579
|
-
fill:
|
|
1580
|
-
...
|
|
1581
|
-
}), /* @__PURE__ */
|
|
1582
|
-
I !== void 0 && /* @__PURE__ */
|
|
1583
|
-
x1:
|
|
1584
|
-
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),
|
|
1585
1579
|
y1: 12,
|
|
1586
1580
|
y2: R,
|
|
1587
1581
|
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
1588
1582
|
}),
|
|
1589
|
-
|
|
1590
|
-
x:
|
|
1583
|
+
de !== void 0 && /* @__PURE__ */ T(ie, {
|
|
1584
|
+
x: Y(de.timestamp),
|
|
1591
1585
|
top: 12,
|
|
1592
1586
|
bottom: R,
|
|
1593
|
-
width: Math.min(16, (
|
|
1587
|
+
width: Math.min(16, (J - q) / 2)
|
|
1594
1588
|
})
|
|
1595
1589
|
]
|
|
1596
|
-
}),
|
|
1590
|
+
}), w && /* @__PURE__ */ E("div", {
|
|
1597
1591
|
"aria-hidden": !0,
|
|
1598
|
-
...
|
|
1599
|
-
children: [/* @__PURE__ */
|
|
1592
|
+
...x.props(Oe.timeAxis, Oe.timeAxisInset(q, Math.max(0, j - J))),
|
|
1593
|
+
children: [/* @__PURE__ */ T("span", {
|
|
1600
1594
|
className: "x1cqoux5 xeuugli xj0a0fe",
|
|
1601
|
-
children:
|
|
1602
|
-
}),
|
|
1595
|
+
children: a(z)
|
|
1596
|
+
}), B !== z && /* @__PURE__ */ T("span", {
|
|
1603
1597
|
className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
|
|
1604
|
-
children:
|
|
1598
|
+
children: a(B)
|
|
1605
1599
|
})]
|
|
1606
1600
|
})]
|
|
1607
1601
|
}),
|
|
1608
|
-
|
|
1602
|
+
l.length > 0 && /* @__PURE__ */ T("ul", {
|
|
1609
1603
|
className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
|
|
1610
|
-
children:
|
|
1611
|
-
|
|
1604
|
+
children: l.map((e) => /* @__PURE__ */ E("li", { children: [
|
|
1605
|
+
a(e.timestamp),
|
|
1612
1606
|
" · ",
|
|
1613
1607
|
e.label,
|
|
1614
|
-
e.kind === "point" && ` · ${
|
|
1608
|
+
e.kind === "point" && ` · ${o(e.value)}`
|
|
1615
1609
|
] }, e.id))
|
|
1616
1610
|
})
|
|
1617
1611
|
]
|
|
@@ -1619,4 +1613,4 @@ function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1619
1613
|
})
|
|
1620
1614
|
});
|
|
1621
1615
|
}
|
|
1622
|
-
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 };
|