@mechane-ai/elements 0.39.0 → 0.41.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/NOTICE +11 -19
- package/README.md +49 -25
- package/dist/accessibility-P89UG9-r.js +25 -0
- package/dist/agent.js +1 -0
- package/dist/ai.js +50 -44
- package/dist/{categorical-values-BECG-J6R.js → categorical-values-DnGR_pQx.js} +3 -3
- package/dist/{chart-frame-CJFnI39T.js → chart-frame-BsyI1Zc8.js} +58 -57
- package/dist/{chart-input-DwAobO8Y.js → chart-input-r4S3-QCT.js} +2 -2
- package/dist/chart-navigation-D7OkLdSx.js +119 -0
- package/dist/charts/cartesian.js +560 -583
- package/dist/charts/distribution.js +218 -218
- package/dist/charts/graph.js +86 -85
- package/dist/charts/hierarchy.js +4 -4
- package/dist/charts/matrix.js +148 -147
- package/dist/charts/timeline.js +77 -76
- package/dist/charts.js +2 -2
- package/dist/code-block-C4K1sM9O.js +255 -0
- package/dist/collections.js +828 -607
- package/dist/constants.stylex-BILvnwUk.js +84 -0
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +184 -77
- package/dist/{content-link-B3ObdyZY.js → content-link-CBDqSvgP.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/control-styles-D3q_Qyxi.js +179 -0
- package/dist/csp.js +14 -1
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +359 -245
- package/dist/forms-I-WMHTkr.js +139 -0
- package/dist/forms.js +3 -3
- package/dist/index.js +1 -1
- package/dist/layout.js +271 -241
- package/dist/navigation/commands.js +87 -76
- package/dist/{navigation-D2_sGy3C.js → navigation-CveMIuXI.js} +1 -1
- package/dist/navigation.js +2 -2
- package/dist/overlays.js +1 -1
- package/dist/packages/ai/src/message-action.d.ts +1 -1
- package/dist/packages/charts/src/chart-navigation.d.ts +18 -2
- package/dist/packages/charts/src/chart-surface.d.ts +23 -0
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +3 -2
- package/dist/packages/collections/src/data-table.d.ts +7 -2
- package/dist/packages/collections/src/index.d.ts +4 -1
- package/dist/packages/collections/src/query-controls.d.ts +18 -0
- package/dist/packages/collections/src/table-query.d.ts +64 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +3 -8
- package/dist/packages/content/src/pierre-theme.d.ts +0 -1
- package/dist/packages/core/src/actions.d.ts +15 -13
- package/dist/packages/core/src/copy-value.d.ts +3 -2
- package/dist/packages/core/src/disclosure.d.ts +14 -11
- package/dist/packages/feedback/src/notifications.d.ts +15 -15
- package/dist/packages/feedback/src/toast.d.ts +9 -3
- package/dist/packages/forms/src/combobox.d.ts +31 -41
- package/dist/packages/forms/src/dates/event-month.d.ts +17 -0
- package/dist/packages/forms/src/dates/index.d.ts +2 -0
- package/dist/packages/forms/src/field-styles.d.ts +0 -19
- package/dist/packages/forms/src/form-controls.d.ts +26 -24
- package/dist/packages/forms/src/forms.d.ts +17 -14
- package/dist/packages/forms/src/select-control.d.ts +6 -4
- package/dist/packages/forms/src/select.d.ts +14 -18
- package/dist/packages/forms/src/selection-state.d.ts +11 -0
- package/dist/packages/forms/src/selection-styles.d.ts +3 -0
- package/dist/packages/forms/src/selection.d.ts +21 -19
- package/dist/packages/foundations/src/agent/index.d.ts +2 -0
- package/dist/packages/foundations/src/control-state.d.ts +2 -3
- package/dist/packages/foundations/src/control-styles.d.ts +19 -0
- package/dist/packages/foundations/src/csp/index.d.ts +1 -1
- package/dist/packages/foundations/src/csp/provider.d.ts +3 -0
- package/dist/packages/foundations/src/style-composition.d.ts +4 -1
- package/dist/packages/layout/src/app-shell.d.ts +12 -1
- package/dist/packages/layout/src/index.d.ts +1 -1
- package/dist/packages/layout/src/navigation-rail.d.ts +15 -2
- package/dist/packages/layout/src/resizable.d.ts +2 -2
- package/dist/packages/layout/src/sidebar.d.ts +4 -3
- package/dist/packages/navigation/src/tab-styles.d.ts +1 -1
- package/dist/packages/navigation/src/tabs.d.ts +12 -10
- package/dist/packages/overlays/src/alert-dialog.d.ts +19 -13
- package/dist/packages/overlays/src/dialog.d.ts +39 -24
- package/dist/packages/overlays/src/drawer.d.ts +16 -26
- package/dist/packages/overlays/src/menu.d.ts +37 -44
- package/dist/packages/overlays/src/overlay-root.d.ts +10 -0
- package/dist/packages/overlays/src/popover.d.ts +11 -20
- package/dist/packages/overlays/src/preview.d.ts +6 -13
- package/dist/packages/overlays/src/tooltip.d.ts +12 -15
- package/dist/{pierre-diff-CaPsfQRo.js → pierre-diff-DJ3oOfPX.js} +5 -5
- package/dist/{src-DPRmO-JY.js → src-CNV1ewzb.js} +379 -407
- package/dist/{src-CSWIG_op.js → src-CQQvXi7a.js} +58 -81
- package/dist/{src-DWjAoOyd.js → src-D2OHco8V.js} +42 -41
- package/dist/src-DfOAlAd2.js +750 -0
- package/dist/src-na2DdkKI.js +561 -0
- package/dist/{src-C-Sx37kz.js → src-s3tWwnN4.js} +361 -518
- package/dist/styles.js +3 -0
- package/dist/{elements.css → styles2.css} +195 -97
- package/dist/tokens.js +3 -1
- package/dist/{tokens.stylex-CJbIDPB9.js → tokens.stylex-dF5CACEJ.js} +13 -93
- package/package.json +8 -9
- package/skills/elements-workspace/SKILL.md +12 -0
- package/dist/accessibility-C-aIZ1Yx.js +0 -15
- package/dist/chart-navigation-CBIeNtJq.js +0 -67
- package/dist/code-block-aC0Htt4N.js +0 -184
- package/dist/forms-BQQFas9g.js +0 -118
- package/dist/foundations.css +0 -7
- package/dist/packages/content/src/tree/pierre-tree.d.ts +0 -3
- package/dist/pierre-theme-BpNaWn1x.js +0 -126
- package/dist/pierre-tree-CYCRjdGG.js +0 -106
- package/dist/src-d7EAi61b.js +0 -617
- package/dist/src-nkgFDl-g.js +0 -1171
- package/dist/style-composition-uYlczSsB.js +0 -9
- package/styles.css +0 -2
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { c as e } from "../src-
|
|
2
|
-
import {
|
|
3
|
-
import { i
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
6
|
-
import * as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { scaleLinear as
|
|
9
|
-
import { Bar as
|
|
1
|
+
import { c as e } from "../src-DfOAlAd2.js";
|
|
2
|
+
import { a as t, n, t as r } from "../chart-navigation-D7OkLdSx.js";
|
|
3
|
+
import { i, n as a, t as o } from "../chart-frame-BsyI1Zc8.js";
|
|
4
|
+
import { n as s, r as c, t as l } from "../chart-input-r4S3-QCT.js";
|
|
5
|
+
import { n as u, t as d } from "../plot-width-BQQS-mw9.js";
|
|
6
|
+
import * as f from "@stylexjs/stylex";
|
|
7
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
|
+
import { scaleLinear as g } from "@visx/scale";
|
|
9
|
+
import { Bar as _ } from "@visx/shape";
|
|
10
10
|
// packages/charts/src/distribution/distribution-input.ts
|
|
11
|
-
var
|
|
11
|
+
var v = {
|
|
12
12
|
bins: 200,
|
|
13
13
|
cumulativePoints: 2e3,
|
|
14
14
|
rows: 200
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
if (!
|
|
18
|
-
if (!
|
|
16
|
+
function y({ items: e, domain: t, maxEntries: n }) {
|
|
17
|
+
if (!c(t)) return "The chart domain must contain two finite, increasing values.";
|
|
18
|
+
if (!s(e)) return "Chart records must have unique identifiers.";
|
|
19
19
|
if (e.length > n) return `This chart supports at most ${n} records. Supply an explicit data window or aggregation.`;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function b(e, t) {
|
|
22
22
|
return !Number.isFinite(e) || e < t[0] || e > t[1];
|
|
23
23
|
}
|
|
24
24
|
// packages/charts/src/distribution/distribution-plot.tsx
|
|
25
|
-
var
|
|
25
|
+
var x = { height: 160 }, S = [
|
|
26
26
|
0,
|
|
27
27
|
.5,
|
|
28
28
|
1
|
|
29
|
-
],
|
|
29
|
+
], C = {
|
|
30
30
|
plot: {
|
|
31
31
|
k7Eaqz: "xeuugli",
|
|
32
32
|
k1xSpc: "xrvj5dj",
|
|
@@ -183,171 +183,171 @@ var b = { height: 160 }, x = [
|
|
|
183
183
|
$$css: !0
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
|
-
function
|
|
187
|
-
let { ref:
|
|
188
|
-
return /* @__PURE__ */
|
|
186
|
+
function w({ navigation: e, onInspectValue: t, xDomain: r, yDomain: i, xLabel: a, yLabel: o, formatX: s, formatY: c, children: l }) {
|
|
187
|
+
let { ref: u, width: f } = d(), p = S.map((e) => r[0] + e * (r[1] - r[0])), g = S.map((e) => i[1] - e * (i[1] - i[0]));
|
|
188
|
+
return /* @__PURE__ */ h("div", {
|
|
189
189
|
className: "xeuugli xrvj5dj x37z1gs x1hnptsi",
|
|
190
190
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ h("div", {
|
|
192
192
|
className: "x1osaytk x78zum5 x1qughib x1n8ia3y",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ m("span", {
|
|
194
194
|
className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
195
|
-
children:
|
|
196
|
-
}), /* @__PURE__ */
|
|
195
|
+
children: o
|
|
196
|
+
}), /* @__PURE__ */ m("span", {
|
|
197
197
|
className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
198
|
-
children:
|
|
198
|
+
children: a
|
|
199
199
|
})]
|
|
200
200
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ m("div", {
|
|
202
202
|
"aria-hidden": !0,
|
|
203
203
|
className: "x1ymw6g x78zum5 xdt5ytf x1qughib xp4054r x153jb6y xy8obcc xas2l8k xss6m8b x2aouup xj0a0fe",
|
|
204
|
-
children:
|
|
204
|
+
children: g.map((e) => /* @__PURE__ */ m("span", { children: c(e) }, e))
|
|
205
205
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
ref:
|
|
206
|
+
/* @__PURE__ */ m(n, {
|
|
207
|
+
ref: u,
|
|
208
208
|
...e,
|
|
209
209
|
className: "xeuugli",
|
|
210
|
-
children: /* @__PURE__ */
|
|
210
|
+
children: /* @__PURE__ */ h("svg", {
|
|
211
211
|
"aria-hidden": !0,
|
|
212
212
|
onPointerMove: (e) => {
|
|
213
|
-
let
|
|
214
|
-
t?.(
|
|
213
|
+
let n = e.currentTarget.getBoundingClientRect();
|
|
214
|
+
t?.(r[0] + (e.clientX - n.left) / n.width * (r[1] - r[0]));
|
|
215
215
|
},
|
|
216
216
|
onPointerDown: (e) => {
|
|
217
|
-
let
|
|
218
|
-
t?.(
|
|
217
|
+
let n = e.currentTarget.getBoundingClientRect();
|
|
218
|
+
t?.(r[0] + (e.clientX - n.left) / n.width * (r[1] - r[0]));
|
|
219
219
|
},
|
|
220
|
-
viewBox: `0 0 ${
|
|
220
|
+
viewBox: `0 0 ${f} ${x.height}`,
|
|
221
221
|
preserveAspectRatio: "none",
|
|
222
222
|
className: "x1lliihq xh8yej3 x1ymw6g xb3r6kr",
|
|
223
|
-
children: [
|
|
223
|
+
children: [S.map((e) => /* @__PURE__ */ m("line", {
|
|
224
224
|
x1: 0,
|
|
225
|
-
x2:
|
|
226
|
-
y1:
|
|
227
|
-
y2:
|
|
225
|
+
x2: f,
|
|
226
|
+
y1: x.height * e,
|
|
227
|
+
y2: x.height * e,
|
|
228
228
|
className: "x13hfdr1 x1ntoi03 x13efnbd"
|
|
229
|
-
}, e)),
|
|
229
|
+
}, e)), l(f)]
|
|
230
230
|
})
|
|
231
231
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ m("span", {}),
|
|
233
|
+
/* @__PURE__ */ m("div", {
|
|
234
234
|
"aria-hidden": !0,
|
|
235
235
|
className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xss6m8b",
|
|
236
|
-
children:
|
|
236
|
+
children: p.map((e, t) => /* @__PURE__ */ m("span", {
|
|
237
237
|
...{
|
|
238
238
|
0: { className: "x1cqoux5 xeuugli xj0a0fe" },
|
|
239
239
|
2: { className: "x1cqoux5 xeuugli xj0a0fe x2b8uid" },
|
|
240
240
|
1: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" },
|
|
241
241
|
3: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" }
|
|
242
242
|
}[(t === 1) << 1 | t === 2],
|
|
243
|
-
children:
|
|
243
|
+
children: s(e)
|
|
244
244
|
}, e))
|
|
245
245
|
})
|
|
246
246
|
]
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
return /* @__PURE__ */
|
|
249
|
+
function T({ domain: e, formatValue: t }) {
|
|
250
|
+
return /* @__PURE__ */ h("div", {
|
|
251
251
|
className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xss6m8b",
|
|
252
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ m("span", {
|
|
253
253
|
className: "x1cqoux5 xeuugli xj0a0fe",
|
|
254
254
|
children: t(e[0])
|
|
255
|
-
}), /* @__PURE__ */
|
|
255
|
+
}), /* @__PURE__ */ m("span", {
|
|
256
256
|
className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
|
|
257
257
|
children: t(e[1])
|
|
258
258
|
})]
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
261
|
// packages/charts/src/distribution/ecdf.tsx
|
|
262
|
-
function
|
|
263
|
-
let
|
|
262
|
+
function E({ title: n, report: o, description: s, points: c, domain: u, valueLabel: d, probabilityLabel: _, formatValue: v, formatProbability: y, tone: b = "series1", selection: S, emptyLabel: T = "No cumulative distribution points are available." }) {
|
|
263
|
+
let E = c.map((e) => ({
|
|
264
264
|
id: e.id,
|
|
265
|
-
label: `${
|
|
266
|
-
})), O =
|
|
267
|
-
title:
|
|
268
|
-
items:
|
|
269
|
-
selection:
|
|
270
|
-
}), k =
|
|
271
|
-
points:
|
|
265
|
+
label: `${d}: ${v(e.value)}, ${_}: ${e.probability === null ? "Unavailable" : y(e.probability)}`
|
|
266
|
+
})), O = r({
|
|
267
|
+
title: n,
|
|
268
|
+
items: E,
|
|
269
|
+
selection: S
|
|
270
|
+
}), k = D({
|
|
271
|
+
points: c,
|
|
272
272
|
domain: u
|
|
273
273
|
});
|
|
274
|
-
if (k !== void 0) return /* @__PURE__ */
|
|
275
|
-
title:
|
|
274
|
+
if (k !== void 0) return /* @__PURE__ */ m(l, {
|
|
275
|
+
title: n,
|
|
276
276
|
report: o,
|
|
277
277
|
description: s,
|
|
278
278
|
message: k
|
|
279
279
|
});
|
|
280
|
-
let A =
|
|
280
|
+
let A = g({
|
|
281
281
|
domain: [0, 1],
|
|
282
|
-
range: [
|
|
282
|
+
range: [x.height, 0]
|
|
283
283
|
});
|
|
284
|
-
return /* @__PURE__ */
|
|
285
|
-
title:
|
|
284
|
+
return /* @__PURE__ */ m(a, {
|
|
285
|
+
title: n,
|
|
286
286
|
report: o,
|
|
287
287
|
description: s,
|
|
288
|
-
footer: /* @__PURE__ */
|
|
288
|
+
footer: /* @__PURE__ */ m(i, {
|
|
289
289
|
id: O.id,
|
|
290
290
|
children: O.label ?? "\xA0"
|
|
291
291
|
}),
|
|
292
|
-
children:
|
|
293
|
-
...
|
|
292
|
+
children: c.length === 0 ? /* @__PURE__ */ m("p", {
|
|
293
|
+
...f.props(C.empty),
|
|
294
294
|
children: T
|
|
295
|
-
}) : /* @__PURE__ */
|
|
295
|
+
}) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(w, {
|
|
296
296
|
navigation: O.props,
|
|
297
297
|
onInspectValue: (e) => {
|
|
298
|
-
let t = { point:
|
|
299
|
-
for (let n of
|
|
298
|
+
let t = { point: c[0] };
|
|
299
|
+
for (let n of c) (t.point === void 0 || Math.abs(n.value - e) < Math.abs(t.point.value - e)) && (t.point = n);
|
|
300
300
|
let n = t.point;
|
|
301
301
|
n !== void 0 && O.inspect(n.id);
|
|
302
302
|
},
|
|
303
303
|
xDomain: u,
|
|
304
304
|
yDomain: [0, 1],
|
|
305
|
-
xLabel:
|
|
305
|
+
xLabel: d,
|
|
306
306
|
yLabel: _,
|
|
307
307
|
formatX: v,
|
|
308
308
|
formatY: y,
|
|
309
309
|
children: (t) => {
|
|
310
|
-
let n =
|
|
310
|
+
let n = g({
|
|
311
311
|
domain: [...u],
|
|
312
312
|
range: [0, t]
|
|
313
|
-
}), r =
|
|
313
|
+
}), r = c.map((e, t) => {
|
|
314
314
|
if (e.probability === null) return "";
|
|
315
|
-
let r = n(e.value), i = A(e.probability), a =
|
|
315
|
+
let r = n(e.value), i = A(e.probability), a = c[t - 1];
|
|
316
316
|
return a === void 0 || a.probability === null ? `M ${r} ${i}` : `H ${r} V ${i}`;
|
|
317
317
|
}).join(" ");
|
|
318
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("path", {
|
|
319
319
|
d: r,
|
|
320
320
|
fill: "none",
|
|
321
|
-
stroke: e[
|
|
321
|
+
stroke: e[b],
|
|
322
322
|
strokeWidth: 2,
|
|
323
323
|
vectorEffect: "non-scaling-stroke"
|
|
324
|
-
}),
|
|
324
|
+
}), c.map((t) => t.probability === null ? null : /* @__PURE__ */ m("circle", {
|
|
325
325
|
onPointerEnter: () => O.inspect(t.id),
|
|
326
|
-
onClick: () =>
|
|
326
|
+
onClick: () => S?.onSelect(t.id),
|
|
327
327
|
cx: n(t.value),
|
|
328
328
|
cy: A(t.probability),
|
|
329
|
-
r:
|
|
330
|
-
fill: e[
|
|
329
|
+
r: S?.selectedId === t.id || O.label !== void 0 && O.activeId === t.id ? 4 : 2,
|
|
330
|
+
fill: e[b]
|
|
331
331
|
}, t.id))] });
|
|
332
332
|
}
|
|
333
|
-
}), /* @__PURE__ */
|
|
334
|
-
label: `${
|
|
333
|
+
}), /* @__PURE__ */ m(t, {
|
|
334
|
+
label: `${n} observations`,
|
|
335
335
|
columns: [{
|
|
336
336
|
id: "observation",
|
|
337
337
|
label: "Observation"
|
|
338
338
|
}],
|
|
339
|
-
rows:
|
|
339
|
+
rows: E.map((e) => ({
|
|
340
340
|
id: e.id,
|
|
341
341
|
values: [e.label]
|
|
342
342
|
}))
|
|
343
343
|
})] })
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
let n =
|
|
346
|
+
function D({ points: e, domain: t }) {
|
|
347
|
+
let n = y({
|
|
348
348
|
items: e,
|
|
349
349
|
domain: t,
|
|
350
|
-
maxEntries:
|
|
350
|
+
maxEntries: v.cumulativePoints
|
|
351
351
|
});
|
|
352
352
|
if (n !== void 0) return n;
|
|
353
353
|
let r = {
|
|
@@ -355,7 +355,7 @@ function E({ points: e, domain: t }) {
|
|
|
355
355
|
probability: 0
|
|
356
356
|
};
|
|
357
357
|
for (let n of e) {
|
|
358
|
-
if (
|
|
358
|
+
if (b(n.value, t) || n.value < r.value) return `Cumulative point ${n.id} is non-finite, outside the domain, or out of order.`;
|
|
359
359
|
if (n.probability !== null) {
|
|
360
360
|
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.`;
|
|
361
361
|
r.probability = n.probability;
|
|
@@ -364,84 +364,84 @@ function E({ points: e, domain: t }) {
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
// packages/charts/src/distribution/histogram.tsx
|
|
367
|
-
function
|
|
368
|
-
let A =
|
|
367
|
+
function O({ title: n, report: o, description: s, bins: c, domain: d, maximumCount: v, valueLabel: y, countLabel: b, formatValue: S, formatCount: T, tone: E = "series1", selection: D, emptyLabel: O = "No histogram bins are available." }) {
|
|
368
|
+
let A = c.map((e) => ({
|
|
369
369
|
id: e.id,
|
|
370
|
-
label: `${e.label}, ${
|
|
371
|
-
})), j =
|
|
372
|
-
title:
|
|
370
|
+
label: `${e.label}, ${S(e.lowerBound)} – ${S(e.upperBound)}, ${b}: ${e.count === null ? "Unavailable" : T(e.count)}`
|
|
371
|
+
})), j = r({
|
|
372
|
+
title: n,
|
|
373
373
|
items: A,
|
|
374
374
|
selection: D
|
|
375
|
-
}), M =
|
|
376
|
-
bins:
|
|
377
|
-
domain:
|
|
375
|
+
}), M = k({
|
|
376
|
+
bins: c,
|
|
377
|
+
domain: d,
|
|
378
378
|
maximumCount: v
|
|
379
379
|
});
|
|
380
|
-
if (M !== void 0) return /* @__PURE__ */
|
|
381
|
-
title:
|
|
380
|
+
if (M !== void 0) return /* @__PURE__ */ m(l, {
|
|
381
|
+
title: n,
|
|
382
382
|
report: o,
|
|
383
383
|
description: s,
|
|
384
384
|
message: M
|
|
385
385
|
});
|
|
386
|
-
let N =
|
|
386
|
+
let N = g({
|
|
387
387
|
domain: [0, v],
|
|
388
|
-
range: [
|
|
388
|
+
range: [x.height, 0]
|
|
389
389
|
});
|
|
390
|
-
return /* @__PURE__ */
|
|
391
|
-
title:
|
|
390
|
+
return /* @__PURE__ */ m(a, {
|
|
391
|
+
title: n,
|
|
392
392
|
report: o,
|
|
393
393
|
description: s,
|
|
394
|
-
footer: /* @__PURE__ */
|
|
394
|
+
footer: /* @__PURE__ */ m(i, {
|
|
395
395
|
id: j.id,
|
|
396
396
|
children: j.label ?? "\xA0"
|
|
397
397
|
}),
|
|
398
|
-
children:
|
|
399
|
-
...
|
|
400
|
-
children:
|
|
401
|
-
}) : /* @__PURE__ */
|
|
398
|
+
children: c.length === 0 ? /* @__PURE__ */ m("p", {
|
|
399
|
+
...f.props(C.empty),
|
|
400
|
+
children: O
|
|
401
|
+
}) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(w, {
|
|
402
402
|
navigation: j.props,
|
|
403
403
|
onInspectValue: (e) => {
|
|
404
|
-
let t =
|
|
404
|
+
let t = c.find((t) => e >= t.lowerBound && e <= t.upperBound);
|
|
405
405
|
t !== void 0 && j.inspect(t.id);
|
|
406
406
|
},
|
|
407
|
-
xDomain:
|
|
407
|
+
xDomain: d,
|
|
408
408
|
yDomain: [0, v],
|
|
409
409
|
xLabel: y,
|
|
410
|
-
yLabel:
|
|
411
|
-
formatX:
|
|
410
|
+
yLabel: b,
|
|
411
|
+
formatX: S,
|
|
412
412
|
formatY: T,
|
|
413
413
|
children: (t) => {
|
|
414
|
-
let n =
|
|
415
|
-
domain: [...
|
|
414
|
+
let n = g({
|
|
415
|
+
domain: [...d],
|
|
416
416
|
range: [0, t]
|
|
417
417
|
});
|
|
418
|
-
return
|
|
418
|
+
return c.map((t) => {
|
|
419
419
|
let r = n(t.lowerBound), i = n(t.upperBound) - r, a = Math.min(2, i * .2), o = D?.selectedId === t.id || j.label !== void 0 && j.activeId === t.id;
|
|
420
|
-
if (t.count === null) return /* @__PURE__ */
|
|
420
|
+
if (t.count === null) return /* @__PURE__ */ m(_, {
|
|
421
421
|
onPointerEnter: () => j.inspect(t.id),
|
|
422
422
|
onClick: () => D?.onSelect(t.id),
|
|
423
423
|
x: r + a / 2,
|
|
424
|
-
y:
|
|
424
|
+
y: x.height - 6,
|
|
425
425
|
width: i - a,
|
|
426
426
|
height: 5,
|
|
427
|
-
...
|
|
427
|
+
...f.props(C.missing)
|
|
428
428
|
}, t.id);
|
|
429
429
|
let s = N(t.count);
|
|
430
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ m(_, {
|
|
431
431
|
onPointerEnter: () => j.inspect(t.id),
|
|
432
432
|
onClick: () => D?.onSelect(t.id),
|
|
433
433
|
x: r + a / 2,
|
|
434
434
|
y: s,
|
|
435
435
|
width: i - a,
|
|
436
|
-
height:
|
|
436
|
+
height: x.height - s,
|
|
437
437
|
fill: e[E],
|
|
438
|
-
...
|
|
438
|
+
...f.props(o && u.selected),
|
|
439
439
|
opacity: D?.selectedId === void 0 || o ? 1 : .45
|
|
440
440
|
}, t.id);
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
|
-
}), /* @__PURE__ */
|
|
444
|
-
label: `${
|
|
443
|
+
}), /* @__PURE__ */ m(t, {
|
|
444
|
+
label: `${n} observations`,
|
|
445
445
|
columns: [{
|
|
446
446
|
id: "observation",
|
|
447
447
|
label: "Observation"
|
|
@@ -453,108 +453,108 @@ function D({ title: a, report: o, description: s, bins: u, domain: _, maximumCou
|
|
|
453
453
|
})] })
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
|
-
function
|
|
457
|
-
let r =
|
|
456
|
+
function k({ bins: e, domain: t, maximumCount: n }) {
|
|
457
|
+
let r = y({
|
|
458
458
|
items: e,
|
|
459
459
|
domain: t,
|
|
460
|
-
maxEntries:
|
|
460
|
+
maxEntries: v.bins
|
|
461
461
|
});
|
|
462
462
|
if (r !== void 0) return r;
|
|
463
463
|
if (!Number.isFinite(n) || n <= 0) return "The histogram count domain must have a finite maximum greater than zero.";
|
|
464
464
|
for (let [r, i] of e.entries()) {
|
|
465
|
-
if (
|
|
465
|
+
if (b(i.lowerBound, t) || b(i.upperBound, t)) return `Histogram bin ${i.id} has a non-finite bound or lies outside the declared domain.`;
|
|
466
466
|
let a = e[r - 1];
|
|
467
467
|
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.`;
|
|
468
468
|
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.`;
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
// packages/charts/src/distribution/interval-plot.tsx
|
|
472
|
-
function
|
|
473
|
-
let { ref: y, width: b } =
|
|
474
|
-
items:
|
|
472
|
+
function A({ title: t, report: n, description: r, items: i, domain: s, valueLabel: c, intervalLabel: u, formatValue: p, selection: _, emptyLabel: v = "No interval estimates are available." }) {
|
|
473
|
+
let { ref: y, width: b } = d(), x = j({
|
|
474
|
+
items: i,
|
|
475
475
|
domain: s
|
|
476
476
|
});
|
|
477
|
-
if (x !== void 0) return /* @__PURE__ */
|
|
477
|
+
if (x !== void 0) return /* @__PURE__ */ m(l, {
|
|
478
478
|
title: t,
|
|
479
479
|
report: n,
|
|
480
480
|
description: r,
|
|
481
481
|
message: x
|
|
482
482
|
});
|
|
483
|
-
let
|
|
483
|
+
let S = g({
|
|
484
484
|
domain: [...s],
|
|
485
485
|
range: [0, b]
|
|
486
486
|
});
|
|
487
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ m(a, {
|
|
488
488
|
title: t,
|
|
489
489
|
report: n,
|
|
490
490
|
description: r,
|
|
491
|
-
footer: `${
|
|
492
|
-
children:
|
|
493
|
-
...
|
|
491
|
+
footer: `${c} · ${u}`,
|
|
492
|
+
children: i.length === 0 ? /* @__PURE__ */ m("p", {
|
|
493
|
+
...f.props(C.empty),
|
|
494
494
|
children: v
|
|
495
|
-
}) : /* @__PURE__ */
|
|
496
|
-
...
|
|
497
|
-
children: [
|
|
498
|
-
let n = t.estimate === null ? "Estimate unavailable" :
|
|
499
|
-
return /* @__PURE__ */
|
|
500
|
-
label: `${t.label}, ${
|
|
495
|
+
}) : /* @__PURE__ */ h("div", {
|
|
496
|
+
...f.props(C.values),
|
|
497
|
+
children: [i.map((t) => {
|
|
498
|
+
let n = t.estimate === null ? "Estimate unavailable" : p(t.estimate), r = `${u}: ${t.lower === null ? "Unavailable" : p(t.lower)} – ${t.upper === null ? "Unavailable" : p(t.upper)}`, i = e[t.tone ?? "series1"];
|
|
499
|
+
return /* @__PURE__ */ m(o, {
|
|
500
|
+
label: `${t.label}, ${c}: ${n}, ${r}`,
|
|
501
501
|
isSelected: _?.selectedId === t.id,
|
|
502
502
|
onSelect: _ === void 0 ? void 0 : () => _.onSelect(t.id),
|
|
503
|
-
children: /* @__PURE__ */
|
|
504
|
-
...
|
|
505
|
-
children: [/* @__PURE__ */
|
|
506
|
-
...
|
|
503
|
+
children: /* @__PURE__ */ h("span", {
|
|
504
|
+
...f.props(C.row),
|
|
505
|
+
children: [/* @__PURE__ */ h("span", {
|
|
506
|
+
...f.props(C.rowLabel),
|
|
507
507
|
children: [
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
...
|
|
508
|
+
/* @__PURE__ */ m("span", { children: t.label }),
|
|
509
|
+
/* @__PURE__ */ m("span", {
|
|
510
|
+
...f.props(C.rowValue),
|
|
511
511
|
children: n
|
|
512
512
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
...
|
|
513
|
+
/* @__PURE__ */ m("span", {
|
|
514
|
+
...f.props(C.label),
|
|
515
515
|
children: r
|
|
516
516
|
})
|
|
517
517
|
]
|
|
518
|
-
}), /* @__PURE__ */
|
|
518
|
+
}), /* @__PURE__ */ h("svg", {
|
|
519
519
|
"aria-hidden": !0,
|
|
520
520
|
viewBox: `0 0 ${b} 28`,
|
|
521
521
|
preserveAspectRatio: "none",
|
|
522
|
-
...
|
|
522
|
+
...f.props(C.rowSvg),
|
|
523
523
|
children: [
|
|
524
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ m("line", {
|
|
525
525
|
x1: 0,
|
|
526
526
|
x2: b,
|
|
527
527
|
y1: 14,
|
|
528
528
|
y2: 14,
|
|
529
|
-
...
|
|
529
|
+
...f.props(C.baseline)
|
|
530
530
|
}),
|
|
531
|
-
t.lower !== null && t.upper !== null && /* @__PURE__ */
|
|
531
|
+
t.lower !== null && t.upper !== null && /* @__PURE__ */ h("g", {
|
|
532
532
|
stroke: i,
|
|
533
533
|
strokeWidth: 2,
|
|
534
534
|
vectorEffect: "non-scaling-stroke",
|
|
535
535
|
children: [
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
-
x1:
|
|
538
|
-
x2:
|
|
536
|
+
/* @__PURE__ */ m("line", {
|
|
537
|
+
x1: S(t.lower),
|
|
538
|
+
x2: S(t.upper),
|
|
539
539
|
y1: 14,
|
|
540
540
|
y2: 14
|
|
541
541
|
}),
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
x1:
|
|
544
|
-
x2:
|
|
542
|
+
/* @__PURE__ */ m("line", {
|
|
543
|
+
x1: S(t.lower),
|
|
544
|
+
x2: S(t.lower),
|
|
545
545
|
y1: 9,
|
|
546
546
|
y2: 19
|
|
547
547
|
}),
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
x1:
|
|
550
|
-
x2:
|
|
548
|
+
/* @__PURE__ */ m("line", {
|
|
549
|
+
x1: S(t.upper),
|
|
550
|
+
x2: S(t.upper),
|
|
551
551
|
y1: 9,
|
|
552
552
|
y2: 19
|
|
553
553
|
})
|
|
554
554
|
]
|
|
555
555
|
}),
|
|
556
|
-
t.estimate !== null && /* @__PURE__ */
|
|
557
|
-
cx:
|
|
556
|
+
t.estimate !== null && /* @__PURE__ */ m("circle", {
|
|
557
|
+
cx: S(t.estimate),
|
|
558
558
|
cy: 14,
|
|
559
559
|
r: 4,
|
|
560
560
|
fill: i
|
|
@@ -563,24 +563,24 @@ function k({ title: t, report: n, description: r, items: o, domain: s, valueLabe
|
|
|
563
563
|
})]
|
|
564
564
|
})
|
|
565
565
|
}, t.id);
|
|
566
|
-
}), /* @__PURE__ */
|
|
567
|
-
...
|
|
568
|
-
children: [/* @__PURE__ */
|
|
566
|
+
}), /* @__PURE__ */ h("div", {
|
|
567
|
+
...f.props(C.row, C.rowAxis),
|
|
568
|
+
children: [/* @__PURE__ */ m("span", { ...f.props(C.axisSpacer) }), /* @__PURE__ */ m("div", {
|
|
569
569
|
ref: y,
|
|
570
|
-
children: /* @__PURE__ */
|
|
570
|
+
children: /* @__PURE__ */ m(T, {
|
|
571
571
|
domain: s,
|
|
572
|
-
formatValue:
|
|
572
|
+
formatValue: p
|
|
573
573
|
})
|
|
574
574
|
})]
|
|
575
575
|
})]
|
|
576
576
|
})
|
|
577
577
|
});
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
let n =
|
|
579
|
+
function j({ items: e, domain: t }) {
|
|
580
|
+
let n = y({
|
|
581
581
|
items: e,
|
|
582
582
|
domain: t,
|
|
583
|
-
maxEntries:
|
|
583
|
+
maxEntries: v.rows
|
|
584
584
|
});
|
|
585
585
|
if (n !== void 0) return n;
|
|
586
586
|
for (let n of e) {
|
|
@@ -588,7 +588,7 @@ function A({ items: e, domain: t }) {
|
|
|
588
588
|
n.lower,
|
|
589
589
|
n.estimate,
|
|
590
590
|
n.upper
|
|
591
|
-
].some((e) => e !== null &&
|
|
591
|
+
].some((e) => e !== null && b(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
|
|
592
592
|
if (n.lower !== null && n.upper !== null && n.lower > n.upper) return `Interval ${n.id} has reversed endpoints.`;
|
|
593
593
|
if (n.estimate !== null) {
|
|
594
594
|
if (n.lower !== null && n.estimate < n.lower) return `Interval ${n.id} has an estimate below its lower endpoint.`;
|
|
@@ -597,95 +597,95 @@ function A({ items: e, domain: t }) {
|
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
// packages/charts/src/distribution/ranked-bars.tsx
|
|
600
|
-
function
|
|
601
|
-
let { ref: y, width: b } =
|
|
602
|
-
items:
|
|
600
|
+
function M({ title: t, report: n, description: r, items: i, domain: s, valueLabel: c, formatValue: u, selection: p, emptyLabel: v = "No ranked values are available." }) {
|
|
601
|
+
let { ref: y, width: b } = d(), x = N({
|
|
602
|
+
items: i,
|
|
603
603
|
domain: s
|
|
604
604
|
});
|
|
605
|
-
if (x !== void 0) return /* @__PURE__ */
|
|
605
|
+
if (x !== void 0) return /* @__PURE__ */ m(l, {
|
|
606
606
|
title: t,
|
|
607
607
|
report: n,
|
|
608
608
|
description: r,
|
|
609
609
|
message: x
|
|
610
610
|
});
|
|
611
|
-
let
|
|
611
|
+
let S = g({
|
|
612
612
|
domain: [...s],
|
|
613
613
|
range: [0, b]
|
|
614
|
-
}),
|
|
615
|
-
return /* @__PURE__ */
|
|
614
|
+
}), w = S(0);
|
|
615
|
+
return /* @__PURE__ */ m(a, {
|
|
616
616
|
title: t,
|
|
617
617
|
report: n,
|
|
618
618
|
description: r,
|
|
619
|
-
footer:
|
|
620
|
-
children:
|
|
621
|
-
...
|
|
619
|
+
footer: c,
|
|
620
|
+
children: i.length === 0 ? /* @__PURE__ */ m("p", {
|
|
621
|
+
...f.props(C.empty),
|
|
622
622
|
children: v
|
|
623
|
-
}) : /* @__PURE__ */
|
|
624
|
-
...
|
|
625
|
-
children: [
|
|
626
|
-
let n = t.value === null ? "Unavailable" :
|
|
627
|
-
return /* @__PURE__ */
|
|
628
|
-
label: `${r}, ${
|
|
629
|
-
isSelected:
|
|
630
|
-
onSelect:
|
|
631
|
-
children: /* @__PURE__ */
|
|
632
|
-
...
|
|
633
|
-
children: [/* @__PURE__ */
|
|
634
|
-
...
|
|
635
|
-
children: [/* @__PURE__ */
|
|
636
|
-
...
|
|
623
|
+
}) : /* @__PURE__ */ h("div", {
|
|
624
|
+
...f.props(C.values),
|
|
625
|
+
children: [i.map((t) => {
|
|
626
|
+
let n = t.value === null ? "Unavailable" : u(t.value), r = t.rank === void 0 ? t.label : `${t.rank} · ${t.label}`, i = e[t.tone ?? "series1"];
|
|
627
|
+
return /* @__PURE__ */ m(o, {
|
|
628
|
+
label: `${r}, ${c}: ${n}`,
|
|
629
|
+
isSelected: p?.selectedId === t.id,
|
|
630
|
+
onSelect: p === void 0 ? void 0 : () => p.onSelect(t.id),
|
|
631
|
+
children: /* @__PURE__ */ h("span", {
|
|
632
|
+
...f.props(C.row),
|
|
633
|
+
children: [/* @__PURE__ */ h("span", {
|
|
634
|
+
...f.props(C.rowLabel),
|
|
635
|
+
children: [/* @__PURE__ */ m("span", { children: r }), /* @__PURE__ */ m("span", {
|
|
636
|
+
...f.props(C.rowValue),
|
|
637
637
|
children: n
|
|
638
638
|
})]
|
|
639
|
-
}), /* @__PURE__ */
|
|
639
|
+
}), /* @__PURE__ */ h("svg", {
|
|
640
640
|
"aria-hidden": !0,
|
|
641
641
|
viewBox: `0 0 ${b} 28`,
|
|
642
642
|
preserveAspectRatio: "none",
|
|
643
|
-
...
|
|
644
|
-
children: [/* @__PURE__ */
|
|
645
|
-
x1:
|
|
646
|
-
x2:
|
|
643
|
+
...f.props(C.rowSvg),
|
|
644
|
+
children: [/* @__PURE__ */ m("line", {
|
|
645
|
+
x1: w,
|
|
646
|
+
x2: w,
|
|
647
647
|
y1: 3,
|
|
648
648
|
y2: 25,
|
|
649
|
-
...
|
|
650
|
-
}), t.value !== null && (t.value === 0 ? /* @__PURE__ */
|
|
651
|
-
x1:
|
|
652
|
-
x2:
|
|
649
|
+
...f.props(C.baseline)
|
|
650
|
+
}), t.value !== null && (t.value === 0 ? /* @__PURE__ */ m("line", {
|
|
651
|
+
x1: w,
|
|
652
|
+
x2: w,
|
|
653
653
|
y1: 10,
|
|
654
654
|
y2: 18,
|
|
655
655
|
stroke: i,
|
|
656
656
|
strokeWidth: 2,
|
|
657
657
|
vectorEffect: "non-scaling-stroke"
|
|
658
|
-
}) : /* @__PURE__ */
|
|
659
|
-
x: Math.min(
|
|
658
|
+
}) : /* @__PURE__ */ m(_, {
|
|
659
|
+
x: Math.min(w, S(t.value)),
|
|
660
660
|
y: 10,
|
|
661
|
-
width: Math.abs(
|
|
661
|
+
width: Math.abs(S(t.value) - w),
|
|
662
662
|
height: 8,
|
|
663
663
|
fill: i
|
|
664
664
|
}))]
|
|
665
665
|
})]
|
|
666
666
|
})
|
|
667
667
|
}, t.id);
|
|
668
|
-
}), /* @__PURE__ */
|
|
669
|
-
...
|
|
670
|
-
children: [/* @__PURE__ */
|
|
668
|
+
}), /* @__PURE__ */ h("div", {
|
|
669
|
+
...f.props(C.row, C.rowAxis),
|
|
670
|
+
children: [/* @__PURE__ */ m("span", { ...f.props(C.axisSpacer) }), /* @__PURE__ */ m("div", {
|
|
671
671
|
ref: y,
|
|
672
|
-
children: /* @__PURE__ */
|
|
672
|
+
children: /* @__PURE__ */ m(T, {
|
|
673
673
|
domain: s,
|
|
674
|
-
formatValue:
|
|
674
|
+
formatValue: u
|
|
675
675
|
})
|
|
676
676
|
})]
|
|
677
677
|
})]
|
|
678
678
|
})
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
|
-
function
|
|
682
|
-
let n =
|
|
681
|
+
function N({ items: e, domain: t }) {
|
|
682
|
+
let n = y({
|
|
683
683
|
items: e,
|
|
684
684
|
domain: t,
|
|
685
|
-
maxEntries:
|
|
685
|
+
maxEntries: v.rows
|
|
686
686
|
});
|
|
687
687
|
if (n !== void 0) return n;
|
|
688
688
|
if (t[0] > 0 || t[1] < 0) return "The ranked-value domain must include zero.";
|
|
689
|
-
for (let n of e) if (n.value !== null &&
|
|
689
|
+
for (let n of e) if (n.value !== null && b(n.value, t)) return `Ranked value ${n.id} is non-finite or lies outside the declared domain.`;
|
|
690
690
|
}
|
|
691
|
-
export {
|
|
691
|
+
export { E as ECDF, O as Histogram, A as IntervalPlot, M as RankedBars };
|