@mechane-ai/elements 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -18
- package/bin/mechane-elements-catalog.mjs +42 -4
- package/dist/ai.js +268 -202
- package/dist/catalog.json +91 -31
- package/dist/categorical-values-BXi-rJuv.js +74 -0
- package/dist/chart-cursor-1mFd48Jc.js +23 -0
- package/dist/chart-data-CIJVWCYt.js +21 -0
- package/dist/{chart-frame-Ztktqs1b.js → chart-frame-BaxKn_MB.js} +22 -41
- package/dist/{chart-input-BO3BqlFO.js → chart-input-Bm82_9Rd.js} +2 -2
- package/dist/chart-theme-4zprJ3rW.js +404 -0
- package/dist/charts/cartesian.js +1598 -1432
- package/dist/charts/distribution.js +476 -404
- package/dist/charts/graph.js +363 -349
- package/dist/charts/hierarchy.js +103 -94
- package/dist/charts/matrix.js +340 -333
- package/dist/charts/timeline.js +167 -134
- package/dist/charts.js +3 -3
- package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
- package/dist/collections.js +1648 -1188
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +67 -66
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/csp.js +6 -11
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +274 -214
- package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
- package/dist/forms.js +3 -3
- package/dist/index.js +1 -1
- package/dist/layout.js +207 -207
- package/dist/navigation.js +4 -3
- package/dist/packages/ai/src/conversation.d.ts +2 -0
- package/dist/packages/ai/src/prompt-input.d.ts +7 -2
- package/dist/packages/charts/src/cartesian/composition-bars.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/index.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +8 -2
- package/dist/packages/charts/src/cartesian/time-series.d.ts +11 -1
- package/dist/packages/charts/src/categorical-values.d.ts +14 -9
- package/dist/packages/charts/src/chart-frame.d.ts +7 -9
- package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
- package/dist/packages/charts/src/chart-range.d.ts +33 -0
- package/dist/packages/charts/src/chart-rows.d.ts +20 -0
- package/dist/packages/charts/src/chart-theme.d.ts +17 -0
- package/dist/packages/charts/src/chart.d.ts +81 -0
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +4 -4
- package/dist/packages/charts/src/index.d.ts +1 -0
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +3 -3
- package/dist/packages/charts/src/plot-width.d.ts +0 -1
- package/dist/packages/charts/src/timeline/index.d.ts +1 -1
- package/dist/packages/charts/src/timeline/waterfall.d.ts +6 -2
- package/dist/packages/collections/src/collection-controls.d.ts +5 -1
- package/dist/packages/collections/src/collection-filters.d.ts +4 -1
- package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
- package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
- package/dist/packages/collections/src/data-table-text.d.ts +13 -0
- package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
- package/dist/packages/collections/src/data-table.d.ts +3 -85
- package/dist/packages/collections/src/index.d.ts +11 -6
- package/dist/packages/collections/src/query-controls.d.ts +6 -2
- package/dist/packages/collections/src/table-results.d.ts +47 -13
- package/dist/packages/collections/src/timeline.d.ts +1 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
- package/dist/packages/collections/src/use-table-window.d.ts +25 -0
- package/dist/packages/content/src/viewer.d.ts +8 -0
- package/dist/packages/core/src/disclosure.d.ts +9 -1
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/route-link.d.ts +11 -0
- package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
- package/dist/packages/forms/src/file-picker.d.ts +15 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -6
- package/dist/packages/forms/src/forms.d.ts +4 -1
- package/dist/packages/forms/src/index.d.ts +4 -2
- package/dist/packages/forms/src/selection.d.ts +14 -0
- package/dist/packages/foundations/src/csp/index.d.ts +1 -1
- package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
- package/dist/packages/navigation/src/index.d.ts +1 -1
- package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
- package/dist/plot-width-v2c_rA20.js +63 -0
- package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
- package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
- package/dist/src-CGc_hjxJ.js +409 -0
- package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
- package/dist/{src-Dcs3SZ9V.js → src-DVHlknB6.js} +1 -1
- package/dist/styles2.css +136 -114
- package/package.json +1 -4
- package/skills/extend-elements/SKILL.md +74 -0
- package/skills/review-elements/SKILL.md +76 -0
- package/skills/upgrade-elements/SKILL.md +34 -0
- package/skills/upgrade-elements/references/releases.md +58 -0
- package/skills/use-elements/SKILL.md +64 -13
- package/skills/use-elements/references/agent.md +57 -0
- package/skills/use-elements/references/charts.md +63 -0
- package/skills/use-elements/references/collections.md +89 -0
- package/skills/use-elements/references/conversations.md +47 -0
- package/skills/use-elements/references/forms.md +81 -0
- package/skills/use-elements/references/styling.md +70 -0
- package/skills/use-elements/references/workspace.md +3 -3
- package/dist/categorical-values-DZLGQVW1.js +0 -63
- package/dist/chart-navigation-BAbb5PV9.js +0 -154
- package/dist/header-styles-COxCYFZx.js +0 -90
- package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
- package/dist/packages/charts/src/chart-surface.d.ts +0 -27
- package/dist/packages/navigation/src/route-link.d.ts +0 -2
- package/dist/plot-width-CIqBiHcd.js +0 -105
- package/dist/src-Bk7M67zy.js +0 -396
package/dist/charts/cartesian.js
CHANGED
|
@@ -1,49 +1,31 @@
|
|
|
1
|
-
import { c as e, f as t, l as n, p as r } from "../src-
|
|
2
|
-
import { i,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { r as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return /* @__PURE__ */ k("g", {
|
|
21
|
-
"aria-hidden": !0,
|
|
22
|
-
className: "xlshs6z xgs60n x17y187c xbabvq0 x47corl",
|
|
23
|
-
children: [/* @__PURE__ */ O("line", {
|
|
24
|
-
x1: e,
|
|
25
|
-
x2: e,
|
|
26
|
-
y1: t,
|
|
27
|
-
y2: n,
|
|
28
|
-
className: "xnpr05h x1ntoi03 x13efnbd"
|
|
29
|
-
}), /* @__PURE__ */ O("line", {
|
|
30
|
-
x1: e - r / 2,
|
|
31
|
-
x2: e + r / 2,
|
|
32
|
-
y1: n + 4,
|
|
33
|
-
y2: n + 4,
|
|
34
|
-
className: "xzly4p3 x13efnbd"
|
|
35
|
-
})]
|
|
36
|
-
});
|
|
37
|
-
}
|
|
1
|
+
import { c as e, f as t, l as n, p as r } from "../src-DVHlknB6.js";
|
|
2
|
+
import { a as i, i as a, n as o, r as s, t as c } from "../categorical-values-BXi-rJuv.js";
|
|
3
|
+
import { t as l } from "../chart-cursor-1mFd48Jc.js";
|
|
4
|
+
import { t as u } from "../chart-data-CIJVWCYt.js";
|
|
5
|
+
import { i as d, r as f, t as p } from "../chart-frame-BaxKn_MB.js";
|
|
6
|
+
import { n as m, r as h, t as g } from "../chart-input-Bm82_9Rd.js";
|
|
7
|
+
import { r as _ } from "../tokens.stylex-dF5CACEJ.js";
|
|
8
|
+
import { a as v, c as y, i as b, l as ee, n as x, r as S, s as C, t as w } from "../chart-theme-4zprJ3rW.js";
|
|
9
|
+
import { t as T } from "../plot-width-v2c_rA20.js";
|
|
10
|
+
import { t as E } from "../label-spacing-BncjePGb.js";
|
|
11
|
+
import { k as D } from "../src-CpdJlDhO.js";
|
|
12
|
+
import { g as O } from "../src-1EHkSFS-.js";
|
|
13
|
+
import * as k from "@stylexjs/stylex";
|
|
14
|
+
import { createParts as A } from "@ui-sdk/react/primitive";
|
|
15
|
+
import { useEffect as j, useId as M, useMemo as N, useRef as P, useState as F } from "react";
|
|
16
|
+
import { bindDrag as I, createChange as L, createSpans as R, definePrimitive as te, dispatch as ne } from "@ui-sdk/core";
|
|
17
|
+
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
18
|
+
import { scaleBand as re, scaleLinear as H } from "@visx/scale";
|
|
19
|
+
import { Area as ie, AreaClosed as ae, Bar as oe, LinePath as se } from "@visx/shape";
|
|
38
20
|
// packages/charts/src/chart-inspection.tsx
|
|
39
|
-
var
|
|
21
|
+
var U = {
|
|
40
22
|
kzqmXN: "x1xc55vz",
|
|
41
23
|
kZKoxP: "xdk7pt",
|
|
42
24
|
kmuXW: "x2lah0s",
|
|
43
25
|
$$css: !0
|
|
44
|
-
},
|
|
26
|
+
}, W = {
|
|
45
27
|
swatch: (e) => [
|
|
46
|
-
|
|
28
|
+
U,
|
|
47
29
|
{
|
|
48
30
|
kWkggS: e == null ? e : "xl8spv7",
|
|
49
31
|
$$css: !0
|
|
@@ -83,45 +65,45 @@ var F = {
|
|
|
83
65
|
"--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
|
|
84
66
|
"--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
85
67
|
}]
|
|
86
|
-
},
|
|
87
|
-
function
|
|
88
|
-
return /* @__PURE__ */
|
|
68
|
+
}, G = 4;
|
|
69
|
+
function K() {
|
|
70
|
+
return /* @__PURE__ */ B("ul", {
|
|
89
71
|
"aria-hidden": !0,
|
|
90
72
|
inert: !0,
|
|
91
73
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k",
|
|
92
|
-
children: Array.from({ length:
|
|
74
|
+
children: Array.from({ length: G }, (e, t) => /* @__PURE__ */ V("li", {
|
|
93
75
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe x1f394nn x43dure",
|
|
94
|
-
children: [/* @__PURE__ */
|
|
76
|
+
children: [/* @__PURE__ */ B("span", { ...k.props(W.swatch(_.line)) }), /* @__PURE__ */ V("span", {
|
|
95
77
|
className: "x1cqoux5 xeuugli",
|
|
96
78
|
children: [
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ B(r, {}),
|
|
80
|
+
/* @__PURE__ */ B("span", {
|
|
99
81
|
className: "x1s85apg xannxpe",
|
|
100
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ B(r, {})
|
|
101
83
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ B("span", {
|
|
103
85
|
className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
|
|
104
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ B(r, {})
|
|
105
87
|
})
|
|
106
88
|
]
|
|
107
89
|
})]
|
|
108
90
|
}, t))
|
|
109
91
|
});
|
|
110
92
|
}
|
|
111
|
-
function
|
|
112
|
-
return t === void 0 ? e : /* @__PURE__ */
|
|
93
|
+
function ce({ title: e, detail: t }) {
|
|
94
|
+
return t === void 0 ? e : /* @__PURE__ */ V("span", {
|
|
113
95
|
"aria-label": e,
|
|
114
96
|
className: "x1lliihq xb3r6kr xlyipyv xuxw1ft",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ B("span", {
|
|
116
98
|
className: "xt0psk2 x1boff50",
|
|
117
99
|
children: e
|
|
118
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ B("span", {
|
|
119
101
|
className: "x1s85apg xfodcyb",
|
|
120
102
|
children: t
|
|
121
103
|
})]
|
|
122
104
|
});
|
|
123
105
|
}
|
|
124
|
-
function
|
|
106
|
+
function le({ label: e, summary: t, rows: n, notes: r = [] }) {
|
|
125
107
|
if (e !== void 0) return [
|
|
126
108
|
e,
|
|
127
109
|
t,
|
|
@@ -129,38 +111,38 @@ function de({ label: e, summary: t, rows: n, notes: r = [] }) {
|
|
|
129
111
|
...r
|
|
130
112
|
].filter((e) => e !== void 0).join(" · ");
|
|
131
113
|
}
|
|
132
|
-
function
|
|
133
|
-
let
|
|
134
|
-
return /* @__PURE__ */
|
|
114
|
+
function ue({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, notes: l = [], hasSeriesSummary: u = !1, hasLegend: f = !0 }) {
|
|
115
|
+
let p = f && !u, m = Math.min(260, s), h = o > s / 2 ? o - m - c : o + c, g = Math.max(0, Math.min(s - m, h));
|
|
116
|
+
return /* @__PURE__ */ V("div", {
|
|
135
117
|
className: "xeuugli",
|
|
136
118
|
children: [
|
|
137
|
-
|
|
119
|
+
p && /* @__PURE__ */ V("div", {
|
|
138
120
|
className: "xrvj5dj xeuugli",
|
|
139
|
-
children: [i !== void 0 && /* @__PURE__ */
|
|
121
|
+
children: [i !== void 0 && /* @__PURE__ */ B("ul", {
|
|
140
122
|
"aria-hidden": !0,
|
|
141
123
|
inert: !0,
|
|
142
124
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc xlshs6z x47corl",
|
|
143
|
-
children: i.map((e) => /* @__PURE__ */
|
|
125
|
+
children: i.map((e) => /* @__PURE__ */ V("li", {
|
|
144
126
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ B(d, {
|
|
146
128
|
tone: e.tone,
|
|
147
129
|
shape: e.shape
|
|
148
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ V("span", {
|
|
149
131
|
className: "xeuugli",
|
|
150
|
-
children: [e.label, /* @__PURE__ */
|
|
132
|
+
children: [e.label, /* @__PURE__ */ B("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
|
|
151
133
|
})]
|
|
152
134
|
}, e.id))
|
|
153
|
-
}), /* @__PURE__ */
|
|
135
|
+
}), /* @__PURE__ */ B("ul", {
|
|
154
136
|
"aria-label": "Legend",
|
|
155
137
|
className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc",
|
|
156
|
-
children: r.map((e) => /* @__PURE__ */
|
|
138
|
+
children: r.map((e) => /* @__PURE__ */ V("li", {
|
|
157
139
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
158
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ B(d, {
|
|
159
141
|
tone: e.tone,
|
|
160
142
|
shape: e.shape
|
|
161
|
-
}), /* @__PURE__ */
|
|
143
|
+
}), /* @__PURE__ */ V("span", {
|
|
162
144
|
className: "xeuugli",
|
|
163
|
-
children: [e.label, /* @__PURE__ */
|
|
145
|
+
children: [e.label, /* @__PURE__ */ B("span", {
|
|
164
146
|
className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
|
|
165
147
|
children: t === void 0 ? "" : a.find((t) => t.id === e.id)?.value ?? "—"
|
|
166
148
|
})]
|
|
@@ -168,44 +150,43 @@ function fe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
|
|
|
168
150
|
}, e.id))
|
|
169
151
|
})]
|
|
170
152
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ B("span", {
|
|
172
154
|
id: e,
|
|
173
|
-
"aria-live": l === "keyboard" ? "polite" : "off",
|
|
174
155
|
className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xb3r6kr x1hyvwdk xuxw1ft",
|
|
175
|
-
children:
|
|
156
|
+
children: le({
|
|
176
157
|
label: t,
|
|
177
158
|
summary: n,
|
|
178
159
|
rows: a,
|
|
179
|
-
notes:
|
|
160
|
+
notes: l
|
|
180
161
|
})
|
|
181
162
|
}),
|
|
182
|
-
t !== void 0 && /* @__PURE__ */
|
|
163
|
+
t !== void 0 && /* @__PURE__ */ B("div", {
|
|
183
164
|
"aria-hidden": !0,
|
|
184
165
|
className: "x1n2onr6 xqtp20y x1vjfegm",
|
|
185
|
-
children: /* @__PURE__ */
|
|
186
|
-
...
|
|
166
|
+
children: /* @__PURE__ */ V("div", {
|
|
167
|
+
...k.props(W.inspector, !p && W.summaryInspector, W.position(g, m)),
|
|
187
168
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ V("div", {
|
|
189
170
|
className: "x78zum5 x1qughib x1hnptsi xk4h15q",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ B("span", { children: t }), n !== void 0 && /* @__PURE__ */ B("span", { children: n })]
|
|
191
172
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ B("dl", {
|
|
193
174
|
className: "xrvj5dj xunmzkg x1ghz6dp",
|
|
194
|
-
children: a.map((e) => /* @__PURE__ */
|
|
175
|
+
children: a.map((e) => /* @__PURE__ */ V("div", {
|
|
195
176
|
className: "x78zum5 x1qughib x1pha0wt x1hnptsi",
|
|
196
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ V("dt", {
|
|
197
178
|
className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ B(d, {
|
|
199
180
|
tone: e.tone,
|
|
200
181
|
shape: e.shape
|
|
201
182
|
}), e.label]
|
|
202
|
-
}), /* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ B("dd", {
|
|
203
184
|
className: "x1ghz6dp xuxw1ft",
|
|
204
185
|
children: e.value
|
|
205
186
|
})]
|
|
206
187
|
}, e.id))
|
|
207
188
|
}),
|
|
208
|
-
|
|
189
|
+
l.map((e) => /* @__PURE__ */ B("span", { children: e }, e))
|
|
209
190
|
]
|
|
210
191
|
})
|
|
211
192
|
})
|
|
@@ -213,7 +194,7 @@ function fe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
|
|
|
213
194
|
});
|
|
214
195
|
}
|
|
215
196
|
// packages/charts/src/cartesian/bar-data.ts
|
|
216
|
-
function
|
|
197
|
+
function de({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
217
198
|
if (e === void 0) return;
|
|
218
199
|
if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
|
|
219
200
|
let i = e.annotation;
|
|
@@ -230,26 +211,26 @@ function I({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
|
230
211
|
}
|
|
231
212
|
}
|
|
232
213
|
}
|
|
233
|
-
var
|
|
234
|
-
function
|
|
214
|
+
var q = 6;
|
|
215
|
+
function fe(e, t) {
|
|
235
216
|
return e === null ? !0 : e === void 0 || !Number.isFinite(e) ? !1 : e >= t[0] && e <= t[1];
|
|
236
217
|
}
|
|
237
|
-
function
|
|
218
|
+
function J({ marker: e, categoryCount: t, domain: n }) {
|
|
238
219
|
let r = e.kind === "tick" ? [e.values] : [e.lower, e.upper];
|
|
239
220
|
if (r.some((e) => e.length !== t)) return "Every bar marker requires one explicit value per category.";
|
|
240
|
-
if (r.some((e) => e.some((e) => !
|
|
221
|
+
if (r.some((e) => e.some((e) => !fe(e, n)))) return "Bar marker values must be finite and within the supplied domain.";
|
|
241
222
|
if (e.kind === "range") for (let [t, n] of e.lower.entries()) {
|
|
242
223
|
let r = e.upper[t] ?? null;
|
|
243
224
|
if (n === null != (r === null) || n !== null && r !== null && n > r) return "A range marker needs both bounds, with the lower bound at most the upper bound, or neither.";
|
|
244
225
|
}
|
|
245
226
|
}
|
|
246
|
-
function
|
|
247
|
-
if (e.length >
|
|
227
|
+
function Y({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r, categoryIds: i, domain: a }) {
|
|
228
|
+
if (e.length > q) return `Supply at most ${q} bar markers.`;
|
|
248
229
|
let o = [...e, ...t];
|
|
249
230
|
if (new Set(o.map((e) => e.id)).size !== o.length || r.some((e) => o.some((t) => t.id === e))) return "Bar series, markers, and annotations require distinct identifiers.";
|
|
250
231
|
for (let t of e) {
|
|
251
232
|
if (!r.includes(t.seriesId)) return "Each bar marker must refer to a supplied series.";
|
|
252
|
-
let e =
|
|
233
|
+
let e = J({
|
|
253
234
|
marker: t,
|
|
254
235
|
categoryCount: i.length,
|
|
255
236
|
domain: a
|
|
@@ -263,7 +244,7 @@ function z({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r,
|
|
|
263
244
|
if (new Set(t.map((e) => JSON.stringify([e.categoryId, e.seriesId ?? null]))).size !== t.length) return "Each bar can hold one annotation.";
|
|
264
245
|
if (new Set(n).size !== n.length || n.some((e) => !i.includes(e))) return "Emphasized categories must be unique supplied categories.";
|
|
265
246
|
}
|
|
266
|
-
function
|
|
247
|
+
function pe({ marker: e, index: t, formatValue: n }) {
|
|
267
248
|
if (e.kind === "tick") {
|
|
268
249
|
let r = e.values[t] ?? null;
|
|
269
250
|
return r === null ? "Unavailable" : n(r);
|
|
@@ -275,149 +256,149 @@ function me(e, t) {
|
|
|
275
256
|
return e.kind === "tick" ? e.values[t] ?? null : e.upper[t] ?? null;
|
|
276
257
|
}
|
|
277
258
|
// packages/charts/src/cartesian/bar-overlays.tsx
|
|
278
|
-
var
|
|
259
|
+
var he = {
|
|
279
260
|
kU5bRw: "x5lxx2x",
|
|
280
261
|
kREpy8: "x13efnbd",
|
|
281
262
|
$$css: !0
|
|
282
|
-
},
|
|
283
|
-
|
|
263
|
+
}, ge = { stroke: (e) => [
|
|
264
|
+
he,
|
|
284
265
|
{
|
|
285
266
|
kjVXCG: e == null ? e : "x6mkzkt",
|
|
286
267
|
$$css: !0
|
|
287
268
|
},
|
|
288
269
|
{ "--x-stroke": e ?? void 0 }
|
|
289
|
-
] },
|
|
290
|
-
function
|
|
291
|
-
return /* @__PURE__ */
|
|
270
|
+
] }, _e = 3, X = 1, ve = 1.5, Z = 3, ye = 14, be = 6.5;
|
|
271
|
+
function Q({ path: e, color: t, width: n }) {
|
|
272
|
+
return /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("path", {
|
|
292
273
|
d: e,
|
|
293
274
|
strokeWidth: n + 4,
|
|
294
275
|
className: "xaep1og x5lxx2x x13efnbd"
|
|
295
|
-
}), /* @__PURE__ */
|
|
276
|
+
}), /* @__PURE__ */ B("path", {
|
|
296
277
|
d: e,
|
|
297
278
|
strokeWidth: n,
|
|
298
|
-
...
|
|
279
|
+
...k.props(ge.stroke(t))
|
|
299
280
|
})] });
|
|
300
281
|
}
|
|
301
|
-
function
|
|
282
|
+
function xe({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
302
283
|
let a = e.kind === "tick" ? e.values[t] ?? null : null;
|
|
303
284
|
if (a !== null && r !== null && a !== r) return `M${n.x + n.width / 2},${i(r)} V${i(a)}`;
|
|
304
285
|
}
|
|
305
|
-
function
|
|
286
|
+
function Se({ marker: e, index: t, span: n, y: r }) {
|
|
306
287
|
if (e.kind === "tick") {
|
|
307
288
|
let i = e.values[t] ?? null;
|
|
308
289
|
if (i === null) return;
|
|
309
290
|
let a = r(i);
|
|
310
|
-
return `M${n.x -
|
|
291
|
+
return `M${n.x - Z},${a} H${n.x + n.width + Z}`;
|
|
311
292
|
}
|
|
312
293
|
let i = e.lower[t] ?? null, a = e.upper[t] ?? null;
|
|
313
294
|
if (i === null || a === null) return;
|
|
314
|
-
let o = n.x + n.width / 2, s = Math.min(
|
|
295
|
+
let o = n.x + n.width / 2, s = Math.min(ye, n.width * .6) / 2, c = r(i), l = r(a);
|
|
315
296
|
return `M${o - s},${l} H${o + s} M${o},${l} V${c} M${o - s},${c} H${o + s}`;
|
|
316
297
|
}
|
|
317
|
-
function
|
|
318
|
-
return /* @__PURE__ */
|
|
319
|
-
let c = r(n, t.seriesId), l =
|
|
298
|
+
function Ce({ markers: t, categoryIds: n, span: r, barTop: i, y: a, isReceded: o }) {
|
|
299
|
+
return /* @__PURE__ */ B("g", { children: t.map((t) => /* @__PURE__ */ B("g", { children: n.map((n, s) => {
|
|
300
|
+
let c = r(n, t.seriesId), l = Se({
|
|
320
301
|
marker: t,
|
|
321
302
|
index: s,
|
|
322
303
|
span: c,
|
|
323
304
|
y: a
|
|
324
305
|
});
|
|
325
306
|
if (l === void 0) return null;
|
|
326
|
-
let u = e[t.tone ?? "neutral"], d =
|
|
307
|
+
let u = e[t.tone ?? "neutral"], d = xe({
|
|
327
308
|
marker: t,
|
|
328
309
|
index: s,
|
|
329
310
|
span: c,
|
|
330
311
|
base: i(s, t.seriesId),
|
|
331
312
|
y: a
|
|
332
313
|
});
|
|
333
|
-
return /* @__PURE__ */
|
|
334
|
-
...
|
|
335
|
-
children: [d !== void 0 && /* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ V("g", {
|
|
315
|
+
...k.props(w.emphasis, o(n) && w.receded),
|
|
316
|
+
children: [d !== void 0 && /* @__PURE__ */ B(Q, {
|
|
336
317
|
path: d,
|
|
337
318
|
color: u,
|
|
338
|
-
width:
|
|
339
|
-
}), /* @__PURE__ */
|
|
319
|
+
width: X
|
|
320
|
+
}), /* @__PURE__ */ B(Q, {
|
|
340
321
|
path: l,
|
|
341
322
|
color: u,
|
|
342
|
-
width: t.kind === "tick" ?
|
|
323
|
+
width: t.kind === "tick" ? _e : ve
|
|
343
324
|
})]
|
|
344
325
|
}, n);
|
|
345
326
|
}) }, t.id)) });
|
|
346
327
|
}
|
|
347
|
-
function
|
|
348
|
-
return /* @__PURE__ */
|
|
328
|
+
function we({ annotations: e, left: t, right: n }) {
|
|
329
|
+
return /* @__PURE__ */ B("g", {
|
|
349
330
|
"aria-hidden": !0,
|
|
350
331
|
children: e.map((e) => {
|
|
351
|
-
let r = e.label.length *
|
|
352
|
-
return /* @__PURE__ */
|
|
332
|
+
let r = e.label.length * be / 2, i = e.x - r < t, a = e.x + r > n, o = i ? "start" : a ? "end" : "middle", s = i ? t : a ? n : e.x;
|
|
333
|
+
return /* @__PURE__ */ B("text", {
|
|
353
334
|
x: s,
|
|
354
335
|
y: e.y,
|
|
355
336
|
textAnchor: o,
|
|
356
|
-
...
|
|
337
|
+
...k.props(w.label, w.strongLabel, w.haloLabel, w.emphasis, e.isReceded && w.receded),
|
|
357
338
|
children: e.label
|
|
358
339
|
}, e.id);
|
|
359
340
|
})
|
|
360
341
|
});
|
|
361
342
|
}
|
|
362
343
|
// packages/charts/src/cartesian/composition-bars.tsx
|
|
363
|
-
var
|
|
344
|
+
var Te = { mark: {
|
|
364
345
|
k3nNDw: "x1hj3fc7",
|
|
365
346
|
k1ekBW: "xwcsmn1",
|
|
366
347
|
kIyJzY: "xtitasy x12w9bfk",
|
|
367
348
|
kAMwcw: "x1faw7qm",
|
|
368
349
|
$$css: !0
|
|
369
350
|
} };
|
|
370
|
-
function
|
|
351
|
+
function Ee({ bucket: t, series: r, focusedSeries: i, index: o, x: s, width: c, y: l, isSelected: u, highlightedSeriesId: d }) {
|
|
371
352
|
let f = i !== void 0, p = i !== void 0 && !r.some((e) => e.id === i.id) ? [...r, i] : r;
|
|
372
353
|
function m(e, t) {
|
|
373
354
|
let n = l(t), r = l(t + e);
|
|
374
355
|
return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
|
|
375
356
|
}
|
|
376
|
-
return /* @__PURE__ */
|
|
357
|
+
return /* @__PURE__ */ V(z, { children: [t.kind !== "gap" && /* @__PURE__ */ B("rect", {
|
|
377
358
|
x: s,
|
|
378
359
|
y: 0,
|
|
379
360
|
width: c,
|
|
380
361
|
height: 1,
|
|
381
362
|
vectorEffect: "non-scaling-stroke",
|
|
382
363
|
fill: e.neutral,
|
|
383
|
-
...
|
|
364
|
+
...k.props(Te.mark, u && w.selected),
|
|
384
365
|
style: {
|
|
385
366
|
transform: m(t.total, 0),
|
|
386
367
|
opacity: f ? .18 : +(t.kind === "total")
|
|
387
368
|
}
|
|
388
369
|
}), p.map((l, p) => {
|
|
389
|
-
let h = l.values[
|
|
370
|
+
let h = l.values[o];
|
|
390
371
|
if (h == null) return null;
|
|
391
|
-
let g = i?.id === l.id, _ = f ? 0 : r.slice(0, p).reduce((e, t) => e + (t.values[
|
|
392
|
-
return /* @__PURE__ */
|
|
372
|
+
let g = i?.id === l.id, _ = f ? 0 : r.slice(0, p).reduce((e, t) => e + (t.values[o] ?? 0), 0), v = f ? g : t.kind === "parts", y = !f && d !== void 0 && d !== l.id;
|
|
373
|
+
return /* @__PURE__ */ B("rect", {
|
|
393
374
|
x: s,
|
|
394
375
|
y: 0,
|
|
395
376
|
width: c,
|
|
396
377
|
height: 1,
|
|
397
378
|
vectorEffect: "non-scaling-stroke",
|
|
398
|
-
fill: e[
|
|
399
|
-
stroke: n[
|
|
400
|
-
...
|
|
379
|
+
fill: e[a(l.tone, p)],
|
|
380
|
+
stroke: n[a(l.tone, p)],
|
|
381
|
+
...k.props(Te.mark, w.outlined, u && w.selected),
|
|
401
382
|
style: {
|
|
402
383
|
transform: m(h, _),
|
|
403
|
-
opacity: v ?
|
|
384
|
+
opacity: v ? y ? .3 : 1 : 0
|
|
404
385
|
}
|
|
405
386
|
}, l.id);
|
|
406
387
|
})] });
|
|
407
388
|
}
|
|
408
389
|
// packages/charts/src/cartesian/reference-lines.tsx
|
|
409
|
-
var
|
|
390
|
+
var De = {
|
|
410
391
|
kfJifR: "xhr4kjn",
|
|
411
392
|
k5rJSQ: "x1dz65qj",
|
|
412
393
|
kREpy8: "x13efnbd",
|
|
413
394
|
$$css: !0
|
|
414
|
-
},
|
|
395
|
+
}, Oe = {
|
|
415
396
|
kfJifR: "xnpr05h",
|
|
416
397
|
kREpy8: "x13efnbd",
|
|
417
398
|
$$css: !0
|
|
418
|
-
},
|
|
399
|
+
}, ke = {
|
|
419
400
|
line: (e) => [
|
|
420
|
-
|
|
401
|
+
De,
|
|
421
402
|
{
|
|
422
403
|
kjVXCG: e == null ? e : "x6mkzkt",
|
|
423
404
|
$$css: !0
|
|
@@ -425,80 +406,80 @@ var we = {
|
|
|
425
406
|
{ "--x-stroke": e ?? void 0 }
|
|
426
407
|
],
|
|
427
408
|
leader: (e) => [
|
|
428
|
-
|
|
409
|
+
Oe,
|
|
429
410
|
{
|
|
430
411
|
kjVXCG: e == null ? e : "x6mkzkt",
|
|
431
412
|
$$css: !0
|
|
432
413
|
},
|
|
433
414
|
{ "--x-stroke": e ?? void 0 }
|
|
434
415
|
]
|
|
435
|
-
},
|
|
436
|
-
function
|
|
437
|
-
if (e.length >
|
|
438
|
-
if (!
|
|
416
|
+
}, Ae = 30, je = 13, Me = 8, Ne = 4, Pe = 6.5, Fe = 40, Ie = 112, Le = 16, Re = 8;
|
|
417
|
+
function ze({ lines: e, domain: t }) {
|
|
418
|
+
if (e.length > Re) return `Supply at most ${Re} reference lines.`;
|
|
419
|
+
if (!m(e)) return "Reference lines require unique identifiers.";
|
|
439
420
|
for (let n of e) if (!(Number.isFinite(n.value) && n.value >= t[0] && n.value <= t[1]) || n.label.trim() === "") return "Each reference line needs a label and a finite value inside the value domain.";
|
|
440
421
|
}
|
|
441
|
-
function
|
|
442
|
-
return e.length >
|
|
422
|
+
function Be(e) {
|
|
423
|
+
return e.length > Le ? `${e.slice(0, 15)}…` : e;
|
|
443
424
|
}
|
|
444
|
-
function
|
|
425
|
+
function Ve({ lines: e, formatValue: t }) {
|
|
445
426
|
if (e.length === 0) return 0;
|
|
446
|
-
let n = Math.max(...e.map((e) => Math.max(
|
|
447
|
-
return Math.min(
|
|
427
|
+
let n = Math.max(...e.map((e) => Math.max(Be(e.label).length, t(e.value).length)));
|
|
428
|
+
return Math.min(Ie, Math.max(Fe, n * Pe)) + Me;
|
|
448
429
|
}
|
|
449
|
-
function
|
|
430
|
+
function He({ lines: e, y: t, top: n, bottom: r }) {
|
|
450
431
|
let i = e.map((e) => ({
|
|
451
432
|
line: e,
|
|
452
433
|
position: t(e.value)
|
|
453
|
-
})).toSorted((e, t) => e.position - t.position), a =
|
|
434
|
+
})).toSorted((e, t) => e.position - t.position), a = E({
|
|
454
435
|
positions: i.map((e) => e.position),
|
|
455
|
-
gap:
|
|
456
|
-
start: n +
|
|
457
|
-
end: r -
|
|
436
|
+
gap: Ae,
|
|
437
|
+
start: n + Ae / 2,
|
|
438
|
+
end: r - Ae / 2
|
|
458
439
|
});
|
|
459
440
|
return i.map((e, t) => ({
|
|
460
441
|
...e,
|
|
461
442
|
center: a[t] ?? e.position
|
|
462
443
|
}));
|
|
463
444
|
}
|
|
464
|
-
function
|
|
465
|
-
return /* @__PURE__ */
|
|
445
|
+
function Ue({ lines: t, y: n, left: r, right: i, top: a, bottom: o, formatValue: s }) {
|
|
446
|
+
return /* @__PURE__ */ B("g", { children: He({
|
|
466
447
|
lines: t,
|
|
467
448
|
y: n,
|
|
468
449
|
top: a,
|
|
469
450
|
bottom: o
|
|
470
451
|
}).map(({ line: t, position: n, center: a }) => {
|
|
471
|
-
let o = e[t.tone ?? "neutral"], c = i +
|
|
472
|
-
return /* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
452
|
+
let o = e[t.tone ?? "neutral"], c = i + Me;
|
|
453
|
+
return /* @__PURE__ */ V("g", { children: [
|
|
454
|
+
/* @__PURE__ */ B("line", {
|
|
474
455
|
x1: r,
|
|
475
456
|
x2: i,
|
|
476
457
|
y1: n,
|
|
477
458
|
y2: n,
|
|
478
|
-
...
|
|
459
|
+
...k.props(ke.line(o))
|
|
479
460
|
}),
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
d: `M${i},${n} L${i +
|
|
461
|
+
/* @__PURE__ */ B("path", {
|
|
462
|
+
d: `M${i},${n} L${i + Ne},${a} H${i + Ne + 1}`,
|
|
482
463
|
fill: "none",
|
|
483
|
-
...
|
|
464
|
+
...k.props(ke.leader(o))
|
|
484
465
|
}),
|
|
485
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ B("text", {
|
|
486
467
|
x: c,
|
|
487
468
|
y: a - 2,
|
|
488
|
-
...
|
|
489
|
-
children:
|
|
469
|
+
...k.props(w.label, w.strongLabel),
|
|
470
|
+
children: Be(t.label)
|
|
490
471
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ B("text", {
|
|
492
473
|
x: c,
|
|
493
|
-
y: a +
|
|
494
|
-
...
|
|
474
|
+
y: a + je - 2,
|
|
475
|
+
...k.props(w.label),
|
|
495
476
|
children: s(t.value)
|
|
496
477
|
})
|
|
497
478
|
] }, t.id);
|
|
498
479
|
}) });
|
|
499
480
|
}
|
|
500
481
|
// packages/charts/src/cartesian/bar-chart.tsx
|
|
501
|
-
var
|
|
482
|
+
var We = {
|
|
502
483
|
plot: {
|
|
503
484
|
kqGvvJ: "x1we84gm",
|
|
504
485
|
$$css: !0
|
|
@@ -507,19 +488,20 @@ var Fe = {
|
|
|
507
488
|
kSiTet: "xuzhngd",
|
|
508
489
|
$$css: !0
|
|
509
490
|
}
|
|
510
|
-
},
|
|
511
|
-
function
|
|
491
|
+
}, Ge = 200, Ke = 12, qe = 30, Je = 8, Ye = 14;
|
|
492
|
+
function Xe({ title: e, description: t, report: n, series: r, layoutSeries: i, markerLegend: o = [], notes: s, children: c, inspectionId: l, label: d, detail: f, summary: m, rows: h = [], x: g = 0, width: _ = 0, offset: v, figure: y, data: b, isLoading: ee = !1 }) {
|
|
512
493
|
let x = r.map((e, t) => ({
|
|
513
494
|
id: e.id,
|
|
514
495
|
label: e.label,
|
|
515
|
-
tone:
|
|
496
|
+
tone: a(e.tone, t)
|
|
516
497
|
})), S = i?.map((e, t) => ({
|
|
517
498
|
id: e.id,
|
|
518
499
|
label: e.label,
|
|
519
|
-
tone:
|
|
520
|
-
})), C =
|
|
521
|
-
return /* @__PURE__ */
|
|
522
|
-
|
|
500
|
+
tone: a(e.tone, t)
|
|
501
|
+
})), C = ee && r.length === 0 && n?.seriesValues === void 0;
|
|
502
|
+
return /* @__PURE__ */ V(p, {
|
|
503
|
+
figure: y,
|
|
504
|
+
title: /* @__PURE__ */ B(ce, {
|
|
523
505
|
title: e,
|
|
524
506
|
detail: f
|
|
525
507
|
}),
|
|
@@ -527,56 +509,55 @@ function Ve({ title: e, description: t, report: n, series: r, layoutSeries: i, m
|
|
|
527
509
|
report: n,
|
|
528
510
|
series: x,
|
|
529
511
|
children: [
|
|
530
|
-
|
|
531
|
-
C ? /* @__PURE__ */
|
|
532
|
-
id:
|
|
512
|
+
b !== void 0 && /* @__PURE__ */ B(u, { ...b }),
|
|
513
|
+
C ? /* @__PURE__ */ B(K, {}) : /* @__PURE__ */ B(ue, {
|
|
514
|
+
id: l,
|
|
533
515
|
label: d,
|
|
534
|
-
summary:
|
|
535
|
-
legend: [...x, ...
|
|
516
|
+
summary: m,
|
|
517
|
+
legend: [...x, ...o],
|
|
536
518
|
hasSeriesSummary: n?.seriesValues !== void 0,
|
|
537
|
-
layoutLegend: S === void 0 ? void 0 : [...S, ...
|
|
519
|
+
layoutLegend: S === void 0 ? void 0 : [...S, ...o],
|
|
538
520
|
rows: h,
|
|
539
521
|
notes: s,
|
|
540
522
|
x: g,
|
|
541
523
|
width: _,
|
|
542
|
-
offset: v
|
|
543
|
-
source: y
|
|
524
|
+
offset: v
|
|
544
525
|
}),
|
|
545
|
-
|
|
526
|
+
c
|
|
546
527
|
]
|
|
547
528
|
});
|
|
548
529
|
}
|
|
549
|
-
function
|
|
550
|
-
let o =
|
|
551
|
-
return o === void 0 ? /* @__PURE__ */
|
|
530
|
+
function Ze({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = Ge }) {
|
|
531
|
+
let o = Qe(a), s = M();
|
|
532
|
+
return o === void 0 ? /* @__PURE__ */ B("div", {
|
|
552
533
|
"aria-hidden": !0,
|
|
553
534
|
inert: !0,
|
|
554
|
-
children: /* @__PURE__ */
|
|
535
|
+
children: /* @__PURE__ */ B(Xe, {
|
|
555
536
|
title: e,
|
|
556
537
|
description: n,
|
|
557
538
|
report: r,
|
|
558
539
|
series: i,
|
|
559
540
|
inspectionId: s,
|
|
560
541
|
isLoading: !0,
|
|
561
|
-
children: /* @__PURE__ */
|
|
562
|
-
...
|
|
563
|
-
children: /* @__PURE__ */
|
|
542
|
+
children: /* @__PURE__ */ B("div", {
|
|
543
|
+
...k.props(w.plot, We.plot),
|
|
544
|
+
children: /* @__PURE__ */ B(t, { height: a })
|
|
564
545
|
})
|
|
565
546
|
})
|
|
566
|
-
}) : /* @__PURE__ */
|
|
547
|
+
}) : /* @__PURE__ */ B(g, {
|
|
567
548
|
title: e,
|
|
568
549
|
description: n,
|
|
569
550
|
report: r,
|
|
570
551
|
message: o
|
|
571
552
|
});
|
|
572
553
|
}
|
|
573
|
-
function
|
|
554
|
+
function Qe(e) {
|
|
574
555
|
if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
|
|
575
556
|
}
|
|
576
|
-
function
|
|
577
|
-
if (e.length >
|
|
578
|
-
if (!
|
|
579
|
-
if (!
|
|
557
|
+
function $e({ categories: e, series: t, domain: n, mode: r }) {
|
|
558
|
+
if (e.length > s.items || t.length > s.series) return `Choose a window with at most ${s.items} categories and ${s.series} series.`;
|
|
559
|
+
if (!h(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
|
|
560
|
+
if (!m(e) || !m(t)) return "Bar categories and series require unique identifiers.";
|
|
580
561
|
for (let i of t) {
|
|
581
562
|
if (i.values.length !== e.length) return "Every series requires one explicit value per category.";
|
|
582
563
|
for (let e of i.values) {
|
|
@@ -586,357 +567,332 @@ function We({ categories: e, series: t, domain: n, mode: r }) {
|
|
|
586
567
|
}
|
|
587
568
|
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.";
|
|
588
569
|
}
|
|
589
|
-
var
|
|
570
|
+
var et = {
|
|
590
571
|
"x-default-marker": "x-default-marker",
|
|
591
572
|
$$css: !0
|
|
592
573
|
};
|
|
593
|
-
function
|
|
594
|
-
let
|
|
595
|
-
categories:
|
|
596
|
-
series: [
|
|
574
|
+
function tt({ title: t, description: r, report: i, categories: o, series: s, domain: c, mode: u = "grouped", formatValue: d, formatTick: f = d, highlightedSeriesId: p, selection: m, height: h = Ge, composition: _, referenceLines: b = [], markers: S = [], annotations: C = [], emphasizedCategoryIds: E = [] }) {
|
|
575
|
+
let D = _?.focusedSeries, O = M(), A = D === void 0 ? void 0 : $e({
|
|
576
|
+
categories: o,
|
|
577
|
+
series: [D],
|
|
597
578
|
domain: c,
|
|
598
579
|
mode: "grouped"
|
|
599
|
-
}),
|
|
600
|
-
categories:
|
|
580
|
+
}), j = $e({
|
|
581
|
+
categories: o,
|
|
601
582
|
series: s,
|
|
602
583
|
domain: c,
|
|
603
|
-
mode:
|
|
604
|
-
}) ??
|
|
605
|
-
markers:
|
|
606
|
-
annotations:
|
|
607
|
-
emphasizedCategoryIds:
|
|
608
|
-
seriesIds: [...s, ...
|
|
609
|
-
categoryIds:
|
|
584
|
+
mode: u
|
|
585
|
+
}) ?? A, N = o.map((e) => e.id), P = Y({
|
|
586
|
+
markers: S,
|
|
587
|
+
annotations: C,
|
|
588
|
+
emphasizedCategoryIds: E,
|
|
589
|
+
seriesIds: [...s, ...D === void 0 ? [] : [D]].map((e) => e.id),
|
|
590
|
+
categoryIds: N,
|
|
610
591
|
domain: c
|
|
611
|
-
}) ??
|
|
612
|
-
lines:
|
|
592
|
+
}) ?? ze({
|
|
593
|
+
lines: b,
|
|
613
594
|
domain: c
|
|
614
|
-
}),
|
|
615
|
-
composition:
|
|
595
|
+
}), F = de({
|
|
596
|
+
composition: _,
|
|
616
597
|
series: s,
|
|
617
|
-
categoryIds:
|
|
598
|
+
categoryIds: N,
|
|
618
599
|
domain: c
|
|
619
|
-
}) ??
|
|
620
|
-
id:
|
|
621
|
-
label:
|
|
600
|
+
}) ?? P ?? Qe(h), I = j ?? F, L = _ === void 0 ? void 0 : {
|
|
601
|
+
id: O,
|
|
602
|
+
label: _.contextLabel,
|
|
622
603
|
tone: "neutral",
|
|
623
|
-
values:
|
|
624
|
-
},
|
|
625
|
-
|
|
604
|
+
values: _.buckets.map((e) => e.kind === "gap" ? null : e.total)
|
|
605
|
+
}, R = L === void 0 ? s : [
|
|
606
|
+
L,
|
|
626
607
|
...s,
|
|
627
|
-
...
|
|
628
|
-
],
|
|
629
|
-
|
|
630
|
-
function e(e) {
|
|
631
|
-
e.target instanceof Node && fe?.contains(e.target) !== !0 && R(void 0);
|
|
632
|
-
}
|
|
633
|
-
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
634
|
-
}, [fe]);
|
|
635
|
-
let U = a.findIndex((e) => e.id === L?.id), W = a[U], he = a[a.findIndex((e) => e.id === m?.selectedId)], ge = a.find((e) => e.id === V) ?? he ?? a[0], G = W, _e = U, K = g?.buckets[_e], ve = w !== void 0 && F !== void 0 ? [w, F] : F === void 0 || K?.kind === "parts" ? s : [], ye = K === void 0 ? void 0 : K.kind === "gap" ? "No reported value" : d(K.total);
|
|
636
|
-
if (P !== void 0) return /* @__PURE__ */ O(_, {
|
|
608
|
+
...D === void 0 || s.some((e) => e.id === D.id) ? [] : [D]
|
|
609
|
+
], te = D !== void 0 && L !== void 0 ? [D, L] : s, { ref: ne, width: z } = T(), ie = M();
|
|
610
|
+
if (I !== void 0) return /* @__PURE__ */ B(g, {
|
|
637
611
|
title: t,
|
|
638
612
|
description: r,
|
|
639
613
|
report: i,
|
|
640
|
-
message:
|
|
614
|
+
message: I
|
|
641
615
|
});
|
|
642
|
-
|
|
643
|
-
let n = e
|
|
644
|
-
|
|
616
|
+
function ae(e) {
|
|
617
|
+
let t = o[e], n = _?.buckets[e], r = D !== void 0 && L !== void 0 ? [D, L] : L === void 0 || n?.kind === "parts" ? s : [], i = n === void 0 ? void 0 : n.kind === "gap" ? "No reported value" : d(n.total), c = r.map((t, n) => {
|
|
618
|
+
let r = t.values[e];
|
|
619
|
+
return {
|
|
620
|
+
id: t.id,
|
|
621
|
+
label: t.label,
|
|
622
|
+
tone: a(t.tone, n),
|
|
623
|
+
value: r == null ? "Unavailable" : d(r)
|
|
624
|
+
};
|
|
625
|
+
}), l = S.map((t) => ({
|
|
626
|
+
id: t.id,
|
|
627
|
+
label: t.label,
|
|
628
|
+
tone: t.tone ?? "neutral",
|
|
629
|
+
shape: t.kind,
|
|
630
|
+
value: pe({
|
|
631
|
+
marker: t,
|
|
632
|
+
index: e,
|
|
633
|
+
formatValue: d
|
|
634
|
+
})
|
|
635
|
+
})), u = b.map((e) => ({
|
|
645
636
|
id: e.id,
|
|
646
637
|
label: e.label,
|
|
647
|
-
tone:
|
|
648
|
-
|
|
638
|
+
tone: e.tone ?? "neutral",
|
|
639
|
+
shape: "dashed",
|
|
640
|
+
value: d(e.value)
|
|
641
|
+
}));
|
|
642
|
+
return {
|
|
643
|
+
category: t,
|
|
644
|
+
label: t?.label,
|
|
645
|
+
summary: i,
|
|
646
|
+
rows: t === void 0 ? [] : [
|
|
647
|
+
...c,
|
|
648
|
+
...l,
|
|
649
|
+
...u
|
|
650
|
+
],
|
|
651
|
+
notes: C.filter((e) => e.categoryId === t?.id).map((e) => e.label)
|
|
649
652
|
};
|
|
650
|
-
}
|
|
653
|
+
}
|
|
654
|
+
let se = S.map((e) => ({
|
|
651
655
|
id: e.id,
|
|
652
656
|
label: e.label,
|
|
653
657
|
tone: e.tone ?? "neutral",
|
|
654
658
|
shape: e.kind
|
|
655
|
-
})),
|
|
656
|
-
id: e.id,
|
|
657
|
-
label: e.label,
|
|
658
|
-
tone: e.tone ?? "neutral",
|
|
659
|
-
shape: e.kind,
|
|
660
|
-
value: B({
|
|
661
|
-
marker: e,
|
|
662
|
-
index: _e,
|
|
663
|
-
formatValue: d
|
|
664
|
-
})
|
|
665
|
-
})), Ee = v.map((e) => ({
|
|
666
|
-
id: e.id,
|
|
667
|
-
label: e.label,
|
|
668
|
-
tone: e.tone ?? "neutral",
|
|
669
|
-
shape: "dashed",
|
|
670
|
-
value: d(e.value)
|
|
671
|
-
})), De = G === void 0 ? [] : [
|
|
672
|
-
...Se,
|
|
673
|
-
...Te,
|
|
674
|
-
...Ee
|
|
675
|
-
], Oe = x.filter((e) => e.categoryId === G?.id).map((e) => e.label), q = x.length > 0 ? Re : Le, J = h - 28, Y = j({
|
|
659
|
+
})), U = C.length > 0 ? qe : Ke, W = h - 28, G = H({
|
|
676
660
|
domain: [...c],
|
|
677
|
-
range: [
|
|
678
|
-
}),
|
|
679
|
-
lines:
|
|
661
|
+
range: [W, U]
|
|
662
|
+
}), K = Math.max(44, ...G.ticks(3).map((e) => f(e).length * 7 + 12)), ce = Ve({
|
|
663
|
+
lines: b,
|
|
680
664
|
formatValue: f
|
|
681
|
-
}),
|
|
682
|
-
domain:
|
|
683
|
-
range: [
|
|
665
|
+
}), ue = Math.max(K + 1, z - 16 - ce), q = re({
|
|
666
|
+
domain: o.map((e) => e.id),
|
|
667
|
+
range: [K, ue],
|
|
684
668
|
padding: .3
|
|
685
|
-
}),
|
|
669
|
+
}), fe = re({
|
|
686
670
|
domain: s.map((e) => e.id),
|
|
687
|
-
range: [0,
|
|
671
|
+
range: [0, q.bandwidth()],
|
|
688
672
|
padding: .08
|
|
689
|
-
}),
|
|
690
|
-
function
|
|
691
|
-
let n =
|
|
692
|
-
return
|
|
673
|
+
}), J = Math.min(120, Math.max(40, ...o.map((e) => (e.axisLabel ?? e.label).length * 7))), he = Math.max(1, Math.ceil((J + 16) / q.step())), ge = u === "stacked" || _ !== void 0;
|
|
674
|
+
function _e(e, t) {
|
|
675
|
+
let n = q(e) ?? K;
|
|
676
|
+
return ge ? {
|
|
693
677
|
x: n,
|
|
694
|
-
width:
|
|
678
|
+
width: q.bandwidth()
|
|
695
679
|
} : {
|
|
696
|
-
x: n + (
|
|
697
|
-
width:
|
|
680
|
+
x: n + (fe(t) ?? 0),
|
|
681
|
+
width: fe.bandwidth()
|
|
698
682
|
};
|
|
699
683
|
}
|
|
700
|
-
function
|
|
701
|
-
if (!
|
|
684
|
+
function X(e, t) {
|
|
685
|
+
if (!ge) return s.find((e) => e.id === t)?.values[e] ?? null;
|
|
702
686
|
let n = s.flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null));
|
|
703
687
|
return n.length === 0 ? null : n.reduce((e, t) => e + t, 0);
|
|
704
688
|
}
|
|
705
|
-
function
|
|
706
|
-
let t = S.
|
|
707
|
-
return S.length > 0 && !t && W?.id !== e;
|
|
708
|
-
}
|
|
709
|
-
function Ze(e, t) {
|
|
710
|
-
let n = (t === void 0 ? s : s.filter((e) => e.id === t)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), r = Ke ? n.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...n), i = g?.buckets[e], a = i === void 0 || i.kind === "gap" ? 0 : i.total, o = b.filter((e) => t === void 0 || e.seriesId === t).flatMap((t) => [me(t, e)].filter((e) => e !== null));
|
|
689
|
+
function ve(e, t) {
|
|
690
|
+
let n = (t === void 0 ? s : s.filter((e) => e.id === t)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), r = ge ? n.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...n), i = _?.buckets[e], a = i === void 0 || i.kind === "gap" ? 0 : i.total, o = S.filter((e) => t === void 0 || e.seriesId === t).flatMap((t) => [me(t, e)].filter((e) => e !== null));
|
|
711
691
|
return Math.max(0, r, a, ...o);
|
|
712
692
|
}
|
|
713
|
-
let
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
label:
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
tabIndex: 0,
|
|
786
|
-
viewBox: `0 0 ${ue} ${h}`,
|
|
787
|
-
height: h,
|
|
788
|
-
controls: {
|
|
789
|
-
items: a,
|
|
790
|
-
cursor: ge?.id,
|
|
791
|
-
inspected: W?.id,
|
|
792
|
-
selected: he?.id,
|
|
793
|
-
readout: de({
|
|
794
|
-
label: W?.label,
|
|
795
|
-
summary: ye,
|
|
796
|
-
rows: De,
|
|
797
|
-
notes: Oe
|
|
798
|
-
}),
|
|
799
|
-
onInspect: (e) => {
|
|
800
|
-
H(e), R({
|
|
801
|
-
id: e,
|
|
802
|
-
source: "keyboard"
|
|
803
|
-
});
|
|
804
|
-
},
|
|
805
|
-
onDismiss: () => R(void 0),
|
|
806
|
-
onSelect: m?.onSelect
|
|
807
|
-
},
|
|
808
|
-
onFocus: (e) => {
|
|
809
|
-
if (e.currentTarget.matches(":focus-visible")) {
|
|
810
|
-
let e = he ?? a[0];
|
|
811
|
-
H(e?.id), R(e === void 0 ? void 0 : {
|
|
812
|
-
id: e.id,
|
|
813
|
-
source: "keyboard"
|
|
814
|
-
});
|
|
815
|
-
}
|
|
816
|
-
},
|
|
817
|
-
onPointerMove: (e) => {
|
|
818
|
-
e.pointerType === "mouse" && et(e);
|
|
819
|
-
},
|
|
820
|
-
onPointerDown: et,
|
|
821
|
-
onPointerLeave: (e) => {
|
|
822
|
-
e.pointerType === "mouse" && L?.source === "pointer" && R(void 0);
|
|
823
|
-
},
|
|
824
|
-
onBlur: () => R(void 0),
|
|
825
|
-
onClick: () => {
|
|
826
|
-
W !== void 0 && m?.onSelect(W.id);
|
|
693
|
+
let Z = Math.max(1, Math.floor((q.step() * he - 16) / 7));
|
|
694
|
+
return /* @__PURE__ */ B(x, {
|
|
695
|
+
items: o,
|
|
696
|
+
readout: (e) => le(ae(N.indexOf(e))),
|
|
697
|
+
locate: y({
|
|
698
|
+
ids: N,
|
|
699
|
+
start: K,
|
|
700
|
+
step: q.step(),
|
|
701
|
+
width: z
|
|
702
|
+
}),
|
|
703
|
+
selected: m?.selectedId ?? null,
|
|
704
|
+
onSelect: m?.onSelect,
|
|
705
|
+
render: (c, { inspected: g, cursor: y }) => {
|
|
706
|
+
let x = ae(N.indexOf(g ?? ""));
|
|
707
|
+
function T(e) {
|
|
708
|
+
let t = E.includes(e);
|
|
709
|
+
return E.length > 0 && !t && g !== e;
|
|
710
|
+
}
|
|
711
|
+
let O = C.map((e) => {
|
|
712
|
+
let t = ve(N.indexOf(e.categoryId), e.seriesId), n = e.seriesId === void 0 ? {
|
|
713
|
+
x: q(e.categoryId) ?? K,
|
|
714
|
+
width: q.bandwidth()
|
|
715
|
+
} : _e(e.categoryId, e.seriesId);
|
|
716
|
+
return {
|
|
717
|
+
id: e.id,
|
|
718
|
+
label: e.label,
|
|
719
|
+
x: n.x + n.width / 2,
|
|
720
|
+
y: Math.max(Ye, G(t) - Je),
|
|
721
|
+
isReceded: T(e.categoryId)
|
|
722
|
+
};
|
|
723
|
+
});
|
|
724
|
+
return /* @__PURE__ */ B(Xe, {
|
|
725
|
+
figure: c,
|
|
726
|
+
title: t,
|
|
727
|
+
description: r,
|
|
728
|
+
report: i,
|
|
729
|
+
series: te,
|
|
730
|
+
layoutSeries: s,
|
|
731
|
+
markerLegend: se,
|
|
732
|
+
notes: x.notes,
|
|
733
|
+
inspectionId: ie,
|
|
734
|
+
label: x.label,
|
|
735
|
+
detail: x.category === void 0 ? void 0 : [x.category.axisLabel ?? x.category.label, x.summary].filter(Boolean).join(" · "),
|
|
736
|
+
summary: x.summary,
|
|
737
|
+
rows: x.rows,
|
|
738
|
+
x: (q(g ?? "") ?? K) + q.bandwidth() / 2,
|
|
739
|
+
width: z,
|
|
740
|
+
offset: q.bandwidth() / 2 + 8,
|
|
741
|
+
data: {
|
|
742
|
+
label: `${t} observations`,
|
|
743
|
+
columns: [{
|
|
744
|
+
id: "category",
|
|
745
|
+
label: "Category"
|
|
746
|
+
}, {
|
|
747
|
+
id: "value",
|
|
748
|
+
label: "Value"
|
|
749
|
+
}],
|
|
750
|
+
rows: [...o.map((e, t) => ({
|
|
751
|
+
id: e.id,
|
|
752
|
+
values: [e.label, [
|
|
753
|
+
nt(R, t, d),
|
|
754
|
+
...S.map((e) => `${e.label}: ${pe({
|
|
755
|
+
marker: e,
|
|
756
|
+
index: t,
|
|
757
|
+
formatValue: d
|
|
758
|
+
})}`),
|
|
759
|
+
...C.filter((t) => t.categoryId === e.id).map((e) => e.label)
|
|
760
|
+
].join(" · ")]
|
|
761
|
+
})), ...b.map((e) => ({
|
|
762
|
+
id: `reference:${e.id}`,
|
|
763
|
+
values: [e.label, d(e.value)]
|
|
764
|
+
}))]
|
|
827
765
|
},
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
766
|
+
children: /* @__PURE__ */ B("div", {
|
|
767
|
+
ref: ne,
|
|
768
|
+
...k.props(w.plot, We.plot),
|
|
769
|
+
children: o.length === 0 || s.length === 0 && _ === void 0 ? /* @__PURE__ */ B("p", {
|
|
770
|
+
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
771
|
+
children: "No categories"
|
|
772
|
+
}) : /* @__PURE__ */ V(v, {
|
|
773
|
+
role: "img",
|
|
774
|
+
"aria-label": ee({
|
|
775
|
+
title: t,
|
|
776
|
+
marks: "categories",
|
|
777
|
+
isSelectable: m !== void 0
|
|
778
|
+
}),
|
|
779
|
+
"aria-describedby": ie,
|
|
780
|
+
viewBox: `0 0 ${z} ${h}`,
|
|
781
|
+
height: h,
|
|
782
|
+
...k.props(w.svg, w.inspectable, et),
|
|
783
|
+
children: [
|
|
784
|
+
g !== null && /* @__PURE__ */ B("rect", {
|
|
785
|
+
x: (q(g) ?? K) - (q.step() - q.bandwidth()) / 2,
|
|
786
|
+
y: U,
|
|
787
|
+
width: q.step(),
|
|
788
|
+
height: W - U,
|
|
789
|
+
className: "x2wnxhi"
|
|
790
|
+
}),
|
|
791
|
+
G.ticks(3).map((e) => /* @__PURE__ */ V("g", { children: [/* @__PURE__ */ B("line", {
|
|
792
|
+
x1: K,
|
|
793
|
+
x2: ue,
|
|
794
|
+
y1: G(e),
|
|
795
|
+
y2: G(e),
|
|
796
|
+
...k.props(e === 0 ? w.baseline : w.grid)
|
|
797
|
+
}), /* @__PURE__ */ B("text", {
|
|
798
|
+
x: K - 8,
|
|
799
|
+
y: G(e),
|
|
800
|
+
textAnchor: "end",
|
|
801
|
+
dominantBaseline: "middle",
|
|
802
|
+
...k.props(w.label, w.tick),
|
|
803
|
+
children: f(e)
|
|
804
|
+
})] }, e)),
|
|
805
|
+
_?.annotation !== void 0 && o.some((e) => e.id === _.annotation?.categoryId) && /* @__PURE__ */ B("text", {
|
|
806
|
+
x: q(_.annotation.categoryId),
|
|
807
|
+
y: Math.max(U, G(_.annotation.value) - 8),
|
|
808
|
+
...k.props(w.label),
|
|
809
|
+
children: _.annotation.label
|
|
810
|
+
}),
|
|
811
|
+
o.map((t, r) => {
|
|
812
|
+
let i = t.axisLabel ?? t.label, o = _?.buckets[r], c = m?.selectedId === t.id;
|
|
813
|
+
return /* @__PURE__ */ V("g", { children: [/* @__PURE__ */ B("g", {
|
|
814
|
+
...k.props(w.emphasis, T(t.id) && w.receded),
|
|
815
|
+
children: o === void 0 ? s.map((i, o) => {
|
|
816
|
+
let l = i.values[r];
|
|
817
|
+
if (l == null) return null;
|
|
818
|
+
let d = u === "stacked" ? s.slice(0, o).reduce((e, t) => e + (t.values[r] ?? 0), 0) : 0, f = G(d), m = G(d + l);
|
|
819
|
+
return /* @__PURE__ */ B(oe, {
|
|
820
|
+
x: (q(t.id) ?? K) + (u === "stacked" ? 0 : fe(i.id) ?? 0),
|
|
821
|
+
y: Math.min(f, m),
|
|
822
|
+
width: u === "stacked" ? q.bandwidth() : fe.bandwidth(),
|
|
823
|
+
height: Math.max(+(l === 0), Math.abs(m - f)),
|
|
824
|
+
fill: e[a(i.tone, o)],
|
|
825
|
+
stroke: n[a(i.tone, o)],
|
|
826
|
+
...k.props(w.outlined, c && w.selected, p !== void 0 && p !== i.id && We.mutedMark)
|
|
827
|
+
}, i.id);
|
|
828
|
+
}) : /* @__PURE__ */ B(Ee, {
|
|
829
|
+
bucket: o,
|
|
830
|
+
series: s,
|
|
831
|
+
focusedSeries: D,
|
|
832
|
+
index: r,
|
|
833
|
+
x: q(t.id) ?? K,
|
|
834
|
+
width: q.bandwidth(),
|
|
835
|
+
y: G,
|
|
836
|
+
isSelected: c,
|
|
837
|
+
highlightedSeriesId: p
|
|
838
|
+
})
|
|
839
|
+
}), r % he === 0 && /* @__PURE__ */ B("text", {
|
|
840
|
+
x: (q(t.id) ?? K) + q.bandwidth() / 2,
|
|
841
|
+
y: h - 4,
|
|
842
|
+
textAnchor: "middle",
|
|
843
|
+
...k.props(w.label, w.tick),
|
|
844
|
+
children: i.length > Z ? `${i.slice(0, Z - 1)}…` : i
|
|
845
|
+
})] }, t.id);
|
|
846
|
+
}),
|
|
847
|
+
/* @__PURE__ */ B(Ue, {
|
|
848
|
+
lines: b,
|
|
849
|
+
y: G,
|
|
850
|
+
left: K,
|
|
851
|
+
right: ue,
|
|
852
|
+
top: U,
|
|
853
|
+
bottom: W,
|
|
854
|
+
formatValue: f
|
|
855
|
+
}),
|
|
856
|
+
/* @__PURE__ */ B(Ce, {
|
|
857
|
+
markers: S,
|
|
858
|
+
categoryIds: N,
|
|
859
|
+
span: _e,
|
|
860
|
+
barTop: X,
|
|
861
|
+
y: G,
|
|
862
|
+
isReceded: T
|
|
863
|
+
}),
|
|
864
|
+
/* @__PURE__ */ B(we, {
|
|
865
|
+
annotations: O,
|
|
866
|
+
left: K,
|
|
867
|
+
right: ue
|
|
868
|
+
}),
|
|
869
|
+
y !== null && /* @__PURE__ */ B(l, {
|
|
870
|
+
x: (q(y) ?? K) + q.bandwidth() / 2,
|
|
871
|
+
top: U,
|
|
872
|
+
bottom: W,
|
|
873
|
+
width: Math.max(8, q.bandwidth())
|
|
884
874
|
})
|
|
885
|
-
|
|
886
|
-
x: (Q(t.id) ?? X) + Q.bandwidth() / 2,
|
|
887
|
-
y: h - 4,
|
|
888
|
-
textAnchor: "middle",
|
|
889
|
-
...C.props(y.label, y.tick),
|
|
890
|
-
children: i.length > $e ? `${i.slice(0, $e - 1)}…` : i
|
|
891
|
-
})] }, t.id);
|
|
892
|
-
}),
|
|
893
|
-
/* @__PURE__ */ O(Pe, {
|
|
894
|
-
lines: v,
|
|
895
|
-
y: Y,
|
|
896
|
-
left: X,
|
|
897
|
-
right: Z,
|
|
898
|
-
top: q,
|
|
899
|
-
bottom: J,
|
|
900
|
-
formatValue: f
|
|
901
|
-
}),
|
|
902
|
-
/* @__PURE__ */ O(be, {
|
|
903
|
-
markers: b,
|
|
904
|
-
categoryIds: A,
|
|
905
|
-
span: Je,
|
|
906
|
-
barTop: Ye,
|
|
907
|
-
y: Y,
|
|
908
|
-
isReceded: Xe
|
|
909
|
-
}),
|
|
910
|
-
/* @__PURE__ */ O(xe, {
|
|
911
|
-
annotations: Qe,
|
|
912
|
-
left: X,
|
|
913
|
-
right: Z
|
|
914
|
-
}),
|
|
915
|
-
ge !== void 0 && /* @__PURE__ */ O(oe, {
|
|
916
|
-
x: (Q(ge.id) ?? X) + Q.bandwidth() / 2,
|
|
917
|
-
top: q,
|
|
918
|
-
bottom: J,
|
|
919
|
-
width: Math.max(8, Q.bandwidth())
|
|
875
|
+
]
|
|
920
876
|
})
|
|
921
|
-
|
|
922
|
-
})
|
|
923
|
-
}
|
|
877
|
+
})
|
|
878
|
+
});
|
|
879
|
+
}
|
|
924
880
|
});
|
|
925
881
|
}
|
|
926
|
-
function
|
|
882
|
+
function nt(e, t, n) {
|
|
927
883
|
return e.map((e) => {
|
|
928
884
|
let r = e.values[t];
|
|
929
885
|
return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
|
|
930
886
|
}).join(" · ");
|
|
931
887
|
}
|
|
932
888
|
// packages/charts/src/cartesian/breakdown-bar.tsx
|
|
933
|
-
var
|
|
889
|
+
var rt = {
|
|
934
890
|
kzqmXN: "x5lhr3w",
|
|
935
891
|
kGVxlE: "x1iotiob",
|
|
936
892
|
kZKoxP: "x5yr21d",
|
|
937
893
|
$$css: !0
|
|
938
|
-
},
|
|
939
|
-
|
|
894
|
+
}, it = { segment: (e, t, n) => [
|
|
895
|
+
rt,
|
|
940
896
|
{
|
|
941
897
|
kWkggS: t == null ? t : "xl8spv7",
|
|
942
898
|
$$css: !0
|
|
@@ -947,62 +903,73 @@ var Je = {
|
|
|
947
903
|
"--x-boxShadow": `inset 0 0 0 1px ${n}` == null ? void 0 : `inset 0 0 0 1px ${n}`
|
|
948
904
|
}
|
|
949
905
|
] };
|
|
950
|
-
function
|
|
951
|
-
let
|
|
952
|
-
|
|
906
|
+
function at({ title: t, report: r, description: s, items: l, total: u, formatValue: d, selection: f }) {
|
|
907
|
+
let m = i(l), h = l.reduce((e, t) => e + (t.value ?? 0), 0), _ = 2 ** -52 * Math.max(h, u, 1) * l.length;
|
|
908
|
+
if (m !== void 0) return /* @__PURE__ */ B(g, {
|
|
953
909
|
title: t,
|
|
954
910
|
report: r,
|
|
955
|
-
description:
|
|
956
|
-
message:
|
|
957
|
-
})
|
|
911
|
+
description: s,
|
|
912
|
+
message: m
|
|
913
|
+
});
|
|
914
|
+
if (!Number.isFinite(u) || u < 0 || h - u > _) return /* @__PURE__ */ B(g, {
|
|
958
915
|
title: t,
|
|
959
916
|
report: r,
|
|
960
|
-
description:
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
l
|
|
917
|
+
description: s,
|
|
918
|
+
message: "The total must be finite and at least the sum of recorded values."
|
|
919
|
+
});
|
|
920
|
+
let v = l.map((e, t) => ({
|
|
921
|
+
id: e.id,
|
|
922
|
+
label: e.label,
|
|
923
|
+
valueLabel: e.value === null ? "Unavailable" : d(e.value),
|
|
924
|
+
tone: a(e.tone, t)
|
|
925
|
+
}));
|
|
926
|
+
return /* @__PURE__ */ B(x, {
|
|
927
|
+
items: o(v),
|
|
928
|
+
arrows: "both",
|
|
929
|
+
selected: f?.selectedId ?? null,
|
|
930
|
+
onSelect: f?.onSelect,
|
|
931
|
+
render: (i, o) => /* @__PURE__ */ B(p, {
|
|
932
|
+
figure: i,
|
|
933
|
+
title: t,
|
|
934
|
+
report: r,
|
|
935
|
+
description: s,
|
|
936
|
+
children: l.length === 0 ? /* @__PURE__ */ B("p", {
|
|
980
937
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
981
|
-
children:
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
"
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
938
|
+
children: "No values"
|
|
939
|
+
}) : /* @__PURE__ */ V(z, { children: [
|
|
940
|
+
/* @__PURE__ */ B("div", {
|
|
941
|
+
"aria-hidden": !0,
|
|
942
|
+
className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
|
|
943
|
+
children: l.map((t, r) => t.value === null ? null : /* @__PURE__ */ B("span", { ...k.props(it.segment(u === 0 ? 0 : t.value / u * 100, e[a(t.tone, r)], n[a(t.tone, r)])) }, t.id))
|
|
944
|
+
}),
|
|
945
|
+
/* @__PURE__ */ B(c, {
|
|
946
|
+
title: t,
|
|
947
|
+
items: v,
|
|
948
|
+
view: f === void 0 ? void 0 : o
|
|
949
|
+
}),
|
|
950
|
+
u - h > _ && /* @__PURE__ */ V("p", {
|
|
951
|
+
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
952
|
+
children: [
|
|
953
|
+
"Unassigned portion: ",
|
|
954
|
+
d(u - h),
|
|
955
|
+
" of ",
|
|
956
|
+
d(u)
|
|
957
|
+
]
|
|
958
|
+
})
|
|
959
|
+
] })
|
|
960
|
+
})
|
|
994
961
|
});
|
|
995
962
|
}
|
|
996
963
|
// packages/charts/src/cartesian/bridge-data.ts
|
|
997
|
-
function
|
|
964
|
+
function ot(e) {
|
|
998
965
|
return e.kind !== "change" || e.value === null ? "neutral" : e.value < 0 ? "negative" : "positive";
|
|
999
966
|
}
|
|
1000
|
-
function
|
|
967
|
+
function st(e) {
|
|
1001
968
|
let t = e.map((e) => e.kind === "total" ? 0 : e.value);
|
|
1002
969
|
return e[0]?.kind !== "start" || t.includes(null) ? null : t.reduce((e, t) => e + (t ?? 0), 0);
|
|
1003
970
|
}
|
|
1004
|
-
function
|
|
1005
|
-
let r = e.tone ??
|
|
971
|
+
function ct({ step: e, before: t, after: n }) {
|
|
972
|
+
let r = e.tone ?? ot(e);
|
|
1006
973
|
switch (e.kind) {
|
|
1007
974
|
case "start": return {
|
|
1008
975
|
step: e,
|
|
@@ -1024,42 +991,42 @@ function $e({ step: e, before: t, after: n }) {
|
|
|
1024
991
|
};
|
|
1025
992
|
}
|
|
1026
993
|
}
|
|
1027
|
-
function
|
|
1028
|
-
return e.map((t, n) =>
|
|
994
|
+
function lt(e) {
|
|
995
|
+
return e.map((t, n) => ct({
|
|
1029
996
|
step: t,
|
|
1030
|
-
before:
|
|
1031
|
-
after:
|
|
997
|
+
before: st(e.slice(0, n)),
|
|
998
|
+
after: st(e.slice(0, n + 1))
|
|
1032
999
|
}));
|
|
1033
1000
|
}
|
|
1034
|
-
function
|
|
1001
|
+
function ut(e) {
|
|
1035
1002
|
let t = e.flatMap((e) => [e.from, e.to].filter((e) => e !== null)), n = Math.min(0, ...t), r = Math.max(0, ...t);
|
|
1036
1003
|
return n === r ? [n, n + 1] : [n, r];
|
|
1037
1004
|
}
|
|
1038
|
-
function
|
|
1039
|
-
if (e.length >
|
|
1040
|
-
if (!
|
|
1005
|
+
function dt({ steps: e, domain: t }) {
|
|
1006
|
+
if (e.length > s.items) return `Choose a bridge with at most ${s.items} steps.`;
|
|
1007
|
+
if (!m(e)) return "Bridge steps require unique identifiers.";
|
|
1041
1008
|
if (e.length > 0 && e[0]?.kind !== "start") return "A bridge begins with one start step.";
|
|
1042
1009
|
if (e.filter((e) => e.kind === "start").length > 1) return "A bridge has exactly one start step.";
|
|
1043
1010
|
if (e.some((e) => {
|
|
1044
1011
|
let t = e.kind === "total" ? null : e.value;
|
|
1045
1012
|
return t !== null && !Number.isFinite(t);
|
|
1046
1013
|
})) return "Bridge values must be finite numbers or explicit missing changes.";
|
|
1047
|
-
let n =
|
|
1014
|
+
let n = ut(lt(e));
|
|
1048
1015
|
if (t === void 0) return Number.isFinite(n[0]) && Number.isFinite(n[1]) ? void 0 : "Running totals must stay finite.";
|
|
1049
1016
|
let r = t[0] <= n[0] && t[1] >= n[1];
|
|
1050
|
-
if (!
|
|
1017
|
+
if (!h(t) || !r) return "The bridge domain must be finite, increasing, and contain zero and every running total.";
|
|
1051
1018
|
}
|
|
1052
1019
|
// packages/charts/src/cartesian/bridge-chart.tsx
|
|
1053
|
-
var
|
|
1020
|
+
var ft = {
|
|
1054
1021
|
kfJifR: "xnpr05h",
|
|
1055
1022
|
$$css: !0
|
|
1056
|
-
},
|
|
1023
|
+
}, pt = {
|
|
1057
1024
|
plot: {
|
|
1058
1025
|
kqGvvJ: "x1we84gm",
|
|
1059
1026
|
$$css: !0
|
|
1060
1027
|
},
|
|
1061
1028
|
bar: (e, t) => [
|
|
1062
|
-
|
|
1029
|
+
ft,
|
|
1063
1030
|
{
|
|
1064
1031
|
kDwRjp: e == null ? e : "x19zyb68",
|
|
1065
1032
|
kjVXCG: t == null ? t : "x6mkzkt",
|
|
@@ -1069,330 +1036,328 @@ var rt = {
|
|
|
1069
1036
|
"--x-fill": e ?? void 0,
|
|
1070
1037
|
"--x-stroke": t ?? void 0
|
|
1071
1038
|
}
|
|
1072
|
-
]
|
|
1073
|
-
|
|
1074
|
-
|
|
1039
|
+
],
|
|
1040
|
+
unknown: {
|
|
1041
|
+
kDwRjp: "xbh8q5q",
|
|
1042
|
+
kjVXCG: "x1crw9hw",
|
|
1043
|
+
kfJifR: "xnpr05h",
|
|
1044
|
+
k5rJSQ: "x1ypbokr",
|
|
1045
|
+
kREpy8: "x13efnbd",
|
|
1046
|
+
$$css: !0
|
|
1047
|
+
}
|
|
1048
|
+
}, mt = 240, ht = 24, gt = 28, _t = 6, vt = 14, yt = 12, bt = 7, xt = 14, St = 4, Ct = {
|
|
1049
|
+
start: w.strongLabel,
|
|
1075
1050
|
change: void 0,
|
|
1076
|
-
total:
|
|
1051
|
+
total: w.strongLabel
|
|
1077
1052
|
};
|
|
1078
|
-
function
|
|
1053
|
+
function wt(e) {
|
|
1079
1054
|
return (t) => t === 0 ? e(0) : `${t > 0 ? "+" : "−"}${e(Math.abs(t))}`;
|
|
1080
1055
|
}
|
|
1081
|
-
function
|
|
1056
|
+
function Tt({ level: e, formatValue: t, formatChange: n }) {
|
|
1082
1057
|
return e.step.kind === "change" && e.step.value !== null ? n(e.step.value) : e.to === null ? "—" : t(e.to);
|
|
1083
1058
|
}
|
|
1084
|
-
function
|
|
1059
|
+
function Et({ level: e, formatValue: t, formatChange: n }) {
|
|
1085
1060
|
return e.step.kind === "change" ? e.step.value === null ? "Unavailable" : n(e.step.value) : e.to === null ? "Unavailable" : t(e.to);
|
|
1086
1061
|
}
|
|
1087
|
-
function
|
|
1062
|
+
function Dt({ level: e, formatValue: t }) {
|
|
1088
1063
|
return e.from === null || e.to === null ? "Unavailable" : `${t(e.from)} → ${t(e.to)}`;
|
|
1089
1064
|
}
|
|
1090
|
-
|
|
1065
|
+
function Ot(e, t, n) {
|
|
1066
|
+
if (e.from === null || e.to === null) {
|
|
1067
|
+
let r = Math.min(n - yt, t(e.from ?? 0) - yt / 2);
|
|
1068
|
+
return {
|
|
1069
|
+
isKnown: !1,
|
|
1070
|
+
top: r,
|
|
1071
|
+
height: yt,
|
|
1072
|
+
labelY: r - _t
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
let r = Math.max(e.from, e.to), i = Math.min(e.from, e.to), a = t(r), o = r <= 0 && i < 0;
|
|
1076
|
+
return {
|
|
1077
|
+
isKnown: !0,
|
|
1078
|
+
top: a,
|
|
1079
|
+
height: Math.max(1, t(i) - a),
|
|
1080
|
+
labelY: o ? t(i) + vt : a - _t
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
function kt(e) {
|
|
1084
|
+
let t = [];
|
|
1085
|
+
for (let n of [...e.filter(({ kind: e }) => e !== "change"), ...e.filter(({ kind: e }) => e === "change")]) t.every((e) => {
|
|
1086
|
+
let t = (n.text.length + e.text.length) * bt / 2 + St;
|
|
1087
|
+
return Math.abs(n.x - e.x) >= t || Math.abs(n.y - e.y) >= xt;
|
|
1088
|
+
}) && t.push(n);
|
|
1089
|
+
return t;
|
|
1090
|
+
}
|
|
1091
|
+
var At = {
|
|
1091
1092
|
"x-default-marker": "x-default-marker",
|
|
1092
1093
|
$$css: !0
|
|
1093
1094
|
};
|
|
1094
|
-
function
|
|
1095
|
-
let { ref:
|
|
1096
|
-
te(() => {
|
|
1097
|
-
function e(e) {
|
|
1098
|
-
e.target instanceof Node && g?.contains(e.target) !== !0 && x(void 0);
|
|
1099
|
-
}
|
|
1100
|
-
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1101
|
-
}, [g]);
|
|
1102
|
-
let ne = !Number.isFinite(f) || f < 96 ? "Chart height must be at least 96 pixels." : void 0, E = et(r), D = s ?? tt(E), A = ne ?? nt({
|
|
1095
|
+
function jt({ title: e, description: t, report: n, steps: r, formatValue: i, formatChange: a = wt(i), formatTick: o = i, domain: s, referenceLines: c = [], selection: d, height: f = mt }) {
|
|
1096
|
+
let { ref: m, width: h } = T(), _ = M(), b = !Number.isFinite(f) || f < 96 ? "Chart height must be at least 96 pixels." : void 0, S = lt(r), C = s ?? ut(S), E = b ?? dt({
|
|
1103
1097
|
steps: r,
|
|
1104
1098
|
domain: s
|
|
1105
|
-
}) ??
|
|
1106
|
-
lines:
|
|
1107
|
-
domain:
|
|
1099
|
+
}) ?? ze({
|
|
1100
|
+
lines: c,
|
|
1101
|
+
domain: C
|
|
1108
1102
|
});
|
|
1109
|
-
if (
|
|
1103
|
+
if (E !== void 0) return /* @__PURE__ */ B(g, {
|
|
1110
1104
|
title: e,
|
|
1111
1105
|
description: t,
|
|
1112
1106
|
report: n,
|
|
1113
|
-
message:
|
|
1107
|
+
message: E
|
|
1114
1108
|
});
|
|
1115
|
-
let
|
|
1116
|
-
level: M,
|
|
1117
|
-
formatValue: i,
|
|
1118
|
-
formatChange: a
|
|
1119
|
-
}), F = M?.step.kind === "change" ? [{
|
|
1120
|
-
id: "running",
|
|
1121
|
-
label: "Running total",
|
|
1122
|
-
tone: "neutral",
|
|
1123
|
-
value: gt({
|
|
1124
|
-
level: M,
|
|
1125
|
-
formatValue: i
|
|
1126
|
-
})
|
|
1127
|
-
}] : [], se = l.map((e) => ({
|
|
1109
|
+
let D = c.map((e) => ({
|
|
1128
1110
|
id: e.id,
|
|
1129
1111
|
label: e.label,
|
|
1130
1112
|
tone: e.tone ?? "neutral",
|
|
1131
1113
|
shape: "dashed",
|
|
1132
1114
|
value: i(e.value)
|
|
1133
|
-
}))
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1115
|
+
}));
|
|
1116
|
+
function O(e) {
|
|
1117
|
+
let t = S.find((t) => t.step.id === e);
|
|
1118
|
+
if (t === void 0) return {
|
|
1119
|
+
level: t,
|
|
1120
|
+
label: void 0,
|
|
1121
|
+
summary: void 0,
|
|
1122
|
+
rows: []
|
|
1123
|
+
};
|
|
1124
|
+
let n = t.step.kind === "change" ? [{
|
|
1125
|
+
id: "running",
|
|
1126
|
+
label: "Running total",
|
|
1127
|
+
tone: "neutral",
|
|
1128
|
+
value: Dt({
|
|
1129
|
+
level: t,
|
|
1130
|
+
formatValue: i
|
|
1131
|
+
})
|
|
1132
|
+
}] : [];
|
|
1133
|
+
return {
|
|
1134
|
+
level: t,
|
|
1135
|
+
label: t.step.label,
|
|
1136
|
+
summary: Et({
|
|
1137
|
+
level: t,
|
|
1138
|
+
formatValue: i,
|
|
1139
|
+
formatChange: a
|
|
1140
|
+
}),
|
|
1141
|
+
rows: [...n, ...D]
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
let A = f - gt, j = H({
|
|
1145
|
+
domain: [...C],
|
|
1146
|
+
range: [A, ht]
|
|
1147
|
+
}), N = j.ticks(4), P = Math.max(44, ...N.map((e) => o(e).length * bt + 12)), F = Ve({
|
|
1148
|
+
lines: c,
|
|
1138
1149
|
formatValue: o
|
|
1139
|
-
}),
|
|
1140
|
-
domain:
|
|
1141
|
-
range: [
|
|
1150
|
+
}), I = Math.max(P + 1, h - 16 - F), L = re({
|
|
1151
|
+
domain: S.map((e) => e.step.id),
|
|
1152
|
+
range: [P, I],
|
|
1142
1153
|
padding: .28
|
|
1143
|
-
}),
|
|
1154
|
+
}), R = S.map((e) => ({
|
|
1144
1155
|
id: e.step.id,
|
|
1145
1156
|
label: e.step.label
|
|
1146
|
-
})),
|
|
1147
|
-
function
|
|
1148
|
-
let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * h, r = Math.floor((n - L) / B.step()), i = E[Math.max(0, Math.min(E.length - 1, r))];
|
|
1149
|
-
i !== void 0 && (e.type === "pointerdown" && w(i.step.id), x({
|
|
1150
|
-
id: i.step.id,
|
|
1151
|
-
source: "pointer"
|
|
1152
|
-
}));
|
|
1153
|
-
}
|
|
1154
|
-
function U(e) {
|
|
1157
|
+
})), te = Math.max(1, Math.floor((L.step() - 8) / bt));
|
|
1158
|
+
function ne(e) {
|
|
1155
1159
|
let t = e.axisLabel ?? e.label;
|
|
1156
|
-
return t.length >
|
|
1160
|
+
return t.length > te ? `${t.slice(0, te - 1)}…` : t;
|
|
1157
1161
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
+
let z = kt(S.map((e) => ({
|
|
1163
|
+
id: e.step.id,
|
|
1164
|
+
kind: e.step.kind,
|
|
1165
|
+
text: Tt({
|
|
1166
|
+
level: e,
|
|
1167
|
+
formatValue: i,
|
|
1168
|
+
formatChange: a
|
|
1162
1169
|
}),
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
if (e.currentTarget.matches(":focus-visible")) {
|
|
1255
|
-
let e = ae ?? E[0];
|
|
1256
|
-
w(e?.step.id), x(e === void 0 ? void 0 : {
|
|
1257
|
-
id: e.step.id,
|
|
1258
|
-
source: "keyboard"
|
|
1259
|
-
});
|
|
1260
|
-
}
|
|
1261
|
-
},
|
|
1262
|
-
onPointerMove: (e) => {
|
|
1263
|
-
e.pointerType === "mouse" && H(e);
|
|
1264
|
-
},
|
|
1265
|
-
onPointerDown: H,
|
|
1266
|
-
onPointerLeave: (e) => {
|
|
1267
|
-
e.pointerType === "mouse" && b?.source === "pointer" && x(void 0);
|
|
1268
|
-
},
|
|
1269
|
-
onBlur: () => x(void 0),
|
|
1270
|
-
onClick: () => {
|
|
1271
|
-
M !== void 0 && d?.onSelect(M.step.id);
|
|
1272
|
-
},
|
|
1273
|
-
...C.props(y.svg, y.inspectable, _t),
|
|
1274
|
-
children: [
|
|
1275
|
-
M !== void 0 && /* @__PURE__ */ O("rect", {
|
|
1276
|
-
x: (B(M.step.id) ?? L) - (B.step() - B.bandwidth()) / 2,
|
|
1277
|
-
y: ot,
|
|
1278
|
-
width: B.step(),
|
|
1279
|
-
height: le - ot,
|
|
1280
|
-
className: "x2wnxhi"
|
|
1281
|
-
}),
|
|
1282
|
-
pe.map((e) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
|
|
1283
|
-
x1: L,
|
|
1284
|
-
x2: z,
|
|
1285
|
-
y1: I(e),
|
|
1286
|
-
y2: I(e),
|
|
1287
|
-
...C.props(e === 0 ? y.baseline : y.grid)
|
|
1288
|
-
}), /* @__PURE__ */ O("text", {
|
|
1289
|
-
x: L - 8,
|
|
1290
|
-
y: I(e),
|
|
1291
|
-
textAnchor: "end",
|
|
1292
|
-
dominantBaseline: "middle",
|
|
1293
|
-
...C.props(y.label, y.tick),
|
|
1294
|
-
children: o(e)
|
|
1295
|
-
})] }, e)),
|
|
1296
|
-
E.map((e, t) => {
|
|
1297
|
-
let n = E[t + 1], r = B(e.step.id) ?? L;
|
|
1298
|
-
return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ O("line", {
|
|
1299
|
-
x1: r + B.bandwidth(),
|
|
1300
|
-
x2: B(n.step.id) ?? r,
|
|
1301
|
-
y1: I(e.to),
|
|
1302
|
-
y2: I(e.to),
|
|
1303
|
-
className: "x1crw9hw xnpr05h x1ypbokr x13efnbd"
|
|
1304
|
-
}, `connector:${e.step.id}`);
|
|
1305
|
-
}),
|
|
1306
|
-
E.map((e) => /* @__PURE__ */ O(yt, {
|
|
1307
|
-
level: e,
|
|
1308
|
-
x: B(e.step.id) ?? L,
|
|
1309
|
-
width: B.bandwidth(),
|
|
1310
|
-
y: I,
|
|
1311
|
-
bottom: le,
|
|
1312
|
-
height: f,
|
|
1313
|
-
label: mt({
|
|
1314
|
-
level: e,
|
|
1315
|
-
formatValue: i,
|
|
1316
|
-
formatChange: a
|
|
1170
|
+
x: (L(e.step.id) ?? P) + L.bandwidth() / 2,
|
|
1171
|
+
y: Ot(e, j, A).labelY
|
|
1172
|
+
})));
|
|
1173
|
+
return /* @__PURE__ */ B(x, {
|
|
1174
|
+
items: R,
|
|
1175
|
+
readout: (e) => le(O(e)),
|
|
1176
|
+
locate: y({
|
|
1177
|
+
ids: R.map((e) => e.id),
|
|
1178
|
+
start: P,
|
|
1179
|
+
step: L.step(),
|
|
1180
|
+
width: h
|
|
1181
|
+
}),
|
|
1182
|
+
selected: d?.selectedId ?? null,
|
|
1183
|
+
onSelect: d?.onSelect,
|
|
1184
|
+
render: (r, { inspected: s, cursor: g }) => {
|
|
1185
|
+
let y = O(s);
|
|
1186
|
+
return /* @__PURE__ */ V(p, {
|
|
1187
|
+
figure: r,
|
|
1188
|
+
title: /* @__PURE__ */ B(ce, {
|
|
1189
|
+
title: e,
|
|
1190
|
+
detail: y.level === void 0 ? void 0 : `${y.label} · ${y.summary}`
|
|
1191
|
+
}),
|
|
1192
|
+
description: t,
|
|
1193
|
+
report: n,
|
|
1194
|
+
children: [
|
|
1195
|
+
/* @__PURE__ */ B(u, {
|
|
1196
|
+
label: `${e} steps`,
|
|
1197
|
+
columns: [
|
|
1198
|
+
{
|
|
1199
|
+
id: "step",
|
|
1200
|
+
label: "Step"
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
id: "value",
|
|
1204
|
+
label: "Value"
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
id: "running",
|
|
1208
|
+
label: "Running total"
|
|
1209
|
+
}
|
|
1210
|
+
],
|
|
1211
|
+
rows: [...S.map((e) => ({
|
|
1212
|
+
id: e.step.id,
|
|
1213
|
+
values: [
|
|
1214
|
+
e.step.label,
|
|
1215
|
+
Et({
|
|
1216
|
+
level: e,
|
|
1217
|
+
formatValue: i,
|
|
1218
|
+
formatChange: a
|
|
1219
|
+
}),
|
|
1220
|
+
e.step.kind === "change" ? Dt({
|
|
1221
|
+
level: e,
|
|
1222
|
+
formatValue: i
|
|
1223
|
+
}) : Et({
|
|
1224
|
+
level: e,
|
|
1225
|
+
formatValue: i,
|
|
1226
|
+
formatChange: a
|
|
1227
|
+
})
|
|
1228
|
+
]
|
|
1229
|
+
})), ...c.map((e) => ({
|
|
1230
|
+
id: `reference:${e.id}`,
|
|
1231
|
+
values: [
|
|
1232
|
+
e.label,
|
|
1233
|
+
i(e.value),
|
|
1234
|
+
""
|
|
1235
|
+
]
|
|
1236
|
+
}))]
|
|
1237
|
+
}),
|
|
1238
|
+
/* @__PURE__ */ B(ue, {
|
|
1239
|
+
id: _,
|
|
1240
|
+
label: y.label,
|
|
1241
|
+
summary: y.summary,
|
|
1242
|
+
legend: [],
|
|
1243
|
+
hasLegend: !1,
|
|
1244
|
+
rows: y.rows,
|
|
1245
|
+
x: (L(s ?? "") ?? P) + L.bandwidth() / 2,
|
|
1246
|
+
width: h,
|
|
1247
|
+
offset: L.bandwidth() / 2 + 8
|
|
1248
|
+
}),
|
|
1249
|
+
/* @__PURE__ */ B("div", {
|
|
1250
|
+
ref: m,
|
|
1251
|
+
...k.props(w.plot, pt.plot),
|
|
1252
|
+
children: S.length === 0 ? /* @__PURE__ */ B("p", {
|
|
1253
|
+
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
1254
|
+
children: "No steps"
|
|
1255
|
+
}) : /* @__PURE__ */ V(v, {
|
|
1256
|
+
role: "img",
|
|
1257
|
+
"aria-label": ee({
|
|
1258
|
+
title: e,
|
|
1259
|
+
marks: "steps",
|
|
1260
|
+
isSelectable: d !== void 0
|
|
1317
1261
|
}),
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1262
|
+
"aria-describedby": _,
|
|
1263
|
+
viewBox: `0 0 ${h} ${f}`,
|
|
1264
|
+
height: f,
|
|
1265
|
+
...k.props(w.svg, w.inspectable, At),
|
|
1266
|
+
children: [
|
|
1267
|
+
s !== null && /* @__PURE__ */ B("rect", {
|
|
1268
|
+
x: (L(s) ?? P) - (L.step() - L.bandwidth()) / 2,
|
|
1269
|
+
y: ht,
|
|
1270
|
+
width: L.step(),
|
|
1271
|
+
height: A - ht,
|
|
1272
|
+
className: "x2wnxhi"
|
|
1273
|
+
}),
|
|
1274
|
+
N.map((e) => /* @__PURE__ */ V("g", { children: [/* @__PURE__ */ B("line", {
|
|
1275
|
+
x1: P,
|
|
1276
|
+
x2: I,
|
|
1277
|
+
y1: j(e),
|
|
1278
|
+
y2: j(e),
|
|
1279
|
+
...k.props(e === 0 ? w.baseline : w.grid)
|
|
1280
|
+
}), /* @__PURE__ */ B("text", {
|
|
1281
|
+
x: P - 8,
|
|
1282
|
+
y: j(e),
|
|
1283
|
+
textAnchor: "end",
|
|
1284
|
+
dominantBaseline: "middle",
|
|
1285
|
+
...k.props(w.label, w.tick),
|
|
1286
|
+
children: o(e)
|
|
1287
|
+
})] }, e)),
|
|
1288
|
+
S.map((e, t) => {
|
|
1289
|
+
let n = S[t + 1], r = L(e.step.id) ?? P;
|
|
1290
|
+
return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ B("line", {
|
|
1291
|
+
x1: r + L.bandwidth(),
|
|
1292
|
+
x2: L(n.step.id) ?? r,
|
|
1293
|
+
y1: j(e.to),
|
|
1294
|
+
y2: j(e.to),
|
|
1295
|
+
className: "x1crw9hw xnpr05h x1ypbokr x13efnbd"
|
|
1296
|
+
}, `connector:${e.step.id}`);
|
|
1297
|
+
}),
|
|
1298
|
+
S.map((e) => /* @__PURE__ */ B(Mt, {
|
|
1299
|
+
level: e,
|
|
1300
|
+
x: L(e.step.id) ?? P,
|
|
1301
|
+
width: L.bandwidth(),
|
|
1302
|
+
y: j,
|
|
1303
|
+
bottom: A,
|
|
1304
|
+
height: f,
|
|
1305
|
+
axisLabel: ne(e.step),
|
|
1306
|
+
isSelected: d?.selectedId === e.step.id
|
|
1307
|
+
}, e.step.id)),
|
|
1308
|
+
/* @__PURE__ */ B(Ue, {
|
|
1309
|
+
lines: c,
|
|
1310
|
+
y: j,
|
|
1311
|
+
left: P,
|
|
1312
|
+
right: I,
|
|
1313
|
+
top: ht,
|
|
1314
|
+
bottom: A,
|
|
1315
|
+
formatValue: o
|
|
1316
|
+
}),
|
|
1317
|
+
z.map((e) => /* @__PURE__ */ B("text", {
|
|
1318
|
+
x: e.x,
|
|
1319
|
+
y: e.y,
|
|
1320
|
+
textAnchor: "middle",
|
|
1321
|
+
...k.props(w.label, Ct[e.kind], w.haloLabel),
|
|
1322
|
+
children: e.text
|
|
1323
|
+
}, e.id)),
|
|
1324
|
+
g !== null && /* @__PURE__ */ B(l, {
|
|
1325
|
+
x: (L(g) ?? P) + L.bandwidth() / 2,
|
|
1326
|
+
top: ht,
|
|
1327
|
+
bottom: A,
|
|
1328
|
+
width: Math.max(8, L.bandwidth())
|
|
1329
|
+
})
|
|
1330
|
+
]
|
|
1335
1331
|
})
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
})
|
|
1339
|
-
|
|
1332
|
+
})
|
|
1333
|
+
]
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1340
1336
|
});
|
|
1341
1337
|
}
|
|
1342
|
-
function
|
|
1343
|
-
let
|
|
1344
|
-
|
|
1338
|
+
function Mt({ level: t, x: r, width: i, y: a, bottom: o, height: s, axisLabel: c, isSelected: l }) {
|
|
1339
|
+
let u = Ot(t, a, o);
|
|
1340
|
+
return /* @__PURE__ */ V("g", { children: [/* @__PURE__ */ B("rect", {
|
|
1341
|
+
x: r,
|
|
1342
|
+
y: u.top,
|
|
1343
|
+
width: i,
|
|
1344
|
+
height: u.height,
|
|
1345
|
+
...k.props(u.isKnown ? pt.bar(e[t.tone], n[t.tone]) : pt.unknown, u.isKnown && l && w.selected)
|
|
1346
|
+
}), /* @__PURE__ */ B("text", {
|
|
1347
|
+
x: r + i / 2,
|
|
1345
1348
|
y: s - 4,
|
|
1346
1349
|
textAnchor: "middle",
|
|
1347
|
-
...
|
|
1348
|
-
children:
|
|
1349
|
-
});
|
|
1350
|
-
if (t.from === null || t.to === null) {
|
|
1351
|
-
let e = t.from ?? 0, n = Math.min(o - ut, a(e) - ut / 2);
|
|
1352
|
-
return /* @__PURE__ */ k("g", { children: [
|
|
1353
|
-
/* @__PURE__ */ O("rect", {
|
|
1354
|
-
x: r,
|
|
1355
|
-
y: n,
|
|
1356
|
-
width: i,
|
|
1357
|
-
height: ut,
|
|
1358
|
-
className: "xbh8q5q x1crw9hw xnpr05h x1ypbokr x13efnbd"
|
|
1359
|
-
}),
|
|
1360
|
-
/* @__PURE__ */ O("text", {
|
|
1361
|
-
x: d,
|
|
1362
|
-
y: n - ct,
|
|
1363
|
-
textAnchor: "middle",
|
|
1364
|
-
...C.props(y.label),
|
|
1365
|
-
children: c
|
|
1366
|
-
}),
|
|
1367
|
-
f
|
|
1368
|
-
] });
|
|
1369
|
-
}
|
|
1370
|
-
let p = Math.max(t.from, t.to), m = Math.min(t.from, t.to), h = a(p), g = Math.max(1, a(m) - h), _ = p <= 0 && m < 0 ? a(m) + lt : h - ct;
|
|
1371
|
-
return /* @__PURE__ */ k("g", { children: [
|
|
1372
|
-
/* @__PURE__ */ O("rect", {
|
|
1373
|
-
x: r,
|
|
1374
|
-
y: h,
|
|
1375
|
-
width: i,
|
|
1376
|
-
height: g,
|
|
1377
|
-
...C.props(it.bar(e[t.tone], n[t.tone]), u && y.selected)
|
|
1378
|
-
}),
|
|
1379
|
-
/* @__PURE__ */ O("text", {
|
|
1380
|
-
x: d,
|
|
1381
|
-
y: _,
|
|
1382
|
-
textAnchor: "middle",
|
|
1383
|
-
...C.props(y.label, ft[t.step.kind], y.haloLabel),
|
|
1384
|
-
children: c
|
|
1385
|
-
}),
|
|
1386
|
-
f
|
|
1387
|
-
] });
|
|
1350
|
+
...k.props(w.label, w.tick),
|
|
1351
|
+
children: c
|
|
1352
|
+
})] });
|
|
1388
1353
|
}
|
|
1389
1354
|
// packages/charts/src/cartesian/scatter-plot.tsx
|
|
1390
|
-
var
|
|
1355
|
+
var Nt = 260, Pt = 56, Ft = 20, It = 12, Lt = 1e3, Rt = {
|
|
1391
1356
|
kzqmXN: "x1xc55vz",
|
|
1392
1357
|
kZKoxP: "xdk7pt",
|
|
1393
1358
|
kaIpWk: "x16rqkct",
|
|
1394
1359
|
$$css: !0
|
|
1395
|
-
},
|
|
1360
|
+
}, zt = {
|
|
1396
1361
|
brush: {
|
|
1397
1362
|
kFalU9: "xx69xxh",
|
|
1398
1363
|
kkrTdU: "xsid9ct",
|
|
@@ -1430,7 +1395,7 @@ var bt = 260, xt = 56, St = 20, Ct = 12, wt = 1e3, Tt = {
|
|
|
1430
1395
|
"--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
1431
1396
|
}],
|
|
1432
1397
|
dot: (e) => [
|
|
1433
|
-
|
|
1398
|
+
Rt,
|
|
1434
1399
|
{
|
|
1435
1400
|
kWkggS: e == null ? e : "xl8spv7",
|
|
1436
1401
|
$$css: !0
|
|
@@ -1445,107 +1410,122 @@ var bt = 260, xt = 56, St = 20, Ct = 12, wt = 1e3, Tt = {
|
|
|
1445
1410
|
$$css: !0
|
|
1446
1411
|
}
|
|
1447
1412
|
};
|
|
1448
|
-
function
|
|
1449
|
-
let { title: n, report: r, description: i, points: a, xDomain: o, yDomain: s, xLabel:
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
label: `${e.label}, ${u}: ${h(e.x)}, ${f}: ${g(e.y)}`
|
|
1455
|
-
}))
|
|
1456
|
-
}), { ref: S, width: te } = ee(), T = At(t);
|
|
1457
|
-
if (T !== null) return /* @__PURE__ */ O(_, {
|
|
1413
|
+
function Bt(t) {
|
|
1414
|
+
let { title: n, report: r, description: i, points: a, xDomain: o, yDomain: s, xLabel: c, yLabel: l, formatX: d, formatY: m, selection: h, rangeSelection: _, emptyLabel: v } = t, y = a.map((e) => ({
|
|
1415
|
+
id: e.id,
|
|
1416
|
+
label: `${e.label}, ${c}: ${d(e.x)}, ${l}: ${m(e.y)}`
|
|
1417
|
+
})), E = M(), { ref: D, width: O } = T(), A = Ut(t);
|
|
1418
|
+
if (A !== null) return /* @__PURE__ */ B(g, {
|
|
1458
1419
|
title: n,
|
|
1459
1420
|
report: r,
|
|
1460
1421
|
description: i,
|
|
1461
|
-
message:
|
|
1422
|
+
message: A
|
|
1462
1423
|
});
|
|
1463
|
-
let
|
|
1424
|
+
let j = H({
|
|
1464
1425
|
domain: [...o],
|
|
1465
|
-
range: [
|
|
1466
|
-
}),
|
|
1426
|
+
range: [Pt, Math.max(Pt, O - Ft)]
|
|
1427
|
+
}), N = H({
|
|
1467
1428
|
domain: [...s],
|
|
1468
|
-
range: [216,
|
|
1469
|
-
})
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
}, `${o[0]}:${o[1]}:${s[0]}:${s[1]}:${te}`), a.length > 0 && /* @__PURE__ */ O("div", {
|
|
1492
|
-
className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
|
|
1493
|
-
children: a.map((t) => {
|
|
1494
|
-
let n = x.label !== void 0 && x.activeId === t.id;
|
|
1495
|
-
return /* @__PURE__ */ O(w, {
|
|
1496
|
-
type: "button",
|
|
1497
|
-
tabIndex: -1,
|
|
1498
|
-
onPointerEnter: () => x.inspect(t.id),
|
|
1499
|
-
title: t.label,
|
|
1500
|
-
"aria-label": `${t.label}, ${u}: ${h(t.x)}, ${f}: ${g(t.y)}`,
|
|
1501
|
-
"aria-pressed": v === void 0 ? void 0 : v.selectedId === t.id,
|
|
1502
|
-
onClick: () => {
|
|
1503
|
-
x.inspect(t.id), v?.onSelect(t.id);
|
|
1504
|
-
},
|
|
1505
|
-
...C.props(Et.target, Et.location(ne(t.x), E(t.y))),
|
|
1506
|
-
children: /* @__PURE__ */ O("span", {
|
|
1507
|
-
"aria-hidden": !0,
|
|
1508
|
-
...C.props(Et.dot(e[t.tone]), (v?.selectedId === t.id || n) && Et.selected)
|
|
1509
|
-
})
|
|
1510
|
-
}, t.id);
|
|
1511
|
-
})
|
|
1512
|
-
})]
|
|
1513
|
-
}),
|
|
1514
|
-
y !== void 0 && /* @__PURE__ */ O(kt, {
|
|
1515
|
-
...t,
|
|
1516
|
-
rangeSelection: y
|
|
1429
|
+
range: [216, It]
|
|
1430
|
+
}), P = new Map(a.map((e) => {
|
|
1431
|
+
let t = j(e.x), n = N(e.y);
|
|
1432
|
+
return [e.id, {
|
|
1433
|
+
left: t,
|
|
1434
|
+
top: n,
|
|
1435
|
+
right: t,
|
|
1436
|
+
bottom: n
|
|
1437
|
+
}];
|
|
1438
|
+
}));
|
|
1439
|
+
return /* @__PURE__ */ B(x, {
|
|
1440
|
+
items: y,
|
|
1441
|
+
place: (e) => P.get(e),
|
|
1442
|
+
selected: h?.selectedId ?? null,
|
|
1443
|
+
onSelect: h?.onSelect,
|
|
1444
|
+
render: (g, { inspected: x, cursor: T }) => /* @__PURE__ */ V(p, {
|
|
1445
|
+
figure: g,
|
|
1446
|
+
title: n,
|
|
1447
|
+
report: r,
|
|
1448
|
+
description: i,
|
|
1449
|
+
footer: /* @__PURE__ */ B(f, {
|
|
1450
|
+
id: E,
|
|
1451
|
+
children: C(y, x)
|
|
1517
1452
|
}),
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
{
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
},
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1453
|
+
children: [
|
|
1454
|
+
a.length === 0 ? /* @__PURE__ */ B("p", {
|
|
1455
|
+
className: "x1ghz6dp x153jb6y",
|
|
1456
|
+
children: v
|
|
1457
|
+
}) : /* @__PURE__ */ V(b, {
|
|
1458
|
+
ref: D,
|
|
1459
|
+
role: "group",
|
|
1460
|
+
"aria-label": ee({
|
|
1461
|
+
title: n,
|
|
1462
|
+
isSelectable: h !== void 0
|
|
1463
|
+
}),
|
|
1464
|
+
"aria-describedby": E,
|
|
1465
|
+
className: "x1n2onr6 xeuugli x-default-marker",
|
|
1466
|
+
children: [/* @__PURE__ */ B(Vt, {
|
|
1467
|
+
width: O,
|
|
1468
|
+
scaleX: j,
|
|
1469
|
+
scaleY: N,
|
|
1470
|
+
...t
|
|
1471
|
+
}, `${o[0]}:${o[1]}:${s[0]}:${s[1]}:${O}`), /* @__PURE__ */ B("div", {
|
|
1472
|
+
className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
|
|
1473
|
+
children: a.map((t, n) => {
|
|
1474
|
+
let r = h?.selectedId === t.id || x === t.id;
|
|
1475
|
+
return /* @__PURE__ */ B(S, {
|
|
1476
|
+
value: t.id,
|
|
1477
|
+
render: /* @__PURE__ */ B("button", {
|
|
1478
|
+
type: "button",
|
|
1479
|
+
tabIndex: -1,
|
|
1480
|
+
title: t.label,
|
|
1481
|
+
"aria-label": y[n]?.label,
|
|
1482
|
+
"aria-pressed": h === void 0 ? void 0 : h.selectedId === t.id
|
|
1483
|
+
}),
|
|
1484
|
+
...k.props(zt.target, zt.location(j(t.x), N(t.y))),
|
|
1485
|
+
children: /* @__PURE__ */ B("span", {
|
|
1486
|
+
"aria-hidden": !0,
|
|
1487
|
+
...k.props(zt.dot(e[t.tone]), r && zt.selected, !r && T === t.id && w.cursor)
|
|
1488
|
+
})
|
|
1489
|
+
}, t.id);
|
|
1490
|
+
})
|
|
1491
|
+
})]
|
|
1492
|
+
}),
|
|
1493
|
+
_ !== void 0 && /* @__PURE__ */ B(Ht, {
|
|
1494
|
+
...t,
|
|
1495
|
+
rangeSelection: _
|
|
1496
|
+
}),
|
|
1497
|
+
/* @__PURE__ */ B(u, {
|
|
1498
|
+
label: `${n} points`,
|
|
1499
|
+
columns: [
|
|
1500
|
+
{
|
|
1501
|
+
id: "point",
|
|
1502
|
+
label: "Point"
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
id: "x",
|
|
1506
|
+
label: c
|
|
1507
|
+
},
|
|
1508
|
+
{
|
|
1509
|
+
id: "y",
|
|
1510
|
+
label: l
|
|
1511
|
+
}
|
|
1512
|
+
],
|
|
1513
|
+
rows: a.map((e) => ({
|
|
1514
|
+
id: e.id,
|
|
1515
|
+
values: [
|
|
1516
|
+
e.label,
|
|
1517
|
+
d(e.x),
|
|
1518
|
+
m(e.y)
|
|
1519
|
+
]
|
|
1520
|
+
}))
|
|
1521
|
+
})
|
|
1522
|
+
]
|
|
1523
|
+
})
|
|
1544
1524
|
});
|
|
1545
1525
|
}
|
|
1546
|
-
function
|
|
1547
|
-
let c =
|
|
1548
|
-
|
|
1526
|
+
function Vt({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, formatY: o, rangeSelection: s }) {
|
|
1527
|
+
let c = M(), [l, u] = F(null), d = P(null);
|
|
1528
|
+
j(() => () => d.current?.(), []);
|
|
1549
1529
|
let f = l === null ? s?.value : {
|
|
1550
1530
|
x: [Math.min(l.start.x, l.end.x), Math.max(l.start.x, l.end.x)],
|
|
1551
1531
|
y: [Math.min(l.start.y, l.end.y), Math.max(l.start.y, l.end.y)]
|
|
@@ -1553,21 +1533,21 @@ function Ot({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a,
|
|
|
1553
1533
|
function p(r, i, a) {
|
|
1554
1534
|
return {
|
|
1555
1535
|
x: t.copy().clamp(!0).invert((i - r.left) / r.width * e),
|
|
1556
|
-
y: n.copy().clamp(!0).invert((a - r.top) / r.height *
|
|
1536
|
+
y: n.copy().clamp(!0).invert((a - r.top) / r.height * Nt)
|
|
1557
1537
|
};
|
|
1558
1538
|
}
|
|
1559
1539
|
function m(t) {
|
|
1560
1540
|
let n = t.button === 0 && t.pointerType !== "touch";
|
|
1561
1541
|
if (s === void 0 || d.current !== null || !n) return;
|
|
1562
|
-
let r = t.currentTarget.getBoundingClientRect(), i = (t.clientX - r.left) / r.width * e, a = (t.clientY - r.top) / r.height *
|
|
1563
|
-
if (i <
|
|
1542
|
+
let r = t.currentTarget.getBoundingClientRect(), i = (t.clientX - r.left) / r.width * e, a = (t.clientY - r.top) / r.height * Nt;
|
|
1543
|
+
if (i < Pt || i > e - Ft || a < It || a > 216) return;
|
|
1564
1544
|
let o = t.currentTarget, c = o.parentElement;
|
|
1565
1545
|
if (c === null) return;
|
|
1566
1546
|
let l = p(r, t.clientX, t.clientY);
|
|
1567
1547
|
u({
|
|
1568
1548
|
start: l,
|
|
1569
1549
|
end: l
|
|
1570
|
-
}), d.current =
|
|
1550
|
+
}), d.current = I(c, t.nativeEvent, {
|
|
1571
1551
|
cancelOnEscape: !0,
|
|
1572
1552
|
onMove: ({ x: e, y: t }) => u({
|
|
1573
1553
|
start: l,
|
|
@@ -1575,75 +1555,78 @@ function Ot({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a,
|
|
|
1575
1555
|
}),
|
|
1576
1556
|
onEnd: (e, t) => {
|
|
1577
1557
|
if (d.current = null, u(null), t) return;
|
|
1578
|
-
let n = p(o.getBoundingClientRect(), e.clientX, e.clientY)
|
|
1579
|
-
s.onChange({
|
|
1558
|
+
let n = p(o.getBoundingClientRect(), e.clientX, e.clientY), r = {
|
|
1580
1559
|
x: [Math.min(l.x, n.x), Math.max(l.x, n.x)],
|
|
1581
1560
|
y: [Math.min(l.y, n.y), Math.max(l.y, n.y)]
|
|
1561
|
+
};
|
|
1562
|
+
ne({ options: () => s }, "onChange", r, {
|
|
1563
|
+
reason: "drag",
|
|
1564
|
+
event: e
|
|
1582
1565
|
});
|
|
1583
1566
|
}
|
|
1584
1567
|
});
|
|
1585
1568
|
}
|
|
1586
|
-
return /* @__PURE__ */
|
|
1569
|
+
return /* @__PURE__ */ V("svg", {
|
|
1587
1570
|
width: e,
|
|
1588
|
-
height:
|
|
1589
|
-
viewBox: `0 0 ${e} ${
|
|
1571
|
+
height: Nt,
|
|
1572
|
+
viewBox: `0 0 ${e} ${Nt}`,
|
|
1590
1573
|
"aria-hidden": !0,
|
|
1591
1574
|
onPointerDown: m,
|
|
1592
|
-
...
|
|
1575
|
+
...k.props(w.svg, s !== void 0 && zt.brush),
|
|
1593
1576
|
children: [
|
|
1594
|
-
/* @__PURE__ */
|
|
1577
|
+
/* @__PURE__ */ B("defs", { children: /* @__PURE__ */ B("clipPath", {
|
|
1595
1578
|
id: c,
|
|
1596
|
-
children: /* @__PURE__ */
|
|
1597
|
-
x:
|
|
1598
|
-
y:
|
|
1599
|
-
width: Math.max(0, e -
|
|
1579
|
+
children: /* @__PURE__ */ B("rect", {
|
|
1580
|
+
x: Pt,
|
|
1581
|
+
y: It,
|
|
1582
|
+
width: Math.max(0, e - Pt - Ft),
|
|
1600
1583
|
height: 204
|
|
1601
1584
|
})
|
|
1602
1585
|
}) }),
|
|
1603
|
-
t.ticks(5).map((e) => /* @__PURE__ */
|
|
1586
|
+
t.ticks(5).map((e) => /* @__PURE__ */ V("g", { children: [/* @__PURE__ */ B("line", {
|
|
1604
1587
|
x1: t(e),
|
|
1605
1588
|
x2: t(e),
|
|
1606
|
-
y1:
|
|
1589
|
+
y1: It,
|
|
1607
1590
|
y2: 216,
|
|
1608
|
-
...
|
|
1609
|
-
}), /* @__PURE__ */
|
|
1591
|
+
...k.props(w.grid)
|
|
1592
|
+
}), /* @__PURE__ */ B("text", {
|
|
1610
1593
|
x: t(e),
|
|
1611
1594
|
y: 234,
|
|
1612
1595
|
textAnchor: "middle",
|
|
1613
|
-
...
|
|
1596
|
+
...k.props(w.label, w.tick),
|
|
1614
1597
|
children: a(e)
|
|
1615
1598
|
})] }, e)),
|
|
1616
|
-
n.ticks(4).map((t) => /* @__PURE__ */
|
|
1617
|
-
x1:
|
|
1618
|
-
x2: e -
|
|
1599
|
+
n.ticks(4).map((t) => /* @__PURE__ */ V("g", { children: [/* @__PURE__ */ B("line", {
|
|
1600
|
+
x1: Pt,
|
|
1601
|
+
x2: e - Ft,
|
|
1619
1602
|
y1: n(t),
|
|
1620
1603
|
y2: n(t),
|
|
1621
|
-
...
|
|
1622
|
-
}), /* @__PURE__ */
|
|
1604
|
+
...k.props(w.grid)
|
|
1605
|
+
}), /* @__PURE__ */ B("text", {
|
|
1623
1606
|
x: 48,
|
|
1624
1607
|
y: n(t) + 4,
|
|
1625
1608
|
textAnchor: "end",
|
|
1626
|
-
...
|
|
1609
|
+
...k.props(w.label, w.tick),
|
|
1627
1610
|
children: o(t)
|
|
1628
1611
|
})] }, t)),
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
x: (
|
|
1612
|
+
/* @__PURE__ */ B("text", {
|
|
1613
|
+
x: (Pt + e - Ft) / 2,
|
|
1631
1614
|
y: 256,
|
|
1632
1615
|
textAnchor: "middle",
|
|
1633
|
-
...
|
|
1616
|
+
...k.props(w.label, w.tick),
|
|
1634
1617
|
children: r
|
|
1635
1618
|
}),
|
|
1636
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ B("text", {
|
|
1637
1620
|
x: 12,
|
|
1638
1621
|
y: 108,
|
|
1639
1622
|
textAnchor: "middle",
|
|
1640
1623
|
transform: "rotate(-90 12 108)",
|
|
1641
|
-
...
|
|
1624
|
+
...k.props(w.label),
|
|
1642
1625
|
children: i
|
|
1643
1626
|
}),
|
|
1644
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ B("g", {
|
|
1645
1628
|
clipPath: `url(#${c})`,
|
|
1646
|
-
children: f != null && /* @__PURE__ */
|
|
1629
|
+
children: f != null && /* @__PURE__ */ B("rect", {
|
|
1647
1630
|
x: t(f.x[0]),
|
|
1648
1631
|
y: n(f.y[1]),
|
|
1649
1632
|
width: t(f.x[1]) - t(f.x[0]),
|
|
@@ -1654,91 +1637,96 @@ function Ot({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a,
|
|
|
1654
1637
|
]
|
|
1655
1638
|
});
|
|
1656
1639
|
}
|
|
1657
|
-
function
|
|
1640
|
+
function Ht({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: a, formatY: o }) {
|
|
1658
1641
|
let s = e.value ?? {
|
|
1659
1642
|
x: t,
|
|
1660
1643
|
y: n
|
|
1661
1644
|
};
|
|
1662
|
-
return /* @__PURE__ */
|
|
1645
|
+
return /* @__PURE__ */ V("fieldset", {
|
|
1663
1646
|
className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
|
|
1664
1647
|
children: [
|
|
1665
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ B("legend", {
|
|
1666
1649
|
className: "x153jb6y xy8obcc x1jfksii",
|
|
1667
1650
|
children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
|
|
1668
1651
|
}),
|
|
1669
|
-
/* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ V(O.Root, {
|
|
1670
1653
|
value: [...s.x],
|
|
1671
1654
|
format: a,
|
|
1672
1655
|
min: t[0],
|
|
1673
1656
|
max: t[1],
|
|
1674
1657
|
step: e.xStep,
|
|
1675
1658
|
locale: e.locale,
|
|
1676
|
-
onValueChange: (t) => e.onChange({
|
|
1659
|
+
onValueChange: (t, n) => e.onChange({
|
|
1677
1660
|
x: t,
|
|
1678
1661
|
y: s.y
|
|
1679
|
-
}),
|
|
1680
|
-
children: [/* @__PURE__ */
|
|
1662
|
+
}, n),
|
|
1663
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1681
1664
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
1682
|
-
children: [/* @__PURE__ */ O
|
|
1665
|
+
children: [/* @__PURE__ */ B(O.Label, { children: r }), /* @__PURE__ */ V("span", { children: [
|
|
1683
1666
|
a(s.x[0]),
|
|
1684
1667
|
" – ",
|
|
1685
1668
|
a(s.x[1])
|
|
1686
1669
|
] })]
|
|
1687
|
-
}), /* @__PURE__ */ O
|
|
1688
|
-
/* @__PURE__ */ O
|
|
1689
|
-
/* @__PURE__ */ O
|
|
1670
|
+
}), /* @__PURE__ */ B(O.Control, { children: /* @__PURE__ */ V(O.Track, { children: [
|
|
1671
|
+
/* @__PURE__ */ B(O.Indicator, {}),
|
|
1672
|
+
/* @__PURE__ */ B(O.Thumb, {
|
|
1690
1673
|
index: 0,
|
|
1691
1674
|
"aria-label": `${r} minimum`
|
|
1692
1675
|
}),
|
|
1693
|
-
/* @__PURE__ */ O
|
|
1676
|
+
/* @__PURE__ */ B(O.Thumb, {
|
|
1694
1677
|
index: 1,
|
|
1695
1678
|
"aria-label": `${r} maximum`
|
|
1696
1679
|
})
|
|
1697
1680
|
] }) })]
|
|
1698
1681
|
}),
|
|
1699
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ V(O.Root, {
|
|
1700
1683
|
value: [...s.y],
|
|
1701
1684
|
format: o,
|
|
1702
1685
|
min: n[0],
|
|
1703
1686
|
max: n[1],
|
|
1704
1687
|
step: e.yStep,
|
|
1705
1688
|
locale: e.locale,
|
|
1706
|
-
onValueChange: (t) => e.onChange({
|
|
1689
|
+
onValueChange: (t, n) => e.onChange({
|
|
1707
1690
|
x: s.x,
|
|
1708
1691
|
y: t
|
|
1709
|
-
}),
|
|
1710
|
-
children: [/* @__PURE__ */
|
|
1692
|
+
}, n),
|
|
1693
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1711
1694
|
className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
|
|
1712
|
-
children: [/* @__PURE__ */ O
|
|
1695
|
+
children: [/* @__PURE__ */ B(O.Label, { children: i }), /* @__PURE__ */ V("span", { children: [
|
|
1713
1696
|
o(s.y[0]),
|
|
1714
1697
|
" – ",
|
|
1715
1698
|
o(s.y[1])
|
|
1716
1699
|
] })]
|
|
1717
|
-
}), /* @__PURE__ */ O
|
|
1718
|
-
/* @__PURE__ */ O
|
|
1719
|
-
/* @__PURE__ */ O
|
|
1700
|
+
}), /* @__PURE__ */ B(O.Control, { children: /* @__PURE__ */ V(O.Track, { children: [
|
|
1701
|
+
/* @__PURE__ */ B(O.Indicator, {}),
|
|
1702
|
+
/* @__PURE__ */ B(O.Thumb, {
|
|
1720
1703
|
index: 0,
|
|
1721
1704
|
"aria-label": `${i} minimum`
|
|
1722
1705
|
}),
|
|
1723
|
-
/* @__PURE__ */ O
|
|
1706
|
+
/* @__PURE__ */ B(O.Thumb, {
|
|
1724
1707
|
index: 1,
|
|
1725
1708
|
"aria-label": `${i} maximum`
|
|
1726
1709
|
})
|
|
1727
1710
|
] }) })]
|
|
1728
1711
|
}),
|
|
1729
|
-
/* @__PURE__ */
|
|
1712
|
+
/* @__PURE__ */ B(D, {
|
|
1730
1713
|
type: "button",
|
|
1731
1714
|
disabled: e.value === null,
|
|
1732
|
-
onClick: () =>
|
|
1715
|
+
onClick: (t) => {
|
|
1716
|
+
ne({ options: () => e }, "onChange", null, {
|
|
1717
|
+
reason: "clear-press",
|
|
1718
|
+
event: t.nativeEvent
|
|
1719
|
+
});
|
|
1720
|
+
},
|
|
1733
1721
|
children: "Clear range"
|
|
1734
1722
|
})
|
|
1735
1723
|
]
|
|
1736
1724
|
});
|
|
1737
1725
|
}
|
|
1738
|
-
function
|
|
1739
|
-
if (!
|
|
1740
|
-
if (e.length > 1e3) return `This plot exceeds the ${
|
|
1741
|
-
if (!
|
|
1726
|
+
function Ut({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
|
|
1727
|
+
if (!h(t) || !h(n)) return "Scatter domains must contain finite, increasing endpoints.";
|
|
1728
|
+
if (e.length > 1e3) return `This plot exceeds the ${Lt}-point render limit. Supply a smaller, labelled sample.`;
|
|
1729
|
+
if (!m(e)) return "Scatter points must have unique identifiers.";
|
|
1742
1730
|
if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
|
|
1743
1731
|
if (e.some((e) => {
|
|
1744
1732
|
let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
|
|
@@ -1748,9 +1736,9 @@ function At({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
|
|
|
1748
1736
|
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];
|
|
1749
1737
|
if (!i || !a) return "Range selection steps must be finite, positive, and no larger than their domain span.";
|
|
1750
1738
|
let o = r.value;
|
|
1751
|
-
return o === null ? null : !
|
|
1739
|
+
return o === null ? null : !Wt(o.x, t) || !Wt(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
|
|
1752
1740
|
}
|
|
1753
|
-
function
|
|
1741
|
+
function Wt(e, t) {
|
|
1754
1742
|
return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
|
|
1755
1743
|
}
|
|
1756
1744
|
// packages/charts/src/cartesian/time-series-data.ts
|
|
@@ -1759,7 +1747,7 @@ var $ = {
|
|
|
1759
1747
|
pointsPerSeries: 2e3,
|
|
1760
1748
|
markers: 200,
|
|
1761
1749
|
panels: 12
|
|
1762
|
-
},
|
|
1750
|
+
}, Gt = .01, Kt = [
|
|
1763
1751
|
"series1",
|
|
1764
1752
|
"series2",
|
|
1765
1753
|
"series3",
|
|
@@ -1767,13 +1755,13 @@ var $ = {
|
|
|
1767
1755
|
"series5",
|
|
1768
1756
|
"series6"
|
|
1769
1757
|
];
|
|
1770
|
-
function
|
|
1758
|
+
function qt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
1771
1759
|
let i = e[0]?.points.map((e) => e.timestamp) ?? r;
|
|
1772
1760
|
if (e.length > $.series || i.length > $.pointsPerSeries || n.length > $.markers) return `Choose a window with at most ${$.series} series, ${$.pointsPerSeries} observations per series, and ${$.markers} markers.`;
|
|
1773
|
-
if (!
|
|
1761
|
+
if (!m(e) || !m(n)) return "Series and markers require unique identifiers.";
|
|
1774
1762
|
for (let n of e) {
|
|
1775
1763
|
if (n.points.length !== i.length) return "Every series must supply the same observation timestamps.";
|
|
1776
|
-
let e =
|
|
1764
|
+
let e = Qt({
|
|
1777
1765
|
points: n.points,
|
|
1778
1766
|
timestamps: i,
|
|
1779
1767
|
isStacked: t
|
|
@@ -1781,7 +1769,7 @@ function Pt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
|
1781
1769
|
if (e !== void 0) return e;
|
|
1782
1770
|
}
|
|
1783
1771
|
for (let t of n) {
|
|
1784
|
-
let n =
|
|
1772
|
+
let n = Jt({
|
|
1785
1773
|
marker: t,
|
|
1786
1774
|
series: e,
|
|
1787
1775
|
timestamps: i
|
|
@@ -1792,7 +1780,7 @@ function Pt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
|
1792
1780
|
if (!Number.isFinite(o) || !Number.isFinite(s)) return "The elapsed-time and value ranges must be finite.";
|
|
1793
1781
|
if (t && i.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
|
|
1794
1782
|
}
|
|
1795
|
-
function
|
|
1783
|
+
function Jt({ marker: e, series: t, timestamps: n }) {
|
|
1796
1784
|
if (e.kind === "event") {
|
|
1797
1785
|
let t = n[0] ?? 0, r = n.at(-1) ?? t, i = e.timestamp >= t && e.timestamp <= r;
|
|
1798
1786
|
return Number.isFinite(e.timestamp) && i ? void 0 : "Every event marker must fall inside the observed time range.";
|
|
@@ -1800,7 +1788,7 @@ function Ft({ marker: e, series: t, timestamps: n }) {
|
|
|
1800
1788
|
if (!n.includes(e.timestamp)) return "Every time and point marker must align with an observation timestamp.";
|
|
1801
1789
|
if (e.kind !== "time") return t.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.value === e.value ? void 0 : "Point markers must reference the recorded series value.";
|
|
1802
1790
|
}
|
|
1803
|
-
function
|
|
1791
|
+
function Yt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
1804
1792
|
return JSON.stringify([
|
|
1805
1793
|
n,
|
|
1806
1794
|
r,
|
|
@@ -1820,15 +1808,15 @@ function It({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
|
1820
1808
|
])
|
|
1821
1809
|
]);
|
|
1822
1810
|
}
|
|
1823
|
-
function
|
|
1811
|
+
function Xt(e, t, n = !1) {
|
|
1824
1812
|
if (e !== t) return [e, t];
|
|
1825
|
-
let r = Math.max(1, Math.abs(e) *
|
|
1813
|
+
let r = Math.max(1, Math.abs(e) * Gt), i = n ? 0 : e - r, a = t + r;
|
|
1826
1814
|
return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
|
|
1827
1815
|
}
|
|
1828
|
-
function
|
|
1816
|
+
function Zt(e, t) {
|
|
1829
1817
|
let n = e.filter((e) => e.tone === void 0);
|
|
1830
1818
|
return e.map((r, i) => {
|
|
1831
|
-
let a = n.findIndex((e) => e.id === r.id), o = r.tone ??
|
|
1819
|
+
let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? Kt[a % Kt.length] ?? "series1", s = r.points.map((n, r) => {
|
|
1832
1820
|
let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
|
|
1833
1821
|
return {
|
|
1834
1822
|
...n,
|
|
@@ -1843,7 +1831,7 @@ function Rt(e, t) {
|
|
|
1843
1831
|
};
|
|
1844
1832
|
});
|
|
1845
1833
|
}
|
|
1846
|
-
function
|
|
1834
|
+
function Qt({ points: e, timestamps: t, isStacked: n }) {
|
|
1847
1835
|
for (let [r, i] of e.entries()) {
|
|
1848
1836
|
let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
|
|
1849
1837
|
if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
|
|
@@ -1852,20 +1840,20 @@ function zt({ points: e, timestamps: t, isStacked: n }) {
|
|
|
1852
1840
|
}
|
|
1853
1841
|
}
|
|
1854
1842
|
// packages/charts/src/cartesian/time-series-line.tsx
|
|
1855
|
-
function
|
|
1843
|
+
function $t({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }) {
|
|
1856
1844
|
let o = t.points.findLastIndex((e) => e.value !== null);
|
|
1857
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(se, {
|
|
1858
1846
|
data: [...t.points],
|
|
1859
1847
|
defined: (e) => e.value !== null,
|
|
1860
1848
|
x: (e) => n(e.timestamp),
|
|
1861
1849
|
y: (e) => r((e.value ?? 0) + e.base),
|
|
1862
1850
|
stroke: e[t.tone],
|
|
1863
|
-
...
|
|
1851
|
+
...k.props(w.mark)
|
|
1864
1852
|
}), t.points.filter((e, n) => {
|
|
1865
1853
|
if (e.value === null) return !1;
|
|
1866
1854
|
let r = t.points[n - 1]?.value === null || t.points[n + 1]?.value === null, a = t.points.length === 1, s = n === o, c = e.timestamp === i;
|
|
1867
1855
|
return a || s ? !0 : r || c;
|
|
1868
|
-
}).map((i) => /* @__PURE__ */
|
|
1856
|
+
}).map((i) => /* @__PURE__ */ B("circle", {
|
|
1869
1857
|
cx: n(i.timestamp),
|
|
1870
1858
|
cy: r((i.value ?? 0) + i.base),
|
|
1871
1859
|
r: a,
|
|
@@ -1873,12 +1861,12 @@ function Bt({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }
|
|
|
1873
1861
|
}, i.timestamp))] });
|
|
1874
1862
|
}
|
|
1875
1863
|
// packages/charts/src/cartesian/sparkline.tsx
|
|
1876
|
-
var
|
|
1864
|
+
var en = {
|
|
1877
1865
|
minimum: "Lowest",
|
|
1878
1866
|
maximum: "Highest",
|
|
1879
1867
|
last: "Latest"
|
|
1880
|
-
},
|
|
1881
|
-
function
|
|
1868
|
+
}, tn = 2.5;
|
|
1869
|
+
function nn({ points: e, marked: t }) {
|
|
1882
1870
|
let n = e.flatMap((e) => e.value === null ? [] : [{
|
|
1883
1871
|
...e,
|
|
1884
1872
|
value: e.value
|
|
@@ -1895,8 +1883,8 @@ function Ut({ points: e, marked: t }) {
|
|
|
1895
1883
|
}];
|
|
1896
1884
|
});
|
|
1897
1885
|
}
|
|
1898
|
-
function
|
|
1899
|
-
let l =
|
|
1886
|
+
function rn({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueDomain: o, markedPoints: s = [], baseline: c }) {
|
|
1887
|
+
let l = M(), u = M(), d = an({
|
|
1900
1888
|
title: t,
|
|
1901
1889
|
summary: n,
|
|
1902
1890
|
unit: r,
|
|
@@ -1905,24 +1893,24 @@ function Wt({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueD
|
|
|
1905
1893
|
markedPoints: s,
|
|
1906
1894
|
baseline: c
|
|
1907
1895
|
}), f = a.points.some((e) => e.value !== null);
|
|
1908
|
-
if (d !== void 0 || !f) return /* @__PURE__ */
|
|
1896
|
+
if (d !== void 0 || !f) return /* @__PURE__ */ B("span", {
|
|
1909
1897
|
role: "img",
|
|
1910
1898
|
"aria-label": `${t}. ${n} Values in ${r}; timestamps in ${i}. ${d ?? "No recorded values. Missing observations remain unavailable."}`,
|
|
1911
1899
|
title: d ?? "No recorded values",
|
|
1912
1900
|
className: "x2pejg6 x10w6t97 x2lah0s xxymvpz x3nfvp2 x6s0dn4 xl56j7k x153jb6y x1hz01jw xy8obcc",
|
|
1913
1901
|
children: d === void 0 ? "No data" : "Invalid trend"
|
|
1914
1902
|
});
|
|
1915
|
-
let p = a.points[0]?.timestamp ?? 0, m = a.points.at(-1)?.timestamp ?? p, h =
|
|
1916
|
-
domain: [...
|
|
1903
|
+
let p = a.points[0]?.timestamp ?? 0, m = a.points.at(-1)?.timestamp ?? p, h = H({
|
|
1904
|
+
domain: [...Xt(p, m)],
|
|
1917
1905
|
range: [3, 125]
|
|
1918
|
-
}), g =
|
|
1906
|
+
}), g = H({
|
|
1919
1907
|
domain: [...o],
|
|
1920
1908
|
range: [29, 3]
|
|
1921
|
-
}), _ =
|
|
1909
|
+
}), _ = Zt([a], !1)[0], v = e[_?.tone ?? "series1"], y = nn({
|
|
1922
1910
|
points: a.points,
|
|
1923
1911
|
marked: s
|
|
1924
|
-
}),
|
|
1925
|
-
return /* @__PURE__ */
|
|
1912
|
+
}), b = y.map(({ kind: e, point: t }) => `${en[e]}: ${t.value} ${r}.`).join(" "), ee = c === void 0 ? "" : `Reference: ${c} ${r}.`;
|
|
1913
|
+
return /* @__PURE__ */ V("svg", {
|
|
1926
1914
|
role: "img",
|
|
1927
1915
|
"aria-labelledby": l,
|
|
1928
1916
|
"aria-describedby": u,
|
|
@@ -1932,11 +1920,11 @@ function Wt({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueD
|
|
|
1932
1920
|
height: 32,
|
|
1933
1921
|
className: "x1rg5ohu x2pejg6 x10w6t97 x2lah0s xxymvpz",
|
|
1934
1922
|
children: [
|
|
1935
|
-
/* @__PURE__ */
|
|
1923
|
+
/* @__PURE__ */ B("title", {
|
|
1936
1924
|
id: l,
|
|
1937
1925
|
children: t
|
|
1938
1926
|
}),
|
|
1939
|
-
/* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ V("desc", {
|
|
1940
1928
|
id: u,
|
|
1941
1929
|
children: [
|
|
1942
1930
|
n,
|
|
@@ -1952,43 +1940,43 @@ function Wt({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueD
|
|
|
1952
1940
|
" ",
|
|
1953
1941
|
r,
|
|
1954
1942
|
". ",
|
|
1955
|
-
|
|
1943
|
+
b,
|
|
1956
1944
|
" ",
|
|
1957
|
-
|
|
1945
|
+
ee
|
|
1958
1946
|
]
|
|
1959
1947
|
}),
|
|
1960
|
-
c !== void 0 && /* @__PURE__ */
|
|
1948
|
+
c !== void 0 && /* @__PURE__ */ B("line", {
|
|
1961
1949
|
x1: 3,
|
|
1962
1950
|
x2: 125,
|
|
1963
1951
|
y1: g(c),
|
|
1964
1952
|
y2: g(c),
|
|
1965
1953
|
className: "x1crw9hw xnpr05h xbw2l0c x13efnbd"
|
|
1966
1954
|
}),
|
|
1967
|
-
_ !== void 0 && /* @__PURE__ */
|
|
1955
|
+
_ !== void 0 && /* @__PURE__ */ B($t, {
|
|
1968
1956
|
series: _,
|
|
1969
1957
|
x: h,
|
|
1970
1958
|
y: g,
|
|
1971
1959
|
pointRadius: 2
|
|
1972
1960
|
}),
|
|
1973
|
-
y.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */
|
|
1961
|
+
y.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */ B("circle", {
|
|
1974
1962
|
cx: h(t.timestamp),
|
|
1975
1963
|
cy: g(t.value),
|
|
1976
|
-
r:
|
|
1964
|
+
r: tn,
|
|
1977
1965
|
fill: v
|
|
1978
|
-
}, e) : /* @__PURE__ */
|
|
1966
|
+
}, e) : /* @__PURE__ */ B("circle", {
|
|
1979
1967
|
cx: h(t.timestamp),
|
|
1980
1968
|
cy: g(t.value),
|
|
1981
|
-
r:
|
|
1969
|
+
r: tn,
|
|
1982
1970
|
stroke: v,
|
|
1983
1971
|
className: "x1fytgo2 x1r6sdyr x13efnbd"
|
|
1984
1972
|
}, e))
|
|
1985
1973
|
]
|
|
1986
1974
|
});
|
|
1987
1975
|
}
|
|
1988
|
-
function
|
|
1976
|
+
function an({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPoints: a, baseline: o }) {
|
|
1989
1977
|
if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
|
|
1990
|
-
if (!
|
|
1991
|
-
let s =
|
|
1978
|
+
if (!h(i)) return "The displayed value domain must have finite, increasing bounds.";
|
|
1979
|
+
let s = qt({
|
|
1992
1980
|
series: [r],
|
|
1993
1981
|
isStacked: !1,
|
|
1994
1982
|
markers: []
|
|
@@ -1999,10 +1987,10 @@ function Gt({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPo
|
|
|
1999
1987
|
if (!(o === void 0 || o >= i[0] && o <= i[1])) return "The reference value must be inside the declared value domain.";
|
|
2000
1988
|
}
|
|
2001
1989
|
// packages/charts/src/cartesian/time-series-bands.ts
|
|
2002
|
-
var
|
|
1990
|
+
var on = {
|
|
2003
1991
|
bands: 4,
|
|
2004
1992
|
crossings: 4
|
|
2005
|
-
},
|
|
1993
|
+
}, sn = [
|
|
2006
1994
|
"series1",
|
|
2007
1995
|
"series2",
|
|
2008
1996
|
"series3",
|
|
@@ -2010,7 +1998,7 @@ var Kt = {
|
|
|
2010
1998
|
"series5",
|
|
2011
1999
|
"series6"
|
|
2012
2000
|
];
|
|
2013
|
-
function
|
|
2001
|
+
function cn(e) {
|
|
2014
2002
|
let t = [
|
|
2015
2003
|
e.lower,
|
|
2016
2004
|
e.center,
|
|
@@ -2018,28 +2006,28 @@ function Jt(e) {
|
|
|
2018
2006
|
].filter((e) => e !== null);
|
|
2019
2007
|
return t.some((e) => !Number.isFinite(e)) ? "Band values must be finite numbers or explicit missing values." : e.lower === null == (e.upper === null) ? t.every((e, n) => n === 0 || (t[n - 1] ?? e) <= e) ? void 0 : "Band values must satisfy lower ≤ center ≤ upper." : "A band observation needs both bounds or neither.";
|
|
2020
2008
|
}
|
|
2021
|
-
function
|
|
2022
|
-
if (e.length >
|
|
2023
|
-
if (!
|
|
2009
|
+
function ln({ bands: e, crossings: t, series: n, timestamps: r }) {
|
|
2010
|
+
if (e.length > on.bands || t.length > on.crossings) return `Supply at most ${on.bands} bands and ${on.crossings} crossings.`;
|
|
2011
|
+
if (!m([...n, ...e]) || !m(t)) return "Series, bands, and crossings require unique identifiers.";
|
|
2024
2012
|
for (let t of e) {
|
|
2025
2013
|
if (t.points.length !== r.length || t.points.some((e, t) => e.timestamp !== r[t])) return "Every band must supply the same observation timestamps as the series.";
|
|
2026
|
-
let e = t.points.map(
|
|
2014
|
+
let e = t.points.map(cn).find((e) => e !== void 0);
|
|
2027
2015
|
if (e !== void 0) return e;
|
|
2028
2016
|
}
|
|
2029
2017
|
let i = new Set([...n, ...e].map((e) => e.id));
|
|
2030
2018
|
for (let e of t) if (!(i.has(e.seriesId) && e.label.trim() !== "") || !Number.isFinite(e.value)) return "Each crossing needs a label, a finite value, and a supplied series or band.";
|
|
2031
2019
|
}
|
|
2032
|
-
function
|
|
2020
|
+
function un({ series: e, bands: t }) {
|
|
2033
2021
|
let n = e.filter((e) => e.tone === void 0).length, r = t.filter((e) => e.tone === void 0);
|
|
2034
2022
|
return t.map((e) => {
|
|
2035
2023
|
let t = n + r.findIndex((t) => t.id === e.id);
|
|
2036
2024
|
return {
|
|
2037
2025
|
...e,
|
|
2038
|
-
tone: e.tone ??
|
|
2026
|
+
tone: e.tone ?? sn[t % sn.length] ?? "series1"
|
|
2039
2027
|
};
|
|
2040
2028
|
});
|
|
2041
2029
|
}
|
|
2042
|
-
function
|
|
2030
|
+
function dn({ start: e, end: t, value: n, direction: r }) {
|
|
2043
2031
|
let i = e > n && t <= n, a = e < n && t >= n;
|
|
2044
2032
|
switch (r) {
|
|
2045
2033
|
case "falling": return i;
|
|
@@ -2047,7 +2035,7 @@ function Zt({ start: e, end: t, value: n, direction: r }) {
|
|
|
2047
2035
|
case void 0: return i || a;
|
|
2048
2036
|
}
|
|
2049
2037
|
}
|
|
2050
|
-
function
|
|
2038
|
+
function fn({ points: e, crossing: t }) {
|
|
2051
2039
|
let n = e.flatMap((t, n) => {
|
|
2052
2040
|
let r = e[n + 1];
|
|
2053
2041
|
return t.value === null || r === void 0 || r.value === null ? [] : [{
|
|
@@ -2056,7 +2044,7 @@ function Qt({ points: e, crossing: t }) {
|
|
|
2056
2044
|
from: t.value,
|
|
2057
2045
|
to: r.value
|
|
2058
2046
|
}];
|
|
2059
|
-
}).find(({ from: e, to: n }) =>
|
|
2047
|
+
}).find(({ from: e, to: n }) => dn({
|
|
2060
2048
|
start: e,
|
|
2061
2049
|
end: n,
|
|
2062
2050
|
value: t.value,
|
|
@@ -2066,10 +2054,10 @@ function Qt({ points: e, crossing: t }) {
|
|
|
2066
2054
|
let r = (t.value - n.from) / (n.to - n.from);
|
|
2067
2055
|
return n.start + r * (n.end - n.start);
|
|
2068
2056
|
}
|
|
2069
|
-
function
|
|
2057
|
+
function pn({ crossings: e, series: t, bands: n }) {
|
|
2070
2058
|
return e.map((e) => ({
|
|
2071
2059
|
crossing: e,
|
|
2072
|
-
timestamp:
|
|
2060
|
+
timestamp: fn({
|
|
2073
2061
|
points: t.find((t) => t.id === e.seriesId)?.points ?? n.find((t) => t.id === e.seriesId)?.points.map((e) => ({
|
|
2074
2062
|
timestamp: e.timestamp,
|
|
2075
2063
|
value: e.center
|
|
@@ -2078,34 +2066,192 @@ function $t({ crossings: e, series: t, bands: n }) {
|
|
|
2078
2066
|
})
|
|
2079
2067
|
}));
|
|
2080
2068
|
}
|
|
2081
|
-
function
|
|
2069
|
+
function mn(e, t) {
|
|
2082
2070
|
let n = Math.min(...e.map((e) => Math.abs(e - t)));
|
|
2083
2071
|
return e.find((e) => Math.abs(e - t) === n);
|
|
2084
2072
|
}
|
|
2085
|
-
function
|
|
2073
|
+
function hn(e) {
|
|
2086
2074
|
return e.flatMap((e) => e.points.flatMap((e) => [
|
|
2087
2075
|
e.lower,
|
|
2088
2076
|
e.center,
|
|
2089
2077
|
e.upper
|
|
2090
2078
|
].filter((e) => e !== null)));
|
|
2091
2079
|
}
|
|
2080
|
+
// packages/charts/src/chart-range.tsx
|
|
2081
|
+
var gn = "axis", _n = "selected", vn = "drawn";
|
|
2082
|
+
function yn({ value: e }) {
|
|
2083
|
+
return {
|
|
2084
|
+
value: e,
|
|
2085
|
+
spans: e === null ? [] : [{
|
|
2086
|
+
id: _n,
|
|
2087
|
+
track: gn,
|
|
2088
|
+
start: e[0],
|
|
2089
|
+
end: e[1]
|
|
2090
|
+
}]
|
|
2091
|
+
};
|
|
2092
|
+
}
|
|
2093
|
+
function bn(e, t) {
|
|
2094
|
+
let { draft: n } = e;
|
|
2095
|
+
return n?.action === "draw" ? t.filter((e) => e.id === n.id) : t;
|
|
2096
|
+
}
|
|
2097
|
+
var xn = te({
|
|
2098
|
+
name: "chart-range",
|
|
2099
|
+
options: {
|
|
2100
|
+
value: "value",
|
|
2101
|
+
onValueChange: "callback",
|
|
2102
|
+
min: "number",
|
|
2103
|
+
max: "number",
|
|
2104
|
+
step: "number",
|
|
2105
|
+
describe: "value"
|
|
2106
|
+
},
|
|
2107
|
+
controlled: ["value"],
|
|
2108
|
+
state: (e) => ({
|
|
2109
|
+
...yn(e),
|
|
2110
|
+
draft: null
|
|
2111
|
+
}),
|
|
2112
|
+
sync: yn,
|
|
2113
|
+
api: (e) => {
|
|
2114
|
+
let t = L(e);
|
|
2115
|
+
function n(n, { id: r, action: i, reason: a, event: o }) {
|
|
2116
|
+
let s = i === "delete" ? void 0 : n.find((e) => e.id === r), c = s === void 0 ? null : [s.start, s.end], l = t("value", c, o === void 0 ? { reason: a } : {
|
|
2117
|
+
reason: a,
|
|
2118
|
+
event: o
|
|
2119
|
+
});
|
|
2120
|
+
return l && i === "delete" && e.element("root")?.querySelector("[tabindex=\"0\"]:not([data-span-id])")?.focus(), l;
|
|
2121
|
+
}
|
|
2122
|
+
let r = R(e, {
|
|
2123
|
+
key: "spans",
|
|
2124
|
+
draft: "draft",
|
|
2125
|
+
axis: "x",
|
|
2126
|
+
min: () => e.options().min,
|
|
2127
|
+
max: () => e.options().max,
|
|
2128
|
+
step: () => e.options().step,
|
|
2129
|
+
create: (e) => ({
|
|
2130
|
+
...e,
|
|
2131
|
+
id: vn
|
|
2132
|
+
}),
|
|
2133
|
+
label: (t) => e.options().describe([t.start, t.end]),
|
|
2134
|
+
createAutoScroll: !1,
|
|
2135
|
+
set: (e, t) => n(e, t)
|
|
2136
|
+
});
|
|
2137
|
+
return {
|
|
2138
|
+
spans: r,
|
|
2139
|
+
shown(t) {
|
|
2140
|
+
return bn(t, r.spans(t)).map((t) => ({
|
|
2141
|
+
id: t.id,
|
|
2142
|
+
label: e.options().describe([t.start, t.end])
|
|
2143
|
+
}));
|
|
2144
|
+
},
|
|
2145
|
+
draw(e) {
|
|
2146
|
+
e.button === 0 && e.pointerType !== "touch" && r.trackPointerdown(e, gn);
|
|
2147
|
+
},
|
|
2148
|
+
setRange(n, r) {
|
|
2149
|
+
let { min: i, max: a, step: o } = e.options(), s = [Number(n), Number(r)].map((e) => i + Math.round((e - i) / o) * o), c = Math.max(i, Math.min(...s)), l = Math.min(a, Math.max(...s));
|
|
2150
|
+
if (!Number.isFinite(c) || !Number.isFinite(l) || c >= l) throw Error(`Give a start and a later end between ${i} and ${a}.`);
|
|
2151
|
+
return t("value", [c, l], { reason: "imperative" });
|
|
2152
|
+
},
|
|
2153
|
+
clear() {
|
|
2154
|
+
return t("value", null, { reason: "imperative" });
|
|
2155
|
+
}
|
|
2156
|
+
};
|
|
2157
|
+
},
|
|
2158
|
+
slots: (e) => ({
|
|
2159
|
+
root: e({
|
|
2160
|
+
role: "group",
|
|
2161
|
+
state: (e, { api: t }) => ({ spans: t.shown(e) }),
|
|
2162
|
+
on: { pointerdown: (e, { api: t }) => t.draw(e) }
|
|
2163
|
+
}),
|
|
2164
|
+
track: e({ bind: (e, { api: t }) => t.spans.bindTrack(e, gn) }),
|
|
2165
|
+
span: e({
|
|
2166
|
+
role: "group",
|
|
2167
|
+
props: { value: "string" },
|
|
2168
|
+
attrs: (e, { api: t, key: n }) => {
|
|
2169
|
+
let r = t.spans.spans(e).find((e) => e.id === n);
|
|
2170
|
+
return {
|
|
2171
|
+
...t.spans.spanAttrs(e, n),
|
|
2172
|
+
tabindex: "0",
|
|
2173
|
+
style: r === void 0 ? void 0 : t.spans.spanStyle(r)
|
|
2174
|
+
};
|
|
2175
|
+
},
|
|
2176
|
+
bind: (e, { api: t, key: n }) => t.spans.bindSpan(e, n),
|
|
2177
|
+
on: {
|
|
2178
|
+
pointerdown: (e, { api: t, key: n }) => t.spans.spanPointerdown(e, n),
|
|
2179
|
+
keydown: (e, { api: t, key: n }) => {
|
|
2180
|
+
t.spans.keydown(e, n);
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
})
|
|
2184
|
+
}),
|
|
2185
|
+
agent: { actions: ["setRange", "clear"] }
|
|
2186
|
+
}), Sn = A(xn, {
|
|
2187
|
+
root: "div",
|
|
2188
|
+
track: "div",
|
|
2189
|
+
span: "div"
|
|
2190
|
+
}), Cn = Sn.Root, wn = Sn.Track, Tn = Sn.Span, En = {
|
|
2191
|
+
kVAEAm: "x10l6tqk",
|
|
2192
|
+
k87sOh: "x13vifvy",
|
|
2193
|
+
kfzvcC: "x47corl",
|
|
2194
|
+
$$css: !0
|
|
2195
|
+
}, Dn = { track: (e, t, n) => [
|
|
2196
|
+
En,
|
|
2197
|
+
{
|
|
2198
|
+
kbCHJM: e == null ? e : "xgq9j65",
|
|
2199
|
+
kzqmXN: t == null ? t : "x5lhr3w",
|
|
2200
|
+
kZKoxP: n == null ? n : "x16ye13r",
|
|
2201
|
+
$$css: !0
|
|
2202
|
+
},
|
|
2203
|
+
{
|
|
2204
|
+
"--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
|
|
2205
|
+
"--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t),
|
|
2206
|
+
"--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(n)
|
|
2207
|
+
}
|
|
2208
|
+
] };
|
|
2209
|
+
function On({ left: e, width: t, height: n, label: r, children: i, ...a }) {
|
|
2210
|
+
return /* @__PURE__ */ B(Cn, {
|
|
2211
|
+
...a,
|
|
2212
|
+
"aria-label": r,
|
|
2213
|
+
className: "x1n2onr6 xeuugli",
|
|
2214
|
+
render: (r, { spans: a }) => /* @__PURE__ */ V("div", {
|
|
2215
|
+
...r,
|
|
2216
|
+
children: [i, /* @__PURE__ */ B(wn, {
|
|
2217
|
+
...k.props(Dn.track(e, t, n)),
|
|
2218
|
+
children: a.map((e) => /* @__PURE__ */ V(Tn, {
|
|
2219
|
+
value: e.id,
|
|
2220
|
+
"aria-label": `Selected range, ${e.label}. Use arrow keys to move it, Shift and an arrow to move its end, and Delete to clear it.`,
|
|
2221
|
+
className: "x10l6tqk x13vifvy x5yr21d x9f619 x1qatu44 x1l0rsgs x1616tdu xbsl7fq xbm8b0d x1n2ykn x1t137rt x19rmrnh x9v5kkp x13qnu6 x1bqaal",
|
|
2222
|
+
children: [
|
|
2223
|
+
/* @__PURE__ */ B("span", { className: "x10l6tqk x67bb7w x5ve5x3 x7it7wx x1ey2m1c xdk7pt x1jm3nie x1o753nm x1jzqe4 x3onkmb" }),
|
|
2224
|
+
/* @__PURE__ */ B("span", {
|
|
2225
|
+
"data-span-edge": "start",
|
|
2226
|
+
className: "x10l6tqk x67bb7w x5ve5x3 x13vifvy x5yr21d x1fsd2vl x7eptgl x1765b1"
|
|
2227
|
+
}),
|
|
2228
|
+
/* @__PURE__ */ B("span", {
|
|
2229
|
+
"data-span-edge": "end",
|
|
2230
|
+
className: "x10l6tqk x67bb7w x5ve5x3 x13vifvy x5yr21d x1fsd2vl x7eptgl xpa5qit"
|
|
2231
|
+
})
|
|
2232
|
+
]
|
|
2233
|
+
}, e.id))
|
|
2234
|
+
})]
|
|
2235
|
+
})
|
|
2236
|
+
});
|
|
2237
|
+
}
|
|
2092
2238
|
// packages/charts/src/cartesian/time-series-overlays.tsx
|
|
2093
|
-
var
|
|
2239
|
+
var kn = {
|
|
2094
2240
|
kDd8S0: "x1bsw5e1",
|
|
2095
2241
|
kfJifR: "xnpr05h",
|
|
2096
2242
|
kDwRjp: "xbh8q5q",
|
|
2097
2243
|
$$css: !0
|
|
2098
|
-
},
|
|
2244
|
+
}, An = {
|
|
2099
2245
|
kVYP8I: "xd6etog",
|
|
2100
2246
|
$$css: !0
|
|
2101
|
-
},
|
|
2247
|
+
}, jn = {
|
|
2102
2248
|
kfJifR: "xvlca1e",
|
|
2103
2249
|
kDwRjp: "xbh8q5q",
|
|
2104
2250
|
kREpy8: "x13efnbd",
|
|
2105
2251
|
$$css: !0
|
|
2106
|
-
},
|
|
2252
|
+
}, Mn = {
|
|
2107
2253
|
bandEdge: (e) => [
|
|
2108
|
-
|
|
2254
|
+
kn,
|
|
2109
2255
|
{
|
|
2110
2256
|
kjVXCG: e == null ? e : "x6mkzkt",
|
|
2111
2257
|
$$css: !0
|
|
@@ -2113,7 +2259,7 @@ var nn = {
|
|
|
2113
2259
|
{ "--x-stroke": e ?? void 0 }
|
|
2114
2260
|
],
|
|
2115
2261
|
bandFill: (e) => [
|
|
2116
|
-
|
|
2262
|
+
An,
|
|
2117
2263
|
{
|
|
2118
2264
|
kDwRjp: e == null ? e : "x19zyb68",
|
|
2119
2265
|
$$css: !0
|
|
@@ -2121,18 +2267,18 @@ var nn = {
|
|
|
2121
2267
|
{ "--x-fill": e ?? void 0 }
|
|
2122
2268
|
],
|
|
2123
2269
|
center: (e) => [
|
|
2124
|
-
|
|
2270
|
+
jn,
|
|
2125
2271
|
{
|
|
2126
2272
|
kjVXCG: e == null ? e : "x6mkzkt",
|
|
2127
2273
|
$$css: !0
|
|
2128
2274
|
},
|
|
2129
2275
|
{ "--x-stroke": e ?? void 0 }
|
|
2130
2276
|
]
|
|
2131
|
-
},
|
|
2132
|
-
function
|
|
2277
|
+
}, Nn = 16, Pn = 6, Fn = 6.5, In = 2.5, Ln = 4, Rn = 12;
|
|
2278
|
+
function zn({ instants: e, x: t, right: n, ends: r }) {
|
|
2133
2279
|
let [i, ...a] = e;
|
|
2134
2280
|
if (i === void 0) return [];
|
|
2135
|
-
let o = t(i.timestamp), s = i.label.length *
|
|
2281
|
+
let o = t(i.timestamp), s = i.label.length * Fn + Pn, c = o + s > n ? "end" : "start", l = c === "start" ? o : o - s, u = c === "start" ? o + s : o, d = r.findIndex((e) => l > e), f = d === -1 ? Math.min(r.length, 1) : d, p = [
|
|
2136
2282
|
...r.slice(0, f),
|
|
2137
2283
|
Math.max(u, r[f] ?? u),
|
|
2138
2284
|
...r.slice(f + 1)
|
|
@@ -2141,94 +2287,94 @@ function pn({ instants: e, x: t, right: n, ends: r }) {
|
|
|
2141
2287
|
...i,
|
|
2142
2288
|
lane: f,
|
|
2143
2289
|
anchor: c
|
|
2144
|
-
}, ...
|
|
2290
|
+
}, ...zn({
|
|
2145
2291
|
instants: a,
|
|
2146
2292
|
x: t,
|
|
2147
2293
|
right: n,
|
|
2148
2294
|
ends: p
|
|
2149
2295
|
})];
|
|
2150
2296
|
}
|
|
2151
|
-
function
|
|
2152
|
-
return
|
|
2297
|
+
function Bn({ instants: e, x: t, right: n }) {
|
|
2298
|
+
return zn({
|
|
2153
2299
|
instants: e.toSorted((e, t) => e.timestamp - t.timestamp),
|
|
2154
2300
|
x: t,
|
|
2155
2301
|
right: n,
|
|
2156
2302
|
ends: []
|
|
2157
2303
|
});
|
|
2158
2304
|
}
|
|
2159
|
-
function
|
|
2160
|
-
return
|
|
2305
|
+
function Vn(e) {
|
|
2306
|
+
return Rn + Math.max(0, ...e.map((e) => e.lane + 1)) * Nn;
|
|
2161
2307
|
}
|
|
2162
|
-
function
|
|
2308
|
+
function Hn(e) {
|
|
2163
2309
|
return e.lower !== null && e.upper !== null;
|
|
2164
2310
|
}
|
|
2165
|
-
function
|
|
2166
|
-
return /* @__PURE__ */
|
|
2311
|
+
function Un({ bands: t, x: n, y: r }) {
|
|
2312
|
+
return /* @__PURE__ */ B("g", { children: t.map((t) => {
|
|
2167
2313
|
let i = e[t.tone], a = [...t.points];
|
|
2168
|
-
return /* @__PURE__ */
|
|
2169
|
-
/* @__PURE__ */
|
|
2314
|
+
return /* @__PURE__ */ V("g", { children: [
|
|
2315
|
+
/* @__PURE__ */ B(ie, {
|
|
2170
2316
|
data: a,
|
|
2171
|
-
defined:
|
|
2317
|
+
defined: Hn,
|
|
2172
2318
|
x: (e) => n(e.timestamp),
|
|
2173
2319
|
y0: (e) => r(e.lower ?? 0),
|
|
2174
2320
|
y1: (e) => r(e.upper ?? 0),
|
|
2175
|
-
...
|
|
2321
|
+
...k.props(Mn.bandFill(i))
|
|
2176
2322
|
}),
|
|
2177
|
-
/* @__PURE__ */
|
|
2323
|
+
/* @__PURE__ */ B(se, {
|
|
2178
2324
|
data: a,
|
|
2179
|
-
defined:
|
|
2325
|
+
defined: Hn,
|
|
2180
2326
|
x: (e) => n(e.timestamp),
|
|
2181
2327
|
y: (e) => r(e.upper ?? 0),
|
|
2182
|
-
...
|
|
2328
|
+
...k.props(Mn.bandEdge(i))
|
|
2183
2329
|
}),
|
|
2184
|
-
/* @__PURE__ */
|
|
2330
|
+
/* @__PURE__ */ B(se, {
|
|
2185
2331
|
data: a,
|
|
2186
|
-
defined:
|
|
2332
|
+
defined: Hn,
|
|
2187
2333
|
x: (e) => n(e.timestamp),
|
|
2188
2334
|
y: (e) => r(e.lower ?? 0),
|
|
2189
|
-
...
|
|
2335
|
+
...k.props(Mn.bandEdge(i))
|
|
2190
2336
|
}),
|
|
2191
|
-
/* @__PURE__ */
|
|
2337
|
+
/* @__PURE__ */ B(se, {
|
|
2192
2338
|
data: a,
|
|
2193
2339
|
defined: (e) => e.center !== null,
|
|
2194
2340
|
x: (e) => n(e.timestamp),
|
|
2195
2341
|
y: (e) => r(e.center ?? 0),
|
|
2196
|
-
...
|
|
2342
|
+
...k.props(Mn.center(i))
|
|
2197
2343
|
})
|
|
2198
2344
|
] }, t.id);
|
|
2199
2345
|
}) });
|
|
2200
2346
|
}
|
|
2201
|
-
function
|
|
2202
|
-
return /* @__PURE__ */
|
|
2347
|
+
function Wn({ placed: e, x: t, y: n, bottom: r }) {
|
|
2348
|
+
return /* @__PURE__ */ B("g", {
|
|
2203
2349
|
"aria-hidden": !0,
|
|
2204
2350
|
children: e.map((e) => {
|
|
2205
|
-
let i = t(e.timestamp), a =
|
|
2206
|
-
return /* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2351
|
+
let i = t(e.timestamp), a = Rn + e.lane * Nn, o = e.anchor === "start" ? i + Pn : i - Pn;
|
|
2352
|
+
return /* @__PURE__ */ V("g", { children: [
|
|
2353
|
+
/* @__PURE__ */ B("line", {
|
|
2208
2354
|
x1: i,
|
|
2209
2355
|
x2: i,
|
|
2210
2356
|
y1: a,
|
|
2211
2357
|
y2: r,
|
|
2212
2358
|
className: "xhq4mlf xnpr05h x1bpwu3k x13efnbd"
|
|
2213
2359
|
}),
|
|
2214
|
-
/* @__PURE__ */
|
|
2360
|
+
/* @__PURE__ */ B("circle", {
|
|
2215
2361
|
cx: i,
|
|
2216
2362
|
cy: a,
|
|
2217
|
-
r:
|
|
2363
|
+
r: In,
|
|
2218
2364
|
className: "xlrhuyr"
|
|
2219
2365
|
}),
|
|
2220
|
-
/* @__PURE__ */
|
|
2366
|
+
/* @__PURE__ */ B("text", {
|
|
2221
2367
|
x: o,
|
|
2222
2368
|
y: a,
|
|
2223
2369
|
textAnchor: e.anchor,
|
|
2224
2370
|
dominantBaseline: "middle",
|
|
2225
|
-
...
|
|
2371
|
+
...k.props(w.label, w.strongLabel, w.haloLabel),
|
|
2226
2372
|
children: e.label
|
|
2227
2373
|
}),
|
|
2228
|
-
e.value !== void 0 && /* @__PURE__ */
|
|
2374
|
+
e.value !== void 0 && /* @__PURE__ */ B("circle", {
|
|
2229
2375
|
cx: i,
|
|
2230
2376
|
cy: n(e.value),
|
|
2231
|
-
r:
|
|
2377
|
+
r: Ln,
|
|
2232
2378
|
className: "x1fytgo2 x17y187c xvlca1e x13efnbd"
|
|
2233
2379
|
})
|
|
2234
2380
|
] }, e.id);
|
|
@@ -2236,7 +2382,7 @@ function vn({ placed: e, x: t, y: n, bottom: r }) {
|
|
|
2236
2382
|
});
|
|
2237
2383
|
}
|
|
2238
2384
|
// packages/charts/src/cartesian/time-series.tsx
|
|
2239
|
-
var
|
|
2385
|
+
var Gn = {
|
|
2240
2386
|
timeAxis: {
|
|
2241
2387
|
k1xSpc: "x78zum5",
|
|
2242
2388
|
kjj79g: "x1qughib",
|
|
@@ -2258,7 +2404,7 @@ var yn = {
|
|
|
2258
2404
|
"--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
2259
2405
|
}]
|
|
2260
2406
|
};
|
|
2261
|
-
function
|
|
2407
|
+
function Kn({ bands: e, crossings: t }) {
|
|
2262
2408
|
return JSON.stringify([e.map((e) => [
|
|
2263
2409
|
e.id,
|
|
2264
2410
|
e.label,
|
|
@@ -2278,7 +2424,7 @@ function bn({ bands: e, crossings: t }) {
|
|
|
2278
2424
|
e.direction
|
|
2279
2425
|
])]);
|
|
2280
2426
|
}
|
|
2281
|
-
function
|
|
2427
|
+
function qn({ bands: e, timestamp: t, formatValue: n }) {
|
|
2282
2428
|
return e.flatMap((e) => {
|
|
2283
2429
|
let r = e.points.find((e) => e.timestamp === t), i = r?.center ?? null, a = r?.lower !== null && r?.upper !== null && r !== void 0;
|
|
2284
2430
|
return [{
|
|
@@ -2296,156 +2442,151 @@ function xn({ bands: e, timestamp: t, formatValue: n }) {
|
|
|
2296
2442
|
}];
|
|
2297
2443
|
});
|
|
2298
2444
|
}
|
|
2299
|
-
function
|
|
2445
|
+
function Jn({ found: e, formatTimestamp: t }) {
|
|
2300
2446
|
return e.timestamp === void 0 ? `${e.crossing.label} · Not reached in this range` : `About ${t(e.timestamp)} · ${e.crossing.label}`;
|
|
2301
2447
|
}
|
|
2302
|
-
function
|
|
2303
|
-
return /* @__PURE__ */
|
|
2448
|
+
function Yn(e) {
|
|
2449
|
+
return /* @__PURE__ */ B(nr, {
|
|
2304
2450
|
...e,
|
|
2305
2451
|
kind: "line",
|
|
2306
2452
|
isStacked: !1
|
|
2307
2453
|
});
|
|
2308
2454
|
}
|
|
2309
|
-
function
|
|
2310
|
-
return /* @__PURE__ */
|
|
2455
|
+
function Xn({ isStacked: e = !1, ...t }) {
|
|
2456
|
+
return /* @__PURE__ */ B(nr, {
|
|
2311
2457
|
...t,
|
|
2312
2458
|
kind: "area",
|
|
2313
2459
|
isStacked: e
|
|
2314
2460
|
});
|
|
2315
2461
|
}
|
|
2316
|
-
function
|
|
2317
|
-
return /* @__PURE__ */
|
|
2462
|
+
function Zn(e) {
|
|
2463
|
+
return /* @__PURE__ */ B(Qn, { ...e });
|
|
2318
2464
|
}
|
|
2319
|
-
function
|
|
2320
|
-
let l =
|
|
2465
|
+
function Qn({ title: e, description: n, series: i, actions: a, report: o, height: s = 180, showTimeAxis: c = !0 }) {
|
|
2466
|
+
let l = M(), u = Zt(i.map((e) => ({
|
|
2321
2467
|
...e,
|
|
2322
2468
|
points: []
|
|
2323
2469
|
})), !1);
|
|
2324
|
-
return !Number.isFinite(s) || s < 48 ? /* @__PURE__ */
|
|
2470
|
+
return !Number.isFinite(s) || s < 48 ? /* @__PURE__ */ B(g, {
|
|
2325
2471
|
title: e,
|
|
2326
2472
|
description: n,
|
|
2327
2473
|
report: o,
|
|
2328
2474
|
message: "Chart height must be at least 48 pixels."
|
|
2329
|
-
}) : /* @__PURE__ */
|
|
2475
|
+
}) : /* @__PURE__ */ B("div", {
|
|
2330
2476
|
"aria-hidden": !0,
|
|
2331
2477
|
inert: !0,
|
|
2332
2478
|
className: "xeuugli",
|
|
2333
|
-
children: /* @__PURE__ */
|
|
2479
|
+
children: /* @__PURE__ */ B(p, {
|
|
2334
2480
|
title: e,
|
|
2335
2481
|
description: n,
|
|
2336
2482
|
report: o,
|
|
2337
2483
|
series: u,
|
|
2338
2484
|
actions: a,
|
|
2339
|
-
children: /* @__PURE__ */
|
|
2485
|
+
children: /* @__PURE__ */ V("div", {
|
|
2340
2486
|
className: "xrvj5dj x1n8ia3y",
|
|
2341
|
-
children: [/* @__PURE__ */
|
|
2487
|
+
children: [/* @__PURE__ */ B(ue, {
|
|
2342
2488
|
id: l,
|
|
2343
2489
|
label: void 0,
|
|
2344
2490
|
legend: u,
|
|
2345
2491
|
rows: [],
|
|
2346
2492
|
x: 0,
|
|
2347
2493
|
width: 0,
|
|
2348
|
-
source: void 0,
|
|
2349
2494
|
hasSeriesSummary: o?.seriesValues !== void 0
|
|
2350
|
-
}), /* @__PURE__ */
|
|
2351
|
-
...
|
|
2352
|
-
children: [/* @__PURE__ */
|
|
2495
|
+
}), /* @__PURE__ */ V("div", {
|
|
2496
|
+
...k.props(w.plot),
|
|
2497
|
+
children: [/* @__PURE__ */ B(t, { height: s - 16 }), c && /* @__PURE__ */ V("div", {
|
|
2353
2498
|
className: "x78zum5 x1qughib x8zbtdt x1c87qhr xiard35 xy8obcc xas2l8k xbixft xss6m8b",
|
|
2354
|
-
children: [/* @__PURE__ */
|
|
2499
|
+
children: [/* @__PURE__ */ B(r, { width: "8ch" }), /* @__PURE__ */ B(r, { width: "8ch" })]
|
|
2355
2500
|
})]
|
|
2356
2501
|
})]
|
|
2357
2502
|
})
|
|
2358
2503
|
})
|
|
2359
2504
|
});
|
|
2360
2505
|
}
|
|
2361
|
-
function
|
|
2362
|
-
let n =
|
|
2506
|
+
function $n({ charts: e, ...t }) {
|
|
2507
|
+
let n = P(null), [r, i] = F(), a = JSON.stringify(e.map((e) => [
|
|
2363
2508
|
e.id,
|
|
2364
2509
|
e.title,
|
|
2365
|
-
|
|
2510
|
+
Yt({
|
|
2366
2511
|
series: e.series,
|
|
2367
2512
|
markers: e.markers ?? [],
|
|
2368
2513
|
timestampUnit: t.timestampUnit,
|
|
2369
2514
|
isStacked: !1
|
|
2370
2515
|
})
|
|
2371
2516
|
])), 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);
|
|
2372
|
-
if (r !== void 0 && r.signature !== a && i(void 0),
|
|
2373
|
-
function e(e) {
|
|
2374
|
-
e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
|
|
2375
|
-
}
|
|
2376
|
-
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
2377
|
-
}, []), !s || !h(e)) return /* @__PURE__ */ O(_, {
|
|
2517
|
+
if (r !== void 0 && r.signature !== a && i(void 0), !s || !m(e)) return /* @__PURE__ */ B(g, {
|
|
2378
2518
|
title: "Small multiples",
|
|
2379
2519
|
message: "Charts need unique identifiers and aligned observation timestamps."
|
|
2380
2520
|
});
|
|
2381
|
-
if (e.length > $.panels) return /* @__PURE__ */
|
|
2521
|
+
if (e.length > $.panels) return /* @__PURE__ */ B(g, {
|
|
2382
2522
|
title: "Small multiples",
|
|
2383
2523
|
message: `Choose at most ${$.panels} panels.`
|
|
2384
2524
|
});
|
|
2385
|
-
if (e.length === 0) return /* @__PURE__ */
|
|
2525
|
+
if (e.length === 0) return /* @__PURE__ */ B(p, {
|
|
2386
2526
|
title: "Small multiples",
|
|
2387
|
-
children: /* @__PURE__ */
|
|
2527
|
+
children: /* @__PURE__ */ B("p", {
|
|
2388
2528
|
className: "x153jb6y",
|
|
2389
2529
|
children: "No charts"
|
|
2390
2530
|
})
|
|
2391
2531
|
});
|
|
2392
2532
|
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);
|
|
2393
|
-
return /* @__PURE__ */
|
|
2533
|
+
return /* @__PURE__ */ B("div", {
|
|
2394
2534
|
ref: n,
|
|
2395
2535
|
...{
|
|
2396
2536
|
0: { className: "xrvj5dj x1j825kq" },
|
|
2397
2537
|
1: { className: "xrvj5dj xxhr3t" }
|
|
2398
2538
|
}[!!l | 0],
|
|
2399
|
-
children: e.map((
|
|
2539
|
+
children: e.map((o, s) => /* @__PURE__ */ B("div", {
|
|
2400
2540
|
...{
|
|
2401
2541
|
0: {},
|
|
2402
2542
|
1: { className: "x1y332i5" }
|
|
2403
|
-
}[!!(l &&
|
|
2404
|
-
children: /* @__PURE__ */
|
|
2543
|
+
}[!!(l && s > 0) | 0],
|
|
2544
|
+
children: /* @__PURE__ */ B(nr, {
|
|
2405
2545
|
...t,
|
|
2406
|
-
title:
|
|
2407
|
-
description:
|
|
2408
|
-
report:
|
|
2409
|
-
series:
|
|
2410
|
-
formatValue:
|
|
2411
|
-
formatTick:
|
|
2412
|
-
markers:
|
|
2546
|
+
title: o.title,
|
|
2547
|
+
description: o.description,
|
|
2548
|
+
report: o.report,
|
|
2549
|
+
series: o.series,
|
|
2550
|
+
formatValue: o.formatValue,
|
|
2551
|
+
formatTick: o.formatTick,
|
|
2552
|
+
markers: o.markers,
|
|
2413
2553
|
kind: "line",
|
|
2414
2554
|
isStacked: !1,
|
|
2415
2555
|
sharedInspection: {
|
|
2416
|
-
|
|
2417
|
-
isSource: r?.chartId ===
|
|
2418
|
-
onChange: (e) => i(e ===
|
|
2419
|
-
|
|
2556
|
+
id: r?.signature === a ? r.id : null,
|
|
2557
|
+
isSource: r?.chartId === o.id,
|
|
2558
|
+
onChange: (e) => i(e === null ? void 0 : {
|
|
2559
|
+
id: e,
|
|
2420
2560
|
signature: a,
|
|
2421
|
-
chartId:
|
|
2422
|
-
})
|
|
2561
|
+
chartId: o.id
|
|
2562
|
+
}),
|
|
2563
|
+
within: (e) => n.current?.contains(e) === !0
|
|
2423
2564
|
},
|
|
2424
2565
|
axisWidth: c,
|
|
2425
|
-
showTimeAxis:
|
|
2566
|
+
showTimeAxis: s === e.length - 1
|
|
2426
2567
|
})
|
|
2427
|
-
},
|
|
2568
|
+
}, o.id))
|
|
2428
2569
|
});
|
|
2429
2570
|
}
|
|
2430
|
-
function
|
|
2431
|
-
if (!
|
|
2571
|
+
function er({ charts: e, height: t }) {
|
|
2572
|
+
if (!m(e) || e.length > $.panels) return /* @__PURE__ */ B(g, {
|
|
2432
2573
|
title: "Small multiples",
|
|
2433
2574
|
message: `Choose at most ${$.panels} panels with unique identifiers.`
|
|
2434
2575
|
});
|
|
2435
2576
|
let n = e.every((e) => e.report !== void 0);
|
|
2436
|
-
return /* @__PURE__ */
|
|
2577
|
+
return /* @__PURE__ */ B("div", {
|
|
2437
2578
|
"aria-hidden": !0,
|
|
2438
2579
|
inert: !0,
|
|
2439
2580
|
...{
|
|
2440
2581
|
0: { className: "xrvj5dj x1j825kq" },
|
|
2441
2582
|
1: { className: "xrvj5dj xxhr3t" }
|
|
2442
2583
|
}[!!n | 0],
|
|
2443
|
-
children: e.map((r, i) => /* @__PURE__ */
|
|
2584
|
+
children: e.map((r, i) => /* @__PURE__ */ B("div", {
|
|
2444
2585
|
...{
|
|
2445
2586
|
0: {},
|
|
2446
2587
|
1: { className: "x1y332i5" }
|
|
2447
2588
|
}[!!(n && i > 0) | 0],
|
|
2448
|
-
children: /* @__PURE__ */
|
|
2589
|
+
children: /* @__PURE__ */ B(Qn, {
|
|
2449
2590
|
...r,
|
|
2450
2591
|
height: t,
|
|
2451
2592
|
showTimeAxis: i === e.length - 1
|
|
@@ -2453,340 +2594,365 @@ function On({ charts: e, height: t }) {
|
|
|
2453
2594
|
}, r.id))
|
|
2454
2595
|
});
|
|
2455
2596
|
}
|
|
2456
|
-
var
|
|
2597
|
+
var tr = {
|
|
2457
2598
|
"x-default-marker": "x-default-marker",
|
|
2458
2599
|
$$css: !0
|
|
2459
2600
|
};
|
|
2460
|
-
function
|
|
2461
|
-
let
|
|
2601
|
+
function nr({ title: t, description: n, series: r, timestampUnit: i, formatTimestamp: a, formatValue: o, formatTick: s = o, markers: c = [], height: d = 180, actions: f, report: m, kind: h, isStacked: y, sharedInspection: b, axisWidth: S, showTimeAxis: C = !0, bands: E = [], crossings: O = [], rangeSelection: A }) {
|
|
2602
|
+
let j = E[0]?.points.map((e) => e.timestamp) ?? [], P = r[0]?.points.map((e) => e.timestamp) ?? j, F = !Number.isFinite(d) || d < 48 ? "Chart height must be at least 48 pixels." : qt({
|
|
2462
2603
|
series: r,
|
|
2463
|
-
isStacked:
|
|
2464
|
-
markers:
|
|
2465
|
-
timeline:
|
|
2466
|
-
}) ??
|
|
2467
|
-
bands:
|
|
2468
|
-
crossings:
|
|
2604
|
+
isStacked: y,
|
|
2605
|
+
markers: c,
|
|
2606
|
+
timeline: j
|
|
2607
|
+
}) ?? ln({
|
|
2608
|
+
bands: E,
|
|
2609
|
+
crossings: O,
|
|
2469
2610
|
series: r,
|
|
2470
|
-
timestamps:
|
|
2471
|
-
})
|
|
2611
|
+
timestamps: P
|
|
2612
|
+
}) ?? rr({
|
|
2613
|
+
rangeSelection: A,
|
|
2614
|
+
timeline: P
|
|
2615
|
+
}), I = N(() => F === void 0 ? Zt(r, y) : [], [
|
|
2472
2616
|
r,
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
]),
|
|
2617
|
+
y,
|
|
2618
|
+
F
|
|
2619
|
+
]), L = N(() => F === void 0 ? un({
|
|
2476
2620
|
series: r,
|
|
2477
|
-
bands:
|
|
2621
|
+
bands: E
|
|
2478
2622
|
}) : [], [
|
|
2479
2623
|
r,
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
]),
|
|
2624
|
+
E,
|
|
2625
|
+
F
|
|
2626
|
+
]), R = I[0]?.points ?? L[0]?.points ?? [], { ref: te, width: z } = T(), re = N(() => R.map(({ timestamp: e }) => ({
|
|
2483
2627
|
id: String(e),
|
|
2484
2628
|
label: a(e)
|
|
2485
|
-
})), [
|
|
2629
|
+
})), [R, a]), ie = `${Yt({
|
|
2486
2630
|
series: r,
|
|
2487
|
-
markers:
|
|
2631
|
+
markers: c,
|
|
2488
2632
|
timestampUnit: i,
|
|
2489
|
-
isStacked:
|
|
2490
|
-
})}${
|
|
2491
|
-
bands:
|
|
2492
|
-
crossings:
|
|
2493
|
-
})}`,
|
|
2633
|
+
isStacked: y
|
|
2634
|
+
})}${Kn({
|
|
2635
|
+
bands: E,
|
|
2636
|
+
crossings: O
|
|
2637
|
+
})}`, oe = [...I.map(({ id: e, label: t, tone: n }) => ({
|
|
2494
2638
|
id: e,
|
|
2495
2639
|
label: t,
|
|
2496
2640
|
tone: n
|
|
2497
|
-
})), ...
|
|
2641
|
+
})), ...L.map(({ id: e, label: t, tone: n }) => ({
|
|
2498
2642
|
id: e,
|
|
2499
2643
|
label: t,
|
|
2500
2644
|
tone: n,
|
|
2501
2645
|
shape: "band"
|
|
2502
|
-
}))],
|
|
2503
|
-
|
|
2504
|
-
let G = b !== void 0;
|
|
2505
|
-
if (te(() => {
|
|
2506
|
-
if (G) return;
|
|
2507
|
-
function e(e) {
|
|
2508
|
-
e.target instanceof Node && I.current?.contains(e.target) !== !0 && me(void 0);
|
|
2509
|
-
}
|
|
2510
|
-
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
2511
|
-
}, [G]), M !== void 0) return /* @__PURE__ */ O(_, {
|
|
2646
|
+
}))], se = m?.seriesValues !== void 0, U = M();
|
|
2647
|
+
if (F !== void 0) return /* @__PURE__ */ B(g, {
|
|
2512
2648
|
title: t,
|
|
2513
2649
|
description: n,
|
|
2514
|
-
report:
|
|
2515
|
-
message:
|
|
2650
|
+
report: m,
|
|
2651
|
+
message: F
|
|
2516
2652
|
});
|
|
2517
|
-
if (
|
|
2653
|
+
if (R.length === 0) return /* @__PURE__ */ B(p, {
|
|
2518
2654
|
title: t,
|
|
2519
2655
|
description: n,
|
|
2520
2656
|
actions: f,
|
|
2521
|
-
report:
|
|
2522
|
-
series:
|
|
2523
|
-
children: /* @__PURE__ */
|
|
2657
|
+
report: m,
|
|
2658
|
+
series: oe,
|
|
2659
|
+
children: /* @__PURE__ */ B("p", {
|
|
2524
2660
|
className: "x153jb6y",
|
|
2525
2661
|
children: "No observations"
|
|
2526
2662
|
})
|
|
2527
2663
|
});
|
|
2528
|
-
let
|
|
2529
|
-
crossings:
|
|
2664
|
+
let W = R.map((e) => e.timestamp), G = pn({
|
|
2665
|
+
crossings: O,
|
|
2530
2666
|
series: r,
|
|
2531
|
-
bands:
|
|
2532
|
-
}),
|
|
2667
|
+
bands: E
|
|
2668
|
+
}), K = [...c.flatMap((e) => e.kind === "event" ? [e] : []), ...G.flatMap(({ crossing: e, timestamp: t }) => t === void 0 ? [] : [{
|
|
2533
2669
|
id: e.id,
|
|
2534
2670
|
timestamp: t,
|
|
2535
2671
|
label: e.label,
|
|
2536
2672
|
value: e.value
|
|
2537
|
-
}])]
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
...D.map((e) => e.value)
|
|
2557
|
-
], Ee = h === "area" ? Math.min(0, ...Te) : Math.min(...Te), De = h === "area" ? Math.max(0, ...Te) : Math.max(...Te), Oe = Lt(Te.length === 0 ? 0 : Ee, Te.length === 0 ? 1 : De, h === "area"), q = j({
|
|
2558
|
-
domain: [...Oe],
|
|
2559
|
-
range: [xe, 0]
|
|
2560
|
-
}), J = x ?? Math.max(44, ...q.ticks(3).map((e) => s(e).length * 7 + 12)), Y = Math.max(J + 1, ce - 16), X = j({
|
|
2561
|
-
domain: [...Lt(Ce, we)],
|
|
2562
|
-
range: [J, Y]
|
|
2563
|
-
}), ke = mn({
|
|
2564
|
-
instants: ve,
|
|
2565
|
-
x: X,
|
|
2566
|
-
right: Y
|
|
2567
|
-
}), Z = hn(ke), Q = j({
|
|
2568
|
-
domain: [...Oe],
|
|
2569
|
-
range: [xe, Z]
|
|
2570
|
-
}), Ae = Q.ticks(3);
|
|
2571
|
-
function je(e) {
|
|
2572
|
-
let t = le?.getBoundingClientRect();
|
|
2573
|
-
if (t === void 0) return;
|
|
2574
|
-
let n = X.invert(e - t.left), r = F.find((e, t) => {
|
|
2575
|
-
let r = F[t + 1];
|
|
2576
|
-
return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
|
|
2577
|
-
});
|
|
2578
|
-
r !== void 0 && Me({
|
|
2579
|
-
signature: V,
|
|
2580
|
-
timestamp: r.timestamp,
|
|
2581
|
-
source: "pointer"
|
|
2582
|
-
});
|
|
2673
|
+
}])];
|
|
2674
|
+
function de(e) {
|
|
2675
|
+
return {
|
|
2676
|
+
label: e === void 0 ? void 0 : a(e),
|
|
2677
|
+
rows: [...I.map((t) => {
|
|
2678
|
+
let n = t.points.find((t) => t.timestamp === e);
|
|
2679
|
+
return {
|
|
2680
|
+
id: t.id,
|
|
2681
|
+
label: t.label,
|
|
2682
|
+
tone: t.tone,
|
|
2683
|
+
value: n?.value === null || n === void 0 ? "Unavailable" : o(n.value)
|
|
2684
|
+
};
|
|
2685
|
+
}), ...qn({
|
|
2686
|
+
bands: L,
|
|
2687
|
+
timestamp: e,
|
|
2688
|
+
formatValue: o
|
|
2689
|
+
})],
|
|
2690
|
+
notes: [...c.filter((t) => t.kind !== "event" && t.timestamp === e).map((e) => e.label), ...K.filter((t) => mn(W, t.timestamp) === e).map((e) => `${e.label} · ${a(e.timestamp)}`)]
|
|
2691
|
+
};
|
|
2583
2692
|
}
|
|
2584
|
-
|
|
2585
|
-
|
|
2693
|
+
let q = d - 28, fe = q + 12, J = R[0]?.timestamp ?? 0, Y = R.at(-1)?.timestamp ?? J, pe = [
|
|
2694
|
+
...I.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])),
|
|
2695
|
+
...hn(E),
|
|
2696
|
+
...O.map((e) => e.value)
|
|
2697
|
+
], me = h === "area" ? Math.min(0, ...pe) : Math.min(...pe), he = h === "area" ? Math.max(0, ...pe) : Math.max(...pe), ge = Xt(pe.length === 0 ? 0 : me, pe.length === 0 ? 1 : he, h === "area"), _e = H({
|
|
2698
|
+
domain: [...ge],
|
|
2699
|
+
range: [q, 0]
|
|
2700
|
+
}), X = S ?? Math.max(44, ..._e.ticks(3).map((e) => s(e).length * 7 + 12)), ve = Math.max(X + 1, z - 16), Z = H({
|
|
2701
|
+
domain: [...Xt(J, Y)],
|
|
2702
|
+
range: [X, ve]
|
|
2703
|
+
}), ye = Bn({
|
|
2704
|
+
instants: K,
|
|
2705
|
+
x: Z,
|
|
2706
|
+
right: ve
|
|
2707
|
+
}), be = Vn(ye), Q = H({
|
|
2708
|
+
domain: [...ge],
|
|
2709
|
+
range: [q, be]
|
|
2710
|
+
}), xe = Q.ticks(3);
|
|
2711
|
+
function Se(e) {
|
|
2712
|
+
return `${a(e[0])} to ${a(e[1])}`;
|
|
2713
|
+
}
|
|
2714
|
+
function Ce(e) {
|
|
2715
|
+
let t = Z.invert(e.x / e.width * z), n = R.find((e, n) => {
|
|
2716
|
+
let r = R[n + 1];
|
|
2717
|
+
return r === void 0 || t <= e.timestamp + (r.timestamp - e.timestamp) / 2;
|
|
2718
|
+
});
|
|
2719
|
+
return n === void 0 ? void 0 : String(n.timestamp);
|
|
2586
2720
|
}
|
|
2587
|
-
return /* @__PURE__ */
|
|
2588
|
-
ref: I,
|
|
2721
|
+
return /* @__PURE__ */ B("div", {
|
|
2589
2722
|
className: "xeuugli",
|
|
2590
|
-
children: /* @__PURE__ */
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
},
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2723
|
+
children: /* @__PURE__ */ B(x, {
|
|
2724
|
+
items: re,
|
|
2725
|
+
readout: (e) => le(de(Number(e))),
|
|
2726
|
+
locate: Ce,
|
|
2727
|
+
revision: ie,
|
|
2728
|
+
inspected: b?.id,
|
|
2729
|
+
onInspectedChange: b?.onChange,
|
|
2730
|
+
within: b?.within,
|
|
2731
|
+
render: (r, { inspected: d, cursor: g }) => {
|
|
2732
|
+
let x = d === null ? void 0 : Number(d), S = de(b === void 0 || b.isSource ? x : void 0), T = /* @__PURE__ */ V(v, {
|
|
2733
|
+
role: "img",
|
|
2734
|
+
"aria-label": ee({
|
|
2735
|
+
title: t,
|
|
2736
|
+
marks: "observations",
|
|
2737
|
+
isSelectable: !1
|
|
2738
|
+
}),
|
|
2739
|
+
"aria-describedby": U,
|
|
2740
|
+
viewBox: `0 0 ${z} ${fe}`,
|
|
2741
|
+
height: fe,
|
|
2742
|
+
...k.props(w.svg, w.inspectable, tr),
|
|
2743
|
+
children: [
|
|
2744
|
+
xe.map((e) => /* @__PURE__ */ V("g", { children: [/* @__PURE__ */ B("line", {
|
|
2745
|
+
x1: X,
|
|
2746
|
+
x2: ve,
|
|
2747
|
+
y1: Q(e),
|
|
2748
|
+
y2: Q(e),
|
|
2749
|
+
...k.props(e === 0 ? w.baseline : w.grid)
|
|
2750
|
+
}), /* @__PURE__ */ B("text", {
|
|
2751
|
+
x: X - 8,
|
|
2752
|
+
y: Q(e),
|
|
2753
|
+
textAnchor: "end",
|
|
2754
|
+
dominantBaseline: "middle",
|
|
2755
|
+
...k.props(w.label, w.tick),
|
|
2756
|
+
children: s(e)
|
|
2757
|
+
})] }, e)),
|
|
2758
|
+
O.map((e) => /* @__PURE__ */ B("line", {
|
|
2759
|
+
x1: X,
|
|
2760
|
+
x2: ve,
|
|
2761
|
+
y1: Q(e.value),
|
|
2762
|
+
y2: Q(e.value),
|
|
2763
|
+
...k.props(w.baseline)
|
|
2764
|
+
}, e.id)),
|
|
2765
|
+
/* @__PURE__ */ B(Un, {
|
|
2766
|
+
bands: L,
|
|
2767
|
+
x: Z,
|
|
2768
|
+
y: Q
|
|
2769
|
+
}),
|
|
2770
|
+
I.map((t) => /* @__PURE__ */ V("g", { children: [h === "area" && /* @__PURE__ */ B(ae, {
|
|
2771
|
+
data: [...t.points],
|
|
2772
|
+
defined: (e) => e.value !== null,
|
|
2773
|
+
x: (e) => Z(e.timestamp),
|
|
2774
|
+
y0: (e) => Q(e.base),
|
|
2775
|
+
y1: (e) => Q((e.value ?? 0) + e.base),
|
|
2776
|
+
yScale: Q,
|
|
2777
|
+
fill: e[t.tone],
|
|
2778
|
+
fillOpacity: y ? .65 : .12
|
|
2779
|
+
}), /* @__PURE__ */ B($t, {
|
|
2780
|
+
series: t,
|
|
2781
|
+
x: Z,
|
|
2782
|
+
y: Q,
|
|
2783
|
+
inspectedTimestamp: x
|
|
2784
|
+
})] }, t.id)),
|
|
2785
|
+
/* @__PURE__ */ B(Wn, {
|
|
2786
|
+
placed: ye,
|
|
2787
|
+
x: Z,
|
|
2788
|
+
y: Q,
|
|
2789
|
+
bottom: q
|
|
2790
|
+
}),
|
|
2791
|
+
c.filter((e) => e.kind !== "event").map((e) => /* @__PURE__ */ V("g", { children: [e.kind === "time" ? /* @__PURE__ */ B("line", {
|
|
2792
|
+
x1: Z(e.timestamp),
|
|
2793
|
+
x2: Z(e.timestamp),
|
|
2794
|
+
y1: be,
|
|
2795
|
+
y2: q,
|
|
2796
|
+
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
2797
|
+
}) : /* @__PURE__ */ B("circle", {
|
|
2798
|
+
cx: Z(e.timestamp),
|
|
2799
|
+
cy: Q(e.value + (I.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
|
|
2800
|
+
r: 4,
|
|
2801
|
+
fill: _.surface,
|
|
2802
|
+
...k.props(w.selected)
|
|
2803
|
+
}), /* @__PURE__ */ B("title", { children: e.kind === "point" ? `${e.label}: ${o(e.value)}` : e.label })] }, e.id)),
|
|
2804
|
+
x !== void 0 && /* @__PURE__ */ B("line", {
|
|
2805
|
+
x1: Z(x),
|
|
2806
|
+
x2: Z(x),
|
|
2807
|
+
y1: be,
|
|
2808
|
+
y2: q,
|
|
2809
|
+
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
2810
|
+
}),
|
|
2811
|
+
g !== null && /* @__PURE__ */ B(l, {
|
|
2812
|
+
x: Z(Number(g)),
|
|
2813
|
+
top: be,
|
|
2814
|
+
bottom: q,
|
|
2815
|
+
width: Math.min(16, (ve - X) / 2)
|
|
2816
|
+
})
|
|
2628
2817
|
]
|
|
2629
|
-
})
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2818
|
+
}), E = A === void 0 || Y === J ? T : /* @__PURE__ */ B(On, {
|
|
2819
|
+
value: A.value,
|
|
2820
|
+
onValueChange: A.onChange,
|
|
2821
|
+
min: J,
|
|
2822
|
+
max: Y,
|
|
2823
|
+
step: A.step,
|
|
2824
|
+
describe: Se,
|
|
2825
|
+
label: `${t} time range`,
|
|
2826
|
+
left: Z(J),
|
|
2827
|
+
width: Z(Y) - Z(J),
|
|
2828
|
+
height: q,
|
|
2829
|
+
children: T
|
|
2830
|
+
});
|
|
2831
|
+
return /* @__PURE__ */ V(p, {
|
|
2832
|
+
figure: r,
|
|
2833
|
+
title: se ? t : /* @__PURE__ */ B(ce, {
|
|
2834
|
+
title: t,
|
|
2835
|
+
detail: S.label
|
|
2643
2836
|
}),
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
controls: {
|
|
2655
|
-
items: R,
|
|
2656
|
-
cursor: z === void 0 ? void 0 : String(z.timestamp),
|
|
2657
|
-
inspected: W === void 0 ? void 0 : String(W.timestamp),
|
|
2658
|
-
readout: de(be),
|
|
2659
|
-
onInspect: (e) => {
|
|
2660
|
-
let t = Number(e);
|
|
2661
|
-
L(t), Me({
|
|
2662
|
-
signature: V,
|
|
2663
|
-
timestamp: t,
|
|
2664
|
-
source: "keyboard"
|
|
2665
|
-
});
|
|
2666
|
-
},
|
|
2667
|
-
onDismiss: () => Me(void 0)
|
|
2668
|
-
},
|
|
2669
|
-
onFocus: (e) => {
|
|
2670
|
-
if (e.currentTarget.matches(":focus-visible")) {
|
|
2671
|
-
let e = U?.timestamp ?? Ce;
|
|
2672
|
-
L(e), Me({
|
|
2673
|
-
signature: V,
|
|
2674
|
-
timestamp: e,
|
|
2675
|
-
source: "keyboard"
|
|
2676
|
-
});
|
|
2677
|
-
}
|
|
2678
|
-
},
|
|
2679
|
-
onPointerMove: (e) => {
|
|
2680
|
-
e.pointerType === "mouse" && je(e.clientX);
|
|
2837
|
+
description: n,
|
|
2838
|
+
report: m,
|
|
2839
|
+
series: oe,
|
|
2840
|
+
actions: f,
|
|
2841
|
+
children: [/* @__PURE__ */ B(u, {
|
|
2842
|
+
label: `${t} observations`,
|
|
2843
|
+
columns: [
|
|
2844
|
+
{
|
|
2845
|
+
id: "time",
|
|
2846
|
+
label: `Time (${i})`
|
|
2681
2847
|
},
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
e.
|
|
2685
|
-
},
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
x1: J,
|
|
2705
|
-
x2: Y,
|
|
2706
|
-
y1: Q(e.value),
|
|
2707
|
-
y2: Q(e.value),
|
|
2708
|
-
...C.props(y.baseline)
|
|
2709
|
-
}, e.id)),
|
|
2710
|
-
/* @__PURE__ */ O(_n, {
|
|
2711
|
-
bands: P,
|
|
2712
|
-
x: X,
|
|
2713
|
-
y: Q
|
|
2714
|
-
}),
|
|
2715
|
-
N.map((t) => /* @__PURE__ */ k("g", { children: [h === "area" && /* @__PURE__ */ O(ae, {
|
|
2716
|
-
data: [...t.points],
|
|
2717
|
-
defined: (e) => e.value !== null,
|
|
2718
|
-
x: (e) => X(e.timestamp),
|
|
2719
|
-
y0: (e) => Q(e.base),
|
|
2720
|
-
y1: (e) => Q((e.value ?? 0) + e.base),
|
|
2721
|
-
yScale: Q,
|
|
2722
|
-
fill: e[t.tone],
|
|
2723
|
-
fillOpacity: g ? .65 : .12
|
|
2724
|
-
}), /* @__PURE__ */ O(Bt, {
|
|
2725
|
-
series: t,
|
|
2726
|
-
x: X,
|
|
2727
|
-
y: Q,
|
|
2728
|
-
inspectedTimestamp: U?.timestamp
|
|
2729
|
-
})] }, t.id)),
|
|
2730
|
-
/* @__PURE__ */ O(vn, {
|
|
2731
|
-
placed: ke,
|
|
2732
|
-
x: X,
|
|
2733
|
-
y: Q,
|
|
2734
|
-
bottom: xe
|
|
2735
|
-
}),
|
|
2736
|
-
l.filter((e) => e.kind !== "event").map((e) => /* @__PURE__ */ k("g", { children: [e.kind === "time" ? /* @__PURE__ */ O("line", {
|
|
2737
|
-
x1: X(e.timestamp),
|
|
2738
|
-
x2: X(e.timestamp),
|
|
2739
|
-
y1: Z,
|
|
2740
|
-
y2: xe,
|
|
2741
|
-
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
2742
|
-
}) : /* @__PURE__ */ O("circle", {
|
|
2743
|
-
cx: X(e.timestamp),
|
|
2744
|
-
cy: Q(e.value + (N.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
|
|
2745
|
-
r: 4,
|
|
2746
|
-
fill: v.surface,
|
|
2747
|
-
...C.props(y.selected)
|
|
2748
|
-
}), /* @__PURE__ */ O("title", { children: e.kind === "point" ? `${e.label}: ${o(e.value)}` : e.label })] }, e.id)),
|
|
2749
|
-
U !== void 0 && /* @__PURE__ */ O("line", {
|
|
2750
|
-
x1: X(U.timestamp),
|
|
2751
|
-
x2: X(U.timestamp),
|
|
2752
|
-
y1: Z,
|
|
2753
|
-
y2: xe,
|
|
2754
|
-
className: "xhq4mlf x1ntoi03 x13efnbd"
|
|
2755
|
-
}),
|
|
2756
|
-
z !== void 0 && /* @__PURE__ */ O(oe, {
|
|
2757
|
-
x: X(z.timestamp),
|
|
2758
|
-
top: Z,
|
|
2759
|
-
bottom: xe,
|
|
2760
|
-
width: Math.min(16, (Y - J) / 2)
|
|
2761
|
-
})
|
|
2848
|
+
...I.map((e) => ({
|
|
2849
|
+
id: `series:${e.id}`,
|
|
2850
|
+
label: e.label
|
|
2851
|
+
})),
|
|
2852
|
+
...L.flatMap((e) => [{
|
|
2853
|
+
id: `band:${e.id}`,
|
|
2854
|
+
label: e.label
|
|
2855
|
+
}, {
|
|
2856
|
+
id: `band-range:${e.id}`,
|
|
2857
|
+
label: `${e.label}: ${e.rangeLabel}`
|
|
2858
|
+
}])
|
|
2859
|
+
],
|
|
2860
|
+
rows: R.map((e, t) => ({
|
|
2861
|
+
id: e.timestamp,
|
|
2862
|
+
values: [
|
|
2863
|
+
a(e.timestamp),
|
|
2864
|
+
...I.map((e) => e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : o(e.points[t].value)),
|
|
2865
|
+
...qn({
|
|
2866
|
+
bands: L,
|
|
2867
|
+
timestamp: e.timestamp,
|
|
2868
|
+
formatValue: o
|
|
2869
|
+
}).map((e) => e.value)
|
|
2762
2870
|
]
|
|
2763
|
-
})
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2871
|
+
}))
|
|
2872
|
+
}), /* @__PURE__ */ V("div", {
|
|
2873
|
+
className: "xrvj5dj x1n8ia3y",
|
|
2874
|
+
children: [
|
|
2875
|
+
/* @__PURE__ */ B(ue, {
|
|
2876
|
+
id: U,
|
|
2877
|
+
label: S.label,
|
|
2878
|
+
legend: oe,
|
|
2879
|
+
rows: S.rows,
|
|
2880
|
+
x: Z(x ?? J),
|
|
2881
|
+
width: z,
|
|
2882
|
+
notes: S.notes,
|
|
2883
|
+
hasSeriesSummary: se
|
|
2884
|
+
}),
|
|
2885
|
+
/* @__PURE__ */ V("div", {
|
|
2886
|
+
ref: te,
|
|
2887
|
+
...k.props(w.plot),
|
|
2888
|
+
children: [E, C && /* @__PURE__ */ V("div", {
|
|
2889
|
+
"aria-hidden": !0,
|
|
2890
|
+
...k.props(Gn.timeAxis, Gn.timeAxisInset(X, Math.max(0, z - ve))),
|
|
2891
|
+
children: [/* @__PURE__ */ B("span", {
|
|
2892
|
+
className: "x1cqoux5 xeuugli xj0a0fe",
|
|
2893
|
+
children: a(J)
|
|
2894
|
+
}), Y !== J && /* @__PURE__ */ B("span", {
|
|
2895
|
+
className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
|
|
2896
|
+
children: a(Y)
|
|
2897
|
+
})]
|
|
2898
|
+
})]
|
|
2899
|
+
}),
|
|
2900
|
+
A !== void 0 && Y !== J && /* @__PURE__ */ V("div", {
|
|
2901
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
2902
|
+
children: [/* @__PURE__ */ B("span", { children: A.value === null ? "Drag on the plot with a mouse to select a range of time." : `Selected range: ${Se(A.value)}` }), A.value === null ? /* @__PURE__ */ B(D, {
|
|
2903
|
+
type: "button",
|
|
2904
|
+
onClick: (e) => {
|
|
2905
|
+
ne({ options: () => A }, "onChange", ir({
|
|
2906
|
+
first: J,
|
|
2907
|
+
last: Y,
|
|
2908
|
+
rangeSelection: A
|
|
2909
|
+
}), {
|
|
2910
|
+
reason: "trigger-press",
|
|
2911
|
+
event: e.nativeEvent
|
|
2912
|
+
});
|
|
2913
|
+
},
|
|
2914
|
+
children: "Select a range"
|
|
2915
|
+
}) : /* @__PURE__ */ B(D, {
|
|
2916
|
+
type: "button",
|
|
2917
|
+
onClick: (e) => {
|
|
2918
|
+
ne({ options: () => A }, "onChange", null, {
|
|
2919
|
+
reason: "clear-press",
|
|
2920
|
+
event: e.nativeEvent
|
|
2921
|
+
});
|
|
2922
|
+
},
|
|
2923
|
+
children: "Clear range"
|
|
2924
|
+
})]
|
|
2925
|
+
}),
|
|
2926
|
+
c.length + G.length > 0 && /* @__PURE__ */ V("ul", {
|
|
2927
|
+
className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
|
|
2928
|
+
children: [c.map((e) => /* @__PURE__ */ V("li", { children: [
|
|
2929
|
+
a(e.timestamp),
|
|
2930
|
+
" · ",
|
|
2931
|
+
e.label,
|
|
2932
|
+
e.kind === "point" && ` · ${o(e.value)}`
|
|
2933
|
+
] }, e.id)), G.map((e) => /* @__PURE__ */ B("li", { children: Jn({
|
|
2934
|
+
found: e,
|
|
2935
|
+
formatTimestamp: a
|
|
2936
|
+
}) }, e.crossing.id))]
|
|
2937
|
+
})
|
|
2938
|
+
]
|
|
2939
|
+
})]
|
|
2940
|
+
});
|
|
2941
|
+
}
|
|
2789
2942
|
})
|
|
2790
2943
|
});
|
|
2791
2944
|
}
|
|
2792
|
-
|
|
2945
|
+
function rr({ rangeSelection: e, timeline: t }) {
|
|
2946
|
+
let n = t[0], r = t.at(-1);
|
|
2947
|
+
if (e === void 0 || n === void 0 || r === void 0) return;
|
|
2948
|
+
let { step: i, value: a } = e, o = r - n;
|
|
2949
|
+
if (o !== 0) {
|
|
2950
|
+
if (!Number.isFinite(i) || i <= 0 || i > o) return "The range selection step must be finite, positive, and no longer than the observed time.";
|
|
2951
|
+
if (a !== null && (!(a[0] >= n && a[1] <= r) || a[0] >= a[1])) return "The selected range must have ordered ends inside the observed time.";
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
function ir({ first: e, last: t, rangeSelection: n }) {
|
|
2955
|
+
let r = Math.max(1, Math.round((t - e) / 4 / n.step)) * n.step, i = Math.min(e + r, t - n.step);
|
|
2956
|
+
return [i, Math.min(t, Math.max(i + n.step, t - r))];
|
|
2957
|
+
}
|
|
2958
|
+
export { Xn as AreaChart, tt as BarChart, Ze as BarChartPlaceholder, at as BreakdownBar, jt as BridgeChart, Yn as LineChart, Lt as MAX_SCATTER_POINTS, Bt as ScatterPlot, $n as SmallMultiples, er as SmallMultiplesPlaceholder, rn as Sparkline, Zn as TimeSeriesChartPlaceholder, on as timeSeriesBandLimits, $ as timeSeriesLimits };
|