@mechane-ai/elements 0.24.1 → 0.25.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/charts/cartesian.js +405 -364
- package/dist/layout.js +1 -1
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/index.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/time-series.d.ts +6 -2
- package/dist/packages/charts/src/chart-frame.d.ts +1 -1
- package/dist/packages/charts/src/chart-input.d.ts +1 -1
- package/package.json +1 -1
package/dist/charts/cartesian.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import { E as
|
|
4
|
-
import { t as
|
|
5
|
-
import { s } from "../src-d7EAi61b.js";
|
|
6
|
-
import { a as
|
|
7
|
-
import { n as
|
|
8
|
-
import { t as
|
|
9
|
-
import { g as
|
|
10
|
-
import { r as
|
|
1
|
+
import { d as e, u as t } from "../src-DHYcohZP.js";
|
|
2
|
+
import { i as n, n as r, r as i, t as a } from "../categorical-values-CPRt9uzI.js";
|
|
3
|
+
import { E as o } from "../src-DLReNPV9.js";
|
|
4
|
+
import { t as s } from "../use-scroll-tab-index-Dxpdh4W7.js";
|
|
5
|
+
import { s as c } from "../src-d7EAi61b.js";
|
|
6
|
+
import { a as l, n as u, o as d, r as f, s as p, t as m } from "../chart-frame-CNr8M_b2.js";
|
|
7
|
+
import { n as h, r as g, t as _ } from "../chart-input-DDAjzy-O.js";
|
|
8
|
+
import { t as v } from "../plot-width--OgdohB5.js";
|
|
9
|
+
import { g as y } from "../src-CQOgWIzP.js";
|
|
10
|
+
import { r as ee } from "../tokens.stylex-DTHHFbyl.js";
|
|
11
11
|
import * as b from "@stylexjs/stylex";
|
|
12
|
-
import { useEffect as
|
|
12
|
+
import { useEffect as x, useId as S, useMemo as te, useRef as ne, useState as C } from "react";
|
|
13
13
|
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
14
14
|
import { scaleBand as D, scaleLinear as O } from "@visx/scale";
|
|
15
|
-
import { AreaClosed as
|
|
15
|
+
import { AreaClosed as k, Bar as A, LinePath as re } from "@visx/shape";
|
|
16
16
|
// packages/charts/src/chart-cursor.tsx
|
|
17
|
-
function
|
|
17
|
+
function ie({ x: e, top: t, bottom: n, width: r }) {
|
|
18
18
|
return /* @__PURE__ */ E("g", {
|
|
19
19
|
"aria-hidden": !0,
|
|
20
20
|
className: "xlshs6z xgs60n x17y187c xbabvq0 x47corl",
|
|
@@ -34,13 +34,13 @@ function re({ x: e, top: t, bottom: n, width: r }) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
// packages/charts/src/chart-data.tsx
|
|
37
|
-
function
|
|
38
|
-
let n =
|
|
39
|
-
return /* @__PURE__ */ E(
|
|
40
|
-
render: /* @__PURE__ */ T(
|
|
37
|
+
function ae({ title: e, children: t }) {
|
|
38
|
+
let n = s();
|
|
39
|
+
return /* @__PURE__ */ E(c.Root, { children: [/* @__PURE__ */ T(c.Trigger, {
|
|
40
|
+
render: /* @__PURE__ */ T(o, {}),
|
|
41
41
|
children: "Chart data"
|
|
42
|
-
}), /* @__PURE__ */ E(
|
|
43
|
-
/* @__PURE__ */ T(
|
|
42
|
+
}), /* @__PURE__ */ E(c.Portal, { children: [/* @__PURE__ */ T(c.Backdrop, {}), /* @__PURE__ */ E(c.Popup, { children: [
|
|
43
|
+
/* @__PURE__ */ T(c.Title, { children: e }),
|
|
44
44
|
/* @__PURE__ */ T("div", {
|
|
45
45
|
ref: n.ref,
|
|
46
46
|
role: "region",
|
|
@@ -49,21 +49,21 @@ function ie({ title: e, children: t }) {
|
|
|
49
49
|
className: "xeuugli x1phlbz0 xysyzu8 x1we84gm",
|
|
50
50
|
children: t
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */ T(
|
|
53
|
-
render: /* @__PURE__ */ T(
|
|
52
|
+
/* @__PURE__ */ T(c.Close, {
|
|
53
|
+
render: /* @__PURE__ */ T(o, {}),
|
|
54
54
|
children: "Close"
|
|
55
55
|
})
|
|
56
56
|
] })] })] });
|
|
57
57
|
}
|
|
58
58
|
// packages/charts/src/chart-inspection.tsx
|
|
59
|
-
var
|
|
59
|
+
var j = {
|
|
60
60
|
kzqmXN: "x1xc55vz",
|
|
61
61
|
kZKoxP: "xdk7pt",
|
|
62
62
|
kmuXW: "x2lah0s",
|
|
63
63
|
$$css: !0
|
|
64
|
-
},
|
|
64
|
+
}, M = {
|
|
65
65
|
swatch: (e) => [
|
|
66
|
-
|
|
66
|
+
j,
|
|
67
67
|
{
|
|
68
68
|
kWkggS: e == null ? e : "xl8spv7",
|
|
69
69
|
$$css: !0
|
|
@@ -100,7 +100,7 @@ var ae = {
|
|
|
100
100
|
"--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
101
101
|
}]
|
|
102
102
|
};
|
|
103
|
-
function
|
|
103
|
+
function oe({ title: e, detail: t }) {
|
|
104
104
|
return t === void 0 ? e : /* @__PURE__ */ E("span", {
|
|
105
105
|
"aria-label": e,
|
|
106
106
|
className: "x1lliihq xb3r6kr xlyipyv xuxw1ft",
|
|
@@ -113,8 +113,8 @@ function M({ title: e, detail: t }) {
|
|
|
113
113
|
})]
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
let d = Math.min(260, s),
|
|
116
|
+
function se({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [] }) {
|
|
117
|
+
let d = Math.min(260, s), f = o > s / 2 ? o - d - c : o + c, m = Math.max(0, Math.min(s - d, f)), h = t === void 0 ? [] : [
|
|
118
118
|
t,
|
|
119
119
|
n,
|
|
120
120
|
...a.map((e) => `${e.label}: ${e.value}`),
|
|
@@ -131,7 +131,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
|
|
|
131
131
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc xlshs6z x47corl",
|
|
132
132
|
children: i.map((e) => /* @__PURE__ */ E("li", {
|
|
133
133
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
134
|
-
children: [/* @__PURE__ */ T("span", { ...b.props(
|
|
134
|
+
children: [/* @__PURE__ */ T("span", { ...b.props(M.swatch(p[e.tone])) }), /* @__PURE__ */ E("span", {
|
|
135
135
|
className: "xeuugli",
|
|
136
136
|
children: [e.label, /* @__PURE__ */ T("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
|
|
137
137
|
})]
|
|
@@ -143,7 +143,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
|
|
|
143
143
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
144
144
|
children: [/* @__PURE__ */ T("span", {
|
|
145
145
|
"aria-hidden": !0,
|
|
146
|
-
...b.props(
|
|
146
|
+
...b.props(M.swatch(p[e.tone]))
|
|
147
147
|
}), /* @__PURE__ */ E("span", {
|
|
148
148
|
className: "xeuugli",
|
|
149
149
|
children: [e.label, /* @__PURE__ */ T("span", {
|
|
@@ -164,7 +164,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
|
|
|
164
164
|
"aria-hidden": !0,
|
|
165
165
|
className: "x1n2onr6 xqtp20y x1vjfegm",
|
|
166
166
|
children: /* @__PURE__ */ E("div", {
|
|
167
|
-
...b.props(
|
|
167
|
+
...b.props(M.inspector, M.position(m, d)),
|
|
168
168
|
children: [
|
|
169
169
|
/* @__PURE__ */ E("div", {
|
|
170
170
|
className: "x78zum5 x1qughib x1hnptsi xk4h15q",
|
|
@@ -176,7 +176,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
|
|
|
176
176
|
className: "x78zum5 x1qughib x1pha0wt x1hnptsi",
|
|
177
177
|
children: [/* @__PURE__ */ E("dt", {
|
|
178
178
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
179
|
-
children: [/* @__PURE__ */ T("span", { ...b.props(
|
|
179
|
+
children: [/* @__PURE__ */ T("span", { ...b.props(M.swatch(p[e.tone])) }), e.label]
|
|
180
180
|
}), /* @__PURE__ */ T("dd", {
|
|
181
181
|
className: "x1ghz6dp xuxw1ft",
|
|
182
182
|
children: e.value
|
|
@@ -191,7 +191,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
|
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
// packages/charts/src/cartesian/bar-data.ts
|
|
194
|
-
function
|
|
194
|
+
function ce({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
195
195
|
if (e === void 0) return;
|
|
196
196
|
if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
|
|
197
197
|
let i = e.annotation;
|
|
@@ -216,8 +216,8 @@ var N = { mark: {
|
|
|
216
216
|
kAMwcw: "x1faw7qm",
|
|
217
217
|
$$css: !0
|
|
218
218
|
} };
|
|
219
|
-
function
|
|
220
|
-
let
|
|
219
|
+
function le({ bucket: e, series: t, focusedSeries: n, index: r, x: a, width: o, y: s, isHighlighted: c, highlightedSeriesId: l }) {
|
|
220
|
+
let u = n !== void 0, f = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
|
|
221
221
|
function m(e, t) {
|
|
222
222
|
let n = s(t), r = s(t + e);
|
|
223
223
|
return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
|
|
@@ -228,24 +228,24 @@ function ce({ bucket: e, series: t, focusedSeries: n, index: i, x: a, width: o,
|
|
|
228
228
|
width: o,
|
|
229
229
|
height: 1,
|
|
230
230
|
vectorEffect: "non-scaling-stroke",
|
|
231
|
-
fill:
|
|
232
|
-
...b.props(N.mark, c &&
|
|
231
|
+
fill: p.neutral,
|
|
232
|
+
...b.props(N.mark, c && d.selected),
|
|
233
233
|
style: {
|
|
234
234
|
transform: m(e.total, 0),
|
|
235
|
-
opacity:
|
|
235
|
+
opacity: u ? .18 : +(e.kind === "total")
|
|
236
236
|
}
|
|
237
|
-
}),
|
|
238
|
-
let h = s.values[
|
|
237
|
+
}), f.map((s, f) => {
|
|
238
|
+
let h = s.values[r];
|
|
239
239
|
if (h == null) return null;
|
|
240
|
-
let g = n?.id === s.id, _ =
|
|
240
|
+
let g = n?.id === s.id, _ = u ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), v = u ? g : e.kind === "parts", y = !u && l !== void 0 && l !== s.id;
|
|
241
241
|
return /* @__PURE__ */ T("rect", {
|
|
242
242
|
x: a,
|
|
243
243
|
y: 0,
|
|
244
244
|
width: o,
|
|
245
245
|
height: 1,
|
|
246
246
|
vectorEffect: "non-scaling-stroke",
|
|
247
|
-
fill:
|
|
248
|
-
...b.props(N.mark, c &&
|
|
247
|
+
fill: p[i(s.tone, f)],
|
|
248
|
+
...b.props(N.mark, c && d.selected),
|
|
249
249
|
style: {
|
|
250
250
|
transform: m(h, _),
|
|
251
251
|
opacity: v ? y ? .3 : 1 : 0
|
|
@@ -254,7 +254,7 @@ function ce({ bucket: e, series: t, focusedSeries: n, index: i, x: a, width: o,
|
|
|
254
254
|
})] });
|
|
255
255
|
}
|
|
256
256
|
// packages/charts/src/cartesian/bar-chart.tsx
|
|
257
|
-
var
|
|
257
|
+
var P = {
|
|
258
258
|
plot: {
|
|
259
259
|
kqGvvJ: "x1we84gm",
|
|
260
260
|
$$css: !0
|
|
@@ -263,38 +263,38 @@ var le = {
|
|
|
263
263
|
kSiTet: "xuzhngd",
|
|
264
264
|
$$css: !0
|
|
265
265
|
}
|
|
266
|
-
}, ue = /* @__PURE__ */ new Set(["Enter", " "]),
|
|
267
|
-
function
|
|
266
|
+
}, ue = /* @__PURE__ */ new Set(["Enter", " "]), de = 200;
|
|
267
|
+
function F({ title: e, description: t, series: n, layoutSeries: r, children: a, inspectionId: o, label: s, detail: c, summary: l, rows: u = [], index: d = -1, formatValue: p = String, x: m = 0, width: h = 0, offset: g, source: _, data: v }) {
|
|
268
268
|
let y = n.map((e, t) => ({
|
|
269
269
|
id: e.id,
|
|
270
270
|
label: e.label,
|
|
271
|
-
tone:
|
|
272
|
-
})),
|
|
271
|
+
tone: i(e.tone, t)
|
|
272
|
+
})), ee = r?.map((e, t) => ({
|
|
273
273
|
id: e.id,
|
|
274
274
|
label: e.label,
|
|
275
|
-
tone:
|
|
275
|
+
tone: i(e.tone, t)
|
|
276
276
|
}));
|
|
277
|
-
return /* @__PURE__ */ E(
|
|
278
|
-
title: /* @__PURE__ */ T(
|
|
277
|
+
return /* @__PURE__ */ E(f, {
|
|
278
|
+
title: /* @__PURE__ */ T(oe, {
|
|
279
279
|
title: e,
|
|
280
280
|
detail: c
|
|
281
281
|
}),
|
|
282
282
|
description: t,
|
|
283
|
-
actions: /* @__PURE__ */ T(
|
|
283
|
+
actions: /* @__PURE__ */ T(ae, {
|
|
284
284
|
title: e,
|
|
285
285
|
children: v
|
|
286
286
|
}),
|
|
287
|
-
children: [/* @__PURE__ */ T(
|
|
287
|
+
children: [/* @__PURE__ */ T(se, {
|
|
288
288
|
id: o,
|
|
289
289
|
label: s,
|
|
290
290
|
summary: l,
|
|
291
291
|
legend: y,
|
|
292
|
-
layoutLegend:
|
|
292
|
+
layoutLegend: ee,
|
|
293
293
|
rows: u.map((e, t) => ({
|
|
294
294
|
id: e.id,
|
|
295
295
|
label: e.label,
|
|
296
|
-
tone:
|
|
297
|
-
value: e.values[
|
|
296
|
+
tone: i(e.tone, t),
|
|
297
|
+
value: e.values[d] === null || e.values[d] === void 0 ? "Unavailable" : p(e.values[d])
|
|
298
298
|
})),
|
|
299
299
|
x: m,
|
|
300
300
|
width: h,
|
|
@@ -303,100 +303,100 @@ function de({ title: e, description: t, series: n, layoutSeries: i, children: a,
|
|
|
303
303
|
}), a]
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
let a =
|
|
306
|
+
function I({ title: e = "Loading chart", description: n, series: r = [], height: i = de }) {
|
|
307
|
+
let a = fe(i), o = S();
|
|
308
308
|
return a === void 0 ? /* @__PURE__ */ T("div", {
|
|
309
309
|
"aria-hidden": !0,
|
|
310
310
|
inert: !0,
|
|
311
|
-
children: /* @__PURE__ */ T(
|
|
312
|
-
title:
|
|
311
|
+
children: /* @__PURE__ */ T(F, {
|
|
312
|
+
title: e,
|
|
313
313
|
description: n,
|
|
314
314
|
series: r,
|
|
315
315
|
inspectionId: o,
|
|
316
316
|
children: /* @__PURE__ */ T("div", {
|
|
317
|
-
...b.props(
|
|
318
|
-
children: /* @__PURE__ */ T(
|
|
317
|
+
...b.props(d.plot, P.plot),
|
|
318
|
+
children: /* @__PURE__ */ T(t, { height: i })
|
|
319
319
|
})
|
|
320
320
|
})
|
|
321
|
-
}) : /* @__PURE__ */ T(
|
|
322
|
-
title:
|
|
321
|
+
}) : /* @__PURE__ */ T(_, {
|
|
322
|
+
title: e,
|
|
323
323
|
description: n,
|
|
324
324
|
message: a
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function fe(e) {
|
|
328
328
|
if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
if (e.length >
|
|
332
|
-
if (!
|
|
333
|
-
if (!
|
|
334
|
-
for (let
|
|
335
|
-
if (
|
|
336
|
-
for (let e of
|
|
337
|
-
if (e !== null && (!Number.isFinite(e) || e <
|
|
330
|
+
function pe({ categories: e, series: t, domain: n, mode: i }) {
|
|
331
|
+
if (e.length > r.items || t.length > r.series) return `Choose a window with at most ${r.items} categories and ${r.series} series.`;
|
|
332
|
+
if (!g(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
|
|
333
|
+
if (!h(e) || !h(t)) return "Bar categories and series require unique identifiers.";
|
|
334
|
+
for (let r of t) {
|
|
335
|
+
if (r.values.length !== e.length) return "Every series requires one explicit value per category.";
|
|
336
|
+
for (let e of r.values) {
|
|
337
|
+
if (e !== null && (!Number.isFinite(e) || e < n[0] || e > n[1])) return "Bar values must be finite and within the supplied domain.";
|
|
338
338
|
if (i === "stacked" && (e === null || e < 0)) return "Stacked bars require present nonnegative values.";
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
if (i === "stacked" && e.some((e,
|
|
341
|
+
if (i === "stacked" && e.some((e, r) => t.reduce((e, t) => e + (t.values[r] ?? 0), 0) > n[1])) return "Stacked bar totals must fit the supplied domain.";
|
|
342
342
|
}
|
|
343
|
-
var
|
|
343
|
+
var L = {
|
|
344
344
|
"x-default-marker": "x-default-marker",
|
|
345
345
|
$$css: !0
|
|
346
346
|
};
|
|
347
|
-
function
|
|
348
|
-
let
|
|
347
|
+
function me({ title: e, description: t, categories: n, series: r, domain: o, mode: s = "grouped", formatValue: c, formatTick: l = c, highlightedSeriesId: u, selection: f, height: m = de, composition: h }) {
|
|
348
|
+
let g = h?.focusedSeries, y = S(), ee = g === void 0 ? void 0 : pe({
|
|
349
349
|
categories: n,
|
|
350
|
-
series: [
|
|
350
|
+
series: [g],
|
|
351
351
|
domain: o,
|
|
352
352
|
mode: "grouped"
|
|
353
|
-
}),
|
|
353
|
+
}), te = pe({
|
|
354
354
|
categories: n,
|
|
355
|
-
series:
|
|
355
|
+
series: r,
|
|
356
356
|
domain: o,
|
|
357
357
|
mode: s
|
|
358
|
-
}) ??
|
|
358
|
+
}) ?? ee, ne = ce({
|
|
359
359
|
composition: h,
|
|
360
|
-
series:
|
|
360
|
+
series: r,
|
|
361
361
|
categoryIds: n.map((e) => e.id),
|
|
362
362
|
domain: o
|
|
363
|
-
}) ??
|
|
363
|
+
}) ?? fe(m), w = te ?? ne, k = h === void 0 ? void 0 : {
|
|
364
364
|
id: y,
|
|
365
365
|
label: h.contextLabel,
|
|
366
366
|
tone: "neutral",
|
|
367
367
|
values: h.buckets.map((e) => e.kind === "gap" ? null : e.total)
|
|
368
|
-
},
|
|
369
|
-
|
|
370
|
-
...
|
|
371
|
-
...
|
|
372
|
-
], ae =
|
|
373
|
-
|
|
368
|
+
}, re = k === void 0 ? r : [
|
|
369
|
+
k,
|
|
370
|
+
...r,
|
|
371
|
+
...g === void 0 || r.some((e) => e.id === g.id) ? [] : [g]
|
|
372
|
+
], ae = g !== void 0 && k !== void 0 ? [g, k] : r, { ref: j, width: M, element: oe } = v(), se = S(), [N, I] = C(), [me, z] = C();
|
|
373
|
+
x(() => {
|
|
374
374
|
function e(e) {
|
|
375
|
-
e.target instanceof Node && oe?.contains(e.target) !== !0 &&
|
|
375
|
+
e.target instanceof Node && oe?.contains(e.target) !== !0 && I(void 0);
|
|
376
376
|
}
|
|
377
377
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
378
378
|
}, [oe]);
|
|
379
|
-
let B = n.findIndex((e) => e.id ===
|
|
380
|
-
if (
|
|
379
|
+
let B = n.findIndex((e) => e.id === N?.id), V = n[B], H = n[n.findIndex((e) => e.id === f?.selectedId)], U = n.find((e) => e.id === me) ?? H ?? n[0], W = n.findIndex((e) => e.id === U?.id), G = V, K = B, q = h?.buckets[K], J = g !== void 0 && k !== void 0 ? [g, k] : k === void 0 || q?.kind === "parts" ? r : [], Y = q === void 0 ? void 0 : q.kind === "gap" ? "No reported value" : c(q.total);
|
|
380
|
+
if (w !== void 0) return /* @__PURE__ */ T(_, {
|
|
381
381
|
title: e,
|
|
382
382
|
description: t,
|
|
383
|
-
message:
|
|
383
|
+
message: w
|
|
384
384
|
});
|
|
385
|
-
let
|
|
385
|
+
let X = m - 28, Z = O({
|
|
386
386
|
domain: [...o],
|
|
387
|
-
range: [
|
|
388
|
-
}),
|
|
387
|
+
range: [X, 12]
|
|
388
|
+
}), Q = Math.max(44, ...Z.ticks(3).map((e) => l(e).length * 7 + 12)), he = Math.max(Q + 1, M - 16), $ = D({
|
|
389
389
|
domain: n.map((e) => e.id),
|
|
390
|
-
range: [
|
|
390
|
+
range: [Q, he],
|
|
391
391
|
padding: .3
|
|
392
392
|
}), ge = D({
|
|
393
|
-
domain:
|
|
393
|
+
domain: r.map((e) => e.id),
|
|
394
394
|
range: [0, $.bandwidth()],
|
|
395
395
|
padding: .08
|
|
396
396
|
}), _e = Math.min(120, Math.max(40, ...n.map((e) => (e.axisLabel ?? e.label).length * 7))), ve = Math.max(1, Math.ceil((_e + 16) / $.step())), ye = Math.max(1, Math.floor(($.step() * ve - 16) / 7));
|
|
397
397
|
function be(e) {
|
|
398
|
-
let t = e.currentTarget.getBoundingClientRect(), r = (e.clientX - t.left) / t.width * M, i = Math.floor((r -
|
|
399
|
-
a !== void 0 && (e.type === "pointerdown" && z(a.id),
|
|
398
|
+
let t = e.currentTarget.getBoundingClientRect(), r = (e.clientX - t.left) / t.width * M, i = Math.floor((r - Q) / $.step()), a = n[Math.max(0, Math.min(n.length - 1, i))];
|
|
399
|
+
a !== void 0 && (e.type === "pointerdown" && z(a.id), I({
|
|
400
400
|
id: a.id,
|
|
401
401
|
source: "pointer"
|
|
402
402
|
}));
|
|
@@ -404,11 +404,11 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
|
|
|
404
404
|
function xe(e) {
|
|
405
405
|
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
406
406
|
if (e.key === "Escape") {
|
|
407
|
-
e.preventDefault(), e.stopPropagation(),
|
|
407
|
+
e.preventDefault(), e.stopPropagation(), I(void 0);
|
|
408
408
|
return;
|
|
409
409
|
}
|
|
410
410
|
if (ue.has(e.key)) {
|
|
411
|
-
U !== void 0 &&
|
|
411
|
+
U !== void 0 && f !== void 0 && (e.preventDefault(), f.onSelect(U.id));
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
414
414
|
let t = {
|
|
@@ -417,46 +417,46 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
|
|
|
417
417
|
Home: 0,
|
|
418
418
|
End: n.length - 1
|
|
419
419
|
}[e.key], r = t === void 0 ? void 0 : n[t];
|
|
420
|
-
r !== void 0 && (e.preventDefault(), z(r.id),
|
|
420
|
+
r !== void 0 && (e.preventDefault(), z(r.id), I({
|
|
421
421
|
id: r.id,
|
|
422
422
|
source: "keyboard"
|
|
423
423
|
}));
|
|
424
424
|
}
|
|
425
|
-
return /* @__PURE__ */ T(
|
|
425
|
+
return /* @__PURE__ */ T(F, {
|
|
426
426
|
title: e,
|
|
427
427
|
description: t,
|
|
428
428
|
series: ae,
|
|
429
|
-
layoutSeries:
|
|
430
|
-
inspectionId:
|
|
429
|
+
layoutSeries: r,
|
|
430
|
+
inspectionId: se,
|
|
431
431
|
label: G?.label,
|
|
432
|
-
detail: G === void 0 ? void 0 : [G.axisLabel ?? G.label,
|
|
433
|
-
summary:
|
|
434
|
-
rows:
|
|
435
|
-
index:
|
|
432
|
+
detail: G === void 0 ? void 0 : [G.axisLabel ?? G.label, Y].filter(Boolean).join(" · "),
|
|
433
|
+
summary: Y,
|
|
434
|
+
rows: J,
|
|
435
|
+
index: K,
|
|
436
436
|
formatValue: c,
|
|
437
|
-
x: ($(G?.id ?? "") ??
|
|
437
|
+
x: ($(G?.id ?? "") ?? Q) + $.bandwidth() / 2,
|
|
438
438
|
width: M,
|
|
439
439
|
offset: $.bandwidth() / 2 + 8,
|
|
440
|
-
source:
|
|
441
|
-
data: /* @__PURE__ */ T(
|
|
440
|
+
source: N?.source,
|
|
441
|
+
data: /* @__PURE__ */ T(a, {
|
|
442
442
|
items: n.map((e, t) => ({
|
|
443
443
|
id: e.id,
|
|
444
444
|
label: e.label,
|
|
445
|
-
valueLabel:
|
|
445
|
+
valueLabel: R(re, t, c),
|
|
446
446
|
tone: "neutral"
|
|
447
447
|
})),
|
|
448
|
-
selection:
|
|
448
|
+
selection: f
|
|
449
449
|
}),
|
|
450
450
|
children: /* @__PURE__ */ T("div", {
|
|
451
451
|
ref: j,
|
|
452
|
-
...b.props(
|
|
453
|
-
children: n.length === 0 ||
|
|
452
|
+
...b.props(d.plot, P.plot),
|
|
453
|
+
children: n.length === 0 || r.length === 0 && h === void 0 ? /* @__PURE__ */ T("p", {
|
|
454
454
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
455
455
|
children: "No categories"
|
|
456
456
|
}) : /* @__PURE__ */ E("svg", {
|
|
457
457
|
role: "img",
|
|
458
|
-
"aria-label": `${e}. Use arrow keys to inspect categories.${
|
|
459
|
-
"aria-describedby":
|
|
458
|
+
"aria-label": `${e}. Use arrow keys to inspect categories.${f === void 0 ? "" : " Press Enter to select."}`,
|
|
459
|
+
"aria-describedby": se,
|
|
460
460
|
tabIndex: 0,
|
|
461
461
|
viewBox: `0 0 ${M} ${m}`,
|
|
462
462
|
height: m,
|
|
@@ -464,7 +464,7 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
|
|
|
464
464
|
onFocus: (e) => {
|
|
465
465
|
if (e.currentTarget.matches(":focus-visible")) {
|
|
466
466
|
let e = H ?? n[0];
|
|
467
|
-
z(e?.id),
|
|
467
|
+
z(e?.id), I(e === void 0 ? void 0 : {
|
|
468
468
|
id: e.id,
|
|
469
469
|
source: "keyboard"
|
|
470
470
|
});
|
|
@@ -475,77 +475,77 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
|
|
|
475
475
|
},
|
|
476
476
|
onPointerDown: be,
|
|
477
477
|
onPointerLeave: (e) => {
|
|
478
|
-
e.pointerType === "mouse" &&
|
|
478
|
+
e.pointerType === "mouse" && N?.source === "pointer" && I(void 0);
|
|
479
479
|
},
|
|
480
|
-
onBlur: () =>
|
|
480
|
+
onBlur: () => I(void 0),
|
|
481
481
|
onClick: () => {
|
|
482
|
-
V !== void 0 &&
|
|
482
|
+
V !== void 0 && f?.onSelect(V.id);
|
|
483
483
|
},
|
|
484
|
-
...b.props(
|
|
484
|
+
...b.props(d.svg, d.inspectable, L),
|
|
485
485
|
children: [
|
|
486
486
|
V !== void 0 && /* @__PURE__ */ T("rect", {
|
|
487
|
-
x: ($(V.id) ??
|
|
487
|
+
x: ($(V.id) ?? Q) - ($.step() - $.bandwidth()) / 2,
|
|
488
488
|
y: 12,
|
|
489
489
|
width: $.step(),
|
|
490
|
-
height:
|
|
490
|
+
height: X - 12,
|
|
491
491
|
className: "x2wnxhi"
|
|
492
492
|
}),
|
|
493
|
-
|
|
494
|
-
x1:
|
|
495
|
-
x2:
|
|
496
|
-
y1:
|
|
497
|
-
y2:
|
|
498
|
-
...b.props(
|
|
493
|
+
Z.ticks(3).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
|
|
494
|
+
x1: Q,
|
|
495
|
+
x2: he,
|
|
496
|
+
y1: Z(e),
|
|
497
|
+
y2: Z(e),
|
|
498
|
+
...b.props(d.grid)
|
|
499
499
|
}), /* @__PURE__ */ T("text", {
|
|
500
|
-
x:
|
|
501
|
-
y:
|
|
500
|
+
x: Q - 8,
|
|
501
|
+
y: Z(e),
|
|
502
502
|
textAnchor: "end",
|
|
503
503
|
dominantBaseline: "middle",
|
|
504
|
-
...b.props(
|
|
504
|
+
...b.props(d.label),
|
|
505
505
|
children: l(e)
|
|
506
506
|
})] }, e)),
|
|
507
507
|
h?.annotation !== void 0 && n.some((e) => e.id === h.annotation?.categoryId) && /* @__PURE__ */ T("text", {
|
|
508
508
|
x: $(h.annotation.categoryId),
|
|
509
|
-
y: Math.max(12,
|
|
510
|
-
...b.props(
|
|
509
|
+
y: Math.max(12, Z(h.annotation.value) - 8),
|
|
510
|
+
...b.props(d.label),
|
|
511
511
|
children: h.annotation.label
|
|
512
512
|
}),
|
|
513
513
|
n.map((e, t) => {
|
|
514
|
-
let n = e.axisLabel ?? e.label,
|
|
515
|
-
return /* @__PURE__ */ E("g", { children: [
|
|
514
|
+
let n = e.axisLabel ?? e.label, a = h?.buckets[t];
|
|
515
|
+
return /* @__PURE__ */ E("g", { children: [a === void 0 ? r.map((n, a) => {
|
|
516
516
|
let o = n.values[t];
|
|
517
517
|
if (o == null) return null;
|
|
518
|
-
let c = s === "stacked" ?
|
|
519
|
-
return /* @__PURE__ */ T(
|
|
520
|
-
x: ($(e.id) ??
|
|
518
|
+
let c = s === "stacked" ? r.slice(0, a).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, l = Z(c), m = Z(c + o), h = f?.selectedId === e.id || V?.id === e.id;
|
|
519
|
+
return /* @__PURE__ */ T(A, {
|
|
520
|
+
x: ($(e.id) ?? Q) + (s === "stacked" ? 0 : ge(n.id) ?? 0),
|
|
521
521
|
y: Math.min(l, m),
|
|
522
522
|
width: s === "stacked" ? $.bandwidth() : ge.bandwidth(),
|
|
523
523
|
height: Math.max(+(o === 0), Math.abs(m - l)),
|
|
524
|
-
fill:
|
|
525
|
-
...b.props(h &&
|
|
524
|
+
fill: p[i(n.tone, a)],
|
|
525
|
+
...b.props(h && d.selected, u !== void 0 && u !== n.id && P.mutedMark)
|
|
526
526
|
}, n.id);
|
|
527
|
-
}) : /* @__PURE__ */ T(
|
|
528
|
-
bucket:
|
|
529
|
-
series:
|
|
530
|
-
focusedSeries:
|
|
527
|
+
}) : /* @__PURE__ */ T(le, {
|
|
528
|
+
bucket: a,
|
|
529
|
+
series: r,
|
|
530
|
+
focusedSeries: g,
|
|
531
531
|
index: t,
|
|
532
|
-
x: $(e.id) ??
|
|
532
|
+
x: $(e.id) ?? Q,
|
|
533
533
|
width: $.bandwidth(),
|
|
534
|
-
y:
|
|
535
|
-
isHighlighted:
|
|
536
|
-
highlightedSeriesId:
|
|
534
|
+
y: Z,
|
|
535
|
+
isHighlighted: f?.selectedId === e.id || V?.id === e.id,
|
|
536
|
+
highlightedSeriesId: u
|
|
537
537
|
}), t % ve === 0 && /* @__PURE__ */ T("text", {
|
|
538
|
-
x: ($(e.id) ??
|
|
538
|
+
x: ($(e.id) ?? Q) + $.bandwidth() / 2,
|
|
539
539
|
y: m - 4,
|
|
540
540
|
textAnchor: "middle",
|
|
541
|
-
...b.props(
|
|
541
|
+
...b.props(d.label),
|
|
542
542
|
children: n.length > ye ? `${n.slice(0, ye - 1)}…` : n
|
|
543
543
|
})] }, e.id);
|
|
544
544
|
}),
|
|
545
|
-
U !== void 0 && /* @__PURE__ */ T(
|
|
546
|
-
x: ($(U.id) ??
|
|
545
|
+
U !== void 0 && /* @__PURE__ */ T(ie, {
|
|
546
|
+
x: ($(U.id) ?? Q) + $.bandwidth() / 2,
|
|
547
547
|
top: 12,
|
|
548
|
-
bottom:
|
|
548
|
+
bottom: X,
|
|
549
549
|
width: Math.max(8, $.bandwidth())
|
|
550
550
|
})
|
|
551
551
|
]
|
|
@@ -553,19 +553,19 @@ function L({ title: e, description: t, categories: n, series: a, domain: o, mode
|
|
|
553
553
|
})
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function R(e, t, n) {
|
|
557
557
|
return e.map((e) => {
|
|
558
558
|
let r = e.values[t];
|
|
559
559
|
return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
|
|
560
560
|
}).join(" · ");
|
|
561
561
|
}
|
|
562
562
|
// packages/charts/src/cartesian/breakdown-bar.tsx
|
|
563
|
-
var
|
|
563
|
+
var z = {
|
|
564
564
|
kzqmXN: "x5lhr3w",
|
|
565
565
|
kZKoxP: "x5yr21d",
|
|
566
566
|
$$css: !0
|
|
567
|
-
},
|
|
568
|
-
|
|
567
|
+
}, B = { segment: (e, t) => [
|
|
568
|
+
z,
|
|
569
569
|
{
|
|
570
570
|
kWkggS: t == null ? t : "xl8spv7",
|
|
571
571
|
$$css: !0
|
|
@@ -575,34 +575,34 @@ var R = {
|
|
|
575
575
|
"--x-backgroundColor": t ?? void 0
|
|
576
576
|
}
|
|
577
577
|
] };
|
|
578
|
-
function
|
|
579
|
-
let l =
|
|
580
|
-
return l === void 0 ? !Number.isFinite(o) || o < 0 || u - o >
|
|
578
|
+
function V({ title: e, description: t, items: r, total: o, formatValue: s, selection: c }) {
|
|
579
|
+
let l = n(r), u = r.reduce((e, t) => e + (t.value ?? 0), 0), d = 2 ** -52 * Math.max(u, o, 1) * r.length;
|
|
580
|
+
return l === void 0 ? !Number.isFinite(o) || o < 0 || u - o > d ? /* @__PURE__ */ T(_, {
|
|
581
581
|
title: e,
|
|
582
|
-
description:
|
|
582
|
+
description: t,
|
|
583
583
|
message: "The total must be finite and at least the sum of recorded values."
|
|
584
|
-
}) : /* @__PURE__ */ T(
|
|
584
|
+
}) : /* @__PURE__ */ T(f, {
|
|
585
585
|
title: e,
|
|
586
|
-
description:
|
|
587
|
-
children:
|
|
586
|
+
description: t,
|
|
587
|
+
children: r.length === 0 ? /* @__PURE__ */ T("p", {
|
|
588
588
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
589
589
|
children: "No values"
|
|
590
590
|
}) : /* @__PURE__ */ E(w, { children: [
|
|
591
591
|
/* @__PURE__ */ T("div", {
|
|
592
592
|
"aria-hidden": !0,
|
|
593
593
|
className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
|
|
594
|
-
children:
|
|
594
|
+
children: r.map((e, t) => e.value === null ? null : /* @__PURE__ */ T("span", { ...b.props(B.segment(o === 0 ? 0 : e.value / o * 100, p[i(e.tone, t)])) }, e.id))
|
|
595
595
|
}),
|
|
596
|
-
/* @__PURE__ */ T(
|
|
597
|
-
items:
|
|
596
|
+
/* @__PURE__ */ T(a, {
|
|
597
|
+
items: r.map((e, t) => ({
|
|
598
598
|
id: e.id,
|
|
599
599
|
label: e.label,
|
|
600
600
|
valueLabel: e.value === null ? "Unavailable" : s(e.value),
|
|
601
|
-
tone:
|
|
601
|
+
tone: i(e.tone, t)
|
|
602
602
|
})),
|
|
603
603
|
selection: c
|
|
604
604
|
}),
|
|
605
|
-
o - u >
|
|
605
|
+
o - u > d && /* @__PURE__ */ E("p", {
|
|
606
606
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
607
607
|
children: [
|
|
608
608
|
"Unassigned portion: ",
|
|
@@ -612,19 +612,19 @@ function B({ title: e, description: n, items: a, total: o, formatValue: s, selec
|
|
|
612
612
|
]
|
|
613
613
|
})
|
|
614
614
|
] })
|
|
615
|
-
}) : /* @__PURE__ */ T(
|
|
615
|
+
}) : /* @__PURE__ */ T(_, {
|
|
616
616
|
title: e,
|
|
617
|
-
description:
|
|
617
|
+
description: t,
|
|
618
618
|
message: l
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
621
|
// packages/charts/src/cartesian/scatter-plot.tsx
|
|
622
|
-
var
|
|
622
|
+
var H = 260, U = 56, W = 20, G = 12, K = 1e3, q = {
|
|
623
623
|
kzqmXN: "x1xc55vz",
|
|
624
624
|
kZKoxP: "xdk7pt",
|
|
625
625
|
kaIpWk: "x16rqkct",
|
|
626
626
|
$$css: !0
|
|
627
|
-
},
|
|
627
|
+
}, J = {
|
|
628
628
|
brush: {
|
|
629
629
|
kFalU9: "xx69xxh",
|
|
630
630
|
kkrTdU: "xsid9ct",
|
|
@@ -662,7 +662,7 @@ var V = 260, H = 56, U = 20, W = 12, G = 1e3, he = {
|
|
|
662
662
|
"--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
663
663
|
}],
|
|
664
664
|
dot: (e) => [
|
|
665
|
-
|
|
665
|
+
q,
|
|
666
666
|
{
|
|
667
667
|
kWkggS: e == null ? e : "xl8spv7",
|
|
668
668
|
$$css: !0
|
|
@@ -677,24 +677,24 @@ var V = 260, H = 56, U = 20, W = 12, G = 1e3, he = {
|
|
|
677
677
|
$$css: !0
|
|
678
678
|
}
|
|
679
679
|
};
|
|
680
|
-
function
|
|
681
|
-
let { title: t, description: n, points: r, xDomain: i, yDomain: a, xLabel: o, yLabel: s, formatX:
|
|
682
|
-
if (
|
|
680
|
+
function Y(e) {
|
|
681
|
+
let { title: t, description: n, points: r, xDomain: i, yDomain: a, xLabel: o, yLabel: s, formatX: c, formatY: d, selection: h, rangeSelection: g, emptyLabel: y } = e, { ref: ee, width: x } = v(), S = Q(e);
|
|
682
|
+
if (S !== null) return /* @__PURE__ */ T(_, {
|
|
683
683
|
title: t,
|
|
684
684
|
description: n,
|
|
685
|
-
message:
|
|
685
|
+
message: S
|
|
686
686
|
});
|
|
687
|
-
let
|
|
687
|
+
let te = O({
|
|
688
688
|
domain: [...i],
|
|
689
|
-
range: [
|
|
690
|
-
}),
|
|
689
|
+
range: [U, Math.max(U, x - W)]
|
|
690
|
+
}), ne = O({
|
|
691
691
|
domain: [...a],
|
|
692
|
-
range: [216,
|
|
693
|
-
}),
|
|
694
|
-
return /* @__PURE__ */ E(
|
|
692
|
+
range: [216, G]
|
|
693
|
+
}), C = r.find((e) => e.id === h?.selectedId);
|
|
694
|
+
return /* @__PURE__ */ E(f, {
|
|
695
695
|
title: t,
|
|
696
696
|
description: n,
|
|
697
|
-
footer: h !== void 0 && r.length > 0 ? /* @__PURE__ */ T(
|
|
697
|
+
footer: h !== void 0 && r.length > 0 ? /* @__PURE__ */ T(l, { children: C === void 0 ? "Select a point to inspect its label and coordinates." : `${C.label}, ${o}: ${c(C.x)}, ${s}: ${d(C.y)}` }) : void 0,
|
|
698
698
|
children: [
|
|
699
699
|
r.length === 0 ? /* @__PURE__ */ T("p", {
|
|
700
700
|
className: "x1ghz6dp x153jb6y",
|
|
@@ -702,63 +702,63 @@ function q(e) {
|
|
|
702
702
|
}) : /* @__PURE__ */ E("div", {
|
|
703
703
|
ref: ee,
|
|
704
704
|
className: "x1n2onr6 xeuugli",
|
|
705
|
-
children: [/* @__PURE__ */ T(
|
|
705
|
+
children: [/* @__PURE__ */ T(X, {
|
|
706
706
|
width: x,
|
|
707
|
-
scaleX:
|
|
708
|
-
scaleY:
|
|
707
|
+
scaleX: te,
|
|
708
|
+
scaleY: ne,
|
|
709
709
|
...e
|
|
710
710
|
}, `${i[0]}:${i[1]}:${a[0]}:${a[1]}:${x}`), h !== void 0 && /* @__PURE__ */ T("div", {
|
|
711
711
|
className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
|
|
712
712
|
children: r.map((e) => /* @__PURE__ */ T("button", {
|
|
713
713
|
type: "button",
|
|
714
714
|
title: e.label,
|
|
715
|
-
"aria-label": `${e.label}, ${o}: ${
|
|
715
|
+
"aria-label": `${e.label}, ${o}: ${c(e.x)}, ${s}: ${d(e.y)}`,
|
|
716
716
|
"aria-pressed": h.selectedId === e.id,
|
|
717
717
|
onClick: () => h.onSelect(e.id),
|
|
718
|
-
...b.props(
|
|
718
|
+
...b.props(J.target, J.location(te(e.x), ne(e.y))),
|
|
719
719
|
children: /* @__PURE__ */ T("span", {
|
|
720
720
|
"aria-hidden": !0,
|
|
721
|
-
...b.props(
|
|
721
|
+
...b.props(J.dot(p[e.tone]), h.selectedId === e.id && J.selected)
|
|
722
722
|
})
|
|
723
723
|
}, e.id))
|
|
724
724
|
})]
|
|
725
725
|
}),
|
|
726
|
-
|
|
726
|
+
g !== void 0 && /* @__PURE__ */ T(Z, {
|
|
727
727
|
...e,
|
|
728
|
-
rangeSelection:
|
|
728
|
+
rangeSelection: g
|
|
729
729
|
}),
|
|
730
|
-
r.length > 0 && /* @__PURE__ */ T(
|
|
731
|
-
label: `${e.label}, ${o}: ${
|
|
730
|
+
r.length > 0 && /* @__PURE__ */ T(m, { children: r.map((e) => /* @__PURE__ */ E(u, {
|
|
731
|
+
label: `${e.label}, ${o}: ${c(e.x)}, ${s}: ${d(e.y)}`,
|
|
732
732
|
isSelected: h?.selectedId === e.id,
|
|
733
733
|
onSelect: h === void 0 ? void 0 : () => h.onSelect(e.id),
|
|
734
734
|
children: [/* @__PURE__ */ T("span", { children: e.label }), /* @__PURE__ */ E("span", {
|
|
735
735
|
className: "xeuugli xss6m8b xj0a0fe x153jb6y",
|
|
736
736
|
children: [
|
|
737
|
-
|
|
737
|
+
c(e.x),
|
|
738
738
|
" · ",
|
|
739
|
-
|
|
739
|
+
d(e.y)
|
|
740
740
|
]
|
|
741
741
|
})]
|
|
742
742
|
}, e.id)) })
|
|
743
743
|
]
|
|
744
744
|
});
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
let
|
|
748
|
-
x: [Math.min(
|
|
749
|
-
y: [Math.min(
|
|
746
|
+
function X({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, formatX: o, formatY: s, selection: c, rangeSelection: l }) {
|
|
747
|
+
let u = S(), [f, m] = C(null), h = f === null ? l?.value : {
|
|
748
|
+
x: [Math.min(f.start.x, f.end.x), Math.max(f.start.x, f.end.x)],
|
|
749
|
+
y: [Math.min(f.start.y, f.end.y), Math.max(f.start.y, f.end.y)]
|
|
750
750
|
};
|
|
751
751
|
function g(r) {
|
|
752
752
|
let i = r.currentTarget.getBoundingClientRect();
|
|
753
753
|
return {
|
|
754
754
|
x: t.copy().clamp(!0).invert((r.clientX - i.left) / i.width * e),
|
|
755
|
-
y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height *
|
|
755
|
+
y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height * H)
|
|
756
756
|
};
|
|
757
757
|
}
|
|
758
758
|
function _(t) {
|
|
759
759
|
if (l === void 0 || t.button !== 0 || t.pointerType === "touch") return;
|
|
760
|
-
let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height *
|
|
761
|
-
if (r <
|
|
760
|
+
let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * H;
|
|
761
|
+
if (r < U || r > e - W || i < G || i > 216) return;
|
|
762
762
|
let a = g(t);
|
|
763
763
|
t.currentTarget.setPointerCapture(t.pointerId), m({
|
|
764
764
|
start: a,
|
|
@@ -767,71 +767,71 @@ function J({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
|
|
|
767
767
|
});
|
|
768
768
|
}
|
|
769
769
|
function v(e) {
|
|
770
|
-
|
|
771
|
-
...
|
|
770
|
+
f !== null && f.pointerId === e.pointerId && m({
|
|
771
|
+
...f,
|
|
772
772
|
end: g(e)
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
775
|
function y(e) {
|
|
776
|
-
if (
|
|
776
|
+
if (f === null || f.pointerId !== e.pointerId) return;
|
|
777
777
|
let t = g(e), n = {
|
|
778
|
-
x: [Math.min(
|
|
779
|
-
y: [Math.min(
|
|
778
|
+
x: [Math.min(f.start.x, t.x), Math.max(f.start.x, t.x)],
|
|
779
|
+
y: [Math.min(f.start.y, t.y), Math.max(f.start.y, t.y)]
|
|
780
780
|
};
|
|
781
781
|
m(null), e.currentTarget.releasePointerCapture(e.pointerId), l?.onChange(n);
|
|
782
782
|
}
|
|
783
783
|
return /* @__PURE__ */ E("svg", {
|
|
784
784
|
width: e,
|
|
785
|
-
height:
|
|
786
|
-
viewBox: `0 0 ${e} ${
|
|
785
|
+
height: H,
|
|
786
|
+
viewBox: `0 0 ${e} ${H}`,
|
|
787
787
|
"aria-hidden": !0,
|
|
788
788
|
onPointerDown: _,
|
|
789
789
|
onPointerMove: v,
|
|
790
790
|
onPointerUp: y,
|
|
791
791
|
onPointerCancel: () => m(null),
|
|
792
792
|
onLostPointerCapture: () => m(null),
|
|
793
|
-
...b.props(
|
|
793
|
+
...b.props(d.svg, l !== void 0 && J.brush),
|
|
794
794
|
children: [
|
|
795
795
|
/* @__PURE__ */ T("defs", { children: /* @__PURE__ */ T("clipPath", {
|
|
796
|
-
id:
|
|
796
|
+
id: u,
|
|
797
797
|
children: /* @__PURE__ */ T("rect", {
|
|
798
|
-
x:
|
|
799
|
-
y:
|
|
800
|
-
width: Math.max(0, e -
|
|
798
|
+
x: U,
|
|
799
|
+
y: G,
|
|
800
|
+
width: Math.max(0, e - U - W),
|
|
801
801
|
height: 204
|
|
802
802
|
})
|
|
803
803
|
}) }),
|
|
804
804
|
t.ticks(5).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
|
|
805
805
|
x1: t(e),
|
|
806
806
|
x2: t(e),
|
|
807
|
-
y1:
|
|
807
|
+
y1: G,
|
|
808
808
|
y2: 216,
|
|
809
|
-
...b.props(
|
|
809
|
+
...b.props(d.grid)
|
|
810
810
|
}), /* @__PURE__ */ T("text", {
|
|
811
811
|
x: t(e),
|
|
812
812
|
y: 234,
|
|
813
813
|
textAnchor: "middle",
|
|
814
|
-
...b.props(
|
|
814
|
+
...b.props(d.label),
|
|
815
815
|
children: o(e)
|
|
816
816
|
})] }, e)),
|
|
817
817
|
n.ticks(4).map((t) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
|
|
818
|
-
x1:
|
|
819
|
-
x2: e -
|
|
818
|
+
x1: U,
|
|
819
|
+
x2: e - W,
|
|
820
820
|
y1: n(t),
|
|
821
821
|
y2: n(t),
|
|
822
|
-
...b.props(
|
|
822
|
+
...b.props(d.grid)
|
|
823
823
|
}), /* @__PURE__ */ T("text", {
|
|
824
824
|
x: 48,
|
|
825
825
|
y: n(t) + 4,
|
|
826
826
|
textAnchor: "end",
|
|
827
|
-
...b.props(
|
|
827
|
+
...b.props(d.label),
|
|
828
828
|
children: s(t)
|
|
829
829
|
})] }, t)),
|
|
830
830
|
/* @__PURE__ */ T("text", {
|
|
831
|
-
x: (
|
|
831
|
+
x: (U + e - W) / 2,
|
|
832
832
|
y: 256,
|
|
833
833
|
textAnchor: "middle",
|
|
834
|
-
...b.props(
|
|
834
|
+
...b.props(d.label),
|
|
835
835
|
children: i
|
|
836
836
|
}),
|
|
837
837
|
/* @__PURE__ */ T("text", {
|
|
@@ -839,11 +839,11 @@ function J({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
|
|
|
839
839
|
y: 108,
|
|
840
840
|
textAnchor: "middle",
|
|
841
841
|
transform: "rotate(-90 12 108)",
|
|
842
|
-
...b.props(
|
|
842
|
+
...b.props(d.label),
|
|
843
843
|
children: a
|
|
844
844
|
}),
|
|
845
845
|
/* @__PURE__ */ E("g", {
|
|
846
|
-
clipPath: `url(#${
|
|
846
|
+
clipPath: `url(#${u})`,
|
|
847
847
|
children: [h != null && /* @__PURE__ */ T("rect", {
|
|
848
848
|
x: t(h.x[0]),
|
|
849
849
|
y: n(h.y[1]),
|
|
@@ -854,13 +854,13 @@ function J({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
|
|
|
854
854
|
cx: t(e.x),
|
|
855
855
|
cy: n(e.y),
|
|
856
856
|
r: 4,
|
|
857
|
-
fill:
|
|
857
|
+
fill: p[e.tone]
|
|
858
858
|
}, e.id))]
|
|
859
859
|
})
|
|
860
860
|
]
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
|
-
function
|
|
863
|
+
function Z({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: a, formatY: s }) {
|
|
864
864
|
let c = e.value ?? {
|
|
865
865
|
x: t,
|
|
866
866
|
y: n
|
|
@@ -872,7 +872,7 @@ function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
872
872
|
className: "x153jb6y xy8obcc x1jfksii",
|
|
873
873
|
children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
|
|
874
874
|
}),
|
|
875
|
-
/* @__PURE__ */ E(
|
|
875
|
+
/* @__PURE__ */ E(y.Root, {
|
|
876
876
|
value: c.x,
|
|
877
877
|
min: t[0],
|
|
878
878
|
max: t[1],
|
|
@@ -885,26 +885,26 @@ function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
885
885
|
}),
|
|
886
886
|
children: [/* @__PURE__ */ E("div", {
|
|
887
887
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
888
|
-
children: [/* @__PURE__ */ T(
|
|
889
|
-
|
|
888
|
+
children: [/* @__PURE__ */ T(y.Label, { children: r }), /* @__PURE__ */ E("span", { children: [
|
|
889
|
+
a(c.x[0]),
|
|
890
890
|
" – ",
|
|
891
|
-
|
|
891
|
+
a(c.x[1])
|
|
892
892
|
] })]
|
|
893
|
-
}), /* @__PURE__ */ T(
|
|
894
|
-
/* @__PURE__ */ T(
|
|
895
|
-
/* @__PURE__ */ T(
|
|
893
|
+
}), /* @__PURE__ */ T(y.Control, { children: /* @__PURE__ */ E(y.Track, { children: [
|
|
894
|
+
/* @__PURE__ */ T(y.Indicator, {}),
|
|
895
|
+
/* @__PURE__ */ T(y.Thumb, {
|
|
896
896
|
index: 0,
|
|
897
897
|
"aria-label": `${r} minimum`,
|
|
898
|
-
getAriaValueText: (e, t) =>
|
|
898
|
+
getAriaValueText: (e, t) => a(t)
|
|
899
899
|
}),
|
|
900
|
-
/* @__PURE__ */ T(
|
|
900
|
+
/* @__PURE__ */ T(y.Thumb, {
|
|
901
901
|
index: 1,
|
|
902
902
|
"aria-label": `${r} maximum`,
|
|
903
|
-
getAriaValueText: (e, t) =>
|
|
903
|
+
getAriaValueText: (e, t) => a(t)
|
|
904
904
|
})
|
|
905
905
|
] }) })]
|
|
906
906
|
}),
|
|
907
|
-
/* @__PURE__ */ E(
|
|
907
|
+
/* @__PURE__ */ E(y.Root, {
|
|
908
908
|
value: c.y,
|
|
909
909
|
min: n[0],
|
|
910
910
|
max: n[1],
|
|
@@ -917,26 +917,26 @@ function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
917
917
|
}),
|
|
918
918
|
children: [/* @__PURE__ */ E("div", {
|
|
919
919
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
920
|
-
children: [/* @__PURE__ */ T(
|
|
920
|
+
children: [/* @__PURE__ */ T(y.Label, { children: i }), /* @__PURE__ */ E("span", { children: [
|
|
921
921
|
s(c.y[0]),
|
|
922
922
|
" – ",
|
|
923
923
|
s(c.y[1])
|
|
924
924
|
] })]
|
|
925
|
-
}), /* @__PURE__ */ T(
|
|
926
|
-
/* @__PURE__ */ T(
|
|
927
|
-
/* @__PURE__ */ T(
|
|
925
|
+
}), /* @__PURE__ */ T(y.Control, { children: /* @__PURE__ */ E(y.Track, { children: [
|
|
926
|
+
/* @__PURE__ */ T(y.Indicator, {}),
|
|
927
|
+
/* @__PURE__ */ T(y.Thumb, {
|
|
928
928
|
index: 0,
|
|
929
929
|
"aria-label": `${i} minimum`,
|
|
930
930
|
getAriaValueText: (e, t) => s(t)
|
|
931
931
|
}),
|
|
932
|
-
/* @__PURE__ */ T(
|
|
932
|
+
/* @__PURE__ */ T(y.Thumb, {
|
|
933
933
|
index: 1,
|
|
934
934
|
"aria-label": `${i} maximum`,
|
|
935
935
|
getAriaValueText: (e, t) => s(t)
|
|
936
936
|
})
|
|
937
937
|
] }) })]
|
|
938
938
|
}),
|
|
939
|
-
/* @__PURE__ */ T(
|
|
939
|
+
/* @__PURE__ */ T(o, {
|
|
940
940
|
type: "button",
|
|
941
941
|
disabled: e.value === null,
|
|
942
942
|
onClick: () => e.onChange(null),
|
|
@@ -945,10 +945,10 @@ function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
|
|
|
945
945
|
]
|
|
946
946
|
});
|
|
947
947
|
}
|
|
948
|
-
function
|
|
949
|
-
if (!
|
|
950
|
-
if (e.length > 1e3) return `This plot exceeds the ${
|
|
951
|
-
if (!
|
|
948
|
+
function Q({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
|
|
949
|
+
if (!g(t) || !g(n)) return "Scatter domains must contain finite, increasing endpoints.";
|
|
950
|
+
if (e.length > 1e3) return `This plot exceeds the ${K}-point render limit. Supply a smaller, labelled sample.`;
|
|
951
|
+
if (!h(e)) return "Scatter points must have unique identifiers.";
|
|
952
952
|
if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
|
|
953
953
|
if (e.some((e) => {
|
|
954
954
|
let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
|
|
@@ -958,18 +958,18 @@ function X({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
|
|
|
958
958
|
let i = Number.isFinite(r.xStep) && r.xStep > 0 && r.xStep <= t[1] - t[0], a = Number.isFinite(r.yStep) && r.yStep > 0 && r.yStep <= n[1] - n[0];
|
|
959
959
|
if (!i || !a) return "Range selection steps must be finite, positive, and no larger than their domain span.";
|
|
960
960
|
let o = r.value;
|
|
961
|
-
return o === null ? null : !
|
|
961
|
+
return o === null ? null : !he(o.x, t) || !he(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function he(e, t) {
|
|
964
964
|
return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
|
|
965
965
|
}
|
|
966
966
|
// packages/charts/src/cartesian/time-series-data.ts
|
|
967
|
-
var
|
|
967
|
+
var $ = {
|
|
968
968
|
series: 12,
|
|
969
969
|
pointsPerSeries: 2e3,
|
|
970
970
|
markers: 200,
|
|
971
971
|
panels: 12
|
|
972
|
-
},
|
|
972
|
+
}, ge = .01, _e = [
|
|
973
973
|
"series1",
|
|
974
974
|
"series2",
|
|
975
975
|
"series3",
|
|
@@ -977,13 +977,13 @@ var Q = {
|
|
|
977
977
|
"series5",
|
|
978
978
|
"series6"
|
|
979
979
|
];
|
|
980
|
-
function
|
|
980
|
+
function ve({ series: e, isStacked: t, markers: n }) {
|
|
981
981
|
let r = e[0]?.points.map((e) => e.timestamp) ?? [];
|
|
982
|
-
if (e.length >
|
|
983
|
-
if (!
|
|
982
|
+
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.`;
|
|
983
|
+
if (!h(e) || !h(n)) return "Series and markers require unique identifiers.";
|
|
984
984
|
for (let n of e) {
|
|
985
985
|
if (n.points.length !== r.length) return "Every series must supply the same observation timestamps.";
|
|
986
|
-
let e =
|
|
986
|
+
let e = Se({
|
|
987
987
|
points: n.points,
|
|
988
988
|
timestamps: r,
|
|
989
989
|
isStacked: t
|
|
@@ -1001,7 +1001,7 @@ function _e({ series: e, isStacked: t, markers: n }) {
|
|
|
1001
1001
|
if (!Number.isFinite(a) || !Number.isFinite(o)) return "The elapsed-time and value ranges must be finite.";
|
|
1002
1002
|
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.";
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1004
|
+
function ye({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
1005
1005
|
return JSON.stringify([
|
|
1006
1006
|
n,
|
|
1007
1007
|
r,
|
|
@@ -1021,15 +1021,15 @@ function ve({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
|
1021
1021
|
])
|
|
1022
1022
|
]);
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function be(e, t, n = !1) {
|
|
1025
1025
|
if (e !== t) return [e, t];
|
|
1026
|
-
let r = Math.max(1, Math.abs(e) *
|
|
1026
|
+
let r = Math.max(1, Math.abs(e) * ge), i = n ? 0 : e - r, a = t + r;
|
|
1027
1027
|
return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function xe(e, t) {
|
|
1030
1030
|
let n = e.filter((e) => e.tone === void 0);
|
|
1031
1031
|
return e.map((r, i) => {
|
|
1032
|
-
let a = n.findIndex((e) => e.id === r.id), o = r.tone ??
|
|
1032
|
+
let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? _e[a % _e.length] ?? "series1", s = r.points.map((n, r) => {
|
|
1033
1033
|
let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
|
|
1034
1034
|
return {
|
|
1035
1035
|
...n,
|
|
@@ -1044,7 +1044,7 @@ function be(e, t) {
|
|
|
1044
1044
|
};
|
|
1045
1045
|
});
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function Se({ points: e, timestamps: t, isStacked: n }) {
|
|
1048
1048
|
for (let [r, i] of e.entries()) {
|
|
1049
1049
|
let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
|
|
1050
1050
|
if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
|
|
@@ -1053,14 +1053,14 @@ function xe({ points: e, timestamps: t, isStacked: n }) {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
1055
|
// packages/charts/src/cartesian/time-series-line.tsx
|
|
1056
|
-
function
|
|
1057
|
-
return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(
|
|
1056
|
+
function Ce({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }) {
|
|
1057
|
+
return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(re, {
|
|
1058
1058
|
data: [...e.points],
|
|
1059
1059
|
defined: (e) => e.value !== null,
|
|
1060
1060
|
x: (e) => t(e.timestamp),
|
|
1061
1061
|
y: (e) => n((e.value ?? 0) + e.base),
|
|
1062
|
-
stroke:
|
|
1063
|
-
...b.props(
|
|
1062
|
+
stroke: p[e.tone],
|
|
1063
|
+
...b.props(d.mark)
|
|
1064
1064
|
}), e.points.filter((t, n) => {
|
|
1065
1065
|
if (t.value === null) return !1;
|
|
1066
1066
|
let i = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
|
|
@@ -1069,12 +1069,12 @@ function Se({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }
|
|
|
1069
1069
|
cx: t(r.timestamp),
|
|
1070
1070
|
cy: n((r.value ?? 0) + r.base),
|
|
1071
1071
|
r: i,
|
|
1072
|
-
fill:
|
|
1072
|
+
fill: p[e.tone]
|
|
1073
1073
|
}, r.timestamp))] });
|
|
1074
1074
|
}
|
|
1075
1075
|
// packages/charts/src/cartesian/sparkline.tsx
|
|
1076
|
-
function
|
|
1077
|
-
let o =
|
|
1076
|
+
function we({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
|
|
1077
|
+
let o = S(), s = S(), c = Te({
|
|
1078
1078
|
title: e,
|
|
1079
1079
|
summary: t,
|
|
1080
1080
|
unit: n,
|
|
@@ -1089,12 +1089,12 @@ function Ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1089
1089
|
children: c === void 0 ? "No data" : "Invalid trend"
|
|
1090
1090
|
});
|
|
1091
1091
|
let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = O({
|
|
1092
|
-
domain: [...
|
|
1092
|
+
domain: [...be(u, d)],
|
|
1093
1093
|
range: [3, 125]
|
|
1094
1094
|
}), p = O({
|
|
1095
1095
|
domain: [...a],
|
|
1096
1096
|
range: [29, 3]
|
|
1097
|
-
}), m =
|
|
1097
|
+
}), m = xe([i], !1)[0];
|
|
1098
1098
|
return /* @__PURE__ */ E("svg", {
|
|
1099
1099
|
role: "img",
|
|
1100
1100
|
"aria-labelledby": o,
|
|
@@ -1127,7 +1127,7 @@ function Ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1127
1127
|
"."
|
|
1128
1128
|
]
|
|
1129
1129
|
}),
|
|
1130
|
-
m !== void 0 && /* @__PURE__ */ T(
|
|
1130
|
+
m !== void 0 && /* @__PURE__ */ T(Ce, {
|
|
1131
1131
|
series: m,
|
|
1132
1132
|
x: f,
|
|
1133
1133
|
y: p,
|
|
@@ -1136,10 +1136,10 @@ function Ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1136
1136
|
]
|
|
1137
1137
|
});
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function Te({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
|
|
1140
1140
|
if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
|
|
1141
|
-
if (!
|
|
1142
|
-
let a =
|
|
1141
|
+
if (!g(i)) return "The displayed value domain must have finite, increasing bounds.";
|
|
1142
|
+
let a = ve({
|
|
1143
1143
|
series: [r],
|
|
1144
1144
|
isStacked: !1,
|
|
1145
1145
|
markers: []
|
|
@@ -1148,7 +1148,7 @@ function we({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
|
|
|
1148
1148
|
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.";
|
|
1149
1149
|
}
|
|
1150
1150
|
// packages/charts/src/cartesian/time-series.tsx
|
|
1151
|
-
var
|
|
1151
|
+
var Ee = {
|
|
1152
1152
|
timeAxis: {
|
|
1153
1153
|
k1xSpc: "x78zum5",
|
|
1154
1154
|
kjj79g: "x1qughib",
|
|
@@ -1169,45 +1169,86 @@ var Te = {
|
|
|
1169
1169
|
"--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
1170
1170
|
}]
|
|
1171
1171
|
};
|
|
1172
|
-
function
|
|
1173
|
-
return /* @__PURE__ */ T(
|
|
1172
|
+
function De(e) {
|
|
1173
|
+
return /* @__PURE__ */ T(Me, {
|
|
1174
1174
|
...e,
|
|
1175
1175
|
kind: "line",
|
|
1176
1176
|
isStacked: !1
|
|
1177
1177
|
});
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1180
|
-
return /* @__PURE__ */ T(
|
|
1179
|
+
function Oe({ isStacked: e = !1, ...t }) {
|
|
1180
|
+
return /* @__PURE__ */ T(Me, {
|
|
1181
1181
|
...t,
|
|
1182
1182
|
kind: "area",
|
|
1183
1183
|
isStacked: e
|
|
1184
1184
|
});
|
|
1185
1185
|
}
|
|
1186
|
-
function
|
|
1187
|
-
let
|
|
1186
|
+
function ke({ title: n, description: r, series: i, actions: a, height: o = 180 }) {
|
|
1187
|
+
let s = S(), c = xe(i.map((e) => ({
|
|
1188
|
+
...e,
|
|
1189
|
+
points: []
|
|
1190
|
+
})), !1);
|
|
1191
|
+
return !Number.isFinite(o) || o < 48 ? /* @__PURE__ */ T(_, {
|
|
1192
|
+
title: n,
|
|
1193
|
+
description: r,
|
|
1194
|
+
message: "Chart height must be at least 48 pixels."
|
|
1195
|
+
}) : /* @__PURE__ */ T("div", {
|
|
1196
|
+
"aria-hidden": !0,
|
|
1197
|
+
inert: !0,
|
|
1198
|
+
className: "xeuugli",
|
|
1199
|
+
children: /* @__PURE__ */ T(f, {
|
|
1200
|
+
title: n,
|
|
1201
|
+
description: r,
|
|
1202
|
+
actions: /* @__PURE__ */ E(w, { children: [a, /* @__PURE__ */ T(ae, {
|
|
1203
|
+
title: n,
|
|
1204
|
+
children: null
|
|
1205
|
+
})] }),
|
|
1206
|
+
children: /* @__PURE__ */ E("div", {
|
|
1207
|
+
className: "xrvj5dj x1n8ia3y",
|
|
1208
|
+
children: [/* @__PURE__ */ T(se, {
|
|
1209
|
+
id: s,
|
|
1210
|
+
label: void 0,
|
|
1211
|
+
legend: c,
|
|
1212
|
+
rows: [],
|
|
1213
|
+
x: 0,
|
|
1214
|
+
width: 0,
|
|
1215
|
+
source: void 0
|
|
1216
|
+
}), /* @__PURE__ */ E("div", {
|
|
1217
|
+
...b.props(d.plot),
|
|
1218
|
+
children: [/* @__PURE__ */ T(t, { height: o - 16 }), /* @__PURE__ */ E("div", {
|
|
1219
|
+
className: "x78zum5 x1qughib x8zbtdt x1c87qhr xy8obcc xas2l8k x153jb6y xss6m8b",
|
|
1220
|
+
children: [/* @__PURE__ */ T(e, { width: "8ch" }), /* @__PURE__ */ T(e, { width: "8ch" })]
|
|
1221
|
+
})]
|
|
1222
|
+
})]
|
|
1223
|
+
})
|
|
1224
|
+
})
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
function Ae({ charts: e, ...t }) {
|
|
1228
|
+
let n = ne(null), [r, i] = C(), a = JSON.stringify(e.map((e) => [
|
|
1188
1229
|
e.id,
|
|
1189
1230
|
e.title,
|
|
1190
|
-
|
|
1231
|
+
ye({
|
|
1191
1232
|
series: e.series,
|
|
1192
1233
|
markers: e.markers ?? [],
|
|
1193
1234
|
timestampUnit: t.timestampUnit,
|
|
1194
1235
|
isStacked: !1
|
|
1195
1236
|
})
|
|
1196
1237
|
])), 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);
|
|
1197
|
-
if (r !== void 0 && r.signature !== a && i(void 0),
|
|
1238
|
+
if (r !== void 0 && r.signature !== a && i(void 0), x(() => {
|
|
1198
1239
|
function e(e) {
|
|
1199
1240
|
e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
|
|
1200
1241
|
}
|
|
1201
1242
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1202
|
-
}, []), !s || !
|
|
1243
|
+
}, []), !s || !h(e)) return /* @__PURE__ */ T(_, {
|
|
1203
1244
|
title: "Small multiples",
|
|
1204
1245
|
message: "Charts need unique identifiers and aligned observation timestamps."
|
|
1205
1246
|
});
|
|
1206
|
-
if (e.length >
|
|
1247
|
+
if (e.length > $.panels) return /* @__PURE__ */ T(_, {
|
|
1207
1248
|
title: "Small multiples",
|
|
1208
|
-
message: `Choose at most ${
|
|
1249
|
+
message: `Choose at most ${$.panels} panels.`
|
|
1209
1250
|
});
|
|
1210
|
-
if (e.length === 0) return /* @__PURE__ */ T(
|
|
1251
|
+
if (e.length === 0) return /* @__PURE__ */ T(f, {
|
|
1211
1252
|
title: "Small multiples",
|
|
1212
1253
|
children: /* @__PURE__ */ T("p", {
|
|
1213
1254
|
className: "x153jb6y",
|
|
@@ -1224,7 +1265,7 @@ function Oe({ charts: e, ...t }) {
|
|
|
1224
1265
|
return /* @__PURE__ */ T("div", {
|
|
1225
1266
|
ref: n,
|
|
1226
1267
|
className: "xrvj5dj x1j825kq",
|
|
1227
|
-
children: e.map((e) => /* @__PURE__ */ T(
|
|
1268
|
+
children: e.map((e) => /* @__PURE__ */ T(Me, {
|
|
1228
1269
|
...t,
|
|
1229
1270
|
title: e.title,
|
|
1230
1271
|
description: e.description,
|
|
@@ -1239,39 +1280,39 @@ function Oe({ charts: e, ...t }) {
|
|
|
1239
1280
|
}, e.id))
|
|
1240
1281
|
});
|
|
1241
1282
|
}
|
|
1242
|
-
var
|
|
1283
|
+
var je = {
|
|
1243
1284
|
"x-default-marker": "x-default-marker",
|
|
1244
1285
|
$$css: !0
|
|
1245
1286
|
};
|
|
1246
|
-
function
|
|
1247
|
-
let
|
|
1287
|
+
function Me({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: i, formatValue: a, formatTick: o = a, markers: s = [], height: c = 180, actions: l, kind: u, isStacked: m, sharedInspection: h, axisWidth: g }) {
|
|
1288
|
+
let y = !Number.isFinite(c) || c < 48 ? "Chart height must be at least 48 pixels." : ve({
|
|
1248
1289
|
series: n,
|
|
1249
1290
|
isStacked: m,
|
|
1250
1291
|
markers: s
|
|
1251
|
-
}),
|
|
1292
|
+
}), D = te(() => y === void 0 ? xe(n, m) : [], [
|
|
1252
1293
|
n,
|
|
1253
1294
|
m,
|
|
1254
|
-
|
|
1255
|
-
]), A =
|
|
1295
|
+
y
|
|
1296
|
+
]), A = D[0]?.points ?? [], { ref: re, width: j, element: M } = v(), ce = ne(null), [N, le] = C(), P = A.find((e) => e.timestamp === N) ?? A[0], [ue, de] = C(), F = ye({
|
|
1256
1297
|
series: n,
|
|
1257
1298
|
markers: s,
|
|
1258
1299
|
timestampUnit: r,
|
|
1259
1300
|
isStacked: m
|
|
1260
|
-
}), I = h === void 0 ?
|
|
1261
|
-
|
|
1301
|
+
}), I = h === void 0 ? ue?.signature === F ? ue : void 0 : h.value, fe = S();
|
|
1302
|
+
ue !== void 0 && (ue.signature !== F || y !== void 0) && de(void 0);
|
|
1262
1303
|
let pe = h !== void 0;
|
|
1263
|
-
if (
|
|
1304
|
+
if (x(() => {
|
|
1264
1305
|
if (pe) return;
|
|
1265
1306
|
function e(e) {
|
|
1266
|
-
e.target instanceof Node &&
|
|
1307
|
+
e.target instanceof Node && ce.current?.contains(e.target) !== !0 && de(void 0);
|
|
1267
1308
|
}
|
|
1268
1309
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1269
|
-
}, [pe]),
|
|
1310
|
+
}, [pe]), y !== void 0) return /* @__PURE__ */ T(_, {
|
|
1270
1311
|
title: e,
|
|
1271
1312
|
description: t,
|
|
1272
|
-
message:
|
|
1313
|
+
message: y
|
|
1273
1314
|
});
|
|
1274
|
-
if (A.length === 0) return /* @__PURE__ */ T(
|
|
1315
|
+
if (A.length === 0) return /* @__PURE__ */ T(f, {
|
|
1275
1316
|
title: e,
|
|
1276
1317
|
description: t,
|
|
1277
1318
|
actions: l,
|
|
@@ -1280,32 +1321,32 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1280
1321
|
children: "No observations"
|
|
1281
1322
|
})
|
|
1282
1323
|
});
|
|
1283
|
-
let L = c - 28, me = L + 12, R = A[0]?.timestamp ?? 0, z = A.at(-1)?.timestamp ?? R, B =
|
|
1284
|
-
domain: [...
|
|
1324
|
+
let L = c - 28, me = L + 12, R = A[0]?.timestamp ?? 0, z = A.at(-1)?.timestamp ?? R, B = D.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), V = u === "area" ? Math.min(0, ...B) : Math.min(...B), H = u === "area" ? Math.max(0, ...B) : Math.max(...B), U = B.length === 0 ? 0 : V, W = B.length === 0 ? 1 : H, G = O({
|
|
1325
|
+
domain: [...be(U, W, u === "area")],
|
|
1285
1326
|
range: [L, 12]
|
|
1286
|
-
}),
|
|
1287
|
-
domain: [...
|
|
1288
|
-
range: [
|
|
1327
|
+
}), K = G.ticks(3), q = g ?? Math.max(44, ...K.map((e) => o(e).length * 7 + 12)), J = Math.max(q + 1, j - 16), Y = O({
|
|
1328
|
+
domain: [...be(R, z)],
|
|
1329
|
+
range: [q, J]
|
|
1289
1330
|
});
|
|
1290
|
-
function
|
|
1291
|
-
let t =
|
|
1331
|
+
function X(e) {
|
|
1332
|
+
let t = M?.getBoundingClientRect();
|
|
1292
1333
|
if (t === void 0) return;
|
|
1293
|
-
let n =
|
|
1334
|
+
let n = Y.invert(e - t.left), r = A.find((e, t) => {
|
|
1294
1335
|
let r = A[t + 1];
|
|
1295
1336
|
return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
|
|
1296
1337
|
});
|
|
1297
|
-
r !== void 0 &&
|
|
1338
|
+
r !== void 0 && Z({
|
|
1298
1339
|
signature: F,
|
|
1299
1340
|
timestamp: r.timestamp,
|
|
1300
1341
|
source: "pointer"
|
|
1301
1342
|
});
|
|
1302
1343
|
}
|
|
1303
|
-
function
|
|
1344
|
+
function Z(e) {
|
|
1304
1345
|
h === void 0 ? de(e) : h.onChange(e);
|
|
1305
1346
|
}
|
|
1306
|
-
function
|
|
1347
|
+
function Q(e) {
|
|
1307
1348
|
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
1308
|
-
let t = A.findIndex((e) => e.timestamp ===
|
|
1349
|
+
let t = A.findIndex((e) => e.timestamp === P?.timestamp), n = {
|
|
1309
1350
|
ArrowRight: Math.min(A.length - 1, t + 1),
|
|
1310
1351
|
ArrowLeft: Math.max(0, t - 1),
|
|
1311
1352
|
Home: 0,
|
|
@@ -1313,7 +1354,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1313
1354
|
};
|
|
1314
1355
|
switch (e.key) {
|
|
1315
1356
|
case "Escape":
|
|
1316
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1357
|
+
e.preventDefault(), e.stopPropagation(), Z(void 0);
|
|
1317
1358
|
break;
|
|
1318
1359
|
case "ArrowRight":
|
|
1319
1360
|
case "ArrowLeft":
|
|
@@ -1321,7 +1362,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1321
1362
|
case "End": {
|
|
1322
1363
|
e.preventDefault();
|
|
1323
1364
|
let t = A[n[e.key]];
|
|
1324
|
-
t !== void 0 && (le(t.timestamp),
|
|
1365
|
+
t !== void 0 && (le(t.timestamp), Z({
|
|
1325
1366
|
signature: F,
|
|
1326
1367
|
timestamp: t.timestamp,
|
|
1327
1368
|
source: "keyboard"
|
|
@@ -1331,10 +1372,10 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1331
1372
|
}
|
|
1332
1373
|
}
|
|
1333
1374
|
return /* @__PURE__ */ T("div", {
|
|
1334
|
-
ref:
|
|
1375
|
+
ref: ce,
|
|
1335
1376
|
className: "xeuugli",
|
|
1336
|
-
children: /* @__PURE__ */ T(
|
|
1337
|
-
title: /* @__PURE__ */ T(
|
|
1377
|
+
children: /* @__PURE__ */ T(f, {
|
|
1378
|
+
title: /* @__PURE__ */ T(oe, {
|
|
1338
1379
|
title: e,
|
|
1339
1380
|
detail: I === void 0 ? void 0 : i(I.timestamp)
|
|
1340
1381
|
}),
|
|
@@ -1342,7 +1383,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1342
1383
|
actions: /* @__PURE__ */ E(w, { children: [
|
|
1343
1384
|
l,
|
|
1344
1385
|
" ",
|
|
1345
|
-
/* @__PURE__ */ T(
|
|
1386
|
+
/* @__PURE__ */ T(ae, {
|
|
1346
1387
|
title: e,
|
|
1347
1388
|
children: /* @__PURE__ */ E("table", {
|
|
1348
1389
|
className: "xh8yej3 x1mwwwfo xy8obcc x1yc453h xss6m8b",
|
|
@@ -1356,7 +1397,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1356
1397
|
r,
|
|
1357
1398
|
")"
|
|
1358
1399
|
]
|
|
1359
|
-
}),
|
|
1400
|
+
}), D.map((e) => /* @__PURE__ */ T("th", {
|
|
1360
1401
|
scope: "col",
|
|
1361
1402
|
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1362
1403
|
children: e.label
|
|
@@ -1365,7 +1406,7 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1365
1406
|
scope: "row",
|
|
1366
1407
|
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1367
1408
|
children: i(e.timestamp)
|
|
1368
|
-
}),
|
|
1409
|
+
}), D.map((e) => /* @__PURE__ */ T("td", {
|
|
1369
1410
|
className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
|
|
1370
1411
|
children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : a(e.points[t].value)
|
|
1371
1412
|
}, e.id))] }, e.timestamp)) })
|
|
@@ -1376,15 +1417,15 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1376
1417
|
children: /* @__PURE__ */ E("div", {
|
|
1377
1418
|
className: "xrvj5dj x1n8ia3y",
|
|
1378
1419
|
children: [
|
|
1379
|
-
/* @__PURE__ */ T(
|
|
1420
|
+
/* @__PURE__ */ T(se, {
|
|
1380
1421
|
id: fe,
|
|
1381
1422
|
label: I === void 0 ? void 0 : i(I.timestamp),
|
|
1382
|
-
legend:
|
|
1423
|
+
legend: D.map(({ id: e, label: t, tone: n }) => ({
|
|
1383
1424
|
id: e,
|
|
1384
1425
|
label: t,
|
|
1385
1426
|
tone: n
|
|
1386
1427
|
})),
|
|
1387
|
-
rows:
|
|
1428
|
+
rows: D.map((e) => {
|
|
1388
1429
|
let t = e.points.find((e) => e.timestamp === I?.timestamp);
|
|
1389
1430
|
return {
|
|
1390
1431
|
id: e.id,
|
|
@@ -1393,14 +1434,14 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1393
1434
|
value: t?.value === null || t === void 0 ? "Unavailable" : a(t.value)
|
|
1394
1435
|
};
|
|
1395
1436
|
}),
|
|
1396
|
-
x:
|
|
1437
|
+
x: Y(I?.timestamp ?? R),
|
|
1397
1438
|
width: j,
|
|
1398
1439
|
source: I?.source,
|
|
1399
1440
|
notes: s.filter((e) => e.timestamp === I?.timestamp).map((e) => e.label)
|
|
1400
1441
|
}),
|
|
1401
1442
|
/* @__PURE__ */ E("div", {
|
|
1402
|
-
ref:
|
|
1403
|
-
...b.props(
|
|
1443
|
+
ref: re,
|
|
1444
|
+
...b.props(d.plot),
|
|
1404
1445
|
children: [/* @__PURE__ */ E("svg", {
|
|
1405
1446
|
role: "img",
|
|
1406
1447
|
"aria-label": `${e}. Use arrow keys to inspect observations.`,
|
|
@@ -1408,11 +1449,11 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1408
1449
|
tabIndex: 0,
|
|
1409
1450
|
viewBox: `0 0 ${j} ${me}`,
|
|
1410
1451
|
height: me,
|
|
1411
|
-
onKeyDown:
|
|
1452
|
+
onKeyDown: Q,
|
|
1412
1453
|
onFocus: (e) => {
|
|
1413
1454
|
if (e.currentTarget.matches(":focus-visible")) {
|
|
1414
1455
|
let e = I?.timestamp ?? R;
|
|
1415
|
-
le(e),
|
|
1456
|
+
le(e), Z({
|
|
1416
1457
|
signature: F,
|
|
1417
1458
|
timestamp: e,
|
|
1418
1459
|
source: "keyboard"
|
|
@@ -1420,74 +1461,74 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1420
1461
|
}
|
|
1421
1462
|
},
|
|
1422
1463
|
onPointerMove: (e) => {
|
|
1423
|
-
e.pointerType === "mouse" &&
|
|
1464
|
+
e.pointerType === "mouse" && X(e.clientX);
|
|
1424
1465
|
},
|
|
1425
|
-
onPointerDown: (e) =>
|
|
1466
|
+
onPointerDown: (e) => X(e.clientX),
|
|
1426
1467
|
onPointerLeave: (e) => {
|
|
1427
|
-
e.pointerType === "mouse" && I?.source === "pointer" &&
|
|
1468
|
+
e.pointerType === "mouse" && I?.source === "pointer" && Z(void 0);
|
|
1428
1469
|
},
|
|
1429
|
-
onBlur: () =>
|
|
1430
|
-
...b.props(
|
|
1470
|
+
onBlur: () => Z(void 0),
|
|
1471
|
+
...b.props(d.svg, d.inspectable, je),
|
|
1431
1472
|
children: [
|
|
1432
|
-
|
|
1433
|
-
x1:
|
|
1434
|
-
x2:
|
|
1473
|
+
K.map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
|
|
1474
|
+
x1: q,
|
|
1475
|
+
x2: J,
|
|
1435
1476
|
y1: G(e),
|
|
1436
1477
|
y2: G(e),
|
|
1437
|
-
...b.props(
|
|
1478
|
+
...b.props(d.grid)
|
|
1438
1479
|
}), /* @__PURE__ */ T("text", {
|
|
1439
|
-
x:
|
|
1480
|
+
x: q - 8,
|
|
1440
1481
|
y: G(e),
|
|
1441
1482
|
textAnchor: "end",
|
|
1442
1483
|
dominantBaseline: "middle",
|
|
1443
|
-
...b.props(
|
|
1484
|
+
...b.props(d.label),
|
|
1444
1485
|
children: o(e)
|
|
1445
1486
|
})] }, e)),
|
|
1446
|
-
|
|
1487
|
+
D.map((e) => /* @__PURE__ */ E("g", { children: [u === "area" && /* @__PURE__ */ T(k, {
|
|
1447
1488
|
data: [...e.points],
|
|
1448
1489
|
defined: (e) => e.value !== null,
|
|
1449
|
-
x: (e) =>
|
|
1490
|
+
x: (e) => Y(e.timestamp),
|
|
1450
1491
|
y0: (e) => G(e.base),
|
|
1451
1492
|
y1: (e) => G((e.value ?? 0) + e.base),
|
|
1452
1493
|
yScale: G,
|
|
1453
|
-
fill:
|
|
1494
|
+
fill: p[e.tone],
|
|
1454
1495
|
fillOpacity: m ? .65 : .15
|
|
1455
|
-
}), /* @__PURE__ */ T(
|
|
1496
|
+
}), /* @__PURE__ */ T(Ce, {
|
|
1456
1497
|
series: e,
|
|
1457
|
-
x:
|
|
1498
|
+
x: Y,
|
|
1458
1499
|
y: G,
|
|
1459
1500
|
inspectedTimestamp: I?.timestamp
|
|
1460
1501
|
})] }, e.id)),
|
|
1461
1502
|
s.map((e) => /* @__PURE__ */ E("g", { children: [e.kind === "time" ? /* @__PURE__ */ T("line", {
|
|
1462
|
-
x1:
|
|
1463
|
-
x2:
|
|
1503
|
+
x1: Y(e.timestamp),
|
|
1504
|
+
x2: Y(e.timestamp),
|
|
1464
1505
|
y1: 12,
|
|
1465
1506
|
y2: L,
|
|
1466
1507
|
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
1467
1508
|
}) : /* @__PURE__ */ T("circle", {
|
|
1468
|
-
cx:
|
|
1469
|
-
cy: G(e.value + (
|
|
1509
|
+
cx: Y(e.timestamp),
|
|
1510
|
+
cy: G(e.value + (D.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
|
|
1470
1511
|
r: 4,
|
|
1471
|
-
fill:
|
|
1472
|
-
...b.props(
|
|
1512
|
+
fill: ee.surface,
|
|
1513
|
+
...b.props(d.selected)
|
|
1473
1514
|
}), /* @__PURE__ */ T("title", { children: e.kind === "point" ? `${e.label}: ${a(e.value)}` : e.label })] }, e.id)),
|
|
1474
1515
|
I !== void 0 && /* @__PURE__ */ T("line", {
|
|
1475
|
-
x1:
|
|
1476
|
-
x2:
|
|
1516
|
+
x1: Y(I.timestamp),
|
|
1517
|
+
x2: Y(I.timestamp),
|
|
1477
1518
|
y1: 12,
|
|
1478
1519
|
y2: L,
|
|
1479
1520
|
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
1480
1521
|
}),
|
|
1481
|
-
|
|
1482
|
-
x:
|
|
1522
|
+
P !== void 0 && /* @__PURE__ */ T(ie, {
|
|
1523
|
+
x: Y(P.timestamp),
|
|
1483
1524
|
top: 12,
|
|
1484
1525
|
bottom: L,
|
|
1485
|
-
width: Math.min(16, (
|
|
1526
|
+
width: Math.min(16, (J - q) / 2)
|
|
1486
1527
|
})
|
|
1487
1528
|
]
|
|
1488
1529
|
}), /* @__PURE__ */ E("div", {
|
|
1489
1530
|
"aria-hidden": !0,
|
|
1490
|
-
...b.props(
|
|
1531
|
+
...b.props(Ee.timeAxis, Ee.timeAxisInset(q, Math.max(0, j - J))),
|
|
1491
1532
|
children: [/* @__PURE__ */ T("span", {
|
|
1492
1533
|
className: "x1cqoux5 xeuugli xj0a0fe",
|
|
1493
1534
|
children: i(R)
|
|
@@ -1511,4 +1552,4 @@ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimes
|
|
|
1511
1552
|
})
|
|
1512
1553
|
});
|
|
1513
1554
|
}
|
|
1514
|
-
export {
|
|
1555
|
+
export { Oe as AreaChart, me as BarChart, I as BarChartPlaceholder, V as BreakdownBar, De as LineChart, K as MAX_SCATTER_POINTS, Y as ScatterPlot, Ae as SmallMultiples, we as Sparkline, ke as TimeSeriesChartPlaceholder, $ as timeSeriesLimits };
|