@mechane-ai/elements 0.44.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -18
- package/bin/mechane-elements-catalog.mjs +42 -4
- package/dist/ai.js +268 -202
- package/dist/catalog.json +95 -31
- package/dist/categorical-values-BXi-rJuv.js +74 -0
- package/dist/chart-cursor-1mFd48Jc.js +23 -0
- package/dist/chart-data-CIJVWCYt.js +21 -0
- package/dist/chart-frame-BaxKn_MB.js +236 -0
- package/dist/{chart-input-B6_HXFDP.js → chart-input-Bm82_9Rd.js} +2 -2
- package/dist/chart-theme-4zprJ3rW.js +404 -0
- package/dist/charts/cartesian.js +1624 -1442
- package/dist/charts/distribution.js +486 -409
- package/dist/charts/graph.js +383 -358
- package/dist/charts/hierarchy.js +103 -94
- package/dist/charts/matrix.js +340 -333
- package/dist/charts/timeline.js +167 -134
- package/dist/charts.js +3 -3
- package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
- package/dist/collections.js +1648 -1188
- package/dist/{constants.stylex-CaVa9yGN.js → constants.stylex-CqhVl0uU.js} +9 -9
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +67 -66
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +3 -3
- package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/csp.js +6 -11
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +274 -214
- package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
- package/dist/forms.js +3 -3
- package/dist/index.js +1 -1
- package/dist/layout.js +207 -207
- package/dist/navigation.js +4 -3
- package/dist/packages/ai/src/conversation.d.ts +2 -0
- package/dist/packages/ai/src/prompt-input.d.ts +7 -2
- package/dist/packages/charts/src/cartesian/composition-bars.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/index.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +8 -2
- package/dist/packages/charts/src/cartesian/time-series.d.ts +11 -1
- package/dist/packages/charts/src/categorical-values.d.ts +14 -9
- package/dist/packages/charts/src/chart-frame.d.ts +7 -9
- package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
- package/dist/packages/charts/src/chart-range.d.ts +33 -0
- package/dist/packages/charts/src/chart-rows.d.ts +20 -0
- package/dist/packages/charts/src/chart-theme.d.ts +25 -1
- package/dist/packages/charts/src/chart.d.ts +81 -0
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +6 -4
- package/dist/packages/charts/src/index.d.ts +2 -1
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +3 -3
- package/dist/packages/charts/src/plot-width.d.ts +0 -1
- package/dist/packages/charts/src/timeline/index.d.ts +1 -1
- package/dist/packages/charts/src/timeline/waterfall.d.ts +6 -2
- package/dist/packages/collections/src/collection-controls.d.ts +5 -1
- package/dist/packages/collections/src/collection-filters.d.ts +4 -1
- package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
- package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
- package/dist/packages/collections/src/data-table-text.d.ts +13 -0
- package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
- package/dist/packages/collections/src/data-table.d.ts +3 -85
- package/dist/packages/collections/src/index.d.ts +11 -6
- package/dist/packages/collections/src/query-controls.d.ts +6 -2
- package/dist/packages/collections/src/table-results.d.ts +47 -13
- package/dist/packages/collections/src/timeline.d.ts +1 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
- package/dist/packages/collections/src/use-table-window.d.ts +25 -0
- package/dist/packages/content/src/viewer.d.ts +8 -0
- package/dist/packages/core/src/disclosure.d.ts +9 -1
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/route-link.d.ts +11 -0
- package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
- package/dist/packages/forms/src/file-picker.d.ts +15 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -6
- package/dist/packages/forms/src/forms.d.ts +4 -1
- package/dist/packages/forms/src/index.d.ts +4 -2
- package/dist/packages/forms/src/selection.d.ts +14 -0
- package/dist/packages/foundations/src/chart-tones.d.ts +5 -0
- package/dist/packages/foundations/src/csp/index.d.ts +1 -1
- package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
- package/dist/packages/navigation/src/index.d.ts +1 -1
- package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
- package/dist/plot-width-v2c_rA20.js +63 -0
- package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
- package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
- package/dist/src-CGc_hjxJ.js +409 -0
- package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
- package/dist/{src-CDp1JtwC.js → src-DVHlknB6.js} +135 -120
- package/dist/styles2.css +167 -132
- package/dist/tokens.js +1 -1
- package/package.json +1 -4
- package/packages/foundations/src/constants.stylex.ts +9 -9
- package/packages/foundations/src/tokens.stylex.ts +9 -9
- package/skills/extend-elements/SKILL.md +74 -0
- package/skills/review-elements/SKILL.md +76 -0
- package/skills/upgrade-elements/SKILL.md +34 -0
- package/skills/upgrade-elements/references/releases.md +58 -0
- package/skills/use-elements/SKILL.md +64 -13
- package/skills/use-elements/references/agent.md +57 -0
- package/skills/use-elements/references/charts.md +63 -0
- package/skills/use-elements/references/collections.md +89 -0
- package/skills/use-elements/references/conversations.md +47 -0
- package/skills/use-elements/references/forms.md +81 -0
- package/skills/use-elements/references/reports.md +6 -4
- package/skills/use-elements/references/styling.md +70 -0
- package/skills/use-elements/references/workspace.md +3 -3
- package/dist/categorical-values-ByvFLaNE.js +0 -59
- package/dist/chart-frame-Bcd9Tpt5.js +0 -251
- package/dist/chart-navigation-BAbb5PV9.js +0 -154
- package/dist/header-styles-COxCYFZx.js +0 -90
- package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
- package/dist/packages/charts/src/chart-surface.d.ts +0 -27
- package/dist/packages/navigation/src/route-link.d.ts +0 -2
- package/dist/plot-width-8cXdAjoD.js +0 -96
- package/dist/src-Bk7M67zy.js +0 -396
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import { c as e } from "../src-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
1
|
+
import { c as e, l as t } from "../src-DVHlknB6.js";
|
|
2
|
+
import { t as n } from "../chart-cursor-1mFd48Jc.js";
|
|
3
|
+
import { t as r } from "../chart-data-CIJVWCYt.js";
|
|
4
|
+
import { r as i, t as a } from "../chart-frame-BaxKn_MB.js";
|
|
5
|
+
import { n as o, r as s, t as c } from "../chart-input-Bm82_9Rd.js";
|
|
6
|
+
import { i as l, l as u, n as d, s as f, t as p } from "../chart-theme-4zprJ3rW.js";
|
|
7
|
+
import { n as m, r as h, t as g } from "../plot-width-v2c_rA20.js";
|
|
8
|
+
import * as _ from "@stylexjs/stylex";
|
|
9
|
+
import { useId as v } from "react";
|
|
10
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
+
import { scaleLinear as S } from "@visx/scale";
|
|
12
|
+
import { Bar as C } from "@visx/shape";
|
|
10
13
|
// packages/charts/src/distribution/distribution-input.ts
|
|
11
|
-
var
|
|
14
|
+
var w = {
|
|
12
15
|
bins: 200,
|
|
13
16
|
cumulativePoints: 2e3,
|
|
14
17
|
rows: 200
|
|
15
18
|
};
|
|
16
|
-
function
|
|
17
|
-
if (!
|
|
18
|
-
if (!
|
|
19
|
+
function T({ items: e, domain: t, maxEntries: n }) {
|
|
20
|
+
if (!s(t)) return "The chart domain must contain two finite, increasing values.";
|
|
21
|
+
if (!o(e)) return "Chart records must have unique identifiers.";
|
|
19
22
|
if (e.length > n) return `This chart supports at most ${n} records. Supply an explicit data window or aggregation.`;
|
|
20
23
|
}
|
|
21
|
-
function
|
|
24
|
+
function E(e, t) {
|
|
22
25
|
return !Number.isFinite(e) || e < t[0] || e > t[1];
|
|
23
26
|
}
|
|
24
27
|
// packages/charts/src/distribution/distribution-plot.tsx
|
|
25
|
-
var
|
|
28
|
+
var D = { height: 160 }, O = [
|
|
26
29
|
0,
|
|
27
30
|
.5,
|
|
28
31
|
1
|
|
29
|
-
],
|
|
32
|
+
], k = {
|
|
30
33
|
plot: {
|
|
31
34
|
k7Eaqz: "xeuugli",
|
|
32
35
|
k1xSpc: "xrvj5dj",
|
|
@@ -40,7 +43,8 @@ var x = { height: 160 }, S = [
|
|
|
40
43
|
kXwgrk: "xdt5ytf",
|
|
41
44
|
kjj79g: "x1qughib",
|
|
42
45
|
k9WMMc: "xp4054r",
|
|
43
|
-
kMwMTN: "
|
|
46
|
+
kMwMTN: "xbixft",
|
|
47
|
+
kMv6JI: "xiard35",
|
|
44
48
|
kGuDYH: "xy8obcc",
|
|
45
49
|
kLWn49: "xas2l8k",
|
|
46
50
|
kcqcaj: "xss6m8b",
|
|
@@ -68,7 +72,8 @@ var x = { height: 160 }, S = [
|
|
|
68
72
|
k1xSpc: "x78zum5",
|
|
69
73
|
kjj79g: "x1qughib",
|
|
70
74
|
kOIVth: "x1hnptsi",
|
|
71
|
-
kMwMTN: "
|
|
75
|
+
kMwMTN: "xbixft",
|
|
76
|
+
kMv6JI: "xiard35",
|
|
72
77
|
kGuDYH: "xy8obcc",
|
|
73
78
|
kLWn49: "xas2l8k",
|
|
74
79
|
kcqcaj: "xss6m8b",
|
|
@@ -186,171 +191,179 @@ var x = { height: 160 }, S = [
|
|
|
186
191
|
$$css: !0
|
|
187
192
|
}
|
|
188
193
|
};
|
|
189
|
-
function
|
|
190
|
-
let { ref: u, width:
|
|
191
|
-
return /* @__PURE__ */
|
|
194
|
+
function A({ label: e, readoutId: t, xDomain: n, yDomain: r, xLabel: i, yLabel: a, formatX: o, formatY: s, children: c }) {
|
|
195
|
+
let { ref: u, width: d } = g(), f = O.map((e) => n[0] + e * (n[1] - n[0])), p = O.map((e) => r[1] - e * (r[1] - r[0]));
|
|
196
|
+
return /* @__PURE__ */ x("div", {
|
|
192
197
|
className: "xeuugli xrvj5dj x37z1gs x1hnptsi",
|
|
193
198
|
children: [
|
|
194
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ x("div", {
|
|
195
200
|
className: "x1osaytk x78zum5 x1qughib x1n8ia3y",
|
|
196
|
-
children: [/* @__PURE__ */
|
|
197
|
-
className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
198
|
-
children: o
|
|
199
|
-
}), /* @__PURE__ */ m("span", {
|
|
201
|
+
children: [/* @__PURE__ */ b("span", {
|
|
200
202
|
className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
201
203
|
children: a
|
|
204
|
+
}), /* @__PURE__ */ b("span", {
|
|
205
|
+
className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
206
|
+
children: i
|
|
202
207
|
})]
|
|
203
208
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ b("div", {
|
|
205
210
|
"aria-hidden": !0,
|
|
206
|
-
className: "x1ymw6g x78zum5 xdt5ytf x1qughib xp4054r
|
|
207
|
-
children:
|
|
211
|
+
className: "x1ymw6g x78zum5 xdt5ytf x1qughib xp4054r xbixft xiard35 xy8obcc xas2l8k xss6m8b x2aouup xj0a0fe",
|
|
212
|
+
children: p.map((e) => /* @__PURE__ */ b("span", { children: s(e) }, e))
|
|
208
213
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ b(l, {
|
|
210
215
|
ref: u,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
216
|
+
role: "group",
|
|
217
|
+
"aria-label": e,
|
|
218
|
+
"aria-describedby": t,
|
|
219
|
+
className: "xeuugli x-default-marker",
|
|
220
|
+
children: /* @__PURE__ */ x("svg", {
|
|
214
221
|
"aria-hidden": !0,
|
|
215
|
-
|
|
216
|
-
let n = e.currentTarget.getBoundingClientRect();
|
|
217
|
-
t?.(r[0] + (e.clientX - n.left) / n.width * (r[1] - r[0]));
|
|
218
|
-
},
|
|
219
|
-
onPointerDown: (e) => {
|
|
220
|
-
let n = e.currentTarget.getBoundingClientRect();
|
|
221
|
-
t?.(r[0] + (e.clientX - n.left) / n.width * (r[1] - r[0]));
|
|
222
|
-
},
|
|
223
|
-
viewBox: `0 0 ${f} ${x.height}`,
|
|
222
|
+
viewBox: `0 0 ${d} ${D.height}`,
|
|
224
223
|
preserveAspectRatio: "none",
|
|
225
224
|
className: "x1lliihq xh8yej3 x1ymw6g xb3r6kr",
|
|
226
|
-
children: [
|
|
225
|
+
children: [O.map((e) => /* @__PURE__ */ b("line", {
|
|
227
226
|
x1: 0,
|
|
228
|
-
x2:
|
|
229
|
-
y1:
|
|
230
|
-
y2:
|
|
227
|
+
x2: d,
|
|
228
|
+
y1: D.height * e,
|
|
229
|
+
y2: D.height * e,
|
|
231
230
|
className: "x13hfdr1 x13efnbd"
|
|
232
|
-
}, e)),
|
|
231
|
+
}, e)), c(d)]
|
|
233
232
|
})
|
|
234
233
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ b("span", {}),
|
|
235
|
+
/* @__PURE__ */ b("div", {
|
|
237
236
|
"aria-hidden": !0,
|
|
238
|
-
className: "x78zum5 x1qughib x1hnptsi
|
|
239
|
-
children:
|
|
237
|
+
className: "x78zum5 x1qughib x1hnptsi xbixft xiard35 xy8obcc xas2l8k xss6m8b",
|
|
238
|
+
children: f.map((e, t) => /* @__PURE__ */ b("span", {
|
|
240
239
|
...{
|
|
241
240
|
0: { className: "x1cqoux5 xeuugli xj0a0fe" },
|
|
242
241
|
2: { className: "x1cqoux5 xeuugli xj0a0fe x2b8uid" },
|
|
243
242
|
1: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" },
|
|
244
243
|
3: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" }
|
|
245
244
|
}[(t === 1) << 1 | t === 2],
|
|
246
|
-
children:
|
|
245
|
+
children: o(e)
|
|
247
246
|
}, e))
|
|
248
247
|
})
|
|
249
248
|
]
|
|
250
249
|
});
|
|
251
250
|
}
|
|
252
|
-
function
|
|
253
|
-
return /* @__PURE__ */
|
|
254
|
-
className: "x78zum5 x1qughib x1hnptsi
|
|
255
|
-
children: [/* @__PURE__ */
|
|
251
|
+
function j({ domain: e, formatValue: t }) {
|
|
252
|
+
return /* @__PURE__ */ x("div", {
|
|
253
|
+
className: "x78zum5 x1qughib x1hnptsi xbixft xiard35 xy8obcc xas2l8k xss6m8b",
|
|
254
|
+
children: [/* @__PURE__ */ b("span", {
|
|
256
255
|
className: "x1cqoux5 xeuugli xj0a0fe",
|
|
257
256
|
children: t(e[0])
|
|
258
|
-
}), /* @__PURE__ */
|
|
257
|
+
}), /* @__PURE__ */ b("span", {
|
|
259
258
|
className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
|
|
260
259
|
children: t(e[1])
|
|
261
260
|
})]
|
|
262
261
|
});
|
|
263
262
|
}
|
|
264
263
|
// packages/charts/src/distribution/ecdf.tsx
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
var M = 6, N = 12;
|
|
265
|
+
function P({ title: t, report: o, description: s, points: l, domain: p, valueLabel: m, probabilityLabel: h, formatValue: g, formatProbability: C, tone: w = "series1", selection: T, emptyLabel: E = "No cumulative distribution points are available." }) {
|
|
266
|
+
let O = l.map((e) => ({
|
|
267
267
|
id: e.id,
|
|
268
|
-
label: `${
|
|
269
|
-
})),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
selection: S
|
|
273
|
-
}), k = D({
|
|
274
|
-
points: c,
|
|
275
|
-
domain: u
|
|
268
|
+
label: `${m}: ${g(e.value)}, ${h}: ${e.probability === null ? "Unavailable" : C(e.probability)}`
|
|
269
|
+
})), j = v(), P = F({
|
|
270
|
+
points: l,
|
|
271
|
+
domain: p
|
|
276
272
|
});
|
|
277
|
-
if (
|
|
278
|
-
title:
|
|
273
|
+
if (P !== void 0) return /* @__PURE__ */ b(c, {
|
|
274
|
+
title: t,
|
|
279
275
|
report: o,
|
|
280
276
|
description: s,
|
|
281
|
-
message:
|
|
277
|
+
message: P
|
|
282
278
|
});
|
|
283
|
-
let
|
|
279
|
+
let I = S({
|
|
284
280
|
domain: [0, 1],
|
|
285
|
-
range: [
|
|
281
|
+
range: [D.height, 0]
|
|
286
282
|
});
|
|
287
|
-
return /* @__PURE__ */
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
},
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
283
|
+
return /* @__PURE__ */ b(d, {
|
|
284
|
+
items: O,
|
|
285
|
+
arrows: "both",
|
|
286
|
+
locate: (e) => {
|
|
287
|
+
let t = p[0] + e.x / e.width * (p[1] - p[0]), n = { point: l[0] };
|
|
288
|
+
for (let e of l) (n.point === void 0 || Math.abs(e.value - t) < Math.abs(n.point.value - t)) && (n.point = e);
|
|
289
|
+
return n.point?.id;
|
|
290
|
+
},
|
|
291
|
+
selected: T?.selectedId ?? null,
|
|
292
|
+
onSelect: T?.onSelect,
|
|
293
|
+
render: (c, { inspected: d, cursor: v }) => /* @__PURE__ */ b(a, {
|
|
294
|
+
figure: c,
|
|
295
|
+
title: t,
|
|
296
|
+
report: o,
|
|
297
|
+
description: s,
|
|
298
|
+
footer: /* @__PURE__ */ b(i, {
|
|
299
|
+
id: j,
|
|
300
|
+
children: f(O, d)
|
|
301
|
+
}),
|
|
302
|
+
children: l.length === 0 ? /* @__PURE__ */ b("p", {
|
|
303
|
+
..._.props(k.empty),
|
|
304
|
+
children: E
|
|
305
|
+
}) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(A, {
|
|
306
|
+
label: u({
|
|
307
|
+
title: t,
|
|
308
|
+
isSelectable: T !== void 0
|
|
309
|
+
}),
|
|
310
|
+
readoutId: j,
|
|
311
|
+
xDomain: p,
|
|
312
|
+
yDomain: [0, 1],
|
|
313
|
+
xLabel: m,
|
|
314
|
+
yLabel: h,
|
|
315
|
+
formatX: g,
|
|
316
|
+
formatY: C,
|
|
317
|
+
children: (t) => {
|
|
318
|
+
let r = S({
|
|
319
|
+
domain: [...p],
|
|
320
|
+
range: [0, t]
|
|
321
|
+
}), i = l.map((e, t) => {
|
|
322
|
+
if (e.probability === null) return "";
|
|
323
|
+
let n = r(e.value), i = I(e.probability), a = l[t - 1];
|
|
324
|
+
return a === void 0 || a.probability === null ? `M ${n} ${i}` : `H ${n} V ${i}`;
|
|
325
|
+
}).join(" "), a = l.find((e) => e.id === v);
|
|
326
|
+
return /* @__PURE__ */ x(y, { children: [
|
|
327
|
+
/* @__PURE__ */ b("path", {
|
|
328
|
+
d: i,
|
|
329
|
+
fill: "none",
|
|
330
|
+
stroke: e[w],
|
|
331
|
+
strokeWidth: 2,
|
|
332
|
+
vectorEffect: "non-scaling-stroke"
|
|
333
|
+
}),
|
|
334
|
+
l.map((t) => t.probability === null ? null : /* @__PURE__ */ b("circle", {
|
|
335
|
+
cx: r(t.value),
|
|
336
|
+
cy: I(t.probability),
|
|
337
|
+
r: T?.selectedId === t.id || d === t.id ? 4 : 2,
|
|
338
|
+
fill: e[w]
|
|
339
|
+
}, t.id)),
|
|
340
|
+
a !== void 0 && /* @__PURE__ */ b(n, {
|
|
341
|
+
x: r(a.value),
|
|
342
|
+
top: 0,
|
|
343
|
+
bottom: D.height - M,
|
|
344
|
+
width: N
|
|
345
|
+
})
|
|
346
|
+
] });
|
|
347
|
+
}
|
|
348
|
+
}), /* @__PURE__ */ b(r, {
|
|
349
|
+
label: `${t} observations`,
|
|
350
|
+
columns: [{
|
|
351
|
+
id: "observation",
|
|
352
|
+
label: "Observation"
|
|
353
|
+
}],
|
|
354
|
+
rows: O.map((e) => ({
|
|
355
|
+
id: e.id,
|
|
356
|
+
values: [e.label]
|
|
357
|
+
}))
|
|
358
|
+
})] })
|
|
359
|
+
})
|
|
347
360
|
});
|
|
348
361
|
}
|
|
349
|
-
function
|
|
350
|
-
let n =
|
|
362
|
+
function F({ points: e, domain: t }) {
|
|
363
|
+
let n = T({
|
|
351
364
|
items: e,
|
|
352
365
|
domain: t,
|
|
353
|
-
maxEntries:
|
|
366
|
+
maxEntries: w.cumulativePoints
|
|
354
367
|
});
|
|
355
368
|
if (n !== void 0) return n;
|
|
356
369
|
let r = {
|
|
@@ -358,7 +371,7 @@ function D({ points: e, domain: t }) {
|
|
|
358
371
|
probability: 0
|
|
359
372
|
};
|
|
360
373
|
for (let n of e) {
|
|
361
|
-
if (
|
|
374
|
+
if (E(n.value, t) || n.value < r.value) return `Cumulative point ${n.id} is non-finite, outside the domain, or out of order.`;
|
|
362
375
|
if (n.probability !== null) {
|
|
363
376
|
if (!Number.isFinite(n.probability) || n.probability < r.probability || n.probability > 1) return `Cumulative point ${n.id} must have a probability from zero to one that does not decrease.`;
|
|
364
377
|
r.probability = n.probability;
|
|
@@ -367,223 +380,259 @@ function D({ points: e, domain: t }) {
|
|
|
367
380
|
}
|
|
368
381
|
}
|
|
369
382
|
// packages/charts/src/distribution/histogram.tsx
|
|
370
|
-
|
|
371
|
-
|
|
383
|
+
var I = 6;
|
|
384
|
+
function L({ title: o, report: s, description: l, bins: m, domain: h, maximumCount: g, valueLabel: C, countLabel: w, formatValue: T, formatCount: E, tone: O = "series1", selection: j, emptyLabel: M = "No histogram bins are available." }) {
|
|
385
|
+
let N = m.map((e) => ({
|
|
372
386
|
id: e.id,
|
|
373
|
-
label: `${e.label}, ${
|
|
374
|
-
})),
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}), M = k({
|
|
379
|
-
bins: c,
|
|
380
|
-
domain: d,
|
|
381
|
-
maximumCount: v
|
|
387
|
+
label: `${e.label}, ${T(e.lowerBound)} – ${T(e.upperBound)}, ${w}: ${e.count === null ? "Unavailable" : E(e.count)}`
|
|
388
|
+
})), P = v(), F = R({
|
|
389
|
+
bins: m,
|
|
390
|
+
domain: h,
|
|
391
|
+
maximumCount: g
|
|
382
392
|
});
|
|
383
|
-
if (
|
|
384
|
-
title:
|
|
385
|
-
report:
|
|
386
|
-
description:
|
|
387
|
-
message:
|
|
393
|
+
if (F !== void 0) return /* @__PURE__ */ b(c, {
|
|
394
|
+
title: o,
|
|
395
|
+
report: s,
|
|
396
|
+
description: l,
|
|
397
|
+
message: F
|
|
388
398
|
});
|
|
389
|
-
let
|
|
390
|
-
domain: [0,
|
|
391
|
-
range: [
|
|
399
|
+
let L = S({
|
|
400
|
+
domain: [0, g],
|
|
401
|
+
range: [D.height, 0]
|
|
392
402
|
});
|
|
393
|
-
return /* @__PURE__ */
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
403
|
+
return /* @__PURE__ */ b(d, {
|
|
404
|
+
items: N,
|
|
405
|
+
arrows: "both",
|
|
406
|
+
locate: (e) => {
|
|
407
|
+
let t = h[0] + e.x / e.width * (h[1] - h[0]);
|
|
408
|
+
return m.find((e) => t >= e.lowerBound && t <= e.upperBound)?.id;
|
|
409
|
+
},
|
|
410
|
+
selected: j?.selectedId ?? null,
|
|
411
|
+
onSelect: j?.onSelect,
|
|
412
|
+
render: (c, { inspected: d, cursor: v }) => /* @__PURE__ */ b(a, {
|
|
413
|
+
figure: c,
|
|
414
|
+
title: o,
|
|
415
|
+
report: s,
|
|
416
|
+
description: l,
|
|
417
|
+
footer: /* @__PURE__ */ b(i, {
|
|
418
|
+
id: P,
|
|
419
|
+
children: f(N, d)
|
|
420
|
+
}),
|
|
421
|
+
children: m.length === 0 ? /* @__PURE__ */ b("p", {
|
|
422
|
+
..._.props(k.empty),
|
|
423
|
+
children: M
|
|
424
|
+
}) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(A, {
|
|
425
|
+
label: u({
|
|
426
|
+
title: o,
|
|
427
|
+
isSelectable: j !== void 0
|
|
428
|
+
}),
|
|
429
|
+
readoutId: P,
|
|
430
|
+
xDomain: h,
|
|
431
|
+
yDomain: [0, g],
|
|
432
|
+
xLabel: C,
|
|
433
|
+
yLabel: w,
|
|
434
|
+
formatX: T,
|
|
435
|
+
formatY: E,
|
|
436
|
+
children: (r) => {
|
|
437
|
+
let i = S({
|
|
438
|
+
domain: [...h],
|
|
439
|
+
range: [0, r]
|
|
440
|
+
}), a = m.map((n) => {
|
|
441
|
+
let r = i(n.lowerBound), a = i(n.upperBound) - r, o = Math.min(2, a * .2), s = j?.selectedId === n.id || d === n.id;
|
|
442
|
+
if (n.count === null) return /* @__PURE__ */ b("rect", {
|
|
443
|
+
x: r + o / 2,
|
|
444
|
+
y: D.height - 6,
|
|
445
|
+
width: a - o,
|
|
446
|
+
height: 5,
|
|
447
|
+
..._.props(k.missing)
|
|
448
|
+
}, n.id);
|
|
449
|
+
let c = L(n.count);
|
|
450
|
+
return /* @__PURE__ */ b("rect", {
|
|
451
|
+
x: r + o / 2,
|
|
452
|
+
y: c,
|
|
453
|
+
width: a - o,
|
|
454
|
+
height: D.height - c,
|
|
455
|
+
fill: e[O],
|
|
456
|
+
stroke: t[O],
|
|
457
|
+
..._.props(p.outlined, s && p.selected),
|
|
458
|
+
opacity: j?.selectedId === void 0 || s ? 1 : .45
|
|
459
|
+
}, n.id);
|
|
460
|
+
}), o = m.find((e) => e.id === v);
|
|
461
|
+
return /* @__PURE__ */ x(y, { children: [a, o !== void 0 && /* @__PURE__ */ b(n, {
|
|
462
|
+
x: (i(o.lowerBound) + i(o.upperBound)) / 2,
|
|
463
|
+
top: 0,
|
|
464
|
+
bottom: D.height - I,
|
|
465
|
+
width: i(o.upperBound) - i(o.lowerBound)
|
|
466
|
+
})] });
|
|
467
|
+
}
|
|
468
|
+
}), /* @__PURE__ */ b(r, {
|
|
469
|
+
label: `${o} observations`,
|
|
470
|
+
columns: [{
|
|
471
|
+
id: "observation",
|
|
472
|
+
label: "Observation"
|
|
473
|
+
}],
|
|
474
|
+
rows: N.map((e) => ({
|
|
475
|
+
id: e.id,
|
|
476
|
+
values: [e.label]
|
|
477
|
+
}))
|
|
478
|
+
})] })
|
|
479
|
+
})
|
|
457
480
|
});
|
|
458
481
|
}
|
|
459
|
-
function
|
|
460
|
-
let r =
|
|
482
|
+
function R({ bins: e, domain: t, maximumCount: n }) {
|
|
483
|
+
let r = T({
|
|
461
484
|
items: e,
|
|
462
485
|
domain: t,
|
|
463
|
-
maxEntries:
|
|
486
|
+
maxEntries: w.bins
|
|
464
487
|
});
|
|
465
488
|
if (r !== void 0) return r;
|
|
466
489
|
if (!Number.isFinite(n) || n <= 0) return "The histogram count domain must have a finite maximum greater than zero.";
|
|
467
490
|
for (let [r, i] of e.entries()) {
|
|
468
|
-
if (
|
|
491
|
+
if (E(i.lowerBound, t) || E(i.upperBound, t)) return `Histogram bin ${i.id} has a non-finite bound or lies outside the declared domain.`;
|
|
469
492
|
let a = e[r - 1];
|
|
470
493
|
if (i.lowerBound >= i.upperBound || a !== void 0 && i.lowerBound < a.upperBound) return `Histogram bin ${i.id} is reversed, overlaps another bin, or is out of order.`;
|
|
471
494
|
if (i.count !== null && (!Number.isFinite(i.count) || i.count < 0 || i.count > n)) return `Histogram bin ${i.id} has a count outside the declared count domain.`;
|
|
472
495
|
}
|
|
473
496
|
}
|
|
474
497
|
// packages/charts/src/distribution/interval-plot.tsx
|
|
475
|
-
function
|
|
476
|
-
let { ref:
|
|
498
|
+
function z({ title: t, report: n, description: r, items: i, domain: o, valueLabel: s, intervalLabel: l, formatValue: u, selection: f, emptyLabel: p = "No interval estimates are available." }) {
|
|
499
|
+
let { ref: v, width: y } = g(), C = B({
|
|
477
500
|
items: i,
|
|
478
|
-
domain:
|
|
501
|
+
domain: o
|
|
479
502
|
});
|
|
480
|
-
if (
|
|
503
|
+
if (C !== void 0) return /* @__PURE__ */ b(c, {
|
|
481
504
|
title: t,
|
|
482
505
|
report: n,
|
|
483
506
|
description: r,
|
|
484
|
-
message:
|
|
485
|
-
});
|
|
486
|
-
let S = g({
|
|
487
|
-
domain: [...s],
|
|
488
|
-
range: [0, b]
|
|
507
|
+
message: C
|
|
489
508
|
});
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
509
|
+
let w = S({
|
|
510
|
+
domain: [...o],
|
|
511
|
+
range: [0, y]
|
|
512
|
+
}), T = i.map((e) => {
|
|
513
|
+
let t = e.estimate === null ? "Estimate unavailable" : u(e.estimate), n = `${l}: ${e.lower === null ? "Unavailable" : u(e.lower)} – ${e.upper === null ? "Unavailable" : u(e.upper)}`;
|
|
514
|
+
return {
|
|
515
|
+
item: e,
|
|
516
|
+
estimate: t,
|
|
517
|
+
interval: n,
|
|
518
|
+
readout: `${e.label}, ${s}: ${t}, ${n}`
|
|
519
|
+
};
|
|
520
|
+
}), E = T.map((e) => ({
|
|
521
|
+
id: e.item.id,
|
|
522
|
+
label: e.readout
|
|
523
|
+
}));
|
|
524
|
+
return /* @__PURE__ */ b(d, {
|
|
525
|
+
items: E,
|
|
526
|
+
arrows: "both",
|
|
527
|
+
selected: f?.selectedId ?? null,
|
|
528
|
+
onSelect: f?.onSelect,
|
|
529
|
+
render: (c, d) => {
|
|
530
|
+
let g = f === void 0 ? void 0 : d;
|
|
531
|
+
return /* @__PURE__ */ b(a, {
|
|
532
|
+
figure: c,
|
|
533
|
+
title: t,
|
|
534
|
+
report: n,
|
|
535
|
+
description: r,
|
|
536
|
+
footer: `${s} · ${l}`,
|
|
537
|
+
children: i.length === 0 ? /* @__PURE__ */ b("p", {
|
|
538
|
+
..._.props(k.empty),
|
|
539
|
+
children: p
|
|
540
|
+
}) : /* @__PURE__ */ b(h, {
|
|
541
|
+
title: t,
|
|
542
|
+
items: E,
|
|
543
|
+
view: g,
|
|
544
|
+
children: /* @__PURE__ */ x("div", {
|
|
545
|
+
..._.props(k.values),
|
|
546
|
+
children: [T.map(({ item: t, estimate: n, interval: r, readout: i }) => {
|
|
547
|
+
let a = e[t.tone ?? "series1"];
|
|
548
|
+
return /* @__PURE__ */ b(m, {
|
|
549
|
+
id: t.id,
|
|
550
|
+
label: i,
|
|
551
|
+
view: g,
|
|
552
|
+
children: /* @__PURE__ */ x("span", {
|
|
553
|
+
..._.props(k.row),
|
|
554
|
+
children: [/* @__PURE__ */ x("span", {
|
|
555
|
+
..._.props(k.rowLabel),
|
|
556
|
+
children: [
|
|
557
|
+
/* @__PURE__ */ b("span", { children: t.label }),
|
|
558
|
+
/* @__PURE__ */ b("span", {
|
|
559
|
+
..._.props(k.rowValue),
|
|
560
|
+
children: n
|
|
561
|
+
}),
|
|
562
|
+
/* @__PURE__ */ b("span", {
|
|
563
|
+
..._.props(k.label),
|
|
564
|
+
children: r
|
|
565
|
+
})
|
|
566
|
+
]
|
|
567
|
+
}), /* @__PURE__ */ x("svg", {
|
|
568
|
+
"aria-hidden": !0,
|
|
569
|
+
viewBox: `0 0 ${y} 28`,
|
|
570
|
+
preserveAspectRatio: "none",
|
|
571
|
+
..._.props(k.rowSvg),
|
|
572
|
+
children: [
|
|
573
|
+
/* @__PURE__ */ b("line", {
|
|
574
|
+
x1: 0,
|
|
575
|
+
x2: y,
|
|
576
|
+
y1: 14,
|
|
577
|
+
y2: 14,
|
|
578
|
+
..._.props(k.baseline)
|
|
579
|
+
}),
|
|
580
|
+
t.lower !== null && t.upper !== null && /* @__PURE__ */ x("g", {
|
|
581
|
+
stroke: a,
|
|
582
|
+
strokeWidth: 2,
|
|
583
|
+
vectorEffect: "non-scaling-stroke",
|
|
584
|
+
children: [
|
|
585
|
+
/* @__PURE__ */ b("line", {
|
|
586
|
+
x1: w(t.lower),
|
|
587
|
+
x2: w(t.upper),
|
|
588
|
+
y1: 14,
|
|
589
|
+
y2: 14
|
|
590
|
+
}),
|
|
591
|
+
/* @__PURE__ */ b("line", {
|
|
592
|
+
x1: w(t.lower),
|
|
593
|
+
x2: w(t.lower),
|
|
594
|
+
y1: 9,
|
|
595
|
+
y2: 19
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ b("line", {
|
|
598
|
+
x1: w(t.upper),
|
|
599
|
+
x2: w(t.upper),
|
|
600
|
+
y1: 9,
|
|
601
|
+
y2: 19
|
|
602
|
+
})
|
|
603
|
+
]
|
|
604
|
+
}),
|
|
605
|
+
t.estimate !== null && /* @__PURE__ */ b("circle", {
|
|
606
|
+
cx: w(t.estimate),
|
|
607
|
+
cy: 14,
|
|
608
|
+
r: 4,
|
|
609
|
+
fill: a
|
|
610
|
+
})
|
|
611
|
+
]
|
|
612
|
+
})]
|
|
519
613
|
})
|
|
520
|
-
|
|
521
|
-
}), /* @__PURE__ */
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
x1: 0,
|
|
529
|
-
x2: b,
|
|
530
|
-
y1: 14,
|
|
531
|
-
y2: 14,
|
|
532
|
-
...f.props(C.baseline)
|
|
533
|
-
}),
|
|
534
|
-
t.lower !== null && t.upper !== null && /* @__PURE__ */ h("g", {
|
|
535
|
-
stroke: i,
|
|
536
|
-
strokeWidth: 2,
|
|
537
|
-
vectorEffect: "non-scaling-stroke",
|
|
538
|
-
children: [
|
|
539
|
-
/* @__PURE__ */ m("line", {
|
|
540
|
-
x1: S(t.lower),
|
|
541
|
-
x2: S(t.upper),
|
|
542
|
-
y1: 14,
|
|
543
|
-
y2: 14
|
|
544
|
-
}),
|
|
545
|
-
/* @__PURE__ */ m("line", {
|
|
546
|
-
x1: S(t.lower),
|
|
547
|
-
x2: S(t.lower),
|
|
548
|
-
y1: 9,
|
|
549
|
-
y2: 19
|
|
550
|
-
}),
|
|
551
|
-
/* @__PURE__ */ m("line", {
|
|
552
|
-
x1: S(t.upper),
|
|
553
|
-
x2: S(t.upper),
|
|
554
|
-
y1: 9,
|
|
555
|
-
y2: 19
|
|
556
|
-
})
|
|
557
|
-
]
|
|
558
|
-
}),
|
|
559
|
-
t.estimate !== null && /* @__PURE__ */ m("circle", {
|
|
560
|
-
cx: S(t.estimate),
|
|
561
|
-
cy: 14,
|
|
562
|
-
r: 4,
|
|
563
|
-
fill: i
|
|
614
|
+
}, t.id);
|
|
615
|
+
}), /* @__PURE__ */ x("div", {
|
|
616
|
+
..._.props(k.row, k.rowAxis),
|
|
617
|
+
children: [/* @__PURE__ */ b("span", { ..._.props(k.axisSpacer) }), /* @__PURE__ */ b("div", {
|
|
618
|
+
ref: v,
|
|
619
|
+
children: /* @__PURE__ */ b(j, {
|
|
620
|
+
domain: o,
|
|
621
|
+
formatValue: u
|
|
564
622
|
})
|
|
565
|
-
]
|
|
623
|
+
})]
|
|
566
624
|
})]
|
|
567
625
|
})
|
|
568
|
-
}
|
|
569
|
-
})
|
|
570
|
-
|
|
571
|
-
children: [/* @__PURE__ */ m("span", { ...f.props(C.axisSpacer) }), /* @__PURE__ */ m("div", {
|
|
572
|
-
ref: y,
|
|
573
|
-
children: /* @__PURE__ */ m(T, {
|
|
574
|
-
domain: s,
|
|
575
|
-
formatValue: p
|
|
576
|
-
})
|
|
577
|
-
})]
|
|
578
|
-
})]
|
|
579
|
-
})
|
|
626
|
+
})
|
|
627
|
+
});
|
|
628
|
+
}
|
|
580
629
|
});
|
|
581
630
|
}
|
|
582
|
-
function
|
|
583
|
-
let n =
|
|
631
|
+
function B({ items: e, domain: t }) {
|
|
632
|
+
let n = T({
|
|
584
633
|
items: e,
|
|
585
634
|
domain: t,
|
|
586
|
-
maxEntries:
|
|
635
|
+
maxEntries: w.rows
|
|
587
636
|
});
|
|
588
637
|
if (n !== void 0) return n;
|
|
589
638
|
for (let n of e) {
|
|
@@ -591,7 +640,7 @@ function j({ items: e, domain: t }) {
|
|
|
591
640
|
n.lower,
|
|
592
641
|
n.estimate,
|
|
593
642
|
n.upper
|
|
594
|
-
].some((e) => e !== null &&
|
|
643
|
+
].some((e) => e !== null && E(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
|
|
595
644
|
if (n.lower !== null && n.upper !== null && n.lower > n.upper) return `Interval ${n.id} has reversed endpoints.`;
|
|
596
645
|
if (n.estimate !== null) {
|
|
597
646
|
if (n.lower !== null && n.estimate < n.lower) return `Interval ${n.id} has an estimate below its lower endpoint.`;
|
|
@@ -600,105 +649,133 @@ function j({ items: e, domain: t }) {
|
|
|
600
649
|
}
|
|
601
650
|
}
|
|
602
651
|
// packages/charts/src/distribution/ranked-bars.tsx
|
|
603
|
-
function
|
|
604
|
-
let { ref: y, width:
|
|
605
|
-
items:
|
|
652
|
+
function V({ title: n, report: r, description: i, items: o, domain: s, valueLabel: l, formatValue: u, selection: f, emptyLabel: v = "No ranked values are available." }) {
|
|
653
|
+
let { ref: y, width: w } = g(), T = H({
|
|
654
|
+
items: o,
|
|
606
655
|
domain: s
|
|
607
656
|
});
|
|
608
|
-
if (
|
|
609
|
-
title:
|
|
610
|
-
report:
|
|
611
|
-
description:
|
|
612
|
-
message:
|
|
657
|
+
if (T !== void 0) return /* @__PURE__ */ b(c, {
|
|
658
|
+
title: n,
|
|
659
|
+
report: r,
|
|
660
|
+
description: i,
|
|
661
|
+
message: T
|
|
613
662
|
});
|
|
614
|
-
let
|
|
663
|
+
let E = S({
|
|
615
664
|
domain: [...s],
|
|
616
|
-
range: [0,
|
|
617
|
-
}),
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
665
|
+
range: [0, w]
|
|
666
|
+
}), D = E(0), O = o.map((e) => {
|
|
667
|
+
let t = e.value === null ? "Unavailable" : u(e.value), n = e.rank === void 0 ? e.label : `${e.rank} · ${e.label}`;
|
|
668
|
+
return {
|
|
669
|
+
item: e,
|
|
670
|
+
value: t,
|
|
671
|
+
label: n,
|
|
672
|
+
readout: `${n}, ${l}: ${t}`
|
|
673
|
+
};
|
|
674
|
+
}), A = O.map((e) => ({
|
|
675
|
+
id: e.item.id,
|
|
676
|
+
label: e.readout
|
|
677
|
+
}));
|
|
678
|
+
return /* @__PURE__ */ b(d, {
|
|
679
|
+
items: A,
|
|
680
|
+
arrows: "both",
|
|
681
|
+
selected: f?.selectedId ?? null,
|
|
682
|
+
onSelect: f?.onSelect,
|
|
683
|
+
render: (c, d) => {
|
|
684
|
+
let g = f === void 0 ? void 0 : d;
|
|
685
|
+
return /* @__PURE__ */ b(a, {
|
|
686
|
+
figure: c,
|
|
687
|
+
title: n,
|
|
688
|
+
report: r,
|
|
689
|
+
description: i,
|
|
690
|
+
footer: l,
|
|
691
|
+
children: o.length === 0 ? /* @__PURE__ */ b("p", {
|
|
692
|
+
..._.props(k.empty),
|
|
693
|
+
children: v
|
|
694
|
+
}) : /* @__PURE__ */ b(h, {
|
|
695
|
+
title: n,
|
|
696
|
+
items: A,
|
|
697
|
+
view: g,
|
|
698
|
+
children: /* @__PURE__ */ x("div", {
|
|
699
|
+
..._.props(k.values),
|
|
700
|
+
children: [O.map(({ item: n, value: r, label: i, readout: a }) => {
|
|
701
|
+
let o = n.tone ?? "series1", s = e[o];
|
|
702
|
+
return /* @__PURE__ */ b(m, {
|
|
703
|
+
id: n.id,
|
|
704
|
+
label: a,
|
|
705
|
+
view: g,
|
|
706
|
+
children: /* @__PURE__ */ x("span", {
|
|
707
|
+
..._.props(k.row),
|
|
708
|
+
children: [/* @__PURE__ */ x("span", {
|
|
709
|
+
..._.props(k.rowLabel),
|
|
710
|
+
children: [/* @__PURE__ */ b("span", { children: i }), /* @__PURE__ */ b("span", {
|
|
711
|
+
..._.props(k.rowValue),
|
|
712
|
+
children: r
|
|
713
|
+
})]
|
|
714
|
+
}), /* @__PURE__ */ x("svg", {
|
|
715
|
+
"aria-hidden": !0,
|
|
716
|
+
viewBox: `0 0 ${w} 28`,
|
|
717
|
+
preserveAspectRatio: "none",
|
|
718
|
+
..._.props(k.rowSvg),
|
|
719
|
+
children: [
|
|
720
|
+
/* @__PURE__ */ b("rect", {
|
|
721
|
+
x: 0,
|
|
722
|
+
y: 10,
|
|
723
|
+
width: w,
|
|
724
|
+
height: 8,
|
|
725
|
+
..._.props(k.track)
|
|
726
|
+
}),
|
|
727
|
+
/* @__PURE__ */ b("line", {
|
|
728
|
+
x1: D,
|
|
729
|
+
x2: D,
|
|
730
|
+
y1: 3,
|
|
731
|
+
y2: 25,
|
|
732
|
+
..._.props(k.baseline)
|
|
733
|
+
}),
|
|
734
|
+
n.value !== null && (n.value === 0 ? /* @__PURE__ */ b("line", {
|
|
735
|
+
x1: D,
|
|
736
|
+
x2: D,
|
|
737
|
+
y1: 10,
|
|
738
|
+
y2: 18,
|
|
739
|
+
stroke: s,
|
|
740
|
+
strokeWidth: 2,
|
|
741
|
+
vectorEffect: "non-scaling-stroke"
|
|
742
|
+
}) : /* @__PURE__ */ b(C, {
|
|
743
|
+
x: Math.min(D, E(n.value)),
|
|
744
|
+
y: 10,
|
|
745
|
+
width: Math.abs(E(n.value) - D),
|
|
746
|
+
height: 8,
|
|
747
|
+
fill: s,
|
|
748
|
+
stroke: t[o],
|
|
749
|
+
..._.props(p.outlined)
|
|
750
|
+
}))
|
|
751
|
+
]
|
|
752
|
+
})]
|
|
753
|
+
})
|
|
754
|
+
}, n.id);
|
|
755
|
+
}), /* @__PURE__ */ x("div", {
|
|
756
|
+
..._.props(k.row, k.rowAxis),
|
|
757
|
+
children: [/* @__PURE__ */ b("span", { ..._.props(k.axisSpacer) }), /* @__PURE__ */ b("div", {
|
|
758
|
+
ref: y,
|
|
759
|
+
children: /* @__PURE__ */ b(j, {
|
|
760
|
+
domain: s,
|
|
761
|
+
formatValue: u
|
|
762
|
+
})
|
|
641
763
|
})]
|
|
642
|
-
}), /* @__PURE__ */ h("svg", {
|
|
643
|
-
"aria-hidden": !0,
|
|
644
|
-
viewBox: `0 0 ${b} 28`,
|
|
645
|
-
preserveAspectRatio: "none",
|
|
646
|
-
...f.props(C.rowSvg),
|
|
647
|
-
children: [
|
|
648
|
-
/* @__PURE__ */ m("rect", {
|
|
649
|
-
x: 0,
|
|
650
|
-
y: 10,
|
|
651
|
-
width: b,
|
|
652
|
-
height: 8,
|
|
653
|
-
...f.props(C.track)
|
|
654
|
-
}),
|
|
655
|
-
/* @__PURE__ */ m("line", {
|
|
656
|
-
x1: w,
|
|
657
|
-
x2: w,
|
|
658
|
-
y1: 3,
|
|
659
|
-
y2: 25,
|
|
660
|
-
...f.props(C.baseline)
|
|
661
|
-
}),
|
|
662
|
-
t.value !== null && (t.value === 0 ? /* @__PURE__ */ m("line", {
|
|
663
|
-
x1: w,
|
|
664
|
-
x2: w,
|
|
665
|
-
y1: 10,
|
|
666
|
-
y2: 18,
|
|
667
|
-
stroke: i,
|
|
668
|
-
strokeWidth: 2,
|
|
669
|
-
vectorEffect: "non-scaling-stroke"
|
|
670
|
-
}) : /* @__PURE__ */ m(_, {
|
|
671
|
-
x: Math.min(w, S(t.value)),
|
|
672
|
-
y: 10,
|
|
673
|
-
width: Math.abs(S(t.value) - w),
|
|
674
|
-
height: 8,
|
|
675
|
-
fill: i
|
|
676
|
-
}))
|
|
677
|
-
]
|
|
678
764
|
})]
|
|
679
765
|
})
|
|
680
|
-
}
|
|
681
|
-
})
|
|
682
|
-
|
|
683
|
-
children: [/* @__PURE__ */ m("span", { ...f.props(C.axisSpacer) }), /* @__PURE__ */ m("div", {
|
|
684
|
-
ref: y,
|
|
685
|
-
children: /* @__PURE__ */ m(T, {
|
|
686
|
-
domain: s,
|
|
687
|
-
formatValue: u
|
|
688
|
-
})
|
|
689
|
-
})]
|
|
690
|
-
})]
|
|
691
|
-
})
|
|
766
|
+
})
|
|
767
|
+
});
|
|
768
|
+
}
|
|
692
769
|
});
|
|
693
770
|
}
|
|
694
|
-
function
|
|
695
|
-
let n =
|
|
771
|
+
function H({ items: e, domain: t }) {
|
|
772
|
+
let n = T({
|
|
696
773
|
items: e,
|
|
697
774
|
domain: t,
|
|
698
|
-
maxEntries:
|
|
775
|
+
maxEntries: w.rows
|
|
699
776
|
});
|
|
700
777
|
if (n !== void 0) return n;
|
|
701
778
|
if (t[0] > 0 || t[1] < 0) return "The ranked-value domain must include zero.";
|
|
702
|
-
for (let n of e) if (n.value !== null &&
|
|
779
|
+
for (let n of e) if (n.value !== null && E(n.value, t)) return `Ranked value ${n.id} is non-finite or lies outside the declared domain.`;
|
|
703
780
|
}
|
|
704
|
-
export {
|
|
781
|
+
export { P as ECDF, L as Histogram, z as IntervalPlot, V as RankedBars };
|