@mechane-ai/elements 0.48.0 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.js +5 -5
- package/dist/{article-BXZr10QQ.js → article-yyNPg6VU.js} +10 -10
- package/dist/article.js +1 -1
- package/dist/catalog.json +215 -1
- package/dist/{categorical-values-BpVq8cFj.js → categorical-values-DCznViFp.js} +1 -1
- package/dist/{cells-xVmnQ9oQ.js → cells-CNZE4us2.js} +2 -2
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/cells.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +1 -1
- package/dist/charts/plot.js +6 -6
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +1 -1
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +2 -2
- package/dist/{code-block-DioAM2bZ.js → code-block-BZsY2sh3.js} +1 -1
- package/dist/collections.js +1 -1
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +1 -1
- package/dist/{content-link-NWuHp5rC.js → content-link-PnpcnTCx.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/{dates-Cww8UR_n.js → dates-ckJdYF7t.js} +1 -1
- package/dist/{dumbbell-plot-DQdTxDeO.js → dumbbell-plot-CMv9llfd.js} +7 -6
- package/dist/{embedding-map-CF-J-8JW.js → embedding-map-DC-lgzCq.js} +8 -8
- package/dist/feedback.js +1 -1
- package/dist/{figure-frame-BJ3REgTA.js → figure-frame-BjFzbl3m.js} +3 -3
- package/dist/forms/dates.js +1 -1
- package/dist/forms.js +3 -3
- package/dist/{image-grid-Dl2sjIMB.js → image-grid-DHqtj_zs.js} +4 -4
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +5 -5
- package/dist/kits/interpretability.js +320 -302
- package/dist/kits/operations.js +6 -6
- package/dist/kits/research.js +558 -0
- package/dist/kits/training.js +6 -6
- package/dist/layout.js +205 -110
- package/dist/lesson.js +2 -2
- package/dist/mdx.js +6 -6
- package/dist/navigation.js +2 -2
- package/dist/packages/charts/src/cartesian/index.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +18 -0
- package/dist/packages/charts/src/chart-theme.d.ts +1 -1
- package/dist/packages/charts/src/plot/plot-surface.d.ts +3 -1
- package/dist/packages/collections/src/index.d.ts +1 -1
- package/dist/packages/collections/src/metrics.d.ts +9 -1
- package/dist/packages/content/src/index.d.ts +2 -0
- package/dist/packages/content/src/text-match.d.ts +22 -0
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/surfaces.d.ts +12 -2
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/token-input.d.ts +24 -0
- package/dist/packages/kits/src/interpretability/index.d.ts +1 -1
- package/dist/packages/kits/src/interpretability/logit-lens.d.ts +10 -1
- package/dist/packages/kits/src/research/finding-card.d.ts +43 -0
- package/dist/packages/kits/src/research/index.d.ts +8 -0
- package/dist/packages/kits/src/research/milestone-path.d.ts +36 -0
- package/dist/packages/kits/src/research/specimen-diff.d.ts +41 -0
- package/dist/packages/kits/src/research/work-heartbeat.d.ts +34 -0
- package/dist/packages/layout/src/figure-grid.d.ts +8 -0
- package/dist/packages/layout/src/index.d.ts +4 -1
- package/dist/packages/layout/src/sidebar.d.ts +7 -0
- package/dist/packages/layout/src/workbench.d.ts +4 -1
- package/dist/{param-CqKUTHaO.js → param-BE3VMSkH.js} +18 -18
- package/dist/{pierre-diff-DlvjyuJn.js → pierre-diff-aGyQK5xK.js} +1 -1
- package/dist/{plot-axes-DJkLW4wk.js → plot-axes-D5S9BnBa.js} +1 -1
- package/dist/{plot-layout-CZVSJ-le.js → plot-layout-Bqe4-0qZ.js} +2 -2
- package/dist/{plot-marks-uozcbOIX.js → plot-marks-FVsbFkUs.js} +3 -3
- package/dist/{plot-surface-CbVBvgqZ.js → plot-surface-DON6WUmk.js} +11 -11
- package/dist/{plot-width-DcqtSgzb.js → plot-width-D3hTycYX.js} +1 -1
- package/dist/{reference-lines-BDcttOp0.js → reference-lines-hjuD1rRZ.js} +2 -2
- package/dist/{scene-0z2gbaDE.js → scene-BP0Ue0R5.js} +8 -8
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-BKVEAVCs.js → slope-chart-C8eeSgL4.js} +7 -7
- package/dist/{src-CpdJlDhO.js → src-9EJskqB_.js} +73 -31
- package/dist/{src-Dcfq8vE4.js → src-B2rgpWap.js} +48 -14
- package/dist/{src-BPTDJqt0.js → src-Ci8DeY8J.js} +1 -1
- package/dist/{src-CGc_hjxJ.js → src-DFW49IAs.js} +143 -111
- package/dist/{src-BD6xlvDt.js → src-Dxs3Buo_.js} +203 -137
- package/dist/{src-CExIrXPC.js → src-npqwq3Sa.js} +1 -1
- package/dist/styles2.css +67 -3
- package/dist/{time-series-BgzGNOk0.js → time-series-BL933QyA.js} +783 -713
- package/dist/{token-heatmap-BrW1OsKD.js → token-heatmap-BB65awva.js} +4 -4
- package/dist/{token-predictions-yerq_Oet.js → token-predictions-Pa8eUGan.js} +6 -6
- package/dist/{transport-BJweqDPj.js → transport-DzyxVXbL.js} +30 -30
- package/dist/{tree-diagram-D09BRqE-.js → tree-diagram-DJhKBiia.js} +6 -6
- package/dist/{treemap-CW4WsJNL.js → treemap-CxxgABUg.js} +5 -5
- package/dist/{violin-plot-DrtPZ1-T.js → violin-plot-CoAEF_7Z.js} +6 -6
- package/dist/{waterfall-DYLSnGjm.js → waterfall-DdoEXEkT.js} +7 -7
- package/package.json +5 -1
- package/skills/use-elements/references/kits.md +7 -6
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { k as e } from "./src-
|
|
2
|
-
import {
|
|
3
|
-
import { d as n, u as r } from "./src-
|
|
1
|
+
import { k as e } from "./src-9EJskqB_.js";
|
|
2
|
+
import { x as t } from "./src-Dxs3Buo_.js";
|
|
3
|
+
import { d as n, u as r } from "./src-npqwq3Sa.js";
|
|
4
4
|
import { n as i, t as a } from "./chart-tones-ei3BC2AL.js";
|
|
5
|
-
import { A as o, O as s, S as c, T as l, a as u, b as d, c as f, i as p, k as m, m as h, n as g, o as _, p as v, w as ee } from "./plot-layout-
|
|
6
|
-
import { i as y, n as b, r as x, t as S } from "./categorical-values-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { A as o, O as s, S as c, T as l, a as u, b as d, c as f, i as p, k as m, m as h, n as g, o as _, p as v, w as ee } from "./plot-layout-Bqe4-0qZ.js";
|
|
6
|
+
import { i as y, n as b, r as x, t as S } from "./categorical-values-DCznViFp.js";
|
|
7
|
+
import { i as C } from "./chart-link-AE_xuxiP.js";
|
|
8
|
+
import { a as te } from "./tone-scope-DKiSw-JR.js";
|
|
9
|
+
import { n as w, r as ne, t as T } from "./figure-format-B8kRZMlo.js";
|
|
9
10
|
import { a as E, i as D, o as O, r as k, t as A } from "./scale-C2xgZyZN.js";
|
|
10
|
-
import { t as
|
|
11
|
-
import { c as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
14
|
-
import { a as
|
|
15
|
-
import { n as
|
|
16
|
-
import { n as
|
|
17
|
-
import { n as
|
|
18
|
-
import { t as
|
|
11
|
+
import { t as re } from "./chart-cursor-1mFd48Jc.js";
|
|
12
|
+
import { c as ie, i as ae, l as oe, n as j, o as se, r as ce, s as M, t as le } from "./figure-frame-BjFzbl3m.js";
|
|
13
|
+
import { n as N, t as P } from "./plot-width-D3hTycYX.js";
|
|
14
|
+
import { t as ue } from "./plot-axes-D5S9BnBa.js";
|
|
15
|
+
import { a as de, c as F, d as I, f as fe, i as L, l as pe, n as R, o as z, r as me, s as B, t as he } from "./plot-marks-FVsbFkUs.js";
|
|
16
|
+
import { n as ge, r as _e, t as ve } from "./plot-surface-DON6WUmk.js";
|
|
17
|
+
import { n as ye, t as be } from "./reference-lines-hjuD1rRZ.js";
|
|
18
|
+
import { n as xe, r as Se, t as Ce } from "./path-BglsXpnO.js";
|
|
19
|
+
import { t as V } from "./locate-Bcg3QcP4.js";
|
|
19
20
|
import * as H from "@stylexjs/stylex";
|
|
20
|
-
import { createParts as
|
|
21
|
-
import { useEffect as
|
|
22
|
-
import { bindDrag as K, createChange as
|
|
23
|
-
import { Fragment as
|
|
21
|
+
import { createParts as we } from "@ui-sdk/react/primitive";
|
|
22
|
+
import { useEffect as Te, useId as U, useRef as W, useState as G } from "react";
|
|
23
|
+
import { bindDrag as K, createChange as Ee, createSpans as De, definePrimitive as Oe, dispatch as ke } from "@ui-sdk/core";
|
|
24
|
+
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
24
25
|
// packages/charts/src/cartesian/bar-data.ts
|
|
25
|
-
function
|
|
26
|
+
function X({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
26
27
|
if (e === void 0) return;
|
|
27
28
|
if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
|
|
28
29
|
let i = e.annotation;
|
|
@@ -39,26 +40,26 @@ function ke({ composition: e, series: t, categoryIds: n, domain: r }) {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
var
|
|
43
|
-
function
|
|
43
|
+
var Z = 6;
|
|
44
|
+
function Q(e, t) {
|
|
44
45
|
return e === null ? !0 : e === void 0 || !Number.isFinite(e) ? !1 : e >= t[0] && e <= t[1];
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function Ae({ marker: e, categoryCount: t, domain: n }) {
|
|
47
48
|
let r = e.kind === "tick" ? [e.values] : [e.lower, e.upper];
|
|
48
49
|
if (r.some((e) => e.length !== t)) return "Every bar marker requires one explicit value per category.";
|
|
49
|
-
if (r.some((e) => e.some((e) => !
|
|
50
|
+
if (r.some((e) => e.some((e) => !Q(e, n)))) return "Bar marker values must be finite and within the supplied domain.";
|
|
50
51
|
if (e.kind === "range") for (let [t, n] of e.lower.entries()) {
|
|
51
52
|
let r = e.upper[t] ?? null;
|
|
52
53
|
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.";
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
if (e.length >
|
|
56
|
+
function je({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r, categoryIds: i, domain: a }) {
|
|
57
|
+
if (e.length > Z) return `Supply at most ${Z} bar markers.`;
|
|
57
58
|
let o = [...e, ...t];
|
|
58
59
|
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.";
|
|
59
60
|
for (let t of e) {
|
|
60
61
|
if (!r.includes(t.seriesId)) return "Each bar marker must refer to a supplied series.";
|
|
61
|
-
let e =
|
|
62
|
+
let e = Ae({
|
|
62
63
|
marker: t,
|
|
63
64
|
categoryCount: i.length,
|
|
64
65
|
domain: a
|
|
@@ -72,25 +73,25 @@ function Ae({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r
|
|
|
72
73
|
if (new Set(t.map((e) => JSON.stringify([e.categoryId, e.seriesId ?? null]))).size !== t.length) return "Each bar can hold one annotation.";
|
|
73
74
|
if (new Set(n).size !== n.length || n.some((e) => !i.includes(e))) return "Emphasized categories must be unique supplied categories.";
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function Me({ marker: e, index: t, valueText: n }) {
|
|
76
77
|
if (e.kind === "tick") return n(e.values[t] ?? null);
|
|
77
78
|
let r = e.lower[t] ?? null, i = e.upper[t] ?? null;
|
|
78
79
|
return r === null || i === null ? n(null) : `${n(r)} – ${n(i)}`;
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function Ne(e, t) {
|
|
81
82
|
return e.kind === "tick" ? e.values[t] ?? null : e.upper[t] ?? null;
|
|
82
83
|
}
|
|
83
84
|
// packages/charts/src/cartesian/value-labels.ts
|
|
84
|
-
var
|
|
85
|
-
function
|
|
86
|
-
let n = (e.text.length + t.text.length) *
|
|
87
|
-
return Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) <
|
|
85
|
+
var Pe = 6.5, Fe = 14, Ie = 6, Le = .5;
|
|
86
|
+
function Re(e, t) {
|
|
87
|
+
let n = (e.text.length + t.text.length) * Pe * Le + Ie;
|
|
88
|
+
return Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) < Fe;
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
-
return e.filter((t, n) => e.slice(0, n).every((e) => !
|
|
90
|
+
function ze(e) {
|
|
91
|
+
return e.filter((t, n) => e.slice(0, n).every((e) => !Re(t, e)));
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
let i = t.length *
|
|
93
|
+
function Be({ x: e, text: t, left: n, right: r }) {
|
|
94
|
+
let i = t.length * Pe * Le;
|
|
94
95
|
return e - i < n ? {
|
|
95
96
|
x: n,
|
|
96
97
|
anchor: "start"
|
|
@@ -103,16 +104,16 @@ function ze({ x: e, text: t, left: n, right: r }) {
|
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
106
|
// packages/charts/src/cartesian/bar-overlays.tsx
|
|
106
|
-
var
|
|
107
|
-
function
|
|
108
|
-
let a = n.x + n.width *
|
|
107
|
+
var Ve = 3, He = 14, Ue = .6, We = .5;
|
|
108
|
+
function Ge({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
109
|
+
let a = n.x + n.width * We;
|
|
109
110
|
if (e.kind === "tick") {
|
|
110
111
|
let o = e.values[t] ?? null;
|
|
111
112
|
if (o === null) return [];
|
|
112
113
|
let s = {
|
|
113
114
|
key: "tick",
|
|
114
|
-
x1: n.x -
|
|
115
|
-
x2: n.x + n.width +
|
|
115
|
+
x1: n.x - Ve,
|
|
116
|
+
x2: n.x + n.width + Ve,
|
|
116
117
|
y1: i(o),
|
|
117
118
|
y2: i(o)
|
|
118
119
|
};
|
|
@@ -126,7 +127,7 @@ function We({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
|
126
127
|
}
|
|
127
128
|
let o = e.lower[t] ?? null, s = e.upper[t] ?? null;
|
|
128
129
|
if (o === null || s === null) return [];
|
|
129
|
-
let c = Math.min(
|
|
130
|
+
let c = Math.min(He, n.width * Ue) * We;
|
|
130
131
|
return [
|
|
131
132
|
{
|
|
132
133
|
key: "whisker",
|
|
@@ -151,9 +152,9 @@ function We({ marker: e, index: t, span: n, base: r, y: i }) {
|
|
|
151
152
|
}
|
|
152
153
|
];
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
+
function Ke({ markers: e, categoryIds: t, span: n, barTop: r, y: i, isReceded: a }) {
|
|
155
156
|
return /* @__PURE__ */ J("g", { children: e.map((e) => /* @__PURE__ */ J("g", { children: t.map((t, o) => {
|
|
156
|
-
let s =
|
|
157
|
+
let s = Ge({
|
|
157
158
|
marker: e,
|
|
158
159
|
index: o,
|
|
159
160
|
span: n(t, e.seriesId),
|
|
@@ -161,27 +162,27 @@ function Ge({ markers: e, categoryIds: t, span: n, barTop: r, y: i, isReceded: a
|
|
|
161
162
|
y: i
|
|
162
163
|
});
|
|
163
164
|
return /* @__PURE__ */ J("g", {
|
|
164
|
-
...H.props(
|
|
165
|
-
children: s.map(({ key: t, ...n }) => /* @__PURE__ */ J(
|
|
165
|
+
...H.props(N.emphasis, a(t) && N.receded),
|
|
166
|
+
children: s.map(({ key: t, ...n }) => /* @__PURE__ */ J(B, {
|
|
166
167
|
...n,
|
|
167
168
|
tone: e.tone ?? "neutral"
|
|
168
169
|
}, t))
|
|
169
170
|
}, t);
|
|
170
171
|
}) }, e.id)) });
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
+
function qe({ annotations: e, left: t, right: n }) {
|
|
173
174
|
return /* @__PURE__ */ J("g", {
|
|
174
175
|
"aria-hidden": !0,
|
|
175
|
-
children:
|
|
176
|
-
let r =
|
|
176
|
+
children: ze(e).map((e) => {
|
|
177
|
+
let r = Be({
|
|
177
178
|
x: e.x,
|
|
178
179
|
text: e.text,
|
|
179
180
|
left: t,
|
|
180
181
|
right: n
|
|
181
182
|
});
|
|
182
183
|
return /* @__PURE__ */ J("g", {
|
|
183
|
-
...H.props(
|
|
184
|
-
children: /* @__PURE__ */ J(
|
|
184
|
+
...H.props(N.emphasis, e.isReceded && N.receded),
|
|
185
|
+
children: /* @__PURE__ */ J(F, {
|
|
185
186
|
x: r.x,
|
|
186
187
|
y: e.y,
|
|
187
188
|
anchor: r.anchor,
|
|
@@ -192,7 +193,7 @@ function Ke({ annotations: e, left: t, right: n }) {
|
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
// packages/charts/src/cartesian/composition-bars.tsx
|
|
195
|
-
var
|
|
196
|
+
var Je = {
|
|
196
197
|
mark: {
|
|
197
198
|
k3nNDw: "x1hj3fc7",
|
|
198
199
|
k1ekBW: "xwcsmn1",
|
|
@@ -208,17 +209,17 @@ var qe = {
|
|
|
208
209
|
"--x-transform": e ?? void 0,
|
|
209
210
|
"--x-opacity": t ?? void 0
|
|
210
211
|
}]
|
|
211
|
-
},
|
|
212
|
-
function
|
|
212
|
+
}, Ye = .18, Xe = .3;
|
|
213
|
+
function Ze({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a, y: o, isSelected: s, isInspected: c, highlighted: l, toneOf: u }) {
|
|
213
214
|
let d = n !== void 0, f = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
|
|
214
215
|
function p(e, t) {
|
|
215
216
|
let n = o(t), r = o(t + e);
|
|
216
217
|
return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0 && t === 0), Math.abs(r - n))})`;
|
|
217
218
|
}
|
|
218
|
-
let m = d ?
|
|
219
|
-
return /* @__PURE__ */ Y(
|
|
220
|
-
...H.props(
|
|
221
|
-
children: /* @__PURE__ */ J(
|
|
219
|
+
let m = d ? Ye : +(e.kind === "total");
|
|
220
|
+
return /* @__PURE__ */ Y(q, { children: [e.kind !== "gap" && /* @__PURE__ */ J("g", {
|
|
221
|
+
...H.props(Je.mark, Je.geometry(p(e.total, 0), m)),
|
|
222
|
+
children: /* @__PURE__ */ J(me, {
|
|
222
223
|
x: i,
|
|
223
224
|
y: 0,
|
|
224
225
|
width: a,
|
|
@@ -230,10 +231,10 @@ function Xe({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a,
|
|
|
230
231
|
}), f.map((o, f) => {
|
|
231
232
|
let m = o.values[r];
|
|
232
233
|
if (m == null) return null;
|
|
233
|
-
let h = d ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), g = d ? n.id === o.id : e.kind === "parts", _ = l != null && l !== o.id, v = g ? !d && _ ?
|
|
234
|
+
let h = d ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[r] ?? 0), 0), g = d ? n.id === o.id : e.kind === "parts", _ = l != null && l !== o.id, v = g ? !d && _ ? Xe : 1 : 0;
|
|
234
235
|
return /* @__PURE__ */ J("g", {
|
|
235
|
-
...H.props(
|
|
236
|
-
children: /* @__PURE__ */ J(
|
|
236
|
+
...H.props(Je.mark, Je.geometry(p(m, h), v)),
|
|
237
|
+
children: /* @__PURE__ */ J(me, {
|
|
237
238
|
x: i,
|
|
238
239
|
y: 0,
|
|
239
240
|
width: a,
|
|
@@ -246,16 +247,16 @@ function Xe({ bucket: e, series: t, focusedSeries: n, index: r, x: i, width: a,
|
|
|
246
247
|
})] });
|
|
247
248
|
}
|
|
248
249
|
// packages/charts/src/cartesian/bar-chart.tsx
|
|
249
|
-
var
|
|
250
|
+
var Qe = { placeholder: {
|
|
250
251
|
kqGvvJ: "x1we84gm",
|
|
251
252
|
$$css: !0
|
|
252
|
-
} },
|
|
253
|
-
function
|
|
253
|
+
} }, $e = 18, et = 8, tt = 14, nt = .08, rt = 8, it = 8, at = .5;
|
|
254
|
+
function ot({ legend: e, layoutLegend: t, notes: n, children: r, inspectionId: i, label: a, summary: o, rows: s = [], x: c = 0, width: l = 0, offset: u, data: d, isLoading: f = !1, ...p }) {
|
|
254
255
|
let m = f && e.length === 0 && p.report?.seriesValues === void 0;
|
|
255
256
|
return /* @__PURE__ */ Y(j, {
|
|
256
257
|
...p,
|
|
257
258
|
series: e,
|
|
258
|
-
seriesLegend: m ? /* @__PURE__ */ J(
|
|
259
|
+
seriesLegend: m ? /* @__PURE__ */ J(M, {}) : /* @__PURE__ */ J(se, {
|
|
259
260
|
id: i,
|
|
260
261
|
label: a,
|
|
261
262
|
summary: o,
|
|
@@ -268,11 +269,11 @@ function at({ legend: e, layoutLegend: t, notes: n, children: r, inspectionId: i
|
|
|
268
269
|
width: l,
|
|
269
270
|
offset: u
|
|
270
271
|
}),
|
|
271
|
-
children: [d !== void 0 && /* @__PURE__ */ J(
|
|
272
|
+
children: [d !== void 0 && /* @__PURE__ */ J(oe, { ...d }), r]
|
|
272
273
|
});
|
|
273
274
|
}
|
|
274
|
-
function
|
|
275
|
-
let e =
|
|
275
|
+
function st() {
|
|
276
|
+
let e = te();
|
|
276
277
|
return (t) => t.map((t, n) => ({
|
|
277
278
|
id: t.id,
|
|
278
279
|
label: t.label,
|
|
@@ -283,12 +284,12 @@ function ot() {
|
|
|
283
284
|
})
|
|
284
285
|
}));
|
|
285
286
|
}
|
|
286
|
-
function
|
|
287
|
-
let a =
|
|
287
|
+
function ct({ title: e = "Loading chart", series: t = [], height: n = "compact", ...i }) {
|
|
288
|
+
let a = U(), o = st()(t);
|
|
288
289
|
return /* @__PURE__ */ J("div", {
|
|
289
290
|
"aria-hidden": !0,
|
|
290
291
|
inert: !0,
|
|
291
|
-
children: /* @__PURE__ */ J(
|
|
292
|
+
children: /* @__PURE__ */ J(ot, {
|
|
292
293
|
...i,
|
|
293
294
|
title: e,
|
|
294
295
|
status: "loading",
|
|
@@ -296,16 +297,16 @@ function st({ title: e = "Loading chart", series: t = [], height: n = "compact",
|
|
|
296
297
|
inspectionId: a,
|
|
297
298
|
isLoading: !0,
|
|
298
299
|
children: /* @__PURE__ */ J("div", {
|
|
299
|
-
...H.props(
|
|
300
|
+
...H.props(N.plot, Qe.placeholder),
|
|
300
301
|
children: /* @__PURE__ */ J(r, { height: f[n] })
|
|
301
302
|
})
|
|
302
303
|
})
|
|
303
304
|
});
|
|
304
305
|
}
|
|
305
|
-
function
|
|
306
|
+
function lt(e, t) {
|
|
306
307
|
return Array.from({ length: t }, (t, n) => e.reduce((e, t) => e + Math.max(0, t.values[n] ?? 0), 0));
|
|
307
308
|
}
|
|
308
|
-
function
|
|
309
|
+
function ut({ categories: e, series: t, domain: n, mode: r }) {
|
|
309
310
|
if (e.length > x.items || t.length > x.series) return `Choose a window with at most ${x.items} categories and ${x.series} series.`;
|
|
310
311
|
if (O(n) !== void 0 || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
|
|
311
312
|
if (!o(e) || !o(t)) return "Bar categories and series require unique identifiers.";
|
|
@@ -314,10 +315,10 @@ function lt({ categories: e, series: t, domain: n, mode: r }) {
|
|
|
314
315
|
if (i.values.some((e) => e !== null && E(e, n))) return "Bar values must be finite and within the supplied domain.";
|
|
315
316
|
if (r === "stacked" && i.values.some((e) => e === null || e < 0)) return "Stacked bars require present nonnegative values.";
|
|
316
317
|
}
|
|
317
|
-
if (r === "stacked" &&
|
|
318
|
+
if (r === "stacked" && lt(t, e.length).some((e) => e > n[1])) return "Stacked bar totals must fit the supplied domain.";
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
-
let o = n === "stacked" || r !== void 0, s = t.flatMap((e) => e.values), c = o ?
|
|
320
|
+
function dt({ categories: e, series: t, mode: n, composition: r, referenceLines: i, markers: a }) {
|
|
321
|
+
let o = n === "stacked" || r !== void 0, s = t.flatMap((e) => e.values), c = o ? lt(t, e.length) : [], l = r?.focusedSeries?.values ?? [], u = r?.buckets.map((e) => e.kind === "gap" ? null : e.total) ?? [], d = a.flatMap((e) => e.kind === "tick" ? e.values : [...e.lower, ...e.upper]);
|
|
321
322
|
return [
|
|
322
323
|
...s,
|
|
323
324
|
...c,
|
|
@@ -328,15 +329,15 @@ function ut({ categories: e, series: t, mode: n, composition: r, referenceLines:
|
|
|
328
329
|
...r?.annotation === void 0 ? [] : [r.annotation.value]
|
|
329
330
|
];
|
|
330
331
|
}
|
|
331
|
-
function
|
|
332
|
-
let { emptyLabel: b = "No categories", ...x } = y, { locale: S, title:
|
|
333
|
-
if (x.status === "loading") return /* @__PURE__ */ J(
|
|
332
|
+
function ft({ categories: e, series: t, domain: n, mode: r = "grouped", valueFormat: i, tickFormat: a, valueLabel: o, highlighted: s, selected: c, onSelectedChange: l, height: d = "compact", composition: f, referenceLines: h = [], markers: g = [], annotations: _ = [], emphasizedCategoryIds: v = [], ...y }) {
|
|
333
|
+
let { emptyLabel: b = "No categories", ...x } = y, { locale: S, title: C } = x, w = f?.focusedSeries, T = U(), E = U(), { ref: D, width: O, height: k } = _e(d), ae = te(), oe = st();
|
|
334
|
+
if (x.status === "loading") return /* @__PURE__ */ J(ct, {
|
|
334
335
|
...x,
|
|
335
336
|
series: t,
|
|
336
337
|
height: d
|
|
337
338
|
});
|
|
338
|
-
let
|
|
339
|
-
values:
|
|
339
|
+
let j = n ?? u({
|
|
340
|
+
values: dt({
|
|
340
341
|
categories: e,
|
|
341
342
|
series: t,
|
|
342
343
|
mode: r,
|
|
@@ -345,88 +346,88 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
345
346
|
markers: g
|
|
346
347
|
}),
|
|
347
348
|
isZeroBased: !0
|
|
348
|
-
}),
|
|
349
|
+
}), se = w === void 0 ? void 0 : ut({
|
|
349
350
|
categories: e,
|
|
350
|
-
series: [
|
|
351
|
-
domain:
|
|
351
|
+
series: [w],
|
|
352
|
+
domain: j,
|
|
352
353
|
mode: "grouped"
|
|
353
|
-
}),
|
|
354
|
+
}), M = ut({
|
|
354
355
|
categories: e,
|
|
355
356
|
series: t,
|
|
356
|
-
domain:
|
|
357
|
+
domain: j,
|
|
357
358
|
mode: r
|
|
358
|
-
}) ??
|
|
359
|
+
}) ?? se, P = e.map((e) => e.id), de = je({
|
|
359
360
|
markers: g,
|
|
360
361
|
annotations: _,
|
|
361
362
|
emphasizedCategoryIds: v,
|
|
362
|
-
seriesIds: [...t, ...
|
|
363
|
-
categoryIds:
|
|
364
|
-
domain:
|
|
365
|
-
}) ??
|
|
363
|
+
seriesIds: [...t, ...w === void 0 ? [] : [w]].map((e) => e.id),
|
|
364
|
+
categoryIds: P,
|
|
365
|
+
domain: j
|
|
366
|
+
}) ?? ye({
|
|
366
367
|
lines: h,
|
|
367
|
-
domain:
|
|
368
|
-
}),
|
|
368
|
+
domain: j
|
|
369
|
+
}), F = M ?? X({
|
|
369
370
|
composition: f,
|
|
370
371
|
series: t,
|
|
371
|
-
categoryIds:
|
|
372
|
-
domain:
|
|
373
|
-
}) ??
|
|
374
|
-
if (
|
|
372
|
+
categoryIds: P,
|
|
373
|
+
domain: j
|
|
374
|
+
}) ?? de;
|
|
375
|
+
if (F !== void 0) return /* @__PURE__ */ J(ce, {
|
|
375
376
|
...x,
|
|
376
|
-
message:
|
|
377
|
+
message: F
|
|
377
378
|
});
|
|
378
|
-
function
|
|
379
|
-
return
|
|
379
|
+
function I(e) {
|
|
380
|
+
return ne({
|
|
380
381
|
value: e,
|
|
381
382
|
locale: S,
|
|
382
383
|
format: i
|
|
383
384
|
});
|
|
384
385
|
}
|
|
385
|
-
let
|
|
386
|
+
let L = w !== void 0 && !t.some((e) => e.id === w.id), pe = [...t, ...L ? [w] : []], R = new Map(pe.map((e, t) => [e.id, ae({
|
|
386
387
|
id: e.id,
|
|
387
388
|
tone: e.tone,
|
|
388
389
|
index: t
|
|
389
390
|
})]));
|
|
390
|
-
function
|
|
391
|
-
return
|
|
391
|
+
function z(e) {
|
|
392
|
+
return R.get(e) ?? "neutral";
|
|
392
393
|
}
|
|
393
|
-
let
|
|
394
|
-
id:
|
|
394
|
+
let B = f === void 0 ? void 0 : {
|
|
395
|
+
id: T,
|
|
395
396
|
label: f.contextLabel,
|
|
396
397
|
tone: "neutral",
|
|
397
398
|
values: f.buckets.map((e) => e.kind === "gap" ? null : e.total)
|
|
398
|
-
},
|
|
399
|
+
}, he = B === void 0 ? t : [B, ...pe], xe = (w !== void 0 && B !== void 0 ? [w, B] : t).map((e) => ({
|
|
399
400
|
id: e.id,
|
|
400
401
|
label: e.label,
|
|
401
|
-
tone: e.id ===
|
|
402
|
-
})),
|
|
402
|
+
tone: e.id === T ? "neutral" : z(e.id)
|
|
403
|
+
})), Se = g.map((e) => ({
|
|
403
404
|
id: e.id,
|
|
404
405
|
label: e.label,
|
|
405
406
|
tone: e.tone ?? "neutral",
|
|
406
407
|
shape: e.kind
|
|
407
408
|
}));
|
|
408
|
-
function
|
|
409
|
-
let r = e[n], i = f?.buckets[n], a =
|
|
409
|
+
function Ce(n) {
|
|
410
|
+
let r = e[n], i = f?.buckets[n], a = w !== void 0 && B !== void 0 ? [w, B] : B === void 0 || i?.kind === "parts" ? t : [], o = i === void 0 ? void 0 : i.kind === "gap" ? "No reported value" : I(i.total), s = a.map((e) => ({
|
|
410
411
|
id: e.id,
|
|
411
412
|
label: e.label,
|
|
412
|
-
tone: e.id ===
|
|
413
|
-
value:
|
|
413
|
+
tone: e.id === T ? "neutral" : z(e.id),
|
|
414
|
+
value: I(e.values[n] ?? null)
|
|
414
415
|
})), c = g.map((e) => ({
|
|
415
416
|
id: e.id,
|
|
416
417
|
label: e.label,
|
|
417
418
|
tone: e.tone ?? "neutral",
|
|
418
419
|
shape: e.kind,
|
|
419
|
-
value:
|
|
420
|
+
value: Me({
|
|
420
421
|
marker: e,
|
|
421
422
|
index: n,
|
|
422
|
-
valueText:
|
|
423
|
+
valueText: I
|
|
423
424
|
})
|
|
424
425
|
})), l = h.map((e) => ({
|
|
425
426
|
id: e.id,
|
|
426
427
|
label: e.label,
|
|
427
428
|
tone: e.tone ?? "neutral",
|
|
428
429
|
shape: "dashed",
|
|
429
|
-
value:
|
|
430
|
+
value: I(e.value)
|
|
430
431
|
}));
|
|
431
432
|
return {
|
|
432
433
|
category: r,
|
|
@@ -440,9 +441,9 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
440
441
|
notes: _.filter((e) => e.categoryId === r?.id).map((e) => e.label)
|
|
441
442
|
};
|
|
442
443
|
}
|
|
443
|
-
let
|
|
444
|
-
width:
|
|
445
|
-
height:
|
|
444
|
+
let V = f?.annotation, we = _.length > 0 || V !== void 0, Te = p({
|
|
445
|
+
width: O,
|
|
446
|
+
height: k,
|
|
446
447
|
direction: "columns",
|
|
447
448
|
categories: e.map((e) => ({
|
|
448
449
|
id: e.id,
|
|
@@ -453,45 +454,45 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
453
454
|
format: i,
|
|
454
455
|
tickFormat: a
|
|
455
456
|
},
|
|
456
|
-
valueDomain:
|
|
457
|
+
valueDomain: j,
|
|
457
458
|
locale: S,
|
|
458
|
-
topInset:
|
|
459
|
+
topInset: we ? $e : 0,
|
|
459
460
|
hasValueTitle: o !== void 0
|
|
460
|
-
}), { box:
|
|
461
|
+
}), { box: W, band: G } = Te, K = Te.value.position, Ee = A({
|
|
461
462
|
ids: t.map((e) => e.id),
|
|
462
|
-
range: [0,
|
|
463
|
-
padding:
|
|
464
|
-
}),
|
|
465
|
-
function De(e) {
|
|
466
|
-
return K.start(e) ?? G.left;
|
|
467
|
-
}
|
|
463
|
+
range: [0, G.bandwidth],
|
|
464
|
+
padding: nt
|
|
465
|
+
}), De = r === "stacked" || f !== void 0;
|
|
468
466
|
function Oe(e) {
|
|
469
|
-
return
|
|
467
|
+
return G.start(e) ?? W.left;
|
|
468
|
+
}
|
|
469
|
+
function ke(e) {
|
|
470
|
+
return Oe(e) + G.bandwidth * at;
|
|
470
471
|
}
|
|
471
|
-
function
|
|
472
|
-
let n =
|
|
473
|
-
return
|
|
472
|
+
function q(e, t) {
|
|
473
|
+
let n = Oe(e);
|
|
474
|
+
return De ? {
|
|
474
475
|
x: n,
|
|
475
|
-
width:
|
|
476
|
+
width: G.bandwidth
|
|
476
477
|
} : {
|
|
477
|
-
x: n + (
|
|
478
|
-
width:
|
|
478
|
+
x: n + (Ee.start(t) ?? 0),
|
|
479
|
+
width: Ee.bandwidth
|
|
479
480
|
};
|
|
480
481
|
}
|
|
481
482
|
function Z(e, n) {
|
|
482
|
-
if (!
|
|
483
|
+
if (!De) return t.find((e) => e.id === n)?.values[e] ?? null;
|
|
483
484
|
let r = t.flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null));
|
|
484
485
|
return r.length === 0 ? null : r.reduce((e, t) => e + t, 0);
|
|
485
486
|
}
|
|
486
487
|
function Q(e, n) {
|
|
487
|
-
let r = (n === void 0 ? t : t.filter((e) => e.id === n)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), i =
|
|
488
|
+
let r = (n === void 0 ? t : t.filter((e) => e.id === n)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), i = De ? r.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...r), a = f?.buckets[e], o = a === void 0 || a.kind === "gap" ? 0 : a.total, s = g.filter((e) => n === void 0 || e.seriesId === n).flatMap((t) => [Ne(t, e)].filter((e) => e !== null));
|
|
488
489
|
return Math.max(0, i, o, ...s);
|
|
489
490
|
}
|
|
490
|
-
function
|
|
491
|
-
return Math.max(
|
|
491
|
+
function Ae(e) {
|
|
492
|
+
return Math.max(tt, K(e) - et);
|
|
492
493
|
}
|
|
493
494
|
let Pe = {
|
|
494
|
-
label: `${
|
|
495
|
+
label: `${C} observations`,
|
|
495
496
|
columns: [{
|
|
496
497
|
id: "category",
|
|
497
498
|
label: "Category"
|
|
@@ -502,83 +503,83 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
502
503
|
rows: [...e.map((e, t) => ({
|
|
503
504
|
id: e.id,
|
|
504
505
|
values: [e.label, [
|
|
505
|
-
...
|
|
506
|
-
...g.map((e) => `${e.label}: ${
|
|
506
|
+
...he.map((e) => `${e.label}: ${I(e.values[t] ?? null)}`),
|
|
507
|
+
...g.map((e) => `${e.label}: ${Me({
|
|
507
508
|
marker: e,
|
|
508
509
|
index: t,
|
|
509
|
-
valueText:
|
|
510
|
+
valueText: I
|
|
510
511
|
})}`),
|
|
511
512
|
..._.filter((t) => t.categoryId === e.id).map((e) => e.label)
|
|
512
513
|
].join(" · ")]
|
|
513
514
|
})), ...h.map((e) => ({
|
|
514
515
|
id: `reference:${e.id}`,
|
|
515
|
-
values: [e.label,
|
|
516
|
+
values: [e.label, I(e.value)]
|
|
516
517
|
}))]
|
|
517
518
|
};
|
|
518
519
|
return /* @__PURE__ */ J(ee, {
|
|
519
520
|
items: e,
|
|
520
|
-
readout: (e) =>
|
|
521
|
-
locate: (e) =>
|
|
521
|
+
readout: (e) => ie(Ce(P.indexOf(e))),
|
|
522
|
+
locate: (e) => G.idAt(e.x / e.width * W.width),
|
|
522
523
|
selected: c ?? null,
|
|
523
524
|
onSelect: l,
|
|
524
525
|
render: (n, { inspected: i, cursor: a }) => {
|
|
525
|
-
let u =
|
|
526
|
+
let u = Ce(P.indexOf(i ?? ""));
|
|
526
527
|
function d(e) {
|
|
527
528
|
let t = v.includes(e);
|
|
528
529
|
return v.length > 0 && !t && i !== e;
|
|
529
530
|
}
|
|
530
|
-
let p =
|
|
531
|
-
id: `composition:${
|
|
532
|
-
text:
|
|
533
|
-
x:
|
|
534
|
-
y:
|
|
535
|
-
isReceded: d(
|
|
531
|
+
let p = V === void 0 || !P.includes(V.categoryId) ? [] : [{
|
|
532
|
+
id: `composition:${V.categoryId}`,
|
|
533
|
+
text: V.label,
|
|
534
|
+
x: ke(V.categoryId),
|
|
535
|
+
y: Ae(V.value),
|
|
536
|
+
isReceded: d(V.categoryId)
|
|
536
537
|
}], ee = _.map((e) => {
|
|
537
538
|
let t = e.seriesId === void 0 ? {
|
|
538
|
-
x:
|
|
539
|
-
width:
|
|
540
|
-
} :
|
|
539
|
+
x: Oe(e.categoryId),
|
|
540
|
+
width: G.bandwidth
|
|
541
|
+
} : q(e.categoryId, e.seriesId);
|
|
541
542
|
return {
|
|
542
543
|
id: e.id,
|
|
543
544
|
text: e.label,
|
|
544
|
-
x: t.x + t.width *
|
|
545
|
-
y:
|
|
545
|
+
x: t.x + t.width * at,
|
|
546
|
+
y: Ae(Q(P.indexOf(e.categoryId), e.seriesId)),
|
|
546
547
|
isReceded: d(e.categoryId)
|
|
547
548
|
};
|
|
548
549
|
}), y = [...p, ...ee];
|
|
549
|
-
return /* @__PURE__ */ J(
|
|
550
|
+
return /* @__PURE__ */ J(ot, {
|
|
550
551
|
...x,
|
|
551
552
|
figure: n,
|
|
552
|
-
legend: [...
|
|
553
|
-
layoutLegend: [...
|
|
553
|
+
legend: [...xe, ...Se],
|
|
554
|
+
layoutLegend: [...oe(t), ...Se],
|
|
554
555
|
notes: u.notes,
|
|
555
|
-
inspectionId:
|
|
556
|
+
inspectionId: E,
|
|
556
557
|
label: u.label,
|
|
557
558
|
titleDetail: u.category === void 0 ? void 0 : [u.category.axisLabel ?? u.category.label, u.summary].filter(Boolean).join(" · "),
|
|
558
559
|
summary: u.summary,
|
|
559
560
|
rows: u.rows,
|
|
560
|
-
x:
|
|
561
|
-
width:
|
|
562
|
-
offset:
|
|
561
|
+
x: ke(i ?? ""),
|
|
562
|
+
width: O,
|
|
563
|
+
offset: G.bandwidth * at + it,
|
|
563
564
|
data: Pe,
|
|
564
|
-
children: e.length === 0 || t.length === 0 && f === void 0 ? /* @__PURE__ */ J(
|
|
565
|
-
plotRef:
|
|
566
|
-
box:
|
|
565
|
+
children: e.length === 0 || t.length === 0 && f === void 0 ? /* @__PURE__ */ J(le, { children: b }) : /* @__PURE__ */ Y(ge, {
|
|
566
|
+
plotRef: D,
|
|
567
|
+
box: W,
|
|
567
568
|
label: m({
|
|
568
|
-
title:
|
|
569
|
+
title: C,
|
|
569
570
|
marks: "categories",
|
|
570
571
|
isSelectable: l !== void 0
|
|
571
572
|
}),
|
|
572
|
-
readoutId:
|
|
573
|
+
readoutId: E,
|
|
573
574
|
children: [
|
|
574
|
-
/* @__PURE__ */ J(
|
|
575
|
-
box:
|
|
576
|
-
xTicks:
|
|
577
|
-
yTicks:
|
|
575
|
+
/* @__PURE__ */ J(ue, {
|
|
576
|
+
box: W,
|
|
577
|
+
xTicks: Te.bandTicks,
|
|
578
|
+
yTicks: Te.valueTicks,
|
|
578
579
|
yTitle: o
|
|
579
580
|
}),
|
|
580
|
-
/* @__PURE__ */ Y(
|
|
581
|
-
box:
|
|
581
|
+
/* @__PURE__ */ Y(ve, {
|
|
582
|
+
box: W,
|
|
582
583
|
children: [
|
|
583
584
|
e.map((e, n) => {
|
|
584
585
|
let a = f?.buckets[n], o = {
|
|
@@ -588,66 +589,66 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
588
589
|
return a === void 0 ? t.map((i, a) => {
|
|
589
590
|
let c = i.values[n];
|
|
590
591
|
if (c == null || r === "stacked" && c === 0) return null;
|
|
591
|
-
let l = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u =
|
|
592
|
-
return /* @__PURE__ */ J(
|
|
592
|
+
let l = r === "stacked" ? t.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u = K(l), f = K(l + c), p = s != null && s !== i.id, m = q(e.id, i.id);
|
|
593
|
+
return /* @__PURE__ */ J(me, {
|
|
593
594
|
...o,
|
|
594
595
|
x: m.x,
|
|
595
596
|
y: Math.min(u, f),
|
|
596
597
|
width: m.width,
|
|
597
598
|
height: Math.max(+(c === 0), Math.abs(f - u)),
|
|
598
|
-
tone:
|
|
599
|
+
tone: z(i.id),
|
|
599
600
|
emphasis: p || d(e.id) ? "receded" : "normal",
|
|
600
601
|
mark: t.length === 1 ? e.id : `${e.id}:${i.id}`
|
|
601
602
|
}, `${e.id}:${i.id}`);
|
|
602
603
|
}) : /* @__PURE__ */ J("g", {
|
|
603
|
-
...H.props(
|
|
604
|
-
children: /* @__PURE__ */ J(
|
|
604
|
+
...H.props(N.emphasis, d(e.id) && N.receded),
|
|
605
|
+
children: /* @__PURE__ */ J(Ze, {
|
|
605
606
|
...o,
|
|
606
607
|
bucket: a,
|
|
607
608
|
series: t,
|
|
608
|
-
focusedSeries:
|
|
609
|
+
focusedSeries: w,
|
|
609
610
|
index: n,
|
|
610
|
-
x:
|
|
611
|
-
width:
|
|
612
|
-
y:
|
|
611
|
+
x: Oe(e.id),
|
|
612
|
+
width: G.bandwidth,
|
|
613
|
+
y: K,
|
|
613
614
|
highlighted: s,
|
|
614
|
-
toneOf:
|
|
615
|
+
toneOf: z
|
|
615
616
|
})
|
|
616
617
|
}, e.id);
|
|
617
618
|
}),
|
|
618
|
-
/* @__PURE__ */ J(
|
|
619
|
-
x1:
|
|
620
|
-
x2:
|
|
621
|
-
y1:
|
|
622
|
-
y2:
|
|
619
|
+
/* @__PURE__ */ J(fe, {
|
|
620
|
+
x1: W.left,
|
|
621
|
+
x2: W.right,
|
|
622
|
+
y1: K(0),
|
|
623
|
+
y2: K(0)
|
|
623
624
|
}),
|
|
624
|
-
/* @__PURE__ */ J(
|
|
625
|
+
/* @__PURE__ */ J(Ke, {
|
|
625
626
|
markers: g,
|
|
626
|
-
categoryIds:
|
|
627
|
-
span:
|
|
627
|
+
categoryIds: P,
|
|
628
|
+
span: q,
|
|
628
629
|
barTop: Z,
|
|
629
|
-
y:
|
|
630
|
+
y: K,
|
|
630
631
|
isReceded: d
|
|
631
632
|
})
|
|
632
633
|
]
|
|
633
634
|
}),
|
|
634
|
-
/* @__PURE__ */ J(
|
|
635
|
+
/* @__PURE__ */ J(be, {
|
|
635
636
|
lines: h,
|
|
636
|
-
box:
|
|
637
|
-
position:
|
|
638
|
-
valueText:
|
|
639
|
-
avoid:
|
|
637
|
+
box: W,
|
|
638
|
+
position: K,
|
|
639
|
+
valueText: I,
|
|
640
|
+
avoid: ze(y)
|
|
640
641
|
}),
|
|
641
|
-
/* @__PURE__ */ J(
|
|
642
|
+
/* @__PURE__ */ J(qe, {
|
|
642
643
|
annotations: y,
|
|
643
|
-
left:
|
|
644
|
-
right:
|
|
644
|
+
left: W.left,
|
|
645
|
+
right: W.right
|
|
645
646
|
}),
|
|
646
|
-
a !== null && /* @__PURE__ */ J(
|
|
647
|
-
x:
|
|
648
|
-
top:
|
|
649
|
-
bottom:
|
|
650
|
-
width: Math.max(
|
|
647
|
+
a !== null && /* @__PURE__ */ J(re, {
|
|
648
|
+
x: ke(a),
|
|
649
|
+
top: W.top,
|
|
650
|
+
bottom: W.bottom,
|
|
651
|
+
width: Math.max(rt, G.bandwidth)
|
|
651
652
|
})
|
|
652
653
|
]
|
|
653
654
|
})
|
|
@@ -656,13 +657,13 @@ function dt({ categories: e, series: t, domain: n, mode: r = "grouped", valueFor
|
|
|
656
657
|
});
|
|
657
658
|
}
|
|
658
659
|
// packages/charts/src/cartesian/breakdown-bar.tsx
|
|
659
|
-
var
|
|
660
|
+
var pt = {
|
|
660
661
|
kzqmXN: "x5lhr3w",
|
|
661
662
|
kGVxlE: "x1iotiob",
|
|
662
663
|
kZKoxP: "x5yr21d",
|
|
663
664
|
$$css: !0
|
|
664
|
-
},
|
|
665
|
-
|
|
665
|
+
}, mt = { segment: (e, t, n) => [
|
|
666
|
+
pt,
|
|
666
667
|
{
|
|
667
668
|
kWkggS: t == null ? t : "xl8spv7",
|
|
668
669
|
$$css: !0
|
|
@@ -672,24 +673,24 @@ var ft = {
|
|
|
672
673
|
"--x-backgroundColor": t ?? void 0,
|
|
673
674
|
"--x-boxShadow": `inset 0 0 0 1px ${n}` == null ? void 0 : `inset 0 0 0 1px ${n}`
|
|
674
675
|
}
|
|
675
|
-
] },
|
|
676
|
-
function
|
|
677
|
-
let { emptyLabel: c = "No values", ...l } = s, { locale: u, title: d } = l, f =
|
|
678
|
-
if (l.status === "loading") return /* @__PURE__ */ J(
|
|
676
|
+
] }, ht = 100;
|
|
677
|
+
function gt({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange: o, ...s }) {
|
|
678
|
+
let { emptyLabel: c = "No values", ...l } = s, { locale: u, title: d } = l, f = te();
|
|
679
|
+
if (l.status === "loading") return /* @__PURE__ */ J(ae, {
|
|
679
680
|
...l,
|
|
680
681
|
height: "compact"
|
|
681
682
|
});
|
|
682
683
|
let p = y(e), m = e.reduce((e, t) => e + (t.value ?? 0), 0), h = 2 ** -52 * Math.max(m, t, 1) * e.length;
|
|
683
|
-
if (p !== void 0) return /* @__PURE__ */ J(
|
|
684
|
+
if (p !== void 0) return /* @__PURE__ */ J(ce, {
|
|
684
685
|
...l,
|
|
685
686
|
message: p
|
|
686
687
|
});
|
|
687
|
-
if (!Number.isFinite(t) || t < 0 || m - t > h) return /* @__PURE__ */ J(
|
|
688
|
+
if (!Number.isFinite(t) || t < 0 || m - t > h) return /* @__PURE__ */ J(ce, {
|
|
688
689
|
...l,
|
|
689
690
|
message: "The total must be finite and at least the sum of recorded values."
|
|
690
691
|
});
|
|
691
692
|
function g(e) {
|
|
692
|
-
return
|
|
693
|
+
return ne({
|
|
693
694
|
value: e,
|
|
694
695
|
locale: u,
|
|
695
696
|
format: n
|
|
@@ -713,13 +714,13 @@ function ht({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange:
|
|
|
713
714
|
render: (n, r) => /* @__PURE__ */ J(j, {
|
|
714
715
|
...l,
|
|
715
716
|
figure: n,
|
|
716
|
-
children: e.length === 0 ? /* @__PURE__ */ J(
|
|
717
|
+
children: e.length === 0 ? /* @__PURE__ */ J(le, { children: c }) : /* @__PURE__ */ Y(q, { children: [
|
|
717
718
|
/* @__PURE__ */ J("div", {
|
|
718
719
|
"aria-hidden": !0,
|
|
719
720
|
className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
|
|
720
721
|
children: e.map((e, n) => {
|
|
721
722
|
let r = _[n]?.tone ?? "neutral";
|
|
722
|
-
return e.value === null ? null : /* @__PURE__ */ J("span", { ...H.props(
|
|
723
|
+
return e.value === null ? null : /* @__PURE__ */ J("span", { ...H.props(mt.segment(t === 0 ? 0 : e.value / t * ht, a[r], i[r])) }, e.id);
|
|
723
724
|
})
|
|
724
725
|
}),
|
|
725
726
|
/* @__PURE__ */ J(S, {
|
|
@@ -741,15 +742,15 @@ function ht({ items: e, total: t, valueFormat: n, selected: r, onSelectedChange:
|
|
|
741
742
|
});
|
|
742
743
|
}
|
|
743
744
|
// packages/charts/src/cartesian/bridge-data.ts
|
|
744
|
-
function
|
|
745
|
+
function _t(e) {
|
|
745
746
|
return e.kind !== "change" || e.value === null ? "neutral" : e.value < 0 ? "negative" : "positive";
|
|
746
747
|
}
|
|
747
|
-
function
|
|
748
|
+
function vt(e) {
|
|
748
749
|
let t = e.map((e) => e.kind === "total" ? 0 : e.value);
|
|
749
750
|
return e[0]?.kind !== "start" || t.includes(null) ? null : t.reduce((e, t) => e + (t ?? 0), 0);
|
|
750
751
|
}
|
|
751
|
-
function
|
|
752
|
-
let r = e.tone ??
|
|
752
|
+
function yt({ step: e, before: t, after: n }) {
|
|
753
|
+
let r = e.tone ?? _t(e);
|
|
753
754
|
switch (e.kind) {
|
|
754
755
|
case "start": return {
|
|
755
756
|
step: e,
|
|
@@ -771,18 +772,18 @@ function vt({ step: e, before: t, after: n }) {
|
|
|
771
772
|
};
|
|
772
773
|
}
|
|
773
774
|
}
|
|
774
|
-
function
|
|
775
|
-
return e.map((t, n) =>
|
|
775
|
+
function bt(e) {
|
|
776
|
+
return e.map((t, n) => yt({
|
|
776
777
|
step: t,
|
|
777
|
-
before:
|
|
778
|
-
after:
|
|
778
|
+
before: vt(e.slice(0, n)),
|
|
779
|
+
after: vt(e.slice(0, n + 1))
|
|
779
780
|
}));
|
|
780
781
|
}
|
|
781
|
-
function
|
|
782
|
+
function xt(e) {
|
|
782
783
|
let t = e.flatMap((e) => [e.from, e.to].filter((e) => e !== null)), n = Math.min(0, ...t), r = Math.max(0, ...t);
|
|
783
784
|
return n === r ? [n, n + 1] : [n, r];
|
|
784
785
|
}
|
|
785
|
-
function
|
|
786
|
+
function St({ steps: e, domain: t }) {
|
|
786
787
|
if (e.length > x.items) return `Choose a bridge with at most ${x.items} steps.`;
|
|
787
788
|
if (!o(e)) return "Bridge steps require unique identifiers.";
|
|
788
789
|
if (e.length > 0 && e[0]?.kind !== "start") return "A bridge begins with one start step.";
|
|
@@ -791,36 +792,36 @@ function xt({ steps: e, domain: t }) {
|
|
|
791
792
|
let t = e.kind === "total" ? null : e.value;
|
|
792
793
|
return t !== null && !Number.isFinite(t);
|
|
793
794
|
})) return "Bridge values must be finite numbers or explicit missing changes.";
|
|
794
|
-
let n = bt(
|
|
795
|
+
let n = xt(bt(e));
|
|
795
796
|
if (t === void 0) return Number.isFinite(n[0]) && Number.isFinite(n[1]) ? void 0 : "Running totals must stay finite.";
|
|
796
797
|
let r = t[0] <= n[0] && t[1] >= n[1];
|
|
797
798
|
if (!D(t) || !r) return "The bridge domain must be finite, increasing, and contain zero and every running total.";
|
|
798
799
|
}
|
|
799
800
|
// packages/charts/src/cartesian/bridge-chart.tsx
|
|
800
|
-
var
|
|
801
|
-
function
|
|
801
|
+
var Ct = 12, wt = 6, Tt = 14, Et = 12, Dt = 8, Ot = 8, kt = .5;
|
|
802
|
+
function At(e) {
|
|
802
803
|
return typeof e == "function" ? (t) => t === 0 ? e(0) : `${t > 0 ? "+" : "−"}${e(Math.abs(t))}` : {
|
|
803
804
|
...e,
|
|
804
805
|
signDisplay: "exceptZero"
|
|
805
806
|
};
|
|
806
807
|
}
|
|
807
|
-
function
|
|
808
|
+
function jt({ level: e, valueText: t, changeText: n }) {
|
|
808
809
|
return e.step.kind === "change" && e.step.value !== null ? n(e.step.value) : e.to === null ? "—" : t(e.to);
|
|
809
810
|
}
|
|
810
|
-
function
|
|
811
|
+
function Mt({ level: e, valueText: t, changeText: n }) {
|
|
811
812
|
return e.step.kind === "change" ? e.step.value === null ? T : n(e.step.value) : e.to === null ? T : t(e.to);
|
|
812
813
|
}
|
|
813
|
-
function
|
|
814
|
+
function Nt({ level: e, valueText: t }) {
|
|
814
815
|
return e.from === null || e.to === null ? T : `${t(e.from)} → ${t(e.to)}`;
|
|
815
816
|
}
|
|
816
|
-
function
|
|
817
|
+
function Pt(e, t, n) {
|
|
817
818
|
if (e.from === null || e.to === null) {
|
|
818
|
-
let r = Math.min(n -
|
|
819
|
+
let r = Math.min(n - Et, t(e.from ?? 0) - Et * kt);
|
|
819
820
|
return {
|
|
820
821
|
isKnown: !1,
|
|
821
822
|
top: r,
|
|
822
|
-
height:
|
|
823
|
-
labelY: r -
|
|
823
|
+
height: Et,
|
|
824
|
+
labelY: r - wt
|
|
824
825
|
};
|
|
825
826
|
}
|
|
826
827
|
let r = Math.max(e.from, e.to), i = Math.min(e.from, e.to), a = t(r), o = r <= 0 && i < 0;
|
|
@@ -828,41 +829,41 @@ function Nt(e, t, n) {
|
|
|
828
829
|
isKnown: !0,
|
|
829
830
|
top: a,
|
|
830
831
|
height: Math.max(1, t(i) - a),
|
|
831
|
-
labelY: o ? t(i) +
|
|
832
|
+
labelY: o ? t(i) + Tt : a - wt
|
|
832
833
|
};
|
|
833
834
|
}
|
|
834
|
-
function
|
|
835
|
-
let { emptyLabel: f = "No steps", ...h } = d, { locale: g, title: _ } = h, v =
|
|
836
|
-
if (h.status === "loading") return /* @__PURE__ */ J(
|
|
835
|
+
function Ft({ steps: e, valueFormat: t, changeFormat: n = At(t), tickFormat: r, valueLabel: i, domain: a, referenceLines: o = [], selected: s, onSelectedChange: c, height: l = "regular", ...d }) {
|
|
836
|
+
let { emptyLabel: f = "No steps", ...h } = d, { locale: g, title: _ } = h, v = _e(l), y = U();
|
|
837
|
+
if (h.status === "loading") return /* @__PURE__ */ J(ae, {
|
|
837
838
|
...h,
|
|
838
839
|
height: l
|
|
839
840
|
});
|
|
840
|
-
let b =
|
|
841
|
+
let b = bt(e), x = xt(b), S = a ?? u({ values: [...x, ...o.map((e) => e.value)] }), C = St({
|
|
841
842
|
steps: e,
|
|
842
843
|
domain: a
|
|
843
|
-
}) ??
|
|
844
|
+
}) ?? ye({
|
|
844
845
|
lines: o,
|
|
845
846
|
domain: S
|
|
846
847
|
});
|
|
847
|
-
if (C !== void 0) return /* @__PURE__ */ J(
|
|
848
|
+
if (C !== void 0) return /* @__PURE__ */ J(ce, {
|
|
848
849
|
...h,
|
|
849
850
|
message: C
|
|
850
851
|
});
|
|
851
|
-
function
|
|
852
|
-
return (t) =>
|
|
852
|
+
function te(e) {
|
|
853
|
+
return (t) => ne({
|
|
853
854
|
value: t,
|
|
854
855
|
locale: g,
|
|
855
856
|
format: e
|
|
856
857
|
});
|
|
857
858
|
}
|
|
858
|
-
let
|
|
859
|
+
let w = te(t), T = te(n), E = o.map((e) => ({
|
|
859
860
|
id: e.id,
|
|
860
861
|
label: e.label,
|
|
861
862
|
tone: e.tone ?? "neutral",
|
|
862
863
|
shape: "dashed",
|
|
863
|
-
value:
|
|
864
|
+
value: w(e.value)
|
|
864
865
|
}));
|
|
865
|
-
function
|
|
866
|
+
function D(e) {
|
|
866
867
|
let t = b.find((t) => t.step.id === e);
|
|
867
868
|
if (t === void 0) return {
|
|
868
869
|
level: t,
|
|
@@ -874,23 +875,23 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
874
875
|
id: "running",
|
|
875
876
|
label: "Running total",
|
|
876
877
|
tone: "neutral",
|
|
877
|
-
value:
|
|
878
|
+
value: Nt({
|
|
878
879
|
level: t,
|
|
879
|
-
valueText:
|
|
880
|
+
valueText: w
|
|
880
881
|
})
|
|
881
882
|
}] : [];
|
|
882
883
|
return {
|
|
883
884
|
level: t,
|
|
884
885
|
label: t.step.label,
|
|
885
|
-
summary:
|
|
886
|
+
summary: Mt({
|
|
886
887
|
level: t,
|
|
887
|
-
valueText:
|
|
888
|
-
changeText:
|
|
888
|
+
valueText: w,
|
|
889
|
+
changeText: T
|
|
889
890
|
}),
|
|
890
|
-
rows: [...n, ...
|
|
891
|
+
rows: [...n, ...E]
|
|
891
892
|
};
|
|
892
893
|
}
|
|
893
|
-
let
|
|
894
|
+
let O = p({
|
|
894
895
|
width: v.width,
|
|
895
896
|
height: v.height,
|
|
896
897
|
direction: "columns",
|
|
@@ -905,43 +906,43 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
905
906
|
},
|
|
906
907
|
valueDomain: S,
|
|
907
908
|
locale: g,
|
|
908
|
-
topInset:
|
|
909
|
+
topInset: Ct,
|
|
909
910
|
hasValueTitle: i !== void 0
|
|
910
|
-
}), { box:
|
|
911
|
+
}), { box: k, band: A } = O, M = O.value.position, N = b.map((e) => ({
|
|
911
912
|
id: e.step.id,
|
|
912
913
|
label: e.step.label
|
|
913
914
|
}));
|
|
914
|
-
function
|
|
915
|
-
return
|
|
915
|
+
function P(e) {
|
|
916
|
+
return A.start(e) ?? k.left;
|
|
916
917
|
}
|
|
917
|
-
function
|
|
918
|
-
return
|
|
918
|
+
function de(e) {
|
|
919
|
+
return P(e) + A.bandwidth * kt;
|
|
919
920
|
}
|
|
920
|
-
let
|
|
921
|
+
let I = ze([...b.filter((e) => e.step.kind !== "change"), ...b.filter((e) => e.step.kind === "change")].map((e) => ({
|
|
921
922
|
id: e.step.id,
|
|
922
923
|
isTotal: e.step.kind !== "change",
|
|
923
|
-
text:
|
|
924
|
+
text: jt({
|
|
924
925
|
level: e,
|
|
925
|
-
valueText:
|
|
926
|
-
changeText:
|
|
926
|
+
valueText: w,
|
|
927
|
+
changeText: T
|
|
927
928
|
}),
|
|
928
|
-
x:
|
|
929
|
-
y:
|
|
929
|
+
x: de(e.step.id),
|
|
930
|
+
y: Pt(e, M, k.bottom).labelY
|
|
930
931
|
})));
|
|
931
932
|
return /* @__PURE__ */ J(ee, {
|
|
932
|
-
items:
|
|
933
|
-
readout: (e) =>
|
|
934
|
-
locate: (e) =>
|
|
933
|
+
items: N,
|
|
934
|
+
readout: (e) => ie(D(e)),
|
|
935
|
+
locate: (e) => A.idAt(e.x / e.width * k.width),
|
|
935
936
|
selected: s ?? null,
|
|
936
937
|
onSelect: c,
|
|
937
938
|
render: (e, { inspected: t, cursor: n }) => {
|
|
938
|
-
let r =
|
|
939
|
+
let r = D(t);
|
|
939
940
|
return /* @__PURE__ */ Y(j, {
|
|
940
941
|
...h,
|
|
941
942
|
figure: e,
|
|
942
943
|
titleDetail: r.level === void 0 ? void 0 : `${r.label} · ${r.summary}`,
|
|
943
944
|
children: [
|
|
944
|
-
/* @__PURE__ */ J(
|
|
945
|
+
/* @__PURE__ */ J(oe, {
|
|
945
946
|
label: `${_} steps`,
|
|
946
947
|
columns: [
|
|
947
948
|
{
|
|
@@ -961,43 +962,43 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
961
962
|
id: e.step.id,
|
|
962
963
|
values: [
|
|
963
964
|
e.step.label,
|
|
964
|
-
|
|
965
|
+
Mt({
|
|
965
966
|
level: e,
|
|
966
|
-
valueText:
|
|
967
|
-
changeText:
|
|
967
|
+
valueText: w,
|
|
968
|
+
changeText: T
|
|
968
969
|
}),
|
|
969
|
-
e.step.kind === "change" ?
|
|
970
|
+
e.step.kind === "change" ? Nt({
|
|
970
971
|
level: e,
|
|
971
|
-
valueText:
|
|
972
|
-
}) :
|
|
972
|
+
valueText: w
|
|
973
|
+
}) : Mt({
|
|
973
974
|
level: e,
|
|
974
|
-
valueText:
|
|
975
|
-
changeText:
|
|
975
|
+
valueText: w,
|
|
976
|
+
changeText: T
|
|
976
977
|
})
|
|
977
978
|
]
|
|
978
979
|
})), ...o.map((e) => ({
|
|
979
980
|
id: `reference:${e.id}`,
|
|
980
981
|
values: [
|
|
981
982
|
e.label,
|
|
982
|
-
|
|
983
|
+
w(e.value),
|
|
983
984
|
""
|
|
984
985
|
]
|
|
985
986
|
}))]
|
|
986
987
|
}),
|
|
987
|
-
/* @__PURE__ */ J(
|
|
988
|
+
/* @__PURE__ */ J(se, {
|
|
988
989
|
id: y,
|
|
989
990
|
label: r.label,
|
|
990
991
|
summary: r.summary,
|
|
991
992
|
legend: [],
|
|
992
993
|
hasLegend: !1,
|
|
993
994
|
rows: r.rows,
|
|
994
|
-
x:
|
|
995
|
+
x: de(t ?? ""),
|
|
995
996
|
width: v.width,
|
|
996
|
-
offset:
|
|
997
|
+
offset: A.bandwidth * kt + Ot
|
|
997
998
|
}),
|
|
998
|
-
b.length === 0 ? /* @__PURE__ */ J(
|
|
999
|
+
b.length === 0 ? /* @__PURE__ */ J(le, { children: f }) : /* @__PURE__ */ Y(ge, {
|
|
999
1000
|
plotRef: v.ref,
|
|
1000
|
-
box:
|
|
1001
|
+
box: k,
|
|
1001
1002
|
label: m({
|
|
1002
1003
|
title: _,
|
|
1003
1004
|
marks: "steps",
|
|
@@ -1005,30 +1006,30 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1005
1006
|
}),
|
|
1006
1007
|
readoutId: y,
|
|
1007
1008
|
children: [
|
|
1008
|
-
/* @__PURE__ */ J(
|
|
1009
|
-
box:
|
|
1010
|
-
xTicks:
|
|
1011
|
-
yTicks:
|
|
1009
|
+
/* @__PURE__ */ J(ue, {
|
|
1010
|
+
box: k,
|
|
1011
|
+
xTicks: O.bandTicks,
|
|
1012
|
+
yTicks: O.valueTicks,
|
|
1012
1013
|
yTitle: i
|
|
1013
1014
|
}),
|
|
1014
|
-
/* @__PURE__ */ Y(
|
|
1015
|
-
box:
|
|
1015
|
+
/* @__PURE__ */ Y(ve, {
|
|
1016
|
+
box: k,
|
|
1016
1017
|
children: [
|
|
1017
1018
|
b.map((e, t) => {
|
|
1018
1019
|
let n = b[t + 1];
|
|
1019
|
-
return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ J(
|
|
1020
|
-
x1:
|
|
1021
|
-
x2:
|
|
1022
|
-
y1:
|
|
1023
|
-
y2:
|
|
1020
|
+
return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ J(L, {
|
|
1021
|
+
x1: P(e.step.id) + A.bandwidth,
|
|
1022
|
+
x2: P(n.step.id),
|
|
1023
|
+
y1: M(e.to),
|
|
1024
|
+
y2: M(e.to)
|
|
1024
1025
|
}, `connector:${e.step.id}`);
|
|
1025
1026
|
}),
|
|
1026
1027
|
b.map((e) => {
|
|
1027
|
-
let n =
|
|
1028
|
-
return /* @__PURE__ */ J(
|
|
1029
|
-
x:
|
|
1028
|
+
let n = Pt(e, M, k.bottom);
|
|
1029
|
+
return /* @__PURE__ */ J(me, {
|
|
1030
|
+
x: P(e.step.id),
|
|
1030
1031
|
y: n.top,
|
|
1031
|
-
width:
|
|
1032
|
+
width: A.bandwidth,
|
|
1032
1033
|
height: n.height,
|
|
1033
1034
|
tone: n.isKnown ? e.tone : "neutral",
|
|
1034
1035
|
isHollow: !n.isKnown,
|
|
@@ -1036,25 +1037,25 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1036
1037
|
isInspected: t === e.step.id
|
|
1037
1038
|
}, e.step.id);
|
|
1038
1039
|
}),
|
|
1039
|
-
/* @__PURE__ */ J(
|
|
1040
|
-
x1:
|
|
1041
|
-
x2:
|
|
1042
|
-
y1:
|
|
1043
|
-
y2:
|
|
1040
|
+
/* @__PURE__ */ J(fe, {
|
|
1041
|
+
x1: k.left,
|
|
1042
|
+
x2: k.right,
|
|
1043
|
+
y1: M(0),
|
|
1044
|
+
y2: M(0)
|
|
1044
1045
|
})
|
|
1045
1046
|
]
|
|
1046
1047
|
}),
|
|
1047
|
-
/* @__PURE__ */ J(
|
|
1048
|
+
/* @__PURE__ */ J(be, {
|
|
1048
1049
|
lines: o,
|
|
1049
|
-
box:
|
|
1050
|
-
position:
|
|
1051
|
-
valueText:
|
|
1052
|
-
avoid:
|
|
1050
|
+
box: k,
|
|
1051
|
+
position: M,
|
|
1052
|
+
valueText: w,
|
|
1053
|
+
avoid: I,
|
|
1053
1054
|
marks: b.map((e) => {
|
|
1054
|
-
let t =
|
|
1055
|
+
let t = Pt(e, M, k.bottom);
|
|
1055
1056
|
return {
|
|
1056
|
-
left:
|
|
1057
|
-
right:
|
|
1057
|
+
left: P(e.step.id),
|
|
1058
|
+
right: P(e.step.id) + A.bandwidth,
|
|
1058
1059
|
top: t.top,
|
|
1059
1060
|
bottom: t.top + t.height
|
|
1060
1061
|
};
|
|
@@ -1062,7 +1063,7 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1062
1063
|
}),
|
|
1063
1064
|
/* @__PURE__ */ J("g", {
|
|
1064
1065
|
"aria-hidden": !0,
|
|
1065
|
-
children:
|
|
1066
|
+
children: I.map((e) => /* @__PURE__ */ J(F, {
|
|
1066
1067
|
x: e.x,
|
|
1067
1068
|
y: e.y,
|
|
1068
1069
|
anchor: "middle",
|
|
@@ -1070,11 +1071,11 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1070
1071
|
children: e.text
|
|
1071
1072
|
}, e.id))
|
|
1072
1073
|
}),
|
|
1073
|
-
n !== null && /* @__PURE__ */ J(
|
|
1074
|
-
x:
|
|
1075
|
-
top:
|
|
1076
|
-
bottom:
|
|
1077
|
-
width: Math.max(
|
|
1074
|
+
n !== null && /* @__PURE__ */ J(re, {
|
|
1075
|
+
x: de(n),
|
|
1076
|
+
top: k.top,
|
|
1077
|
+
bottom: k.bottom,
|
|
1078
|
+
width: Math.max(Dt, A.bandwidth)
|
|
1078
1079
|
})
|
|
1079
1080
|
]
|
|
1080
1081
|
})
|
|
@@ -1084,7 +1085,7 @@ function Pt({ steps: e, valueFormat: t, changeFormat: n = kt(t), tickFormat: r,
|
|
|
1084
1085
|
});
|
|
1085
1086
|
}
|
|
1086
1087
|
// packages/charts/src/cartesian/scatter-plot.tsx
|
|
1087
|
-
var
|
|
1088
|
+
var It = { points: 1e3 }, Lt = {
|
|
1088
1089
|
target: {
|
|
1089
1090
|
kVAEAm: "x10l6tqk",
|
|
1090
1091
|
k1xSpc: "xrvj5dj",
|
|
@@ -1123,212 +1124,250 @@ var Ft = { points: 1e3 }, It = {
|
|
|
1123
1124
|
$$css: !0
|
|
1124
1125
|
}
|
|
1125
1126
|
};
|
|
1126
|
-
function
|
|
1127
|
+
function Rt(e, t) {
|
|
1127
1128
|
return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
|
|
1128
1129
|
}
|
|
1129
|
-
function
|
|
1130
|
+
function zt(e, t) {
|
|
1130
1131
|
return Number.isFinite(e) && e > 0 && e <= t[1] - t[0];
|
|
1131
1132
|
}
|
|
1132
|
-
function
|
|
1133
|
+
function Bt({ points: e, x: t, y: n, xDomain: r, yDomain: i, range: a, onRangeChange: s, rangeStep: c }) {
|
|
1133
1134
|
let l = O(r, t.scale) ?? O(i, n.scale);
|
|
1134
1135
|
if (l !== void 0) return l;
|
|
1135
|
-
if (e.length >
|
|
1136
|
+
if (e.length > It.points) return `This plot exceeds the ${It.points}-point render limit. Supply a smaller, labelled sample.`;
|
|
1136
1137
|
if (!o(e)) return "Scatter points must have unique identifiers.";
|
|
1137
1138
|
if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
|
|
1138
1139
|
if (e.some((e) => E(e.x, r) || E(e.y, i))) return "Scatter coordinates fall outside the declared domain. Widen the domain or supply a labelled window of points.";
|
|
1139
1140
|
if (s !== void 0) {
|
|
1140
|
-
if (c === void 0 || !
|
|
1141
|
-
if (a != null && (!
|
|
1141
|
+
if (c === void 0 || !zt(c.x, r) || !zt(c.y, i)) return "Range selection steps must be finite, positive, and no larger than their domain span.";
|
|
1142
|
+
if (a != null && (!Rt(a.x, r) || !Rt(a.y, i))) return "The selected range must have finite, ordered bounds inside the declared domain.";
|
|
1142
1143
|
}
|
|
1143
1144
|
}
|
|
1144
|
-
function
|
|
1145
|
+
function Vt(e, t) {
|
|
1145
1146
|
return [Math.min(e, t), Math.max(e, t)];
|
|
1146
1147
|
}
|
|
1147
|
-
function
|
|
1148
|
-
let { points: t, x: n, y: r,
|
|
1149
|
-
if (
|
|
1150
|
-
...
|
|
1151
|
-
height:
|
|
1148
|
+
function Ht(e) {
|
|
1149
|
+
let { points: t, x: n, y: r, referenceDiagonal: i, referenceLines: a = [], frontier: o = [], labeledIds: d = [], range: f, onRangeChange: p, rangeStep: h, selected: v, onSelectedChange: y, height: b = "regular", ...x } = e, { emptyLabel: S = "No points were supplied.", ...w } = x, { locale: T, title: E } = w, D = U(), O = _e(b), k = te(), A = C(), [re, ie] = G(null), se = W(null);
|
|
1150
|
+
if (Te(() => () => se.current?.(), []), w.status === "loading") return /* @__PURE__ */ J(ae, {
|
|
1151
|
+
...w,
|
|
1152
|
+
height: b
|
|
1152
1153
|
});
|
|
1153
|
-
let
|
|
1154
|
+
let M = n.domain ?? u({
|
|
1154
1155
|
values: t.map((e) => e.x),
|
|
1155
1156
|
scale: n.scale
|
|
1156
|
-
}),
|
|
1157
|
+
}), P = r.domain ?? u({
|
|
1157
1158
|
values: t.map((e) => e.y),
|
|
1158
1159
|
scale: r.scale
|
|
1159
|
-
}),
|
|
1160
|
+
}), I = Bt({
|
|
1160
1161
|
points: t,
|
|
1161
1162
|
x: n,
|
|
1162
1163
|
y: r,
|
|
1163
|
-
xDomain:
|
|
1164
|
-
yDomain:
|
|
1165
|
-
range:
|
|
1166
|
-
onRangeChange:
|
|
1167
|
-
rangeStep:
|
|
1168
|
-
})
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1164
|
+
xDomain: M,
|
|
1165
|
+
yDomain: P,
|
|
1166
|
+
range: f,
|
|
1167
|
+
onRangeChange: p,
|
|
1168
|
+
rangeStep: h
|
|
1169
|
+
}) ?? (a.length > 0 ? ye({
|
|
1170
|
+
lines: a,
|
|
1171
|
+
domain: P
|
|
1172
|
+
}) : void 0), fe = f ?? null;
|
|
1173
|
+
if (I !== void 0) return /* @__PURE__ */ J(ce, {
|
|
1174
|
+
...w,
|
|
1175
|
+
message: I
|
|
1172
1176
|
});
|
|
1173
|
-
let
|
|
1174
|
-
width:
|
|
1175
|
-
height:
|
|
1177
|
+
let L = _({
|
|
1178
|
+
width: O.width,
|
|
1179
|
+
height: O.height,
|
|
1176
1180
|
x: n,
|
|
1177
1181
|
y: r,
|
|
1178
|
-
xDomain:
|
|
1179
|
-
yDomain:
|
|
1180
|
-
locale:
|
|
1181
|
-
}), { box:
|
|
1182
|
-
function
|
|
1183
|
-
return
|
|
1182
|
+
xDomain: M,
|
|
1183
|
+
yDomain: P,
|
|
1184
|
+
locale: T
|
|
1185
|
+
}), { box: R } = L;
|
|
1186
|
+
function z(e) {
|
|
1187
|
+
return ne({
|
|
1184
1188
|
value: e,
|
|
1185
|
-
locale:
|
|
1189
|
+
locale: T,
|
|
1186
1190
|
format: n.format
|
|
1187
1191
|
});
|
|
1188
1192
|
}
|
|
1189
|
-
function
|
|
1190
|
-
return
|
|
1193
|
+
function me(e) {
|
|
1194
|
+
return ne({
|
|
1191
1195
|
value: e,
|
|
1192
|
-
locale:
|
|
1196
|
+
locale: T,
|
|
1193
1197
|
format: r.format
|
|
1194
1198
|
});
|
|
1195
1199
|
}
|
|
1196
|
-
let
|
|
1200
|
+
let B = t.map((e) => ({
|
|
1197
1201
|
id: e.id,
|
|
1198
|
-
label: `${e.label}, ${n.label}: ${
|
|
1199
|
-
})),
|
|
1202
|
+
label: `${e.label}, ${n.label}: ${z(e.x)}, ${r.label}: ${me(e.y)}`
|
|
1203
|
+
})), he = t.map((e, t) => ({
|
|
1200
1204
|
...e,
|
|
1201
|
-
tone:
|
|
1205
|
+
tone: k({
|
|
1202
1206
|
id: e.id,
|
|
1203
1207
|
tone: e.tone,
|
|
1204
1208
|
index: t
|
|
1205
1209
|
}),
|
|
1206
|
-
left:
|
|
1207
|
-
top:
|
|
1208
|
-
})),
|
|
1210
|
+
left: L.x.position(e.x),
|
|
1211
|
+
top: L.y.position(e.y)
|
|
1212
|
+
})), xe = new Map(he.map((e) => [e.id, {
|
|
1209
1213
|
left: e.left,
|
|
1210
1214
|
top: e.top,
|
|
1211
1215
|
right: e.left,
|
|
1212
1216
|
bottom: e.top
|
|
1213
|
-
}])),
|
|
1214
|
-
x:
|
|
1215
|
-
y:
|
|
1217
|
+
}])), Ce = re === null ? f : {
|
|
1218
|
+
x: Vt(re.start.x, re.end.x),
|
|
1219
|
+
y: Vt(re.start.y, re.end.y)
|
|
1216
1220
|
};
|
|
1217
|
-
function
|
|
1218
|
-
let r = e.getBoundingClientRect(), i = (t - r.left) / r.width *
|
|
1221
|
+
function V(e, t, n) {
|
|
1222
|
+
let r = e.getBoundingClientRect(), i = (t - r.left) / r.width * R.width, a = (n - r.top) / r.height * R.height;
|
|
1219
1223
|
return {
|
|
1220
|
-
x:
|
|
1221
|
-
y:
|
|
1224
|
+
x: L.x.valueAt(Math.min(R.right, Math.max(R.left, i))),
|
|
1225
|
+
y: L.y.valueAt(Math.min(R.bottom, Math.max(R.top, a)))
|
|
1222
1226
|
};
|
|
1223
1227
|
}
|
|
1224
|
-
function
|
|
1225
|
-
let n = t.button === 0 && t.pointerType !== "touch", r = t.currentTarget, i = r.parentElement,
|
|
1226
|
-
if (
|
|
1227
|
-
let
|
|
1228
|
-
|
|
1229
|
-
start:
|
|
1230
|
-
end:
|
|
1231
|
-
}),
|
|
1228
|
+
function we(t) {
|
|
1229
|
+
let n = t.button === 0 && t.pointerType !== "touch", r = t.currentTarget, i = r.parentElement, a = t.target instanceof Element && t.target.closest("[data-brush]") !== null, o = n && a;
|
|
1230
|
+
if (p === void 0 || se.current !== null || !o || i === null) return;
|
|
1231
|
+
let s = V(r, t.clientX, t.clientY);
|
|
1232
|
+
ie({
|
|
1233
|
+
start: s,
|
|
1234
|
+
end: s
|
|
1235
|
+
}), se.current = K(i, t.nativeEvent, {
|
|
1232
1236
|
cancelOnEscape: !0,
|
|
1233
|
-
onMove: ({ x: e, y: t }) =>
|
|
1234
|
-
start:
|
|
1235
|
-
end:
|
|
1237
|
+
onMove: ({ x: e, y: t }) => ie({
|
|
1238
|
+
start: s,
|
|
1239
|
+
end: V(r, e, t)
|
|
1236
1240
|
}),
|
|
1237
1241
|
onEnd: (t, n) => {
|
|
1238
|
-
if (
|
|
1239
|
-
let i =
|
|
1240
|
-
x:
|
|
1241
|
-
y:
|
|
1242
|
+
if (se.current = null, ie(null), n) return;
|
|
1243
|
+
let i = V(r, t.clientX, t.clientY), a = {
|
|
1244
|
+
x: Vt(s.x, i.x),
|
|
1245
|
+
y: Vt(s.y, i.y)
|
|
1242
1246
|
};
|
|
1243
|
-
|
|
1247
|
+
ke({ options: () => e }, "onRangeChange", a, {
|
|
1244
1248
|
reason: "drag",
|
|
1245
1249
|
event: t
|
|
1246
1250
|
});
|
|
1247
1251
|
}
|
|
1248
1252
|
});
|
|
1249
1253
|
}
|
|
1254
|
+
let Ee = new Map(he.map((e) => [e.id, e])), De = o.map((e) => Ee.get(e)).filter((e) => e !== void 0), Oe = De.length >= 2 ? Se(De.map((e) => ({
|
|
1255
|
+
x: e.left,
|
|
1256
|
+
y: e.top
|
|
1257
|
+
}))) : "", q = new Set(d), X = i === !0 ? { label: "y = x" } : i === !1 || i === void 0 ? null : i, Z = Math.max(M[0], P[0]), Q = Math.min(M[1], P[1]), Ae = X !== null && Q > Z;
|
|
1250
1258
|
return /* @__PURE__ */ J(ee, {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1259
|
+
...A,
|
|
1260
|
+
items: B,
|
|
1261
|
+
place: (e) => xe.get(e),
|
|
1262
|
+
selected: v ?? null,
|
|
1263
|
+
onSelect: y,
|
|
1264
|
+
render: (e, { inspected: i, cursor: o }) => /* @__PURE__ */ Y(j, {
|
|
1265
|
+
...w,
|
|
1257
1266
|
figure: e,
|
|
1258
1267
|
footer: /* @__PURE__ */ J(c, {
|
|
1259
|
-
id:
|
|
1260
|
-
children: s(
|
|
1268
|
+
id: D,
|
|
1269
|
+
children: s(B, i)
|
|
1261
1270
|
}),
|
|
1262
1271
|
children: [
|
|
1263
|
-
t.length === 0 ? /* @__PURE__ */ J(
|
|
1264
|
-
plotRef:
|
|
1265
|
-
box:
|
|
1272
|
+
t.length === 0 ? /* @__PURE__ */ J(le, { children: S }) : /* @__PURE__ */ Y(ge, {
|
|
1273
|
+
plotRef: O.ref,
|
|
1274
|
+
box: R,
|
|
1266
1275
|
label: m({
|
|
1267
|
-
title:
|
|
1268
|
-
isSelectable:
|
|
1276
|
+
title: E,
|
|
1277
|
+
isSelectable: y !== void 0
|
|
1269
1278
|
}),
|
|
1270
|
-
readoutId:
|
|
1271
|
-
onPointerDown:
|
|
1272
|
-
overlay:
|
|
1279
|
+
readoutId: D,
|
|
1280
|
+
onPointerDown: we,
|
|
1281
|
+
overlay: he.map((e, t) => /* @__PURE__ */ J(l, {
|
|
1273
1282
|
value: e.id,
|
|
1274
1283
|
render: /* @__PURE__ */ J("button", {
|
|
1275
1284
|
type: "button",
|
|
1276
1285
|
tabIndex: -1,
|
|
1277
1286
|
title: e.label,
|
|
1278
|
-
"aria-label":
|
|
1279
|
-
"aria-pressed":
|
|
1287
|
+
"aria-label": B[t]?.label,
|
|
1288
|
+
"aria-pressed": y === void 0 ? void 0 : v === e.id
|
|
1280
1289
|
}),
|
|
1281
|
-
...H.props(
|
|
1290
|
+
...H.props(Lt.target, Lt.location(e.left, e.top)),
|
|
1282
1291
|
children: /* @__PURE__ */ J("span", {
|
|
1283
1292
|
"aria-hidden": !0,
|
|
1284
|
-
...H.props(
|
|
1293
|
+
...H.props(Lt.ring, o === e.id && N.cursor)
|
|
1285
1294
|
})
|
|
1286
1295
|
}, e.id)),
|
|
1287
1296
|
children: [
|
|
1288
|
-
/* @__PURE__ */ J(
|
|
1289
|
-
box:
|
|
1290
|
-
xTicks:
|
|
1291
|
-
yTicks:
|
|
1297
|
+
/* @__PURE__ */ J(ue, {
|
|
1298
|
+
box: R,
|
|
1299
|
+
xTicks: L.xTicks,
|
|
1300
|
+
yTicks: L.yTicks,
|
|
1292
1301
|
xTitle: g(n),
|
|
1293
1302
|
yTitle: g(r),
|
|
1294
1303
|
grid: "both"
|
|
1295
1304
|
}),
|
|
1296
|
-
|
|
1305
|
+
p !== void 0 && /* @__PURE__ */ J("rect", {
|
|
1297
1306
|
"data-brush": "",
|
|
1298
|
-
x:
|
|
1299
|
-
y:
|
|
1300
|
-
width:
|
|
1301
|
-
height:
|
|
1307
|
+
x: R.left,
|
|
1308
|
+
y: R.top,
|
|
1309
|
+
width: R.innerWidth,
|
|
1310
|
+
height: R.innerHeight,
|
|
1302
1311
|
className: "xsid9ct xy6m8k3"
|
|
1303
1312
|
}),
|
|
1304
|
-
/* @__PURE__ */ Y(
|
|
1305
|
-
box:
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1313
|
+
/* @__PURE__ */ Y(ve, {
|
|
1314
|
+
box: R,
|
|
1315
|
+
pad: 6,
|
|
1316
|
+
children: [
|
|
1317
|
+
Ae && /* @__PURE__ */ J(Ut, {
|
|
1318
|
+
spec: X,
|
|
1319
|
+
low: Z,
|
|
1320
|
+
high: Q,
|
|
1321
|
+
plot: L
|
|
1322
|
+
}),
|
|
1323
|
+
a.length > 0 && /* @__PURE__ */ J(be, {
|
|
1324
|
+
lines: a,
|
|
1325
|
+
box: R,
|
|
1326
|
+
position: L.y.position,
|
|
1327
|
+
valueText: me
|
|
1328
|
+
}),
|
|
1329
|
+
Oe !== "" && /* @__PURE__ */ J(pe, {
|
|
1330
|
+
d: Oe,
|
|
1331
|
+
tone: "series1",
|
|
1332
|
+
stroke: "dashed"
|
|
1333
|
+
}),
|
|
1334
|
+
Ce != null && /* @__PURE__ */ J(Wt, {
|
|
1335
|
+
range: Ce,
|
|
1336
|
+
plot: L
|
|
1337
|
+
}),
|
|
1338
|
+
he.map((e) => /* @__PURE__ */ J(de, {
|
|
1339
|
+
mark: e.id,
|
|
1340
|
+
x: e.left,
|
|
1341
|
+
y: e.top,
|
|
1342
|
+
tone: e.tone,
|
|
1343
|
+
isInspected: i === e.id,
|
|
1344
|
+
isSelected: v === e.id
|
|
1345
|
+
}, e.id)),
|
|
1346
|
+
he.filter((e) => q.has(e.id)).map((e) => {
|
|
1347
|
+
let t = e.left > R.right - 90, n = e.top < R.top + 18;
|
|
1348
|
+
return /* @__PURE__ */ J(F, {
|
|
1349
|
+
x: e.left + (t ? -8 : 8),
|
|
1350
|
+
y: e.top + (n ? 14 : -6),
|
|
1351
|
+
anchor: t ? "end" : "start",
|
|
1352
|
+
children: e.label
|
|
1353
|
+
}, `label-${e.id}`);
|
|
1354
|
+
})
|
|
1355
|
+
]
|
|
1317
1356
|
})
|
|
1318
1357
|
]
|
|
1319
1358
|
}),
|
|
1320
|
-
|
|
1359
|
+
p !== void 0 && h !== void 0 && /* @__PURE__ */ J(Kt, {
|
|
1321
1360
|
x: n,
|
|
1322
1361
|
y: r,
|
|
1323
|
-
xDomain:
|
|
1324
|
-
yDomain:
|
|
1325
|
-
range:
|
|
1326
|
-
rangeStep:
|
|
1327
|
-
locale:
|
|
1328
|
-
onRangeChange:
|
|
1362
|
+
xDomain: M,
|
|
1363
|
+
yDomain: P,
|
|
1364
|
+
range: fe,
|
|
1365
|
+
rangeStep: h,
|
|
1366
|
+
locale: T,
|
|
1367
|
+
onRangeChange: p
|
|
1329
1368
|
}),
|
|
1330
|
-
/* @__PURE__ */ J(
|
|
1331
|
-
label: `${
|
|
1369
|
+
/* @__PURE__ */ J(oe, {
|
|
1370
|
+
label: `${E} points`,
|
|
1332
1371
|
columns: [
|
|
1333
1372
|
{
|
|
1334
1373
|
id: "point",
|
|
@@ -1347,8 +1386,8 @@ function Vt(e) {
|
|
|
1347
1386
|
id: e.id,
|
|
1348
1387
|
values: [
|
|
1349
1388
|
e.label,
|
|
1350
|
-
|
|
1351
|
-
|
|
1389
|
+
z(e.x),
|
|
1390
|
+
me(e.y)
|
|
1352
1391
|
]
|
|
1353
1392
|
}))
|
|
1354
1393
|
})
|
|
@@ -1356,7 +1395,38 @@ function Vt(e) {
|
|
|
1356
1395
|
})
|
|
1357
1396
|
});
|
|
1358
1397
|
}
|
|
1359
|
-
function
|
|
1398
|
+
function Ut({ spec: e, low: t, high: n, plot: r }) {
|
|
1399
|
+
let { box: i } = r, a = r.x.position(n), o = r.y.position(n);
|
|
1400
|
+
return /* @__PURE__ */ Y("g", { children: [
|
|
1401
|
+
/* @__PURE__ */ J("line", {
|
|
1402
|
+
x1: r.x.position(t),
|
|
1403
|
+
y1: r.y.position(t),
|
|
1404
|
+
x2: a,
|
|
1405
|
+
y2: o,
|
|
1406
|
+
className: "xhq4mlf xnpr05h xlz5em3 x47corl x13efnbd"
|
|
1407
|
+
}),
|
|
1408
|
+
e.label !== void 0 && /* @__PURE__ */ J(F, {
|
|
1409
|
+
x: a - 6,
|
|
1410
|
+
y: o + 14,
|
|
1411
|
+
anchor: "end",
|
|
1412
|
+
children: e.label
|
|
1413
|
+
}),
|
|
1414
|
+
e.aboveLabel !== void 0 && /* @__PURE__ */ J("text", {
|
|
1415
|
+
x: i.left + 8,
|
|
1416
|
+
y: i.top + 14,
|
|
1417
|
+
className: "x1q7gtio x1hz01jw xy8obcc x47corl",
|
|
1418
|
+
children: e.aboveLabel
|
|
1419
|
+
}),
|
|
1420
|
+
e.belowLabel !== void 0 && /* @__PURE__ */ J("text", {
|
|
1421
|
+
x: i.right - 8,
|
|
1422
|
+
y: i.bottom - 8,
|
|
1423
|
+
textAnchor: "end",
|
|
1424
|
+
className: "x1q7gtio x1hz01jw xy8obcc x47corl",
|
|
1425
|
+
children: e.belowLabel
|
|
1426
|
+
})
|
|
1427
|
+
] });
|
|
1428
|
+
}
|
|
1429
|
+
function Wt({ range: e, plot: t }) {
|
|
1360
1430
|
let n = t.x.position(e.x[0]), r = t.y.position(e.y[1]);
|
|
1361
1431
|
return /* @__PURE__ */ J("rect", {
|
|
1362
1432
|
x: n,
|
|
@@ -1366,9 +1436,9 @@ function Ht({ range: e, plot: t }) {
|
|
|
1366
1436
|
className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
|
|
1367
1437
|
});
|
|
1368
1438
|
}
|
|
1369
|
-
function
|
|
1439
|
+
function Gt({ axis: e, domain: n, value: r, step: i, locale: a, onChange: o }) {
|
|
1370
1440
|
function s(t) {
|
|
1371
|
-
return
|
|
1441
|
+
return ne({
|
|
1372
1442
|
value: t,
|
|
1373
1443
|
locale: a,
|
|
1374
1444
|
format: e.format
|
|
@@ -1402,7 +1472,7 @@ function Ut({ axis: e, domain: n, value: r, step: i, locale: a, onChange: o }) {
|
|
|
1402
1472
|
] }) })]
|
|
1403
1473
|
});
|
|
1404
1474
|
}
|
|
1405
|
-
function
|
|
1475
|
+
function Kt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale: s, onRangeChange: c }) {
|
|
1406
1476
|
let l = a ?? {
|
|
1407
1477
|
x: r,
|
|
1408
1478
|
y: i
|
|
@@ -1414,7 +1484,7 @@ function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
|
|
|
1414
1484
|
className: "x153jb6y xy8obcc x1jfksii",
|
|
1415
1485
|
children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
|
|
1416
1486
|
}),
|
|
1417
|
-
/* @__PURE__ */ J(
|
|
1487
|
+
/* @__PURE__ */ J(Gt, {
|
|
1418
1488
|
axis: t,
|
|
1419
1489
|
domain: r,
|
|
1420
1490
|
value: l.x,
|
|
@@ -1425,7 +1495,7 @@ function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
|
|
|
1425
1495
|
y: l.y
|
|
1426
1496
|
}, t)
|
|
1427
1497
|
}),
|
|
1428
|
-
/* @__PURE__ */ J(
|
|
1498
|
+
/* @__PURE__ */ J(Gt, {
|
|
1429
1499
|
axis: n,
|
|
1430
1500
|
domain: i,
|
|
1431
1501
|
value: l.y,
|
|
@@ -1440,7 +1510,7 @@ function Wt({ x: t, y: n, xDomain: r, yDomain: i, range: a, rangeStep: o, locale
|
|
|
1440
1510
|
type: "button",
|
|
1441
1511
|
disabled: a === null,
|
|
1442
1512
|
onClick: (e) => {
|
|
1443
|
-
|
|
1513
|
+
ke({ options: () => ({ onRangeChange: c }) }, "onRangeChange", null, {
|
|
1444
1514
|
reason: "clear-press",
|
|
1445
1515
|
event: e.nativeEvent
|
|
1446
1516
|
});
|
|
@@ -1456,14 +1526,14 @@ var $ = {
|
|
|
1456
1526
|
pointsPerSeries: 2e3,
|
|
1457
1527
|
markers: 200,
|
|
1458
1528
|
panels: 12
|
|
1459
|
-
},
|
|
1460
|
-
function
|
|
1529
|
+
}, qt = .01;
|
|
1530
|
+
function Jt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
1461
1531
|
let i = e[0]?.points.map((e) => e.timestamp) ?? r;
|
|
1462
1532
|
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.`;
|
|
1463
1533
|
if (!o(e) || !o(n)) return "Series and markers require unique identifiers.";
|
|
1464
1534
|
for (let n of e) {
|
|
1465
1535
|
if (n.points.length !== i.length) return "Every series must supply the same observation timestamps.";
|
|
1466
|
-
let e =
|
|
1536
|
+
let e = $t({
|
|
1467
1537
|
points: n.points,
|
|
1468
1538
|
timestamps: i,
|
|
1469
1539
|
isStacked: t
|
|
@@ -1471,7 +1541,7 @@ function Kt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
|
1471
1541
|
if (e !== void 0) return e;
|
|
1472
1542
|
}
|
|
1473
1543
|
for (let t of n) {
|
|
1474
|
-
let n =
|
|
1544
|
+
let n = Yt({
|
|
1475
1545
|
marker: t,
|
|
1476
1546
|
series: e,
|
|
1477
1547
|
timestamps: i
|
|
@@ -1482,7 +1552,7 @@ function Kt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
|
|
|
1482
1552
|
if (!Number.isFinite(s) || !Number.isFinite(c)) return "The elapsed-time and value ranges must be finite.";
|
|
1483
1553
|
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.";
|
|
1484
1554
|
}
|
|
1485
|
-
function
|
|
1555
|
+
function Yt({ marker: e, series: t, timestamps: n }) {
|
|
1486
1556
|
if (e.kind === "event") {
|
|
1487
1557
|
let t = n[0] ?? 0, r = n.at(-1) ?? t, i = e.timestamp >= t && e.timestamp <= r;
|
|
1488
1558
|
return Number.isFinite(e.timestamp) && i ? void 0 : "Every event marker must fall inside the observed time range.";
|
|
@@ -1490,7 +1560,7 @@ function qt({ marker: e, series: t, timestamps: n }) {
|
|
|
1490
1560
|
if (!n.includes(e.timestamp)) return "Every time and point marker must align with an observation timestamp.";
|
|
1491
1561
|
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.";
|
|
1492
1562
|
}
|
|
1493
|
-
function
|
|
1563
|
+
function Xt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
1494
1564
|
return JSON.stringify([
|
|
1495
1565
|
n,
|
|
1496
1566
|
r,
|
|
@@ -1510,12 +1580,12 @@ function Jt({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
|
|
|
1510
1580
|
])
|
|
1511
1581
|
]);
|
|
1512
1582
|
}
|
|
1513
|
-
function
|
|
1583
|
+
function Zt(e, t) {
|
|
1514
1584
|
if (e !== t) return [e, t];
|
|
1515
|
-
let n = Math.max(1, Math.abs(e) *
|
|
1585
|
+
let n = Math.max(1, Math.abs(e) * qt), r = e - n, i = t + n;
|
|
1516
1586
|
return [Number.isFinite(r) ? r : e, Number.isFinite(i) ? i : t];
|
|
1517
1587
|
}
|
|
1518
|
-
function
|
|
1588
|
+
function Qt({ series: e, isStacked: t, tones: n }) {
|
|
1519
1589
|
let r = e.filter((e) => e.tone === void 0);
|
|
1520
1590
|
return e.map((i, a) => {
|
|
1521
1591
|
let o = r.findIndex((e) => e.id === i.id), s = n({
|
|
@@ -1537,7 +1607,7 @@ function Xt({ series: e, isStacked: t, tones: n }) {
|
|
|
1537
1607
|
};
|
|
1538
1608
|
});
|
|
1539
1609
|
}
|
|
1540
|
-
function
|
|
1610
|
+
function $t({ points: e, timestamps: t, isStacked: n }) {
|
|
1541
1611
|
for (let [r, i] of e.entries()) {
|
|
1542
1612
|
let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
|
|
1543
1613
|
if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
|
|
@@ -1546,16 +1616,16 @@ function Zt({ points: e, timestamps: t, isStacked: n }) {
|
|
|
1546
1616
|
}
|
|
1547
1617
|
}
|
|
1548
1618
|
// packages/charts/src/cartesian/time-series-line.tsx
|
|
1549
|
-
function
|
|
1619
|
+
function en({ series: e, x: t, y: n, pointRadius: r = 3 }) {
|
|
1550
1620
|
let i = e.points.findLastIndex((e) => e.value !== null);
|
|
1551
|
-
return /* @__PURE__ */ Y(
|
|
1552
|
-
d:
|
|
1621
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("path", {
|
|
1622
|
+
d: Se(e.points.map((e) => ({
|
|
1553
1623
|
x: t(e.timestamp),
|
|
1554
1624
|
y: e.value === null ? null : n(e.value + e.base)
|
|
1555
1625
|
}))),
|
|
1556
1626
|
fill: "none",
|
|
1557
1627
|
stroke: a[e.tone],
|
|
1558
|
-
...H.props(
|
|
1628
|
+
...H.props(N.mark)
|
|
1559
1629
|
}), e.points.filter((t, n) => {
|
|
1560
1630
|
if (t.value === null) return !1;
|
|
1561
1631
|
let r = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
|
|
@@ -1568,18 +1638,18 @@ function Qt({ series: e, x: t, y: n, pointRadius: r = 3 }) {
|
|
|
1568
1638
|
}, i.timestamp))] });
|
|
1569
1639
|
}
|
|
1570
1640
|
// packages/charts/src/cartesian/sparkline.tsx
|
|
1571
|
-
var
|
|
1641
|
+
var tn = {
|
|
1572
1642
|
minimum: "Lowest",
|
|
1573
1643
|
maximum: "Highest",
|
|
1574
1644
|
last: "Latest"
|
|
1575
|
-
},
|
|
1645
|
+
}, nn = 2.5, rn = 3, an = {
|
|
1576
1646
|
inline: {
|
|
1577
1647
|
width: 128,
|
|
1578
1648
|
height: 32
|
|
1579
1649
|
},
|
|
1580
1650
|
figure: { height: 48 }
|
|
1581
1651
|
};
|
|
1582
|
-
function
|
|
1652
|
+
function on({ points: e, marked: t }) {
|
|
1583
1653
|
let n = e.flatMap((e) => e.value === null ? [] : [{
|
|
1584
1654
|
...e,
|
|
1585
1655
|
value: e.value
|
|
@@ -1596,8 +1666,8 @@ function rn({ points: e, marked: t }) {
|
|
|
1596
1666
|
}];
|
|
1597
1667
|
});
|
|
1598
1668
|
}
|
|
1599
|
-
function
|
|
1600
|
-
let u =
|
|
1669
|
+
function sn({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: o, markedPoints: s = [], baseline: c, layout: l = "inline" }) {
|
|
1670
|
+
let u = U(), f = P(), p = l === "figure", m = p ? f.width : an.inline.width, h = p ? an.figure.height : an.inline.height, g = U(), _ = te(), v = cn({
|
|
1601
1671
|
title: e,
|
|
1602
1672
|
summary: t,
|
|
1603
1673
|
unit: n,
|
|
@@ -1614,19 +1684,19 @@ function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1614
1684
|
children: v === void 0 ? "No data" : "Invalid trend"
|
|
1615
1685
|
});
|
|
1616
1686
|
let y = i.points[0]?.timestamp ?? 0, b = i.points.at(-1)?.timestamp ?? y, x = k({
|
|
1617
|
-
domain:
|
|
1618
|
-
range: [
|
|
1687
|
+
domain: Zt(y, b),
|
|
1688
|
+
range: [rn, m - rn]
|
|
1619
1689
|
}).position, S = k({
|
|
1620
1690
|
domain: o,
|
|
1621
|
-
range: [h -
|
|
1622
|
-
}).position,
|
|
1691
|
+
range: [h - rn, rn]
|
|
1692
|
+
}).position, C = Qt({
|
|
1623
1693
|
series: [i],
|
|
1624
1694
|
isStacked: !1,
|
|
1625
1695
|
tones: _
|
|
1626
|
-
})[0],
|
|
1696
|
+
})[0], w = a[C?.tone ?? "series1"], ne = on({
|
|
1627
1697
|
points: i.points,
|
|
1628
1698
|
marked: s
|
|
1629
|
-
}),
|
|
1699
|
+
}), T = ne.map(({ kind: e, point: t }) => `${tn[e]}: ${t.value} ${n}.`).join(" "), E = c === void 0 ? "" : `Reference: ${c} ${n}.`, D = /* @__PURE__ */ Y("svg", {
|
|
1630
1700
|
role: "img",
|
|
1631
1701
|
"aria-labelledby": u,
|
|
1632
1702
|
"aria-describedby": g,
|
|
@@ -1659,34 +1729,34 @@ function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1659
1729
|
" ",
|
|
1660
1730
|
n,
|
|
1661
1731
|
". ",
|
|
1662
|
-
|
|
1732
|
+
T,
|
|
1663
1733
|
" ",
|
|
1664
|
-
|
|
1734
|
+
E
|
|
1665
1735
|
]
|
|
1666
1736
|
}),
|
|
1667
1737
|
c !== void 0 && /* @__PURE__ */ J("line", {
|
|
1668
|
-
x1:
|
|
1669
|
-
x2: m -
|
|
1738
|
+
x1: rn,
|
|
1739
|
+
x2: m - rn,
|
|
1670
1740
|
y1: S(c),
|
|
1671
1741
|
y2: S(c),
|
|
1672
1742
|
className: "x1crw9hw xnpr05h xbw2l0c x13efnbd"
|
|
1673
1743
|
}),
|
|
1674
|
-
|
|
1675
|
-
series:
|
|
1744
|
+
C !== void 0 && /* @__PURE__ */ J(en, {
|
|
1745
|
+
series: C,
|
|
1676
1746
|
x,
|
|
1677
1747
|
y: S,
|
|
1678
1748
|
pointRadius: 2
|
|
1679
1749
|
}),
|
|
1680
|
-
|
|
1750
|
+
ne.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */ J("circle", {
|
|
1681
1751
|
cx: x(t.timestamp),
|
|
1682
1752
|
cy: S(t.value),
|
|
1683
|
-
r:
|
|
1684
|
-
fill:
|
|
1753
|
+
r: nn,
|
|
1754
|
+
fill: w
|
|
1685
1755
|
}, e) : /* @__PURE__ */ J("circle", {
|
|
1686
1756
|
cx: x(t.timestamp),
|
|
1687
1757
|
cy: S(t.value),
|
|
1688
|
-
r:
|
|
1689
|
-
stroke:
|
|
1758
|
+
r: nn,
|
|
1759
|
+
stroke: w,
|
|
1690
1760
|
className: "x1fytgo2 x1r6sdyr x13efnbd"
|
|
1691
1761
|
}, e))
|
|
1692
1762
|
]
|
|
@@ -1697,14 +1767,14 @@ function an({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
|
|
|
1697
1767
|
children: /* @__PURE__ */ J("div", {
|
|
1698
1768
|
ref: f.ref,
|
|
1699
1769
|
className: "x1lliihq xeuugli",
|
|
1700
|
-
children:
|
|
1770
|
+
children: D
|
|
1701
1771
|
})
|
|
1702
|
-
}) :
|
|
1772
|
+
}) : D;
|
|
1703
1773
|
}
|
|
1704
|
-
function
|
|
1774
|
+
function cn({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPoints: a, baseline: o }) {
|
|
1705
1775
|
if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
|
|
1706
1776
|
if (!D(i)) return "The displayed value domain must have finite, increasing bounds.";
|
|
1707
|
-
let s =
|
|
1777
|
+
let s = Jt({
|
|
1708
1778
|
series: [r],
|
|
1709
1779
|
isStacked: !1,
|
|
1710
1780
|
markers: []
|
|
@@ -1715,11 +1785,11 @@ function on({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPo
|
|
|
1715
1785
|
if (!(o === void 0 || o >= i[0] && o <= i[1])) return "The reference value must be inside the declared value domain.";
|
|
1716
1786
|
}
|
|
1717
1787
|
// packages/charts/src/cartesian/time-series-bands.ts
|
|
1718
|
-
var
|
|
1788
|
+
var ln = {
|
|
1719
1789
|
bands: 4,
|
|
1720
1790
|
crossings: 4
|
|
1721
1791
|
};
|
|
1722
|
-
function
|
|
1792
|
+
function un(e) {
|
|
1723
1793
|
let t = [
|
|
1724
1794
|
e.lower,
|
|
1725
1795
|
e.center,
|
|
@@ -1727,18 +1797,18 @@ function cn(e) {
|
|
|
1727
1797
|
].filter((e) => e !== null);
|
|
1728
1798
|
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.";
|
|
1729
1799
|
}
|
|
1730
|
-
function
|
|
1731
|
-
if (e.length >
|
|
1800
|
+
function dn({ bands: e, crossings: t, series: n, timestamps: r }) {
|
|
1801
|
+
if (e.length > ln.bands || t.length > ln.crossings) return `Supply at most ${ln.bands} bands and ${ln.crossings} crossings.`;
|
|
1732
1802
|
if (!o([...n, ...e]) || !o(t)) return "Series, bands, and crossings require unique identifiers.";
|
|
1733
1803
|
for (let t of e) {
|
|
1734
1804
|
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.";
|
|
1735
|
-
let e = t.points.map(
|
|
1805
|
+
let e = t.points.map(un).find((e) => e !== void 0);
|
|
1736
1806
|
if (e !== void 0) return e;
|
|
1737
1807
|
}
|
|
1738
1808
|
let i = new Set([...n, ...e].map((e) => e.id));
|
|
1739
1809
|
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.";
|
|
1740
1810
|
}
|
|
1741
|
-
function
|
|
1811
|
+
function fn({ series: e, bands: t, tones: n }) {
|
|
1742
1812
|
let r = e.filter((e) => e.tone === void 0).length, i = t.filter((e) => e.tone === void 0);
|
|
1743
1813
|
return t.map((e) => {
|
|
1744
1814
|
let t = r + i.findIndex((t) => t.id === e.id);
|
|
@@ -1752,7 +1822,7 @@ function un({ series: e, bands: t, tones: n }) {
|
|
|
1752
1822
|
};
|
|
1753
1823
|
});
|
|
1754
1824
|
}
|
|
1755
|
-
function
|
|
1825
|
+
function pn({ start: e, end: t, value: n, direction: r }) {
|
|
1756
1826
|
let i = e > n && t <= n, a = e < n && t >= n;
|
|
1757
1827
|
switch (r) {
|
|
1758
1828
|
case "falling": return i;
|
|
@@ -1760,7 +1830,7 @@ function dn({ start: e, end: t, value: n, direction: r }) {
|
|
|
1760
1830
|
case void 0: return i || a;
|
|
1761
1831
|
}
|
|
1762
1832
|
}
|
|
1763
|
-
function
|
|
1833
|
+
function mn({ points: e, crossing: t }) {
|
|
1764
1834
|
let n = e.flatMap((t, n) => {
|
|
1765
1835
|
let r = e[n + 1];
|
|
1766
1836
|
return t.value === null || r === void 0 || r.value === null ? [] : [{
|
|
@@ -1769,7 +1839,7 @@ function fn({ points: e, crossing: t }) {
|
|
|
1769
1839
|
from: t.value,
|
|
1770
1840
|
to: r.value
|
|
1771
1841
|
}];
|
|
1772
|
-
}).find(({ from: e, to: n }) =>
|
|
1842
|
+
}).find(({ from: e, to: n }) => pn({
|
|
1773
1843
|
start: e,
|
|
1774
1844
|
end: n,
|
|
1775
1845
|
value: t.value,
|
|
@@ -1779,10 +1849,10 @@ function fn({ points: e, crossing: t }) {
|
|
|
1779
1849
|
let r = (t.value - n.from) / (n.to - n.from);
|
|
1780
1850
|
return n.start + r * (n.end - n.start);
|
|
1781
1851
|
}
|
|
1782
|
-
function
|
|
1852
|
+
function hn({ crossings: e, series: t, bands: n }) {
|
|
1783
1853
|
return e.map((e) => ({
|
|
1784
1854
|
crossing: e,
|
|
1785
|
-
timestamp:
|
|
1855
|
+
timestamp: mn({
|
|
1786
1856
|
points: t.find((t) => t.id === e.seriesId)?.points ?? n.find((t) => t.id === e.seriesId)?.points.map((e) => ({
|
|
1787
1857
|
timestamp: e.timestamp,
|
|
1788
1858
|
value: e.center
|
|
@@ -1791,11 +1861,11 @@ function pn({ crossings: e, series: t, bands: n }) {
|
|
|
1791
1861
|
})
|
|
1792
1862
|
}));
|
|
1793
1863
|
}
|
|
1794
|
-
function
|
|
1864
|
+
function gn(e, t) {
|
|
1795
1865
|
let n = Math.min(...e.map((e) => Math.abs(e - t)));
|
|
1796
1866
|
return e.find((e) => Math.abs(e - t) === n);
|
|
1797
1867
|
}
|
|
1798
|
-
function
|
|
1868
|
+
function _n(e) {
|
|
1799
1869
|
return e.flatMap((e) => e.points.flatMap((e) => [
|
|
1800
1870
|
e.lower,
|
|
1801
1871
|
e.center,
|
|
@@ -1803,23 +1873,23 @@ function hn(e) {
|
|
|
1803
1873
|
].filter((e) => e !== null)));
|
|
1804
1874
|
}
|
|
1805
1875
|
// packages/charts/src/chart-range.tsx
|
|
1806
|
-
var
|
|
1807
|
-
function
|
|
1876
|
+
var vn = "axis", yn = "selected", bn = "drawn";
|
|
1877
|
+
function xn({ value: e }) {
|
|
1808
1878
|
return {
|
|
1809
1879
|
value: e,
|
|
1810
1880
|
spans: e === null ? [] : [{
|
|
1811
|
-
id:
|
|
1812
|
-
track:
|
|
1881
|
+
id: yn,
|
|
1882
|
+
track: vn,
|
|
1813
1883
|
start: e[0],
|
|
1814
1884
|
end: e[1]
|
|
1815
1885
|
}]
|
|
1816
1886
|
};
|
|
1817
1887
|
}
|
|
1818
|
-
function
|
|
1888
|
+
function Sn(e, t) {
|
|
1819
1889
|
let { draft: n } = e;
|
|
1820
1890
|
return n?.action === "draw" ? t.filter((e) => e.id === n.id) : t;
|
|
1821
1891
|
}
|
|
1822
|
-
var
|
|
1892
|
+
var Cn = Oe({
|
|
1823
1893
|
name: "chart-range",
|
|
1824
1894
|
options: {
|
|
1825
1895
|
value: "value",
|
|
@@ -1831,12 +1901,12 @@ var xn = Ee({
|
|
|
1831
1901
|
},
|
|
1832
1902
|
controlled: ["value"],
|
|
1833
1903
|
state: (e) => ({
|
|
1834
|
-
...
|
|
1904
|
+
...xn(e),
|
|
1835
1905
|
draft: null
|
|
1836
1906
|
}),
|
|
1837
|
-
sync:
|
|
1907
|
+
sync: xn,
|
|
1838
1908
|
api: (e) => {
|
|
1839
|
-
let t =
|
|
1909
|
+
let t = Ee(e);
|
|
1840
1910
|
function n(n, { id: r, action: i, reason: a, event: o }) {
|
|
1841
1911
|
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 } : {
|
|
1842
1912
|
reason: a,
|
|
@@ -1844,7 +1914,7 @@ var xn = Ee({
|
|
|
1844
1914
|
});
|
|
1845
1915
|
return l && i === "delete" && e.element("root")?.querySelector("[tabindex=\"0\"]:not([data-span-id])")?.focus(), l;
|
|
1846
1916
|
}
|
|
1847
|
-
let r =
|
|
1917
|
+
let r = De(e, {
|
|
1848
1918
|
key: "spans",
|
|
1849
1919
|
draft: "draft",
|
|
1850
1920
|
axis: "x",
|
|
@@ -1853,7 +1923,7 @@ var xn = Ee({
|
|
|
1853
1923
|
step: () => e.options().step,
|
|
1854
1924
|
create: (e) => ({
|
|
1855
1925
|
...e,
|
|
1856
|
-
id:
|
|
1926
|
+
id: bn
|
|
1857
1927
|
}),
|
|
1858
1928
|
label: (t) => e.options().describe([t.start, t.end]),
|
|
1859
1929
|
createAutoScroll: !1,
|
|
@@ -1862,13 +1932,13 @@ var xn = Ee({
|
|
|
1862
1932
|
return {
|
|
1863
1933
|
spans: r,
|
|
1864
1934
|
shown(t) {
|
|
1865
|
-
return
|
|
1935
|
+
return Sn(t, r.spans(t)).map((t) => ({
|
|
1866
1936
|
id: t.id,
|
|
1867
1937
|
label: e.options().describe([t.start, t.end])
|
|
1868
1938
|
}));
|
|
1869
1939
|
},
|
|
1870
1940
|
draw(e) {
|
|
1871
|
-
e.button === 0 && e.pointerType !== "touch" && r.trackPointerdown(e,
|
|
1941
|
+
e.button === 0 && e.pointerType !== "touch" && r.trackPointerdown(e, vn);
|
|
1872
1942
|
},
|
|
1873
1943
|
setRange(n, r) {
|
|
1874
1944
|
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));
|
|
@@ -1886,7 +1956,7 @@ var xn = Ee({
|
|
|
1886
1956
|
state: (e, { api: t }) => ({ spans: t.shown(e) }),
|
|
1887
1957
|
on: { pointerdown: (e, { api: t }) => t.draw(e) }
|
|
1888
1958
|
}),
|
|
1889
|
-
track: e({ bind: (e, { api: t }) => t.spans.bindTrack(e,
|
|
1959
|
+
track: e({ bind: (e, { api: t }) => t.spans.bindTrack(e, vn) }),
|
|
1890
1960
|
span: e({
|
|
1891
1961
|
role: "group",
|
|
1892
1962
|
props: { value: "string" },
|
|
@@ -1908,17 +1978,17 @@ var xn = Ee({
|
|
|
1908
1978
|
})
|
|
1909
1979
|
}),
|
|
1910
1980
|
agent: { actions: ["setRange", "clear"] }
|
|
1911
|
-
}),
|
|
1981
|
+
}), wn = we(Cn, {
|
|
1912
1982
|
root: "div",
|
|
1913
1983
|
track: "div",
|
|
1914
1984
|
span: "div"
|
|
1915
|
-
}),
|
|
1985
|
+
}), Tn = wn.Root, En = wn.Track, Dn = wn.Span, On = {
|
|
1916
1986
|
kVAEAm: "x10l6tqk",
|
|
1917
1987
|
k87sOh: "x13vifvy",
|
|
1918
1988
|
kfzvcC: "x47corl",
|
|
1919
1989
|
$$css: !0
|
|
1920
|
-
},
|
|
1921
|
-
|
|
1990
|
+
}, kn = { track: (e, t, n) => [
|
|
1991
|
+
On,
|
|
1922
1992
|
{
|
|
1923
1993
|
kbCHJM: e == null ? e : "xgq9j65",
|
|
1924
1994
|
kzqmXN: t == null ? t : "x5lhr3w",
|
|
@@ -1931,16 +2001,16 @@ var xn = Ee({
|
|
|
1931
2001
|
"--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(n)
|
|
1932
2002
|
}
|
|
1933
2003
|
] };
|
|
1934
|
-
function
|
|
1935
|
-
return /* @__PURE__ */ J(
|
|
2004
|
+
function An({ left: e, width: t, height: n, label: r, children: i, ...a }) {
|
|
2005
|
+
return /* @__PURE__ */ J(Tn, {
|
|
1936
2006
|
...a,
|
|
1937
2007
|
"aria-label": r,
|
|
1938
2008
|
className: "x1n2onr6 xeuugli",
|
|
1939
2009
|
render: (r, { spans: a }) => /* @__PURE__ */ Y("div", {
|
|
1940
2010
|
...r,
|
|
1941
|
-
children: [i, /* @__PURE__ */ J(
|
|
1942
|
-
...H.props(
|
|
1943
|
-
children: a.map((e) => /* @__PURE__ */ Y(
|
|
2011
|
+
children: [i, /* @__PURE__ */ J(En, {
|
|
2012
|
+
...H.props(kn.track(e, t, n)),
|
|
2013
|
+
children: a.map((e) => /* @__PURE__ */ Y(Dn, {
|
|
1944
2014
|
value: e.id,
|
|
1945
2015
|
"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.`,
|
|
1946
2016
|
className: "x10l6tqk x13vifvy x5yr21d x9f619 x1qatu44 x1l0rsgs x1616tdu xbsl7fq xbm8b0d x1n2ykn x1t137rt x19rmrnh x9v5kkp x13qnu6 x1bqaal",
|
|
@@ -1961,11 +2031,11 @@ function On({ left: e, width: t, height: n, label: r, children: i, ...a }) {
|
|
|
1961
2031
|
});
|
|
1962
2032
|
}
|
|
1963
2033
|
// packages/charts/src/cartesian/time-series-overlays.tsx
|
|
1964
|
-
var
|
|
1965
|
-
function
|
|
2034
|
+
var jn = 16, Mn = 6, Nn = 6.5, Pn = 4;
|
|
2035
|
+
function Fn({ instants: e, x: t, right: n, ends: r }) {
|
|
1966
2036
|
let [i, ...a] = e;
|
|
1967
2037
|
if (i === void 0) return [];
|
|
1968
|
-
let o = t(i.timestamp), s = i.label.length *
|
|
2038
|
+
let o = t(i.timestamp), s = i.label.length * Nn + Mn, 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 = [
|
|
1969
2039
|
...r.slice(0, f),
|
|
1970
2040
|
Math.max(u, r[f] ?? u),
|
|
1971
2041
|
...r.slice(f + 1)
|
|
@@ -1974,25 +2044,25 @@ function Nn({ instants: e, x: t, right: n, ends: r }) {
|
|
|
1974
2044
|
...i,
|
|
1975
2045
|
lane: f,
|
|
1976
2046
|
anchor: c
|
|
1977
|
-
}, ...
|
|
2047
|
+
}, ...Fn({
|
|
1978
2048
|
instants: a,
|
|
1979
2049
|
x: t,
|
|
1980
2050
|
right: n,
|
|
1981
2051
|
ends: p
|
|
1982
2052
|
})];
|
|
1983
2053
|
}
|
|
1984
|
-
function
|
|
1985
|
-
return
|
|
2054
|
+
function In({ instants: e, x: t, right: n }) {
|
|
2055
|
+
return Fn({
|
|
1986
2056
|
instants: e.toSorted((e, t) => e.timestamp - t.timestamp),
|
|
1987
2057
|
x: t,
|
|
1988
2058
|
right: n,
|
|
1989
2059
|
ends: []
|
|
1990
2060
|
});
|
|
1991
2061
|
}
|
|
1992
|
-
function
|
|
1993
|
-
return Math.max(0, ...e.map((e) => e.lane + 1)) *
|
|
2062
|
+
function Ln(e) {
|
|
2063
|
+
return Math.max(0, ...e.map((e) => e.lane + 1)) * jn;
|
|
1994
2064
|
}
|
|
1995
|
-
function
|
|
2065
|
+
function Rn({ bands: e, x: t, y: n }) {
|
|
1996
2066
|
return /* @__PURE__ */ J("g", { children: e.map((e) => {
|
|
1997
2067
|
function r(t) {
|
|
1998
2068
|
return e.points.map((e) => {
|
|
@@ -2001,15 +2071,15 @@ function In({ bands: e, x: t, y: n }) {
|
|
|
2001
2071
|
});
|
|
2002
2072
|
}
|
|
2003
2073
|
let i = r((e) => e.lower), a = r((e) => e.upper), o = r((e) => e.center), s = e.points.map((e) => t(e.timestamp));
|
|
2004
|
-
return /* @__PURE__ */ Y("g", { children: [/* @__PURE__ */ J(
|
|
2005
|
-
d:
|
|
2074
|
+
return /* @__PURE__ */ Y("g", { children: [/* @__PURE__ */ J(R, {
|
|
2075
|
+
d: Ce(s.map((e, t) => ({
|
|
2006
2076
|
x: e,
|
|
2007
2077
|
y0: i[t] ?? null,
|
|
2008
2078
|
y1: a[t] ?? null
|
|
2009
2079
|
}))),
|
|
2010
2080
|
tone: e.tone
|
|
2011
|
-
}), /* @__PURE__ */ J(
|
|
2012
|
-
d:
|
|
2081
|
+
}), /* @__PURE__ */ J(pe, {
|
|
2082
|
+
d: Se(s.map((e, t) => ({
|
|
2013
2083
|
x: e,
|
|
2014
2084
|
y: o[t] ?? null
|
|
2015
2085
|
}))),
|
|
@@ -2017,25 +2087,25 @@ function In({ bands: e, x: t, y: n }) {
|
|
|
2017
2087
|
})] }, e.id);
|
|
2018
2088
|
}) });
|
|
2019
2089
|
}
|
|
2020
|
-
function
|
|
2021
|
-
let a = r -
|
|
2090
|
+
function zn({ placed: e, x: t, y: n, top: r, bottom: i }) {
|
|
2091
|
+
let a = r - Ln(e);
|
|
2022
2092
|
return /* @__PURE__ */ J("g", {
|
|
2023
2093
|
"aria-hidden": !0,
|
|
2024
2094
|
children: e.map((e) => {
|
|
2025
|
-
let r = t(e.timestamp), o = a + (e.lane + 1 / 2) *
|
|
2095
|
+
let r = t(e.timestamp), o = a + (e.lane + 1 / 2) * jn, s = e.anchor === "start" ? r + Mn : r - Mn;
|
|
2026
2096
|
return /* @__PURE__ */ Y("g", { children: [
|
|
2027
|
-
/* @__PURE__ */ J(
|
|
2097
|
+
/* @__PURE__ */ J(z, {
|
|
2028
2098
|
x: r,
|
|
2029
2099
|
top: o,
|
|
2030
2100
|
bottom: i
|
|
2031
2101
|
}),
|
|
2032
|
-
/* @__PURE__ */ J(
|
|
2102
|
+
/* @__PURE__ */ J(F, {
|
|
2033
2103
|
x: s,
|
|
2034
|
-
y: o +
|
|
2104
|
+
y: o + Pn,
|
|
2035
2105
|
anchor: e.anchor,
|
|
2036
2106
|
children: e.label
|
|
2037
2107
|
}),
|
|
2038
|
-
e.value !== void 0 && /* @__PURE__ */ J(
|
|
2108
|
+
e.value !== void 0 && /* @__PURE__ */ J(I, {
|
|
2039
2109
|
x: r,
|
|
2040
2110
|
y: n(e.value)
|
|
2041
2111
|
})
|
|
@@ -2044,35 +2114,35 @@ function Ln({ placed: e, x: t, y: n, top: r, bottom: i }) {
|
|
|
2044
2114
|
});
|
|
2045
2115
|
}
|
|
2046
2116
|
// packages/charts/src/cartesian/time-series.tsx
|
|
2047
|
-
var
|
|
2117
|
+
var Bn = {
|
|
2048
2118
|
seconds: 1e3,
|
|
2049
2119
|
milliseconds: 1
|
|
2050
|
-
},
|
|
2120
|
+
}, Vn = 24, Hn = 12, Un = 2.5, Wn = 4, Gn = {
|
|
2051
2121
|
line: "line",
|
|
2052
2122
|
area: "swatch"
|
|
2053
2123
|
};
|
|
2054
|
-
function
|
|
2055
|
-
return e *
|
|
2124
|
+
function Kn(e, t) {
|
|
2125
|
+
return e * Bn[t];
|
|
2056
2126
|
}
|
|
2057
|
-
function
|
|
2127
|
+
function qn({ format: e, tickFormat: t, label: n = "" }) {
|
|
2058
2128
|
return {
|
|
2059
2129
|
label: n,
|
|
2060
2130
|
format: e,
|
|
2061
2131
|
tickFormat: t
|
|
2062
2132
|
};
|
|
2063
2133
|
}
|
|
2064
|
-
function
|
|
2134
|
+
function Jn({ series: e, isStacked: t, isZeroBased: n, bands: r, crossings: i }) {
|
|
2065
2135
|
let a = (e[0]?.points ?? []).map((t, n) => e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)), o = t ? a : e.flatMap((e) => e.points.map((e) => e.value));
|
|
2066
2136
|
return u({
|
|
2067
2137
|
values: [
|
|
2068
2138
|
...o,
|
|
2069
|
-
...
|
|
2139
|
+
..._n(r),
|
|
2070
2140
|
...i.map((e) => e.value)
|
|
2071
2141
|
],
|
|
2072
2142
|
isZeroBased: n
|
|
2073
2143
|
});
|
|
2074
2144
|
}
|
|
2075
|
-
function
|
|
2145
|
+
function Yn({ bands: e, crossings: t }) {
|
|
2076
2146
|
return JSON.stringify([e.map((e) => [
|
|
2077
2147
|
e.id,
|
|
2078
2148
|
e.label,
|
|
@@ -2092,7 +2162,7 @@ function qn({ bands: e, crossings: t }) {
|
|
|
2092
2162
|
e.direction
|
|
2093
2163
|
])]);
|
|
2094
2164
|
}
|
|
2095
|
-
function
|
|
2165
|
+
function Xn({ bands: e, timestamp: t, valueText: n }) {
|
|
2096
2166
|
return e.flatMap((e) => {
|
|
2097
2167
|
let r = e.points.find((e) => e.timestamp === t), i = r?.center ?? null, a = r?.lower !== null && r?.upper !== null && r !== void 0;
|
|
2098
2168
|
return [{
|
|
@@ -2110,28 +2180,28 @@ function Jn({ bands: e, timestamp: t, valueText: n }) {
|
|
|
2110
2180
|
}];
|
|
2111
2181
|
});
|
|
2112
2182
|
}
|
|
2113
|
-
function
|
|
2183
|
+
function Zn({ found: e, timeText: t }) {
|
|
2114
2184
|
return e.timestamp === void 0 ? `${e.crossing.label} · Not reached in this range` : `About ${t(e.timestamp)} · ${e.crossing.label}`;
|
|
2115
2185
|
}
|
|
2116
|
-
function
|
|
2117
|
-
return /* @__PURE__ */ J(
|
|
2186
|
+
function Qn(e) {
|
|
2187
|
+
return /* @__PURE__ */ J(ir, {
|
|
2118
2188
|
...e,
|
|
2119
2189
|
kind: "line",
|
|
2120
2190
|
isStacked: !1
|
|
2121
2191
|
});
|
|
2122
2192
|
}
|
|
2123
|
-
function
|
|
2124
|
-
return /* @__PURE__ */ J(
|
|
2193
|
+
function $n({ isStacked: e = !1, ...t }) {
|
|
2194
|
+
return /* @__PURE__ */ J(ir, {
|
|
2125
2195
|
...t,
|
|
2126
2196
|
kind: "area",
|
|
2127
2197
|
isStacked: e
|
|
2128
2198
|
});
|
|
2129
2199
|
}
|
|
2130
|
-
function
|
|
2131
|
-
return /* @__PURE__ */ J(
|
|
2200
|
+
function er(e) {
|
|
2201
|
+
return /* @__PURE__ */ J(tr, { ...e });
|
|
2132
2202
|
}
|
|
2133
|
-
function
|
|
2134
|
-
let o =
|
|
2203
|
+
function tr({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
|
|
2204
|
+
let o = U(), s = te(), c = Qt({
|
|
2135
2205
|
series: e.map((e) => ({
|
|
2136
2206
|
...e,
|
|
2137
2207
|
points: []
|
|
@@ -2147,7 +2217,7 @@ function $n({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
|
|
|
2147
2217
|
...a,
|
|
2148
2218
|
status: "loading",
|
|
2149
2219
|
series: c,
|
|
2150
|
-
seriesLegend: /* @__PURE__ */ J(
|
|
2220
|
+
seriesLegend: /* @__PURE__ */ J(se, {
|
|
2151
2221
|
id: o,
|
|
2152
2222
|
label: void 0,
|
|
2153
2223
|
legend: c,
|
|
@@ -2160,37 +2230,37 @@ function $n({ series: e, height: t = "compact", showTimeAxis: i = !0, ...a }) {
|
|
|
2160
2230
|
className: "xrvj5dj x1n8ia3y",
|
|
2161
2231
|
children: /* @__PURE__ */ Y("div", {
|
|
2162
2232
|
className: "xeuugli",
|
|
2163
|
-
children: [/* @__PURE__ */ J(r, { height: f[t] -
|
|
2233
|
+
children: [/* @__PURE__ */ J(r, { height: f[t] - Vn }), /* @__PURE__ */ J("div", {
|
|
2164
2234
|
className: "x78zum5 x6s0dn4 x1qughib x8zbtdt xxk0z11",
|
|
2165
|
-
children: i && /* @__PURE__ */ Y(
|
|
2235
|
+
children: i && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(n, { width: "8ch" }), /* @__PURE__ */ J(n, { width: "8ch" })] })
|
|
2166
2236
|
})]
|
|
2167
2237
|
})
|
|
2168
2238
|
})
|
|
2169
2239
|
})
|
|
2170
2240
|
});
|
|
2171
2241
|
}
|
|
2172
|
-
function
|
|
2173
|
-
let s =
|
|
2242
|
+
function nr({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact", locale: i, status: a }) {
|
|
2243
|
+
let s = W(null), [c, l] = G(), u = JSON.stringify(e.map((e) => [
|
|
2174
2244
|
e.id,
|
|
2175
2245
|
e.title,
|
|
2176
|
-
|
|
2246
|
+
Xt({
|
|
2177
2247
|
series: e.series,
|
|
2178
2248
|
markers: e.markers ?? [],
|
|
2179
2249
|
timestampUnit: t,
|
|
2180
2250
|
isStacked: !1
|
|
2181
2251
|
})
|
|
2182
2252
|
])), d = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), p = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === d);
|
|
2183
|
-
if (c !== void 0 && c.signature !== u && l(void 0), a === "loading") return /* @__PURE__ */ J(
|
|
2253
|
+
if (c !== void 0 && c.signature !== u && l(void 0), a === "loading") return /* @__PURE__ */ J(rr, {
|
|
2184
2254
|
charts: e,
|
|
2185
2255
|
height: r,
|
|
2186
2256
|
locale: i
|
|
2187
2257
|
});
|
|
2188
|
-
if (!p || !o(e)) return /* @__PURE__ */ J(
|
|
2258
|
+
if (!p || !o(e)) return /* @__PURE__ */ J(ce, {
|
|
2189
2259
|
title: "Small multiples",
|
|
2190
2260
|
locale: i,
|
|
2191
2261
|
message: "Charts need unique identifiers and aligned observation timestamps."
|
|
2192
2262
|
});
|
|
2193
|
-
if (e.length > $.panels) return /* @__PURE__ */ J(
|
|
2263
|
+
if (e.length > $.panels) return /* @__PURE__ */ J(ce, {
|
|
2194
2264
|
title: "Small multiples",
|
|
2195
2265
|
locale: i,
|
|
2196
2266
|
message: `Choose at most ${$.panels} panels.`
|
|
@@ -2198,19 +2268,19 @@ function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
|
|
|
2198
2268
|
if (e.length === 0) return /* @__PURE__ */ J(j, {
|
|
2199
2269
|
title: "Small multiples",
|
|
2200
2270
|
locale: i,
|
|
2201
|
-
children: /* @__PURE__ */ J(
|
|
2271
|
+
children: /* @__PURE__ */ J(le, { children: "No charts" })
|
|
2202
2272
|
});
|
|
2203
2273
|
let m = h({
|
|
2204
2274
|
height: f[r],
|
|
2205
2275
|
locale: i,
|
|
2206
2276
|
hasValueTitle: e.some((e) => e.valueLabel !== void 0),
|
|
2207
2277
|
axes: e.map((e) => ({
|
|
2208
|
-
axis:
|
|
2278
|
+
axis: qn({
|
|
2209
2279
|
format: e.valueFormat,
|
|
2210
2280
|
tickFormat: e.tickFormat,
|
|
2211
2281
|
label: e.valueLabel
|
|
2212
2282
|
}),
|
|
2213
|
-
domain:
|
|
2283
|
+
domain: Jn({
|
|
2214
2284
|
series: e.series,
|
|
2215
2285
|
isStacked: !1,
|
|
2216
2286
|
isZeroBased: !1,
|
|
@@ -2230,7 +2300,7 @@ function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
|
|
|
2230
2300
|
0: {},
|
|
2231
2301
|
1: { className: "x1y332i5" }
|
|
2232
2302
|
}[!!(g && f > 0) | 0],
|
|
2233
|
-
children: /* @__PURE__ */ J(
|
|
2303
|
+
children: /* @__PURE__ */ J(ir, {
|
|
2234
2304
|
...d,
|
|
2235
2305
|
locale: i,
|
|
2236
2306
|
status: a,
|
|
@@ -2255,8 +2325,8 @@ function er({ charts: e, timestampUnit: t, timeFormat: n, height: r = "compact",
|
|
|
2255
2325
|
}, o))
|
|
2256
2326
|
});
|
|
2257
2327
|
}
|
|
2258
|
-
function
|
|
2259
|
-
if (!o(e) || e.length > $.panels) return /* @__PURE__ */ J(
|
|
2328
|
+
function rr({ charts: e, height: t, locale: n }) {
|
|
2329
|
+
if (!o(e) || e.length > $.panels) return /* @__PURE__ */ J(ce, {
|
|
2260
2330
|
title: "Small multiples",
|
|
2261
2331
|
locale: n,
|
|
2262
2332
|
message: `Choose at most ${$.panels} panels with unique identifiers.`
|
|
@@ -2274,7 +2344,7 @@ function tr({ charts: e, height: t, locale: n }) {
|
|
|
2274
2344
|
0: {},
|
|
2275
2345
|
1: { className: "x1y332i5" }
|
|
2276
2346
|
}[!!(r && o > 0) | 0],
|
|
2277
|
-
children: /* @__PURE__ */ J(
|
|
2347
|
+
children: /* @__PURE__ */ J(tr, {
|
|
2278
2348
|
...a,
|
|
2279
2349
|
locale: n,
|
|
2280
2350
|
height: t,
|
|
@@ -2283,150 +2353,150 @@ function tr({ charts: e, height: t, locale: n }) {
|
|
|
2283
2353
|
}, i))
|
|
2284
2354
|
});
|
|
2285
2355
|
}
|
|
2286
|
-
function
|
|
2287
|
-
let { title:
|
|
2356
|
+
function ir({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFormat: a, valueLabel: o, markers: s = [], height: c = "compact", kind: l, isStacked: u, sharedInspection: d, gutter: f, showTimeAxis: p = !0, bands: h = [], crossings: g = [], range: _ = null, onRangeChange: y, rangeStep: b, emptyLabel: x = "No observations", ...S }) {
|
|
2357
|
+
let { title: C, locale: T, report: E } = S, D = te(), O = _e(c), k = U(), A = h[0]?.points.map((e) => e.timestamp) ?? [], ae = t[0]?.points.map((e) => e.timestamp) ?? A, M = Jt({
|
|
2288
2358
|
series: t,
|
|
2289
2359
|
isStacked: u,
|
|
2290
2360
|
markers: s,
|
|
2291
|
-
timeline:
|
|
2292
|
-
}) ??
|
|
2361
|
+
timeline: A
|
|
2362
|
+
}) ?? dn({
|
|
2293
2363
|
bands: h,
|
|
2294
2364
|
crossings: g,
|
|
2295
2365
|
series: t,
|
|
2296
|
-
timestamps:
|
|
2297
|
-
}) ??
|
|
2366
|
+
timestamps: ae
|
|
2367
|
+
}) ?? ar({
|
|
2298
2368
|
range: _,
|
|
2299
2369
|
rangeStep: b,
|
|
2300
2370
|
isSelectable: y !== void 0,
|
|
2301
|
-
timeline:
|
|
2302
|
-
}),
|
|
2371
|
+
timeline: ae
|
|
2372
|
+
}), N = M === void 0 ? Qt({
|
|
2303
2373
|
series: t,
|
|
2304
2374
|
isStacked: u,
|
|
2305
|
-
tones:
|
|
2306
|
-
}) : [],
|
|
2375
|
+
tones: D
|
|
2376
|
+
}) : [], P = M === void 0 ? fn({
|
|
2307
2377
|
series: t,
|
|
2308
2378
|
bands: h,
|
|
2309
|
-
tones:
|
|
2310
|
-
}) : [],
|
|
2311
|
-
function
|
|
2379
|
+
tones: D
|
|
2380
|
+
}) : [], F = N[0]?.points ?? P[0]?.points ?? [];
|
|
2381
|
+
function L(e) {
|
|
2312
2382
|
return w({
|
|
2313
|
-
timestamp:
|
|
2314
|
-
locale:
|
|
2383
|
+
timestamp: Kn(e, n),
|
|
2384
|
+
locale: T,
|
|
2315
2385
|
format: r
|
|
2316
2386
|
});
|
|
2317
2387
|
}
|
|
2318
|
-
function
|
|
2319
|
-
return
|
|
2388
|
+
function R(e) {
|
|
2389
|
+
return ne({
|
|
2320
2390
|
value: e,
|
|
2321
|
-
locale:
|
|
2391
|
+
locale: T,
|
|
2322
2392
|
format: i
|
|
2323
2393
|
});
|
|
2324
2394
|
}
|
|
2325
|
-
let
|
|
2395
|
+
let me = F.map(({ timestamp: e }) => ({
|
|
2326
2396
|
id: String(e),
|
|
2327
|
-
label:
|
|
2328
|
-
})),
|
|
2397
|
+
label: L(e)
|
|
2398
|
+
})), B = `${Xt({
|
|
2329
2399
|
series: t,
|
|
2330
2400
|
markers: s,
|
|
2331
2401
|
timestampUnit: n,
|
|
2332
2402
|
isStacked: u
|
|
2333
|
-
})}${
|
|
2403
|
+
})}${Yn({
|
|
2334
2404
|
bands: h,
|
|
2335
2405
|
crossings: g
|
|
2336
|
-
})}`,
|
|
2406
|
+
})}`, ye = [...N.map(({ id: e, label: t, tone: n }) => ({
|
|
2337
2407
|
id: e,
|
|
2338
2408
|
label: t,
|
|
2339
2409
|
tone: n,
|
|
2340
|
-
shape:
|
|
2341
|
-
})), ...
|
|
2410
|
+
shape: Gn[l]
|
|
2411
|
+
})), ...P.map(({ id: e, label: t, tone: n }) => ({
|
|
2342
2412
|
id: e,
|
|
2343
2413
|
label: t,
|
|
2344
2414
|
tone: n,
|
|
2345
2415
|
shape: "band"
|
|
2346
|
-
}))],
|
|
2347
|
-
if (S.status === "loading") return /* @__PURE__ */ J(
|
|
2416
|
+
}))], be = E?.seriesValues !== void 0;
|
|
2417
|
+
if (S.status === "loading") return /* @__PURE__ */ J(tr, {
|
|
2348
2418
|
...S,
|
|
2349
2419
|
series: t,
|
|
2350
2420
|
height: c,
|
|
2351
2421
|
showTimeAxis: p
|
|
2352
2422
|
});
|
|
2353
|
-
if (
|
|
2423
|
+
if (M !== void 0) return /* @__PURE__ */ J(ce, {
|
|
2354
2424
|
...S,
|
|
2355
|
-
message:
|
|
2425
|
+
message: M
|
|
2356
2426
|
});
|
|
2357
|
-
if (
|
|
2427
|
+
if (F.length === 0) return /* @__PURE__ */ J(j, {
|
|
2358
2428
|
...S,
|
|
2359
|
-
series:
|
|
2360
|
-
children: /* @__PURE__ */ J(
|
|
2429
|
+
series: ye,
|
|
2430
|
+
children: /* @__PURE__ */ J(le, { children: x })
|
|
2361
2431
|
});
|
|
2362
|
-
let
|
|
2432
|
+
let H = F.map((e) => e.timestamp), we = hn({
|
|
2363
2433
|
crossings: g,
|
|
2364
2434
|
series: t,
|
|
2365
2435
|
bands: h
|
|
2366
|
-
}),
|
|
2436
|
+
}), Te = [...s.flatMap((e) => e.kind === "event" ? [e] : []), ...we.flatMap(({ crossing: e, timestamp: t }) => t === void 0 ? [] : [{
|
|
2367
2437
|
id: e.id,
|
|
2368
2438
|
timestamp: t,
|
|
2369
2439
|
label: e.label,
|
|
2370
2440
|
value: e.value
|
|
2371
2441
|
}])];
|
|
2372
|
-
function
|
|
2442
|
+
function W(e) {
|
|
2373
2443
|
return {
|
|
2374
|
-
label: e === void 0 ? void 0 :
|
|
2375
|
-
rows: [...
|
|
2444
|
+
label: e === void 0 ? void 0 : L(e),
|
|
2445
|
+
rows: [...N.map((t) => {
|
|
2376
2446
|
let n = t.points.find((t) => t.timestamp === e);
|
|
2377
2447
|
return {
|
|
2378
2448
|
id: t.id,
|
|
2379
2449
|
label: t.label,
|
|
2380
2450
|
tone: t.tone,
|
|
2381
|
-
value:
|
|
2451
|
+
value: R(n?.value ?? null)
|
|
2382
2452
|
};
|
|
2383
|
-
}), ...
|
|
2384
|
-
bands:
|
|
2453
|
+
}), ...Xn({
|
|
2454
|
+
bands: P,
|
|
2385
2455
|
timestamp: e,
|
|
2386
|
-
valueText:
|
|
2456
|
+
valueText: R
|
|
2387
2457
|
})],
|
|
2388
|
-
notes: [...s.filter((t) => t.kind !== "event" && t.timestamp === e).map((e) => e.label), ...
|
|
2458
|
+
notes: [...s.filter((t) => t.kind !== "event" && t.timestamp === e).map((e) => e.label), ...Te.filter((t) => gn(H, t.timestamp) === e).map((e) => `${e.label} · ${L(e.timestamp)}`)]
|
|
2389
2459
|
};
|
|
2390
2460
|
}
|
|
2391
|
-
let
|
|
2392
|
-
width:
|
|
2393
|
-
height:
|
|
2394
|
-
value:
|
|
2461
|
+
let G = H[0] ?? 0, K = H.at(-1) ?? G, Ee = {
|
|
2462
|
+
width: O.width,
|
|
2463
|
+
height: O.height,
|
|
2464
|
+
value: qn({
|
|
2395
2465
|
format: i,
|
|
2396
2466
|
tickFormat: a,
|
|
2397
2467
|
label: o
|
|
2398
2468
|
}),
|
|
2399
|
-
valueDomain:
|
|
2469
|
+
valueDomain: Jn({
|
|
2400
2470
|
series: t,
|
|
2401
2471
|
isStacked: u,
|
|
2402
2472
|
isZeroBased: l === "area",
|
|
2403
2473
|
bands: h,
|
|
2404
2474
|
crossings: g
|
|
2405
2475
|
}),
|
|
2406
|
-
timeDomain:
|
|
2476
|
+
timeDomain: Zt(Kn(G, n), Kn(K, n)),
|
|
2407
2477
|
timeFormat: r,
|
|
2408
|
-
locale:
|
|
2478
|
+
locale: T,
|
|
2409
2479
|
gutter: f,
|
|
2410
2480
|
hasValueTitle: o !== void 0
|
|
2411
|
-
},
|
|
2412
|
-
instants:
|
|
2413
|
-
x: (e) =>
|
|
2414
|
-
right:
|
|
2415
|
-
}),
|
|
2416
|
-
...
|
|
2417
|
-
topInset:
|
|
2418
|
-
}), { box: X } =
|
|
2481
|
+
}, De = v(Ee), Oe = In({
|
|
2482
|
+
instants: Te,
|
|
2483
|
+
x: (e) => De.x.position(Kn(e, n)),
|
|
2484
|
+
right: De.box.right
|
|
2485
|
+
}), q = v({
|
|
2486
|
+
...Ee,
|
|
2487
|
+
topInset: Ln(Oe)
|
|
2488
|
+
}), { box: X } = q;
|
|
2419
2489
|
function Z(e) {
|
|
2420
|
-
return
|
|
2490
|
+
return q.x.position(Kn(e, n));
|
|
2421
2491
|
}
|
|
2422
|
-
let Q =
|
|
2492
|
+
let Q = q.y.position;
|
|
2423
2493
|
function Ae(e) {
|
|
2424
|
-
return `${
|
|
2494
|
+
return `${L(e[0])} to ${L(e[1])}`;
|
|
2425
2495
|
}
|
|
2426
|
-
let je = y !== void 0 && b !== void 0 &&
|
|
2496
|
+
let je = y !== void 0 && b !== void 0 && K !== G ? {
|
|
2427
2497
|
onRangeChange: y,
|
|
2428
2498
|
rangeStep: b
|
|
2429
|
-
} : void 0, Me =
|
|
2499
|
+
} : void 0, Me = H.map((e) => ({
|
|
2430
2500
|
id: String(e),
|
|
2431
2501
|
x: Z(e),
|
|
2432
2502
|
y: 0
|
|
@@ -2434,44 +2504,44 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2434
2504
|
return /* @__PURE__ */ J("div", {
|
|
2435
2505
|
className: "xeuugli",
|
|
2436
2506
|
children: /* @__PURE__ */ J(ee, {
|
|
2437
|
-
items:
|
|
2438
|
-
readout: (e) =>
|
|
2439
|
-
locate:
|
|
2507
|
+
items: me,
|
|
2508
|
+
readout: (e) => ie(W(Number(e))),
|
|
2509
|
+
locate: V({
|
|
2440
2510
|
marks: Me,
|
|
2441
2511
|
width: X.width,
|
|
2442
2512
|
height: X.height,
|
|
2443
2513
|
axis: "x"
|
|
2444
2514
|
}),
|
|
2445
|
-
revision:
|
|
2515
|
+
revision: B,
|
|
2446
2516
|
inspected: d?.id,
|
|
2447
2517
|
onInspectedChange: d?.onChange,
|
|
2448
2518
|
within: d?.within,
|
|
2449
2519
|
render: (t, { inspected: r, cursor: i }) => {
|
|
2450
|
-
let a = r === null ? void 0 : Number(r), c =
|
|
2451
|
-
plotRef:
|
|
2520
|
+
let a = r === null ? void 0 : Number(r), c = W(d === void 0 || d.isSource ? a : void 0), f = /* @__PURE__ */ Y(ge, {
|
|
2521
|
+
plotRef: O.ref,
|
|
2452
2522
|
box: X,
|
|
2453
2523
|
label: m({
|
|
2454
|
-
title:
|
|
2524
|
+
title: C,
|
|
2455
2525
|
marks: "observations",
|
|
2456
2526
|
isSelectable: !1
|
|
2457
2527
|
}),
|
|
2458
|
-
readoutId:
|
|
2528
|
+
readoutId: k,
|
|
2459
2529
|
children: [
|
|
2460
|
-
/* @__PURE__ */ J(
|
|
2530
|
+
/* @__PURE__ */ J(ue, {
|
|
2461
2531
|
box: X,
|
|
2462
|
-
xTicks: p ?
|
|
2463
|
-
yTicks:
|
|
2532
|
+
xTicks: p ? q.xTicks : [],
|
|
2533
|
+
yTicks: q.yTicks,
|
|
2464
2534
|
yTitle: o
|
|
2465
2535
|
}),
|
|
2466
|
-
/* @__PURE__ */ Y(
|
|
2536
|
+
/* @__PURE__ */ Y(ve, {
|
|
2467
2537
|
box: X,
|
|
2468
2538
|
children: [
|
|
2469
|
-
/* @__PURE__ */ J(
|
|
2470
|
-
bands:
|
|
2539
|
+
/* @__PURE__ */ J(Rn, {
|
|
2540
|
+
bands: P,
|
|
2471
2541
|
x: Z,
|
|
2472
2542
|
y: Q
|
|
2473
2543
|
}),
|
|
2474
|
-
|
|
2544
|
+
N.map((e) => {
|
|
2475
2545
|
let t = e.points.map((e) => ({
|
|
2476
2546
|
x: Z(e.timestamp),
|
|
2477
2547
|
y: e.value === null ? null : Q(e.value + e.base)
|
|
@@ -2481,49 +2551,49 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2481
2551
|
y1: e.value === null ? null : Q(e.value + e.base)
|
|
2482
2552
|
}));
|
|
2483
2553
|
return /* @__PURE__ */ Y("g", { children: [
|
|
2484
|
-
l === "area" && /* @__PURE__ */ J(
|
|
2485
|
-
d:
|
|
2554
|
+
l === "area" && /* @__PURE__ */ J(he, {
|
|
2555
|
+
d: Ce(n),
|
|
2486
2556
|
tone: e.tone,
|
|
2487
2557
|
isPale: !u
|
|
2488
2558
|
}),
|
|
2489
|
-
/* @__PURE__ */ J(
|
|
2490
|
-
d:
|
|
2559
|
+
/* @__PURE__ */ J(pe, {
|
|
2560
|
+
d: Se(t),
|
|
2491
2561
|
tone: e.tone
|
|
2492
2562
|
}),
|
|
2493
|
-
|
|
2563
|
+
xe(t).map((t) => /* @__PURE__ */ J(de, {
|
|
2494
2564
|
x: t.x,
|
|
2495
2565
|
y: t.y,
|
|
2496
2566
|
tone: e.tone,
|
|
2497
|
-
radius:
|
|
2567
|
+
radius: Un
|
|
2498
2568
|
}, t.x))
|
|
2499
2569
|
] }, e.id);
|
|
2500
2570
|
}),
|
|
2501
|
-
g.map((e) => /* @__PURE__ */ J(
|
|
2571
|
+
g.map((e) => /* @__PURE__ */ J(fe, {
|
|
2502
2572
|
x1: X.left,
|
|
2503
2573
|
x2: X.right,
|
|
2504
2574
|
y1: Q(e.value),
|
|
2505
2575
|
y2: Q(e.value)
|
|
2506
2576
|
}, e.id)),
|
|
2507
2577
|
s.map((e) => {
|
|
2508
|
-
if (e.kind === "time") return /* @__PURE__ */ J(
|
|
2578
|
+
if (e.kind === "time") return /* @__PURE__ */ J(z, {
|
|
2509
2579
|
x: Z(e.timestamp),
|
|
2510
2580
|
top: X.top,
|
|
2511
2581
|
bottom: X.bottom
|
|
2512
2582
|
}, e.id);
|
|
2513
|
-
let t =
|
|
2514
|
-
return e.kind === "point" ? /* @__PURE__ */ J(
|
|
2583
|
+
let t = N.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base;
|
|
2584
|
+
return e.kind === "point" ? /* @__PURE__ */ J(I, {
|
|
2515
2585
|
x: Z(e.timestamp),
|
|
2516
2586
|
y: Q(e.value + (t ?? 0))
|
|
2517
2587
|
}, e.id) : void 0;
|
|
2518
2588
|
}),
|
|
2519
|
-
a !== void 0 && /* @__PURE__ */ J(
|
|
2589
|
+
a !== void 0 && /* @__PURE__ */ J(z, {
|
|
2520
2590
|
x: Z(a),
|
|
2521
2591
|
top: X.top,
|
|
2522
2592
|
bottom: X.bottom
|
|
2523
2593
|
}),
|
|
2524
|
-
a !== void 0 &&
|
|
2594
|
+
a !== void 0 && N.flatMap((e) => {
|
|
2525
2595
|
let t = e.points.find((e) => e.timestamp === a);
|
|
2526
|
-
return t === void 0 || t.value === null ? [] : [/* @__PURE__ */ J(
|
|
2596
|
+
return t === void 0 || t.value === null ? [] : [/* @__PURE__ */ J(de, {
|
|
2527
2597
|
x: Z(t.timestamp),
|
|
2528
2598
|
y: Q(t.value + t.base),
|
|
2529
2599
|
tone: e.tone,
|
|
@@ -2532,48 +2602,48 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2532
2602
|
})
|
|
2533
2603
|
]
|
|
2534
2604
|
}),
|
|
2535
|
-
/* @__PURE__ */ J(
|
|
2605
|
+
/* @__PURE__ */ J(zn, {
|
|
2536
2606
|
placed: Oe,
|
|
2537
2607
|
x: Z,
|
|
2538
2608
|
y: Q,
|
|
2539
2609
|
top: X.top,
|
|
2540
2610
|
bottom: X.bottom
|
|
2541
2611
|
}),
|
|
2542
|
-
i !== null && /* @__PURE__ */ J(
|
|
2612
|
+
i !== null && /* @__PURE__ */ J(re, {
|
|
2543
2613
|
x: Z(Number(i)),
|
|
2544
2614
|
top: X.top,
|
|
2545
2615
|
bottom: X.bottom,
|
|
2546
|
-
width:
|
|
2616
|
+
width: Hn
|
|
2547
2617
|
})
|
|
2548
2618
|
]
|
|
2549
2619
|
});
|
|
2550
2620
|
return /* @__PURE__ */ Y(j, {
|
|
2551
2621
|
...S,
|
|
2552
2622
|
figure: t,
|
|
2553
|
-
titleDetail:
|
|
2554
|
-
series:
|
|
2555
|
-
seriesLegend: /* @__PURE__ */ J(
|
|
2556
|
-
id:
|
|
2623
|
+
titleDetail: be ? void 0 : c.label,
|
|
2624
|
+
series: ye,
|
|
2625
|
+
seriesLegend: /* @__PURE__ */ J(se, {
|
|
2626
|
+
id: k,
|
|
2557
2627
|
label: c.label,
|
|
2558
|
-
legend:
|
|
2628
|
+
legend: ye,
|
|
2559
2629
|
rows: c.rows,
|
|
2560
|
-
x: Z(a ??
|
|
2630
|
+
x: Z(a ?? G),
|
|
2561
2631
|
width: X.width,
|
|
2562
2632
|
notes: c.notes,
|
|
2563
|
-
hasSeriesSummary:
|
|
2633
|
+
hasSeriesSummary: be
|
|
2564
2634
|
}),
|
|
2565
|
-
children: [/* @__PURE__ */ J(
|
|
2566
|
-
label: `${
|
|
2635
|
+
children: [/* @__PURE__ */ J(oe, {
|
|
2636
|
+
label: `${C} observations`,
|
|
2567
2637
|
columns: [
|
|
2568
2638
|
{
|
|
2569
2639
|
id: "time",
|
|
2570
2640
|
label: `Time (${n})`
|
|
2571
2641
|
},
|
|
2572
|
-
...
|
|
2642
|
+
...N.map((e) => ({
|
|
2573
2643
|
id: `series:${e.id}`,
|
|
2574
2644
|
label: e.label
|
|
2575
2645
|
})),
|
|
2576
|
-
...
|
|
2646
|
+
...P.flatMap((e) => [{
|
|
2577
2647
|
id: `band:${e.id}`,
|
|
2578
2648
|
label: e.label
|
|
2579
2649
|
}, {
|
|
@@ -2581,31 +2651,31 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2581
2651
|
label: `${e.label}: ${e.rangeLabel}`
|
|
2582
2652
|
}])
|
|
2583
2653
|
],
|
|
2584
|
-
rows:
|
|
2654
|
+
rows: F.map((e, t) => ({
|
|
2585
2655
|
id: e.timestamp,
|
|
2586
2656
|
values: [
|
|
2587
|
-
|
|
2588
|
-
...
|
|
2589
|
-
...
|
|
2590
|
-
bands:
|
|
2657
|
+
L(e.timestamp),
|
|
2658
|
+
...N.map((e) => R(e.points[t]?.value ?? null)),
|
|
2659
|
+
...Xn({
|
|
2660
|
+
bands: P,
|
|
2591
2661
|
timestamp: e.timestamp,
|
|
2592
|
-
valueText:
|
|
2662
|
+
valueText: R
|
|
2593
2663
|
}).map((e) => e.value)
|
|
2594
2664
|
]
|
|
2595
2665
|
}))
|
|
2596
2666
|
}), /* @__PURE__ */ Y("div", {
|
|
2597
2667
|
className: "xrvj5dj x1n8ia3y",
|
|
2598
2668
|
children: [
|
|
2599
|
-
je === void 0 ? f : /* @__PURE__ */ J(
|
|
2669
|
+
je === void 0 ? f : /* @__PURE__ */ J(An, {
|
|
2600
2670
|
value: _,
|
|
2601
2671
|
onValueChange: je.onRangeChange,
|
|
2602
|
-
min:
|
|
2603
|
-
max:
|
|
2672
|
+
min: G,
|
|
2673
|
+
max: K,
|
|
2604
2674
|
step: je.rangeStep,
|
|
2605
2675
|
describe: Ae,
|
|
2606
|
-
label: `${
|
|
2607
|
-
left: Z(
|
|
2608
|
-
width: Z(
|
|
2676
|
+
label: `${C} time range`,
|
|
2677
|
+
left: Z(G),
|
|
2678
|
+
width: Z(K) - Z(G),
|
|
2609
2679
|
height: X.bottom,
|
|
2610
2680
|
children: f
|
|
2611
2681
|
}),
|
|
@@ -2614,9 +2684,9 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2614
2684
|
children: [/* @__PURE__ */ J("span", { children: _ === null ? "Drag on the plot with a mouse to select a range of time." : `Selected range: ${Ae(_)}` }), _ === null ? /* @__PURE__ */ J(e, {
|
|
2615
2685
|
type: "button",
|
|
2616
2686
|
onClick: (e) => {
|
|
2617
|
-
|
|
2618
|
-
first:
|
|
2619
|
-
last:
|
|
2687
|
+
ke({ options: () => je }, "onRangeChange", or({
|
|
2688
|
+
first: G,
|
|
2689
|
+
last: K,
|
|
2620
2690
|
step: je.rangeStep
|
|
2621
2691
|
}), {
|
|
2622
2692
|
reason: "trigger-press",
|
|
@@ -2627,7 +2697,7 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2627
2697
|
}) : /* @__PURE__ */ J(e, {
|
|
2628
2698
|
type: "button",
|
|
2629
2699
|
onClick: (e) => {
|
|
2630
|
-
|
|
2700
|
+
ke({ options: () => je }, "onRangeChange", null, {
|
|
2631
2701
|
reason: "clear-press",
|
|
2632
2702
|
event: e.nativeEvent
|
|
2633
2703
|
});
|
|
@@ -2635,16 +2705,16 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2635
2705
|
children: "Clear range"
|
|
2636
2706
|
})]
|
|
2637
2707
|
}),
|
|
2638
|
-
s.length +
|
|
2708
|
+
s.length + we.length > 0 && /* @__PURE__ */ Y("ul", {
|
|
2639
2709
|
className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
|
|
2640
2710
|
children: [s.map((e) => /* @__PURE__ */ Y("li", { children: [
|
|
2641
|
-
|
|
2711
|
+
L(e.timestamp),
|
|
2642
2712
|
" · ",
|
|
2643
2713
|
e.label,
|
|
2644
|
-
e.kind === "point" && ` · ${
|
|
2645
|
-
] }, e.id)),
|
|
2714
|
+
e.kind === "point" && ` · ${R(e.value)}`
|
|
2715
|
+
] }, e.id)), we.map((e) => /* @__PURE__ */ J("li", { children: Zn({
|
|
2646
2716
|
found: e,
|
|
2647
|
-
timeText:
|
|
2717
|
+
timeText: L
|
|
2648
2718
|
}) }, e.crossing.id))]
|
|
2649
2719
|
})
|
|
2650
2720
|
]
|
|
@@ -2654,7 +2724,7 @@ function nr({ series: t, timestampUnit: n, timeFormat: r, valueFormat: i, tickFo
|
|
|
2654
2724
|
})
|
|
2655
2725
|
});
|
|
2656
2726
|
}
|
|
2657
|
-
function
|
|
2727
|
+
function ar({ range: e, rangeStep: t, isSelectable: n, timeline: r }) {
|
|
2658
2728
|
let i = r[0], a = r.at(-1);
|
|
2659
2729
|
if (!n || i === void 0 || a === void 0) return;
|
|
2660
2730
|
let o = a - i;
|
|
@@ -2663,8 +2733,8 @@ function rr({ range: e, rangeStep: t, isSelectable: n, timeline: r }) {
|
|
|
2663
2733
|
if (e !== null && (!(e[0] >= i && e[1] <= a) || e[0] >= e[1])) return "The selected range must have ordered ends inside the observed time.";
|
|
2664
2734
|
}
|
|
2665
2735
|
}
|
|
2666
|
-
function
|
|
2667
|
-
let r = Math.max(1, Math.round((t - e) /
|
|
2736
|
+
function or({ first: e, last: t, step: n }) {
|
|
2737
|
+
let r = Math.max(1, Math.round((t - e) / Wn / n)) * n, i = Math.min(e + r, t - n);
|
|
2668
2738
|
return [i, Math.min(t, Math.max(i + n, t - r))];
|
|
2669
2739
|
}
|
|
2670
|
-
export {
|
|
2740
|
+
export { er as a, $ as c, Ft as d, gt as f, rr as i, Ht as l, ct as m, Qn as n, ln as o, ft as p, nr as r, sn as s, $n as t, It as u };
|