@genome-spy/app 0.88.1 → 0.89.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 (43) hide show
  1. package/dist/{agentApi-BIpg3JKh.js → agentApi-BUcXm-JC.js} +5544 -6449
  2. package/dist/agentApi.es.js +3328 -4255
  3. package/dist/agentShared.es.js +9 -9
  4. package/dist/{canvas2d-BVQ7-2eJ.js → canvas2d-CGuVGvQk.js} +117 -106
  5. package/dist/{canvas2d-D7SZK3xv.js → canvas2d-DgF0kstG.js} +99 -88
  6. package/dist/{canvasSizeHelper-7h_8rOcx.js → canvasSizeHelper-foL2YvGL.js} +15 -8
  7. package/dist/{clipOptions-DTMcB_9z.js → clipOptions-8BPf0WMZ.js} +1013 -755
  8. package/dist/{clipOptions-BWHr3aTa.js → clipOptions-DBJX_W31.js} +1033 -775
  9. package/dist/{debug-CVpoEOWx.js → debug-BEWbYuZD.js} +2 -2
  10. package/dist/{debug-DYAMZZKl.js → debug-DQj_7mFm.js} +2 -2
  11. package/dist/index.es.js +65 -65
  12. package/dist/index.js +406 -362
  13. package/dist/{indexer-DAH_ruVn.js → indexer-Cdt_U05k.js} +1 -1
  14. package/dist/{indexer-CXjZDo2Q.js → indexer-D8Bgkkb8.js} +1 -1
  15. package/dist/order-BPOzLe80.js +1056 -0
  16. package/dist/order-DIxlclRN.js +1056 -0
  17. package/dist/rasterExport-Bl6w9t3J.js +51 -0
  18. package/dist/rasterExport-DRvNAH-r.js +51 -0
  19. package/dist/rasterization-D0tOoKu_.js +62 -0
  20. package/dist/rectangle-DE98gIxF.js +108 -0
  21. package/dist/{renderCanvas2D-DxturTEW.js → renderCanvas2D-Ct95auF3.js} +60 -59
  22. package/dist/{renderCanvas2D-DtcJjqpB.js → renderCanvas2D-LdEYFnRo.js} +71 -70
  23. package/dist/schema.json +588 -116
  24. package/dist/{svg-CyrLfa9e.js → svg-Ag36-h_I.js} +394 -382
  25. package/dist/{svg-SDJMzL--.js → svg-pkTPD4bv.js} +368 -356
  26. package/dist/{svgRasterizer-f7DJ3UO0.js → svgRasterizer-CksK4QTB.js} +6 -5
  27. package/dist/{svgRasterizer-mWK7HTkx.js → svgRasterizer-DrtJ9nLk.js} +6 -5
  28. package/dist/{vega-scale-CypF85iS.js → vega-scale-BJaDSHBJ.js} +891 -959
  29. package/dist/{vega-scale-DLKCwWRs.js → vega-scale-BWBFykuI.js} +692 -760
  30. package/dist/{viewIdentityRegistry-DIDo44XQ.js → viewIdentityRegistry-B-snqI3y.js} +1 -1
  31. package/dist/{viewIdentityRegistry-Dl-vMN9I.js → viewIdentityRegistry-BvCJajXG.js} +1 -1
  32. package/dist/{viewSelectors-CymbZyE6.js → viewSelectors-BlvzvG-z.js} +445 -380
  33. package/dist/{viewSelectors-DNiDip5e.js → viewSelectors-C5q3qBiR.js} +364 -299
  34. package/dist/{viewUtils-BrJLIj2o.js → viewUtils-C3vBtSvE.js} +1714 -1689
  35. package/dist/{webgl-tZfZ8y3q.js → webgl-CZX2pe5v.js} +2319 -972
  36. package/dist/{webgl-CTJt7jQd.js → webgl-CexXSw_I.js} +2371 -1024
  37. package/package.json +5 -5
  38. package/dist/order-C5CzA37O.js +0 -918
  39. package/dist/order-DvY7KNcu.js +0 -918
  40. package/dist/rasterExport-BgZ98e6U.js +0 -44
  41. package/dist/rasterExport-DEr8fOLm.js +0 -44
  42. package/dist/rasterization-CFogVB3B.js +0 -50
  43. package/dist/rectangle-DKnrAmKs.js +0 -142
@@ -1,44 +0,0 @@
1
- import { t as e } from "./rasterization-CFogVB3B.js";
2
- import { t } from "./rectangle-DKnrAmKs.js";
3
- import { t as n } from "./layoutResult-D50MSHXR.js";
4
- import { t as r } from "./renderCanvas2D-DtcJjqpB.js";
5
- //#region ../core/src/rendering/canvas2d/rasterExport.js
6
- async function i(e) {
7
- let t = e.mimeType ?? "image/png";
8
- if (t != "image/png") throw Error(`Unsupported raster export MIME type: ${t}`);
9
- let n = o(e);
10
- return new Promise((e, r) => {
11
- n.toBlob((t) => {
12
- t ? e(t) : r(/* @__PURE__ */ Error("Canvas2D could not encode the raster export."));
13
- }, t);
14
- });
15
- }
16
- function a(e) {
17
- return o({
18
- ...e,
19
- pixelRatio: e.devicePixelRatio ?? e.pixelRatio
20
- }).toDataURL("image/png");
21
- }
22
- function o(i) {
23
- let a = i.logicalWidth ?? i.liveSize.width, o = i.logicalHeight ?? i.liveSize.height, s = i.pixelRatio ?? i.liveDevicePixelRatio, c, l;
24
- try {
25
- c = document.createElement("canvas"), c.width = Math.floor(a * s), c.height = Math.floor(o * s), l = c.getContext("2d");
26
- } catch (t) {
27
- throw new e("Unable to initialize a Canvas2D export context.", { cause: t });
28
- }
29
- if (!l) throw new e("Unable to initialize a Canvas2D export context.");
30
- return r({
31
- layoutResult: n(i.viewRoot, t.create(0, 0, a, o), {
32
- devicePixelRatio: s,
33
- renderingOptions: { firstFacet: !0 }
34
- }),
35
- context: l,
36
- width: a,
37
- height: o,
38
- devicePixelRatio: s,
39
- background: i.clearColor ?? null,
40
- paint: !0
41
- }), c;
42
- }
43
- //#endregion
44
- export { a as exportCanvas, i as exportRaster };
@@ -1,44 +0,0 @@
1
- import { t as e } from "./rasterization-CFogVB3B.js";
2
- import { t } from "./rectangle-DKnrAmKs.js";
3
- import { t as n } from "./layoutResult-D50MSHXR.js";
4
- import { t as r } from "./renderCanvas2D-DxturTEW.js";
5
- //#region ../core/src/rendering/canvas2d/rasterExport.js
6
- async function i(e) {
7
- let t = e.mimeType ?? "image/png";
8
- if (t != "image/png") throw Error(`Unsupported raster export MIME type: ${t}`);
9
- let n = o(e);
10
- return new Promise((e, r) => {
11
- n.toBlob((t) => {
12
- t ? e(t) : r(/* @__PURE__ */ Error("Canvas2D could not encode the raster export."));
13
- }, t);
14
- });
15
- }
16
- function a(e) {
17
- return o({
18
- ...e,
19
- pixelRatio: e.devicePixelRatio ?? e.pixelRatio
20
- }).toDataURL("image/png");
21
- }
22
- function o(i) {
23
- let a = i.logicalWidth ?? i.liveSize.width, o = i.logicalHeight ?? i.liveSize.height, s = i.pixelRatio ?? i.liveDevicePixelRatio, c, l;
24
- try {
25
- c = document.createElement("canvas"), c.width = Math.floor(a * s), c.height = Math.floor(o * s), l = c.getContext("2d");
26
- } catch (t) {
27
- throw new e("Unable to initialize a Canvas2D export context.", { cause: t });
28
- }
29
- if (!l) throw new e("Unable to initialize a Canvas2D export context.");
30
- return r({
31
- layoutResult: n(i.viewRoot, t.create(0, 0, a, o), {
32
- devicePixelRatio: s,
33
- renderingOptions: { firstFacet: !0 }
34
- }),
35
- context: l,
36
- width: a,
37
- height: o,
38
- devicePixelRatio: s,
39
- background: i.clearColor ?? null,
40
- paint: !0
41
- }), c;
42
- }
43
- //#endregion
44
- export { a as exportCanvas, i as exportRaster };
@@ -1,50 +0,0 @@
1
- //#region ../core/src/rendering/renderingModuleRegistry.js
2
- var e = {}, t = class extends Error {
3
- constructor(e, t) {
4
- super(e, t), this.name = "RasterizationUnavailableError";
5
- }
6
- };
7
- async function n(n, r) {
8
- if (n.exportRaster) try {
9
- return await n.exportRaster(r);
10
- } catch (e) {
11
- if (!(e instanceof t)) throw e;
12
- }
13
- if (!e.canvasRasterExport) throw i();
14
- let a;
15
- try {
16
- a = await e.canvasRasterExport();
17
- } catch (e) {
18
- throw i(e);
19
- }
20
- try {
21
- return await a.exportRaster({
22
- ...r,
23
- liveSize: n.surface.getLogicalCanvasSize(),
24
- liveDevicePixelRatio: n.surface.getDevicePixelRatio()
25
- });
26
- } catch (e) {
27
- throw e instanceof t ? i(e) : e;
28
- }
29
- }
30
- async function r(n, r) {
31
- if (n.rasterizeSvgRuns) try {
32
- await n.rasterizeSvgRuns(r);
33
- return;
34
- } catch (e) {
35
- if (!(e instanceof t)) throw e;
36
- }
37
- if (!e.canvasSvgRasterizer) throw new t("No raster backend supports selective SVG rasterization. Import \"@genome-spy/core/rendering/canvas.js\" to enable the Canvas2D fallback.");
38
- let i;
39
- try {
40
- i = await e.canvasSvgRasterizer();
41
- } catch (e) {
42
- throw new t("No raster backend supports selective SVG rasterization.", { cause: e });
43
- }
44
- await i.createCanvas2DSvgRasterizer()(r);
45
- }
46
- function i(e) {
47
- return new t("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 });
48
- }
49
- //#endregion
50
- export { e as i, n, r, t };
@@ -1,142 +0,0 @@
1
- function e(e) {
2
- let t = [];
3
- for (let e = 0; e <= 127; e++) t.push(void 0);
4
- let n = /* @__PURE__ */ new Map();
5
- for (let r of e.chars) r.id <= 127 ? t[r.id] = r : n.set(r.id, r);
6
- let r = 8722;
7
- n.has(r) || n.set(r, t[45]);
8
- function i(e) {
9
- return (e <= 127 ? t[e] : n.get(e)) || t[63];
10
- }
11
- function a(e) {
12
- return i(e.charCodeAt(0));
13
- }
14
- let o = e.common.base, s = a("x"), c = a("X"), l = a("q"), u = s.height - 10, d = c.height - 10, f = l.height - s.height + l.yoffset - s.yoffset;
15
- function p(e, t = 1) {
16
- let n = 0;
17
- for (let t = 0; t < e.length; t++) n += i(e.charCodeAt(t)).xadvance;
18
- return n / o * t;
19
- }
20
- let m = 0;
21
- for (let t of e.chars) t.id > m && (m = t.id);
22
- return {
23
- measureWidth: p,
24
- getCharByCode: i,
25
- getChar: a,
26
- chars: e.chars,
27
- maxCharId: m,
28
- xHeight: u,
29
- capHeight: d,
30
- descent: f,
31
- common: e.common
32
- };
33
- }
34
- //#endregion
35
- //#region ../core/src/view/layout/rectangle.js
36
- function t(e) {
37
- return () => e;
38
- }
39
- var n = class e {
40
- static create(n, r, i, a) {
41
- return new e(t(n), t(r), t(i), t(a));
42
- }
43
- static ZERO = e.create(0, 0, 0, 0);
44
- _offset(e, t) {
45
- let n = this["_" + e];
46
- if (t === 0) return n;
47
- switch (typeof t) {
48
- case "number": return () => n() + t;
49
- case "function": return () => n() + t();
50
- default: throw Error("Not a number of function");
51
- }
52
- }
53
- _passThrough(e) {
54
- return this._offset(e, 0);
55
- }
56
- constructor(e, t, n, r) {
57
- this._x = e, this._y = t, this._width = n, this._height = r;
58
- }
59
- get x() {
60
- return this._x();
61
- }
62
- get y() {
63
- return this._y();
64
- }
65
- get width() {
66
- return this._width();
67
- }
68
- get height() {
69
- return this._height();
70
- }
71
- get x2() {
72
- return this._x() + this._width();
73
- }
74
- get y2() {
75
- return this._y() + this._height();
76
- }
77
- equals(e) {
78
- return e ? this === e || this.x === e.x && this.y === e.y && this.width === e.width && this.height === e.height : !1;
79
- }
80
- modify(n) {
81
- if (!Object.keys(n).length) return this;
82
- let r = (e) => {
83
- let r = n[e];
84
- return typeof r == "number" ? t(r) : typeof r == "function" ? r : this._passThrough(e);
85
- };
86
- return new e(r("x"), r("y"), r("width"), r("height"));
87
- }
88
- translate(t, n) {
89
- return t === 0 && n === 0 ? this : new e(this._offset("x", t), this._offset("y", n), this._passThrough("width"), this._passThrough("height"));
90
- }
91
- translateBy(e) {
92
- return this.translate(e.x, e.y);
93
- }
94
- expand(t, n = 1) {
95
- 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"));
96
- }
97
- shrink(e) {
98
- return this.expand(e, -1);
99
- }
100
- intersect(t) {
101
- 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));
102
- }
103
- intersectX(t) {
104
- 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"));
105
- }
106
- intersectY(t) {
107
- 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));
108
- }
109
- union(t) {
110
- 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));
111
- }
112
- isDefined() {
113
- return this.width >= 0 && this.height >= 0;
114
- }
115
- flatten() {
116
- return new e(t(this.x), t(this.y), t(this.width), t(this.height));
117
- }
118
- containsPoint(e, t) {
119
- return e >= this.x && e < this.x2 && t >= this.y && t < this.y2;
120
- }
121
- normalizePoint(e, t, n = !1) {
122
- let r = {
123
- x: (e - this.x) / this.width,
124
- y: (t - this.y) / this.height
125
- };
126
- return n && (r.y = 1 - r.y), r;
127
- }
128
- denormalizePoint(e, t, n = !1) {
129
- return n && (t = 1 - t), {
130
- x: this.x + e * this.width,
131
- y: this.y + t * this.height
132
- };
133
- }
134
- toString() {
135
- return `Rectangle: x: ${this.x}, y: ${this.y}, width: ${this.width}, height: ${this.height}`;
136
- }
137
- toRoundedString() {
138
- return `Rectangle: x: ${Math.round(this.x)}, y: ${Math.round(this.y)}, width: ${Math.round(this.width)}, height: ${Math.round(this.height)}`;
139
- }
140
- };
141
- //#endregion
142
- export { e as n, n as t };