@genome-spy/app 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{agentApi-sPuuT0KS.js → agentApi-8hMSlqAQ.js} +8307 -6861
  2. package/dist/agentApi.es.js +5569 -4250
  3. package/dist/agentShared.es.js +9 -9
  4. package/dist/{canvas2d-iDK4BC5j.js → canvas2d-Bd8H8MMo.js} +149 -134
  5. package/dist/{canvas2d-MXaFeZnP.js → canvas2d-D6VYooRf.js} +136 -122
  6. package/dist/{clipOptions-Cba4I0AO.js → clipOptions-DElJ8dTZ.js} +2274 -2080
  7. package/dist/{clipOptions-B5PibDq3.js → clipOptions-D_wBNhzs.js} +2121 -1957
  8. package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CRJSc4bM.js} +24 -31
  9. package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-aEVmYmkA.js} +24 -31
  10. package/dist/{debug-DbigmdrK.js → debug-CQ0agCrd.js} +9 -9
  11. package/dist/{debug-BlqDxTw3.js → debug-DkIMiGdW.js} +10 -10
  12. package/dist/index.es.js +3582 -3566
  13. package/dist/index.js +698 -454
  14. package/dist/{indexer-En7gpvLN.js → indexer-DDC0YRGn.js} +1 -1
  15. package/dist/{indexer-DbFTKGlm.js → indexer-DOYMJ-Md.js} +1 -1
  16. package/dist/markUtils-CvLDz744.js +75 -0
  17. package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
  18. package/dist/{order-B4uR9Q04.js → order-BVvkjDRT.js} +369 -316
  19. package/dist/{order-BSPy5DI8.js → order-DmMoZsi1.js} +360 -308
  20. package/dist/{rasterExport-DQH3hVg_.js → rasterExport-DxvowWjH.js} +3 -3
  21. package/dist/{rasterExport-B62RmAK1.js → rasterExport-jeRVq6kY.js} +4 -4
  22. package/dist/{rasterization-B05bDo5e.js → rasterization-DFj3Cvx4.js} +26 -19
  23. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  24. package/dist/rectangle-Dl4Dy0hS.js +191 -0
  25. package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Bfm1NHFu.js} +96 -91
  26. package/dist/{renderCanvas2D-ChdoHGrU.js → renderCanvas2D-DVjhp834.js} +98 -93
  27. package/dist/{scalePosition-ByvlXaML.js → scalePosition-0aeqp_kz.js} +8 -1
  28. package/dist/schema.json +27198 -13709
  29. package/dist/style.css +1 -1
  30. package/dist/{svg-N3tj05-e.js → svg-Bm2zxBPu.js} +315 -316
  31. package/dist/{svg-DHsq1RpV.js → svg-CkfuhONt.js} +290 -291
  32. package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-DoRQEqFA.js} +2 -2
  33. package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-raDDhBF-.js} +3 -3
  34. package/dist/{vega-scale-Byaw1K8O.js → vega-scale-BoGHANI7.js} +90 -90
  35. package/dist/{vega-scale-Ctz_wa3z.js → vega-scale-o9TRyzYH.js} +699 -699
  36. package/dist/viewError-BkJeVYXA.js +33 -0
  37. package/dist/viewError-IYqyluc7.js +33 -0
  38. package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-7LyasQN-.js} +498 -434
  39. package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-CbmkSQRT.js} +549 -485
  40. package/dist/{viewUtils-JX6CMEYH.js → viewUtils-DuddMNNw.js} +2138 -2009
  41. package/dist/{webgl-Dw8xqZpX.js → webgl-CQfvgnxo.js} +1229 -1140
  42. package/dist/{webgl-DdmOwEH0.js → webgl-DVYkXtiZ.js} +1477 -1389
  43. package/package.json +4 -4
  44. package/src/spec/view.d.ts +44 -5
  45. package/dist/viewError-BiR9VCgL.js +0 -29
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./rasterization-CFogVB3B.js";
2
- import { t } from "./rectangle-DE98gIxF.js";
2
+ import { t } from "./rectangle-DZTR6NFQ.js";
3
3
  import { t as n } from "./layoutResult-D50MSHXR.js";
4
- import { r } from "./order-B4uR9Q04.js";
5
- import { t as i } from "./renderCanvas2D-Bdv-B4wj.js";
4
+ import { r } from "./order-BVvkjDRT.js";
5
+ import { t as i } from "./renderCanvas2D-DVjhp834.js";
6
6
  //#region ../core/src/rendering/canvas2d/rasterExport.js
7
7
  async function a(e) {
8
8
  let t = e.mimeType ?? "image/png";
@@ -1,8 +1,8 @@
1
- import { t as e } from "./rasterization-B05bDo5e.js";
2
- import { t } from "./rectangle-DE98gIxF.js";
1
+ import { t as e } from "./rasterization-DFj3Cvx4.js";
2
+ import { t } from "./rectangle-Dl4Dy0hS.js";
3
3
  import { t as n } from "./layoutResult-D50MSHXR.js";
4
- import { r } from "./order-BSPy5DI8.js";
5
- import { t as i } from "./renderCanvas2D-ChdoHGrU.js";
4
+ import { r } from "./order-DmMoZsi1.js";
5
+ import { t as i } from "./renderCanvas2D-Bfm1NHFu.js";
6
6
  //#region ../core/src/rendering/canvas2d/rasterExport.js
7
7
  async function a(e) {
8
8
  let t = e.mimeType ?? "image/png";
@@ -7,54 +7,61 @@ function e(e, t = .5) {
7
7
  }
8
8
  return 0;
9
9
  }
10
+ function t(e, t, n) {
11
+ if ("gapMapping" in e) {
12
+ let r = e;
13
+ return r.gapMapping(n)?.invertPoint(t).value ?? r.invert(t);
14
+ }
15
+ return e.invert(t);
16
+ }
10
17
  //#endregion
11
18
  //#region ../core/src/rendering/renderingModuleRegistry.js
12
- var t = {}, n = class extends Error {
19
+ var n = {}, r = class extends Error {
13
20
  constructor(e, t) {
14
21
  super(e, t), this.name = "RasterizationUnavailableError";
15
22
  }
16
23
  };
17
- async function r(e, r) {
24
+ async function i(e, t) {
18
25
  if (e.exportRaster) try {
19
- return await e.exportRaster(r);
26
+ return await e.exportRaster(t);
20
27
  } catch (e) {
21
- if (!(e instanceof n)) throw e;
28
+ if (!(e instanceof r)) throw e;
22
29
  }
23
- if (!t.canvasRasterExport) throw a();
30
+ if (!n.canvasRasterExport) throw o();
24
31
  let i;
25
32
  try {
26
- i = await t.canvasRasterExport();
33
+ i = await n.canvasRasterExport();
27
34
  } catch (e) {
28
- throw a(e);
35
+ throw o(e);
29
36
  }
30
37
  try {
31
38
  return await i.exportRaster({
32
- ...r,
39
+ ...t,
33
40
  liveSize: e.surface.getLogicalCanvasSize(),
34
41
  liveDevicePixelRatio: e.surface.getDevicePixelRatio()
35
42
  });
36
43
  } catch (e) {
37
- throw e instanceof n ? a(e) : e;
44
+ throw e instanceof r ? o(e) : e;
38
45
  }
39
46
  }
40
- async function i(e, r) {
47
+ async function a(e, t) {
41
48
  if (e.rasterizeSvgRuns) try {
42
- await e.rasterizeSvgRuns(r);
49
+ await e.rasterizeSvgRuns(t);
43
50
  return;
44
51
  } catch (e) {
45
- if (!(e instanceof n)) throw e;
52
+ if (!(e instanceof r)) throw e;
46
53
  }
47
- if (!t.canvasSvgRasterizer) throw new n("No raster backend supports selective SVG rasterization. Import \"@genome-spy/core/rendering/canvas.js\" to enable the Canvas2D fallback.");
54
+ if (!n.canvasSvgRasterizer) throw new r("No raster backend supports selective SVG rasterization. Import \"@genome-spy/core/rendering/canvas.js\" to enable the Canvas2D fallback.");
48
55
  let i;
49
56
  try {
50
- i = await t.canvasSvgRasterizer();
57
+ i = await n.canvasSvgRasterizer();
51
58
  } catch (e) {
52
- throw new n("No raster backend supports selective SVG rasterization.", { cause: e });
59
+ throw new r("No raster backend supports selective SVG rasterization.", { cause: e });
53
60
  }
54
- await i.createCanvas2DSvgRasterizer()(r);
61
+ await i.createCanvas2DSvgRasterizer()(t);
55
62
  }
56
- function a(e) {
57
- return new n("Raster export is unsupported because no raster rendering backend is available. Import \"@genome-spy/core/rendering/canvas.js\" to enable the Canvas2D fallback.", { cause: e });
63
+ function o(e) {
64
+ return new r("Raster export is unsupported because no raster rendering backend is available. Import \"@genome-spy/core/rendering/canvas.js\" to enable the Canvas2D fallback.", { cause: e });
58
65
  }
59
66
  //#endregion
60
- export { e as a, t as i, r as n, i as r, n as t };
67
+ export { e as a, n as i, i as n, t as o, a as r, r as t };
@@ -6,6 +6,15 @@ var t = class t {
6
6
  static create(n, r, i, a) {
7
7
  return new t(e(n), e(r), e(i), e(a));
8
8
  }
9
+ static unionAll(e) {
10
+ if (!e.length) return;
11
+ let { x: n, y: r, x2: i, y2: a } = e[0];
12
+ for (let t = 1; t < e.length; t++) {
13
+ let o = e[t];
14
+ n = Math.min(n, o.x), r = Math.min(r, o.y), i = Math.max(i, o.x2), a = Math.max(a, o.y2);
15
+ }
16
+ return t.create(n, r, i - n, a - r);
17
+ }
9
18
  static ZERO = t.create(0, 0, 0, 0);
10
19
  _offset(e, t) {
11
20
  let n = this["_" + e];
@@ -55,7 +64,7 @@ var t = class t {
55
64
  return e === 0 && n === 0 ? this : new t(this._offset("x", e), this._offset("y", n), this._passThrough("width"), this._passThrough("height"));
56
65
  }
57
66
  translateBy(e) {
58
- return this.translate(e.x, e.y);
67
+ return this.translate(() => e.x, () => e.y);
59
68
  }
60
69
  expand(e, n = 1) {
61
70
  return e.left == 0 && e.top == 0 && e.right == 0 && e.bottom == 0 ? this : new t(e.left ? this._offset("x", -e.left * n) : this._passThrough("x"), e.top ? this._offset("y", -e.top * n) : this._passThrough("y"), e.width ? this._offset("width", e.width * n) : this._passThrough("width"), e.height ? this._offset("height", e.height * n) : this._passThrough("height"));
@@ -0,0 +1,191 @@
1
+ import { Tt as e, c as t, dt as n, ft as r, it as i, u as a } from "./clipOptions-DElJ8dTZ.js";
2
+ //#region ../core/src/marks/markUtils.js
3
+ var o = Symbol("half-open interval peer");
4
+ function s(e) {
5
+ return e?.[o];
6
+ }
7
+ function c(e, t) {
8
+ let r = n(t), s = i(e[t]), c = i(e[r]);
9
+ s && c && ["index", "locus"].includes(s.type) && (e[t] = a(e[t], {
10
+ ...e[t],
11
+ [o]: r
12
+ }), e[r] = a(e[r], {
13
+ ...e[r],
14
+ [o]: t
15
+ }));
16
+ }
17
+ function l(t) {
18
+ for (let r of ["x", "y"]) {
19
+ let a = n(r), o = t[r], s = t[a];
20
+ if (o && s && e(o) && !i(o) && i(s)) throw Error(`Cannot combine encoding.${r}.value with scale-backed encoding.${a}. Use encoding.${r}.datum for a constant data-domain endpoint, or use encoding.${a}.value for a visual-domain endpoint.`);
21
+ }
22
+ }
23
+ function u(t, i, o = !1) {
24
+ let s = n(i);
25
+ c(t, i);
26
+ let l = t[i] && a(t[i], { ...t[i] }), u = t[s] && a(t[s], { ...t[s] });
27
+ if (!(e(l) || e(u))) {
28
+ if (l) {
29
+ if (!r(t[i])) return;
30
+ if (!u) {
31
+ if (l.type == "quantitative") u = {
32
+ datum: 0,
33
+ domainInert: !0
34
+ };
35
+ else {
36
+ u = a(l, { ...l });
37
+ let e = (1 - (l.band ?? 1)) / 2;
38
+ l.band = 0 + e, u.band = o ? l.band : 1 - e;
39
+ }
40
+ } else if (l.type != "quantitative") {
41
+ let e = (1 - (l.band || 1)) / 2;
42
+ l.band = e, u.band = -e;
43
+ }
44
+ } else l = { value: 0 }, u = { value: 1 };
45
+ t[i] = l, t[s] = u;
46
+ }
47
+ }
48
+ function d(t, i) {
49
+ c(t, i);
50
+ let o = n(i), s = t[i], l = t[o];
51
+ if (!s || !l || e(s) || e(l) || !r(s) || !r(l) || !["index", "locus"].includes(s.type)) return;
52
+ let u = s.band, d = l.band, f = u ?? d ?? 0;
53
+ t[i] = a(s, {
54
+ ...s,
55
+ band: f
56
+ }), t[o] = a(l, {
57
+ ...l,
58
+ band: d ?? f
59
+ });
60
+ }
61
+ function f(e, t) {
62
+ let n = i(e);
63
+ n && (n.resolutionChannel = t);
64
+ }
65
+ function p(n, r) {
66
+ n.stroke || (r ? n.stroke = { value: null } : (n.stroke = t(n.color), f(n.stroke, "color"))), e(n.stroke) && n.stroke.value === null && (n.strokeWidth = { value: 0 }), n.strokeOpacity || (n.strokeOpacity = t(n.opacity), f(n.strokeOpacity, "opacity"));
67
+ }
68
+ function m(n, r) {
69
+ e(n.fill) && n.fill.value === null ? n.fillOpacity = { value: 0 } : n.fill || (n.fill = t(n.color), f(n.fill, "color"), !r && !n.fillOpacity && (n.fillOpacity = { value: 0 })), n.fillOpacity || (r ? (n.fillOpacity = t(n.opacity), f(n.fillOpacity, "opacity")) : n.fillOpacity = { value: 0 });
70
+ }
71
+ function h(e, t) {
72
+ return e.properties.clamp === !0 || e.properties.clamp === t;
73
+ }
74
+ //#endregion
75
+ //#region ../core/src/view/layout/rectangle.js
76
+ function g(e) {
77
+ return () => e;
78
+ }
79
+ var _ = class e {
80
+ static create(t, n, r, i) {
81
+ return new e(g(t), g(n), g(r), g(i));
82
+ }
83
+ static unionAll(t) {
84
+ if (!t.length) return;
85
+ let { x: n, y: r, x2: i, y2: a } = t[0];
86
+ for (let e = 1; e < t.length; e++) {
87
+ let o = t[e];
88
+ n = Math.min(n, o.x), r = Math.min(r, o.y), i = Math.max(i, o.x2), a = Math.max(a, o.y2);
89
+ }
90
+ return e.create(n, r, i - n, a - r);
91
+ }
92
+ static ZERO = e.create(0, 0, 0, 0);
93
+ _offset(e, t) {
94
+ let n = this["_" + e];
95
+ if (t === 0) return n;
96
+ switch (typeof t) {
97
+ case "number": return () => n() + t;
98
+ case "function": return () => n() + t();
99
+ default: throw Error("Not a number of function");
100
+ }
101
+ }
102
+ _passThrough(e) {
103
+ return this._offset(e, 0);
104
+ }
105
+ constructor(e, t, n, r) {
106
+ this._x = e, this._y = t, this._width = n, this._height = r;
107
+ }
108
+ get x() {
109
+ return this._x();
110
+ }
111
+ get y() {
112
+ return this._y();
113
+ }
114
+ get width() {
115
+ return this._width();
116
+ }
117
+ get height() {
118
+ return this._height();
119
+ }
120
+ get x2() {
121
+ return this._x() + this._width();
122
+ }
123
+ get y2() {
124
+ return this._y() + this._height();
125
+ }
126
+ equals(e) {
127
+ return e ? this === e || this.x === e.x && this.y === e.y && this.width === e.width && this.height === e.height : !1;
128
+ }
129
+ modify(t) {
130
+ if (!Object.keys(t).length) return this;
131
+ let n = (e) => {
132
+ let n = t[e];
133
+ return typeof n == "number" ? g(n) : typeof n == "function" ? n : this._passThrough(e);
134
+ };
135
+ return new e(n("x"), n("y"), n("width"), n("height"));
136
+ }
137
+ translate(t, n) {
138
+ return t === 0 && n === 0 ? this : new e(this._offset("x", t), this._offset("y", n), this._passThrough("width"), this._passThrough("height"));
139
+ }
140
+ translateBy(e) {
141
+ return this.translate(() => e.x, () => e.y);
142
+ }
143
+ expand(t, n = 1) {
144
+ return t.left == 0 && t.top == 0 && t.right == 0 && t.bottom == 0 ? this : new e(t.left ? this._offset("x", -t.left * n) : this._passThrough("x"), t.top ? this._offset("y", -t.top * n) : this._passThrough("y"), t.width ? this._offset("width", t.width * n) : this._passThrough("width"), t.height ? this._offset("height", t.height * n) : this._passThrough("height"));
145
+ }
146
+ shrink(e) {
147
+ return this.expand(e, -1);
148
+ }
149
+ intersect(t) {
150
+ return this === t || t == null ? this : new e(() => Math.max(this.x, t.x), () => Math.max(this.y, t.y), () => Math.min(this.x2, t.x2) - Math.max(this.x, t.x), () => Math.min(this.y2, t.y2) - Math.max(this.y, t.y));
151
+ }
152
+ intersectX(t) {
153
+ return this === t || t == null ? this : new e(() => Math.max(this.x, t.x), this._passThrough("y"), () => Math.min(this.x2, t.x2) - Math.max(this.x, t.x), this._passThrough("height"));
154
+ }
155
+ intersectY(t) {
156
+ return this === t || t == null ? this : new e(this._passThrough("x"), () => Math.max(this.y, t.y), this._passThrough("width"), () => Math.min(this.y2, t.y2) - Math.max(this.y, t.y));
157
+ }
158
+ union(t) {
159
+ return this === t || t == null ? this : new e(() => Math.min(this.x, t.x), () => Math.min(this.y, t.y), () => Math.max(this.x2, t.x2) - Math.min(this.x, t.x), () => Math.max(this.y2, t.y2) - Math.min(this.y, t.y));
160
+ }
161
+ isDefined() {
162
+ return this.width >= 0 && this.height >= 0;
163
+ }
164
+ flatten() {
165
+ return new e(g(this.x), g(this.y), g(this.width), g(this.height));
166
+ }
167
+ containsPoint(e, t) {
168
+ return e >= this.x && e < this.x2 && t >= this.y && t < this.y2;
169
+ }
170
+ normalizePoint(e, t, n = !1) {
171
+ let r = {
172
+ x: (e - this.x) / this.width,
173
+ y: (t - this.y) / this.height
174
+ };
175
+ return n && (r.y = 1 - r.y), r;
176
+ }
177
+ denormalizePoint(e, t, n = !1) {
178
+ return n && (t = 1 - t), {
179
+ x: this.x + e * this.width,
180
+ y: this.y + t * this.height
181
+ };
182
+ }
183
+ toString() {
184
+ return `Rectangle: x: ${this.x}, y: ${this.y}, width: ${this.width}, height: ${this.height}`;
185
+ }
186
+ toRoundedString() {
187
+ return `Rectangle: x: ${Math.round(this.x)}, y: ${Math.round(this.y)}, width: ${Math.round(this.width)}, height: ${Math.round(this.height)}`;
188
+ }
189
+ };
190
+ //#endregion
191
+ export { m as a, s as c, u as i, h as l, o as n, d as o, c as r, p as s, _ as t, l as u };