vis-core 0.25.7 → 0.25.9

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), De = JSON.parse(Je), bt = Date.now();
91
91
  return !De.s || De.s > bt ? (this.token = void 0, "") : De.e && De.e < bt ? (this.token = void 0, "") : (De.isValid = ye, De);
92
92
  }
93
- }, version = "0.25.7";
93
+ }, version = "0.25.9";
94
94
  /**
95
95
  * @license
96
96
  * Copyright 2010-2025 Three.js Authors
@@ -56159,47 +56159,7 @@ const detect = () => {
56159
56159
  tier: 0
56160
56160
  };
56161
56161
  }
56162
- };
56163
- function observeTransformScale(d, t) {
56164
- let o = d, r = 1;
56165
- for (; o; ) {
56166
- const O = window.getComputedStyle(o).transform;
56167
- if (O && O !== "none") {
56168
- const ne = new DOMMatrix(O);
56169
- if (ne.a !== 1 || ne.d !== 1) {
56170
- r = Math.max(ne.a, ne.d);
56171
- break;
56172
- }
56173
- }
56174
- if (o === document.body) {
56175
- o = null;
56176
- break;
56177
- }
56178
- o = o.parentElement;
56179
- }
56180
- if (!o)
56181
- return null;
56182
- const g = (w) => {
56183
- const ne = window.getComputedStyle(o).transform;
56184
- let ye = 1;
56185
- if (ne && ne !== "none") {
56186
- const fe = new DOMMatrix(ne);
56187
- ye = Math.max(fe.a, fe.d);
56188
- }
56189
- r !== ye && (r = ye, t(ye, w));
56190
- }, v = new MutationObserver((w) => {
56191
- for (const O of w)
56192
- if (O.type === "attributes" && (O.attributeName === "style" || O.attributeName === "class")) {
56193
- g("MutationObserver");
56194
- return;
56195
- }
56196
- });
56197
- return v.observe(o, {
56198
- attributes: !0,
56199
- attributeFilter: ["style", "class"]
56200
- }), t(r, "init"), v;
56201
- }
56202
- const IS_DEV = !1;
56162
+ }, IS_DEV = !1;
56203
56163
  class Base extends Camera {
56204
56164
  constructor(o) {
56205
56165
  var r;
@@ -56372,12 +56332,7 @@ class Base extends Camera {
56372
56332
  anisotropy: 1
56373
56333
  } : {})
56374
56334
  }), this.pencilConfig), this.options.pencilConfig));
56375
- this.options.observeParentScale && (this.observeTransformScale = observeTransformScale(
56376
- this.container,
56377
- (Yt, St) => {
56378
- bt.setDevicePixelRatio(window.devicePixelRatio * Yt);
56379
- }
56380
- )), this.pencil = bt, this.sceneActive = 1;
56335
+ this.options.observeParentScale, this.pencil = bt, this.sceneActive = 1;
56381
56336
  const Ct = bt.composerController.ssaoPass;
56382
56337
  Ct && (Ct.enabled = !1);
56383
56338
  const Lt = new T({
@@ -136875,7 +136830,10 @@ const objs$4 = Ki(ii({}, objs$5), {
136875
136830
  return;
136876
136831
  const [Lt, Yt, St] = Ct;
136877
136832
  let Tt = w;
136878
- o === "lite" && Tt && (Tt = w.replace("自治州", "").replace("地区", "").replace("自治区", "").replace("省", "").replace("市", "").replace("壮族", "").replace("特别行政区", "").replace("回族", "").replace("维吾尔", ""));
136833
+ o === "lite" && Tt && (Tt = w.replace(
136834
+ /自治州|地区|自治区|省|市|壮族|特别行政区|回族|维吾尔/g,
136835
+ ""
136836
+ ));
136879
136837
  const Mt = Tt && getLabelElement(Tt), Ht = Tt != null && Tt.startsWith("澳门") ? -1 : 0;
136880
136838
  yield this.lead.draw("Node", {
136881
136839
  position: new Vector3(Lt, Yt + Ht, St),
@@ -136982,6 +136940,7 @@ const objs$4 = Ki(ii({}, objs$5), {
136982
136940
  const k0 = (Yt = this.mapHistory.at(-1)) == null ? void 0 : Yt.controls;
136983
136941
  yield this.fitTo(c0, {
136984
136942
  fixZ: u0 + o0,
136943
+ adcode: o,
136985
136944
  enableTransition: r !== 0,
136986
136945
  polarAngle: k0 == null ? void 0 : k0.polarAngle,
136987
136946
  azimuthAngle: k0 == null ? void 0 : k0.azimuthAngle,
@@ -137026,22 +136985,22 @@ const objs$4 = Ki(ii({}, objs$5), {
137026
136985
  const r = this.getAdcodeShowLevel(o);
137027
136986
  o === 0 ? (this.pencil.camera.near = 1, this.pencil.camera.far = 1e3, this.pencil.camera.updateProjectionMatrix()) : (r === "country" || r === "province") && this.pencil.camera.near !== this.pencilConfig.camera.near * 10 ? (this.pencil.camera.near = this.pencilConfig.camera.near * 10, this.pencil.camera.updateProjectionMatrix()) : (r === "city" || r === "district") && this.pencil.camera.near !== this.pencilConfig.camera.near && (this.pencil.camera.near = this.pencilConfig.camera.near, this.pencil.camera.updateProjectionMatrix());
137028
136987
  }
137029
- fitTo(ne) {
136988
+ fitTo(ye) {
137030
136989
  return _0(this, arguments, function* (o, {
137031
136990
  polarAngle: r,
137032
136991
  azimuthAngle: g,
137033
136992
  fixZ: v,
137034
136993
  handleStart: w,
137035
- enableTransition: O = !0
136994
+ adcode: O,
136995
+ enableTransition: ne = !0
137036
136996
  } = {}) {
137037
- var Mt;
137038
136997
  if (!(o != null && o.object3d)) return;
137039
- if (yield this.useSaveCamera(
137040
- `map-${(Mt = this.mapInfo) == null ? void 0 : Mt.adcode}`,
137041
- O
137042
- )) {
137043
- w && (yield w());
137044
- return;
136998
+ if (O) {
136999
+ const Mt = yield this.useSaveCamera(`map-${O}`, ne);
137000
+ if (console.log("useSaveCamera.adcode", Mt), Mt) {
137001
+ w && (yield w());
137002
+ return;
137003
+ }
137045
137004
  }
137046
137005
  const fe = this.options.mapPadding, { height: Je, width: De } = this.pencil.getSize();
137047
137006
  Je < fe[0] + fe[2] + 50 && (fe[0] = 0, fe[2] = 0), De < fe[1] + fe[3] + 50 && (fe[1] = 0, fe[3] = 0);
@@ -137064,7 +137023,7 @@ const objs$4 = Ki(ii({}, objs$5), {
137064
137023
  const Tt = this.pencil.cameraPositon.toArray();
137065
137024
  yield this.lookAt(...Lt, ...Yt), yield Promise.all(
137066
137025
  [
137067
- this.lookAt(...Tt, ...St, O),
137026
+ this.lookAt(...Tt, ...St, ne),
137068
137027
  w == null ? void 0 : w()
137069
137028
  ].filter(Boolean)
137070
137029
  );
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.25.7";
1
+ declare const _default: "0.25.9";
2
2
  export default _default;
@@ -201,7 +201,8 @@ export default class extends Base {
201
201
  }): Promise<void>;
202
202
  saveCamvasState(type: 'userControls' | 'controls', index: number): void;
203
203
  fixNear(adcode: number): void;
204
- fitTo(obj?: BaseObject, { polarAngle, azimuthAngle, fixZ, handleStart, enableTransition, }?: {
204
+ fitTo(obj?: BaseObject, { polarAngle, azimuthAngle, fixZ, handleStart, adcode, enableTransition, }?: {
205
+ adcode?: number;
205
206
  polarAngle?: number;
206
207
  azimuthAngle?: number;
207
208
  enableTransition?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.25.7",
3
+ "version": "0.25.9",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && bundler",