@mechane-ai/elements 0.49.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -2
- package/dist/{article-yyNPg6VU.js → article-CRlhq9oA.js} +531 -463
- package/dist/article.js +1 -1
- package/dist/catalog.json +29 -1
- package/dist/{categorical-values-DCznViFp.js → categorical-values-BYP_R5gS.js} +13 -13
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +1 -1
- package/dist/charts/plot.js +4 -4
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +1 -1
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +7 -7
- package/dist/{dumbbell-plot-CMv9llfd.js → dumbbell-plot-B-Tn7ewW.js} +45 -45
- package/dist/{embedding-map-DC-lgzCq.js → embedding-map-Bljn-A5q.js} +528 -528
- package/dist/figure-frame-CEijciL7.js +289 -0
- package/dist/{image-grid-DHqtj_zs.js → image-grid-mrG5u9oE.js} +47 -47
- package/dist/kits/evaluation.js +3 -3
- package/dist/kits/interpretability.js +6 -6
- package/dist/kits/operations.js +3 -3
- package/dist/kits/research.js +2 -2
- package/dist/kits/training.js +2 -2
- package/dist/lesson/spec.js +11 -11
- package/dist/lesson.js +4 -4
- package/dist/mdx.js +4 -4
- package/dist/packages/charts/src/figure/caption-scope.d.ts +12 -0
- package/dist/packages/charts/src/figure/figure-frame.d.ts +2 -1
- package/dist/packages/charts/src/index.d.ts +2 -0
- package/dist/packages/teaching/src/article/article-context.d.ts +2 -0
- package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +13 -0
- package/dist/packages/teaching/src/article/article.d.ts +6 -1
- package/dist/packages/teaching/src/article/figure.d.ts +20 -3
- package/dist/packages/teaching/src/article/index.d.ts +1 -1
- package/dist/packages/teaching/src/article/view-essay.d.ts +2 -1
- package/dist/packages/teaching/src/lesson/define-lesson.d.ts +4 -0
- package/dist/packages/teaching/src/lesson/index.d.ts +2 -2
- package/dist/packages/teaching/src/lesson/lesson-player.d.ts +19 -3
- package/dist/packages/teaching/src/lesson/lesson-store.d.ts +2 -0
- package/dist/packages/teaching/src/lesson/playback.d.ts +9 -6
- package/dist/packages/teaching/src/lesson/use-lesson.d.ts +7 -2
- package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +4 -1
- package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +5 -6
- package/dist/packages/teaching/src/scene/scene-geometry.d.ts +1 -1
- package/dist/packages/teaching/src/scene/scene-node.d.ts +4 -1
- package/dist/packages/teaching/src/scene/scene-validate.d.ts +6 -0
- package/dist/packages/teaching/src/scene/scene-wire.d.ts +6 -1
- package/dist/packages/teaching/src/scene/scene.d.ts +1 -1
- package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +5 -1
- package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +1 -1
- package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +1 -1
- package/dist/packages/teaching/src/time/tween.d.ts +2 -0
- package/dist/{param-BE3VMSkH.js → param-BdqTpZER.js} +166 -99
- package/dist/{plot-layout-Bqe4-0qZ.js → plot-layout-B2xRt-_k.js} +144 -130
- package/dist/{plot-surface-DON6WUmk.js → plot-surface-0cKFwtws.js} +1 -1
- package/dist/{reference-lines-hjuD1rRZ.js → reference-lines-nSxcZVF5.js} +1 -1
- package/dist/{scene-BP0Ue0R5.js → scene-BwJKueD6.js} +1227 -1125
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-C8eeSgL4.js → slope-chart-CGTYbFxi.js} +179 -179
- package/dist/styles2.css +69 -14
- package/dist/{time-series-BL933QyA.js → time-series-Dh8y5ba0.js} +952 -948
- package/dist/{token-heatmap-BB65awva.js → token-heatmap-BTrZ3-N4.js} +84 -84
- package/dist/{token-predictions-Pa8eUGan.js → token-predictions-CUe4junQ.js} +126 -126
- package/dist/{transport-DzyxVXbL.js → transport-4V9rfYHN.js} +278 -233
- package/dist/{tree-diagram-DJhKBiia.js → tree-diagram-Dpqmo-fh.js} +115 -115
- package/dist/{treemap-CxxgABUg.js → treemap-BUSaVD3m.js} +27 -27
- package/dist/use-tween-BsaEO862.js +10 -0
- package/dist/{violin-plot-CoAEF_7Z.js → violin-plot-BxaLwdRi.js} +123 -123
- package/dist/{waterfall-DdoEXEkT.js → waterfall-CcDMdKec.js} +39 -39
- package/package.json +1 -1
- package/recipes/counting-cards.tsx +3 -3
- package/skills/review-explainer/SKILL.md +2 -1
- package/skills/upgrade-elements/references/releases.md +61 -0
- package/skills/use-elements/SKILL.md +3 -1
- package/skills/use-elements/references/styling.md +23 -0
- package/skills/use-elements/references/teaching.md +13 -0
- package/skills/write-explainer/references/article.md +50 -2
- package/skills/write-explainer/references/lesson.md +18 -9
- package/skills/write-explainer/references/scene-parts.md +17 -12
- package/skills/write-explainer/references/scene.md +25 -3
- package/dist/figure-frame-BjFzbl3m.js +0 -270
- 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,
|
|
7
|
-
import { i as
|
|
8
|
-
import { a as
|
|
9
|
-
import { r as
|
|
10
|
-
import { a as
|
|
11
|
-
import { i as ie, l as ae, n as oe, r as se, t as ce } from "./figure-frame-
|
|
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-CEijciL7.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-
|
|
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,
|
|
60
|
-
function
|
|
61
|
-
let r = n.length *
|
|
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 -
|
|
66
|
-
y1: t +
|
|
65
|
+
y0: t - ke - Q,
|
|
66
|
+
y1: t + Ae + Q
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
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
|
|
73
|
+
var Me = {
|
|
74
74
|
kDwRjp: "xbh8q5q",
|
|
75
75
|
$$css: !0
|
|
76
|
-
},
|
|
76
|
+
}, Ne = {
|
|
77
77
|
level: (e) => [
|
|
78
|
-
|
|
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
|
|
96
|
-
let r =
|
|
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
|
|
100
|
-
let c =
|
|
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) =>
|
|
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
|
|
118
|
-
let { grid: t, levels: n, x: r, y: i, value: a, path:
|
|
119
|
-
if (
|
|
120
|
-
...
|
|
121
|
-
height:
|
|
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 :
|
|
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:
|
|
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
|
-
...
|
|
134
|
+
..._,
|
|
135
135
|
message: M
|
|
136
136
|
});
|
|
137
|
-
let N =
|
|
138
|
-
width:
|
|
139
|
-
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:
|
|
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
|
|
153
|
+
return y({
|
|
154
154
|
value: e,
|
|
155
|
-
locale:
|
|
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:
|
|
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) *
|
|
192
|
-
y: (t.y + n.y) *
|
|
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) *
|
|
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) => [
|
|
219
|
+
}, we = W.flatMap((e) => [$({
|
|
220
220
|
x: e.px,
|
|
221
|
-
y: e.py -
|
|
221
|
+
y: e.py - q - X,
|
|
222
222
|
text: e.label
|
|
223
223
|
}), {
|
|
224
|
-
x0: e.px -
|
|
225
|
-
x1: e.px +
|
|
226
|
-
y0: e.py -
|
|
227
|
-
y1: e.py +
|
|
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*
|
|
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 -
|
|
236
|
+
y: e.y - X
|
|
237
237
|
})).find((t) => {
|
|
238
|
-
let n =
|
|
239
|
-
return r && i && !e.taken.some((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,
|
|
241
|
+
r !== void 0 && (e.taken = [...e.taken, $(r)], yield r);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
let
|
|
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}: ${
|
|
251
|
+
`${r.label}: ${y({
|
|
252
252
|
value: e.x,
|
|
253
|
-
locale:
|
|
253
|
+
locale: b,
|
|
254
254
|
format: r.format
|
|
255
255
|
})}`,
|
|
256
|
-
`${i.label}: ${
|
|
256
|
+
`${i.label}: ${y({
|
|
257
257
|
value: e.y,
|
|
258
|
-
locale:
|
|
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
|
|
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 <=
|
|
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
|
|
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(
|
|
286
|
-
items:
|
|
287
|
-
locate:
|
|
288
|
-
selected:
|
|
289
|
-
onSelect:
|
|
290
|
-
render: (e, { inspected: t, selected: n, cursor:
|
|
291
|
-
let
|
|
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
|
-
...
|
|
293
|
+
..._,
|
|
294
294
|
figure: e,
|
|
295
|
-
series:
|
|
296
|
-
seriesLegend:
|
|
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(
|
|
306
|
-
id:
|
|
307
|
-
children:
|
|
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:
|
|
310
|
-
plotRef:
|
|
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:
|
|
313
|
+
title: x,
|
|
314
314
|
marks: "levels and markers",
|
|
315
|
-
isSelectable:
|
|
315
|
+
isSelectable: p !== void 0
|
|
316
316
|
}),
|
|
317
|
-
readoutId:
|
|
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,
|
|
332
|
+
...R.props(C.mark, C.emphasis, Ne.level(e.color))
|
|
333
333
|
}, e.id)),
|
|
334
|
-
|
|
334
|
+
c.map((e) => /* @__PURE__ */ H("path", {
|
|
335
335
|
d: e.d,
|
|
336
|
-
...R.props(C.mark,
|
|
336
|
+
...R.props(C.mark, Ne.level(e.color), Ne.focused)
|
|
337
337
|
}, e.id)),
|
|
338
|
-
|
|
339
|
-
d:
|
|
340
|
-
...R.props(C.shapeCursor,
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
373
|
-
...R.props(C.shapeCursor,
|
|
372
|
+
r: De,
|
|
373
|
+
...R.props(C.shapeCursor, Ne.cursor)
|
|
374
374
|
})
|
|
375
375
|
]
|
|
376
376
|
}),
|
|
377
|
-
|
|
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 -
|
|
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: `${
|
|
392
|
+
label: `${x} levels and markers`,
|
|
393
393
|
columns: [{
|
|
394
394
|
id: "item",
|
|
395
395
|
label: "Level or marker"
|
|
396
396
|
}],
|
|
397
|
-
rows:
|
|
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
|
|
408
|
-
function
|
|
407
|
+
var Le = 2;
|
|
408
|
+
function Re(e, t) {
|
|
409
409
|
return e.values[t.id] ?? null;
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function ze({ dimensions: e, rows: t }) {
|
|
412
412
|
return e.map((e) => ({
|
|
413
413
|
...e,
|
|
414
|
-
domain: e.domain ??
|
|
415
|
-
values: t.map((t) =>
|
|
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
|
|
421
|
-
if (e.length <
|
|
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 (!
|
|
424
|
-
let i = e.map((e) =>
|
|
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)),
|
|
427
|
-
if (
|
|
428
|
-
let
|
|
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:
|
|
432
|
-
}))).find(({ axis: e, value: t }) => t !== null &&
|
|
433
|
-
if (
|
|
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
|
|
436
|
-
let a = t.map((t) => `${t.label}: ${
|
|
437
|
-
value:
|
|
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) =>
|
|
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
|
|
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:
|
|
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
|
|
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) =>
|
|
471
|
-
value:
|
|
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
|
|
479
|
-
let t =
|
|
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
|
|
496
|
-
function
|
|
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]) /
|
|
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 ${
|
|
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
|
|
575
|
+
var qe = {
|
|
576
576
|
dimensions: 12,
|
|
577
577
|
rows: 500
|
|
578
|
-
},
|
|
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
|
-
},
|
|
590
|
-
function*
|
|
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) >=
|
|
594
|
+
Math.abs(e - n.last) >= vt && (n.last = e, yield r);
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
|
-
function
|
|
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 && (
|
|
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
|
|
606
|
+
function xt({ row: e, axes: t, ranges: n }) {
|
|
607
607
|
return t.every((t) => {
|
|
608
|
-
let r = n[t.id], i =
|
|
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
|
|
613
|
-
let { dimensions: t, rows: n, groups: r = [], ranges: i = {}, onRangesChange: a, height:
|
|
614
|
-
if (z(() => () => j.current?.(), []),
|
|
615
|
-
...
|
|
616
|
-
height:
|
|
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 =
|
|
618
|
+
let M = ze({
|
|
619
619
|
dimensions: t,
|
|
620
620
|
rows: n
|
|
621
|
-
}), me =
|
|
621
|
+
}), me = Be({
|
|
622
622
|
axes: M,
|
|
623
623
|
rows: n,
|
|
624
624
|
groups: r,
|
|
625
|
-
limits:
|
|
626
|
-
}) ??
|
|
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
|
-
...
|
|
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 = (
|
|
638
|
-
let { values: t, labels: n } =
|
|
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:
|
|
642
|
-
spacing:
|
|
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 ?
|
|
651
|
-
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 :
|
|
656
|
-
width:
|
|
657
|
-
height:
|
|
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:
|
|
659
|
+
top: K,
|
|
660
660
|
right: Ee,
|
|
661
|
-
bottom:
|
|
661
|
+
bottom: nt,
|
|
662
662
|
left: Te
|
|
663
663
|
}
|
|
664
|
-
}),
|
|
665
|
-
let n =
|
|
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: [
|
|
668
|
+
range: [q.bottom, q.top]
|
|
669
669
|
});
|
|
670
670
|
return {
|
|
671
671
|
axis: e,
|
|
672
|
-
x:
|
|
672
|
+
x: q.left + t * J,
|
|
673
673
|
scale: n,
|
|
674
|
-
ticks: Array.from(
|
|
674
|
+
ticks: Array.from(yt({
|
|
675
675
|
ticks: I[t] ?? [],
|
|
676
676
|
scale: n
|
|
677
677
|
}))
|
|
678
678
|
};
|
|
679
|
-
}),
|
|
680
|
-
let t =
|
|
681
|
-
let n =
|
|
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 =
|
|
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:
|
|
692
|
+
isMatch: xt({
|
|
693
693
|
row: e,
|
|
694
694
|
axes: M,
|
|
695
695
|
ranges: N
|
|
696
696
|
})
|
|
697
697
|
};
|
|
698
|
-
}),
|
|
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
|
-
}),
|
|
705
|
-
function
|
|
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
|
|
712
|
-
let t = e.x / e.width *
|
|
713
|
-
return (
|
|
714
|
-
let t = e.ys[i] ?? null, r = e.ys[i + 1] ?? null, o = t !== null && r !== null ? t + (r - t) * a : a <
|
|
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
|
|
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 *
|
|
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 *
|
|
728
|
-
return c?.scale.valueAt(Math.min(
|
|
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
|
|
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:
|
|
741
|
+
range: f(e)
|
|
742
742
|
});
|
|
743
743
|
},
|
|
744
744
|
onEnd: (e, t) => {
|
|
745
745
|
j.current = null, A(null);
|
|
746
|
-
let n =
|
|
747
|
-
!t && d.hasMoved && n[0] < n[1] &&
|
|
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(
|
|
759
|
-
...
|
|
760
|
-
items:
|
|
761
|
-
locate:
|
|
758
|
+
return /* @__PURE__ */ H(c, {
|
|
759
|
+
...S,
|
|
760
|
+
items: De,
|
|
761
|
+
locate: Ae,
|
|
762
762
|
selected: l,
|
|
763
|
-
onSelect:
|
|
763
|
+
onSelect: d,
|
|
764
764
|
render: (e, { inspected: t, selected: r, cursor: i }) => {
|
|
765
|
-
let
|
|
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
|
-
...
|
|
767
|
+
...m,
|
|
768
768
|
figure: e,
|
|
769
769
|
series: O,
|
|
770
|
-
seriesLegend: O.length > 0 ? /* @__PURE__ */ H(
|
|
771
|
-
footer: n.length === 0 ? void 0 : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H(
|
|
772
|
-
id:
|
|
773
|
-
children:
|
|
774
|
-
}), /* @__PURE__ */ H(
|
|
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:
|
|
777
|
+
locale: v,
|
|
778
|
+
matching: Oe.length,
|
|
779
779
|
total: n.length,
|
|
780
|
-
onChange: (e, t) =>
|
|
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:
|
|
787
|
-
box:
|
|
786
|
+
plotRef: b.ref,
|
|
787
|
+
box: q,
|
|
788
788
|
label: ee({
|
|
789
|
-
title:
|
|
789
|
+
title: y,
|
|
790
790
|
marks: "rows",
|
|
791
|
-
isSelectable:
|
|
791
|
+
isSelectable: d !== void 0
|
|
792
792
|
}),
|
|
793
|
-
readoutId:
|
|
794
|
-
onPointerDown:
|
|
793
|
+
readoutId: x,
|
|
794
|
+
onPointerDown: Z,
|
|
795
795
|
children: [
|
|
796
|
-
|
|
796
|
+
Y.map((e) => /* @__PURE__ */ U("g", { children: [/* @__PURE__ */ H("line", {
|
|
797
797
|
x1: e.x,
|
|
798
798
|
x2: e.x,
|
|
799
|
-
y1:
|
|
800
|
-
y2:
|
|
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 -
|
|
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:
|
|
810
|
+
box: q,
|
|
811
811
|
children: [
|
|
812
|
-
|
|
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:
|
|
820
|
+
radius: _t,
|
|
821
821
|
emphasis: e.isMatch ? f : "context"
|
|
822
822
|
}, t.x))] }, e.row.id)),
|
|
823
|
-
[
|
|
823
|
+
[c, s].map((e) => e === void 0 ? null : /* @__PURE__ */ H("path", {
|
|
824
824
|
d: e.d,
|
|
825
|
-
...R.props(C.mark,
|
|
825
|
+
...R.props(C.mark, Je.ink, e !== s && Je.selected)
|
|
826
826
|
}, e.row.id)),
|
|
827
|
-
|
|
828
|
-
x:
|
|
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(
|
|
831
|
-
radius:
|
|
830
|
+
tone: le(s.row),
|
|
831
|
+
radius: gt,
|
|
832
832
|
isInspected: !0
|
|
833
|
-
},
|
|
834
|
-
|
|
835
|
-
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
|
-
|
|
842
|
-
x: e.x -
|
|
843
|
-
y: e.scale.position(t.value) +
|
|
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:
|
|
849
|
+
y: q.top - et,
|
|
850
850
|
textAnchor: B ? "start" : "middle",
|
|
851
|
-
transform: B ? `rotate(-${
|
|
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
|
-
|
|
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 -
|
|
858
|
+
x: e.x - mt / 2,
|
|
859
859
|
y: e.scale.position(t[1]),
|
|
860
|
-
width:
|
|
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 -
|
|
865
|
-
y:
|
|
864
|
+
x: e.x - pt,
|
|
865
|
+
y: q.top,
|
|
866
866
|
width: 20,
|
|
867
|
-
height:
|
|
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: `${
|
|
874
|
-
...
|
|
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
|
|
885
|
+
var Ct = {
|
|
886
886
|
dimensions: 6,
|
|
887
887
|
rows: 500
|
|
888
|
-
},
|
|
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
|
|
899
|
-
let { dimensions: t, rows: n, groups: r = [], height: i = "regular", selected: a, onSelectedChange:
|
|
900
|
-
if (
|
|
901
|
-
...
|
|
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 =
|
|
904
|
+
let E = ze({
|
|
905
905
|
dimensions: t,
|
|
906
906
|
rows: n
|
|
907
|
-
}), D =
|
|
907
|
+
}), D = Be({
|
|
908
908
|
axes: E,
|
|
909
909
|
rows: n,
|
|
910
910
|
groups: r,
|
|
911
|
-
limits:
|
|
911
|
+
limits: Ct
|
|
912
912
|
});
|
|
913
913
|
if (D !== void 0) return /* @__PURE__ */ H(se, {
|
|
914
|
-
...
|
|
914
|
+
...m,
|
|
915
915
|
message: D
|
|
916
916
|
});
|
|
917
|
-
let O = (
|
|
918
|
-
let { values: t, labels: n } =
|
|
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:
|
|
922
|
-
spacing: O ?
|
|
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 =
|
|
931
|
-
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 =
|
|
936
|
-
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 =
|
|
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 +
|
|
944
|
-
}), a = A[t] ?? [], o = Math.max(0, ...a.map((e) => e.label.length)) *
|
|
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 *
|
|
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:
|
|
952
|
+
yScale: re({
|
|
953
953
|
type: e.scale,
|
|
954
954
|
domain: e.domain,
|
|
955
|
-
range: [r + P -
|
|
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 =
|
|
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
|
|
975
|
+
return y({
|
|
976
976
|
value: t,
|
|
977
|
-
locale:
|
|
977
|
+
locale: v,
|
|
978
978
|
format: e.format
|
|
979
979
|
});
|
|
980
980
|
}
|
|
981
|
-
let _e =
|
|
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(
|
|
998
|
+
return /* @__PURE__ */ H(c, {
|
|
999
999
|
...le,
|
|
1000
1000
|
items: _e,
|
|
1001
1001
|
locate: V,
|
|
1002
1002
|
selected: a,
|
|
1003
|
-
onSelect:
|
|
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),
|
|
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
|
-
...
|
|
1007
|
+
...m,
|
|
1008
1008
|
figure: e,
|
|
1009
1009
|
series: pe,
|
|
1010
|
-
seriesLegend: pe.length > 0 ? /* @__PURE__ */ H(
|
|
1011
|
-
footer: n.length === 0 ? void 0 : /* @__PURE__ */ H(
|
|
1012
|
-
id:
|
|
1013
|
-
children:
|
|
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:
|
|
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(
|
|
1018
|
+
...R.props(Vt.scrolled(me)),
|
|
1019
1019
|
children: /* @__PURE__ */ U(de, {
|
|
1020
|
-
plotRef:
|
|
1020
|
+
plotRef: x.ref,
|
|
1021
1021
|
box: F,
|
|
1022
1022
|
label: ee({
|
|
1023
|
-
title:
|
|
1023
|
+
title: b,
|
|
1024
1024
|
marks: "rows",
|
|
1025
|
-
isSelectable:
|
|
1025
|
+
isSelectable: s !== void 0
|
|
1026
1026
|
}),
|
|
1027
|
-
readoutId:
|
|
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 +
|
|
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 -
|
|
1065
|
-
y: e.yScale.position(t.value) +
|
|
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,
|
|
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:
|
|
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:
|
|
1094
|
+
radius: It,
|
|
1095
1095
|
isInspected: n.id === t,
|
|
1096
1096
|
isSelected: n.id === r
|
|
1097
1097
|
}, n.id);
|
|
1098
1098
|
}),
|
|
1099
|
-
|
|
1100
|
-
cx: z(e,
|
|
1101
|
-
cy: z(e,
|
|
1102
|
-
r:
|
|
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: `${
|
|
1111
|
-
...
|
|
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
|
|
1122
|
+
var Ut = {
|
|
1123
1123
|
columns: 512,
|
|
1124
1124
|
rows: 512,
|
|
1125
1125
|
cellItems: 1024
|
|
1126
|
-
},
|
|
1126
|
+
}, Wt = { outline: {
|
|
1127
1127
|
kDwRjp: "xbh8q5q",
|
|
1128
1128
|
kfzvcC: "x47corl",
|
|
1129
1129
|
$$css: !0
|
|
1130
1130
|
} };
|
|
1131
|
-
function
|
|
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:
|
|
1149
|
+
maximum: x(e)?.[1] ?? 0
|
|
1150
1150
|
};
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
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
|
|
1156
|
-
let { columns: r, rows: i, counts: a, xDomain: o, yDomain: s } = e, c =
|
|
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 (!
|
|
1159
|
-
if (![r, i].every((e) => Number.isInteger(e) && e > 0) || r >
|
|
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
|
|
1164
|
-
let { histogram: t, x: n, y: r, count: i, height: a = "tall", ...
|
|
1165
|
-
counts:
|
|
1166
|
-
columns:
|
|
1167
|
-
rows:
|
|
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
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1169
|
+
ne,
|
|
1170
|
+
h,
|
|
1171
|
+
g
|
|
1172
1172
|
]);
|
|
1173
|
-
if (
|
|
1174
|
-
...
|
|
1173
|
+
if (d.status === "loading") return /* @__PURE__ */ H(ie, {
|
|
1174
|
+
...d,
|
|
1175
1175
|
height: a
|
|
1176
1176
|
});
|
|
1177
|
-
let w =
|
|
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
|
-
...
|
|
1183
|
+
...d,
|
|
1184
1184
|
message: w
|
|
1185
1185
|
});
|
|
1186
|
-
let ue =
|
|
1187
|
-
width:
|
|
1188
|
-
height:
|
|
1186
|
+
let ue = m({
|
|
1187
|
+
width: b.width,
|
|
1188
|
+
height: b.height,
|
|
1189
1189
|
x: n,
|
|
1190
1190
|
y: r,
|
|
1191
|
-
xDomain:
|
|
1192
|
-
yDomain:
|
|
1193
|
-
locale:
|
|
1194
|
-
}), { box: T } = ue, { filled: E, maximum: D } =
|
|
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
|
-
}),
|
|
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
|
|
1204
|
+
return y({
|
|
1205
1205
|
value: e,
|
|
1206
|
-
locale:
|
|
1206
|
+
locale: f,
|
|
1207
1207
|
format: i.format
|
|
1208
1208
|
});
|
|
1209
1209
|
}
|
|
1210
1210
|
function he(e) {
|
|
1211
|
-
let t =
|
|
1211
|
+
let t = y({
|
|
1212
1212
|
value: k.valueAt(e),
|
|
1213
|
-
locale:
|
|
1213
|
+
locale: f,
|
|
1214
1214
|
format: n.format
|
|
1215
|
-
}), r =
|
|
1215
|
+
}), r = y({
|
|
1216
1216
|
value: k.valueAt(e + 1),
|
|
1217
|
-
locale:
|
|
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 =
|
|
1223
|
+
let t = y({
|
|
1224
1224
|
value: j.valueAt(e),
|
|
1225
|
-
locale:
|
|
1225
|
+
locale: f,
|
|
1226
1226
|
format: r.format
|
|
1227
|
-
}), n =
|
|
1227
|
+
}), n = y({
|
|
1228
1228
|
value: j.valueAt(e + 1),
|
|
1229
|
-
locale:
|
|
1229
|
+
locale: f,
|
|
1230
1230
|
format: r.format
|
|
1231
1231
|
});
|
|
1232
1232
|
return `${r.label} ${t} – ${n}`;
|
|
1233
1233
|
}
|
|
1234
|
-
let I =
|
|
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 *
|
|
1247
|
-
if (t >= 0 && t <
|
|
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(
|
|
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:
|
|
1270
|
-
bottom:
|
|
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
|
|
1275
|
+
let s = ve(t), c = ve(a);
|
|
1276
1276
|
return /* @__PURE__ */ H(oe, {
|
|
1277
|
-
...
|
|
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:
|
|
1284
|
+
locale: f
|
|
1285
1285
|
}),
|
|
1286
|
-
footer: E.length === 0 ? void 0 : /* @__PURE__ */ H(
|
|
1287
|
-
id:
|
|
1288
|
-
children:
|
|
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:
|
|
1291
|
+
plotRef: b.ref,
|
|
1292
1292
|
box: T,
|
|
1293
1293
|
label: ee({
|
|
1294
|
-
title:
|
|
1294
|
+
title: p,
|
|
1295
1295
|
marks: N ? "cells" : "rows",
|
|
1296
1296
|
isSelectable: !1
|
|
1297
1297
|
}),
|
|
1298
|
-
readoutId:
|
|
1298
|
+
readoutId: x,
|
|
1299
1299
|
overlay: /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H(A, {
|
|
1300
1300
|
box: T,
|
|
1301
|
-
columns:
|
|
1302
|
-
rows:
|
|
1303
|
-
counts:
|
|
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: [
|
|
1314
|
-
x:
|
|
1315
|
-
y:
|
|
1316
|
-
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(
|
|
1319
|
-
}),
|
|
1320
|
-
x:
|
|
1321
|
-
y:
|
|
1322
|
-
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(
|
|
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: `${
|
|
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 >
|
|
1427
|
+
if (n > Yt.webglPoints) return {
|
|
1428
1428
|
...r,
|
|
1429
|
-
error: `This map draws at most ${
|
|
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 =
|
|
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 = !
|
|
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:
|
|
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
|
|
1478
|
-
if (
|
|
1479
|
-
if (t.length >
|
|
1480
|
-
if (!
|
|
1481
|
-
if (
|
|
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:
|
|
1484
|
-
if (
|
|
1485
|
-
x:
|
|
1486
|
-
y:
|
|
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 (
|
|
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:
|
|
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
|
-
]),
|
|
1528
|
+
]), q = B(() => p === null ? 0 : P({
|
|
1529
1529
|
x: n.x,
|
|
1530
1530
|
y: n.y,
|
|
1531
1531
|
group: n.group
|
|
1532
|
-
},
|
|
1532
|
+
}, p), [
|
|
1533
1533
|
n.x,
|
|
1534
1534
|
n.y,
|
|
1535
1535
|
n.group,
|
|
1536
|
-
|
|
1536
|
+
p
|
|
1537
1537
|
]);
|
|
1538
1538
|
if (z(() => () => Ee.current?.(), []), E.status === "loading") return /* @__PURE__ */ H(ie, {
|
|
1539
1539
|
...E,
|
|
1540
|
-
height:
|
|
1540
|
+
height: b
|
|
1541
1541
|
});
|
|
1542
|
-
let
|
|
1543
|
-
x:
|
|
1544
|
-
y:
|
|
1545
|
-
},
|
|
1546
|
-
summary:
|
|
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:
|
|
1548
|
+
landmarks: l,
|
|
1549
1549
|
x: i,
|
|
1550
1550
|
y: a,
|
|
1551
|
-
domain:
|
|
1552
|
-
range:
|
|
1553
|
-
renderer:
|
|
1554
|
-
count:
|
|
1551
|
+
domain: De,
|
|
1552
|
+
range: p,
|
|
1553
|
+
renderer: f,
|
|
1554
|
+
count: J
|
|
1555
1555
|
});
|
|
1556
|
-
if (
|
|
1556
|
+
if (Oe !== void 0) return /* @__PURE__ */ H(se, {
|
|
1557
1557
|
...E,
|
|
1558
|
-
message:
|
|
1558
|
+
message: Oe
|
|
1559
1559
|
});
|
|
1560
|
-
let
|
|
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
|
-
},
|
|
1567
|
-
...
|
|
1568
|
-
xDomain:
|
|
1569
|
-
yDomain:
|
|
1570
|
-
}),
|
|
1566
|
+
}, Ae = m({
|
|
1567
|
+
...ke,
|
|
1568
|
+
xDomain: Y,
|
|
1569
|
+
yDomain: X
|
|
1570
|
+
}), Z = g ? k({
|
|
1571
1571
|
view: L,
|
|
1572
|
-
box:
|
|
1573
|
-
x:
|
|
1574
|
-
y:
|
|
1575
|
-
}) :
|
|
1576
|
-
...
|
|
1577
|
-
xDomain:
|
|
1578
|
-
yDomain:
|
|
1579
|
-
}) :
|
|
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
|
-
})),
|
|
1587
|
-
function
|
|
1588
|
-
return
|
|
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
|
|
1595
|
-
return
|
|
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
|
|
1602
|
-
return `${i.label} ${
|
|
1601
|
+
function Le(e, t) {
|
|
1602
|
+
return `${i.label} ${Fe(e)}, ${a.label} ${Ie(t)}`;
|
|
1603
1603
|
}
|
|
1604
|
-
function
|
|
1605
|
-
let n =
|
|
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} ${
|
|
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
|
|
1613
|
-
let n =
|
|
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 =
|
|
1618
|
-
value:
|
|
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
|
-
}),
|
|
1628
|
+
}), Be = [...ze.map((e) => ({
|
|
1629
1629
|
id: e.id,
|
|
1630
1630
|
label: e.text
|
|
1631
|
-
})), ...
|
|
1631
|
+
})), ...l.map((e) => ({
|
|
1632
1632
|
id: e.id,
|
|
1633
|
-
label: `${e.label}: ${
|
|
1634
|
-
}))],
|
|
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
|
-
})),
|
|
1639
|
-
function
|
|
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:
|
|
1643
|
-
y:
|
|
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
|
|
1647
|
-
let t =
|
|
1646
|
+
function Ke(e) {
|
|
1647
|
+
let t = Ge(e), n = {
|
|
1648
1648
|
x: t.x,
|
|
1649
1649
|
y: t.y,
|
|
1650
|
-
radiusX: Xt /
|
|
1651
|
-
radiusY: Xt /
|
|
1650
|
+
radiusX: Xt / Ue,
|
|
1651
|
+
radiusY: Xt / We
|
|
1652
1652
|
};
|
|
1653
|
-
Se(
|
|
1653
|
+
Se(K.index?.nearest(n) ?? null);
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1656
|
-
let t = !
|
|
1657
|
-
if (e.pointerType === "touch" && !
|
|
1658
|
-
let i = e.currentTarget, a =
|
|
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:
|
|
1669
|
-
y:
|
|
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:
|
|
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
|
|
1687
|
-
ye({ options: () => ({ onRangeChange:
|
|
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
|
|
1694
|
-
let t =
|
|
1695
|
-
return `${n.ids?.[e] ?? `Item ${
|
|
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 ?? ""} · ${
|
|
1699
|
+
})}`} · ${t?.label ?? ""} · ${Le(n.x[e] ?? 0, n.y[e] ?? 0)}`;
|
|
1700
1700
|
}
|
|
1701
|
-
function
|
|
1702
|
-
if (t.find((t) => t.id === e) === void 0) return
|
|
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
|
|
1705
|
-
return /* @__PURE__ */ H(
|
|
1704
|
+
let Ze = Ce ?? p;
|
|
1705
|
+
return /* @__PURE__ */ H(c, {
|
|
1706
1706
|
...F,
|
|
1707
|
-
items:
|
|
1707
|
+
items: Be,
|
|
1708
1708
|
arrows: "both",
|
|
1709
|
-
selected:
|
|
1709
|
+
selected: x,
|
|
1710
1710
|
onSelect: (e, t) => {
|
|
1711
|
-
|
|
1711
|
+
He.has(e) && S?.(e, t);
|
|
1712
1712
|
},
|
|
1713
|
-
render: (e, { inspected:
|
|
1714
|
-
let
|
|
1715
|
-
landmarks:
|
|
1716
|
-
plot:
|
|
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
|
-
|
|
1719
|
-
|
|
1718
|
+
x ?? null,
|
|
1719
|
+
c,
|
|
1720
1720
|
d
|
|
1721
1721
|
]
|
|
1722
|
-
}),
|
|
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:
|
|
1727
|
-
seriesLegend: /* @__PURE__ */ H(
|
|
1728
|
-
items:
|
|
1726
|
+
series: Ve,
|
|
1727
|
+
seriesLegend: /* @__PURE__ */ H(ne, {
|
|
1728
|
+
items: Ve,
|
|
1729
1729
|
label: `${O} groups`
|
|
1730
1730
|
}),
|
|
1731
|
-
footer:
|
|
1731
|
+
footer: J === 0 ? void 0 : /* @__PURE__ */ U(xe, { children: [/* @__PURE__ */ H(u, {
|
|
1732
1732
|
id: j,
|
|
1733
|
-
children:
|
|
1734
|
-
}), we !== null && we !==
|
|
1735
|
-
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:
|
|
1739
|
+
isEnabled: g,
|
|
1740
1740
|
onKeyDown: () => Se(null),
|
|
1741
1741
|
children: [/* @__PURE__ */ H(de, {
|
|
1742
1742
|
plotRef: A.ref,
|
|
1743
|
-
box:
|
|
1743
|
+
box: $,
|
|
1744
1744
|
label: ee({
|
|
1745
1745
|
title: O,
|
|
1746
1746
|
marks: "groups and landmarks",
|
|
1747
|
-
isSelectable:
|
|
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:
|
|
1752
|
+
box: $,
|
|
1753
1753
|
points: n,
|
|
1754
|
-
x:
|
|
1755
|
-
y:
|
|
1756
|
-
tones:
|
|
1757
|
-
highlight:
|
|
1758
|
-
radius:
|
|
1759
|
-
opacity:
|
|
1760
|
-
renderer:
|
|
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" &&
|
|
1764
|
+
onPointerMove: (e) => e.pointerType === "mouse" && Ke(e),
|
|
1765
1765
|
onPointerLeave: () => Se(null),
|
|
1766
|
-
onPointerDown:
|
|
1767
|
-
...R.props(un.surface(
|
|
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:
|
|
1772
|
-
height:
|
|
1773
|
-
viewBox: `0 0 ${
|
|
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:
|
|
1777
|
+
box: $,
|
|
1778
1778
|
children: [
|
|
1779
|
-
|
|
1780
|
-
x:
|
|
1781
|
-
y:
|
|
1782
|
-
width:
|
|
1783
|
-
height:
|
|
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
|
-
|
|
1787
|
-
x:
|
|
1788
|
-
y:
|
|
1789
|
-
width:
|
|
1790
|
-
height:
|
|
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 &&
|
|
1794
|
-
x:
|
|
1795
|
-
y:
|
|
1796
|
-
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
|
-
|
|
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 ===
|
|
1811
|
-
isSelected: e.id ===
|
|
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
|
-
|
|
1819
|
-
x:
|
|
1820
|
-
y:
|
|
1821
|
-
width: (
|
|
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:
|
|
1830
|
-
xTicks:
|
|
1831
|
-
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
|
-
}),
|
|
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.",
|
|
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:
|
|
1840
|
+
disabled: je,
|
|
1841
1841
|
onClick: () => be(M),
|
|
1842
1842
|
children: "Reset view"
|
|
1843
1843
|
})]
|
|
1844
1844
|
})]
|
|
1845
1845
|
}),
|
|
1846
|
-
|
|
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:
|
|
1850
|
-
|
|
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) =>
|
|
1853
|
-
x:
|
|
1854
|
-
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:
|
|
1861
|
-
onClick: (e) =>
|
|
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:
|
|
1882
|
+
rows: ze.map((e) => ({
|
|
1883
1883
|
id: e.id,
|
|
1884
1884
|
values: [
|
|
1885
1885
|
e.label,
|
|
1886
|
-
|
|
1886
|
+
y({
|
|
1887
1887
|
value: e.items,
|
|
1888
1888
|
locale: D,
|
|
1889
1889
|
format: sn
|
|
1890
1890
|
}),
|
|
1891
|
-
|
|
1892
|
-
value:
|
|
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
|
-
|
|
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:
|
|
1915
|
+
rows: l.map((e) => ({
|
|
1916
1916
|
id: e.id,
|
|
1917
1917
|
values: [
|
|
1918
1918
|
e.label,
|
|
1919
|
-
|
|
1920
|
-
|
|
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 {
|
|
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 };
|