@mechane-ai/elements 0.49.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +40 -2
  2. package/dist/{article-yyNPg6VU.js → article-CRlhq9oA.js} +531 -463
  3. package/dist/article.js +1 -1
  4. package/dist/catalog.json +37 -1
  5. package/dist/{categorical-values-DCznViFp.js → categorical-values-BYP_R5gS.js} +13 -13
  6. package/dist/charts/cartesian.js +1 -1
  7. package/dist/charts/comparison.js +1 -1
  8. package/dist/charts/distribution.js +1 -1
  9. package/dist/charts/figure.js +12 -12
  10. package/dist/charts/graph.js +1 -1
  11. package/dist/charts/hierarchy.js +1 -1
  12. package/dist/charts/image.js +1 -1
  13. package/dist/charts/matrix.js +1 -1
  14. package/dist/charts/plot.js +4 -4
  15. package/dist/charts/relationship.js +1 -1
  16. package/dist/charts/text.js +1 -1
  17. package/dist/charts/timeline.js +1 -1
  18. package/dist/charts/trend.js +1 -1
  19. package/dist/charts.js +7 -7
  20. package/dist/collections.js +1 -1
  21. package/dist/{dumbbell-plot-CMv9llfd.js → dumbbell-plot-BC8d_IJy.js} +45 -45
  22. package/dist/{embedding-map-DC-lgzCq.js → embedding-map-Bj8krO-d.js} +528 -528
  23. package/dist/figure-frame-koVKcXph.js +323 -0
  24. package/dist/{image-grid-DHqtj_zs.js → image-grid-CLhol2jy.js} +47 -47
  25. package/dist/kits/evaluation.js +50 -48
  26. package/dist/kits/interpretability.js +7 -7
  27. package/dist/kits/operations.js +4 -4
  28. package/dist/kits/research.js +346 -264
  29. package/dist/kits/training.js +3 -3
  30. package/dist/layout.js +1 -1075
  31. package/dist/lesson/spec.js +11 -11
  32. package/dist/lesson.js +4 -4
  33. package/dist/mdx.js +4 -4
  34. package/dist/packages/charts/src/chart-inspection.d.ts +4 -1
  35. package/dist/packages/charts/src/figure/caption-scope.d.ts +12 -0
  36. package/dist/packages/charts/src/figure/figure-frame.d.ts +2 -1
  37. package/dist/packages/charts/src/index.d.ts +2 -0
  38. package/dist/packages/collections/src/data-table-trigger.d.ts +2 -0
  39. package/dist/packages/kits/src/evaluation/leaderboard.d.ts +2 -0
  40. package/dist/packages/kits/src/research/collection-page.d.ts +46 -0
  41. package/dist/packages/kits/src/research/index.d.ts +2 -0
  42. package/dist/packages/kits/src/research/milestone-path.d.ts +1 -2
  43. package/dist/packages/kits/src/research/work-heartbeat.d.ts +4 -3
  44. package/dist/packages/layout/src/detail-page.d.ts +3 -1
  45. package/dist/packages/teaching/src/article/article-context.d.ts +2 -0
  46. package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +13 -0
  47. package/dist/packages/teaching/src/article/article.d.ts +6 -1
  48. package/dist/packages/teaching/src/article/figure.d.ts +20 -3
  49. package/dist/packages/teaching/src/article/index.d.ts +1 -1
  50. package/dist/packages/teaching/src/article/view-essay.d.ts +2 -1
  51. package/dist/packages/teaching/src/lesson/define-lesson.d.ts +4 -0
  52. package/dist/packages/teaching/src/lesson/index.d.ts +2 -2
  53. package/dist/packages/teaching/src/lesson/lesson-player.d.ts +19 -3
  54. package/dist/packages/teaching/src/lesson/lesson-store.d.ts +2 -0
  55. package/dist/packages/teaching/src/lesson/playback.d.ts +9 -6
  56. package/dist/packages/teaching/src/lesson/use-lesson.d.ts +7 -2
  57. package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +4 -1
  58. package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +5 -6
  59. package/dist/packages/teaching/src/scene/scene-geometry.d.ts +1 -1
  60. package/dist/packages/teaching/src/scene/scene-node.d.ts +4 -1
  61. package/dist/packages/teaching/src/scene/scene-validate.d.ts +6 -0
  62. package/dist/packages/teaching/src/scene/scene-wire.d.ts +6 -1
  63. package/dist/packages/teaching/src/scene/scene.d.ts +1 -1
  64. package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +5 -1
  65. package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +1 -1
  66. package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +1 -1
  67. package/dist/packages/teaching/src/time/tween.d.ts +2 -0
  68. package/dist/{param-BE3VMSkH.js → param-BdqTpZER.js} +166 -99
  69. package/dist/{plot-layout-Bqe4-0qZ.js → plot-layout-B2xRt-_k.js} +144 -130
  70. package/dist/{plot-surface-DON6WUmk.js → plot-surface-0cKFwtws.js} +1 -1
  71. package/dist/{reference-lines-hjuD1rRZ.js → reference-lines-nSxcZVF5.js} +1 -1
  72. package/dist/{scene-BP0Ue0R5.js → scene-4ePpWdmE.js} +1227 -1125
  73. package/dist/scene.js +1 -1
  74. package/dist/{slope-chart-C8eeSgL4.js → slope-chart-DWZIYDty.js} +179 -179
  75. package/dist/{src-B2rgpWap.js → src-DNclWY4V.js} +1 -1
  76. package/dist/src-DhWMspwr.js +1085 -0
  77. package/dist/styles2.css +77 -14
  78. package/dist/{time-series-BL933QyA.js → time-series-CsngFxr1.js} +952 -948
  79. package/dist/{token-heatmap-BB65awva.js → token-heatmap-BQLIxPky.js} +84 -84
  80. package/dist/{token-predictions-Pa8eUGan.js → token-predictions-C3B5L-eO.js} +126 -126
  81. package/dist/{transport-DzyxVXbL.js → transport-4V9rfYHN.js} +278 -233
  82. package/dist/{tree-diagram-DJhKBiia.js → tree-diagram-Dau9jeXS.js} +115 -115
  83. package/dist/{treemap-CxxgABUg.js → treemap-DWrMQndu.js} +27 -27
  84. package/dist/use-tween-BsaEO862.js +10 -0
  85. package/dist/{violin-plot-CoAEF_7Z.js → violin-plot-D05ODcyc.js} +123 -123
  86. package/dist/{waterfall-DdoEXEkT.js → waterfall-BkLLv2Lm.js} +39 -39
  87. package/package.json +1 -1
  88. package/recipes/counting-cards.tsx +3 -3
  89. package/skills/review-elements/SKILL.md +14 -0
  90. package/skills/review-explainer/SKILL.md +2 -1
  91. package/skills/upgrade-elements/references/releases.md +61 -0
  92. package/skills/use-elements/SKILL.md +21 -17
  93. package/skills/use-elements/references/editorial-restraint.md +40 -0
  94. package/skills/use-elements/references/styling.md +23 -0
  95. package/skills/use-elements/references/teaching.md +13 -0
  96. package/skills/use-elements/references/workspace.md +14 -8
  97. package/skills/write-explainer/references/article.md +50 -2
  98. package/skills/write-explainer/references/lesson.md +18 -9
  99. package/skills/write-explainer/references/scene-parts.md +17 -12
  100. package/skills/write-explainer/references/scene.md +25 -3
  101. package/dist/figure-frame-BjFzbl3m.js +0 -270
  102. package/dist/use-tween-5HZ55_9d.js +0 -72
@@ -1,14 +1,14 @@
1
1
  import { r as e } from "./tokens.stylex-dF5CACEJ.js";
2
2
  import { t } from "./chart-tones-ei3BC2AL.js";
3
- import { A as n, E as r, O as i, S as a, T as o, a as s, i as c, k as l, n as u, s as d, w as f, x as p } from "./plot-layout-Bqe4-0qZ.js";
3
+ import { A as n, D as r, E as i, M as a, O as o, S as s, a as c, i as l, j as u, n as d, s as f, x as p } from "./plot-layout-B2xRt-_k.js";
4
4
  import { i as ee } from "./chart-link-AE_xuxiP.js";
5
5
  import { r as m } from "./figure-format-B8kRZMlo.js";
6
6
  import { a as h, i as g, o as _ } from "./scale-C2xgZyZN.js";
7
- import { i as te, l as ne, n as re, r as v, t as ie } from "./figure-frame-BjFzbl3m.js";
7
+ import { i as te, l as ne, n as re, r as v, t as ie } from "./figure-frame-koVKcXph.js";
8
8
  import { n as ae } from "./plot-width-D3hTycYX.js";
9
9
  import { t as y } from "./plot-axes-D5S9BnBa.js";
10
10
  import { c as b, f as x, r as S, u as C } from "./plot-marks-FVsbFkUs.js";
11
- import { n as w, r as T, t as E } from "./plot-surface-DON6WUmk.js";
11
+ import { n as w, r as T, t as E } from "./plot-surface-0cKFwtws.js";
12
12
  import { r as D } from "./path-BglsXpnO.js";
13
13
  import { t as O } from "./locate-Bcg3QcP4.js";
14
14
  import * as k from "@stylexjs/stylex";
@@ -248,20 +248,20 @@ var J = {
248
248
  $$css: !0
249
249
  }
250
250
  };
251
- function ye({ examples: e, domain: t, palette: r, context: i }) {
252
- let a = F({
251
+ function ye({ examples: e, domain: t, palette: n, context: r }) {
252
+ let i = F({
253
253
  domain: t,
254
- palette: r
254
+ palette: n
255
255
  });
256
- if (a !== void 0) return a;
256
+ if (i !== void 0) return i;
257
257
  if (e.length > J.examples) return `This chart draws at most ${J.examples} examples. Supply the leading examples.`;
258
- if (!n(e)) return "Examples must have unique identifiers.";
259
- if (i !== void 0 && (!Number.isSafeInteger(i) || i < 0)) return "The context must be a whole number of tokens, zero or more.";
258
+ if (!a(e)) return "Examples must have unique identifiers.";
259
+ if (r !== void 0 && (!Number.isSafeInteger(r) || r < 0)) return "The context must be a whole number of tokens, zero or more.";
260
260
  for (let n of e) {
261
261
  if (n.tokens.length > J.tokensPerExample) return `Example ${n.id} has more than ${J.tokensPerExample} tokens. Supply a window around its peak.`;
262
- let { peakIndex: e } = n, r = e !== void 0;
263
- if (r && !(Number.isSafeInteger(e) && e >= 0 && e < n.tokens.length)) return `Example ${n.id} names a peak index that is not one of its token positions.`;
264
- if (i !== void 0 && !r) return `Example ${n.id} has no peak index, so the chart cannot show context around it.`;
262
+ let { peakIndex: e } = n, i = e !== void 0;
263
+ if (i && !(Number.isSafeInteger(e) && e >= 0 && e < n.tokens.length)) return `Example ${n.id} names a peak index that is not one of its token positions.`;
264
+ if (r !== void 0 && !i) return `Example ${n.id} has no peak index, so the chart cannot show context around it.`;
265
265
  if (n.tokens.some((e) => e.value !== null && I(e.value, t))) return `Example ${n.id} has a value that is not finite or lies outside the color domain.`;
266
266
  }
267
267
  }
@@ -284,24 +284,24 @@ function be(e, t, n) {
284
284
  };
285
285
  }
286
286
  function xe(e) {
287
- let { examples: t, valueLabel: n, valueFormat: s, domain: c, palette: u, context: d, selected: p, onSelectedChange: h, ...g } = e, { emptyLabel: _ = "No examples are available.", ...y } = g, { locale: b, title: x } = y, S = oe(), C = ee();
287
+ let { examples: t, valueLabel: a, valueFormat: c, domain: l, palette: d, context: f, selected: p, onSelectedChange: h, ...g } = e, { emptyLabel: _ = "No examples are available.", ...y } = g, { locale: b, title: x } = y, S = oe(), C = ee();
288
288
  if (y.status === "loading") return /* @__PURE__ */ M(te, { ...y });
289
289
  let w = ye({
290
290
  examples: t,
291
- domain: c,
292
- palette: u,
293
- context: d
291
+ domain: l,
292
+ palette: d,
293
+ context: f
294
294
  });
295
295
  if (w !== void 0) return /* @__PURE__ */ M(v, {
296
296
  ...y,
297
297
  message: w
298
298
  });
299
- let T = t.map((e, t) => be(e, t, d));
299
+ let T = t.map((e, t) => be(e, t, f));
300
300
  function E(e) {
301
301
  return m({
302
302
  value: e,
303
303
  locale: b,
304
- format: s
304
+ format: c
305
305
  });
306
306
  }
307
307
  function D(e) {
@@ -313,7 +313,7 @@ function xe(e) {
313
313
  }
314
314
  let O = T.flatMap((e) => e.tokens.map((t) => ({
315
315
  id: t.id,
316
- label: `${e.name}, token ${t.index} ${G(t.text)}: ${n} ${E(t.value)}${t.isPeak ? " (peak)" : ""}`
316
+ label: `${e.name}, token ${t.index} ${G(t.text)}: ${a} ${E(t.value)}${t.isPeak ? " (peak)" : ""}`
317
317
  }))), A = new Map(T.flatMap((e) => e.tokens.map((t) => [t.id, e.id]))), j = new Map(T.flatMap((e, n) => e.tokens.map((e) => {
318
318
  let r = t[n]?.peakIndex ?? 0, i = e.index - r;
319
319
  return [e.id, {
@@ -323,7 +323,7 @@ function xe(e) {
323
323
  bottom: n * ve + 1
324
324
  }];
325
325
  }))), P = T.find((e) => e.id === p), ce = P?.tokens.find((e) => e.isPeak) ?? P?.tokens[0], F = T.some((e) => e.tokens.some((e) => e.value === null));
326
- return /* @__PURE__ */ M(f, {
326
+ return /* @__PURE__ */ M(i, {
327
327
  ...C,
328
328
  items: O,
329
329
  place: (e) => j.get(e),
@@ -332,24 +332,24 @@ function xe(e) {
332
332
  let n = A.get(e);
333
333
  n !== void 0 && h(n, t);
334
334
  },
335
- render: (e, { inspected: d, cursor: f }) => /* @__PURE__ */ M(re, {
335
+ render: (e, { inspected: i, cursor: f }) => /* @__PURE__ */ M(re, {
336
336
  ...y,
337
337
  figure: e,
338
338
  scaleLegend: t.length === 0 ? void 0 : /* @__PURE__ */ M(ge, {
339
- label: n,
340
- domain: c,
341
- palette: u,
339
+ label: a,
340
+ domain: l,
341
+ palette: d,
342
342
  locale: b,
343
- format: s,
343
+ format: c,
344
344
  hasMissing: F
345
345
  }),
346
- footer: t.length === 0 ? void 0 : /* @__PURE__ */ M(a, {
346
+ footer: t.length === 0 ? void 0 : /* @__PURE__ */ M(s, {
347
347
  id: S,
348
- children: i(O, d)
348
+ children: n(O, i)
349
349
  }),
350
- children: t.length === 0 ? /* @__PURE__ */ M(ie, { children: _ }) : /* @__PURE__ */ N(se, { children: [/* @__PURE__ */ M(r, {
350
+ children: t.length === 0 ? /* @__PURE__ */ M(ie, { children: _ }) : /* @__PURE__ */ N(se, { children: [/* @__PURE__ */ M(o, {
351
351
  role: "group",
352
- "aria-label": l({
352
+ "aria-label": u({
353
353
  title: x,
354
354
  marks: "tokens",
355
355
  isSelectable: h !== void 0
@@ -376,12 +376,12 @@ function xe(e) {
376
376
  className: "x153jb6y x1hz01jw xy8obcc",
377
377
  children: `… ${D(e.hiddenBefore)} earlier tokens hidden … `
378
378
  }),
379
- e.tokens.map((e) => /* @__PURE__ */ M(o, {
379
+ e.tokens.map((e) => /* @__PURE__ */ M(r, {
380
380
  value: e.id,
381
381
  ...k.props(Y.token, e.value === null ? Y.missing : Y.shade(L(e.value, {
382
- domain: c,
383
- palette: u
384
- })), e.isPeak && Y.peakToken, d === e.id && Y.inspected, f === e.id && ae.cursor),
382
+ domain: l,
383
+ palette: d
384
+ })), e.isPeak && Y.peakToken, i === e.id && Y.inspected, f === e.id && ae.cursor),
385
385
  children: /* @__PURE__ */ M(q, {
386
386
  text: e.text,
387
387
  shouldWrap: !1
@@ -412,7 +412,7 @@ function xe(e) {
412
412
  },
413
413
  {
414
414
  id: "value",
415
- label: n
415
+ label: a
416
416
  }
417
417
  ],
418
418
  rows: T.flatMap((e) => e.tokens.map((t) => ({
@@ -484,28 +484,28 @@ var Ce = {
484
484
  $$css: !0
485
485
  }
486
486
  };
487
- function we({ columns: e, rows: t, cells: r, domain: i, palette: a }) {
487
+ function we({ columns: e, rows: t, cells: n, domain: r, palette: i }) {
488
488
  let o = F({
489
- domain: i,
490
- palette: a
489
+ domain: r,
490
+ palette: i
491
491
  });
492
492
  if (o !== void 0) return o;
493
493
  let s = e.length * t.length > X.cells;
494
494
  if (e.length > X.columns || t.length > X.rows || s) return `This grid draws at most ${X.rows} rows, ${X.columns} columns and ${X.cells} cells. Supply fewer stages or a shorter prompt.`;
495
- if (!n(e) || !n(t)) return "Rows and columns must have unique identifiers.";
496
- let c = new Set(t.map((e) => e.id)), l = new Set(e.map((e) => e.id)), u = r.map((e) => Se(e.rowId, e.columnId));
495
+ if (!a(e) || !a(t)) return "Rows and columns must have unique identifiers.";
496
+ let c = new Set(t.map((e) => e.id)), l = new Set(e.map((e) => e.id)), u = n.map((e) => Se(e.rowId, e.columnId));
497
497
  if (new Set(u).size !== u.length) return "Each row and column pair takes at most one cell.";
498
- if (r.some((e) => !c.has(e.rowId) || !l.has(e.columnId))) return "A cell names a row or column the grid does not list.";
499
- if (r.some((e) => e.value !== null && I(e.value, i))) return "A cell value is not finite or lies outside the color domain.";
498
+ if (n.some((e) => !c.has(e.rowId) || !l.has(e.columnId))) return "A cell names a row or column the grid does not list.";
499
+ if (n.some((e) => e.value !== null && I(e.value, r))) return "A cell value is not finite or lies outside the color domain.";
500
500
  }
501
501
  function Te(e) {
502
- let { columns: t, rows: n, cells: s, valueLabel: c, valueFormat: u, domain: d, palette: p, selected: h, onSelectedChange: g, ..._ } = e, { emptyLabel: y = "No predictions are available.", ...b } = _, { locale: x, title: S } = b, C = oe(), w = ee();
502
+ let { columns: t, rows: a, cells: c, valueLabel: l, valueFormat: d, domain: f, palette: p, selected: h, onSelectedChange: g, ..._ } = e, { emptyLabel: y = "No predictions are available.", ...b } = _, { locale: x, title: S } = b, C = oe(), w = ee();
503
503
  if (b.status === "loading") return /* @__PURE__ */ M(te, { ...b });
504
504
  let T = we({
505
505
  columns: t,
506
- rows: n,
507
- cells: s,
508
- domain: d,
506
+ rows: a,
507
+ cells: c,
508
+ domain: f,
509
509
  palette: p
510
510
  });
511
511
  if (T !== void 0) return /* @__PURE__ */ M(v, {
@@ -516,10 +516,10 @@ function Te(e) {
516
516
  return m({
517
517
  value: e,
518
518
  locale: x,
519
- format: u
519
+ format: d
520
520
  });
521
521
  }
522
- let D = new Map(s.map((e) => [Se(e.rowId, e.columnId), e])), O = n.map((e) => ({
522
+ let D = new Map(c.map((e) => [Se(e.rowId, e.columnId), e])), O = a.map((e) => ({
523
523
  row: e,
524
524
  cells: t.map((t, n) => {
525
525
  let r = Se(e.id, t.id), i = D.get(r), a = `${e.label}, position ${n} ${G(t.token)}`;
@@ -530,40 +530,40 @@ function Te(e) {
530
530
  } : {
531
531
  id: r,
532
532
  cell: i,
533
- label: `${a}: ${i.token === null ? "prediction unavailable" : `predicts ${G(i.token)}`}, ${c} ${E(i.value)}`
533
+ label: `${a}: ${i.token === null ? "prediction unavailable" : `predicts ${G(i.token)}`}, ${l} ${E(i.value)}`
534
534
  };
535
535
  })
536
536
  })), A = O.flatMap((e) => e.cells.map((e) => ({
537
537
  id: e.id,
538
538
  label: e.label
539
- }))), j = O.some((e) => e.cells.some((e) => e.cell === void 0 || e.cell.value === null)), P = n.length === 0 || t.length === 0;
540
- return /* @__PURE__ */ M(f, {
539
+ }))), j = O.some((e) => e.cells.some((e) => e.cell === void 0 || e.cell.value === null)), P = a.length === 0 || t.length === 0;
540
+ return /* @__PURE__ */ M(i, {
541
541
  ...w,
542
542
  items: A,
543
543
  columns: t.length,
544
544
  selected: h,
545
545
  onSelect: g,
546
- render: (e, n) => /* @__PURE__ */ M(re, {
546
+ render: (e, i) => /* @__PURE__ */ M(re, {
547
547
  ...b,
548
548
  figure: e,
549
549
  scaleLegend: P ? void 0 : /* @__PURE__ */ M(ge, {
550
- label: c,
551
- domain: d,
550
+ label: l,
551
+ domain: f,
552
552
  palette: p,
553
553
  locale: x,
554
- format: u,
554
+ format: d,
555
555
  hasMissing: j
556
556
  }),
557
- footer: P ? void 0 : /* @__PURE__ */ M(a, {
557
+ footer: P ? void 0 : /* @__PURE__ */ M(s, {
558
558
  id: C,
559
- children: i(A, n.inspected)
559
+ children: n(A, i.inspected)
560
560
  }),
561
561
  children: P ? /* @__PURE__ */ M(ie, { children: y }) : /* @__PURE__ */ N(se, { children: [/* @__PURE__ */ M(_e, {
562
- cursor: n.cursor,
562
+ cursor: i.cursor,
563
563
  isBounded: !0,
564
- children: /* @__PURE__ */ M(r, {
564
+ children: /* @__PURE__ */ M(o, {
565
565
  role: "group",
566
- "aria-label": l({
566
+ "aria-label": u({
567
567
  title: S,
568
568
  marks: "cells",
569
569
  isSelectable: g !== void 0
@@ -589,14 +589,14 @@ function Te(e) {
589
589
  className: "x7wzq59 xu96u03 x11ru5tl x78zum5 x6s0dn4 x1fa0jp5 xuxw1ft x153jb6y xpvm0e4",
590
590
  children: e.row.label
591
591
  }, e.row.id), ...e.cells.map(({ id: e, cell: t }) => {
592
- let r = t?.value ?? null;
593
- return /* @__PURE__ */ M(o, {
592
+ let n = t?.value ?? null;
593
+ return /* @__PURE__ */ M(r, {
594
594
  value: e,
595
- "data-token-cursor": n.cursor === e ? "" : void 0,
596
- ...k.props(Z.cell, r === null ? Z.missing : Z.shade(L(r, {
597
- domain: d,
595
+ "data-token-cursor": i.cursor === e ? "" : void 0,
596
+ ...k.props(Z.cell, n === null ? Z.missing : Z.shade(L(n, {
597
+ domain: f,
598
598
  palette: p
599
- })), n.selected === e && Z.selected, n.inspected === e && Z.inspected, n.cursor === e && ae.cursor),
599
+ })), i.selected === e && Z.selected, i.inspected === e && Z.inspected, i.cursor === e && ae.cursor),
600
600
  children: t?.token !== void 0 && t.token !== null && /* @__PURE__ */ M(q, {
601
601
  text: t.token,
602
602
  shouldWrap: !1
@@ -658,22 +658,22 @@ var Q = {
658
658
  $$css: !0
659
659
  }, { "--x-opacity": e ?? void 0 }]
660
660
  };
661
- function ze({ tokens: e, links: t, domain: r }) {
662
- if (!g(r) || r[0] < 0) return "The weight domain must hold two finite, increasing values, starting at zero or above.";
661
+ function ze({ tokens: e, links: t, domain: n }) {
662
+ if (!g(n) || n[0] < 0) return "The weight domain must hold two finite, increasing values, starting at zero or above.";
663
663
  if (e.length > Q.tokens || t.length > Q.links) return `This chart draws at most ${Q.tokens} tokens and ${Q.links} links. Supply a shorter window or the strongest links.`;
664
- if (!n(e)) return "Tokens must have unique identifiers.";
665
- let i = new Set(e.map((e) => e.id)), a = new Set(t.map((e) => JSON.stringify([e.sourceId, e.destinationId])));
666
- if (t.some((e) => !i.has(e.sourceId) || !i.has(e.destinationId))) return "A link names a token the chart does not list.";
667
- if (a.size !== t.length) return "Each source and destination pair takes at most one link.";
668
- if (t.some((e) => h(e.weight, r))) return "A link weight is not finite or lies outside the weight domain.";
664
+ if (!a(e)) return "Tokens must have unique identifiers.";
665
+ let r = new Set(e.map((e) => e.id)), i = new Set(t.map((e) => JSON.stringify([e.sourceId, e.destinationId])));
666
+ if (t.some((e) => !r.has(e.sourceId) || !r.has(e.destinationId))) return "A link names a token the chart does not list.";
667
+ if (i.size !== t.length) return "Each source and destination pair takes at most one link.";
668
+ if (t.some((e) => h(e.weight, n))) return "A link weight is not finite or lies outside the weight domain.";
669
669
  }
670
670
  function Be(e) {
671
- let { tokens: t, links: n, weightLabel: r, valueFormat: o, domain: s, direction: c, selected: u, onSelectedChange: p, ...h } = e, { emptyLabel: g = "No tokens are available.", ..._ } = h, { locale: y, title: b } = _, x = T(), S = oe(), E = ee();
671
+ let { tokens: t, links: r, weightLabel: a, valueFormat: o, domain: c, direction: l, selected: d, onSelectedChange: p, ...h } = e, { emptyLabel: g = "No tokens are available.", ..._ } = h, { locale: y, title: b } = _, x = T(), S = oe(), E = ee();
672
672
  if (_.status === "loading") return /* @__PURE__ */ M(te, { ..._ });
673
673
  let A = ze({
674
674
  tokens: t,
675
- links: n,
676
- domain: s
675
+ links: r,
676
+ domain: c
677
677
  });
678
678
  if (A !== void 0) return /* @__PURE__ */ M(v, {
679
679
  ..._,
@@ -687,9 +687,9 @@ function Be(e) {
687
687
  });
688
688
  }
689
689
  function P(e) {
690
- return (e - s[0]) / (s[1] - s[0]);
690
+ return (e - c[0]) / (c[1] - c[0]);
691
691
  }
692
- let ce = Math.max(0, ...t.map((e) => Array.from(e.text).length)), F = Math.min(Oe, Math.max(De, ce * ke + Ae)), I = t.length > 0 ? Math.max(F, x.width / t.length) : F, L = Math.max(1, I * t.length), R = d({
692
+ let ce = Math.max(0, ...t.map((e) => Array.from(e.text).length)), F = Math.min(Oe, Math.max(De, ce * ke + Ae)), I = t.length > 0 ? Math.max(F, x.width / t.length) : F, L = Math.max(1, I * t.length), R = f({
693
693
  width: L,
694
694
  height: 176,
695
695
  margins: {
@@ -713,17 +713,17 @@ function Be(e) {
713
713
  return `${n.join("; ")}${r > 0 ? `; and ${r} more` : ""}`;
714
714
  }
715
715
  let H = z.map((e) => {
716
- let t = n.filter((t) => t.sourceId === e.id), i = n.filter((t) => t.destinationId === e.id);
716
+ let t = r.filter((t) => t.sourceId === e.id), n = r.filter((t) => t.destinationId === e.id);
717
717
  return {
718
718
  id: e.id,
719
- label: `${G(e.text)} at position ${e.position}. Attends to, by ${r}: ${V(i, "sourceId")}. Attended to by: ${V(t, "destinationId")}.`
719
+ label: `${G(e.text)} at position ${e.position}. Attends to, by ${a}: ${V(n, "sourceId")}. Attended to by: ${V(t, "destinationId")}.`
720
720
  };
721
721
  }), U = z.map((e) => ({
722
722
  id: e.id,
723
723
  x: e.x,
724
724
  y: 0
725
725
  }));
726
- return /* @__PURE__ */ M(f, {
726
+ return /* @__PURE__ */ M(i, {
727
727
  ...E,
728
728
  items: H,
729
729
  locate: O({
@@ -732,19 +732,19 @@ function Be(e) {
732
732
  height: R.height,
733
733
  axis: "x"
734
734
  }),
735
- selected: u,
735
+ selected: d,
736
736
  onSelect: p,
737
- render: (e, o) => {
738
- let u = o.inspected ?? o.selected;
737
+ render: (e, i) => {
738
+ let o = i.inspected ?? i.selected;
739
739
  return /* @__PURE__ */ M(re, {
740
740
  ..._,
741
741
  figure: e,
742
742
  scaleLegend: t.length === 0 ? void 0 : /* @__PURE__ */ N("div", {
743
743
  className: "xrvj5dj xunmzkg xeuugli x153jb6y xy8obcc xas2l8k",
744
- children: [/* @__PURE__ */ M("span", { children: `${Re[c]} Width and opacity follow ${r}:` }), /* @__PURE__ */ M("div", {
744
+ children: [/* @__PURE__ */ M("span", { children: `${Re[l]} Width and opacity follow ${a}:` }), /* @__PURE__ */ M("div", {
745
745
  className: "x78zum5 x1a02dak x6s0dn4 x8zbtdt x1gkm1c7 x153jb6y xy8obcc xas2l8k",
746
746
  children: Le.map((e) => {
747
- let t = s[0] + e * (s[1] - s[0]);
747
+ let t = c[0] + e * (c[1] - c[0]);
748
748
  return /* @__PURE__ */ N("span", {
749
749
  className: "x3nfvp2 x6s0dn4 xunmzkg xss6m8b",
750
750
  children: [/* @__PURE__ */ M("svg", {
@@ -770,41 +770,41 @@ function Be(e) {
770
770
  })
771
771
  })]
772
772
  }),
773
- footer: t.length === 0 ? void 0 : /* @__PURE__ */ M(a, {
773
+ footer: t.length === 0 ? void 0 : /* @__PURE__ */ M(s, {
774
774
  id: S,
775
- children: i(H, u)
775
+ children: n(H, o)
776
776
  }),
777
777
  children: t.length === 0 ? /* @__PURE__ */ M(ie, { children: g }) : /* @__PURE__ */ N(se, { children: [/* @__PURE__ */ M("div", {
778
778
  ref: x.ref,
779
779
  className: "xeuugli x41o525",
780
780
  children: /* @__PURE__ */ M(_e, {
781
- cursor: o.cursor,
781
+ cursor: i.cursor,
782
782
  children: /* @__PURE__ */ M("div", {
783
783
  ...k.props($.canvas(L)),
784
784
  children: /* @__PURE__ */ M(w, {
785
785
  plotRef: null,
786
786
  box: R,
787
- label: l({
787
+ label: u({
788
788
  title: b,
789
789
  marks: "tokens",
790
790
  isSelectable: p !== void 0
791
791
  }),
792
792
  readoutId: S,
793
793
  overlay: z.flatMap((e) => [0, R.bottom].map((t) => /* @__PURE__ */ M("span", {
794
- "data-token-cursor": t === 0 && o.cursor === e.id ? "" : void 0,
795
- ...k.props($.slot, $.chip(e.left, t, I), t === 0 && o.cursor === e.id && ae.cursor),
794
+ "data-token-cursor": t === 0 && i.cursor === e.id ? "" : void 0,
795
+ ...k.props($.slot, $.chip(e.left, t, I), t === 0 && i.cursor === e.id && ae.cursor),
796
796
  children: /* @__PURE__ */ M("span", {
797
797
  ...{
798
798
  0: { className: "x193iq5w xb3r6kr x14w6jbu xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xbixft x1r7kqkb xy8obcc xas2l8k" },
799
799
  1: { className: "x193iq5w xb3r6kr x14w6jbu xmkeg23 x1y0btm7 x1ok0vyi xbixft xy8obcc xas2l8k x159tnba xpvm0e4" }
800
- }[u === e.id | 0],
800
+ }[o === e.id | 0],
801
801
  children: /* @__PURE__ */ M(q, {
802
802
  text: e.text,
803
803
  shouldWrap: !1
804
804
  })
805
805
  })
806
806
  }, `${e.id}-${t}`))),
807
- children: n.filter((e) => u === null || e.sourceId === u || e.destinationId === u).map((e) => {
807
+ children: r.filter((e) => o === null || e.sourceId === o || e.destinationId === o).map((e) => {
808
808
  let t = B.get(e.sourceId), n = B.get(e.destinationId), r = P(e.weight);
809
809
  return t === void 0 || n === void 0 ? null : /* @__PURE__ */ M("g", {
810
810
  ...k.props($.strength(Ne + .75 * r)),
@@ -818,7 +818,7 @@ function Be(e) {
818
818
  }]),
819
819
  tone: "series1",
820
820
  width: je + Me * r,
821
- emphasis: u === null ? "receded" : "normal"
821
+ emphasis: o === null ? "receded" : "normal"
822
822
  })
823
823
  }, `${e.sourceId}\u0000${e.destinationId}`);
824
824
  })
@@ -838,10 +838,10 @@ function Be(e) {
838
838
  },
839
839
  {
840
840
  id: "weight",
841
- label: r
841
+ label: a
842
842
  }
843
843
  ],
844
- rows: n.map((e) => {
844
+ rows: r.map((e) => {
845
845
  let t = B.get(e.sourceId), n = B.get(e.destinationId);
846
846
  return {
847
847
  id: `${e.sourceId}\u0000${e.destinationId}`,
@@ -901,18 +901,18 @@ function $e(e) {
901
901
  };
902
902
  }
903
903
  function et(e, t) {
904
- let r = _(t);
905
- if (r !== void 0) return r;
904
+ let n = _(t);
905
+ if (n !== void 0) return n;
906
906
  if (t[0] > 0 || t[1] < 0) return "The value domain must hold zero, where the bars start.";
907
907
  if (e.length > Ve.rows) return `This chart draws at most ${Ve.rows} predictions. Supply the leading ones.`;
908
- if (!n(e)) return "Predictions must have unique identifiers.";
909
- let i = e.find((e) => [e.probability, e.baseline ?? null].some((e) => e !== null && h(e, t)));
910
- return i === void 0 ? void 0 : `Prediction ${i.id} has a value that is not finite or lies outside the value domain.`;
908
+ if (!a(e)) return "Predictions must have unique identifiers.";
909
+ let r = e.find((e) => [e.probability, e.baseline ?? null].some((e) => e !== null && h(e, t)));
910
+ return r === void 0 ? void 0 : `Prediction ${r.id} has a value that is not finite or lies outside the value domain.`;
911
911
  }
912
912
  function tt(e) {
913
- let { predictions: t, valueLabel: n = "Probability", valueFormat: r = Ze, domain: o, baselineLabel: d = "Baseline", selected: ee, onSelectedChange: h, ...g } = e, { emptyLabel: _ = "No predictions are available.", ...C } = g, { locale: D, title: A } = C, j = T(), P = oe();
913
+ let { predictions: t, valueLabel: r = "Probability", valueFormat: a = Ze, domain: o, baselineLabel: f = "Baseline", selected: ee, onSelectedChange: h, ...g } = e, { emptyLabel: _ = "No predictions are available.", ...C } = g, { locale: D, title: A } = C, j = T(), P = oe();
914
914
  if (C.status === "loading") return /* @__PURE__ */ M(te, { ...C });
915
- let ce = t.flatMap((e) => [e.probability, e.baseline ?? null]), F = o ?? s({
915
+ let ce = t.flatMap((e) => [e.probability, e.baseline ?? null]), F = o ?? c({
916
916
  values: ce,
917
917
  isZeroBased: !0
918
918
  }), I = et(t, F);
@@ -924,14 +924,14 @@ function tt(e) {
924
924
  return m({
925
925
  value: e,
926
926
  locale: D,
927
- format: r
927
+ format: a
928
928
  });
929
929
  }
930
930
  let R = t.some((e) => e.baseline !== void 0), z = {
931
- label: n,
931
+ label: r,
932
932
  domain: F,
933
- format: r
934
- }, B = c({
933
+ format: a
934
+ }, B = l({
935
935
  width: j.width,
936
936
  height: t.length * He + Ue,
937
937
  direction: "rows",
@@ -946,19 +946,19 @@ function tt(e) {
946
946
  valueDomain: F,
947
947
  locale: D
948
948
  }), { box: V, band: H } = B, U = B.value.position(0), W = t.map((e) => {
949
- let t = e.isTarget === !0 ? ` (${Xe})` : "", i = `${G(e.token)}${t}: ${n} ${L(e.probability)}`, { baseline: a } = e;
950
- if (a === void 0) return {
949
+ let t = e.isTarget === !0 ? ` (${Xe})` : "", n = `${G(e.token)}${t}: ${r} ${L(e.probability)}`, { baseline: i } = e;
950
+ if (i === void 0) return {
951
951
  id: e.id,
952
- label: i
952
+ label: n
953
953
  };
954
- let o = a === null || e.probability === null ? null : e.probability - a, s = m({
954
+ let o = i === null || e.probability === null ? null : e.probability - i, s = m({
955
955
  value: o,
956
956
  locale: D,
957
- format: $e(r)
957
+ format: $e(a)
958
958
  });
959
959
  return {
960
960
  id: e.id,
961
- label: `${i} · ${d} ${L(a)} · Change ${s}`
961
+ label: `${n} · ${f} ${L(i)} · Change ${s}`
962
962
  };
963
963
  }), le = t.flatMap((e) => {
964
964
  let t = H.center(e.id);
@@ -974,7 +974,7 @@ function tt(e) {
974
974
  height: H.step
975
975
  };
976
976
  }
977
- return /* @__PURE__ */ M(f, {
977
+ return /* @__PURE__ */ M(i, {
978
978
  items: W,
979
979
  arrows: "both",
980
980
  locate: O({
@@ -985,27 +985,27 @@ function tt(e) {
985
985
  }),
986
986
  selected: ee,
987
987
  onSelect: h,
988
- render: (e, { inspected: r, cursor: o, selected: s }) => /* @__PURE__ */ M(re, {
988
+ render: (e, { inspected: i, cursor: a, selected: o }) => /* @__PURE__ */ M(re, {
989
989
  ...C,
990
990
  figure: e,
991
991
  seriesLegend: R && t.length > 0 ? /* @__PURE__ */ M(p, { items: [{
992
992
  id: "value",
993
- label: n,
993
+ label: r,
994
994
  tone: "series1"
995
995
  }, {
996
996
  id: "baseline",
997
- label: d,
997
+ label: f,
998
998
  tone: "neutral",
999
999
  shape: "tick"
1000
1000
  }] }) : void 0,
1001
- footer: /* @__PURE__ */ M(a, {
1001
+ footer: /* @__PURE__ */ M(s, {
1002
1002
  id: P,
1003
- children: i(W, r)
1003
+ children: n(W, i)
1004
1004
  }),
1005
1005
  children: t.length === 0 ? /* @__PURE__ */ M(ie, { children: _ }) : /* @__PURE__ */ N(se, { children: [/* @__PURE__ */ N(w, {
1006
1006
  plotRef: j.ref,
1007
1007
  box: V,
1008
- label: l({
1008
+ label: u({
1009
1009
  title: A,
1010
1010
  marks: "predictions",
1011
1011
  isSelectable: h !== void 0
@@ -1025,20 +1025,20 @@ function tt(e) {
1025
1025
  })]
1026
1026
  }, e.id)),
1027
1027
  children: [
1028
- t.filter((e) => e.id === r || e.id === s).map((e) => /* @__PURE__ */ M("rect", {
1028
+ t.filter((e) => e.id === i || e.id === o).map((e) => /* @__PURE__ */ M("rect", {
1029
1029
  x: V.left,
1030
1030
  width: V.innerWidth,
1031
1031
  ...ue(e.id),
1032
1032
  ...{
1033
1033
  0: { className: "x47corl x2wnxhi" },
1034
1034
  1: { className: "x47corl xzmcrz1" }
1035
- }[e.id === s | 0]
1035
+ }[e.id === o | 0]
1036
1036
  }, e.id)),
1037
1037
  /* @__PURE__ */ M(y, {
1038
1038
  box: V,
1039
1039
  xTicks: B.valueTicks,
1040
1040
  yTicks: [],
1041
- xTitle: u(z),
1041
+ xTitle: d(z),
1042
1042
  grid: "x"
1043
1043
  }),
1044
1044
  /* @__PURE__ */ M(E, {
@@ -1051,7 +1051,7 @@ function tt(e) {
1051
1051
  width: Math.abs(i - U),
1052
1052
  height: H.bandwidth,
1053
1053
  tone: "series1",
1054
- isSelected: e.id === s
1054
+ isSelected: e.id === o
1055
1055
  }), r !== null && /* @__PURE__ */ M(x, {
1056
1056
  x1: B.value.position(r),
1057
1057
  x2: B.value.position(r),
@@ -1069,10 +1069,10 @@ function tt(e) {
1069
1069
  children: t
1070
1070
  }, e.id);
1071
1071
  }),
1072
- o !== null && /* @__PURE__ */ M("rect", {
1072
+ a !== null && /* @__PURE__ */ M("rect", {
1073
1073
  x: V.left,
1074
1074
  width: V.innerWidth,
1075
- ...ue(o),
1075
+ ...ue(a),
1076
1076
  ...k.props(Qe.pointerless, Qe.cursor, ae.cursor)
1077
1077
  })
1078
1078
  ]