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