@genome-spy/app 0.79.1 → 0.81.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.
@@ -0,0 +1,345 @@
1
+ import { T as e, i as t, l as n, n as r, t as i } from "./viewIdentityRegistry-DLQWeb1Y.js";
2
+ //#region ../core/src/debug/valuePreview.js
3
+ var a = 3, o = 12, s = 8, c = 160;
4
+ function l(e, t = 0) {
5
+ if (typeof e != "object" || !e) return u(e);
6
+ if (t >= a) return Array.isArray(e) ? `[Array(${e.length})]` : `[Object(${Object.keys(e).length})]`;
7
+ if (Array.isArray(e)) {
8
+ let n = e.slice(0, s).map((e) => l(e, t + 1));
9
+ return e.length > s && n.push(`... ${e.length - s} more items`), n;
10
+ }
11
+ let n = {}, r = e, i = Object.keys(r);
12
+ for (let e of i.slice(0, o)) n[e] = l(r[e], t + 1);
13
+ return i.length > o && (n["..."] = `${i.length - o} more keys`), n;
14
+ }
15
+ function u(e) {
16
+ return typeof e == "string" && e.length > c ? e.slice(0, c) + "..." : e;
17
+ }
18
+ //#endregion
19
+ //#region ../core/src/debug/dataflowDebugSnapshot.js
20
+ function d(e, t) {
21
+ if (!e) return {
22
+ sourceIds: [],
23
+ nodes: [],
24
+ collectorCount: 0
25
+ };
26
+ let n = [], r = [], i = /* @__PURE__ */ new Set(), a = p(t.rootView);
27
+ for (let o of e.dataSources) {
28
+ let e = f(o, void 0, t, n, i, a);
29
+ r.push(e.id);
30
+ }
31
+ return {
32
+ sourceIds: r,
33
+ nodes: n,
34
+ collectorCount: e.collectors.length
35
+ };
36
+ }
37
+ function f(e, t, n, r, i, a) {
38
+ let o = n.getDebugId(e);
39
+ if (i.has(e)) {
40
+ let e = r.find((e) => e.id === o);
41
+ if (!e) throw Error("Seen flow node missing from debug snapshot.");
42
+ return e;
43
+ }
44
+ i.add(e);
45
+ let s = e.getDebugState(), c = s.view ?? a.get(e), u = {
46
+ id: o,
47
+ parentId: t,
48
+ childIds: [],
49
+ label: s.label,
50
+ count: s.stats.count,
51
+ first: l(s.stats.first),
52
+ completed: s.completed,
53
+ initialized: s.initialized,
54
+ disposed: s.disposed,
55
+ params: s.params ? l(s.params) : void 0,
56
+ viewId: c ? n.getDebugId(c) : void 0,
57
+ viewPath: c ? c.getPathString() : void 0,
58
+ domainSensitiveScaleChannels: s.domainSensitiveScaleChannels
59
+ };
60
+ r.push(u);
61
+ for (let e of s.children) {
62
+ let t = f(e, o, n, r, i, a);
63
+ u.childIds.push(t.id);
64
+ }
65
+ return u;
66
+ }
67
+ function p(e) {
68
+ let t = /* @__PURE__ */ new WeakMap();
69
+ return e && e.visit((e) => {
70
+ let n = e.flowHandle;
71
+ n?.dataSource && t.set(n.dataSource, e), n?.node && t.set(n.node, e), n?.collector && t.set(n.collector, e);
72
+ }), t;
73
+ }
74
+ //#endregion
75
+ //#region ../core/src/debug/markDebugSnapshot.js
76
+ function m(e, n) {
77
+ if (!e) return { marks: [] };
78
+ let r = [];
79
+ return h(e, (e) => {
80
+ let i = e.mark;
81
+ if (!i) return;
82
+ let a = i.getDebugState();
83
+ r.push({
84
+ viewId: n.getDebugId(e),
85
+ viewPath: e.getPathString(),
86
+ type: i.getType(),
87
+ ready: !!i.isReady(),
88
+ pickingParticipant: i.isPickingParticipant(),
89
+ markUniformsAltered: a.markUniformsAltered,
90
+ encodingChannels: Object.keys(i.encoding),
91
+ encoderChannels: i.encoders ? Object.keys(i.encoders) : [],
92
+ searchFields: t(e.getEncoding()) ?? [],
93
+ dataCount: g(e),
94
+ vertexCount: a.vertexCount,
95
+ allocatedVertices: a.allocatedVertices,
96
+ rangeCount: i.rangeMap.size,
97
+ properties: l(a.properties)
98
+ });
99
+ }), { marks: r };
100
+ }
101
+ function h(e, t) {
102
+ if (t(e), e instanceof r) for (let n of e) h(n, t);
103
+ }
104
+ function g(e) {
105
+ return (e.getCollector?.())?.getItemCount();
106
+ }
107
+ //#endregion
108
+ //#region ../core/src/debug/paramDebugSnapshot.js
109
+ function _(e, t) {
110
+ if (!e) return { scopes: [] };
111
+ let n = [];
112
+ return v(e, (e) => {
113
+ let r = e.paramRuntime.getDebugState();
114
+ n.push({
115
+ viewId: t.getDebugId(e),
116
+ viewPath: e.getPathString(),
117
+ scopeId: r.scopeId,
118
+ disposed: r.disposed,
119
+ params: r.params.map((e) => ({
120
+ name: e.name,
121
+ kind: e.kind,
122
+ value: l(e.value),
123
+ writable: e.writable,
124
+ configured: e.configured,
125
+ config: e.config ? l(e.config) : void 0
126
+ }))
127
+ });
128
+ }), { scopes: n };
129
+ }
130
+ function v(e, t) {
131
+ if (t(e), e instanceof r) for (let n of e) v(n, t);
132
+ }
133
+ //#endregion
134
+ //#region ../core/src/debug/resolutionDebugSnapshot.js
135
+ function y(e, t) {
136
+ if (!e) return {
137
+ scales: [],
138
+ axes: [],
139
+ legends: []
140
+ };
141
+ let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
142
+ return x(e, (e) => {
143
+ b(n, e.resolutions.scale), b(r, e.resolutions.axis), b(i, e.resolutions.legend);
144
+ }), {
145
+ scales: Array.from(n).map((e) => S(e, t)),
146
+ axes: Array.from(r).map((e) => C(e, t)),
147
+ legends: Array.from(i).map((e) => w(e, t))
148
+ };
149
+ }
150
+ function b(e, t) {
151
+ for (let n of Object.values(t)) n && e.add(n);
152
+ }
153
+ function x(e, t) {
154
+ if (t(e), e instanceof r) for (let n of e) x(n, t);
155
+ }
156
+ function S(e, t) {
157
+ let n = e.getDebugState();
158
+ return {
159
+ id: t.getDebugId(e),
160
+ ...E(n.hostView, t),
161
+ channel: n.channel,
162
+ name: n.name,
163
+ type: n.type,
164
+ resolvedScaleType: n.resolvedScaleType,
165
+ domain: n.domain,
166
+ complexDomain: n.complexDomain,
167
+ range: n.range,
168
+ zoomable: n.zoomable,
169
+ zoomed: n.zoomed,
170
+ activeMemberCount: n.activeMemberCount,
171
+ dataDomainMemberCount: n.dataDomainMemberCount,
172
+ members: n.members.map((e) => ({
173
+ viewId: t.getDebugId(e.view),
174
+ viewPath: e.view.getPathString(),
175
+ chrome: T(e.view),
176
+ channel: e.channel,
177
+ field: "field" in e.channelDef ? e.channelDef.field : void 0,
178
+ expr: "expr" in e.channelDef ? e.channelDef.expr : void 0,
179
+ type: "type" in e.channelDef ? e.channelDef.type : void 0,
180
+ contributesToDomain: e.contributesToDomain,
181
+ active: e.active
182
+ }))
183
+ };
184
+ }
185
+ function C(e, t) {
186
+ let n = e.getDebugState();
187
+ return {
188
+ id: t.getDebugId(e),
189
+ ...E(n.hostView, t),
190
+ channel: n.channel,
191
+ title: n.title,
192
+ scaleResolutionId: n.scaleResolution ? t.getDebugId(n.scaleResolution) : void 0,
193
+ hasVisibleNonChromeMember: n.hasVisibleNonChromeMember,
194
+ members: n.members.map((e) => ({
195
+ viewId: t.getDebugId(e.view),
196
+ viewPath: e.view.getPathString(),
197
+ chrome: T(e.view),
198
+ channel: e.channel,
199
+ field: "field" in e.channelDef ? e.channelDef.field : void 0,
200
+ expr: "expr" in e.channelDef ? e.channelDef.expr : void 0,
201
+ type: "type" in e.channelDef ? e.channelDef.type : void 0
202
+ }))
203
+ };
204
+ }
205
+ function w(e, t) {
206
+ let n = e.getDebugState();
207
+ return {
208
+ id: t.getDebugId(e),
209
+ ...E(n.hostView, t),
210
+ channel: n.channel,
211
+ hasVisibleNonChromeMember: n.hasVisibleNonChromeMember,
212
+ definitionCount: n.legendDefs.length,
213
+ members: n.members.map((e) => ({
214
+ viewId: t.getDebugId(e.view),
215
+ viewPath: e.view.getPathString(),
216
+ chrome: T(e.view),
217
+ channel: e.channel
218
+ }))
219
+ };
220
+ }
221
+ function T(t) {
222
+ return e(t) || t.getLayoutAncestors().some(e);
223
+ }
224
+ function E(e, t) {
225
+ return {
226
+ hostViewId: e ? t.getDebugId(e) : void 0,
227
+ hostViewPath: e?.getPathString()
228
+ };
229
+ }
230
+ //#endregion
231
+ //#region ../core/src/debug/viewDebugSnapshot.js
232
+ function D(t, n) {
233
+ if (!t) return {
234
+ rootId: void 0,
235
+ nodes: []
236
+ };
237
+ let i = n.includeChrome ?? !1, a = [], o = (t, s) => {
238
+ let c = e(t);
239
+ if (c && !i) return;
240
+ let l = n.getDebugId(t), u = O(t, l, s, c, n);
241
+ if (a.push(u), t instanceof r) for (let e of t) {
242
+ let t = o(e, l);
243
+ t && u.childIds.push(t.id);
244
+ }
245
+ return u;
246
+ };
247
+ return {
248
+ rootId: o(t, void 0)?.id,
249
+ nodes: a
250
+ };
251
+ }
252
+ function O(e, t, n, r, i) {
253
+ let a = [];
254
+ return {
255
+ id: t,
256
+ parentId: n,
257
+ childIds: [],
258
+ name: e.name,
259
+ explicitName: e.explicitName,
260
+ defaultName: e.defaultName,
261
+ path: k(a, "path", e.name, () => e.getPathString()),
262
+ className: e.constructor.name,
263
+ type: k(a, "type", "unknown", () => A(e)),
264
+ markType: k(a, "markType", void 0, () => j(e)),
265
+ chrome: r,
266
+ visible: k(a, "visible", !1, () => e.isVisible()),
267
+ configuredVisible: k(a, "configuredVisible", !1, () => e.isConfiguredVisible()),
268
+ visibleInSpec: k(a, "visibleInSpec", !1, () => e.isVisibleInSpec()),
269
+ dataInitializationState: k(a, "dataInitializationState", "none", () => e.getDataInitializationState()),
270
+ selector: k(a, "selector", void 0, () => M(e)),
271
+ bounds: k(a, "bounds", void 0, () => N(e)),
272
+ size: k(a, "size", void 0, () => P(e.getSize())),
273
+ viewportSize: k(a, "viewportSize", void 0, () => P(e.getViewportSize())),
274
+ scaleResolutionIds: k(a, "scaleResolutionIds", {}, () => F(e.resolutions.scale, i)),
275
+ axisResolutionIds: k(a, "axisResolutionIds", {}, () => F(e.resolutions.axis, i)),
276
+ legendResolutionIds: k(a, "legendResolutionIds", {}, () => F(e.resolutions.legend, i)),
277
+ encodings: k(a, "encodings", {}, () => I(e, i)),
278
+ paramNames: k(a, "paramNames", [], () => Array.from(e.paramRuntime.paramConfigs.keys())),
279
+ spec: k(a, "spec", {}, () => structuredClone(e.spec)),
280
+ debugErrors: a
281
+ };
282
+ }
283
+ function k(e, t, n, r) {
284
+ try {
285
+ return r();
286
+ } catch (r) {
287
+ return console.warn(`Failed to collect view debug field "${t}".`, r), e.push({
288
+ field: t,
289
+ message: r instanceof Error ? r.message : String(r)
290
+ }), n;
291
+ }
292
+ }
293
+ function A(e) {
294
+ if (typeof e.getMarkType == "function") return "unit";
295
+ let t = e.constructor.name;
296
+ return t.endsWith("View") ? t.slice(0, -4).toLowerCase() : t.toLowerCase();
297
+ }
298
+ function j(e) {
299
+ let t = e;
300
+ if (typeof t.getMarkType == "function") return t.getMarkType();
301
+ }
302
+ function M(e) {
303
+ if (e.explicitName) return n(e);
304
+ }
305
+ function N(e) {
306
+ let t = e.coords;
307
+ if (t) return {
308
+ x: t.x,
309
+ y: t.y,
310
+ width: t.width,
311
+ height: t.height
312
+ };
313
+ }
314
+ function P(e) {
315
+ return {
316
+ width: e.width,
317
+ height: e.height
318
+ };
319
+ }
320
+ function F(e, t) {
321
+ let n = {};
322
+ for (let [r, i] of Object.entries(e)) i && (n[r] = t.getDebugId(i));
323
+ return n;
324
+ }
325
+ function I(e, t) {
326
+ let n = e.mark?.encoding ?? e.getEncoding(), r = {};
327
+ for (let [i, a] of Object.entries(n)) a && (r[i] = {
328
+ channel: i,
329
+ field: "field" in a ? a.field : void 0,
330
+ expr: "expr" in a ? a.expr : void 0,
331
+ value: "value" in a ? a.value : void 0,
332
+ type: "type" in a ? a.type : void 0,
333
+ scaleResolutionId: L(e.resolutions.scale, i, t),
334
+ axisResolutionId: L(e.resolutions.axis, i, t),
335
+ legendResolutionId: L(e.resolutions.legend, i, t),
336
+ channelDef: structuredClone(a)
337
+ });
338
+ return r;
339
+ }
340
+ function L(e, t, n) {
341
+ let r = e[t];
342
+ return r ? n.getDebugId(r) : void 0;
343
+ }
344
+ //#endregion
345
+ export { d as createDataflowDebugSnapshot, m as createMarkDebugSnapshot, _ as createParamDebugSnapshot, y as createResolutionDebugSnapshot, D as createViewDebugSnapshot, i as getViewIdentityRegistry };