@mechane-ai/elements 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.js +4 -4
- package/dist/chart-frame-C0UBu4ku.js +213 -0
- package/dist/{chart-input-CN8PMrni.js → chart-input-Ccr2NJ6J.js} +2 -2
- package/dist/{categorical-values-DpnNvPkc.js → chart-theme-Bwr9YSP1.js} +56 -5
- package/dist/charts/cartesian.js +617 -623
- package/dist/charts/distribution.js +77 -76
- package/dist/charts/graph.js +29 -28
- package/dist/charts/hierarchy.js +32 -31
- package/dist/charts/matrix.js +48 -47
- package/dist/charts/timeline.js +2 -2
- package/dist/charts.js +3 -1
- package/dist/collections.js +314 -267
- package/dist/elements.css +14 -0
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +86 -63
- package/dist/forms.js +2 -2
- package/dist/packages/charts/src/cartesian/bar-data.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +1 -1
- package/dist/packages/charts/src/categorical-values.d.ts +1 -1
- package/dist/packages/charts/src/chart-series-marker.d.ts +7 -0
- package/dist/packages/charts/src/chart-theme.d.ts +1 -2
- package/dist/packages/charts/src/distribution/ecdf.d.ts +1 -1
- package/dist/packages/charts/src/distribution/histogram.d.ts +1 -1
- package/dist/packages/charts/src/distribution/interval-plot.d.ts +1 -1
- package/dist/packages/charts/src/distribution/ranked-bars.d.ts +1 -1
- package/dist/packages/charts/src/graph/relation-graph.d.ts +1 -1
- package/dist/packages/charts/src/index.d.ts +4 -2
- package/dist/packages/collections/src/data-table.d.ts +6 -4
- package/dist/packages/feedback/src/progress.d.ts +8 -2
- package/dist/packages/forms/src/dates/civil.d.ts +6 -4
- package/dist/packages/forms/src/dates/index.d.ts +1 -0
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/select-control.d.ts +26 -0
- package/dist/packages/foundations/src/chart-tones.d.ts +2 -0
- package/dist/{src-BYKjPC-0.js → src-CoFxE4Cj.js} +282 -227
- package/dist/{src-BHllGfI8.js → src-DXdsMc_Z.js} +415 -307
- package/package.json +1 -1
- package/dist/chart-frame-BV0IPZtQ.js +0 -270
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as e } from "../src-DXdsMc_Z.js";
|
|
2
|
+
import { a as t, n, r, t as i } from "../chart-frame-C0UBu4ku.js";
|
|
3
|
+
import { n as a, r as o, t as s } from "../chart-input-Ccr2NJ6J.js";
|
|
3
4
|
import { t as c } from "../plot-width--OgdohB5.js";
|
|
4
5
|
import * as l from "@stylexjs/stylex";
|
|
5
6
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
@@ -263,11 +264,11 @@ function C({ title: a, report: o, description: c, points: m, domain: h, valueLab
|
|
|
263
264
|
domain: [0, 1],
|
|
264
265
|
range: [v.height, 0]
|
|
265
266
|
}), k = m.find((e) => e.id === T?.selectedId);
|
|
266
|
-
return /* @__PURE__ */ d(
|
|
267
|
+
return /* @__PURE__ */ d(r, {
|
|
267
268
|
title: a,
|
|
268
269
|
report: o,
|
|
269
270
|
description: c,
|
|
270
|
-
footer: T !== void 0 && m.length > 0 ? /* @__PURE__ */ d(
|
|
271
|
+
footer: T !== void 0 && m.length > 0 ? /* @__PURE__ */ d(t, { children: k === void 0 ? "Select a point in View data to inspect its probability." : `${g}: ${y(k.value)}, ${_}: ${k.probability === null ? "Unavailable" : S(k.probability)}` }) : void 0,
|
|
271
272
|
children: m.length === 0 ? /* @__PURE__ */ d("p", {
|
|
272
273
|
...l.props(b.empty),
|
|
273
274
|
children: E
|
|
@@ -278,39 +279,39 @@ function C({ title: a, report: o, description: c, points: m, domain: h, valueLab
|
|
|
278
279
|
yLabel: _,
|
|
279
280
|
formatX: y,
|
|
280
281
|
formatY: S,
|
|
281
|
-
children: (
|
|
282
|
-
let
|
|
282
|
+
children: (t) => {
|
|
283
|
+
let n = p({
|
|
283
284
|
domain: [...h],
|
|
284
|
-
range: [0,
|
|
285
|
-
}),
|
|
285
|
+
range: [0, t]
|
|
286
|
+
}), r = m.map((e, t) => {
|
|
286
287
|
if (e.probability === null) return "";
|
|
287
|
-
let r =
|
|
288
|
+
let r = n(e.value), i = O(e.probability), a = m[t - 1];
|
|
288
289
|
return a === void 0 || a.probability === null ? `M ${r} ${i}` : `H ${r} V ${i}`;
|
|
289
290
|
}).join(" ");
|
|
290
291
|
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", {
|
|
291
|
-
d:
|
|
292
|
+
d: r,
|
|
292
293
|
fill: "none",
|
|
293
|
-
stroke:
|
|
294
|
+
stroke: e[C],
|
|
294
295
|
strokeWidth: 2,
|
|
295
296
|
vectorEffect: "non-scaling-stroke"
|
|
296
|
-
}), m.map((
|
|
297
|
-
cx: t
|
|
298
|
-
cy: O(
|
|
299
|
-
r: T?.selectedId ===
|
|
300
|
-
fill:
|
|
301
|
-
},
|
|
297
|
+
}), m.map((t) => t.probability === null ? null : /* @__PURE__ */ d("circle", {
|
|
298
|
+
cx: n(t.value),
|
|
299
|
+
cy: O(t.probability),
|
|
300
|
+
r: T?.selectedId === t.id ? 4 : 2,
|
|
301
|
+
fill: e[C]
|
|
302
|
+
}, t.id))] });
|
|
302
303
|
}
|
|
303
304
|
}), /* @__PURE__ */ d(i, { children: /* @__PURE__ */ d("div", {
|
|
304
305
|
...l.props(b.values),
|
|
305
306
|
children: m.map((e) => {
|
|
306
|
-
let
|
|
307
|
-
return /* @__PURE__ */ d(
|
|
308
|
-
label: `${g}: ${
|
|
307
|
+
let t = y(e.value), r = e.probability === null ? "Unavailable" : S(e.probability);
|
|
308
|
+
return /* @__PURE__ */ d(n, {
|
|
309
|
+
label: `${g}: ${t}, ${_}: ${r}`,
|
|
309
310
|
isSelected: T?.selectedId === e.id,
|
|
310
311
|
onSelect: T === void 0 ? void 0 : () => T.onSelect(e.id),
|
|
311
312
|
children: /* @__PURE__ */ f("span", {
|
|
312
313
|
...l.props(b.value),
|
|
313
|
-
children: [/* @__PURE__ */ d("span", { children:
|
|
314
|
+
children: [/* @__PURE__ */ d("span", { children: t }), /* @__PURE__ */ d("span", {
|
|
314
315
|
...l.props(b.summary),
|
|
315
316
|
children: r
|
|
316
317
|
})]
|
|
@@ -357,11 +358,11 @@ function T({ title: a, report: o, description: c, bins: h, domain: g, maximumCou
|
|
|
357
358
|
domain: [0, _],
|
|
358
359
|
range: [v.height, 0]
|
|
359
360
|
}), j = h.find((e) => e.id === D?.selectedId);
|
|
360
|
-
return /* @__PURE__ */ d(
|
|
361
|
+
return /* @__PURE__ */ d(r, {
|
|
361
362
|
title: a,
|
|
362
363
|
report: o,
|
|
363
364
|
description: c,
|
|
364
|
-
footer: D !== void 0 && h.length > 0 ? /* @__PURE__ */ d(
|
|
365
|
+
footer: D !== void 0 && h.length > 0 ? /* @__PURE__ */ d(t, { children: j === void 0 ? "Select a bin in View data to inspect its count." : `${j.label}, ${C(j.lowerBound)} – ${C(j.upperBound)}, ${S}: ${j.count === null ? "Unavailable" : w(j.count)}` }) : void 0,
|
|
365
366
|
children: h.length === 0 ? /* @__PURE__ */ d("p", {
|
|
366
367
|
...l.props(b.empty),
|
|
367
368
|
children: O
|
|
@@ -372,37 +373,37 @@ function T({ title: a, report: o, description: c, bins: h, domain: g, maximumCou
|
|
|
372
373
|
yLabel: S,
|
|
373
374
|
formatX: C,
|
|
374
375
|
formatY: w,
|
|
375
|
-
children: (
|
|
376
|
-
let
|
|
376
|
+
children: (t) => {
|
|
377
|
+
let n = p({
|
|
377
378
|
domain: [...g],
|
|
378
|
-
range: [0,
|
|
379
|
+
range: [0, t]
|
|
379
380
|
});
|
|
380
|
-
return h.map((
|
|
381
|
-
let
|
|
382
|
-
if (
|
|
383
|
-
x:
|
|
381
|
+
return h.map((t) => {
|
|
382
|
+
let r = n(t.lowerBound), i = n(t.upperBound) - r, a = Math.min(2, i * .2), o = D?.selectedId === t.id;
|
|
383
|
+
if (t.count === null) return /* @__PURE__ */ d(m, {
|
|
384
|
+
x: r + a / 2,
|
|
384
385
|
y: v.height - 6,
|
|
385
386
|
width: i - a,
|
|
386
387
|
height: 5,
|
|
387
388
|
...l.props(b.missing)
|
|
388
|
-
},
|
|
389
|
-
let s = A(
|
|
389
|
+
}, t.id);
|
|
390
|
+
let s = A(t.count);
|
|
390
391
|
return /* @__PURE__ */ d(m, {
|
|
391
|
-
x:
|
|
392
|
+
x: r + a / 2,
|
|
392
393
|
y: s,
|
|
393
394
|
width: i - a,
|
|
394
395
|
height: v.height - s,
|
|
395
|
-
fill:
|
|
396
|
+
fill: e[T],
|
|
396
397
|
opacity: D?.selectedId === void 0 || o ? 1 : .45
|
|
397
|
-
},
|
|
398
|
+
}, t.id);
|
|
398
399
|
});
|
|
399
400
|
}
|
|
400
401
|
}), /* @__PURE__ */ d(i, { children: /* @__PURE__ */ d("div", {
|
|
401
402
|
...l.props(b.values),
|
|
402
403
|
children: h.map((e) => {
|
|
403
|
-
let
|
|
404
|
-
return /* @__PURE__ */ d(
|
|
405
|
-
label: `${e.label}, ${r}, ${S}: ${
|
|
404
|
+
let t = e.count === null ? "Unavailable" : w(e.count), r = `${C(e.lowerBound)} – ${C(e.upperBound)}`;
|
|
405
|
+
return /* @__PURE__ */ d(n, {
|
|
406
|
+
label: `${e.label}, ${r}, ${S}: ${t}`,
|
|
406
407
|
isSelected: D?.selectedId === e.id,
|
|
407
408
|
onSelect: D === void 0 ? void 0 : () => D.onSelect(e.id),
|
|
408
409
|
children: /* @__PURE__ */ f("span", {
|
|
@@ -413,7 +414,7 @@ function T({ title: a, report: o, description: c, bins: h, domain: g, maximumCou
|
|
|
413
414
|
r
|
|
414
415
|
] }), /* @__PURE__ */ d("span", {
|
|
415
416
|
...l.props(b.summary),
|
|
416
|
-
children:
|
|
417
|
+
children: t
|
|
417
418
|
})]
|
|
418
419
|
})
|
|
419
420
|
}, e.id);
|
|
@@ -437,13 +438,13 @@ function E({ bins: e, domain: t, maximumCount: n }) {
|
|
|
437
438
|
}
|
|
438
439
|
}
|
|
439
440
|
// packages/charts/src/distribution/interval-plot.tsx
|
|
440
|
-
function D({ title:
|
|
441
|
+
function D({ title: t, report: i, description: a, items: o, domain: u, valueLabel: m, intervalLabel: h, formatValue: g, selection: _, emptyLabel: v = "No interval estimates are available." }) {
|
|
441
442
|
let { ref: y, width: x } = c(), C = O({
|
|
442
443
|
items: o,
|
|
443
444
|
domain: u
|
|
444
445
|
});
|
|
445
446
|
if (C !== void 0) return /* @__PURE__ */ d(s, {
|
|
446
|
-
title:
|
|
447
|
+
title: t,
|
|
447
448
|
report: i,
|
|
448
449
|
description: a,
|
|
449
450
|
message: C
|
|
@@ -452,8 +453,8 @@ function D({ title: e, report: i, description: a, items: o, domain: u, valueLabe
|
|
|
452
453
|
domain: [...u],
|
|
453
454
|
range: [0, x]
|
|
454
455
|
});
|
|
455
|
-
return /* @__PURE__ */ d(
|
|
456
|
-
title:
|
|
456
|
+
return /* @__PURE__ */ d(r, {
|
|
457
|
+
title: t,
|
|
457
458
|
report: i,
|
|
458
459
|
description: a,
|
|
459
460
|
footer: `${m} · ${h}`,
|
|
@@ -462,21 +463,21 @@ function D({ title: e, report: i, description: a, items: o, domain: u, valueLabe
|
|
|
462
463
|
children: v
|
|
463
464
|
}) : /* @__PURE__ */ f("div", {
|
|
464
465
|
...l.props(b.values),
|
|
465
|
-
children: [o.map((
|
|
466
|
-
let
|
|
467
|
-
return /* @__PURE__ */ d(
|
|
468
|
-
label: `${
|
|
469
|
-
isSelected: _?.selectedId ===
|
|
470
|
-
onSelect: _ === void 0 ? void 0 : () => _.onSelect(
|
|
466
|
+
children: [o.map((t) => {
|
|
467
|
+
let r = t.estimate === null ? "Estimate unavailable" : g(t.estimate), i = `${h}: ${t.lower === null ? "Unavailable" : g(t.lower)} – ${t.upper === null ? "Unavailable" : g(t.upper)}`, a = e[t.tone ?? "series1"];
|
|
468
|
+
return /* @__PURE__ */ d(n, {
|
|
469
|
+
label: `${t.label}, ${m}: ${r}, ${i}`,
|
|
470
|
+
isSelected: _?.selectedId === t.id,
|
|
471
|
+
onSelect: _ === void 0 ? void 0 : () => _.onSelect(t.id),
|
|
471
472
|
children: /* @__PURE__ */ f("span", {
|
|
472
473
|
...l.props(b.row),
|
|
473
474
|
children: [/* @__PURE__ */ f("span", {
|
|
474
475
|
...l.props(b.rowLabel),
|
|
475
476
|
children: [
|
|
476
|
-
/* @__PURE__ */ d("span", { children:
|
|
477
|
+
/* @__PURE__ */ d("span", { children: t.label }),
|
|
477
478
|
/* @__PURE__ */ d("span", {
|
|
478
479
|
...l.props(b.rowValue),
|
|
479
|
-
children:
|
|
480
|
+
children: r
|
|
480
481
|
}),
|
|
481
482
|
/* @__PURE__ */ d("span", {
|
|
482
483
|
...l.props(b.label),
|
|
@@ -496,33 +497,33 @@ function D({ title: e, report: i, description: a, items: o, domain: u, valueLabe
|
|
|
496
497
|
y2: 14,
|
|
497
498
|
...l.props(b.baseline)
|
|
498
499
|
}),
|
|
499
|
-
|
|
500
|
+
t.lower !== null && t.upper !== null && /* @__PURE__ */ f("g", {
|
|
500
501
|
stroke: a,
|
|
501
502
|
strokeWidth: 2,
|
|
502
503
|
vectorEffect: "non-scaling-stroke",
|
|
503
504
|
children: [
|
|
504
505
|
/* @__PURE__ */ d("line", {
|
|
505
|
-
x1: w(
|
|
506
|
-
x2: w(
|
|
506
|
+
x1: w(t.lower),
|
|
507
|
+
x2: w(t.upper),
|
|
507
508
|
y1: 14,
|
|
508
509
|
y2: 14
|
|
509
510
|
}),
|
|
510
511
|
/* @__PURE__ */ d("line", {
|
|
511
|
-
x1: w(
|
|
512
|
-
x2: w(
|
|
512
|
+
x1: w(t.lower),
|
|
513
|
+
x2: w(t.lower),
|
|
513
514
|
y1: 9,
|
|
514
515
|
y2: 19
|
|
515
516
|
}),
|
|
516
517
|
/* @__PURE__ */ d("line", {
|
|
517
|
-
x1: w(
|
|
518
|
-
x2: w(
|
|
518
|
+
x1: w(t.upper),
|
|
519
|
+
x2: w(t.upper),
|
|
519
520
|
y1: 9,
|
|
520
521
|
y2: 19
|
|
521
522
|
})
|
|
522
523
|
]
|
|
523
524
|
}),
|
|
524
|
-
|
|
525
|
-
cx: w(
|
|
525
|
+
t.estimate !== null && /* @__PURE__ */ d("circle", {
|
|
526
|
+
cx: w(t.estimate),
|
|
526
527
|
cy: 14,
|
|
527
528
|
r: 4,
|
|
528
529
|
fill: a
|
|
@@ -530,7 +531,7 @@ function D({ title: e, report: i, description: a, items: o, domain: u, valueLabe
|
|
|
530
531
|
]
|
|
531
532
|
})]
|
|
532
533
|
})
|
|
533
|
-
},
|
|
534
|
+
}, t.id);
|
|
534
535
|
}), /* @__PURE__ */ f("div", {
|
|
535
536
|
...l.props(b.row, b.rowAxis),
|
|
536
537
|
children: [/* @__PURE__ */ d("span", { ...l.props(b.axisSpacer) }), /* @__PURE__ */ d("div", {
|
|
@@ -565,13 +566,13 @@ function O({ items: e, domain: t }) {
|
|
|
565
566
|
}
|
|
566
567
|
}
|
|
567
568
|
// packages/charts/src/distribution/ranked-bars.tsx
|
|
568
|
-
function k({ title:
|
|
569
|
+
function k({ title: t, report: i, description: a, items: o, domain: u, valueLabel: h, formatValue: g, selection: _, emptyLabel: v = "No ranked values are available." }) {
|
|
569
570
|
let { ref: y, width: x } = c(), C = A({
|
|
570
571
|
items: o,
|
|
571
572
|
domain: u
|
|
572
573
|
});
|
|
573
574
|
if (C !== void 0) return /* @__PURE__ */ d(s, {
|
|
574
|
-
title:
|
|
575
|
+
title: t,
|
|
575
576
|
report: i,
|
|
576
577
|
description: a,
|
|
577
578
|
message: C
|
|
@@ -580,8 +581,8 @@ function k({ title: e, report: i, description: a, items: o, domain: u, valueLabe
|
|
|
580
581
|
domain: [...u],
|
|
581
582
|
range: [0, x]
|
|
582
583
|
}), T = w(0);
|
|
583
|
-
return /* @__PURE__ */ d(
|
|
584
|
-
title:
|
|
584
|
+
return /* @__PURE__ */ d(r, {
|
|
585
|
+
title: t,
|
|
585
586
|
report: i,
|
|
586
587
|
description: a,
|
|
587
588
|
footer: h,
|
|
@@ -590,19 +591,19 @@ function k({ title: e, report: i, description: a, items: o, domain: u, valueLabe
|
|
|
590
591
|
children: v
|
|
591
592
|
}) : /* @__PURE__ */ f("div", {
|
|
592
593
|
...l.props(b.values),
|
|
593
|
-
children: [o.map((
|
|
594
|
-
let
|
|
595
|
-
return /* @__PURE__ */ d(
|
|
596
|
-
label: `${i}, ${h}: ${
|
|
597
|
-
isSelected: _?.selectedId ===
|
|
598
|
-
onSelect: _ === void 0 ? void 0 : () => _.onSelect(
|
|
594
|
+
children: [o.map((t) => {
|
|
595
|
+
let r = t.value === null ? "Unavailable" : g(t.value), i = t.rank === void 0 ? t.label : `${t.rank} · ${t.label}`, a = e[t.tone ?? "series1"];
|
|
596
|
+
return /* @__PURE__ */ d(n, {
|
|
597
|
+
label: `${i}, ${h}: ${r}`,
|
|
598
|
+
isSelected: _?.selectedId === t.id,
|
|
599
|
+
onSelect: _ === void 0 ? void 0 : () => _.onSelect(t.id),
|
|
599
600
|
children: /* @__PURE__ */ f("span", {
|
|
600
601
|
...l.props(b.row),
|
|
601
602
|
children: [/* @__PURE__ */ f("span", {
|
|
602
603
|
...l.props(b.rowLabel),
|
|
603
604
|
children: [/* @__PURE__ */ d("span", { children: i }), /* @__PURE__ */ d("span", {
|
|
604
605
|
...l.props(b.rowValue),
|
|
605
|
-
children:
|
|
606
|
+
children: r
|
|
606
607
|
})]
|
|
607
608
|
}), /* @__PURE__ */ f("svg", {
|
|
608
609
|
"aria-hidden": !0,
|
|
@@ -615,7 +616,7 @@ function k({ title: e, report: i, description: a, items: o, domain: u, valueLabe
|
|
|
615
616
|
y1: 3,
|
|
616
617
|
y2: 25,
|
|
617
618
|
...l.props(b.baseline)
|
|
618
|
-
}),
|
|
619
|
+
}), t.value !== null && (t.value === 0 ? /* @__PURE__ */ d("line", {
|
|
619
620
|
x1: T,
|
|
620
621
|
x2: T,
|
|
621
622
|
y1: 10,
|
|
@@ -624,15 +625,15 @@ function k({ title: e, report: i, description: a, items: o, domain: u, valueLabe
|
|
|
624
625
|
strokeWidth: 2,
|
|
625
626
|
vectorEffect: "non-scaling-stroke"
|
|
626
627
|
}) : /* @__PURE__ */ d(m, {
|
|
627
|
-
x: Math.min(T, w(
|
|
628
|
+
x: Math.min(T, w(t.value)),
|
|
628
629
|
y: 10,
|
|
629
|
-
width: Math.abs(w(
|
|
630
|
+
width: Math.abs(w(t.value) - T),
|
|
630
631
|
height: 8,
|
|
631
632
|
fill: a
|
|
632
633
|
}))]
|
|
633
634
|
})]
|
|
634
635
|
})
|
|
635
|
-
},
|
|
636
|
+
}, t.id);
|
|
636
637
|
}), /* @__PURE__ */ f("div", {
|
|
637
638
|
...l.props(b.row, b.rowAxis),
|
|
638
639
|
children: [/* @__PURE__ */ d("span", { ...l.props(b.axisSpacer) }), /* @__PURE__ */ d("div", {
|
package/dist/charts/graph.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
1
|
+
import { c as e } from "../src-DXdsMc_Z.js";
|
|
2
|
+
import { t } from "../use-scroll-tab-index-Dxpdh4W7.js";
|
|
3
|
+
import { a as n, n as r, r as i, t as a } from "../chart-frame-C0UBu4ku.js";
|
|
4
|
+
import { n as o, t as s } from "../chart-input-Ccr2NJ6J.js";
|
|
4
5
|
import * as c from "@stylexjs/stylex";
|
|
5
6
|
import { useId as l } from "react";
|
|
6
7
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
@@ -82,7 +83,7 @@ var p = {
|
|
|
82
83
|
}
|
|
83
84
|
}, h = 256, g = 1024, _ = 256, v = 8192;
|
|
84
85
|
function y({ title: o, report: p, description: h, nodes: g, edges: _, groups: v = [], width: y, height: S, selection: C, emptyLabel: w }) {
|
|
85
|
-
let T = l(), E =
|
|
86
|
+
let T = l(), E = t(), D = b({
|
|
86
87
|
nodes: g,
|
|
87
88
|
edges: _,
|
|
88
89
|
groups: v,
|
|
@@ -101,11 +102,11 @@ function y({ title: o, report: p, description: h, nodes: g, edges: _, groups: v
|
|
|
101
102
|
report: p,
|
|
102
103
|
description: h,
|
|
103
104
|
message: "Every relationship must refer to two supplied nodes."
|
|
104
|
-
}) : /* @__PURE__ */ f(
|
|
105
|
+
}) : /* @__PURE__ */ f(i, {
|
|
105
106
|
title: o,
|
|
106
107
|
report: p,
|
|
107
108
|
description: h,
|
|
108
|
-
footer: C !== void 0 && j ? /* @__PURE__ */ d(
|
|
109
|
+
footer: C !== void 0 && j ? /* @__PURE__ */ d(n, { children: A === void 0 ? "Select a node to inspect its record." : [A.label, A.description].filter((e) => e !== void 0).join(" · ") }) : void 0,
|
|
109
110
|
children: [j ? /* @__PURE__ */ d("div", {
|
|
110
111
|
ref: E.ref,
|
|
111
112
|
role: "region",
|
|
@@ -162,33 +163,33 @@ function y({ title: o, report: p, description: h, nodes: g, edges: _, groups: v
|
|
|
162
163
|
}, e.id);
|
|
163
164
|
})
|
|
164
165
|
]
|
|
165
|
-
}), g.map((
|
|
166
|
-
let
|
|
167
|
-
...v.filter((
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
].filter((e) => e !== void 0).join(", "),
|
|
166
|
+
}), g.map((t) => {
|
|
167
|
+
let n = [
|
|
168
|
+
...v.filter((e) => e.nodeIds.includes(t.id)).map((e) => e.label),
|
|
169
|
+
t.label,
|
|
170
|
+
t.description
|
|
171
|
+
].filter((e) => e !== void 0).join(", "), r = c.props(m.node, m.position(t.x, t.y), m.size(t.width, t.height), m.tone(e[t.tone]), C !== void 0 && m.action, C?.selectedId === t.id && m.selected), i = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", {
|
|
171
172
|
className: "xtqrqnz x1778rvt xk4h15q xb3r6kr xlyipyv xuxw1ft",
|
|
172
|
-
children:
|
|
173
|
-
}),
|
|
173
|
+
children: t.label
|
|
174
|
+
}), t.description !== void 0 && t.height >= 56 && /* @__PURE__ */ d("span", {
|
|
174
175
|
className: "xy8obcc xas2l8k x153jb6y xb3r6kr xlyipyv xuxw1ft",
|
|
175
|
-
children:
|
|
176
|
+
children: t.description
|
|
176
177
|
})] });
|
|
177
178
|
return C === void 0 ? /* @__PURE__ */ d("div", {
|
|
178
179
|
role: "group",
|
|
179
|
-
"aria-label":
|
|
180
|
-
title:
|
|
181
|
-
...
|
|
182
|
-
children:
|
|
183
|
-
},
|
|
180
|
+
"aria-label": n,
|
|
181
|
+
title: n,
|
|
182
|
+
...r,
|
|
183
|
+
children: i
|
|
184
|
+
}, t.id) : /* @__PURE__ */ d("button", {
|
|
184
185
|
type: "button",
|
|
185
|
-
"aria-label":
|
|
186
|
-
title:
|
|
187
|
-
"aria-pressed": C.selectedId ===
|
|
188
|
-
onClick: () => C.onSelect(
|
|
189
|
-
...
|
|
190
|
-
children:
|
|
191
|
-
},
|
|
186
|
+
"aria-label": n,
|
|
187
|
+
title: n,
|
|
188
|
+
"aria-pressed": C.selectedId === t.id,
|
|
189
|
+
onClick: () => C.onSelect(t.id),
|
|
190
|
+
...r,
|
|
191
|
+
children: i
|
|
192
|
+
}, t.id);
|
|
192
193
|
})]
|
|
193
194
|
})
|
|
194
195
|
}) : /* @__PURE__ */ d("p", {
|
|
@@ -200,7 +201,7 @@ function y({ title: o, report: p, description: h, nodes: g, edges: _, groups: v
|
|
|
200
201
|
/* @__PURE__ */ d("ul", {
|
|
201
202
|
"aria-label": "Nodes",
|
|
202
203
|
className: "x1ghz6dp x1717udv xe8uvvx",
|
|
203
|
-
children: g.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(
|
|
204
|
+
children: g.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(r, {
|
|
204
205
|
label: [e.label, e.description].filter((e) => e !== void 0).join(", "),
|
|
205
206
|
isSelected: C?.selectedId === e.id,
|
|
206
207
|
onSelect: C === void 0 ? void 0 : () => C.onSelect(e.id),
|
package/dist/charts/hierarchy.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { c as e } from "../src-DXdsMc_Z.js";
|
|
2
|
+
import { a as t, i as n, n as r, t as i } from "../chart-theme-Bwr9YSP1.js";
|
|
3
|
+
import { r as a } from "../chart-frame-C0UBu4ku.js";
|
|
4
|
+
import { t as o } from "../chart-input-Ccr2NJ6J.js";
|
|
4
5
|
import { t as s } from "../plot-width--OgdohB5.js";
|
|
5
6
|
import * as c from "@stylexjs/stylex";
|
|
6
7
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
@@ -12,18 +13,18 @@ var p = { treeRect: {
|
|
|
12
13
|
$$css: !0
|
|
13
14
|
} };
|
|
14
15
|
function m({ title: m, report: h, description: g, items: _, formatValue: v, selection: y, height: b = 180 }) {
|
|
15
|
-
let x =
|
|
16
|
+
let x = t(_), S = _.reduce((e, t) => e + (t.value ?? 0), 0), { ref: C, width: w } = s();
|
|
16
17
|
if (x !== void 0 || !Number.isFinite(b) || b < 48) return /* @__PURE__ */ l(o, {
|
|
17
18
|
title: m,
|
|
18
19
|
report: h,
|
|
19
20
|
description: g,
|
|
20
21
|
message: x ?? "Chart height must be at least 48 pixels."
|
|
21
22
|
});
|
|
22
|
-
let T = _.flatMap((e,
|
|
23
|
+
let T = _.flatMap((e, t) => e.value === null || e.value === 0 ? [] : [{
|
|
23
24
|
id: e.id,
|
|
24
25
|
label: e.label,
|
|
25
26
|
value: e.value,
|
|
26
|
-
tone:
|
|
27
|
+
tone: n(e.tone, t)
|
|
27
28
|
}]), E = f({
|
|
28
29
|
id: "root",
|
|
29
30
|
label: m,
|
|
@@ -31,14 +32,14 @@ function m({ title: m, report: h, description: g, items: _, formatValue: v, sele
|
|
|
31
32
|
tone: "neutral",
|
|
32
33
|
children: T
|
|
33
34
|
}, (e) => e.children === void 0 ? void 0 : [...e.children]).sum((e) => e.value);
|
|
34
|
-
return /* @__PURE__ */ u(
|
|
35
|
+
return /* @__PURE__ */ u(a, {
|
|
35
36
|
title: m,
|
|
36
37
|
report: h,
|
|
37
38
|
description: g,
|
|
38
39
|
children: [
|
|
39
40
|
/* @__PURE__ */ l("div", {
|
|
40
41
|
ref: C,
|
|
41
|
-
...c.props(
|
|
42
|
+
...c.props(i.plot),
|
|
42
43
|
children: S === 0 ? /* @__PURE__ */ l("p", {
|
|
43
44
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
44
45
|
children: "No positive values to size the areas"
|
|
@@ -47,57 +48,57 @@ function m({ title: m, report: h, description: g, items: _, formatValue: v, sele
|
|
|
47
48
|
"aria-label": `${m}. Areas compare recorded values.`,
|
|
48
49
|
viewBox: `0 0 ${w} ${b}`,
|
|
49
50
|
height: b,
|
|
50
|
-
...c.props(
|
|
51
|
+
...c.props(i.svg),
|
|
51
52
|
children: /* @__PURE__ */ l(d, {
|
|
52
53
|
root: E,
|
|
53
54
|
size: [w, b],
|
|
54
55
|
paddingInner: 2,
|
|
55
|
-
children: (
|
|
56
|
-
let
|
|
56
|
+
children: (t) => t.leaves().map((t) => {
|
|
57
|
+
let n = t.x1 - t.x0 > 96 && t.y1 - t.y0 > 40, r = Math.max(1, Math.floor((t.x1 - t.x0 - 16) / 7)), a = t.data.label.length > r ? `${t.data.label.slice(0, r - 1)}…` : t.data.label;
|
|
57
58
|
return /* @__PURE__ */ u("g", { children: [
|
|
58
59
|
/* @__PURE__ */ l("rect", {
|
|
59
|
-
x:
|
|
60
|
-
y:
|
|
61
|
-
width:
|
|
62
|
-
height:
|
|
63
|
-
fill:
|
|
60
|
+
x: t.x0,
|
|
61
|
+
y: t.y0,
|
|
62
|
+
width: t.x1 - t.x0,
|
|
63
|
+
height: t.y1 - t.y0,
|
|
64
|
+
fill: e[t.data.tone],
|
|
64
65
|
fillOpacity: .18,
|
|
65
|
-
...c.props(p.treeRect, y?.selectedId ===
|
|
66
|
+
...c.props(p.treeRect, y?.selectedId === t.data.id && i.selected)
|
|
66
67
|
}),
|
|
67
68
|
/* @__PURE__ */ u("title", { children: [
|
|
68
|
-
|
|
69
|
+
t.data.label,
|
|
69
70
|
": ",
|
|
70
|
-
v(
|
|
71
|
+
v(t.data.value)
|
|
71
72
|
] }),
|
|
72
|
-
|
|
73
|
-
x:
|
|
74
|
-
y:
|
|
75
|
-
width:
|
|
76
|
-
height:
|
|
73
|
+
n && /* @__PURE__ */ u("svg", {
|
|
74
|
+
x: t.x0,
|
|
75
|
+
y: t.y0,
|
|
76
|
+
width: t.x1 - t.x0,
|
|
77
|
+
height: t.y1 - t.y0,
|
|
77
78
|
overflow: "hidden",
|
|
78
79
|
children: [/* @__PURE__ */ l("text", {
|
|
79
80
|
x: 8,
|
|
80
81
|
y: 18,
|
|
81
82
|
className: "xlrhuyr x1hz01jw xy8obcc",
|
|
82
|
-
children:
|
|
83
|
-
}), v(
|
|
83
|
+
children: a
|
|
84
|
+
}), v(t.data.value).length * 12 < t.x1 - t.x0 - 16 && /* @__PURE__ */ l("text", {
|
|
84
85
|
x: 8,
|
|
85
86
|
y: 34,
|
|
86
87
|
className: "xlrhuyr x1hz01jw xy8obcc",
|
|
87
|
-
children: v(
|
|
88
|
+
children: v(t.data.value)
|
|
88
89
|
})]
|
|
89
90
|
})
|
|
90
|
-
] },
|
|
91
|
+
] }, t.data.id);
|
|
91
92
|
})
|
|
92
93
|
})
|
|
93
94
|
})
|
|
94
95
|
}),
|
|
95
|
-
/* @__PURE__ */ l(
|
|
96
|
-
items: _.map((e,
|
|
96
|
+
/* @__PURE__ */ l(r, {
|
|
97
|
+
items: _.map((e, t) => ({
|
|
97
98
|
id: e.id,
|
|
98
99
|
label: e.label,
|
|
99
100
|
valueLabel: e.value === null ? "Unavailable" : v(e.value),
|
|
100
|
-
tone:
|
|
101
|
+
tone: n(e.tone, t)
|
|
101
102
|
})),
|
|
102
103
|
selection: y
|
|
103
104
|
}),
|