@genome-spy/app 0.83.1 → 0.85.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-AxdD95yY.js → agentApi-Cz0hCnVp.js} +6576 -7722
  2. package/dist/agentApi.es.js +3747 -3317
  3. package/dist/agentShared.es.js +18 -18
  4. package/dist/arrayUtils-LJpQOu-U.js +2175 -0
  5. package/dist/bmFontMetrics-CuNB-kNN.js +31 -0
  6. package/dist/canvas2d-DoAXEiF9.js +309 -0
  7. package/dist/canvas2d-f5jl4A5D.js +310 -0
  8. package/dist/canvasSizeHelper-7h_8rOcx.js +56 -0
  9. package/dist/clipOptions-gqdb3fvW.js +43 -0
  10. package/dist/color-W5zffv-z.js +335 -0
  11. package/dist/{componentStyles-BzJWWojD.js → componentStyles-FsNmIb22.js} +5 -1
  12. package/dist/{debug-CI7POTMx.js → debug-BvCZWumf.js} +10 -10
  13. package/dist/{debug-DJKug_38.js → debug-CgDtmspT.js} +7 -5
  14. package/dist/dialog.es.js +1 -1
  15. package/dist/{esm-CGLz7idZ.js → esm-BA6yMcc-.js} +438 -434
  16. package/dist/{esm-D8vvQAP3.js → esm-CcDLRSvC.js} +33 -33
  17. package/dist/{esm-BeV56E_5.js → esm-CfYZhLHN.js} +33 -33
  18. package/dist/{esm-DQ3lJSQN.js → esm-JAiZmFIS.js} +1 -1
  19. package/dist/framebufferReadback-CCLOjStu.js +148 -0
  20. package/dist/framebufferReadback-THWwFqs8.js +1994 -0
  21. package/dist/index.es.js +3735 -3369
  22. package/dist/index.js +743 -616
  23. package/dist/metadataChannels-DV62inJh.js +19 -0
  24. package/dist/nativeText-DMO8gLt7.js +806 -0
  25. package/dist/nativeText-m5AUINMq.js +806 -0
  26. package/dist/paramUtils-BYI4rwyL.js +2195 -0
  27. package/dist/schema.json +2253 -4201
  28. package/dist/style.css +1 -1
  29. package/dist/svg-CCu8kYy2.js +1158 -0
  30. package/dist/svg-yFj875aX.js +1158 -0
  31. package/dist/svgNumber-DNxESJQB.js +11 -0
  32. package/dist/twgl-full.module-DB2UdP1k.js +1849 -0
  33. package/dist/viewIdentityRegistry-BUdkK9zT.js +92 -0
  34. package/dist/{viewIdentityRegistry-CcQdL0Z8.js → viewIdentityRegistry-D3oPbN4O.js} +1 -1
  35. package/dist/viewRenderingContext-HtpqwS_x.js +120 -0
  36. package/dist/viewSelectors-DGCspRN3.js +4198 -0
  37. package/dist/viewSelectors-U5oLCLHV.js +4195 -0
  38. package/dist/{viewUtils-Cybv1tu-.js → viewUtils-Dg4RA40Q.js} +2405 -3983
  39. package/dist/warning-CpIIpk8e.js +7 -0
  40. package/dist/warning-DRGdb6BF.js +59 -0
  41. package/dist/webgl-Ci6ZhCCf.js +54 -0
  42. package/dist/webgl-Dpz8a3TI.js +53 -0
  43. package/package.json +5 -5
  44. package/dist/metadataChannels-fGQOmJj0.js +0 -6732
  45. package/dist/viewIdentityRegistry-EH5-Noyz.js +0 -6827
@@ -0,0 +1,7 @@
1
+ //#region ../core/src/utils/warning.js
2
+ var e = /* @__PURE__ */ new Set();
3
+ function t(t) {
4
+ e.has(t) || (e.add(t), console.warn(t));
5
+ }
6
+ //#endregion
7
+ export { t };
@@ -0,0 +1,59 @@
1
+ //#region ../core/src/rendering/canvasSizeHelper.js
2
+ var e = class {
3
+ constructor(e, t, n, r) {
4
+ this._container = e, this._canvas = t, this._sizeSource = n, this._onPhysicalSizeChange = r ?? (() => {}), this._logicalCanvasSize = void 0, this._devicePixelContentBoxSize = void 0, this._devicePixelContentBoxObserver = void 0, this._observeDevicePixelContentBox();
5
+ }
6
+ invalidate() {
7
+ this._logicalCanvasSize = void 0, this._devicePixelContentBoxSize = void 0;
8
+ }
9
+ finalize() {
10
+ this._devicePixelContentBoxObserver && this._devicePixelContentBoxObserver.disconnect();
11
+ }
12
+ getPhysicalCanvasSize(e) {
13
+ if (this._devicePixelContentBoxSize) return this._devicePixelContentBoxSize;
14
+ let t = window.devicePixelRatio ?? 1;
15
+ return e ||= this.getLogicalCanvasSize(), {
16
+ width: Math.round(e.width * t),
17
+ height: Math.round(e.height * t)
18
+ };
19
+ }
20
+ getDevicePixelRatio(e) {
21
+ e ||= this.getLogicalCanvasSize();
22
+ let t = this.getPhysicalCanvasSize(e), n = e.width > 0 ? t.width / e.width : void 0, r = e.height > 0 ? t.height / e.height : void 0;
23
+ return n !== void 0 && r !== void 0 ? (n + r) / 2 : n === void 0 ? r === void 0 ? window.devicePixelRatio ?? 1 : r : n;
24
+ }
25
+ getLogicalCanvasSize() {
26
+ if (this._logicalCanvasSize) return this._logicalCanvasSize;
27
+ let e = this._sizeSource(), t = window.getComputedStyle(this._container, null), n = this._container.getBoundingClientRect(), r = parseFloat(t.paddingLeft), i = parseFloat(t.paddingRight), a = parseFloat(t.paddingTop), o = parseFloat(t.paddingBottom), s = parseFloat(t.borderLeftWidth), c = parseFloat(t.borderRightWidth), l = parseFloat(t.borderTopWidth), u = parseFloat(t.borderBottomWidth), d = e.width ?? n.width - r - i - s - c, f = e.height ?? n.height - a - o - l - u;
28
+ return this._logicalCanvasSize = {
29
+ width: d,
30
+ height: f
31
+ }, this._logicalCanvasSize;
32
+ }
33
+ _observeDevicePixelContentBox() {
34
+ if (typeof ResizeObserver != "function") return;
35
+ let e = new ResizeObserver((e) => {
36
+ let t = e.find((e) => e.target == this._canvas);
37
+ if (!t) return;
38
+ let n = t.devicePixelContentBoxSize;
39
+ if (!n) return;
40
+ let r = Array.isArray(n) ? n[0] : n;
41
+ if (!r) return;
42
+ let i = {
43
+ width: r.inlineSize,
44
+ height: r.blockSize
45
+ };
46
+ this._devicePixelContentBoxSize && this._devicePixelContentBoxSize.width == i.width && this._devicePixelContentBoxSize.height == i.height || (this._devicePixelContentBoxSize = i, this._onPhysicalSizeChange());
47
+ });
48
+ try {
49
+ e.observe(this._canvas, { box: "device-pixel-content-box" }), this._devicePixelContentBoxObserver = e;
50
+ } catch {
51
+ e.disconnect();
52
+ }
53
+ }
54
+ }, t = /* @__PURE__ */ new Set();
55
+ function n(e) {
56
+ t.has(e) || (t.add(e), console.warn(e));
57
+ }
58
+ //#endregion
59
+ export { e as n, n as t };
@@ -0,0 +1,54 @@
1
+ import { i as e } from "./twgl-full.module-DB2UdP1k.js";
2
+ import { n as t } from "./viewRenderingContext-HtpqwS_x.js";
3
+ import { n, r } from "./framebufferReadback-CCLOjStu.js";
4
+ import { t as i } from "./svgNumber-DNxESJQB.js";
5
+ //#region ../core/src/rendering/svg/raster/webgl.js
6
+ function a({ runs: a, viewRoot: c, webGLHelper: l, logicalWidth: u, logicalHeight: d, pixelRatio: f }) {
7
+ let p = l.gl, m = Math.ceil(u * f), h = Math.ceil(d * f);
8
+ o(p, m, h);
9
+ let g = e(p, [{
10
+ format: p.RGBA,
11
+ type: p.UNSIGNED_BYTE,
12
+ minMag: p.LINEAR,
13
+ wrap: p.CLAMP_TO_EDGE
14
+ }], m, h);
15
+ try {
16
+ for (let e of a) {
17
+ let a = new r({ picking: !1 }, {
18
+ webGLHelper: l,
19
+ canvasSize: {
20
+ width: u,
21
+ height: d
22
+ },
23
+ devicePixelRatio: f,
24
+ framebufferInfo: g,
25
+ markPredicate: (t) => e.marks.has(t),
26
+ pixelOffset: 0
27
+ });
28
+ c.render(a, t.create(0, 0, u, d), { firstFacet: !0 }), a.render();
29
+ let o = s(e.bounds, f, m, h), _ = n(p, g, "image/png", {
30
+ ...o,
31
+ unpremultiplyAlpha: !0
32
+ }), v = e.image;
33
+ if (!v) throw Error("Raster run has no SVG image placeholder.");
34
+ v.setAttribute("x", "" + i(o.x / f)), v.setAttribute("y", "" + i(o.y / f)), v.setAttribute("width", "" + i(o.width / f)), v.setAttribute("height", "" + i(o.height / f)), v.setAttribute("href", _);
35
+ }
36
+ } finally {
37
+ p.bindFramebuffer(p.FRAMEBUFFER, null), p.deleteTexture(g.attachments[0]), p.deleteFramebuffer(g.framebuffer);
38
+ }
39
+ }
40
+ function o(e, t, n) {
41
+ let r = e.getParameter(e.MAX_RENDERBUFFER_SIZE), i = e.getParameter(e.MAX_TEXTURE_SIZE), a = Math.min(r, i);
42
+ if (t <= 0 || n <= 0 || t > a || n > a) throw RangeError(`SVG raster dimensions ${t} x ${n} exceed the WebGL limit ${a}.`);
43
+ }
44
+ function s(e, t, n, r) {
45
+ let i = Math.max(0, Math.floor(e.x1 * t)), a = Math.max(0, Math.floor(e.y1 * t)), o = Math.min(n, Math.ceil(e.x2 * t)), s = Math.min(r, Math.ceil(e.y2 * t));
46
+ return {
47
+ x: i,
48
+ y: a,
49
+ width: o - i,
50
+ height: s - a
51
+ };
52
+ }
53
+ //#endregion
54
+ export { a as rasterizeSvgRuns };
@@ -0,0 +1,53 @@
1
+ import { n as e, r as t, s as n } from "./framebufferReadback-THWwFqs8.js";
2
+ import { n as r } from "./viewRenderingContext-HtpqwS_x.js";
3
+ import { t as i } from "./svgNumber-DNxESJQB.js";
4
+ //#region ../core/src/rendering/svg/raster/webgl.js
5
+ function a({ runs: a, viewRoot: c, webGLHelper: l, logicalWidth: u, logicalHeight: d, pixelRatio: f }) {
6
+ let p = l.gl, m = Math.ceil(u * f), h = Math.ceil(d * f);
7
+ o(p, m, h);
8
+ let g = n(p, [{
9
+ format: p.RGBA,
10
+ type: p.UNSIGNED_BYTE,
11
+ minMag: p.LINEAR,
12
+ wrap: p.CLAMP_TO_EDGE
13
+ }], m, h);
14
+ try {
15
+ for (let n of a) {
16
+ let a = new t({ picking: !1 }, {
17
+ webGLHelper: l,
18
+ canvasSize: {
19
+ width: u,
20
+ height: d
21
+ },
22
+ devicePixelRatio: f,
23
+ framebufferInfo: g,
24
+ markPredicate: (e) => n.marks.has(e),
25
+ pixelOffset: 0
26
+ });
27
+ c.render(a, r.create(0, 0, u, d), { firstFacet: !0 }), a.render();
28
+ let o = s(n.bounds, f, m, h), _ = e(p, g, "image/png", {
29
+ ...o,
30
+ unpremultiplyAlpha: !0
31
+ }), v = n.image;
32
+ if (!v) throw Error("Raster run has no SVG image placeholder.");
33
+ v.setAttribute("x", "" + i(o.x / f)), v.setAttribute("y", "" + i(o.y / f)), v.setAttribute("width", "" + i(o.width / f)), v.setAttribute("height", "" + i(o.height / f)), v.setAttribute("href", _);
34
+ }
35
+ } finally {
36
+ p.bindFramebuffer(p.FRAMEBUFFER, null), p.deleteTexture(g.attachments[0]), p.deleteFramebuffer(g.framebuffer);
37
+ }
38
+ }
39
+ function o(e, t, n) {
40
+ let r = e.getParameter(e.MAX_RENDERBUFFER_SIZE), i = e.getParameter(e.MAX_TEXTURE_SIZE), a = Math.min(r, i);
41
+ if (t <= 0 || n <= 0 || t > a || n > a) throw RangeError(`SVG raster dimensions ${t} x ${n} exceed the WebGL limit ${a}.`);
42
+ }
43
+ function s(e, t, n, r) {
44
+ let i = Math.max(0, Math.floor(e.x1 * t)), a = Math.max(0, Math.floor(e.y1 * t)), o = Math.min(n, Math.ceil(e.x2 * t)), s = Math.min(r, Math.ceil(e.y2 * t));
45
+ return {
46
+ x: i,
47
+ y: a,
48
+ width: o - i,
49
+ height: s - a
50
+ };
51
+ }
52
+ //#endregion
53
+ export { a as rasterizeSvgRuns };
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "contributors": [],
9
9
  "license": "MIT",
10
10
  "homepage": "https://genomespy.app/",
11
- "version": "0.83.1",
11
+ "version": "0.85.0",
12
12
  "main": "dist/index.js",
13
13
  "module": "dist/index.es.js",
14
14
  "type": "module",
@@ -70,7 +70,7 @@
70
70
  "@fortawesome/fontawesome-free": "^6.4.2",
71
71
  "@fortawesome/fontawesome-svg-core": "^6.4.2",
72
72
  "@fortawesome/free-solid-svg-icons": "^6.4.2",
73
- "@genome-spy/core": "^0.83.1",
73
+ "@genome-spy/core": "^0.85.0",
74
74
  "@reduxjs/toolkit": "^2.11.0",
75
75
  "d3-color": "^3.1.0",
76
76
  "idb": "^7.1.1",
@@ -83,8 +83,8 @@
83
83
  "zarrita": "^0.6.1"
84
84
  },
85
85
  "devDependencies": {
86
- "@genome-spy/app-agent": "^0.83.1",
87
- "@genome-spy/inspector": "^0.83.1"
86
+ "@genome-spy/app-agent": "^0.85.0",
87
+ "@genome-spy/inspector": "^0.85.0"
88
88
  },
89
- "gitHead": "f880c82effa9550b5e979b5982770dd909d91b59"
89
+ "gitHead": "9d32a48e4ee76086a65ee66231f871c0f57071d7"
90
90
  }