@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
@@ -3,16 +3,16 @@ import { k as t } from "./src-9EJskqB_.js";
3
3
  import { b as n, v as r } from "./src-Dxs3Buo_.js";
4
4
  import { t as i } from "./forms-CEbwzlRR.js";
5
5
  import { t as a } from "./chart-tones-ei3BC2AL.js";
6
- import { A as o, O as s, S as c, T as l, a as u, c as d, k as ee, l as f, n as te, o as p, s as m, t as h, w as ne, x as re } from "./plot-layout-Bqe4-0qZ.js";
7
- import { i as g } from "./chart-link-AE_xuxiP.js";
8
- import { a as _ } from "./tone-scope-DKiSw-JR.js";
9
- import { r as v } from "./figure-format-B8kRZMlo.js";
10
- import { a as y, n as b, o as x, r as S } from "./scale-C2xgZyZN.js";
11
- import { i as ie, l as ae, n as oe, r as se, t as ce } from "./figure-frame-BjFzbl3m.js";
6
+ import { A as o, D as s, E as c, M as l, S as u, a as d, c as f, j as ee, l as p, n as te, o as m, s as h, t as g, x as ne } from "./plot-layout-B2xRt-_k.js";
7
+ import { i as _ } from "./chart-link-AE_xuxiP.js";
8
+ import { a as v } from "./tone-scope-DKiSw-JR.js";
9
+ import { r as y } from "./figure-format-B8kRZMlo.js";
10
+ import { a as b, n as x, o as S, r as re } from "./scale-C2xgZyZN.js";
11
+ import { i as ie, l as ae, n as oe, r as se, t as ce } from "./figure-frame-koVKcXph.js";
12
12
  import { n as C } from "./plot-width-D3hTycYX.js";
13
13
  import { t as le } from "./plot-axes-D5S9BnBa.js";
14
14
  import { a as w, c as ue, l as T } from "./plot-marks-FVsbFkUs.js";
15
- import { n as de, r as fe, t as pe } from "./plot-surface-DON6WUmk.js";
15
+ import { n as de, r as fe, t as pe } from "./plot-surface-0cKFwtws.js";
16
16
  import { n as E, r as D } from "./path-BglsXpnO.js";
17
17
  import { t as O } from "./color-legend-CIo7DhXB.js";
18
18
  import { a as k, c as A, d as j, i as M, l as me, n as N, o as P, r as he, s as F, t as I, u as L } from "./point-layer-C-EYETAt.js";
@@ -56,26 +56,26 @@ var G = {
56
56
  paths: 6,
57
57
  pointsPerPath: 2e3,
58
58
  markers: 12
59
- }, we = 2, Te = "level:", Ee = 4, De = 45, K = 5, q = 14, J = 3.5, Y = 6, Oe = 9, ke = .5, Ae = 12, je = 4, X = 7, Z = 4;
60
- function Q({ x: e, y: t, text: n }) {
61
- let r = n.length * X / 2 + Z;
59
+ }, we = 2, Te = "level:", Ee = 4, K = 45, q = 5, J = 14, Y = 3.5, X = 6, De = 9, Oe = .5, ke = 12, Ae = 4, Z = 7, Q = 4;
60
+ function $({ x: e, y: t, text: n }) {
61
+ let r = n.length * Z / 2 + Q;
62
62
  return {
63
63
  x0: e - r,
64
64
  x1: e + r,
65
- y0: t - Ae - Z,
66
- y1: t + je + Z
65
+ y0: t - ke - Q,
66
+ y1: t + Ae + Q
67
67
  };
68
68
  }
69
- function Me(e, t) {
69
+ function je(e, t) {
70
70
  let n = e.x0 < t.x1 && t.x0 < e.x1, r = e.y0 < t.y1 && t.y0 < e.y1;
71
71
  return n && r;
72
72
  }
73
- var Ne = {
73
+ var Me = {
74
74
  kDwRjp: "xbh8q5q",
75
75
  $$css: !0
76
- }, Pe = {
76
+ }, Ne = {
77
77
  level: (e) => [
78
- Ne,
78
+ Me,
79
79
  {
80
80
  kjVXCG: e == null ? e : "x6mkzkt",
81
81
  $$css: !0
@@ -92,12 +92,12 @@ var Ne = {
92
92
  $$css: !0
93
93
  }
94
94
  };
95
- function Fe({ index: t, count: n }) {
96
- let r = De + 55 * (n > 1 ? t / (n - 1) : 1);
95
+ function Pe({ index: t, count: n }) {
96
+ let r = K + 55 * (n > 1 ? t / (n - 1) : 1);
97
97
  return `color-mix(in srgb, ${a.series1} ${r}%, ${e.surface})`;
98
98
  }
99
- function Ie({ grid: e, levels: t, paths: n, markers: r, xDomain: i, yDomain: a, x: o, y: s }) {
100
- let c = x(e.xDomain) ?? x(e.yDomain) ?? x(i, o.scale) ?? x(a, s.scale);
99
+ function Fe({ grid: e, levels: t, paths: n, markers: r, xDomain: i, yDomain: a, x: o, y: s }) {
100
+ let c = S(e.xDomain) ?? S(e.yDomain) ?? S(i, o.scale) ?? S(a, s.scale);
101
101
  if (c !== void 0) return c;
102
102
  if (!(Number.isInteger(e.columns) && Number.isInteger(e.rows)) || e.columns < we || e.rows < we) return `The grid needs at least ${we} columns and ${we} rows.`;
103
103
  if (e.columns > G.columns || e.rows > G.rows) return `This chart draws a grid of at most ${G.columns} by ${G.rows} samples. Supply a coarser sample.`;
@@ -112,18 +112,18 @@ function Ie({ grid: e, levels: t, paths: n, markers: r, xDomain: i, yDomain: a,
112
112
  if (new Set(l).size !== l.length || l.some((e) => e.startsWith(Te))) return `Paths and markers need unique identifiers that do not start with "${Te}".`;
113
113
  let u = [...n.flatMap((e) => e.points), ...r];
114
114
  if (n.some((e) => e.points.length > G.pointsPerPath)) return `A path exceeds ${G.pointsPerPath} points. Supply a coarser sample.`;
115
- if (u.some((e) => y(e.x, i) || y(e.y, a))) return "A path or marker lies outside the declared domain.";
115
+ if (u.some((e) => b(e.x, i) || b(e.y, a))) return "A path or marker lies outside the declared domain.";
116
116
  }
117
- function Le(e) {
118
- let { grid: t, levels: n, x: r, y: i, value: a, path: o = [], markers: l = [], height: u = "tall", selected: d, onSelectedChange: f, ...m } = e, { emptyLabel: h = "No surface is available.", ...g } = m, { locale: y, title: b } = g, x = fe(u), S = ge(), E = _();
119
- if (g.status === "loading") return /* @__PURE__ */ H(ie, {
120
- ...g,
121
- height: u
117
+ function Ie(e) {
118
+ let { grid: t, levels: n, x: r, y: i, value: a, path: s = [], markers: l = [], height: d = "tall", selected: f, onSelectedChange: p, ...h } = e, { emptyLabel: g = "No surface is available.", ..._ } = h, { locale: b, title: x } = _, S = fe(d), re = ge(), E = v();
119
+ if (_.status === "loading") return /* @__PURE__ */ H(ie, {
120
+ ..._,
121
+ height: d
122
122
  });
123
- let O = r.domain ?? t.xDomain, k = i.domain ?? t.yDomain, A = t.values.length === 0, M = A ? void 0 : Ie({
123
+ let O = r.domain ?? t.xDomain, k = i.domain ?? t.yDomain, A = t.values.length === 0, M = A ? void 0 : Fe({
124
124
  grid: t,
125
125
  levels: n,
126
- paths: o,
126
+ paths: s,
127
127
  markers: l,
128
128
  xDomain: O,
129
129
  yDomain: k,
@@ -131,17 +131,17 @@ function Le(e) {
131
131
  y: i
132
132
  });
133
133
  if (M !== void 0) return /* @__PURE__ */ H(se, {
134
- ...g,
134
+ ..._,
135
135
  message: M
136
136
  });
137
- let N = p({
138
- width: x.width,
139
- height: x.height,
137
+ let N = m({
138
+ width: S.width,
139
+ height: S.height,
140
140
  x: r,
141
141
  y: i,
142
142
  xDomain: O,
143
143
  yDomain: k,
144
- locale: y
144
+ locale: b
145
145
  }), { box: P } = N, he = t.xDomain[1] - t.xDomain[0], F = t.yDomain[1] - t.yDomain[0];
146
146
  function I(e) {
147
147
  return {
@@ -150,9 +150,9 @@ function Le(e) {
150
150
  };
151
151
  }
152
152
  function z(e) {
153
- return v({
153
+ return y({
154
154
  value: e,
155
- locale: y,
155
+ locale: b,
156
156
  format: a.format
157
157
  });
158
158
  }
@@ -177,7 +177,7 @@ function Le(e) {
177
177
  return {
178
178
  id: `${Te}${r}`,
179
179
  level: e,
180
- color: Fe({
180
+ color: Pe({
181
181
  index: r,
182
182
  count: n.length
183
183
  }),
@@ -188,12 +188,12 @@ function Le(e) {
188
188
  midpoints: i.map((e) => {
189
189
  let t = I(e.from), n = I(e.to);
190
190
  return {
191
- x: (t.x + n.x) * ke,
192
- y: (t.y + n.y) * ke
191
+ x: (t.x + n.x) * Oe,
192
+ y: (t.y + n.y) * Oe
193
193
  };
194
194
  })
195
195
  };
196
- }), ve = (P.left + P.right) * ke, ye = (P.top + P.bottom) * ke, be = o.map((e, t) => ({
196
+ }), ve = (P.left + P.right) * Oe, ye = (P.top + P.bottom) * Oe, be = s.map((e, t) => ({
197
197
  ...e,
198
198
  tone: E({
199
199
  id: e.id,
@@ -216,56 +216,56 @@ function Le(e) {
216
216
  y0: P.top,
217
217
  x1: P.right,
218
218
  y1: P.bottom
219
- }, we = W.flatMap((e) => [Q({
219
+ }, we = W.flatMap((e) => [$({
220
220
  x: e.px,
221
- y: e.py - K - Y,
221
+ y: e.py - q - X,
222
222
  text: e.label
223
223
  }), {
224
- x0: e.px - K - Z,
225
- x1: e.px + K + Z,
226
- y0: e.py - K - Z,
227
- y1: e.py + K + Z
224
+ x0: e.px - q - Q,
225
+ x1: e.px + q + Q,
226
+ y0: e.py - q - Q,
227
+ y1: e.py + q + Q
228
228
  }]);
229
- function* De() {
229
+ function* K() {
230
230
  let e = { taken: we };
231
231
  for (let t of V.filter((e, t) => t % Se === 0)) {
232
232
  let n = z(t.level), r = t.midpoints.toSorted((e, t) => (e.x - ve) ** 2 + (e.y - ye) ** 2 - ((t.x - ve) ** 2 + (t.y - ye) ** 2)).map((e) => ({
233
233
  id: t.id,
234
234
  text: n,
235
235
  x: e.x,
236
- y: e.y - Y
236
+ y: e.y - X
237
237
  })).find((t) => {
238
- let n = Q(t), r = n.x0 >= G.x0 && n.x1 <= G.x1, i = n.y0 >= G.y0 && n.y1 <= G.y1;
239
- return r && i && !e.taken.some((e) => Me(n, e));
238
+ let n = $(t), r = n.x0 >= G.x0 && n.x1 <= G.x1, i = n.y0 >= G.y0 && n.y1 <= G.y1;
239
+ return r && i && !e.taken.some((e) => je(n, e));
240
240
  });
241
- r !== void 0 && (e.taken = [...e.taken, Q(r)], yield r);
241
+ r !== void 0 && (e.taken = [...e.taken, $(r)], yield r);
242
242
  }
243
243
  }
244
- let Ae = Array.from(De()), je = [...V.map((e) => ({
244
+ let ke = Array.from(K()), Ae = [...V.map((e) => ({
245
245
  id: e.id,
246
246
  label: `${a.label} level ${z(e.level)}`
247
247
  })), ...W.map((e) => ({
248
248
  id: e.id,
249
249
  label: [
250
250
  e.label,
251
- `${r.label}: ${v({
251
+ `${r.label}: ${y({
252
252
  value: e.x,
253
- locale: y,
253
+ locale: b,
254
254
  format: r.format
255
255
  })}`,
256
- `${i.label}: ${v({
256
+ `${i.label}: ${y({
257
257
  value: e.y,
258
- locale: y,
258
+ locale: b,
259
259
  format: i.format
260
260
  })}`,
261
261
  `${a.label} is ${_e(B(e))}`
262
262
  ].join(" · ")
263
263
  }))];
264
- function X(e) {
264
+ function Z(e) {
265
265
  let t = e.x / e.width * P.width, n = e.y / e.height * P.height, r = W.map((e) => ({
266
266
  id: e.id,
267
267
  distance: Math.hypot(e.px - t, e.py - n)
268
- })).filter((e) => e.distance <= q).toSorted((e, t) => e.distance - t.distance)[0];
268
+ })).filter((e) => e.distance <= J).toSorted((e, t) => e.distance - t.distance)[0];
269
269
  if (r !== void 0) return r.id;
270
270
  let i = B({
271
271
  x: N.x.valueAt(t),
@@ -276,24 +276,24 @@ function Le(e) {
276
276
  distance: Math.abs(e.level - (i ?? NaN))
277
277
  })).filter((e) => !Number.isNaN(e.distance)).toSorted((e, t) => e.distance - t.distance)[0]?.id;
278
278
  }
279
- let Ne = be.map((e) => ({
279
+ let Me = be.map((e) => ({
280
280
  id: e.id,
281
281
  label: e.label,
282
282
  tone: e.tone,
283
283
  shape: "line"
284
284
  }));
285
- return /* @__PURE__ */ H(ne, {
286
- items: je,
287
- locate: X,
288
- selected: d,
289
- onSelect: f,
290
- render: (e, { inspected: t, selected: n, cursor: o }) => {
291
- let l = V.filter((e) => e.id === t || e.id === n), u = V.find((e) => e.id === o), d = W.find((e) => e.id === o);
285
+ return /* @__PURE__ */ H(c, {
286
+ items: Ae,
287
+ locate: Z,
288
+ selected: f,
289
+ onSelect: p,
290
+ render: (e, { inspected: t, selected: n, cursor: s }) => {
291
+ let c = V.filter((e) => e.id === t || e.id === n), l = V.find((e) => e.id === s), d = W.find((e) => e.id === s);
292
292
  return /* @__PURE__ */ H(oe, {
293
- ...g,
293
+ ..._,
294
294
  figure: e,
295
- series: Ne,
296
- seriesLegend: Ne.length > 0 ? /* @__PURE__ */ H(re, { items: Ne }) : void 0,
295
+ series: Me,
296
+ seriesLegend: Me.length > 0 ? /* @__PURE__ */ H(ne, { items: Me }) : void 0,
297
297
  scaleLegend: A ? void 0 : /* @__PURE__ */ H(Ce, {
298
298
  label: `${a.label} levels`,
299
299
  entries: V.map((e) => ({
@@ -302,19 +302,19 @@ function Le(e) {
302
302
  color: e.color
303
303
  }))
304
304
  }),
305
- footer: A ? void 0 : /* @__PURE__ */ H(c, {
306
- id: S,
307
- children: s(je, t ?? n)
305
+ footer: A ? void 0 : /* @__PURE__ */ H(u, {
306
+ id: re,
307
+ children: o(Ae, t ?? n)
308
308
  }),
309
- children: A ? /* @__PURE__ */ H(ce, { children: h }) : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ U(de, {
310
- plotRef: x.ref,
309
+ children: A ? /* @__PURE__ */ H(ce, { children: g }) : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ U(de, {
310
+ plotRef: S.ref,
311
311
  box: P,
312
312
  label: ee({
313
- title: b,
313
+ title: x,
314
314
  marks: "levels and markers",
315
- isSelectable: f !== void 0
315
+ isSelectable: p !== void 0
316
316
  }),
317
- readoutId: S,
317
+ readoutId: re,
318
318
  children: [
319
319
  /* @__PURE__ */ H(le, {
320
320
  box: P,
@@ -329,15 +329,15 @@ function Le(e) {
329
329
  children: [
330
330
  V.map((e) => /* @__PURE__ */ H("path", {
331
331
  d: e.d,
332
- ...R.props(C.mark, C.emphasis, Pe.level(e.color))
332
+ ...R.props(C.mark, C.emphasis, Ne.level(e.color))
333
333
  }, e.id)),
334
- l.map((e) => /* @__PURE__ */ H("path", {
334
+ c.map((e) => /* @__PURE__ */ H("path", {
335
335
  d: e.d,
336
- ...R.props(C.mark, Pe.level(e.color), Pe.focused)
336
+ ...R.props(C.mark, Ne.level(e.color), Ne.focused)
337
337
  }, e.id)),
338
- u !== void 0 && /* @__PURE__ */ H("path", {
339
- d: u.d,
340
- ...R.props(C.shapeCursor, Pe.cursor)
338
+ l !== void 0 && /* @__PURE__ */ H("path", {
339
+ d: l.d,
340
+ ...R.props(C.shapeCursor, Ne.cursor)
341
341
  }),
342
342
  be.map((e) => /* @__PURE__ */ U("g", { children: [
343
343
  /* @__PURE__ */ H(T, {
@@ -348,33 +348,33 @@ function Le(e) {
348
348
  x: t.x,
349
349
  y: t.y,
350
350
  tone: e.tone,
351
- radius: J,
351
+ radius: Y,
352
352
  isHollow: !0
353
353
  }, "start")),
354
354
  e.positions.slice(-1).map((t) => /* @__PURE__ */ H(w, {
355
355
  x: t.x,
356
356
  y: t.y,
357
357
  tone: e.tone,
358
- radius: J
358
+ radius: Y
359
359
  }, "end"))
360
360
  ] }, e.id)),
361
361
  W.map((e) => /* @__PURE__ */ H(w, {
362
362
  x: e.px,
363
363
  y: e.py,
364
364
  tone: e.tone,
365
- radius: K,
365
+ radius: q,
366
366
  isInspected: e.id === t,
367
367
  isSelected: e.id === n
368
368
  }, e.id)),
369
369
  d !== void 0 && /* @__PURE__ */ H("circle", {
370
370
  cx: d.px,
371
371
  cy: d.py,
372
- r: Oe,
373
- ...R.props(C.shapeCursor, Pe.cursor)
372
+ r: De,
373
+ ...R.props(C.shapeCursor, Ne.cursor)
374
374
  })
375
375
  ]
376
376
  }),
377
- Ae.map((e) => /* @__PURE__ */ H(ue, {
377
+ ke.map((e) => /* @__PURE__ */ H(ue, {
378
378
  x: e.x,
379
379
  y: e.y,
380
380
  anchor: "middle",
@@ -382,19 +382,19 @@ function Le(e) {
382
382
  }, e.id)),
383
383
  W.map((e) => /* @__PURE__ */ H(ue, {
384
384
  x: e.px,
385
- y: e.py - K - Y,
385
+ y: e.py - q - X,
386
386
  anchor: "middle",
387
387
  tone: e.tone,
388
388
  children: e.label
389
389
  }, e.id))
390
390
  ]
391
391
  }), /* @__PURE__ */ H(ae, {
392
- label: `${b} levels and markers`,
392
+ label: `${x} levels and markers`,
393
393
  columns: [{
394
394
  id: "item",
395
395
  label: "Level or marker"
396
396
  }],
397
- rows: je.map((e) => ({
397
+ rows: Ae.map((e) => ({
398
398
  id: e.id,
399
399
  values: [e.label]
400
400
  }))
@@ -404,50 +404,50 @@ function Le(e) {
404
404
  });
405
405
  }
406
406
  // packages/charts/src/relationship/measures.ts
407
- var Re = 2;
408
- function ze(e, t) {
407
+ var Le = 2;
408
+ function Re(e, t) {
409
409
  return e.values[t.id] ?? null;
410
410
  }
411
- function Be({ dimensions: e, rows: t }) {
411
+ function ze({ dimensions: e, rows: t }) {
412
412
  return e.map((e) => ({
413
413
  ...e,
414
- domain: e.domain ?? u({
415
- values: t.map((t) => ze(t, e)),
414
+ domain: e.domain ?? d({
415
+ values: t.map((t) => Re(t, e)),
416
416
  scale: e.scale
417
417
  })
418
418
  }));
419
419
  }
420
- function Ve({ axes: e, rows: t, groups: n, limits: r }) {
421
- if (e.length < Re || e.length > r.dimensions) return `This chart needs ${Re} to ${r.dimensions} dimensions.`;
420
+ function Be({ axes: e, rows: t, groups: n, limits: r }) {
421
+ if (e.length < Le || e.length > r.dimensions) return `This chart needs ${Le} to ${r.dimensions} dimensions.`;
422
422
  if (t.length > r.rows) return `This chart draws at most ${r.rows} rows. Supply a sample or a smaller set.`;
423
- if (!o(e) || !o(t) || !o(n)) return "Dimensions, rows and groups must have unique identifiers.";
424
- let i = e.map((e) => x(e.domain, e.scale)).find((e) => e !== void 0);
423
+ if (!l(e) || !l(t) || !l(n)) return "Dimensions, rows and groups must have unique identifiers.";
424
+ let i = e.map((e) => S(e.domain, e.scale)).find((e) => e !== void 0);
425
425
  if (i !== void 0) return i;
426
- let a = new Set(n.map((e) => e.id)), s = t.find((e) => e.group !== void 0 && !a.has(e.group));
427
- if (s !== void 0) return `Row ${s.id} names a group that was not supplied.`;
428
- let c = t.flatMap((t) => e.map((e) => ({
426
+ let a = new Set(n.map((e) => e.id)), o = t.find((e) => e.group !== void 0 && !a.has(e.group));
427
+ if (o !== void 0) return `Row ${o.id} names a group that was not supplied.`;
428
+ let s = t.flatMap((t) => e.map((e) => ({
429
429
  row: t,
430
430
  axis: e,
431
- value: ze(t, e)
432
- }))).find(({ axis: e, value: t }) => t !== null && y(t, e.domain));
433
- if (c !== void 0) return `Row ${c.row.id} has a ${c.axis.label} value that is not finite or lies outside the declared domain.`;
431
+ value: Re(t, e)
432
+ }))).find(({ axis: e, value: t }) => t !== null && b(t, e.domain));
433
+ if (s !== void 0) return `Row ${s.row.id} has a ${s.axis.label} value that is not finite or lies outside the declared domain.`;
434
434
  }
435
- function He({ row: e, axes: t, locale: n, groupLabel: r, consequence: i }) {
436
- let a = t.map((t) => `${t.label}: ${v({
437
- value: ze(e, t),
435
+ function Ve({ row: e, axes: t, locale: n, groupLabel: r, consequence: i }) {
436
+ let a = t.map((t) => `${t.label}: ${y({
437
+ value: Re(e, t),
438
438
  locale: n,
439
439
  format: t.format
440
- })}`), o = t.filter((t) => ze(e, t) === null).map((e) => e.label), s = o.length === 0 ? [] : [`No value for ${o.join(", ")}: ${i}`];
440
+ })}`), o = t.filter((t) => Re(e, t) === null).map((e) => e.label), s = o.length === 0 ? [] : [`No value for ${o.join(", ")}: ${i}`];
441
441
  return [
442
442
  r === void 0 ? e.label : `${e.label} (${r})`,
443
443
  ...a,
444
444
  ...s
445
445
  ].join(" · ");
446
446
  }
447
- function Ue({ rows: e, axes: t, locale: n, groupLabel: r, consequence: i }) {
447
+ function He({ rows: e, axes: t, locale: n, groupLabel: r, consequence: i }) {
448
448
  return e.map((e) => ({
449
449
  id: e.id,
450
- label: He({
450
+ label: Ve({
451
451
  row: e,
452
452
  axes: t,
453
453
  locale: n,
@@ -456,7 +456,7 @@ function Ue({ rows: e, axes: t, locale: n, groupLabel: r, consequence: i }) {
456
456
  })
457
457
  }));
458
458
  }
459
- function We({ rows: e, axes: t, locale: n }) {
459
+ function Ue({ rows: e, axes: t, locale: n }) {
460
460
  return {
461
461
  columns: [{
462
462
  id: "row",
@@ -467,16 +467,16 @@ function We({ rows: e, axes: t, locale: n }) {
467
467
  }))],
468
468
  rows: e.map((e) => ({
469
469
  id: e.id,
470
- values: [e.label, ...t.map((t) => v({
471
- value: ze(e, t),
470
+ values: [e.label, ...t.map((t) => y({
471
+ value: Re(e, t),
472
472
  locale: n,
473
473
  format: t.format
474
474
  }))]
475
475
  }))
476
476
  };
477
477
  }
478
- function Ge(e) {
479
- let t = _(), n = e.map((e, n) => ({
478
+ function We(e) {
479
+ let t = v(), n = e.map((e, n) => ({
480
480
  id: e.id,
481
481
  label: e.label,
482
482
  tone: t({
@@ -492,8 +492,8 @@ function Ge(e) {
492
492
  };
493
493
  }
494
494
  // packages/charts/src/relationship/range-controls.tsx
495
- var Ke = 1e3;
496
- function qe({ axes: e, ranges: a, locale: o, matching: s, total: c, onChange: l }) {
495
+ var Ge = 1e3;
496
+ function Ke({ axes: e, ranges: a, locale: o, matching: s, total: c, onChange: l }) {
497
497
  let u = Object.keys(a).length > 0;
498
498
  return /* @__PURE__ */ U("details", {
499
499
  className: "xrvj5dj x1n8ia3y xeuugli xbixft x1hz01jw xtqrqnz x1778rvt",
@@ -516,11 +516,11 @@ function qe({ axes: e, ranges: a, locale: o, matching: s, total: c, onChange: l
516
516
  }) }), /* @__PURE__ */ H("div", {
517
517
  className: "xrvj5dj xrhm57f x1n8ia3y",
518
518
  children: e.map((e) => {
519
- let [t, s] = a[e.id] ?? e.domain, c = typeof e.format == "function" ? {} : { format: e.format }, u = (e.domain[1] - e.domain[0]) / Ke, d = `${v({
519
+ let [t, s] = a[e.id] ?? e.domain, c = typeof e.format == "function" ? {} : { format: e.format }, u = (e.domain[1] - e.domain[0]) / Ge, d = `${y({
520
520
  value: e.domain[0],
521
521
  locale: o,
522
522
  format: e.format
523
- })} to ${v({
523
+ })} to ${y({
524
524
  value: e.domain[1],
525
525
  locale: o,
526
526
  format: e.format
@@ -572,10 +572,10 @@ function qe({ axes: e, ranges: a, locale: o, matching: s, total: c, onChange: l
572
572
  });
573
573
  }
574
574
  // packages/charts/src/relationship/parallel-coordinates.tsx
575
- var Je = {
575
+ var qe = {
576
576
  dimensions: 12,
577
577
  rows: 500
578
- }, Ye = {
578
+ }, Je = {
579
579
  ink: {
580
580
  kjVXCG: "x17y187c",
581
581
  kfJifR: "x1ip4yf",
@@ -586,101 +586,101 @@ var Je = {
586
586
  kfJifR: "xvlca1e",
587
587
  $$css: !0
588
588
  }
589
- }, Xe = 7, Ze = 16, Qe = 140, $e = 24, et = 32, tt = 18, nt = 140, rt = 16, it = 72, at = 8, ot = 40, st = .64, ct = .77, lt = .3, ut = 4, dt = 8, ft = 4, pt = 48, mt = 10, ht = 10, gt = .5, _t = 3, vt = 2, yt = 18;
590
- function* bt({ ticks: e, scale: t }) {
589
+ }, Ye = 7, Xe = 16, Ze = 140, Qe = 24, $e = 32, et = 18, tt = 140, nt = 16, rt = 72, it = 8, at = 40, ot = .64, st = .77, ct = .3, lt = 4, ut = 8, dt = 4, ft = 48, pt = 10, mt = 10, ht = .5, gt = 3, _t = 2, vt = 18;
590
+ function* yt({ ticks: e, scale: t }) {
591
591
  let n = { last: -Infinity };
592
592
  for (let r of e) {
593
593
  let e = t.position(r.value);
594
- Math.abs(e - n.last) >= yt && (n.last = e, yield r);
594
+ Math.abs(e - n.last) >= vt && (n.last = e, yield r);
595
595
  }
596
596
  }
597
- function xt({ ranges: e, axes: t }) {
597
+ function bt({ ranges: e, axes: t }) {
598
598
  let n = Object.entries(e), r = n.find(([e]) => !t.some((t) => t.id === e));
599
599
  if (r !== void 0) return `A range names the dimension ${r[0]}, which was not supplied.`;
600
600
  let i = n.find(([e, n]) => {
601
- let r = t.find((t) => t.id === e)?.domain, i = n[0] > n[1], a = r !== void 0 && (y(n[0], r) || y(n[1], r));
601
+ let r = t.find((t) => t.id === e)?.domain, i = n[0] > n[1], a = r !== void 0 && (b(n[0], r) || b(n[1], r));
602
602
  return i || a;
603
603
  });
604
604
  return i === void 0 ? void 0 : `The range on ${i[0]} is not finite, is reversed or lies outside its domain.`;
605
605
  }
606
- function St({ row: e, axes: t, ranges: n }) {
606
+ function xt({ row: e, axes: t, ranges: n }) {
607
607
  return t.every((t) => {
608
- let r = n[t.id], i = ze(e, t);
608
+ let r = n[t.id], i = Re(e, t);
609
609
  return r === void 0 || i !== null && i >= r[0] && i <= r[1];
610
610
  });
611
611
  }
612
- function Ct(e) {
613
- let { dimensions: t, rows: n, groups: r = [], ranges: i = {}, onRangesChange: a, height: o = "regular", selected: l, onSelectedChange: u, ...d } = e, { emptyLabel: te = "No rows are available.", ...p } = d, { locale: _, title: v } = p, y = fe(o), b = ge(), x = g(), { toneOf: le, groupLabel: ue, legend: O } = Ge(r), [k, A] = V(null), j = _e(null);
614
- if (z(() => () => j.current?.(), []), p.status === "loading") return /* @__PURE__ */ H(ie, {
615
- ...p,
616
- height: o
612
+ function St(e) {
613
+ let { dimensions: t, rows: n, groups: r = [], ranges: i = {}, onRangesChange: a, height: s = "regular", selected: l, onSelectedChange: d, ...f } = e, { emptyLabel: te = "No rows are available.", ...m } = f, { locale: v, title: y } = m, b = fe(s), x = ge(), S = _(), { toneOf: le, groupLabel: ue, legend: O } = We(r), [k, A] = V(null), j = _e(null);
614
+ if (z(() => () => j.current?.(), []), m.status === "loading") return /* @__PURE__ */ H(ie, {
615
+ ...m,
616
+ height: s
617
617
  });
618
- let M = Be({
618
+ let M = ze({
619
619
  dimensions: t,
620
620
  rows: n
621
- }), me = Ve({
621
+ }), me = Be({
622
622
  axes: M,
623
623
  rows: n,
624
624
  groups: r,
625
- limits: Je
626
- }) ?? xt({
625
+ limits: qe
626
+ }) ?? bt({
627
627
  ranges: i,
628
628
  axes: M
629
629
  });
630
630
  if (me !== void 0) return /* @__PURE__ */ H(se, {
631
- ...p,
631
+ ...m,
632
632
  message: me
633
633
  });
634
634
  let N = k === null ? i : {
635
635
  ...i,
636
636
  [k.id]: k.range
637
- }, P = M.length, he = (y.width - Qe) / (P - 1), F = he >= it, I = M.map((e) => {
638
- let { values: t, labels: n } = h({
637
+ }, P = M.length, he = (b.width - Ze) / (P - 1), F = he >= rt, I = M.map((e) => {
638
+ let { values: t, labels: n } = g({
639
639
  axis: e,
640
640
  domain: e.domain,
641
- length: y.height,
642
- spacing: pt,
643
- locale: _,
641
+ length: b.height,
642
+ spacing: ft,
643
+ locale: v,
644
644
  hasTitle: !0
645
645
  });
646
646
  return t.map((e, t) => ({
647
647
  value: e,
648
648
  label: n[t] ?? ""
649
649
  }));
650
- }), L = F ? f({
651
- width: y.width,
650
+ }), L = F ? p({
651
+ width: b.width,
652
652
  valueLabels: I.flatMap((e) => e.map((e) => e.label)),
653
653
  hasXTitle: !1,
654
654
  hasYTitle: !1
655
- }).left : Ze, B = M.some((e) => e.label.length * Xe > he - at), W = Math.max(0, ...M.map((e) => e.label.length)), Se = B ? Math.ceil(W * Xe * st) : 0, Ce = B ? 0 : M[0]?.label.length ?? 0, G = M[P - 1]?.label.length ?? 0, we = B ? G * ct : G * gt, Te = Math.max(L, Math.ceil(Ce * Xe * gt)), Ee = Math.max($e, Math.min(y.width * lt, Math.ceil(we * Xe))), De = Math.min(nt, et + Se), K = m({
656
- width: y.width,
657
- height: y.height + De - et,
655
+ }).left : Xe, B = M.some((e) => e.label.length * Ye > he - it), W = Math.max(0, ...M.map((e) => e.label.length)), Se = B ? Math.ceil(W * Ye * ot) : 0, Ce = B ? 0 : M[0]?.label.length ?? 0, G = M[P - 1]?.label.length ?? 0, we = B ? G * st : G * ht, Te = Math.max(L, Math.ceil(Ce * Ye * ht)), Ee = Math.max(Qe, Math.min(b.width * ct, Math.ceil(we * Ye))), K = Math.min(tt, $e + Se), q = h({
656
+ width: b.width,
657
+ height: b.height + K - $e,
658
658
  margins: {
659
- top: De,
659
+ top: K,
660
660
  right: Ee,
661
- bottom: rt,
661
+ bottom: nt,
662
662
  left: Te
663
663
  }
664
- }), q = K.innerWidth / (P - 1), J = M.map((e, t) => {
665
- let n = S({
664
+ }), J = q.innerWidth / (P - 1), Y = M.map((e, t) => {
665
+ let n = re({
666
666
  type: e.scale,
667
667
  domain: e.domain,
668
- range: [K.bottom, K.top]
668
+ range: [q.bottom, q.top]
669
669
  });
670
670
  return {
671
671
  axis: e,
672
- x: K.left + t * q,
672
+ x: q.left + t * J,
673
673
  scale: n,
674
- ticks: Array.from(bt({
674
+ ticks: Array.from(yt({
675
675
  ticks: I[t] ?? [],
676
676
  scale: n
677
677
  }))
678
678
  };
679
- }), Y = n.map((e) => {
680
- let t = J.map((t) => {
681
- let n = ze(e, t.axis);
679
+ }), X = n.map((e) => {
680
+ let t = Y.map((t) => {
681
+ let n = Re(e, t.axis);
682
682
  return n === null ? null : t.scale.position(n);
683
- }), n = J.map((e, n) => ({
683
+ }), n = Y.map((e, n) => ({
684
684
  x: e.x,
685
685
  y: t[n] ?? null
686
686
  }));
@@ -689,46 +689,46 @@ function Ct(e) {
689
689
  ys: t,
690
690
  d: D(n),
691
691
  dots: E(n),
692
- isMatch: St({
692
+ isMatch: xt({
693
693
  row: e,
694
694
  axes: M,
695
695
  ranges: N
696
696
  })
697
697
  };
698
- }), Oe = Ue({
698
+ }), De = He({
699
699
  rows: n,
700
700
  axes: M,
701
- locale: _,
701
+ locale: v,
702
702
  groupLabel: ue,
703
703
  consequence: "the line breaks at those axes."
704
- }), ke = Y.filter((e) => e.isMatch);
705
- function Ae({ next: e, reason: t, event: n }) {
704
+ }), Oe = X.filter((e) => e.isMatch);
705
+ function ke({ next: e, reason: t, event: n }) {
706
706
  ye({ options: () => ({ onRangesChange: a }) }, "onRangesChange", e, n === void 0 ? { reason: t } : {
707
707
  reason: t,
708
708
  event: n
709
709
  });
710
710
  }
711
- function je(e) {
712
- let t = e.x / e.width * K.width, n = e.y / e.height * K.height, r = Math.min(P - 1, Math.max(0, (t - K.left) / q)), i = Math.min(P - 2, Math.floor(r)), a = r - i;
713
- return (ke.length > 0 ? ke : Y).flatMap((e) => {
714
- let t = e.ys[i] ?? null, r = e.ys[i + 1] ?? null, o = t !== null && r !== null ? t + (r - t) * a : a < gt ? t : r;
711
+ function Ae(e) {
712
+ let t = e.x / e.width * q.width, n = e.y / e.height * q.height, r = Math.min(P - 1, Math.max(0, (t - q.left) / J)), i = Math.min(P - 2, Math.floor(r)), a = r - i;
713
+ return (Oe.length > 0 ? Oe : X).flatMap((e) => {
714
+ let t = e.ys[i] ?? null, r = e.ys[i + 1] ?? null, o = t !== null && r !== null ? t + (r - t) * a : a < ht ? t : r;
715
715
  return o === null ? [] : [{
716
716
  id: e.row.id,
717
717
  distance: Math.abs(o - n)
718
718
  }];
719
719
  }).toSorted((e, t) => e.distance - t.distance)[0]?.id;
720
720
  }
721
- function X(e) {
721
+ function Z(e) {
722
722
  let t = e.button === 0 && e.pointerType !== "touch", n = e.currentTarget, r = n.parentElement;
723
723
  if (a === void 0 || j.current !== null || !t || r === null) return;
724
- let o = n.getBoundingClientRect(), s = (e.clientX - o.left) / o.width * K.width, c = J.find((e) => Math.abs(e.x - s) <= mt);
724
+ let o = n.getBoundingClientRect(), s = (e.clientX - o.left) / o.width * q.width, c = Y.find((e) => Math.abs(e.x - s) <= pt);
725
725
  if (c === void 0) return;
726
726
  function l(e) {
727
- let t = (e - o.top) / o.height * K.height;
728
- return c?.scale.valueAt(Math.min(K.bottom, Math.max(K.top, t))) ?? 0;
727
+ let t = (e - o.top) / o.height * q.height;
728
+ return c?.scale.valueAt(Math.min(q.bottom, Math.max(q.top, t))) ?? 0;
729
729
  }
730
730
  let u = l(e.clientY), d = { hasMoved: !1 };
731
- function ee(e) {
731
+ function f(e) {
732
732
  let t = l(e);
733
733
  return [Math.min(u, t), Math.max(u, t)];
734
734
  }
@@ -738,13 +738,13 @@ function Ct(e) {
738
738
  onMove: ({ y: e }) => {
739
739
  d.hasMoved = !0, A({
740
740
  id: c.axis.id,
741
- range: ee(e)
741
+ range: f(e)
742
742
  });
743
743
  },
744
744
  onEnd: (e, t) => {
745
745
  j.current = null, A(null);
746
- let n = ee(e.clientY);
747
- !t && d.hasMoved && n[0] < n[1] && Ae({
746
+ let n = f(e.clientY);
747
+ !t && d.hasMoved && n[0] < n[1] && ke({
748
748
  next: {
749
749
  ...i,
750
750
  [c.axis.id]: n
@@ -755,61 +755,61 @@ function Ct(e) {
755
755
  }
756
756
  });
757
757
  }
758
- return /* @__PURE__ */ H(ne, {
759
- ...x,
760
- items: Oe,
761
- locate: je,
758
+ return /* @__PURE__ */ H(c, {
759
+ ...S,
760
+ items: De,
761
+ locate: Ae,
762
762
  selected: l,
763
- onSelect: u,
763
+ onSelect: d,
764
764
  render: (e, { inspected: t, selected: r, cursor: i }) => {
765
- let o = Y.find((e) => e.row.id === t), l = Y.find((e) => e.row.id === r), d = Y.find((e) => e.row.id === i), f = t === null ? "normal" : "receded";
765
+ let s = X.find((e) => e.row.id === t), c = X.find((e) => e.row.id === r), l = X.find((e) => e.row.id === i), f = t === null ? "normal" : "receded";
766
766
  return /* @__PURE__ */ H(oe, {
767
- ...p,
767
+ ...m,
768
768
  figure: e,
769
769
  series: O,
770
- seriesLegend: O.length > 0 ? /* @__PURE__ */ H(re, { items: O }) : void 0,
771
- footer: n.length === 0 ? void 0 : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H(c, {
772
- id: b,
773
- children: s(Oe, t ?? r)
774
- }), /* @__PURE__ */ H(qe, {
770
+ seriesLegend: O.length > 0 ? /* @__PURE__ */ H(ne, { items: O }) : void 0,
771
+ footer: n.length === 0 ? void 0 : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H(u, {
772
+ id: x,
773
+ children: o(De, t ?? r)
774
+ }), /* @__PURE__ */ H(Ke, {
775
775
  axes: M,
776
776
  ranges: N,
777
- locale: _,
778
- matching: ke.length,
777
+ locale: v,
778
+ matching: Oe.length,
779
779
  total: n.length,
780
- onChange: (e, t) => Ae({
780
+ onChange: (e, t) => ke({
781
781
  next: e,
782
782
  reason: t
783
783
  })
784
784
  })] }),
785
785
  children: n.length === 0 ? /* @__PURE__ */ H(ce, { children: te }) : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ U(de, {
786
- plotRef: y.ref,
787
- box: K,
786
+ plotRef: b.ref,
787
+ box: q,
788
788
  label: ee({
789
- title: v,
789
+ title: y,
790
790
  marks: "rows",
791
- isSelectable: u !== void 0
791
+ isSelectable: d !== void 0
792
792
  }),
793
- readoutId: b,
794
- onPointerDown: X,
793
+ readoutId: x,
794
+ onPointerDown: Z,
795
795
  children: [
796
- J.map((e) => /* @__PURE__ */ U("g", { children: [/* @__PURE__ */ H("line", {
796
+ Y.map((e) => /* @__PURE__ */ U("g", { children: [/* @__PURE__ */ H("line", {
797
797
  x1: e.x,
798
798
  x2: e.x,
799
- y1: K.top,
800
- y2: K.bottom,
799
+ y1: q.top,
800
+ y2: q.bottom,
801
801
  ...R.props(C.axis)
802
802
  }), e.ticks.map((t) => /* @__PURE__ */ H("line", {
803
- x1: e.x - ut,
803
+ x1: e.x - lt,
804
804
  x2: e.x,
805
805
  y1: e.scale.position(t.value),
806
806
  y2: e.scale.position(t.value),
807
807
  ...R.props(C.axis)
808
808
  }, t.value))] }, e.axis.id)),
809
809
  /* @__PURE__ */ U(pe, {
810
- box: K,
810
+ box: q,
811
811
  children: [
812
- Y.toSorted((e, t) => Number(e.isMatch) - Number(t.isMatch)).map((e) => /* @__PURE__ */ U("g", { children: [/* @__PURE__ */ H(T, {
812
+ X.toSorted((e, t) => Number(e.isMatch) - Number(t.isMatch)).map((e) => /* @__PURE__ */ U("g", { children: [/* @__PURE__ */ H(T, {
813
813
  d: e.d,
814
814
  tone: le(e.row),
815
815
  emphasis: e.isMatch ? f : "context"
@@ -817,64 +817,64 @@ function Ct(e) {
817
817
  x: t.x,
818
818
  y: t.y,
819
819
  tone: le(e.row),
820
- radius: vt,
820
+ radius: _t,
821
821
  emphasis: e.isMatch ? f : "context"
822
822
  }, t.x))] }, e.row.id)),
823
- [l, o].map((e) => e === void 0 ? null : /* @__PURE__ */ H("path", {
823
+ [c, s].map((e) => e === void 0 ? null : /* @__PURE__ */ H("path", {
824
824
  d: e.d,
825
- ...R.props(C.mark, Ye.ink, e !== o && Ye.selected)
825
+ ...R.props(C.mark, Je.ink, e !== s && Je.selected)
826
826
  }, e.row.id)),
827
- o?.ys.map((e, t) => e === null ? null : /* @__PURE__ */ H(w, {
828
- x: J[t]?.x ?? 0,
827
+ s?.ys.map((e, t) => e === null ? null : /* @__PURE__ */ H(w, {
828
+ x: Y[t]?.x ?? 0,
829
829
  y: e,
830
- tone: le(o.row),
831
- radius: _t,
830
+ tone: le(s.row),
831
+ radius: gt,
832
832
  isInspected: !0
833
- }, J[t]?.axis.id)),
834
- d !== void 0 && /* @__PURE__ */ H("path", {
835
- d: d.d,
833
+ }, Y[t]?.axis.id)),
834
+ l !== void 0 && /* @__PURE__ */ H("path", {
835
+ d: l.d,
836
836
  fill: "none",
837
837
  ...R.props(C.shapeCursor)
838
838
  })
839
839
  ]
840
840
  }),
841
- J.map((e) => /* @__PURE__ */ U("g", { children: [F && e.ticks.map((t) => /* @__PURE__ */ H("text", {
842
- x: e.x - dt,
843
- y: e.scale.position(t.value) + ft,
841
+ Y.map((e) => /* @__PURE__ */ U("g", { children: [F && e.ticks.map((t) => /* @__PURE__ */ H("text", {
842
+ x: e.x - ut,
843
+ y: e.scale.position(t.value) + dt,
844
844
  textAnchor: "end",
845
845
  ...R.props(C.label, C.tick, C.haloLabel),
846
846
  children: t.label
847
847
  }, t.value)), /* @__PURE__ */ H("text", {
848
848
  x: e.x,
849
- y: K.top - tt,
849
+ y: q.top - et,
850
850
  textAnchor: B ? "start" : "middle",
851
- transform: B ? `rotate(-${ot} ${e.x} ${K.top - tt})` : void 0,
851
+ transform: B ? `rotate(-${at} ${e.x} ${q.top - et})` : void 0,
852
852
  ...R.props(C.label, C.strongLabel),
853
853
  children: e.axis.label
854
854
  })] }, e.axis.id)),
855
- J.map((e) => {
855
+ Y.map((e) => {
856
856
  let t = N[e.axis.id];
857
857
  return /* @__PURE__ */ U("g", { children: [t !== void 0 && /* @__PURE__ */ H("rect", {
858
- x: e.x - ht / 2,
858
+ x: e.x - mt / 2,
859
859
  y: e.scale.position(t[1]),
860
- width: ht,
860
+ width: mt,
861
861
  height: e.scale.position(t[0]) - e.scale.position(t[1]),
862
862
  className: "xlrhuyr x11l25vo x17y187c xnpr05h x13efnbd x47corl"
863
863
  }), a !== void 0 && /* @__PURE__ */ H("rect", {
864
- x: e.x - mt,
865
- y: K.top,
864
+ x: e.x - pt,
865
+ y: q.top,
866
866
  width: 20,
867
- height: K.innerHeight,
867
+ height: q.innerHeight,
868
868
  className: "xy6m8k3 x1e5i8e3"
869
869
  })] }, e.axis.id);
870
870
  })
871
871
  ]
872
872
  }), /* @__PURE__ */ H(ae, {
873
- label: `${v} rows`,
874
- ...We({
873
+ label: `${y} rows`,
874
+ ...Ue({
875
875
  rows: n,
876
876
  axes: M,
877
- locale: _
877
+ locale: v
878
878
  })
879
879
  })] })
880
880
  });
@@ -882,10 +882,10 @@ function Ct(e) {
882
882
  });
883
883
  }
884
884
  // packages/charts/src/relationship/scatter-matrix.tsx
885
- var wt = {
885
+ var Ct = {
886
886
  dimensions: 6,
887
887
  rows: 500
888
- }, Tt = 18, Et = 6, Dt = 110, Ot = 120, kt = 88, At = 7, jt = 8, Mt = 64, Nt = 6, Pt = .7, Ft = 60, It = 2.5, Lt = 4.5, Rt = 8, zt = 8, Bt = 16, Vt = 4, Ht = {
888
+ }, wt = 18, Tt = 6, Et = 110, Dt = 120, Ot = 88, kt = 7, At = 8, jt = 64, Mt = 6, Nt = .7, Pt = 60, Ft = 2.5, It = 4.5, Lt = 8, Rt = 8, zt = 16, Bt = 4, Vt = {
889
889
  frame: {
890
890
  kDwRjp: "xbh8q5q",
891
891
  $$css: !0
@@ -895,64 +895,64 @@ var wt = {
895
895
  $$css: !0
896
896
  }, { "--x-minWidth": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }]
897
897
  };
898
- function Ut(e) {
899
- let { dimensions: t, rows: n, groups: r = [], height: i = "regular", selected: a, onSelectedChange: o, ...l } = e, { emptyLabel: u = "No rows are available.", ...p } = l, { locale: _, title: y } = p, b = fe(i), x = ge(), le = g(), { toneOf: ue, groupLabel: T, legend: pe } = Ge(r);
900
- if (p.status === "loading") return /* @__PURE__ */ H(ie, {
901
- ...p,
898
+ function Ht(e) {
899
+ let { dimensions: t, rows: n, groups: r = [], height: i = "regular", selected: a, onSelectedChange: s, ...l } = e, { emptyLabel: d = "No rows are available.", ...m } = l, { locale: v, title: b } = m, x = fe(i), S = ge(), le = _(), { toneOf: ue, groupLabel: T, legend: pe } = We(r);
900
+ if (m.status === "loading") return /* @__PURE__ */ H(ie, {
901
+ ...m,
902
902
  height: i
903
903
  });
904
- let E = Be({
904
+ let E = ze({
905
905
  dimensions: t,
906
906
  rows: n
907
- }), D = Ve({
907
+ }), D = Be({
908
908
  axes: E,
909
909
  rows: n,
910
910
  groups: r,
911
- limits: wt
911
+ limits: Ct
912
912
  });
913
913
  if (D !== void 0) return /* @__PURE__ */ H(se, {
914
- ...p,
914
+ ...m,
915
915
  message: D
916
916
  });
917
- let O = (b.width - Mt) / E.length < Dt, k = O ? Et : Tt, A = E.map((e) => {
918
- let { values: t, labels: n } = h({
917
+ let O = (x.width - jt) / E.length < Et, k = O ? Tt : wt, A = E.map((e) => {
918
+ let { values: t, labels: n } = g({
919
919
  axis: e,
920
920
  domain: e.domain,
921
- length: b.width / E.length,
922
- spacing: O ? Ot : Ft,
923
- locale: _,
921
+ length: x.width / E.length,
922
+ spacing: O ? Dt : Pt,
923
+ locale: v,
924
924
  hasTitle: !0
925
925
  });
926
926
  return t.map((e, t) => ({
927
927
  value: e,
928
928
  label: n[t] ?? ""
929
929
  }));
930
- }), j = f({
931
- width: b.width,
930
+ }), j = p({
931
+ width: x.width,
932
932
  valueLabels: A.flatMap((e) => e.map((e) => e.label)),
933
933
  hasXTitle: !1,
934
934
  hasYTitle: !1
935
- }), M = kt + k, me = j.left + j.right + M * E.length, N = Math.max(M, Math.min((b.width - j.left - j.right) / E.length, d[i] * Pt)), P = N - k, he = j.top + N * E.length - k, F = m({
936
- width: b.width,
935
+ }), M = Ot + k, me = j.left + j.right + M * E.length, N = Math.max(M, Math.min((x.width - j.left - j.right) / E.length, f[i] * Nt)), P = N - k, he = j.top + N * E.length - k, F = h({
936
+ width: x.width,
937
937
  height: he + j.bottom,
938
938
  margins: j
939
939
  }), I = E.map((e, t) => {
940
- let n = j.left + t * N, r = j.top + t * N, i = S({
940
+ let n = j.left + t * N, r = j.top + t * N, i = re({
941
941
  type: e.scale,
942
942
  domain: e.domain,
943
- range: [n + Nt, n + P - Nt]
944
- }), a = A[t] ?? [], o = Math.max(0, ...a.map((e) => e.label.length)) * At, s = Math.min(...a.slice(1).map((e, t) => Math.abs(i.position(e.value) - i.position(a[t]?.value ?? 0)))), c = Math.max(1, Math.ceil((o + jt) / s));
943
+ range: [n + Mt, n + P - Mt]
944
+ }), a = A[t] ?? [], o = Math.max(0, ...a.map((e) => e.label.length)) * kt, s = Math.min(...a.slice(1).map((e, t) => Math.abs(i.position(e.value) - i.position(a[t]?.value ?? 0)))), c = Math.max(1, Math.ceil((o + At) / s));
945
945
  return {
946
946
  axis: e,
947
947
  left: n,
948
948
  top: r,
949
949
  ticks: a.filter((e, t) => t % c === 0),
950
- xTicks: a.filter((e, t) => t % c === 0).filter((e) => Math.abs(i.position(e.value) - n - P / 2) + e.label.length * At / 2 <= (P + k) / 2),
950
+ xTicks: a.filter((e, t) => t % c === 0).filter((e) => Math.abs(i.position(e.value) - n - P / 2) + e.label.length * kt / 2 <= (P + k) / 2),
951
951
  xScale: i,
952
- yScale: S({
952
+ yScale: re({
953
953
  type: e.scale,
954
954
  domain: e.domain,
955
- range: [r + P - Nt, r + Nt]
955
+ range: [r + P - Mt, r + Mt]
956
956
  })
957
957
  };
958
958
  }), L = I.flatMap((e, t) => I.slice(0, t).map((t) => ({
@@ -965,23 +965,23 @@ function Ut(e) {
965
965
  top: e.top
966
966
  })));
967
967
  function z(e, t) {
968
- let n = ze(t, e.xAxis), r = ze(t, e.yAxis);
968
+ let n = Re(t, e.xAxis), r = Re(t, e.yAxis);
969
969
  return n === null || r === null ? void 0 : {
970
970
  x: e.xScale.position(n),
971
971
  y: e.yScale.position(r)
972
972
  };
973
973
  }
974
974
  function B(e, t) {
975
- return v({
975
+ return y({
976
976
  value: t,
977
- locale: _,
977
+ locale: v,
978
978
  format: e.format
979
979
  });
980
980
  }
981
- let _e = Ue({
981
+ let _e = He({
982
982
  rows: n,
983
983
  axes: E,
984
- locale: _,
984
+ locale: v,
985
985
  groupLabel: T,
986
986
  consequence: "the row is not drawn in the panels that use them."
987
987
  });
@@ -995,36 +995,36 @@ function Ut(e) {
995
995
  }];
996
996
  }).toSorted((e, t) => e.distance - t.distance)[0]?.id;
997
997
  }
998
- return /* @__PURE__ */ H(ne, {
998
+ return /* @__PURE__ */ H(c, {
999
999
  ...le,
1000
1000
  items: _e,
1001
1001
  locate: V,
1002
1002
  selected: a,
1003
- onSelect: o,
1003
+ onSelect: s,
1004
1004
  render: (e, { inspected: t, selected: r, cursor: i }) => {
1005
- let a = n.filter((e) => e.id === t || e.id === r), l = n.find((e) => e.id === i);
1005
+ let a = n.filter((e) => e.id === t || e.id === r), c = n.find((e) => e.id === i);
1006
1006
  return /* @__PURE__ */ H(oe, {
1007
- ...p,
1007
+ ...m,
1008
1008
  figure: e,
1009
1009
  series: pe,
1010
- seriesLegend: pe.length > 0 ? /* @__PURE__ */ H(re, { items: pe }) : void 0,
1011
- footer: n.length === 0 ? void 0 : /* @__PURE__ */ H(c, {
1012
- id: x,
1013
- children: s(_e, t ?? r)
1010
+ seriesLegend: pe.length > 0 ? /* @__PURE__ */ H(ne, { items: pe }) : void 0,
1011
+ footer: n.length === 0 ? void 0 : /* @__PURE__ */ H(u, {
1012
+ id: S,
1013
+ children: o(_e, t ?? r)
1014
1014
  }),
1015
- children: n.length === 0 ? /* @__PURE__ */ H(ce, { children: u }) : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H("div", {
1015
+ children: n.length === 0 ? /* @__PURE__ */ H(ce, { children: d }) : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H("div", {
1016
1016
  className: "xw2csxc xeuugli",
1017
1017
  children: /* @__PURE__ */ H("div", {
1018
- ...R.props(Ht.scrolled(me)),
1018
+ ...R.props(Vt.scrolled(me)),
1019
1019
  children: /* @__PURE__ */ U(de, {
1020
- plotRef: b.ref,
1020
+ plotRef: x.ref,
1021
1021
  box: F,
1022
1022
  label: ee({
1023
- title: y,
1023
+ title: b,
1024
1024
  marks: "rows",
1025
- isSelectable: o !== void 0
1025
+ isSelectable: s !== void 0
1026
1026
  }),
1027
- readoutId: x,
1027
+ readoutId: S,
1028
1028
  children: [I.map((e, t) => /* @__PURE__ */ U("g", { children: [
1029
1029
  /* @__PURE__ */ H("foreignObject", {
1030
1030
  x: e.left,
@@ -1055,14 +1055,14 @@ function Ut(e) {
1055
1055
  }),
1056
1056
  t < I.length - 1 && e.xTicks.map((t) => /* @__PURE__ */ H("text", {
1057
1057
  x: e.xScale.position(t.value),
1058
- y: he + Bt,
1058
+ y: he + zt,
1059
1059
  textAnchor: "middle",
1060
1060
  ...R.props(C.label, C.tick),
1061
1061
  children: t.label
1062
1062
  }, t.value)),
1063
1063
  t > 0 && e.ticks.map((t) => /* @__PURE__ */ H("text", {
1064
- x: j.left - zt,
1065
- y: e.yScale.position(t.value) + Vt,
1064
+ x: j.left - Rt,
1065
+ y: e.yScale.position(t.value) + Bt,
1066
1066
  textAnchor: "end",
1067
1067
  ...R.props(C.label, C.tick),
1068
1068
  children: t.label
@@ -1073,7 +1073,7 @@ function Ut(e) {
1073
1073
  y: e.top,
1074
1074
  width: P,
1075
1075
  height: P,
1076
- ...R.props(C.grid, Ht.frame)
1076
+ ...R.props(C.grid, Vt.frame)
1077
1077
  }),
1078
1078
  n.map((t) => {
1079
1079
  let n = z(e, t);
@@ -1081,7 +1081,7 @@ function Ut(e) {
1081
1081
  x: n.x,
1082
1082
  y: n.y,
1083
1083
  tone: ue(t),
1084
- radius: It,
1084
+ radius: Ft,
1085
1085
  emphasis: ue(t) === "neutral" ? "context" : "normal"
1086
1086
  }, t.id);
1087
1087
  }),
@@ -1091,15 +1091,15 @@ function Ut(e) {
1091
1091
  x: i.x,
1092
1092
  y: i.y,
1093
1093
  tone: ue(n),
1094
- radius: Lt,
1094
+ radius: It,
1095
1095
  isInspected: n.id === t,
1096
1096
  isSelected: n.id === r
1097
1097
  }, n.id);
1098
1098
  }),
1099
- l !== void 0 && z(e, l) !== void 0 && /* @__PURE__ */ H("circle", {
1100
- cx: z(e, l)?.x,
1101
- cy: z(e, l)?.y,
1102
- r: Rt,
1099
+ c !== void 0 && z(e, c) !== void 0 && /* @__PURE__ */ H("circle", {
1100
+ cx: z(e, c)?.x,
1101
+ cy: z(e, c)?.y,
1102
+ r: Lt,
1103
1103
  fill: "none",
1104
1104
  ...R.props(C.shapeCursor)
1105
1105
  })
@@ -1107,11 +1107,11 @@ function Ut(e) {
1107
1107
  })
1108
1108
  })
1109
1109
  }), /* @__PURE__ */ H(ae, {
1110
- label: `${y} rows`,
1111
- ...We({
1110
+ label: `${b} rows`,
1111
+ ...Ue({
1112
1112
  rows: n,
1113
1113
  axes: E,
1114
- locale: _
1114
+ locale: v
1115
1115
  })
1116
1116
  })] })
1117
1117
  });
@@ -1119,16 +1119,16 @@ function Ut(e) {
1119
1119
  });
1120
1120
  }
1121
1121
  // packages/charts/src/relationship/density-map.tsx
1122
- var Wt = {
1122
+ var Ut = {
1123
1123
  columns: 512,
1124
1124
  rows: 512,
1125
1125
  cellItems: 1024
1126
- }, Gt = { outline: {
1126
+ }, Wt = { outline: {
1127
1127
  kDwRjp: "xbh8q5q",
1128
1128
  kfzvcC: "x47corl",
1129
1129
  $$css: !0
1130
1130
  } };
1131
- function Kt({ counts: e, columns: t, rows: n }) {
1131
+ function Gt({ counts: e, columns: t, rows: n }) {
1132
1132
  let r = Math.max(1, t), i = e.flatMap((e, t) => {
1133
1133
  let n = t % r, i = Math.floor(t / r);
1134
1134
  return e > 0 ? [{
@@ -1146,92 +1146,92 @@ function Kt({ counts: e, columns: t, rows: n }) {
1146
1146
  total: e,
1147
1147
  peak: o[t]
1148
1148
  })),
1149
- maximum: b(e)?.[1] ?? 0
1149
+ maximum: x(e)?.[1] ?? 0
1150
1150
  };
1151
1151
  }
1152
- function qt(e, t) {
1152
+ function Kt(e, t) {
1153
1153
  return e.domain === void 0 || e.domain[0] === t[0] && e.domain[1] === t[1];
1154
1154
  }
1155
- function Jt({ histogram: e, x: t, y: n }) {
1156
- let { columns: r, rows: i, counts: a, xDomain: o, yDomain: s } = e, c = x(o, t.scale) ?? x(s, n.scale);
1155
+ function qt({ histogram: e, x: t, y: n }) {
1156
+ let { columns: r, rows: i, counts: a, xDomain: o, yDomain: s } = e, c = S(o, t.scale) ?? S(s, n.scale);
1157
1157
  if (c !== void 0) return c;
1158
- if (!qt(t, o) || !qt(n, s)) return "An axis domain must match the histogram's domain. Leave the axis domain out to use it.";
1159
- if (![r, i].every((e) => Number.isInteger(e) && e > 0) || r > Wt.columns || i > Wt.rows) return `A density map needs whole numbers of columns and rows, at most ${Wt.columns} by ${Wt.rows}.`;
1158
+ if (!Kt(t, o) || !Kt(n, s)) return "An axis domain must match the histogram's domain. Leave the axis domain out to use it.";
1159
+ if (![r, i].every((e) => Number.isInteger(e) && e > 0) || r > Ut.columns || i > Ut.rows) return `A density map needs whole numbers of columns and rows, at most ${Ut.columns} by ${Ut.rows}.`;
1160
1160
  if (a.length !== r * i) return `The histogram needs ${r * i} counts, one per cell; it has ${a.length}.`;
1161
1161
  if (a.some((e) => !Number.isFinite(e) || e < 0)) return "Every count must be a finite value of zero or more.";
1162
1162
  }
1163
- function Yt(e) {
1164
- let { histogram: t, x: n, y: r, count: i, height: a = "tall", ...o } = e, { emptyLabel: l = "No counts are available.", ...u } = o, { locale: d, title: f } = u, { columns: m, rows: h, counts: re, xDomain: g, yDomain: _ } = t, y = fe(a), b = ge(), x = B(() => Kt({
1165
- counts: re,
1166
- columns: m,
1167
- rows: h
1163
+ function Jt(e) {
1164
+ let { histogram: t, x: n, y: r, count: i, height: a = "tall", ...s } = e, { emptyLabel: l = "No counts are available.", ...d } = s, { locale: f, title: p } = d, { columns: h, rows: g, counts: ne, xDomain: _, yDomain: v } = t, b = fe(a), x = ge(), S = B(() => Gt({
1165
+ counts: ne,
1166
+ columns: h,
1167
+ rows: g
1168
1168
  }), [
1169
- re,
1170
- m,
1171
- h
1169
+ ne,
1170
+ h,
1171
+ g
1172
1172
  ]);
1173
- if (u.status === "loading") return /* @__PURE__ */ H(ie, {
1174
- ...u,
1173
+ if (d.status === "loading") return /* @__PURE__ */ H(ie, {
1174
+ ...d,
1175
1175
  height: a
1176
1176
  });
1177
- let w = Jt({
1177
+ let w = qt({
1178
1178
  histogram: t,
1179
1179
  x: n,
1180
1180
  y: r
1181
1181
  });
1182
1182
  if (w !== void 0) return /* @__PURE__ */ H(se, {
1183
- ...u,
1183
+ ...d,
1184
1184
  message: w
1185
1185
  });
1186
- let ue = p({
1187
- width: y.width,
1188
- height: y.height,
1186
+ let ue = m({
1187
+ width: b.width,
1188
+ height: b.height,
1189
1189
  x: n,
1190
1190
  y: r,
1191
- xDomain: g,
1192
- yDomain: _,
1193
- locale: d
1194
- }), { box: T } = ue, { filled: E, maximum: D } = x, k = S({
1191
+ xDomain: _,
1192
+ yDomain: v,
1193
+ locale: f
1194
+ }), { box: T } = ue, { filled: E, maximum: D } = S, k = re({
1195
1195
  type: n.scale,
1196
- domain: g,
1197
- range: [0, m]
1198
- }), j = S({
1199
- type: r.scale,
1200
1196
  domain: _,
1201
1197
  range: [0, h]
1202
- }), M = T.innerWidth / m, me = T.innerHeight / h, N = E.length <= Wt.cellItems;
1198
+ }), j = re({
1199
+ type: r.scale,
1200
+ domain: v,
1201
+ range: [0, g]
1202
+ }), M = T.innerWidth / h, me = T.innerHeight / g, N = E.length <= Ut.cellItems;
1203
1203
  function P(e) {
1204
- return v({
1204
+ return y({
1205
1205
  value: e,
1206
- locale: d,
1206
+ locale: f,
1207
1207
  format: i.format
1208
1208
  });
1209
1209
  }
1210
1210
  function he(e) {
1211
- let t = v({
1211
+ let t = y({
1212
1212
  value: k.valueAt(e),
1213
- locale: d,
1213
+ locale: f,
1214
1214
  format: n.format
1215
- }), r = v({
1215
+ }), r = y({
1216
1216
  value: k.valueAt(e + 1),
1217
- locale: d,
1217
+ locale: f,
1218
1218
  format: n.format
1219
1219
  });
1220
1220
  return `${n.label} ${t} – ${r}`;
1221
1221
  }
1222
1222
  function F(e) {
1223
- let t = v({
1223
+ let t = y({
1224
1224
  value: j.valueAt(e),
1225
- locale: d,
1225
+ locale: f,
1226
1226
  format: r.format
1227
- }), n = v({
1227
+ }), n = y({
1228
1228
  value: j.valueAt(e + 1),
1229
- locale: d,
1229
+ locale: f,
1230
1230
  format: r.format
1231
1231
  });
1232
1232
  return `${r.label} ${t} – ${n}`;
1233
1233
  }
1234
- let I = x.rows.flatMap((e) => e.peak === void 0 ? [] : [{
1234
+ let I = S.rows.flatMap((e) => e.peak === void 0 ? [] : [{
1235
1235
  id: `row:${e.row}`,
1236
1236
  row: e.row,
1237
1237
  label: `${F(e.row)}: ${i.label} ${P(e.total)} in all, at most ${P(e.peak.count)} at ${he(e.peak.column)}`
@@ -1243,8 +1243,8 @@ function Yt(e) {
1243
1243
  label: e.label
1244
1244
  })), z = new Map(E.map((e) => [e.id, e])), _e = new Map(I.map((e) => [e.id, e.row]));
1245
1245
  function V(e) {
1246
- let t = Math.floor((e.x / e.width * T.width - T.left) / T.innerWidth * m), n = h - 1 - Math.floor((e.y / e.height * T.height - T.top) / T.innerHeight * h);
1247
- if (t >= 0 && t < m && n >= 0 && n < h) return N ? `${t}:${n}` : `row:${n}`;
1246
+ let t = Math.floor((e.x / e.width * T.width - T.left) / T.innerWidth * h), n = g - 1 - Math.floor((e.y / e.height * T.height - T.top) / T.innerHeight * g);
1247
+ if (t >= 0 && t < h && n >= 0 && n < g) return N ? `${t}:${n}` : `row:${n}`;
1248
1248
  }
1249
1249
  function ve(e) {
1250
1250
  let t = e === null ? void 0 : z.get(e), n = e === null ? void 0 : _e.get(e);
@@ -1258,7 +1258,7 @@ function Yt(e) {
1258
1258
  width: M
1259
1259
  };
1260
1260
  }
1261
- return /* @__PURE__ */ H(ne, {
1261
+ return /* @__PURE__ */ H(c, {
1262
1262
  items: L,
1263
1263
  locate: V,
1264
1264
  place: N ? (e) => {
@@ -1266,41 +1266,41 @@ function Yt(e) {
1266
1266
  return t === void 0 ? void 0 : {
1267
1267
  left: t.column,
1268
1268
  right: t.column + 1,
1269
- top: h - t.row - 1,
1270
- bottom: h - t.row
1269
+ top: g - t.row - 1,
1270
+ bottom: g - t.row
1271
1271
  };
1272
1272
  } : void 0,
1273
1273
  arrows: "both",
1274
1274
  render: (e, { inspected: t, cursor: a }) => {
1275
- let o = ve(t), p = ve(a);
1275
+ let s = ve(t), c = ve(a);
1276
1276
  return /* @__PURE__ */ H(oe, {
1277
- ...u,
1277
+ ...d,
1278
1278
  figure: e,
1279
1279
  scaleLegend: E.length === 0 ? void 0 : /* @__PURE__ */ H(O, {
1280
1280
  label: i.label,
1281
1281
  domain: [0, D],
1282
1282
  palette: "sequential",
1283
1283
  valueFormat: i.format,
1284
- locale: d
1284
+ locale: f
1285
1285
  }),
1286
- footer: E.length === 0 ? void 0 : /* @__PURE__ */ H(c, {
1287
- id: b,
1288
- children: s(L, t)
1286
+ footer: E.length === 0 ? void 0 : /* @__PURE__ */ H(u, {
1287
+ id: x,
1288
+ children: o(L, t)
1289
1289
  }),
1290
1290
  children: E.length === 0 ? /* @__PURE__ */ H(ce, { children: l }) : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H(de, {
1291
- plotRef: y.ref,
1291
+ plotRef: b.ref,
1292
1292
  box: T,
1293
1293
  label: ee({
1294
- title: f,
1294
+ title: p,
1295
1295
  marks: N ? "cells" : "rows",
1296
1296
  isSelectable: !1
1297
1297
  }),
1298
- readoutId: b,
1298
+ readoutId: x,
1299
1299
  overlay: /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H(A, {
1300
1300
  box: T,
1301
- columns: m,
1302
- rows: h,
1303
- counts: re,
1301
+ columns: h,
1302
+ rows: g,
1303
+ counts: ne,
1304
1304
  maximum: D
1305
1305
  }), /* @__PURE__ */ H("svg", {
1306
1306
  "aria-hidden": !0,
@@ -1310,18 +1310,18 @@ function Yt(e) {
1310
1310
  ...R.props(C.svg),
1311
1311
  children: /* @__PURE__ */ U(pe, {
1312
1312
  box: T,
1313
- children: [o !== void 0 && /* @__PURE__ */ H("rect", {
1314
- x: o.x,
1315
- y: o.y,
1316
- width: o.width,
1313
+ children: [s !== void 0 && /* @__PURE__ */ H("rect", {
1314
+ x: s.x,
1315
+ y: s.y,
1316
+ width: s.width,
1317
1317
  height: me,
1318
- ...R.props(Gt.outline, C.selected)
1319
- }), p !== void 0 && /* @__PURE__ */ H("rect", {
1320
- x: p.x,
1321
- y: p.y,
1322
- width: p.width,
1318
+ ...R.props(Wt.outline, C.selected)
1319
+ }), c !== void 0 && /* @__PURE__ */ H("rect", {
1320
+ x: c.x,
1321
+ y: c.y,
1322
+ width: c.width,
1323
1323
  height: me,
1324
- ...R.props(Gt.outline, C.shapeCursor)
1324
+ ...R.props(Wt.outline, C.shapeCursor)
1325
1325
  })]
1326
1326
  })
1327
1327
  })] }),
@@ -1334,7 +1334,7 @@ function Yt(e) {
1334
1334
  grid: "none"
1335
1335
  })
1336
1336
  }), /* @__PURE__ */ H(ae, {
1337
- label: `${f} ${N ? "cells" : "rows"}`,
1337
+ label: `${p} ${N ? "cells" : "rows"}`,
1338
1338
  columns: [{
1339
1339
  id: "item",
1340
1340
  label: N ? "Cell" : "Row"
@@ -1349,7 +1349,7 @@ function Yt(e) {
1349
1349
  });
1350
1350
  }
1351
1351
  // packages/charts/src/relationship/embedding-map.tsx
1352
- var $ = {
1352
+ var Yt = {
1353
1353
  canvasPoints: 1e5,
1354
1354
  webglPoints: 1e6,
1355
1355
  groups: 12,
@@ -1424,9 +1424,9 @@ function dn(e, t) {
1424
1424
  ...r,
1425
1425
  error: "The x, y and group columns must have one value per item."
1426
1426
  };
1427
- if (n > $.webglPoints) return {
1427
+ if (n > Yt.webglPoints) return {
1428
1428
  ...r,
1429
- error: `This map draws at most ${$.webglPoints} items. Supply a sample and declare its coverage.`
1429
+ error: `This map draws at most ${Yt.webglPoints} items. Supply a sample and declare its coverage.`
1430
1430
  };
1431
1431
  if (e.ids !== void 0 && (e.ids.length !== n || new Set(e.ids).size !== n)) return {
1432
1432
  ...r,
@@ -1445,7 +1445,7 @@ function dn(e, t) {
1445
1445
  ...r,
1446
1446
  error: `Item ${e.ids?.[o.index] ?? o.index} needs finite coordinates and a group index between 0 and ${t - 1}.`
1447
1447
  };
1448
- let s = b(e.x), c = b(e.y), l = Array.from(a, (e, t) => e === 0 ? void 0 : {
1448
+ let s = x(e.x), c = x(e.y), l = Array.from(a, (e, t) => e === 0 ? void 0 : {
1449
1449
  x: [i[t * 4] ?? 0, i[t * 4 + 1] ?? 0],
1450
1450
  y: [i[t * 4 + 2] ?? 0, i[t * 4 + 3] ?? 0]
1451
1451
  }), u = s === void 0 || c === void 0 ? void 0 : F({
@@ -1468,28 +1468,28 @@ function fn(e) {
1468
1468
  return e[0] === e[1] ? [e[0] - 1, e[1] + 1] : e;
1469
1469
  }
1470
1470
  function pn(e, t) {
1471
- let n = e.x[0] <= e.x[1] && e.y[0] <= e.y[1], r = !y(e.x[0], t.x) && !y(e.x[1], t.x), i = !y(e.y[0], t.y) && !y(e.y[1], t.y);
1471
+ let n = e.x[0] <= e.x[1] && e.y[0] <= e.y[1], r = !b(e.x[0], t.x) && !b(e.x[1], t.x), i = !b(e.y[0], t.y) && !b(e.y[1], t.y);
1472
1472
  return n && r && i;
1473
1473
  }
1474
- function mn({ summary: e, groups: t, landmarks: n, x: r, y: i, domain: a, range: s, renderer: c, count: l }) {
1474
+ function mn({ summary: e, groups: t, landmarks: n, x: r, y: i, domain: a, range: o, renderer: s, count: c }) {
1475
1475
  let u = (r.scale ?? "linear") === "linear", d = (i.scale ?? "linear") === "linear";
1476
1476
  if (!u || !d) return "An embedding map draws projected coordinates on linear axes.";
1477
- let ee = x(a.x) ?? x(a.y);
1478
- if (ee !== void 0) return ee;
1479
- if (t.length > $.groups || n.length > $.landmarks) return `This map draws at most ${$.groups} groups and ${$.landmarks} landmarks.`;
1480
- if (!o([...t, ...n])) return "Groups and landmarks must have unique identifiers, distinct from each other.";
1481
- if (c === "canvas" && l > $.canvasPoints) return `Canvas draws at most ${$.canvasPoints} items. Use the WebGL or automatic renderer.`;
1477
+ let f = S(a.x) ?? S(a.y);
1478
+ if (f !== void 0) return f;
1479
+ if (t.length > Yt.groups || n.length > Yt.landmarks) return `This map draws at most ${Yt.groups} groups and ${Yt.landmarks} landmarks.`;
1480
+ if (!l([...t, ...n])) return "Groups and landmarks must have unique identifiers, distinct from each other.";
1481
+ if (s === "canvas" && c > Yt.canvasPoints) return `Canvas draws at most ${Yt.canvasPoints} items. Use the WebGL or automatic renderer.`;
1482
1482
  if (e.error !== void 0) return e.error;
1483
- let { xExtent: f, yExtent: te } = e;
1484
- if (f !== void 0 && te !== void 0 && !pn({
1485
- x: f,
1486
- y: te
1483
+ let { xExtent: ee, yExtent: p } = e;
1484
+ if (ee !== void 0 && p !== void 0 && !pn({
1485
+ x: ee,
1486
+ y: p
1487
1487
  }, a)) return "An item lies outside the declared domain.";
1488
1488
  if (n.some((e) => !pn({
1489
1489
  x: [e.x, e.x],
1490
1490
  y: [e.y, e.y]
1491
1491
  }, a))) return "A landmark needs finite coordinates inside the declared domain.";
1492
- if (s !== null && !pn(s, a)) return "The range needs finite, ordered bounds inside the declared domain.";
1492
+ if (o !== null && !pn(o, a)) return "The range needs finite, ordered bounds inside the declared domain.";
1493
1493
  }
1494
1494
  function hn(e) {
1495
1495
  return e > rn.points ? rn : e > an.points ? an : on;
@@ -1514,7 +1514,7 @@ function gn({ landmarks: e, plot: t, first: n }) {
1514
1514
  });
1515
1515
  }
1516
1516
  function _n(e) {
1517
- let { points: n, groups: r, x: i, y: a, landmarks: o = [], renderer: d = "auto", range: f = null, onRangeChange: m, isExplorable: h = !1, height: y = "tall", selected: b, onSelectedChange: x, ...S } = e, { emptyLabel: T = "No items are available.", ...E } = S, { locale: D, title: O } = E, A = fe(y), j = ge(), me = _(), F = g(), [L, be] = V(M), [W, Se] = V(null), [Ce, G] = V(null), [we, Te] = V(null), Ee = _e(null), De = B(() => dn({
1517
+ let { points: n, groups: r, x: i, y: a, landmarks: l = [], renderer: f = "auto", range: p = null, onRangeChange: h, isExplorable: g = !1, height: b = "tall", selected: x, onSelectedChange: S, ...re } = e, { emptyLabel: T = "No items are available.", ...E } = re, { locale: D, title: O } = E, A = fe(b), j = ge(), me = v(), F = _(), [L, be] = V(M), [W, Se] = V(null), [Ce, G] = V(null), [we, Te] = V(null), Ee = _e(null), K = B(() => dn({
1518
1518
  ids: n.ids,
1519
1519
  x: n.x,
1520
1520
  y: n.y,
@@ -1525,97 +1525,97 @@ function _n(e) {
1525
1525
  n.y,
1526
1526
  n.group,
1527
1527
  r.length
1528
- ]), K = B(() => f === null ? 0 : P({
1528
+ ]), q = B(() => p === null ? 0 : P({
1529
1529
  x: n.x,
1530
1530
  y: n.y,
1531
1531
  group: n.group
1532
- }, f), [
1532
+ }, p), [
1533
1533
  n.x,
1534
1534
  n.y,
1535
1535
  n.group,
1536
- f
1536
+ p
1537
1537
  ]);
1538
1538
  if (z(() => () => Ee.current?.(), []), E.status === "loading") return /* @__PURE__ */ H(ie, {
1539
1539
  ...E,
1540
- height: y
1540
+ height: b
1541
1541
  });
1542
- let q = n.x.length, J = i.domain ?? u({ values: De.xExtent ?? [] }), Y = a.domain ?? u({ values: De.yExtent ?? [] }), Oe = {
1543
- x: J,
1544
- y: Y
1545
- }, ke = mn({
1546
- summary: De,
1542
+ let J = n.x.length, Y = i.domain ?? d({ values: K.xExtent ?? [] }), X = a.domain ?? d({ values: K.yExtent ?? [] }), De = {
1543
+ x: Y,
1544
+ y: X
1545
+ }, Oe = mn({
1546
+ summary: K,
1547
1547
  groups: r,
1548
- landmarks: o,
1548
+ landmarks: l,
1549
1549
  x: i,
1550
1550
  y: a,
1551
- domain: Oe,
1552
- range: f,
1553
- renderer: d,
1554
- count: q
1551
+ domain: De,
1552
+ range: p,
1553
+ renderer: f,
1554
+ count: J
1555
1555
  });
1556
- if (ke !== void 0) return /* @__PURE__ */ H(se, {
1556
+ if (Oe !== void 0) return /* @__PURE__ */ H(se, {
1557
1557
  ...E,
1558
- message: ke
1558
+ message: Oe
1559
1559
  });
1560
- let Ae = {
1560
+ let ke = {
1561
1561
  width: A.width,
1562
1562
  height: A.height,
1563
1563
  x: i,
1564
1564
  y: a,
1565
1565
  locale: D
1566
- }, je = p({
1567
- ...Ae,
1568
- xDomain: J,
1569
- yDomain: Y
1570
- }), X = h ? k({
1566
+ }, Ae = m({
1567
+ ...ke,
1568
+ xDomain: Y,
1569
+ yDomain: X
1570
+ }), Z = g ? k({
1571
1571
  view: L,
1572
- box: je.box,
1573
- x: je.x,
1574
- y: je.y
1575
- }) : Oe, Z = h ? p({
1576
- ...Ae,
1577
- xDomain: X.x,
1578
- yDomain: X.y
1579
- }) : je, { box: Q } = Z, Me = L.zoom === 1 && L.x === 0 && L.y === 0, Ne = r.map((e, t) => ({
1572
+ box: Ae.box,
1573
+ x: Ae.x,
1574
+ y: Ae.y
1575
+ }) : De, Q = g ? m({
1576
+ ...ke,
1577
+ xDomain: Z.x,
1578
+ yDomain: Z.y
1579
+ }) : Ae, { box: $ } = Q, je = L.zoom === 1 && L.x === 0 && L.y === 0, Me = r.map((e, t) => ({
1580
1580
  ...e,
1581
1581
  tone: me({
1582
1582
  id: e.id,
1583
1583
  tone: e.tone,
1584
1584
  index: t
1585
1585
  })
1586
- })), Pe = d === "auto" ? q > $.canvasPoints ? "webgl" : "canvas" : d, Fe = hn(q);
1587
- function Ie(e) {
1588
- return v({
1586
+ })), Ne = f === "auto" ? J > Yt.canvasPoints ? "webgl" : "canvas" : f, Pe = hn(J);
1587
+ function Fe(e) {
1588
+ return y({
1589
1589
  value: e,
1590
1590
  locale: D,
1591
1591
  format: i.format
1592
1592
  });
1593
1593
  }
1594
- function Le(e) {
1595
- return v({
1594
+ function Ie(e) {
1595
+ return y({
1596
1596
  value: e,
1597
1597
  locale: D,
1598
1598
  format: a.format
1599
1599
  });
1600
1600
  }
1601
- function Re(e, t) {
1602
- return `${i.label} ${Ie(e)}, ${a.label} ${Le(t)}`;
1601
+ function Le(e, t) {
1602
+ return `${i.label} ${Fe(e)}, ${a.label} ${Ie(t)}`;
1603
1603
  }
1604
- function ze(e, t) {
1605
- let n = v({
1604
+ function Re(e, t) {
1605
+ let n = y({
1606
1606
  value: t,
1607
1607
  locale: D,
1608
1608
  format: sn
1609
1609
  });
1610
- return `${i.label} ${Ie(e.x[0])} – ${Ie(e.x[1])}, ${a.label} ${Le(e.y[0])} – ${Le(e.y[1])}: ${n} items`;
1610
+ return `${i.label} ${Fe(e.x[0])} – ${Fe(e.x[1])}, ${a.label} ${Ie(e.y[0])} – ${Ie(e.y[1])}: ${n} items`;
1611
1611
  }
1612
- let Be = Ne.map((e, t) => {
1613
- let n = De.counts[t] ?? 0, r = v({
1612
+ let ze = Me.map((e, t) => {
1613
+ let n = K.counts[t] ?? 0, r = y({
1614
1614
  value: n,
1615
1615
  locale: D,
1616
1616
  format: sn
1617
- }), i = v({
1618
- value: q === 0 ? 0 : n / q,
1617
+ }), i = y({
1618
+ value: J === 0 ? 0 : n / J,
1619
1619
  locale: D,
1620
1620
  format: cn
1621
1621
  });
@@ -1625,37 +1625,37 @@ function _n(e) {
1625
1625
  items: n,
1626
1626
  text: `${e.label}: ${r} items, ${i} of the map`
1627
1627
  };
1628
- }), Ve = [...Be.map((e) => ({
1628
+ }), Be = [...ze.map((e) => ({
1629
1629
  id: e.id,
1630
1630
  label: e.text
1631
- })), ...o.map((e) => ({
1631
+ })), ...l.map((e) => ({
1632
1632
  id: e.id,
1633
- label: `${e.label}: ${Re(e.x, e.y)}`
1634
- }))], He = Ne.map((e) => ({
1633
+ label: `${e.label}: ${Le(e.x, e.y)}`
1634
+ }))], Ve = Me.map((e) => ({
1635
1635
  id: e.id,
1636
1636
  label: e.label,
1637
1637
  tone: e.tone
1638
- })), Ue = new Set(o.map((e) => e.id)), We = Math.abs((Q.right - Q.left) / (X.x[1] - X.x[0])), Ge = Math.abs((Q.bottom - Q.top) / (X.y[1] - X.y[0]));
1639
- function Ke(e) {
1638
+ })), He = new Set(l.map((e) => e.id)), Ue = Math.abs(($.right - $.left) / (Z.x[1] - Z.x[0])), We = Math.abs(($.bottom - $.top) / (Z.y[1] - Z.y[0]));
1639
+ function Ge(e) {
1640
1640
  let t = e.currentTarget.getBoundingClientRect();
1641
1641
  return {
1642
- x: Z.x.valueAt(Q.left + Math.max(0, Math.min(Q.innerWidth, e.clientX - t.left))),
1643
- y: Z.y.valueAt(Q.top + Math.max(0, Math.min(Q.innerHeight, e.clientY - t.top)))
1642
+ x: Q.x.valueAt($.left + Math.max(0, Math.min($.innerWidth, e.clientX - t.left))),
1643
+ y: Q.y.valueAt($.top + Math.max(0, Math.min($.innerHeight, e.clientY - t.top)))
1644
1644
  };
1645
1645
  }
1646
- function qe(e) {
1647
- let t = Ke(e), n = {
1646
+ function Ke(e) {
1647
+ let t = Ge(e), n = {
1648
1648
  x: t.x,
1649
1649
  y: t.y,
1650
- radiusX: Xt / We,
1651
- radiusY: Xt / Ge
1650
+ radiusX: Xt / Ue,
1651
+ radiusY: Xt / We
1652
1652
  };
1653
- Se(De.index?.nearest(n) ?? null);
1653
+ Se(K.index?.nearest(n) ?? null);
1654
1654
  }
1655
- function Je(e) {
1656
- let t = !h || e.shiftKey, r = e.button === 0 && e.pointerType !== "touch" && t;
1657
- if (e.pointerType === "touch" && !h && qe(e), m === void 0 || Ee.current !== null || !r) return;
1658
- let i = e.currentTarget, a = Ke(e);
1655
+ function qe(e) {
1656
+ let t = !g || e.shiftKey, r = e.button === 0 && e.pointerType !== "touch" && t;
1657
+ if (e.pointerType === "touch" && !g && Ke(e), h === void 0 || Ee.current !== null || !r) return;
1658
+ let i = e.currentTarget, a = Ge(e);
1659
1659
  function o(e) {
1660
1660
  return {
1661
1661
  x: [Math.min(a.x, e.x), Math.max(a.x, e.x)],
@@ -1665,8 +1665,8 @@ function _n(e) {
1665
1665
  function s(e, t) {
1666
1666
  let n = i.getBoundingClientRect();
1667
1667
  return {
1668
- x: Z.x.valueAt(Q.left + Math.max(0, Math.min(Q.innerWidth, e - n.left))),
1669
- y: Z.y.valueAt(Q.top + Math.max(0, Math.min(Q.innerHeight, t - n.top)))
1668
+ x: Q.x.valueAt($.left + Math.max(0, Math.min($.innerWidth, e - n.left))),
1669
+ y: Q.y.valueAt($.top + Math.max(0, Math.min($.innerHeight, t - n.top)))
1670
1670
  };
1671
1671
  }
1672
1672
  G(o(a)), Ee.current = ve(i, e.nativeEvent, {
@@ -1675,7 +1675,7 @@ function _n(e) {
1675
1675
  onEnd: (e, t) => {
1676
1676
  Ee.current = null, G(null);
1677
1677
  let r = o(s(e.clientX, e.clientY));
1678
- t || r.x[0] === r.x[1] || r.y[0] === r.y[1] || ye({ options: () => ({ onRangeChange: m }) }, "onRangeChange", r, {
1678
+ t || r.x[0] === r.x[1] || r.y[0] === r.y[1] || ye({ options: () => ({ onRangeChange: h }) }, "onRangeChange", r, {
1679
1679
  reason: "drag",
1680
1680
  event: e,
1681
1681
  count: P(n, r)
@@ -1683,122 +1683,122 @@ function _n(e) {
1683
1683
  }
1684
1684
  });
1685
1685
  }
1686
- function Ye(e, t, r) {
1687
- ye({ options: () => ({ onRangeChange: m }) }, "onRangeChange", e, {
1686
+ function Je(e, t, r) {
1687
+ ye({ options: () => ({ onRangeChange: h }) }, "onRangeChange", e, {
1688
1688
  reason: t,
1689
1689
  event: r,
1690
1690
  count: e === null ? 0 : P(n, e)
1691
1691
  });
1692
1692
  }
1693
- function Xe(e) {
1694
- let t = Ne[n.group[e] ?? 0];
1695
- return `${n.ids?.[e] ?? `Item ${v({
1693
+ function Ye(e) {
1694
+ let t = Me[n.group[e] ?? 0];
1695
+ return `${n.ids?.[e] ?? `Item ${y({
1696
1696
  value: e + 1,
1697
1697
  locale: D,
1698
1698
  format: sn
1699
- })}`} · ${t?.label ?? ""} · ${Re(n.x[e] ?? 0, n.y[e] ?? 0)}`;
1699
+ })}`} · ${t?.label ?? ""} · ${Le(n.x[e] ?? 0, n.y[e] ?? 0)}`;
1700
1700
  }
1701
- function Ze(e, t) {
1702
- if (t.find((t) => t.id === e) === void 0) return De.extents[r.findIndex((t) => t.id === e)];
1701
+ function Xe(e, t) {
1702
+ if (t.find((t) => t.id === e) === void 0) return K.extents[r.findIndex((t) => t.id === e)];
1703
1703
  }
1704
- let Qe = Ce ?? f;
1705
- return /* @__PURE__ */ H(ne, {
1704
+ let Ze = Ce ?? p;
1705
+ return /* @__PURE__ */ H(c, {
1706
1706
  ...F,
1707
- items: Ve,
1707
+ items: Be,
1708
1708
  arrows: "both",
1709
- selected: b,
1709
+ selected: x,
1710
1710
  onSelect: (e, t) => {
1711
- Ue.has(e) && x?.(e, t);
1711
+ He.has(e) && S?.(e, t);
1712
1712
  },
1713
- render: (e, { inspected: u, cursor: d }) => {
1714
- let p = r.findIndex((e) => e.id === u), ne = gn({
1715
- landmarks: o,
1716
- plot: Z,
1713
+ render: (e, { inspected: c, cursor: d }) => {
1714
+ let f = r.findIndex((e) => e.id === c), m = gn({
1715
+ landmarks: l,
1716
+ plot: Q,
1717
1717
  first: [
1718
- b ?? null,
1719
- u,
1718
+ x ?? null,
1719
+ c,
1720
1720
  d
1721
1721
  ]
1722
- }), g = ne.find((e) => e.id === d), _ = Ze(d, ne), y = W === null ? s(Ve, u) : Xe(W), S = W === null ? void 0 : Ne[n.group[W] ?? 0];
1722
+ }), _ = m.find((e) => e.id === d), v = Xe(d, m), b = W === null ? o(Be, c) : Ye(W), re = W === null ? void 0 : Me[n.group[W] ?? 0];
1723
1723
  return /* @__PURE__ */ H(oe, {
1724
1724
  ...E,
1725
1725
  figure: e,
1726
- series: He,
1727
- seriesLegend: /* @__PURE__ */ H(re, {
1728
- items: He,
1726
+ series: Ve,
1727
+ seriesLegend: /* @__PURE__ */ H(ne, {
1728
+ items: Ve,
1729
1729
  label: `${O} groups`
1730
1730
  }),
1731
- footer: q === 0 ? void 0 : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H(c, {
1731
+ footer: J === 0 ? void 0 : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H(u, {
1732
1732
  id: j,
1733
- children: y
1734
- }), we !== null && we !== Pe && /* @__PURE__ */ H("p", { children: "WebGL is unavailable in this browser, so the map draws with canvas 2D and responds more slowly." })] }),
1735
- children: q === 0 ? /* @__PURE__ */ H(ce, { children: T }) : /* @__PURE__ */ U(xe, { children: [
1733
+ children: b
1734
+ }), we !== null && we !== Ne && /* @__PURE__ */ H("p", { children: "WebGL is unavailable in this browser, so the map draws with canvas 2D and responds more slowly." })] }),
1735
+ children: J === 0 ? /* @__PURE__ */ H(ce, { children: T }) : /* @__PURE__ */ U(xe, { children: [
1736
1736
  /* @__PURE__ */ U(N, {
1737
1737
  view: L,
1738
1738
  onViewChange: be,
1739
- isEnabled: h,
1739
+ isEnabled: g,
1740
1740
  onKeyDown: () => Se(null),
1741
1741
  children: [/* @__PURE__ */ H(de, {
1742
1742
  plotRef: A.ref,
1743
- box: Q,
1743
+ box: $,
1744
1744
  label: ee({
1745
1745
  title: O,
1746
1746
  marks: "groups and landmarks",
1747
- isSelectable: x !== void 0 && o.length > 0
1747
+ isSelectable: S !== void 0 && l.length > 0
1748
1748
  }),
1749
1749
  readoutId: j,
1750
1750
  overlay: /* @__PURE__ */ U(xe, { children: [
1751
1751
  /* @__PURE__ */ H(I, {
1752
- box: Q,
1752
+ box: $,
1753
1753
  points: n,
1754
- x: Z.x,
1755
- y: Z.y,
1756
- tones: Ne.map((e) => e.tone),
1757
- highlight: p === -1 ? null : p,
1758
- radius: Fe.radius,
1759
- opacity: Fe.opacity,
1760
- renderer: Pe,
1754
+ x: Q.x,
1755
+ y: Q.y,
1756
+ tones: Me.map((e) => e.tone),
1757
+ highlight: f === -1 ? null : f,
1758
+ radius: Pe.radius,
1759
+ opacity: Pe.opacity,
1760
+ renderer: Ne,
1761
1761
  onDraw: (e) => Te(e.renderer)
1762
1762
  }),
1763
1763
  /* @__PURE__ */ H(he, {
1764
- onPointerMove: (e) => e.pointerType === "mouse" && qe(e),
1764
+ onPointerMove: (e) => e.pointerType === "mouse" && Ke(e),
1765
1765
  onPointerLeave: () => Se(null),
1766
- onPointerDown: Je,
1767
- ...R.props(un.surface(Q.left, Q.top), un.size(Q.innerWidth, Q.innerHeight), h ? un.explore : m === void 0 ? un.inspect : un.brush)
1766
+ onPointerDown: qe,
1767
+ ...R.props(un.surface($.left, $.top), un.size($.innerWidth, $.innerHeight), g ? un.explore : h === void 0 ? un.inspect : un.brush)
1768
1768
  }),
1769
1769
  /* @__PURE__ */ U("svg", {
1770
1770
  "aria-hidden": !0,
1771
- width: Q.width,
1772
- height: Q.height,
1773
- viewBox: `0 0 ${Q.width} ${Q.height}`,
1771
+ width: $.width,
1772
+ height: $.height,
1773
+ viewBox: `0 0 ${$.width} ${$.height}`,
1774
1774
  className: "x10l6tqk x13vifvy xu96u03 x1rea2x4 x47corl",
1775
1775
  children: [
1776
1776
  /* @__PURE__ */ U(pe, {
1777
- box: Q,
1777
+ box: $,
1778
1778
  children: [
1779
- Qe !== null && /* @__PURE__ */ H("rect", {
1780
- x: Z.x.position(Qe.x[0]),
1781
- y: Z.y.position(Qe.y[1]),
1782
- width: Z.x.position(Qe.x[1]) - Z.x.position(Qe.x[0]),
1783
- height: Z.y.position(Qe.y[0]) - Z.y.position(Qe.y[1]),
1779
+ Ze !== null && /* @__PURE__ */ H("rect", {
1780
+ x: Q.x.position(Ze.x[0]),
1781
+ y: Q.y.position(Ze.y[1]),
1782
+ width: Q.x.position(Ze.x[1]) - Q.x.position(Ze.x[0]),
1783
+ height: Q.y.position(Ze.y[0]) - Q.y.position(Ze.y[1]),
1784
1784
  className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x13efnbd"
1785
1785
  }),
1786
- _ !== void 0 && /* @__PURE__ */ H("rect", {
1787
- x: Z.x.position(_.x[0]) - nn,
1788
- y: Z.y.position(_.y[1]) - nn,
1789
- width: Z.x.position(_.x[1]) - Z.x.position(_.x[0]) + 8,
1790
- height: Z.y.position(_.y[0]) - Z.y.position(_.y[1]) + 8,
1786
+ v !== void 0 && /* @__PURE__ */ H("rect", {
1787
+ x: Q.x.position(v.x[0]) - nn,
1788
+ y: Q.y.position(v.y[1]) - nn,
1789
+ width: Q.x.position(v.x[1]) - Q.x.position(v.x[0]) + 8,
1790
+ height: Q.y.position(v.y[0]) - Q.y.position(v.y[1]) + 8,
1791
1791
  ...R.props(un.cursorBox, C.shapeCursor)
1792
1792
  }),
1793
- W !== null && S !== void 0 && /* @__PURE__ */ H(w, {
1794
- x: Z.x.position(n.x[W] ?? 0),
1795
- y: Z.y.position(n.y[W] ?? 0),
1796
- tone: S.tone,
1793
+ W !== null && re !== void 0 && /* @__PURE__ */ H(w, {
1794
+ x: Q.x.position(n.x[W] ?? 0),
1795
+ y: Q.y.position(n.y[W] ?? 0),
1796
+ tone: re.tone,
1797
1797
  isInspected: !0
1798
1798
  })
1799
1799
  ]
1800
1800
  }),
1801
- ne.map((e) => /* @__PURE__ */ U(l, {
1801
+ m.map((e) => /* @__PURE__ */ U(s, {
1802
1802
  value: e.id,
1803
1803
  render: /* @__PURE__ */ H("g", {}),
1804
1804
  className: "x67bb7w x1ypdohk",
@@ -1807,18 +1807,18 @@ function _n(e) {
1807
1807
  y: e.top,
1808
1808
  tone: "neutral",
1809
1809
  radius: Zt,
1810
- isInspected: e.id === u,
1811
- isSelected: e.id === b
1810
+ isInspected: e.id === c,
1811
+ isSelected: e.id === x
1812
1812
  }), e.hasLabel && /* @__PURE__ */ H(ue, {
1813
1813
  x: e.left + Qt,
1814
1814
  y: e.top + en,
1815
1815
  children: e.label
1816
1816
  })]
1817
1817
  }, e.id)),
1818
- g !== void 0 && /* @__PURE__ */ H("rect", {
1819
- x: g.left - Zt - nn,
1820
- y: g.top - $t / 2 - nn / 2,
1821
- width: (g.hasLabel ? g.width + Qt : 0) + 14,
1818
+ _ !== void 0 && /* @__PURE__ */ H("rect", {
1819
+ x: _.left - Zt - nn,
1820
+ y: _.top - $t / 2 - nn / 2,
1821
+ width: (_.hasLabel ? _.width + Qt : 0) + 14,
1822
1822
  height: 18,
1823
1823
  ...R.props(un.cursorBox, C.shapeCursor)
1824
1824
  })
@@ -1826,39 +1826,39 @@ function _n(e) {
1826
1826
  })
1827
1827
  ] }),
1828
1828
  children: /* @__PURE__ */ H(le, {
1829
- box: Q,
1830
- xTicks: Z.xTicks,
1831
- yTicks: Z.yTicks,
1829
+ box: $,
1830
+ xTicks: Q.xTicks,
1831
+ yTicks: Q.yTicks,
1832
1832
  xTitle: te(i),
1833
1833
  yTitle: te(a),
1834
1834
  grid: "both"
1835
1835
  })
1836
- }), h && /* @__PURE__ */ U("div", {
1836
+ }), g && /* @__PURE__ */ U("div", {
1837
1837
  className: "x78zum5 x1a02dak x1pha0wt x8zbtdt x1gkm1c7 xeuugli xyrmp21 x153jb6y xy8obcc xas2l8k xss6m8b",
1838
- children: [/* @__PURE__ */ U("span", { children: ["Drag to pan. Pinch, or hold Control or Command and scroll, to zoom.", m === void 0 ? "" : " Hold Shift and drag to select an area."] }), /* @__PURE__ */ H(t, {
1838
+ children: [/* @__PURE__ */ U("span", { children: ["Drag to pan. Pinch, or hold Control or Command and scroll, to zoom.", h === void 0 ? "" : " Hold Shift and drag to select an area."] }), /* @__PURE__ */ H(t, {
1839
1839
  density: "compact",
1840
- disabled: Me,
1840
+ disabled: je,
1841
1841
  onClick: () => be(M),
1842
1842
  children: "Reset view"
1843
1843
  })]
1844
1844
  })]
1845
1845
  }),
1846
- m !== void 0 && /* @__PURE__ */ U("div", {
1846
+ h !== void 0 && /* @__PURE__ */ U("div", {
1847
1847
  className: "x78zum5 x1a02dak x1pha0wt x8zbtdt x1gkm1c7 xeuugli xyrmp21 x153jb6y xy8obcc xas2l8k xss6m8b",
1848
1848
  children: [
1849
- /* @__PURE__ */ H("span", { children: f === null ? h ? "No area selected." : "Drag on the map to select an area." : `Selected area: ${ze(f, K)}` }),
1850
- h && /* @__PURE__ */ H(t, {
1849
+ /* @__PURE__ */ H("span", { children: p === null ? g ? "No area selected." : "Drag on the map to select an area." : `Selected area: ${Re(p, q)}` }),
1850
+ g && /* @__PURE__ */ H(t, {
1851
1851
  density: "compact",
1852
- onClick: (e) => Ye({
1853
- x: X.x,
1854
- y: X.y
1852
+ onClick: (e) => Je({
1853
+ x: Z.x,
1854
+ y: Z.y
1855
1855
  }, "trigger-press", e.nativeEvent),
1856
1856
  children: "Select visible area"
1857
1857
  }),
1858
1858
  /* @__PURE__ */ H(t, {
1859
1859
  density: "compact",
1860
- disabled: f === null,
1861
- onClick: (e) => Ye(null, "clear-press", e.nativeEvent),
1860
+ disabled: p === null,
1861
+ onClick: (e) => Je(null, "clear-press", e.nativeEvent),
1862
1862
  children: "Clear range"
1863
1863
  })
1864
1864
  ]
@@ -1879,24 +1879,24 @@ function _n(e) {
1879
1879
  label: "Share"
1880
1880
  }
1881
1881
  ],
1882
- rows: Be.map((e) => ({
1882
+ rows: ze.map((e) => ({
1883
1883
  id: e.id,
1884
1884
  values: [
1885
1885
  e.label,
1886
- v({
1886
+ y({
1887
1887
  value: e.items,
1888
1888
  locale: D,
1889
1889
  format: sn
1890
1890
  }),
1891
- v({
1892
- value: q === 0 ? 0 : e.items / q,
1891
+ y({
1892
+ value: J === 0 ? 0 : e.items / J,
1893
1893
  locale: D,
1894
1894
  format: cn
1895
1895
  })
1896
1896
  ]
1897
1897
  }))
1898
1898
  }),
1899
- o.length > 0 && /* @__PURE__ */ H(ae, {
1899
+ l.length > 0 && /* @__PURE__ */ H(ae, {
1900
1900
  label: `${O} landmarks`,
1901
1901
  columns: [
1902
1902
  {
@@ -1912,12 +1912,12 @@ function _n(e) {
1912
1912
  label: a.label
1913
1913
  }
1914
1914
  ],
1915
- rows: o.map((e) => ({
1915
+ rows: l.map((e) => ({
1916
1916
  id: e.id,
1917
1917
  values: [
1918
1918
  e.label,
1919
- Ie(e.x),
1920
- Le(e.y)
1919
+ Fe(e.x),
1920
+ Ie(e.y)
1921
1921
  ]
1922
1922
  }))
1923
1923
  })
@@ -1926,4 +1926,4 @@ function _n(e) {
1926
1926
  }
1927
1927
  });
1928
1928
  }
1929
- export { Ut as a, Je as c, Wt as i, Le as l, $ as n, wt as o, Yt as r, Ct as s, _n as t, G as u };
1929
+ export { Ht as a, qe as c, Ut as i, Ie as l, Yt as n, Ct as o, Jt as r, St as s, _n as t, G as u };