@mechane-ai/elements 0.26.0 → 0.27.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 +9 -6
- package/dist/ai.js +56 -56
- package/dist/{categorical-values-CPRt9uzI.js → categorical-values-DqoH9l1M.js} +2 -2
- package/dist/chart-frame-CYdrUwvP.js +239 -0
- package/dist/{chart-input-DDAjzy-O.js → chart-input--Q3Jdono.js} +4 -3
- package/dist/charts/cartesian.js +527 -434
- package/dist/charts/distribution.js +134 -126
- package/dist/charts/graph.js +46 -43
- package/dist/charts/hierarchy.js +28 -26
- package/dist/charts/matrix.js +81 -77
- package/dist/charts/timeline.js +87 -80
- package/dist/charts.js +1 -1
- package/dist/{code-block-DENC5fD_.js → code-block-DPeyW4sm.js} +3 -3
- package/dist/collections.js +52 -52
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +10 -10
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-CGIua9If.js → content-link-5oRGjDHa.js} +1 -1
- package/dist/content.js +18 -18
- package/dist/elements.css +14 -0
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +7 -7
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +39 -39
- package/dist/navigation/commands.js +1 -1
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +5 -4
- package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/index.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +2 -1
- package/dist/packages/charts/src/cartesian/time-series.d.ts +12 -3
- package/dist/packages/charts/src/chart-frame.d.ts +15 -7
- package/dist/packages/charts/src/chart-input.d.ts +3 -1
- package/dist/packages/charts/src/chart-inspection.d.ts +3 -1
- package/dist/packages/charts/src/chart-series-summary.d.ts +6 -0
- package/dist/packages/charts/src/chart-theme.d.ts +5 -0
- package/dist/packages/charts/src/distribution/ecdf.d.ts +3 -2
- package/dist/packages/charts/src/distribution/histogram.d.ts +3 -2
- package/dist/packages/charts/src/distribution/interval-plot.d.ts +3 -2
- package/dist/packages/charts/src/distribution/ranked-bars.d.ts +3 -2
- package/dist/packages/charts/src/graph/relation-graph.d.ts +3 -2
- package/dist/packages/charts/src/hierarchy/treemap.d.ts +3 -2
- package/dist/packages/charts/src/index.d.ts +1 -1
- package/dist/packages/charts/src/matrix/matrix.d.ts +3 -2
- package/dist/packages/charts/src/matrix/token-heatmap.d.ts +3 -2
- package/dist/packages/charts/src/timeline/waterfall.d.ts +4 -1
- package/dist/packages/core/src/index.d.ts +2 -0
- package/dist/packages/core/src/section-heading.d.ts +8 -0
- package/dist/{pierre-diff-CHQsoQSZ.js → pierre-diff-C3U_qae6.js} +1 -1
- package/dist/{pierre-theme-CLgk9v3e.js → pierre-theme-DsrSwl5m.js} +19 -20
- package/dist/{pierre-tree-C3nKYyoN.js → pierre-tree-KSFewJrY.js} +4 -4
- package/dist/{src-CQOgWIzP.js → src-DYwAhQHt.js} +98 -98
- package/dist/{src-DLReNPV9.js → src-E3Or8tkO.js} +38 -18
- package/dist/{src-DHYcohZP.js → src-eWcNz_oB.js} +25 -26
- package/dist/tokens.js +1 -3
- package/dist/{tokens.stylex-DTHHFbyl.js → tokens.stylex-BoRZ3D8s.js} +92 -12
- package/package.json +1 -1
- package/dist/chart-frame-CNr8M_b2.js +0 -166
- package/dist/constants.stylex-BILvnwUk.js +0 -84
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-
|
|
2
|
-
import { n as a, r as o, t as s } from "../chart-input
|
|
1
|
+
import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-CYdrUwvP.js";
|
|
2
|
+
import { n as a, r as o, t as s } from "../chart-input--Q3Jdono.js";
|
|
3
3
|
import { t as c } from "../plot-width--OgdohB5.js";
|
|
4
4
|
import * as l from "@stylexjs/stylex";
|
|
5
5
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
@@ -248,64 +248,66 @@ function S({ domain: e, formatValue: t }) {
|
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
// packages/charts/src/distribution/ecdf.tsx
|
|
251
|
-
function C({ title: a,
|
|
252
|
-
let
|
|
253
|
-
points:
|
|
254
|
-
domain:
|
|
251
|
+
function C({ title: a, report: o, description: c, points: m, domain: h, valueLabel: g, probabilityLabel: _, formatValue: y, formatProbability: S, tone: C = "series1", selection: T, emptyLabel: E = "No cumulative distribution points are available." }) {
|
|
252
|
+
let D = w({
|
|
253
|
+
points: m,
|
|
254
|
+
domain: h
|
|
255
255
|
});
|
|
256
|
-
if (
|
|
256
|
+
if (D !== void 0) return /* @__PURE__ */ d(s, {
|
|
257
257
|
title: a,
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
report: o,
|
|
259
|
+
description: c,
|
|
260
|
+
message: D
|
|
260
261
|
});
|
|
261
|
-
let
|
|
262
|
+
let O = p({
|
|
262
263
|
domain: [0, 1],
|
|
263
264
|
range: [v.height, 0]
|
|
264
|
-
}),
|
|
265
|
+
}), k = m.find((e) => e.id === T?.selectedId);
|
|
265
266
|
return /* @__PURE__ */ d(n, {
|
|
266
267
|
title: a,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
report: o,
|
|
269
|
+
description: c,
|
|
270
|
+
footer: T !== void 0 && m.length > 0 ? /* @__PURE__ */ d(e, { 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
|
+
children: m.length === 0 ? /* @__PURE__ */ d("p", {
|
|
270
272
|
...l.props(b.empty),
|
|
271
|
-
children:
|
|
273
|
+
children: E
|
|
272
274
|
}) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(x, {
|
|
273
|
-
xDomain:
|
|
275
|
+
xDomain: h,
|
|
274
276
|
yDomain: [0, 1],
|
|
275
|
-
xLabel:
|
|
276
|
-
yLabel:
|
|
277
|
-
formatX:
|
|
278
|
-
formatY:
|
|
277
|
+
xLabel: g,
|
|
278
|
+
yLabel: _,
|
|
279
|
+
formatX: y,
|
|
280
|
+
formatY: S,
|
|
279
281
|
children: (e) => {
|
|
280
282
|
let t = p({
|
|
281
|
-
domain: [...
|
|
283
|
+
domain: [...h],
|
|
282
284
|
range: [0, e]
|
|
283
|
-
}), n =
|
|
285
|
+
}), n = m.map((e, n) => {
|
|
284
286
|
if (e.probability === null) return "";
|
|
285
|
-
let r = t(e.value), i =
|
|
287
|
+
let r = t(e.value), i = O(e.probability), a = m[n - 1];
|
|
286
288
|
return a === void 0 || a.probability === null ? `M ${r} ${i}` : `H ${r} V ${i}`;
|
|
287
289
|
}).join(" ");
|
|
288
290
|
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", {
|
|
289
291
|
d: n,
|
|
290
292
|
fill: "none",
|
|
291
|
-
stroke: r[
|
|
293
|
+
stroke: r[C],
|
|
292
294
|
strokeWidth: 2,
|
|
293
295
|
vectorEffect: "non-scaling-stroke"
|
|
294
|
-
}),
|
|
296
|
+
}), m.map((e) => e.probability === null ? null : /* @__PURE__ */ d("circle", {
|
|
295
297
|
cx: t(e.value),
|
|
296
|
-
cy:
|
|
297
|
-
r:
|
|
298
|
-
fill: r[
|
|
298
|
+
cy: O(e.probability),
|
|
299
|
+
r: T?.selectedId === e.id ? 4 : 2,
|
|
300
|
+
fill: r[C]
|
|
299
301
|
}, e.id))] });
|
|
300
302
|
}
|
|
301
303
|
}), /* @__PURE__ */ d(i, { children: /* @__PURE__ */ d("div", {
|
|
302
304
|
...l.props(b.values),
|
|
303
|
-
children:
|
|
304
|
-
let n =
|
|
305
|
+
children: m.map((e) => {
|
|
306
|
+
let n = y(e.value), r = e.probability === null ? "Unavailable" : S(e.probability);
|
|
305
307
|
return /* @__PURE__ */ d(t, {
|
|
306
|
-
label: `${
|
|
307
|
-
isSelected:
|
|
308
|
-
onSelect:
|
|
308
|
+
label: `${g}: ${n}, ${_}: ${r}`,
|
|
309
|
+
isSelected: T?.selectedId === e.id,
|
|
310
|
+
onSelect: T === void 0 ? void 0 : () => T.onSelect(e.id),
|
|
309
311
|
children: /* @__PURE__ */ f("span", {
|
|
310
312
|
...l.props(b.value),
|
|
311
313
|
children: [/* @__PURE__ */ d("span", { children: n }), /* @__PURE__ */ d("span", {
|
|
@@ -339,42 +341,44 @@ function w({ points: e, domain: t }) {
|
|
|
339
341
|
}
|
|
340
342
|
}
|
|
341
343
|
// packages/charts/src/distribution/histogram.tsx
|
|
342
|
-
function T({ title: a,
|
|
343
|
-
let
|
|
344
|
-
bins:
|
|
345
|
-
domain:
|
|
346
|
-
maximumCount:
|
|
344
|
+
function T({ title: a, report: o, description: c, bins: h, domain: g, maximumCount: _, valueLabel: y, countLabel: S, formatValue: C, formatCount: w, tone: T = "series1", selection: D, emptyLabel: O = "No histogram bins are available." }) {
|
|
345
|
+
let k = E({
|
|
346
|
+
bins: h,
|
|
347
|
+
domain: g,
|
|
348
|
+
maximumCount: _
|
|
347
349
|
});
|
|
348
|
-
if (
|
|
350
|
+
if (k !== void 0) return /* @__PURE__ */ d(s, {
|
|
349
351
|
title: a,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
+
report: o,
|
|
353
|
+
description: c,
|
|
354
|
+
message: k
|
|
352
355
|
});
|
|
353
|
-
let
|
|
354
|
-
domain: [0,
|
|
356
|
+
let A = p({
|
|
357
|
+
domain: [0, _],
|
|
355
358
|
range: [v.height, 0]
|
|
356
|
-
}),
|
|
359
|
+
}), j = h.find((e) => e.id === D?.selectedId);
|
|
357
360
|
return /* @__PURE__ */ d(n, {
|
|
358
361
|
title: a,
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
report: o,
|
|
363
|
+
description: c,
|
|
364
|
+
footer: D !== void 0 && h.length > 0 ? /* @__PURE__ */ d(e, { 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
|
+
children: h.length === 0 ? /* @__PURE__ */ d("p", {
|
|
362
366
|
...l.props(b.empty),
|
|
363
|
-
children:
|
|
367
|
+
children: O
|
|
364
368
|
}) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(x, {
|
|
365
|
-
xDomain:
|
|
366
|
-
yDomain: [0,
|
|
367
|
-
xLabel:
|
|
368
|
-
yLabel:
|
|
369
|
-
formatX:
|
|
370
|
-
formatY:
|
|
369
|
+
xDomain: g,
|
|
370
|
+
yDomain: [0, _],
|
|
371
|
+
xLabel: y,
|
|
372
|
+
yLabel: S,
|
|
373
|
+
formatX: C,
|
|
374
|
+
formatY: w,
|
|
371
375
|
children: (e) => {
|
|
372
376
|
let t = p({
|
|
373
|
-
domain: [...
|
|
377
|
+
domain: [...g],
|
|
374
378
|
range: [0, e]
|
|
375
379
|
});
|
|
376
|
-
return
|
|
377
|
-
let n = t(e.lowerBound), i = t(e.upperBound) - n, a = Math.min(2, i * .2), o =
|
|
380
|
+
return h.map((e) => {
|
|
381
|
+
let n = t(e.lowerBound), i = t(e.upperBound) - n, a = Math.min(2, i * .2), o = D?.selectedId === e.id;
|
|
378
382
|
if (e.count === null) return /* @__PURE__ */ d(m, {
|
|
379
383
|
x: n + a / 2,
|
|
380
384
|
y: v.height - 6,
|
|
@@ -382,25 +386,25 @@ function T({ title: a, description: o, bins: c, domain: h, maximumCount: g, valu
|
|
|
382
386
|
height: 5,
|
|
383
387
|
...l.props(b.missing)
|
|
384
388
|
}, e.id);
|
|
385
|
-
let s =
|
|
389
|
+
let s = A(e.count);
|
|
386
390
|
return /* @__PURE__ */ d(m, {
|
|
387
391
|
x: n + a / 2,
|
|
388
392
|
y: s,
|
|
389
393
|
width: i - a,
|
|
390
394
|
height: v.height - s,
|
|
391
|
-
fill: r[
|
|
392
|
-
opacity:
|
|
395
|
+
fill: r[T],
|
|
396
|
+
opacity: D?.selectedId === void 0 || o ? 1 : .45
|
|
393
397
|
}, e.id);
|
|
394
398
|
});
|
|
395
399
|
}
|
|
396
400
|
}), /* @__PURE__ */ d(i, { children: /* @__PURE__ */ d("div", {
|
|
397
401
|
...l.props(b.values),
|
|
398
|
-
children:
|
|
399
|
-
let n = e.count === null ? "Unavailable" :
|
|
402
|
+
children: h.map((e) => {
|
|
403
|
+
let n = e.count === null ? "Unavailable" : w(e.count), r = `${C(e.lowerBound)} – ${C(e.upperBound)}`;
|
|
400
404
|
return /* @__PURE__ */ d(t, {
|
|
401
|
-
label: `${e.label}, ${r}, ${
|
|
402
|
-
isSelected:
|
|
403
|
-
onSelect:
|
|
405
|
+
label: `${e.label}, ${r}, ${S}: ${n}`,
|
|
406
|
+
isSelected: D?.selectedId === e.id,
|
|
407
|
+
onSelect: D === void 0 ? void 0 : () => D.onSelect(e.id),
|
|
404
408
|
children: /* @__PURE__ */ f("span", {
|
|
405
409
|
...l.props(b.value),
|
|
406
410
|
children: [/* @__PURE__ */ f("span", { children: [
|
|
@@ -433,35 +437,37 @@ function E({ bins: e, domain: t, maximumCount: n }) {
|
|
|
433
437
|
}
|
|
434
438
|
}
|
|
435
439
|
// packages/charts/src/distribution/interval-plot.tsx
|
|
436
|
-
function D({ title: e,
|
|
437
|
-
let { ref:
|
|
438
|
-
items:
|
|
439
|
-
domain:
|
|
440
|
+
function D({ title: e, report: i, description: a, items: o, domain: u, valueLabel: m, intervalLabel: h, formatValue: g, selection: _, emptyLabel: v = "No interval estimates are available." }) {
|
|
441
|
+
let { ref: y, width: x } = c(), C = O({
|
|
442
|
+
items: o,
|
|
443
|
+
domain: u
|
|
440
444
|
});
|
|
441
|
-
if (
|
|
445
|
+
if (C !== void 0) return /* @__PURE__ */ d(s, {
|
|
442
446
|
title: e,
|
|
443
|
-
|
|
444
|
-
|
|
447
|
+
report: i,
|
|
448
|
+
description: a,
|
|
449
|
+
message: C
|
|
445
450
|
});
|
|
446
|
-
let
|
|
447
|
-
domain: [...
|
|
448
|
-
range: [0,
|
|
451
|
+
let w = p({
|
|
452
|
+
domain: [...u],
|
|
453
|
+
range: [0, x]
|
|
449
454
|
});
|
|
450
455
|
return /* @__PURE__ */ d(n, {
|
|
451
456
|
title: e,
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
457
|
+
report: i,
|
|
458
|
+
description: a,
|
|
459
|
+
footer: `${m} · ${h}`,
|
|
460
|
+
children: o.length === 0 ? /* @__PURE__ */ d("p", {
|
|
455
461
|
...l.props(b.empty),
|
|
456
|
-
children:
|
|
462
|
+
children: v
|
|
457
463
|
}) : /* @__PURE__ */ f("div", {
|
|
458
464
|
...l.props(b.values),
|
|
459
|
-
children: [
|
|
460
|
-
let n = e.estimate === null ? "Estimate unavailable" :
|
|
465
|
+
children: [o.map((e) => {
|
|
466
|
+
let n = e.estimate === null ? "Estimate unavailable" : g(e.estimate), i = `${h}: ${e.lower === null ? "Unavailable" : g(e.lower)} – ${e.upper === null ? "Unavailable" : g(e.upper)}`, a = r[e.tone ?? "series1"];
|
|
461
467
|
return /* @__PURE__ */ d(t, {
|
|
462
|
-
label: `${e.label}, ${
|
|
463
|
-
isSelected:
|
|
464
|
-
onSelect:
|
|
468
|
+
label: `${e.label}, ${m}: ${n}, ${i}`,
|
|
469
|
+
isSelected: _?.selectedId === e.id,
|
|
470
|
+
onSelect: _ === void 0 ? void 0 : () => _.onSelect(e.id),
|
|
465
471
|
children: /* @__PURE__ */ f("span", {
|
|
466
472
|
...l.props(b.row),
|
|
467
473
|
children: [/* @__PURE__ */ f("span", {
|
|
@@ -479,13 +485,13 @@ function D({ title: e, description: i, items: a, domain: o, valueLabel: u, inter
|
|
|
479
485
|
]
|
|
480
486
|
}), /* @__PURE__ */ f("svg", {
|
|
481
487
|
"aria-hidden": !0,
|
|
482
|
-
viewBox: `0 0 ${
|
|
488
|
+
viewBox: `0 0 ${x} 28`,
|
|
483
489
|
preserveAspectRatio: "none",
|
|
484
490
|
...l.props(b.rowSvg),
|
|
485
491
|
children: [
|
|
486
492
|
/* @__PURE__ */ d("line", {
|
|
487
493
|
x1: 0,
|
|
488
|
-
x2:
|
|
494
|
+
x2: x,
|
|
489
495
|
y1: 14,
|
|
490
496
|
y2: 14,
|
|
491
497
|
...l.props(b.baseline)
|
|
@@ -496,27 +502,27 @@ function D({ title: e, description: i, items: a, domain: o, valueLabel: u, inter
|
|
|
496
502
|
vectorEffect: "non-scaling-stroke",
|
|
497
503
|
children: [
|
|
498
504
|
/* @__PURE__ */ d("line", {
|
|
499
|
-
x1:
|
|
500
|
-
x2:
|
|
505
|
+
x1: w(e.lower),
|
|
506
|
+
x2: w(e.upper),
|
|
501
507
|
y1: 14,
|
|
502
508
|
y2: 14
|
|
503
509
|
}),
|
|
504
510
|
/* @__PURE__ */ d("line", {
|
|
505
|
-
x1:
|
|
506
|
-
x2:
|
|
511
|
+
x1: w(e.lower),
|
|
512
|
+
x2: w(e.lower),
|
|
507
513
|
y1: 9,
|
|
508
514
|
y2: 19
|
|
509
515
|
}),
|
|
510
516
|
/* @__PURE__ */ d("line", {
|
|
511
|
-
x1:
|
|
512
|
-
x2:
|
|
517
|
+
x1: w(e.upper),
|
|
518
|
+
x2: w(e.upper),
|
|
513
519
|
y1: 9,
|
|
514
520
|
y2: 19
|
|
515
521
|
})
|
|
516
522
|
]
|
|
517
523
|
}),
|
|
518
524
|
e.estimate !== null && /* @__PURE__ */ d("circle", {
|
|
519
|
-
cx:
|
|
525
|
+
cx: w(e.estimate),
|
|
520
526
|
cy: 14,
|
|
521
527
|
r: 4,
|
|
522
528
|
fill: a
|
|
@@ -528,10 +534,10 @@ function D({ title: e, description: i, items: a, domain: o, valueLabel: u, inter
|
|
|
528
534
|
}), /* @__PURE__ */ f("div", {
|
|
529
535
|
...l.props(b.row, b.rowAxis),
|
|
530
536
|
children: [/* @__PURE__ */ d("span", { ...l.props(b.axisSpacer) }), /* @__PURE__ */ d("div", {
|
|
531
|
-
ref:
|
|
537
|
+
ref: y,
|
|
532
538
|
children: /* @__PURE__ */ d(S, {
|
|
533
|
-
domain:
|
|
534
|
-
formatValue:
|
|
539
|
+
domain: u,
|
|
540
|
+
formatValue: g
|
|
535
541
|
})
|
|
536
542
|
})]
|
|
537
543
|
})]
|
|
@@ -559,35 +565,37 @@ function O({ items: e, domain: t }) {
|
|
|
559
565
|
}
|
|
560
566
|
}
|
|
561
567
|
// packages/charts/src/distribution/ranked-bars.tsx
|
|
562
|
-
function k({ title: e,
|
|
563
|
-
let { ref:
|
|
564
|
-
items:
|
|
565
|
-
domain:
|
|
568
|
+
function k({ title: e, report: i, description: a, items: o, domain: u, valueLabel: h, formatValue: g, selection: _, emptyLabel: v = "No ranked values are available." }) {
|
|
569
|
+
let { ref: y, width: x } = c(), C = A({
|
|
570
|
+
items: o,
|
|
571
|
+
domain: u
|
|
566
572
|
});
|
|
567
|
-
if (
|
|
573
|
+
if (C !== void 0) return /* @__PURE__ */ d(s, {
|
|
568
574
|
title: e,
|
|
569
|
-
|
|
570
|
-
|
|
575
|
+
report: i,
|
|
576
|
+
description: a,
|
|
577
|
+
message: C
|
|
571
578
|
});
|
|
572
|
-
let
|
|
573
|
-
domain: [...
|
|
574
|
-
range: [0,
|
|
575
|
-
}),
|
|
579
|
+
let w = p({
|
|
580
|
+
domain: [...u],
|
|
581
|
+
range: [0, x]
|
|
582
|
+
}), T = w(0);
|
|
576
583
|
return /* @__PURE__ */ d(n, {
|
|
577
584
|
title: e,
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
585
|
+
report: i,
|
|
586
|
+
description: a,
|
|
587
|
+
footer: h,
|
|
588
|
+
children: o.length === 0 ? /* @__PURE__ */ d("p", {
|
|
581
589
|
...l.props(b.empty),
|
|
582
|
-
children:
|
|
590
|
+
children: v
|
|
583
591
|
}) : /* @__PURE__ */ f("div", {
|
|
584
592
|
...l.props(b.values),
|
|
585
|
-
children: [
|
|
586
|
-
let n = e.value === null ? "Unavailable" :
|
|
593
|
+
children: [o.map((e) => {
|
|
594
|
+
let n = e.value === null ? "Unavailable" : g(e.value), i = e.rank === void 0 ? e.label : `${e.rank} · ${e.label}`, a = r[e.tone ?? "series1"];
|
|
587
595
|
return /* @__PURE__ */ d(t, {
|
|
588
|
-
label: `${i}, ${
|
|
589
|
-
isSelected:
|
|
590
|
-
onSelect:
|
|
596
|
+
label: `${i}, ${h}: ${n}`,
|
|
597
|
+
isSelected: _?.selectedId === e.id,
|
|
598
|
+
onSelect: _ === void 0 ? void 0 : () => _.onSelect(e.id),
|
|
591
599
|
children: /* @__PURE__ */ f("span", {
|
|
592
600
|
...l.props(b.row),
|
|
593
601
|
children: [/* @__PURE__ */ f("span", {
|
|
@@ -598,27 +606,27 @@ function k({ title: e, description: i, items: a, domain: o, valueLabel: u, forma
|
|
|
598
606
|
})]
|
|
599
607
|
}), /* @__PURE__ */ f("svg", {
|
|
600
608
|
"aria-hidden": !0,
|
|
601
|
-
viewBox: `0 0 ${
|
|
609
|
+
viewBox: `0 0 ${x} 28`,
|
|
602
610
|
preserveAspectRatio: "none",
|
|
603
611
|
...l.props(b.rowSvg),
|
|
604
612
|
children: [/* @__PURE__ */ d("line", {
|
|
605
|
-
x1:
|
|
606
|
-
x2:
|
|
613
|
+
x1: T,
|
|
614
|
+
x2: T,
|
|
607
615
|
y1: 3,
|
|
608
616
|
y2: 25,
|
|
609
617
|
...l.props(b.baseline)
|
|
610
618
|
}), e.value !== null && (e.value === 0 ? /* @__PURE__ */ d("line", {
|
|
611
|
-
x1:
|
|
612
|
-
x2:
|
|
619
|
+
x1: T,
|
|
620
|
+
x2: T,
|
|
613
621
|
y1: 10,
|
|
614
622
|
y2: 18,
|
|
615
623
|
stroke: a,
|
|
616
624
|
strokeWidth: 2,
|
|
617
625
|
vectorEffect: "non-scaling-stroke"
|
|
618
626
|
}) : /* @__PURE__ */ d(m, {
|
|
619
|
-
x: Math.min(
|
|
627
|
+
x: Math.min(T, w(e.value)),
|
|
620
628
|
y: 10,
|
|
621
|
-
width: Math.abs(
|
|
629
|
+
width: Math.abs(w(e.value) - T),
|
|
622
630
|
height: 8,
|
|
623
631
|
fill: a
|
|
624
632
|
}))]
|
|
@@ -628,10 +636,10 @@ function k({ title: e, description: i, items: a, domain: o, valueLabel: u, forma
|
|
|
628
636
|
}), /* @__PURE__ */ f("div", {
|
|
629
637
|
...l.props(b.row, b.rowAxis),
|
|
630
638
|
children: [/* @__PURE__ */ d("span", { ...l.props(b.axisSpacer) }), /* @__PURE__ */ d("div", {
|
|
631
|
-
ref:
|
|
639
|
+
ref: y,
|
|
632
640
|
children: /* @__PURE__ */ d(S, {
|
|
633
|
-
domain:
|
|
634
|
-
formatValue:
|
|
641
|
+
domain: u,
|
|
642
|
+
formatValue: g
|
|
635
643
|
})
|
|
636
644
|
})]
|
|
637
645
|
})]
|
package/dist/charts/graph.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../use-scroll-tab-index-Dxpdh4W7.js";
|
|
2
|
-
import { a as t, n, r, s as i, t as a } from "../chart-frame-
|
|
3
|
-
import { n as o, t as s } from "../chart-input
|
|
2
|
+
import { a as t, n, r, s as i, t as a } from "../chart-frame-CYdrUwvP.js";
|
|
3
|
+
import { n as o, t as s } from "../chart-input--Q3Jdono.js";
|
|
4
4
|
import * as c from "@stylexjs/stylex";
|
|
5
5
|
import { useId as l } from "react";
|
|
6
6
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
@@ -81,44 +81,47 @@ var p = {
|
|
|
81
81
|
$$css: !0
|
|
82
82
|
}
|
|
83
83
|
}, h = 256, g = 1024, _ = 256, v = 8192;
|
|
84
|
-
function y({ title: o,
|
|
85
|
-
let
|
|
86
|
-
nodes:
|
|
87
|
-
edges:
|
|
88
|
-
groups:
|
|
89
|
-
width:
|
|
90
|
-
height:
|
|
84
|
+
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 = e(), D = b({
|
|
86
|
+
nodes: g,
|
|
87
|
+
edges: _,
|
|
88
|
+
groups: v,
|
|
89
|
+
width: y,
|
|
90
|
+
height: S
|
|
91
91
|
});
|
|
92
|
-
if (
|
|
92
|
+
if (D !== null) return /* @__PURE__ */ d(s, {
|
|
93
93
|
title: o,
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
report: p,
|
|
95
|
+
description: h,
|
|
96
|
+
message: D
|
|
96
97
|
});
|
|
97
|
-
let
|
|
98
|
-
return
|
|
98
|
+
let O = new Map(g.map((e) => [e.id, e])), k = x(_, O), A = C?.selectedId === void 0 ? void 0 : O.get(C.selectedId), j = g.length > 0;
|
|
99
|
+
return k === null ? /* @__PURE__ */ d(s, {
|
|
99
100
|
title: o,
|
|
100
|
-
|
|
101
|
+
report: p,
|
|
102
|
+
description: h,
|
|
101
103
|
message: "Every relationship must refer to two supplied nodes."
|
|
102
104
|
}) : /* @__PURE__ */ f(r, {
|
|
103
105
|
title: o,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
report: p,
|
|
107
|
+
description: h,
|
|
108
|
+
footer: C !== void 0 && j ? /* @__PURE__ */ d(t, { children: A === void 0 ? "Select a node to inspect its record." : [A.label, A.description].filter((e) => e !== void 0).join(" · ") }) : void 0,
|
|
109
|
+
children: [j ? /* @__PURE__ */ d("div", {
|
|
110
|
+
ref: E.ref,
|
|
108
111
|
role: "region",
|
|
109
112
|
"aria-label": `${o} graph`,
|
|
110
|
-
tabIndex:
|
|
113
|
+
tabIndex: E.tabIndex,
|
|
111
114
|
className: "xysyzu8 xzuc9lq xeuugli x1t137rt xmkeg23 x1y0btm7 x1ey3b81 x13qnu6 x19rmrnh x9v5kkp x1bqaal",
|
|
112
115
|
children: /* @__PURE__ */ f("div", {
|
|
113
|
-
...c.props(m.canvas(
|
|
116
|
+
...c.props(m.canvas(y, S)),
|
|
114
117
|
children: [/* @__PURE__ */ f("svg", {
|
|
115
|
-
width:
|
|
116
|
-
height:
|
|
118
|
+
width: y,
|
|
119
|
+
height: S,
|
|
117
120
|
"aria-hidden": !0,
|
|
118
121
|
className: "x10l6tqk x10a8y8t x1lliihq",
|
|
119
122
|
children: [
|
|
120
123
|
/* @__PURE__ */ d("defs", { children: /* @__PURE__ */ d("marker", {
|
|
121
|
-
id:
|
|
124
|
+
id: T,
|
|
122
125
|
markerWidth: 8,
|
|
123
126
|
markerHeight: 8,
|
|
124
127
|
refX: 7,
|
|
@@ -130,7 +133,7 @@ function y({ title: o, description: p, nodes: h, edges: g, groups: _ = [], width
|
|
|
130
133
|
className: "x8futc7"
|
|
131
134
|
})
|
|
132
135
|
}) }),
|
|
133
|
-
|
|
136
|
+
v.map((e) => /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("rect", {
|
|
134
137
|
x: e.x,
|
|
135
138
|
y: e.y,
|
|
136
139
|
width: e.width,
|
|
@@ -149,29 +152,29 @@ function y({ title: o, description: p, nodes: h, edges: g, groups: _ = [], width
|
|
|
149
152
|
children: e.label
|
|
150
153
|
})
|
|
151
154
|
})] }, e.id)),
|
|
152
|
-
|
|
155
|
+
k.map(({ edge: e, source: t, target: n }) => {
|
|
153
156
|
let r = t.x < n.x, i = t.x + (r ? t.width : 0), a = n.x + (r ? 0 : n.width), o = t.y + t.height / 2, s = n.y + n.height / 2, c = (i + a) / 2, l = t.x + t.width / 2, u = t.id === n.id ? `M${l - 12},${t.y} C${l - 48},${t.y - 36} ${l + 48},${t.y - 36} ${l + 12},${t.y}` : `M${i},${o} C${c},${o} ${c},${s} ${a},${s}`;
|
|
154
157
|
return /* @__PURE__ */ d("path", {
|
|
155
158
|
d: u,
|
|
156
|
-
markerEnd: e.direction === "directed" ? `url(#${
|
|
159
|
+
markerEnd: e.direction === "directed" ? `url(#${T})` : void 0,
|
|
157
160
|
className: "xbh8q5q x1crw9hw xhr4kjn",
|
|
158
161
|
children: /* @__PURE__ */ d("title", { children: e.label })
|
|
159
162
|
}, e.id);
|
|
160
163
|
})
|
|
161
164
|
]
|
|
162
|
-
}),
|
|
165
|
+
}), g.map((e) => {
|
|
163
166
|
let t = [
|
|
164
|
-
...
|
|
167
|
+
...v.filter((t) => t.nodeIds.includes(e.id)).map((e) => e.label),
|
|
165
168
|
e.label,
|
|
166
169
|
e.description
|
|
167
|
-
].filter((e) => e !== void 0).join(", "), n = c.props(m.node, m.position(e.x, e.y), m.size(e.width, e.height), m.tone(i[e.tone]),
|
|
170
|
+
].filter((e) => e !== void 0).join(", "), n = c.props(m.node, m.position(e.x, e.y), m.size(e.width, e.height), m.tone(i[e.tone]), C !== void 0 && m.action, C?.selectedId === e.id && m.selected), r = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", {
|
|
168
171
|
className: "xtqrqnz x1778rvt xk4h15q xb3r6kr xlyipyv xuxw1ft",
|
|
169
172
|
children: e.label
|
|
170
173
|
}), e.description !== void 0 && e.height >= 56 && /* @__PURE__ */ d("span", {
|
|
171
174
|
className: "xy8obcc xas2l8k x153jb6y xb3r6kr xlyipyv xuxw1ft",
|
|
172
175
|
children: e.description
|
|
173
176
|
})] });
|
|
174
|
-
return
|
|
177
|
+
return C === void 0 ? /* @__PURE__ */ d("div", {
|
|
175
178
|
role: "group",
|
|
176
179
|
"aria-label": t,
|
|
177
180
|
title: t,
|
|
@@ -181,8 +184,8 @@ function y({ title: o, description: p, nodes: h, edges: g, groups: _ = [], width
|
|
|
181
184
|
type: "button",
|
|
182
185
|
"aria-label": t,
|
|
183
186
|
title: t,
|
|
184
|
-
"aria-pressed":
|
|
185
|
-
onClick: () =>
|
|
187
|
+
"aria-pressed": C.selectedId === e.id,
|
|
188
|
+
onClick: () => C.onSelect(e.id),
|
|
186
189
|
...n,
|
|
187
190
|
children: r
|
|
188
191
|
}, e.id);
|
|
@@ -190,17 +193,17 @@ function y({ title: o, description: p, nodes: h, edges: g, groups: _ = [], width
|
|
|
190
193
|
})
|
|
191
194
|
}) : /* @__PURE__ */ d("p", {
|
|
192
195
|
className: "x1ghz6dp x153jb6y",
|
|
193
|
-
children:
|
|
194
|
-
}),
|
|
196
|
+
children: w
|
|
197
|
+
}), j ? /* @__PURE__ */ f(a, {
|
|
195
198
|
label: "Graph data",
|
|
196
199
|
children: [
|
|
197
200
|
/* @__PURE__ */ d("ul", {
|
|
198
201
|
"aria-label": "Nodes",
|
|
199
202
|
className: "x1ghz6dp x1717udv xe8uvvx",
|
|
200
|
-
children:
|
|
203
|
+
children: g.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(n, {
|
|
201
204
|
label: [e.label, e.description].filter((e) => e !== void 0).join(", "),
|
|
202
|
-
isSelected:
|
|
203
|
-
onSelect:
|
|
205
|
+
isSelected: C?.selectedId === e.id,
|
|
206
|
+
onSelect: C === void 0 ? void 0 : () => C.onSelect(e.id),
|
|
204
207
|
children: /* @__PURE__ */ f("span", {
|
|
205
208
|
className: "xrvj5dj xfko13i xeuugli xh8yej3",
|
|
206
209
|
children: [/* @__PURE__ */ d("span", { children: e.label }), e.description !== void 0 && /* @__PURE__ */ d("span", {
|
|
@@ -210,19 +213,19 @@ function y({ title: o, description: p, nodes: h, edges: g, groups: _ = [], width
|
|
|
210
213
|
})
|
|
211
214
|
}) }, e.id))
|
|
212
215
|
}),
|
|
213
|
-
|
|
216
|
+
v.length > 0 && /* @__PURE__ */ d("ul", {
|
|
214
217
|
"aria-label": "Groups",
|
|
215
218
|
className: "xo02m6d xv06hpe x153jb6y xj0a0fe",
|
|
216
|
-
children:
|
|
219
|
+
children: v.map((e) => /* @__PURE__ */ f("li", { children: [
|
|
217
220
|
e.label,
|
|
218
221
|
": ",
|
|
219
|
-
e.nodeIds.map((e) =>
|
|
222
|
+
e.nodeIds.map((e) => O.get(e)?.label).join(", ")
|
|
220
223
|
] }, e.id))
|
|
221
224
|
}),
|
|
222
|
-
|
|
225
|
+
k.length > 0 && /* @__PURE__ */ d("ul", {
|
|
223
226
|
"aria-label": "Relationships",
|
|
224
227
|
className: "xo02m6d xv06hpe x153jb6y xj0a0fe",
|
|
225
|
-
children:
|
|
228
|
+
children: k.map(({ edge: e, source: t, target: n }) => /* @__PURE__ */ f("li", { children: [
|
|
226
229
|
t.label,
|
|
227
230
|
" ",
|
|
228
231
|
e.direction === "directed" ? "→" : "↔",
|