vis-core 0.22.13 → 0.22.15

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.15";
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,29 +38149,34 @@ 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;
38163
- (s = this.helperMesh) != null && s.length && this.helperMesh.some((r, T) => {
38164
- if (r.position.distanceTo(this.helperMeshPosition[T]) > 0.01) {
38165
- this.helperMeshPosition[T].copy(r.position);
38166
- const Xe = new CubicBezierCurve3(
38167
- this.helperMeshPosition[0],
38168
- this.helperMeshPosition[1],
38169
- this.helperMeshPosition[2],
38170
- this.helperMeshPosition[3]
38171
- ).getPoints(1500);
38172
- return this.line.setGeometry(Xe, (Ke) => Ke * 1), !0;
38173
- }
38174
- });
38163
+ if ((s = this.helperMesh) != null && s.length && this.helperMesh.find(
38164
+ (T, de) => T.position.distanceTo(this.helperMeshPosition[de]) > 0.01
38165
+ )) {
38166
+ this.helperMesh.forEach((Xe, Ke) => {
38167
+ this.helperMeshPosition[Ke].copy(Xe.position);
38168
+ });
38169
+ const de = new CubicBezierCurve3(
38170
+ this.helperMeshPosition[0],
38171
+ this.helperMeshPosition[1],
38172
+ this.helperMeshPosition[2],
38173
+ this.helperMeshPosition[3]
38174
+ ).getPoints(1500);
38175
+ this.line.setGeometry(
38176
+ de,
38177
+ this.line.object3d.geometry.widthCallback
38178
+ );
38179
+ }
38175
38180
  }
38176
38181
  setMList() {
38177
38182
  var r;
@@ -50482,20 +50487,22 @@ class Base extends Event {
50482
50487
  const r = {
50483
50488
  bloom: !1
50484
50489
  };
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")
50490
+ if (s.objectType === "BaseObject#Light")
50491
+ return;
50492
+ s.objectType === "BaseObject#Arc" && (r.animationDuration = 2e3), prefabType.includes(s.objectType.split("#")[1]) && (r.prefab = s.prefab), s.object3d.userData = new Proxy(r, {
50493
+ set: (de, Xe, Ke) => {
50494
+ if (Xe === "bloom")
50488
50495
  this.pencil.composerController.toggleBloomSelection(
50489
50496
  s,
50490
- Xe
50497
+ Ke
50491
50498
  );
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);
50499
+ else if (Xe === "prefab") {
50500
+ const Je = this.pencil.getPlugin("draw");
50501
+ s.prefab = Ke, Ke ? Je.prefabGroup.attach(s) : Je.group.attach(s);
50502
+ } else Xe === "animationDuration" && s.animateIn({ duration: Ke });
50503
+ return Reflect.set(de, Xe, Ke);
50497
50504
  }
50498
- }));
50505
+ });
50499
50506
  }
50500
50507
  initPencilPlugin() {
50501
50508
  this.mList = new MaterialList(), this.loader = new Kl(ai({
@@ -129769,14 +129776,11 @@ const objs$4 = Ki(ai({}, objs$5), {
129769
129776
  }, c.initMaterial = function() {
129770
129777
  return ei(this, null, function* () {
129771
129778
  const e = this.loader, s = (() => {
129772
- const r = new MeshStandardMaterial({
129779
+ const T = new MeshStandardMaterial({
129773
129780
  name: "顶面",
129774
129781
  map: e.getAsset("/image/map/hp.webp"),
129775
129782
  normalMap: e.getAsset("/image/map/shuchu2.webp")
129776
- }), T = this.options.drillDownTopMatTwo ? new MeshBasicMaterial({
129777
- name: "二级顶面",
129778
- color: new Color$1("#0d2425")
129779
- }) : null, de = new MeshBasicMaterial({
129783
+ }), de = new MeshBasicMaterial({
129780
129784
  name: "侧面",
129781
129785
  map: e.getAsset("/image/map/jianbian.webp")
129782
129786
  }), Xe = new it$1({
@@ -129794,14 +129798,41 @@ const objs$4 = Ki(ai({}, objs$5), {
129794
129798
  depthWrite: !1
129795
129799
  });
129796
129800
  return {
129797
- topMat: r,
129798
- topMatTwo: T,
129801
+ topMat: T,
129799
129802
  sideMat: de,
129800
129803
  lineMat: Xe,
129801
129804
  extrudeLineMat: Ke
129802
129805
  };
129803
- })();
129804
- this.mList.setMaterialObj("plane", s), this.mList.setShowMaterialList("area", ["plane#topMat", "plane#sideMat"], {
129806
+ })(), r = this.options.drillDownTopMatTwo ? (() => {
129807
+ const T = new MeshBasicMaterial({
129808
+ name: "二级顶面",
129809
+ color: new Color$1("#0d2425")
129810
+ }), de = new MeshBasicMaterial({
129811
+ name: "二级侧面",
129812
+ color: new Color$1("#0d2425")
129813
+ }), Xe = new it$1({
129814
+ name: "二级线",
129815
+ color: new Color$1("#73FEDD"),
129816
+ sizeAttenuation: 0,
129817
+ lineWidth: this.options.lineWidth,
129818
+ //@ts-ignore
129819
+ depthWrite: !1
129820
+ }), Ke = new it$1({
129821
+ name: "二级边线",
129822
+ color: new Color$1("#00FFED"),
129823
+ sizeAttenuation: 0,
129824
+ lineWidth: this.options.extrudeLineWidth,
129825
+ //@ts-ignore
129826
+ depthWrite: !1
129827
+ });
129828
+ return {
129829
+ topMat: T,
129830
+ sideMat: de,
129831
+ lineMat: Xe,
129832
+ extrudeLineMat: Ke
129833
+ };
129834
+ })() : null;
129835
+ this.mList.setMaterialObj("plane", s), r && this.mList.setMaterialObj("secondPlane", r), this.mList.setShowMaterialList("area", ["plane#topMat", "plane#sideMat"], {
129805
129836
  name: "板块"
129806
129837
  }), this.mList.setShowMaterialList("line", "plane#lineMat", {
129807
129838
  name: "板块线"
@@ -129816,13 +129847,10 @@ const objs$4 = Ki(ai({}, objs$5), {
129816
129847
  }, c.initMaterial = function() {
129817
129848
  return ei(this, null, function* () {
129818
129849
  const e = this.loader, s = (() => {
129819
- const r = new MeshBasicMaterial({
129850
+ const T = new MeshBasicMaterial({
129820
129851
  name: "顶面",
129821
129852
  color: new Color$1("#0d2425")
129822
- }), T = this.options.drillDownTopMatTwo ? new MeshBasicMaterial({
129823
- name: "二级顶面",
129824
- color: new Color$1("#0d2425")
129825
- }) : null, de = new MeshBasicMaterial({
129853
+ }), de = new MeshBasicMaterial({
129826
129854
  name: "侧面",
129827
129855
  map: e.getAsset("/image/map/jianbian.webp")
129828
129856
  }), Xe = new it$1({
@@ -129839,14 +129867,41 @@ const objs$4 = Ki(ai({}, objs$5), {
129839
129867
  depthWrite: !1
129840
129868
  });
129841
129869
  return {
129842
- topMatTwo: T,
129843
- topMat: r,
129870
+ topMat: T,
129844
129871
  sideMat: de,
129845
129872
  lineMat: Xe,
129846
129873
  extrudeLineMat: Ke
129847
129874
  };
129848
- })();
129849
- this.mList.setMaterialObj("plane", s), this.mList.setShowMaterialList("area", ["plane#topMat", "plane#sideMat"], {
129875
+ })(), r = this.options.drillDownTopMatTwo ? (() => {
129876
+ const T = new MeshBasicMaterial({
129877
+ name: "二级顶面",
129878
+ color: new Color$1("#0d2425")
129879
+ }), de = new MeshBasicMaterial({
129880
+ name: "二级侧面",
129881
+ color: new Color$1("#0d2425")
129882
+ }), Xe = new it$1({
129883
+ name: "二级线",
129884
+ color: new Color$1("#73FEDD"),
129885
+ sizeAttenuation: 0,
129886
+ lineWidth: this.options.lineWidth,
129887
+ //@ts-ignore
129888
+ depthWrite: !1
129889
+ }), Ke = new it$1({
129890
+ name: "二级边线",
129891
+ color: new Color$1("#00FFED"),
129892
+ sizeAttenuation: 0,
129893
+ lineWidth: this.options.extrudeLineWidth,
129894
+ //@ts-ignore
129895
+ depthWrite: !1
129896
+ });
129897
+ return {
129898
+ topMat: T,
129899
+ sideMat: de,
129900
+ lineMat: Xe,
129901
+ extrudeLineMat: Ke
129902
+ };
129903
+ })() : null;
129904
+ this.mList.setMaterialObj("plane", s), r && this.mList.setMaterialObj("secondPlane", r), this.mList.setShowMaterialList("area", ["plane#topMat", "plane#sideMat"], {
129850
129905
  name: "板块"
129851
129906
  }), this.mList.setShowMaterialList("line", "plane#lineMat", {
129852
129907
  name: "板块线"
@@ -130171,6 +130226,13 @@ const objs$4 = Ki(ai({}, objs$5), {
130171
130226
  }
130172
130227
  });
130173
130228
  }
130229
+ consoleMousePostion() {
130230
+ this.addListener(this.container, "click", (s) => {
130231
+ var de, Xe;
130232
+ 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]);
130233
+ console.log("consoleMousePostion.postion", r), console.log("consoleMousePostion.lnglat", T);
130234
+ });
130235
+ }
130174
130236
  setAreaMixColor(s, r) {
130175
130237
  this.setAreaColorByProperty("adcode", s, r, !0);
130176
130238
  }
@@ -130659,9 +130721,7 @@ const objs$4 = Ki(ai({}, objs$5), {
130659
130721
  depth: de,
130660
130722
  adcode: Xe
130661
130723
  }) {
130662
- const Je = this.mapHistory.length === 0, Qe = this.mList.getMaterialObj("plane"), _e = ai({}, Qe);
130663
- !Je && _e.topMatTwo && (_e.topMat = _e.topMatTwo);
130664
- const $e = yield this.drawController.draw(
130724
+ const Je = this.mapHistory.length !== 0 && this.options.drillDownTopMatTwo, Qe = Je ? "secondPlane" : "plane", _e = this.mList.getMaterialObj(Qe), $e = ai({}, _e), qe = yield this.drawController.draw(
130665
130725
  "PlaneMap",
130666
130726
  {
130667
130727
  geojson: s,
@@ -130673,7 +130733,7 @@ const objs$4 = Ki(ai({}, objs$5), {
130673
130733
  rotate: this.options.worldPacificCentre ? [-160, 0] : void 0,
130674
130734
  projectionType: this.options.projectionType
130675
130735
  },
130676
- materialOptions: _e,
130736
+ materialOptions: $e,
130677
130737
  bbox: T,
130678
130738
  topSegments: this.options.topSegments,
130679
130739
  lineOffset: this.options.lineOffset,
@@ -130681,19 +130741,19 @@ const objs$4 = Ki(ai({}, objs$5), {
130681
130741
  },
130682
130742
  this.group
130683
130743
  );
130684
- return $e.extrudelineArr && $e.extrudelineArr.forEach((qe) => {
130685
- qe.object3d.name = "板块边线", this.mList.setObject3d(qe.object3d, "extrudeLine", {
130686
- baseObject: qe,
130744
+ return Je || (qe.extrudelineArr && qe.extrudelineArr.forEach((st) => {
130745
+ st.object3d.name = "板块边线", this.mList.setObject3d(st.object3d, "extrudeLine", {
130746
+ baseObject: st,
130687
130747
  replace: !0
130688
- }), this.initBaseObjectUserData(qe);
130748
+ }), this.initBaseObjectUserData(st);
130689
130749
  }), this.mList.setObject3d(
130690
- $e.object3d,
130750
+ qe.object3d,
130691
130751
  Xe === 1e5 ? "chinaGroup" : "planeMapGroup",
130692
130752
  {
130693
- baseObject: $e,
130753
+ baseObject: qe,
130694
130754
  replace: !0
130695
130755
  }
130696
- ), $e;
130756
+ )), qe;
130697
130757
  });
130698
130758
  }
130699
130759
  handleBack() {
@@ -133162,13 +133222,6 @@ const R1 = class R1 extends Map$1 {
133162
133222
  }), 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
133223
  });
133164
133224
  }
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
133225
  initCityOnMap(s) {
133173
133226
  return ei(this, null, function* () {
133174
133227
  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.15";
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.15",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && bundler",