@realsee/dnalogel 3.47.3 → 3.47.4

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.
@@ -40,6 +40,7 @@ export declare class Magnifier {
40
40
  private hammer?;
41
41
  private offsetRange?;
42
42
  private isPanning;
43
+ private imageData;
43
44
  constructor(five: Five, options: MagnifierParameter);
44
45
  enable(): this;
45
46
  disable(): this;
@@ -14,10 +14,10 @@ import * as a from "three";
14
14
  import { DEFAULT_LINE_COLOR as m, DEFAULT_LINE_WIDTH as M, DEFAULT_HIGHLIGHT_OPACITY as D } from "../typings/style.js";
15
15
  import { LineGeometry as L, LineMaterial as w, THREE_Line2 as H } from "../../shared-utils/five/FiveLine.js";
16
16
  import { anyPositionToVector3 as C } from "../../shared-utils/positionToVector3.js";
17
- import { IObject3D as I } from "../../shared-utils/three/IObject3D.js";
17
+ import { IObject3D as p } from "../../shared-utils/three/IObject3D.js";
18
18
  import "hammerjs";
19
19
  import "three/examples/jsm/renderers/CSS3DRenderer";
20
- import { centerPoint as p } from "../../shared-utils/three/centerPoint.js";
20
+ import { centerPoint as I } from "../../shared-utils/three/centerPoint.js";
21
21
  import { LightTag as R } from "../../shared-utils/tag.js";
22
22
  import { globalModules as x } from "../utils/Modules/Global.js";
23
23
  import { removeAllTag as v } from "../utils/removeAllTag.js";
@@ -50,7 +50,7 @@ class T extends H {
50
50
  h(this, "name", "Line3");
51
51
  }
52
52
  }
53
- class J extends I {
53
+ class J extends p {
54
54
  constructor(e) {
55
55
  var l, r, g, u, d;
56
56
  super();
@@ -139,15 +139,17 @@ class J extends I {
139
139
  }
140
140
  updateLengthItems() {
141
141
  var e, n;
142
- if (this.points.length < 2 && (this.lengthDoms.forEach((t) => t.destroy()), this.lengthDoms = []), this.paramsStyle.lengthEnable) {
142
+ if ((!this.points || this.points.length < 2) && (this.lengthDoms.forEach((t) => t.destroy()), this.lengthDoms = []), this.paramsStyle.lengthEnable) {
143
143
  const t = (n = (e = this.points) == null ? void 0 : e.map((i, l) => {
144
144
  if (l !== 0)
145
145
  return [this.points[l - 1], i];
146
146
  }).filter(c)) != null ? n : [];
147
147
  t.forEach(([i, l], r) => {
148
148
  var d;
149
- const g = p(i, l), u = i.distanceTo(l).toFixed(2) + "m";
150
- this.lengthDoms[r] = (d = this.lengthDoms[r]) != null ? d : new R(x.five), this.lengthDoms[r].setPosition(g), this.lengthDoms[r].container.innerHTML = `<div style="pointer-events:none;color:white;">${u}</div>`;
149
+ const g = I(i, l), u = i.distanceTo(l).toFixed(2) + "m";
150
+ this.lengthDoms[r] = (d = this.lengthDoms[r]) != null ? d : new R(x.five), this.lengthDoms[r].setPosition(g), this.lengthDoms[r].container.innerHTML = `
151
+ <div style="pointer-events:none;color:white;">${u}</div>
152
+ `;
151
153
  }), this.lengthDoms.length > t.length && (this.lengthDoms.slice(t.length).forEach((i) => i.destroy()), this.lengthDoms.length = t.length);
152
154
  } else
153
155
  this.lengthDoms.forEach((t) => t.destroy()), this.lengthDoms = [];
@@ -17,7 +17,7 @@ let x = class {
17
17
  /**
18
18
  * @realsee/dnalogel 版本号
19
19
  */
20
- i(this, "VERSION", "3.47.3");
20
+ i(this, "VERSION", "3.47.4");
21
21
  i(this, "NAME");
22
22
  i(this, "five");
23
23
  i(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.47.3",
3
+ "%c %c@realsee/dnalogel %cv3.47.4",
4
4
  [
5
5
  "background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
6
6
  "background-repeat: no-repeat",
@@ -40,6 +40,7 @@ export declare class Magnifier {
40
40
  private hammer?;
41
41
  private offsetRange?;
42
42
  private isPanning;
43
+ private imageData;
43
44
  constructor(five: Five, options: MagnifierParameter);
44
45
  enable(): this;
45
46
  disable(): this;
@@ -1,15 +1,15 @@
1
- var p = Object.defineProperty;
2
- var b = (r, t, e) => t in r ? p(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var n = (r, t, e) => (b(r, typeof t != "symbol" ? t + "" : t, e), e);
4
- import C from "hammerjs";
1
+ var P = Object.defineProperty;
2
+ var p = (r, t, e) => t in r ? P(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var n = (r, t, e) => (p(r, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import b from "hammerjs";
5
5
  import * as l from "three";
6
- import { Subscribe as R } from "../Subscribe.js";
7
- class Y {
6
+ import { Subscribe as C } from "../Subscribe.js";
7
+ class E {
8
8
  constructor(t, e) {
9
9
  n(this, "width");
10
10
  n(this, "height");
11
11
  n(this, "containerDom");
12
- n(this, "hooks", new R());
12
+ n(this, "hooks", new C());
13
13
  n(this, "canvas", document.createElement("canvas"));
14
14
  n(this, "config");
15
15
  n(this, "state", { enabled: !1 });
@@ -21,6 +21,7 @@ class Y {
21
21
  n(this, "hammer");
22
22
  n(this, "offsetRange");
23
23
  n(this, "isPanning", !1);
24
+ n(this, "imageData", new ImageData(1, 1));
24
25
  n(this, "onPanstart", () => {
25
26
  this.isPanning = !0, this.canvas.style.boxShadow = "0 2px 30px 0 rgba(0,0,0,0.20)";
26
27
  });
@@ -49,7 +50,7 @@ class Y {
49
50
  const i = this.canvas.getContext("2d");
50
51
  if (!i)
51
52
  throw new Error("CANNOT CREATE CONTEXT2D");
52
- this.context = i, this.config.dragEnabled && (this.hammer = new C(this.canvas), this.hammer.on("pan", this.onPan), this.hammer.on("panstart", this.onPanstart), this.hammer.on("panend", this.onPanend)), this.initStyle();
53
+ this.context = i, this.config.dragEnabled && (this.hammer = new b(this.canvas), this.hammer.on("pan", this.onPan), this.hammer.on("panstart", this.onPanstart), this.hammer.on("panend", this.onPanend)), this.initStyle();
53
54
  }
54
55
  enable() {
55
56
  if (!this.state.enabled)
@@ -100,12 +101,12 @@ class Y {
100
101
  return;
101
102
  const { width: t, height: e } = this, { clientWidth: i, clientHeight: s } = this.containerDom, [h, o, a] = (() => {
102
103
  if (this.renderCenter instanceof l.Vector3) {
103
- const c = this.renderCenter.clone().project(this.five.camera);
104
+ const f = this.renderCenter.clone().project(this.five.camera);
104
105
  return [
105
106
  //
106
- (c.x + 1) / 2 * i,
107
- -(c.x - 1) / 2 * i,
108
- -(c.y - 1) / 2 * s
107
+ (f.x + 1) / 2 * i,
108
+ -(f.x - 1) / 2 * i,
109
+ -(f.y - 1) / 2 * s
109
110
  ];
110
111
  } else
111
112
  return [this.renderCenter.x, i - this.renderCenter.x, this.renderCenter.y];
@@ -117,14 +118,12 @@ class Y {
117
118
  return;
118
119
  const { scale: t, context: e, width: i, height: s } = this, h = this.five.renderer.getSize(new l.Vector2()), [o, a] = (() => {
119
120
  if (this.renderCenter instanceof l.Vector3) {
120
- const y = this.renderCenter.clone().project(this.five.camera);
121
- return [(y.x + 1) / 2 * h.x, (y.y + 1) / 2 * h.y];
121
+ const v = this.renderCenter.clone().project(this.five.camera);
122
+ return [(v.x + 1) / 2 * h.x, (v.y + 1) / 2 * h.y];
122
123
  } else
123
124
  return [this.renderCenter.x, h.y - this.renderCenter.y];
124
- })(), c = 1, f = i / t, x = s / t, P = c * t, g = this.five.getPixels(o - f / 2, a - f / 2, f, x, P), m = Math.floor(i * c), u = Math.floor(s * c);
125
- w(g, m, u);
126
- const v = new ImageData(m, u);
127
- v.data.set(g), e.putImageData(v, 0, 0), this.canvas.style.visibility = "visible";
125
+ })(), f = 1, c = i / t, g = s / t, y = f * t, u = this.five.getPixels(o - c / 2, a - c / 2, c, g, y), x = Math.floor(i * f), m = Math.floor(s * f);
126
+ D(u, x, m), (this.imageData.width !== x || this.imageData.height !== m) && (this.imageData = new ImageData(x, m)), this.imageData.data.set(u), e.putImageData(this.imageData, 0, 0), this.canvas.style.visibility = "visible";
128
127
  }
129
128
  initStyle() {
130
129
  const t = this.canvas;
@@ -136,24 +135,24 @@ class Y {
136
135
  const {
137
136
  min: { x: i, y: s },
138
137
  max: { x: h, y: o }
139
- } = e, a = this.offset.x + t.deltaX, c = this.offset.y + t.deltaY, f = Math.min(Math.max(a, i), h), x = Math.min(Math.max(c, s), o);
140
- return { translateX: f, translateY: x };
138
+ } = e, a = this.offset.x + t.deltaX, f = this.offset.y + t.deltaY, c = Math.min(Math.max(a, i), h), g = Math.min(Math.max(f, s), o);
139
+ return { translateX: c, translateY: g };
141
140
  }
142
141
  }
143
142
  function d(r, t, e) {
144
143
  const i = r[t], s = r[e];
145
144
  i === void 0 || s === void 0 || (r[t] = s, r[e] = i);
146
145
  }
147
- function w(r, t, e) {
146
+ function D(r, t, e) {
148
147
  const i = e / 2;
149
148
  for (let s = 1; s <= i; s++) {
150
149
  const h = e - (s - 1);
151
150
  for (let o = 1; o <= t; o++) {
152
- const a = (s - 1) * t + o - 1, c = (h - 1) * t + o - 1;
153
- d(r, a * 4 + 0, c * 4 + 0), d(r, a * 4 + 1, c * 4 + 1), d(r, a * 4 + 2, c * 4 + 2), d(r, a * 4 + 3, c * 4 + 3);
151
+ const a = (s - 1) * t + o - 1, f = (h - 1) * t + o - 1;
152
+ d(r, a * 4 + 0, f * 4 + 0), d(r, a * 4 + 1, f * 4 + 1), d(r, a * 4 + 2, f * 4 + 2), d(r, a * 4 + 3, f * 4 + 3);
154
153
  }
155
154
  }
156
155
  }
157
156
  export {
158
- Y as Magnifier
157
+ E as Magnifier
159
158
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.47.3",
3
+ "version": "3.47.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@babel/core": "^7.22.9",
45
- "@realsee/five": "6.1.3",
45
+ "@realsee/five": "6.2.0-alpha.6",
46
46
  "@sveltejs/vite-plugin-svelte": "^2.4.2",
47
47
  "@tsconfig/svelte": "^4.0.1",
48
48
  "@tweenjs/tween.js": "^23.1.1",