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