vis-core 0.22.13 → 0.22.14

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.
@@ -90,7 +90,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
90
90
  ).toString(CryptoJS.enc.Utf8), qe = JSON.parse($e), st = Date.now();
91
91
  return !qe.s || qe.s > st ? (this.token = void 0, "") : qe.e && qe.e < st ? (this.token = void 0, "") : (qe.isValid = Qe, qe);
92
92
  }
93
- }, version = "0.22.13";
93
+ }, version = "0.22.14";
94
94
  /**
95
95
  * @license
96
96
  * Copyright 2010-2024 Three.js Authors
@@ -38024,7 +38024,7 @@ const V = {
38024
38024
  r.width = 256, r.height = 1;
38025
38025
  const T = r.getContext("2d"), de = T.createLinearGradient(0, 0, 256, 1);
38026
38026
  de.addColorStop(0, e), de.addColorStop(c, e), de.addColorStop(c, s), de.addColorStop(1, s), T.fillStyle = de, T.fillRect(0, 0, 256, 1);
38027
- const Xe = new Texture(r);
38027
+ const Xe = new CanvasTexture(r);
38028
38028
  return Xe.wrapS = RepeatWrapping, Xe.wrapT = RepeatWrapping, Xe.needsUpdate = !0, Xe;
38029
38029
  }, createFlyPath = (c, e, s = 40) => {
38030
38030
  const r = c.angleTo(e);
@@ -38149,14 +38149,14 @@ class Arc extends A$1 {
38149
38149
  onComplete: de,
38150
38150
  onRepeat: Xe
38151
38151
  } = {}) {
38152
- this.line.material.userData.tween && (this.line.material.userData.tween.stop(), remove(this.line.material.userData.tween), this.line.material.userData.tween = null), this.line.material.uniforms.offset.value.x = 1, this.line.material.uniforms.offsetLoop.value = 0, this.line.animate({
38152
+ this.line.material.userData.tween && (this.line.material.userData.tween.stop(), remove(this.line.material.userData.tween), this.line.material.userData.tween = null, this.line.material.uniforms.offset.value.x = 0), s && (this.line.material.uniforms.offset.value.x = 1, this.line.material.uniforms.offsetLoop.value = 0, this.line.animate({
38153
38153
  duration: s,
38154
38154
  repeat: T,
38155
38155
  delay: r,
38156
38156
  lineLoop: this.options.offsetLoop,
38157
38157
  onRepeat: Xe,
38158
38158
  onComplete: de
38159
- });
38159
+ }));
38160
38160
  }
38161
38161
  update() {
38162
38162
  var s;
@@ -38169,7 +38169,10 @@ class Arc extends A$1 {
38169
38169
  this.helperMeshPosition[2],
38170
38170
  this.helperMeshPosition[3]
38171
38171
  ).getPoints(1500);
38172
- return this.line.setGeometry(Xe, (Ke) => Ke * 1), !0;
38172
+ return this.line.setGeometry(
38173
+ Xe,
38174
+ this.line.object3d.geometry.widthCallback
38175
+ ), !0;
38173
38176
  }
38174
38177
  });
38175
38178
  }
@@ -50482,20 +50485,22 @@ class Base extends Event {
50482
50485
  const r = {
50483
50486
  bloom: !1
50484
50487
  };
50485
- s.objectType !== "BaseObject#Light" && (prefabType.includes(s.objectType.split("#")[1]) && (r.prefab = s.prefab), s.object3d.userData = new Proxy(r, {
50486
- set: (T, de, Xe) => {
50487
- if (de === "bloom")
50488
+ if (s.objectType === "BaseObject#Light")
50489
+ return;
50490
+ s.objectType === "BaseObject#Arc" && (r.animationDuration = 2e3), prefabType.includes(s.objectType.split("#")[1]) && (r.prefab = s.prefab), s.object3d.userData = new Proxy(r, {
50491
+ set: (de, Xe, Ke) => {
50492
+ if (Xe === "bloom")
50488
50493
  this.pencil.composerController.toggleBloomSelection(
50489
50494
  s,
50490
- Xe
50495
+ Ke
50491
50496
  );
50492
- else if (de === "prefab") {
50493
- const Ke = this.pencil.getPlugin("draw");
50494
- s.prefab = Xe, Xe ? Ke.prefabGroup.attach(s) : Ke.group.attach(s);
50495
- }
50496
- return Reflect.set(T, de, Xe);
50497
+ else if (Xe === "prefab") {
50498
+ const Je = this.pencil.getPlugin("draw");
50499
+ s.prefab = Ke, Ke ? Je.prefabGroup.attach(s) : Je.group.attach(s);
50500
+ } else Xe === "animationDuration" && s.animateIn({ duration: Ke });
50501
+ return Reflect.set(de, Xe, Ke);
50497
50502
  }
50498
- }));
50503
+ });
50499
50504
  }
50500
50505
  initPencilPlugin() {
50501
50506
  this.mList = new MaterialList(), this.loader = new Kl(ai({
@@ -130171,6 +130176,13 @@ const objs$4 = Ki(ai({}, objs$5), {
130171
130176
  }
130172
130177
  });
130173
130178
  }
130179
+ consoleMousePostion() {
130180
+ this.addListener(this.container, "click", (s) => {
130181
+ var de, Xe;
130182
+ const r = this.unproject(s, this.mapObj.z + this.mapObj.depth), T = (Xe = (de = this.projection).invert) == null ? void 0 : Xe.call(de, [r.x, -r.y]);
130183
+ console.log("consoleMousePostion.postion", r), console.log("consoleMousePostion.lnglat", T);
130184
+ });
130185
+ }
130174
130186
  setAreaMixColor(s, r) {
130175
130187
  this.setAreaColorByProperty("adcode", s, r, !0);
130176
130188
  }
@@ -133162,13 +133174,6 @@ const R1 = class R1 extends Map$1 {
133162
133174
  }), adcodeMap[s].parent === 35e4 && this.options.curvatureResolution && city350000(Je), Je.pencilConfig = this.pencilConfig, Je.pencil = this.pencil, Je.roomEnvMap = this.roomEnvMap, Je.mList = this.mList, Je.loader = this.loader, Je.editor = this.editor, Je.drawController = this.drawController, yield Je.init(), Je.group.hide(), this.cityVisObj[s].city = Je, this.cityVisObj[s].state.resolve(), this.emit("initCityVis", s);
133163
133175
  });
133164
133176
  }
133165
- consoleMousePostion() {
133166
- this.addListener(this.container, "click", (s) => {
133167
- var de, Xe;
133168
- const r = this.unproject(s, this.mapObj.z + this.mapObj.depth), T = (Xe = (de = this.projection).invert) == null ? void 0 : Xe.call(de, [r.x, -r.y]);
133169
- console.log("consoleMousePostion.postion", r), console.log("consoleMousePostion.lnglat", T);
133170
- });
133171
- }
133172
133177
  initCityOnMap(s) {
133173
133178
  return ei(this, null, function* () {
133174
133179
  if (this.getAdcodeShowLevel(s) !== "city") {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.22.13";
1
+ declare const _default: "0.22.14";
2
2
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import * as THREE from 'three';
2
2
  import Pencil from 'gl-draw';
3
- export declare const getLineTexture: (length: number, lightColor?: string, lineColor?: string) => THREE.Texture;
3
+ export declare const getLineTexture: (length: number, lightColor?: string, lineColor?: string) => THREE.CanvasTexture;
4
4
  export declare const createFlyPath: (v0: THREE.Vector3, v3: THREE.Vector3, h?: number) => THREE.CubicBezierCurve3;
5
5
  export declare const createFlyPath2: (v0: THREE.Vector3, v3: THREE.Vector3, h?: number) => THREE.CubicBezierCurve3;
6
6
  export declare const pixel2unit: (pencil: Pencil, pixel: number) => number;
@@ -3,6 +3,7 @@ import MaterialList from "../all/MaterialList";
3
3
  import { Wk, Loader, Draw as DrawController } from 'gl-draw/dist/plugins';
4
4
  import type { PickFunctionsItem } from 'gl-draw/dist/plugins/Draw';
5
5
  import { Node } from 'gl-draw/dist/objects';
6
+ import Arc from "../all/objects/Arc";
6
7
  import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment';
7
8
  import * as THREE from 'three';
8
9
  import Event from "./event";
@@ -58,7 +59,7 @@ export default class Base extends Event {
58
59
  Group: typeof import("gl-draw/dist/objects").Group;
59
60
  Light: typeof import("../all/objects/Light").default;
60
61
  Point: typeof import("../all/objects/Point").default;
61
- Arc: typeof import("../all/objects/Arc").default;
62
+ Arc: typeof Arc;
62
63
  Model: typeof import("../all/objects/Model").default;
63
64
  }>;
64
65
  mList: MaterialList;
@@ -75,7 +76,7 @@ export default class Base extends Event {
75
76
  setOptions(options: Record<string, any>): void;
76
77
  get fromJSON(): (jsonOrUrl: Record<string, any> | string, hooks?: import("../../editor").Hooks) => Promise<Record<string, any>>;
77
78
  get baseObjectByUuid(): {
78
- (uuid: `arc${string}`, flag?: boolean): import("../all/objects/Arc").default;
79
+ (uuid: `arc${string}`, flag?: boolean): Arc;
79
80
  (uuid: `sprite${string}`, flag?: boolean): import("../all/objects/Sprite").default;
80
81
  (uuid: string, flag?: boolean): BaseObject;
81
82
  };
@@ -130,6 +130,7 @@ export default class extends Base {
130
130
  initVis(adcode: number): Promise<void>;
131
131
  loaderAddBg(): void;
132
132
  initMaterialBg(): Promise<void>;
133
+ consoleMousePostion(): void;
133
134
  setAreaMixColor(adcode: number, color: string): void;
134
135
  setAreaColorByProperty(key: string, value: any, color: string, mix?: boolean): void;
135
136
  setAreaEmissiveByProperty(key: string, value: any, color: string, intensity?: number): void;
@@ -44,7 +44,6 @@ export default class extends Map {
44
44
  clip?: boolean;
45
45
  grey?: boolean;
46
46
  }): Promise<void>;
47
- consoleMousePostion(): void;
48
47
  initCityOnMap(adcode: number): Promise<void>;
49
48
  showCity(adcode: number, lnglat?: [number, number]): Promise<void>;
50
49
  showCity(option: showCityOption): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.22.13",
3
+ "version": "0.22.14",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && bundler",