vis-core 0.21.52 → 0.21.53
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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -16
- package/dist/index.module.js +55 -25
- package/dist/version.d.ts +1 -1
- package/package.json +4 -3
package/dist/index.module.js
CHANGED
|
@@ -89,7 +89,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
|
|
|
89
89
|
).toString(CryptoJS.enc.Utf8), de = JSON.parse($t), Xe = Date.now();
|
|
90
90
|
return !de.s || de.s > Xe ? (this.token = void 0, "") : de.e && de.e < Xe ? (this.token = void 0, "") : (de.isValid = Tt, de);
|
|
91
91
|
}
|
|
92
|
-
}, version = "0.21.
|
|
92
|
+
}, version = "0.21.53";
|
|
93
93
|
/**
|
|
94
94
|
* @license
|
|
95
95
|
* Copyright 2010-2024 Three.js Authors
|
|
@@ -30167,7 +30167,7 @@ var ce$1 = Object.defineProperty, fe$1 = Object.defineProperties, he$1 = Object.
|
|
|
30167
30167
|
me.call(e, s) && Q$1(st, s, e[s]);
|
|
30168
30168
|
return st;
|
|
30169
30169
|
}, Y$1 = (st, e) => fe$1(st, he$1(e));
|
|
30170
|
-
const j$2 = new Vector4(), te = new Vector3(), ie = new Vector3(), y = new Vector4(), x$3 = new Vector4(), I$2 = new Vector4(), $$
|
|
30170
|
+
const j$2 = new Vector4(), te = new Vector3(), ie = new Vector3(), y = new Vector4(), x$3 = new Vector4(), I$2 = new Vector4(), $$2 = new Vector3(), k$2 = new Matrix4(), M$3 = new Line3(), ne = new Vector3(), E$1 = new Box3(), G$1 = new Sphere$1(), B$1 = new Vector4();
|
|
30171
30171
|
let V$1, L$2;
|
|
30172
30172
|
function re(st, e, s) {
|
|
30173
30173
|
return B$1.set(0, 0, -e, 1).applyMatrix4(st.projectionMatrix), B$1.multiplyScalar(1 / B$1.w), B$1.x = L$2 / s.width, B$1.y = L$2 / s.height, B$1.applyMatrix4(st.projectionMatrixInverse), B$1.multiplyScalar(1 / B$1.w), Math.abs(Math.max(B$1.x, B$1.y));
|
|
@@ -30191,7 +30191,7 @@ function Te$2(st, e) {
|
|
|
30191
30191
|
}
|
|
30192
30192
|
function De$1(st, e, s) {
|
|
30193
30193
|
const c = e.projectionMatrix, ct = st.material.resolution, Zt = st.matrixWorld, Wt = st.geometry, Yt = Wt.attributes.instanceStart, vt = Wt.attributes.instanceEnd, Tt = Math.min(Wt.instanceCount, Yt.count), Jt = -e.near;
|
|
30194
|
-
V$1.at(1, I$2), I$2.w = 1, I$2.applyMatrix4(e.matrixWorldInverse), I$2.applyMatrix4(c), I$2.multiplyScalar(1 / I$2.w), I$2.x *= ct.x / 2, I$2.y *= ct.y / 2, I$2.z = 0, $$
|
|
30194
|
+
V$1.at(1, I$2), I$2.w = 1, I$2.applyMatrix4(e.matrixWorldInverse), I$2.applyMatrix4(c), I$2.multiplyScalar(1 / I$2.w), I$2.x *= ct.x / 2, I$2.y *= ct.y / 2, I$2.z = 0, $$2.copy(I$2), k$2.multiplyMatrices(e.matrixWorldInverse, Zt);
|
|
30195
30195
|
for (let $t = 0, de = Tt; $t < de; $t++) {
|
|
30196
30196
|
if (y.fromBufferAttribute(Yt, $t), x$3.fromBufferAttribute(vt, $t), y.w = 1, x$3.w = 1, y.applyMatrix4(k$2), x$3.applyMatrix4(k$2), y.z > Jt && x$3.z > Jt)
|
|
30197
30197
|
continue;
|
|
@@ -30203,9 +30203,9 @@ function De$1(st, e, s) {
|
|
|
30203
30203
|
x$3.lerp(y, Qe);
|
|
30204
30204
|
}
|
|
30205
30205
|
y.applyMatrix4(c), x$3.applyMatrix4(c), y.multiplyScalar(1 / y.w), x$3.multiplyScalar(1 / x$3.w), y.x *= ct.x / 2, y.y *= ct.y / 2, x$3.x *= ct.x / 2, x$3.y *= ct.y / 2, M$3.start.copy(y), M$3.start.z = 0, M$3.end.copy(x$3), M$3.end.z = 0;
|
|
30206
|
-
const Xe = M$3.closestPointToPointParameter($$
|
|
30206
|
+
const Xe = M$3.closestPointToPointParameter($$2, !0);
|
|
30207
30207
|
M$3.at(Xe, ne);
|
|
30208
|
-
const Ke = MathUtils.lerp(y.z, x$3.z, Xe), $e = Ke >= -1 && Ke <= 1, _e = $$
|
|
30208
|
+
const Ke = MathUtils.lerp(y.z, x$3.z, Xe), $e = Ke >= -1 && Ke <= 1, _e = $$2.distanceTo(ne) < L$2 * 0.5;
|
|
30209
30209
|
if ($e && _e) {
|
|
30210
30210
|
M$3.start.fromBufferAttribute(Yt, $t), M$3.end.fromBufferAttribute(vt, $t), M$3.start.applyMatrix4(Zt), M$3.end.applyMatrix4(Zt);
|
|
30211
30211
|
const Je = new Vector3(), Qe = new Vector3();
|
|
@@ -33852,7 +33852,7 @@ function wt(st, e) {
|
|
|
33852
33852
|
function Q(st) {
|
|
33853
33853
|
return isFinite(st) ? st : st < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
33854
33854
|
}
|
|
33855
|
-
function
|
|
33855
|
+
function $$1(st) {
|
|
33856
33856
|
return Math.abs(st) < Number.MAX_VALUE ? st : st * (1 / 0);
|
|
33857
33857
|
}
|
|
33858
33858
|
function rt(st, e, s, c, ct = 1 / 0, Zt) {
|
|
@@ -35306,7 +35306,7 @@ class Y extends fe {
|
|
|
35306
35306
|
*/
|
|
35307
35307
|
fromJSON(e, s = !1) {
|
|
35308
35308
|
const c = JSON.parse(e);
|
|
35309
|
-
this.enabled = c.enabled, this.minDistance = c.minDistance, this.maxDistance =
|
|
35309
|
+
this.enabled = c.enabled, this.minDistance = c.minDistance, this.maxDistance = $$1(c.maxDistance), this.minZoom = c.minZoom, this.maxZoom = $$1(c.maxZoom), this.minPolarAngle = c.minPolarAngle, this.maxPolarAngle = $$1(c.maxPolarAngle), this.minAzimuthAngle = $$1(c.minAzimuthAngle), this.maxAzimuthAngle = $$1(c.maxAzimuthAngle), this.smoothTime = c.smoothTime, this.draggingSmoothTime = c.draggingSmoothTime, this.dollySpeed = c.dollySpeed, this.truckSpeed = c.truckSpeed, this.dollyToCursor = c.dollyToCursor, this.verticalDragToForward = c.verticalDragToForward, this._target0.fromArray(c.target0), this._position0.fromArray(c.position0), this._zoom0 = c.zoom0, this._focalOffset0.fromArray(c.focalOffset0), this.moveTo(c.target[0], c.target[1], c.target[2], s), z.setFromVector3(
|
|
35310
35310
|
P$1.fromArray(c.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)
|
|
35311
35311
|
), this.rotateTo(z.theta, z.phi, s), this.dollyTo(z.radius, s), this.zoomTo(c.zoom, s), this.setFocalOffset(
|
|
35312
35312
|
c.focalOffset[0],
|
|
@@ -47761,7 +47761,7 @@ function o(st) {
|
|
|
47761
47761
|
}));
|
|
47762
47762
|
};
|
|
47763
47763
|
}
|
|
47764
|
-
class
|
|
47764
|
+
class ul {
|
|
47765
47765
|
constructor(e) {
|
|
47766
47766
|
this.pluginName = "draw", this.objMap = /* @__PURE__ */ new Map(), this.targetNullMap = /* @__PURE__ */ new Map(), this.objects = /* @__PURE__ */ new Map(), this.objectNamesToFactories = /* @__PURE__ */ new Map(), this.pickFunctionsMapIndex = -1, this.pickFunctionsMap = {}, this.pickListener = {
|
|
47767
47767
|
move: !1,
|
|
@@ -48052,7 +48052,7 @@ const k = (st) => {
|
|
|
48052
48052
|
);
|
|
48053
48053
|
}), e;
|
|
48054
48054
|
};
|
|
48055
|
-
class
|
|
48055
|
+
class sl {
|
|
48056
48056
|
constructor(e) {
|
|
48057
48057
|
this.pluginName = "worker", this.bufferGeometryLoader = new BufferGeometryLoader(), this.cacheObj = {}, this._dispose = !1, this.options = L({
|
|
48058
48058
|
dbName: "base",
|
|
@@ -48143,15 +48143,37 @@ class n extends Loader {
|
|
|
48143
48143
|
), Zt;
|
|
48144
48144
|
}
|
|
48145
48145
|
}
|
|
48146
|
-
|
|
48146
|
+
class q extends Loader {
|
|
48147
|
+
constructor(e) {
|
|
48148
|
+
super(e);
|
|
48149
|
+
}
|
|
48150
|
+
load(e, s, c, ct) {
|
|
48151
|
+
const Zt = new FileLoader(this.manager);
|
|
48152
|
+
Zt.setResponseType("blob"), Zt.setRequestHeader(this.requestHeader), Zt.setPath(this.path), Zt.setWithCredentials(this.withCredentials), Zt.load(
|
|
48153
|
+
e,
|
|
48154
|
+
(Wt) => {
|
|
48155
|
+
const Yt = Wt, vt = new DecompressionStream("gzip"), Tt = Yt.stream().pipeThrough(vt);
|
|
48156
|
+
new Response(Tt).json().then((Jt) => {
|
|
48157
|
+
s == null || s(Jt);
|
|
48158
|
+
}).catch((Jt) => {
|
|
48159
|
+
ct == null || ct(Jt);
|
|
48160
|
+
});
|
|
48161
|
+
},
|
|
48162
|
+
c,
|
|
48163
|
+
ct
|
|
48164
|
+
);
|
|
48165
|
+
}
|
|
48166
|
+
}
|
|
48167
|
+
const $ = {
|
|
48147
48168
|
images: ["png", "jpg", "jpeg", "ico", "webp", "avif"],
|
|
48148
48169
|
media: ["mp4", "webm", "ogg"],
|
|
48149
48170
|
gltf: ["gltf", "glb"],
|
|
48150
48171
|
json: ["json", "geojson"],
|
|
48172
|
+
gzipJson: ["json.gzip"],
|
|
48151
48173
|
exr: ["exr"],
|
|
48152
48174
|
lottie: ["lottie.json"]
|
|
48153
48175
|
};
|
|
48154
|
-
class
|
|
48176
|
+
class al {
|
|
48155
48177
|
constructor(e = {}) {
|
|
48156
48178
|
this.pluginName = "loader", this.loadObj = [], this.delLoadArr = [], this.assets = /* @__PURE__ */ new Map(), this.event = new P$2.EventEmitter(), this.options = {}, this.options = L({
|
|
48157
48179
|
simpleTexture4deleted: !1,
|
|
@@ -48191,8 +48213,10 @@ class sZ {
|
|
|
48191
48213
|
if (c) {
|
|
48192
48214
|
if (e.endsWith("lottie.json"))
|
|
48193
48215
|
return "lottie";
|
|
48216
|
+
if (e.endsWith("json.gzip"))
|
|
48217
|
+
return "gzipJson";
|
|
48194
48218
|
} else return;
|
|
48195
|
-
for (const [ct, Zt] of Object.entries(
|
|
48219
|
+
for (const [ct, Zt] of Object.entries($))
|
|
48196
48220
|
if (Zt.includes(c))
|
|
48197
48221
|
return ct;
|
|
48198
48222
|
}
|
|
@@ -48210,6 +48234,8 @@ class sZ {
|
|
|
48210
48234
|
return this.gltfLoader || (this.gltfLoader = new GLTFLoader(this.loadingManager), this.options.prefix && this.gltfLoader.setPath(this.options.prefix)), this.gltfLoader;
|
|
48211
48235
|
if (e === "lottie")
|
|
48212
48236
|
return this.lottieLoader || (this.lottieLoader = new LottieLoader(this.loadingManager), this.options.prefix && this.lottieLoader.setPath(this.options.prefix)), this.lottieLoader;
|
|
48237
|
+
if (e === "gzipJson")
|
|
48238
|
+
return this.gzipJsonLoader || (this.gzipJsonLoader = new q(this.loadingManager), this.options.prefix && this.gzipJsonLoader.setPath(this.options.prefix)), this.gzipJsonLoader;
|
|
48213
48239
|
if (e === "json")
|
|
48214
48240
|
return this.jsonLoader || (this.jsonLoader = new FileLoader(this.loadingManager), this.jsonLoader.setResponseType("json"), this.options.prefix && this.jsonLoader.setPath(this.options.prefix)), this.jsonLoader;
|
|
48215
48241
|
if (e === "exr")
|
|
@@ -50053,7 +50079,7 @@ class Base extends Event {
|
|
|
50053
50079
|
J0(this, "delLoadArr");
|
|
50054
50080
|
J0(this, "extendsOptions", {});
|
|
50055
50081
|
J0(this, "pencil");
|
|
50056
|
-
J0(this, "drawController", new
|
|
50082
|
+
J0(this, "drawController", new ul(objs$5));
|
|
50057
50083
|
J0(this, "mList");
|
|
50058
50084
|
J0(this, "loader");
|
|
50059
50085
|
J0(this, "worker");
|
|
@@ -50205,12 +50231,12 @@ class Base extends Event {
|
|
|
50205
50231
|
}));
|
|
50206
50232
|
}
|
|
50207
50233
|
initPencilPlugin() {
|
|
50208
|
-
this.mList = new MaterialList(), this.loader = new
|
|
50234
|
+
this.mList = new MaterialList(), this.loader = new al(mi({
|
|
50209
50235
|
prefix: this.options.assetsPrefix,
|
|
50210
50236
|
simpleTexture4deleted: !0
|
|
50211
50237
|
}, this.tier0 ? {
|
|
50212
50238
|
anisotropy: 1
|
|
50213
|
-
} : {})), this.worker = new
|
|
50239
|
+
} : {})), this.worker = new sl({
|
|
50214
50240
|
dbName: this.visName,
|
|
50215
50241
|
cacheVersion: version
|
|
50216
50242
|
}), this.delLoadArr && (this.loader.delLoadArr = this.delLoadArr), this.loader.on("progress", (...s) => {
|
|
@@ -51211,7 +51237,7 @@ const objs$4 = Bi(mi({}, objs$5), {
|
|
|
51211
51237
|
constructor() {
|
|
51212
51238
|
super(...arguments);
|
|
51213
51239
|
//@ts-ignore
|
|
51214
|
-
J0(this, "drawController", new
|
|
51240
|
+
J0(this, "drawController", new ul(objs$4));
|
|
51215
51241
|
J0(this, "mapHistory", []);
|
|
51216
51242
|
J0(this, "activePlaneMap", null);
|
|
51217
51243
|
J0(this, "isAnimating", !1);
|
|
@@ -53478,7 +53504,7 @@ class Map$1 extends Map$2 {
|
|
|
53478
53504
|
constructor() {
|
|
53479
53505
|
super(...arguments);
|
|
53480
53506
|
//@ts-ignore
|
|
53481
|
-
J0(this, "drawController", new
|
|
53507
|
+
J0(this, "drawController", new ul(objs$3));
|
|
53482
53508
|
J0(this, "initSettingsObj", {
|
|
53483
53509
|
label: !1,
|
|
53484
53510
|
labelLite: !1,
|
|
@@ -53881,7 +53907,7 @@ class City$1 extends Base {
|
|
|
53881
53907
|
constructor() {
|
|
53882
53908
|
super(...arguments);
|
|
53883
53909
|
//@ts-ignore
|
|
53884
|
-
J0(this, "drawController", new
|
|
53910
|
+
J0(this, "drawController", new ul(objs$2));
|
|
53885
53911
|
J0(this, "adcode", 0);
|
|
53886
53912
|
J0(this, "pcenter", [104, 37.5]);
|
|
53887
53913
|
J0(this, "pscale", 5e4);
|
|
@@ -53927,10 +53953,10 @@ class City$1 extends Base {
|
|
|
53927
53953
|
loaderAddJson(s) {
|
|
53928
53954
|
this.loader.add(
|
|
53929
53955
|
[
|
|
53930
|
-
this.options.showBuilding && `/
|
|
53931
|
-
this.options.showRoad && `/
|
|
53932
|
-
this.options.showRiver && `/
|
|
53933
|
-
this.options.showGrassland && `/
|
|
53956
|
+
this.options.showBuilding && `/cityGzip/Building${s}.json.gzip`,
|
|
53957
|
+
this.options.showRoad && `/cityGzip/Road${s}.json.gzip`,
|
|
53958
|
+
this.options.showRiver && `/cityGzip/River${s}.json.gzip`,
|
|
53959
|
+
this.options.showGrassland && `/cityGzip/Grassland${s}.json.gzip`
|
|
53934
53960
|
].filter(Boolean),
|
|
53935
53961
|
{
|
|
53936
53962
|
// cacheVersion: '1',
|
|
@@ -54075,7 +54101,11 @@ class City$1 extends Base {
|
|
|
54075
54101
|
}
|
|
54076
54102
|
initVis() {
|
|
54077
54103
|
return ii(this, null, function* () {
|
|
54078
|
-
const { fitTo: s, jsonName: c, bbox: ct, planeOut: Zt } = this.options, Wt = this.adcode, Yt = this.loader, vt = Yt.getAsset(
|
|
54104
|
+
const { fitTo: s, jsonName: c, bbox: ct, planeOut: Zt } = this.options, Wt = this.adcode, Yt = this.loader, vt = Yt.getAsset(
|
|
54105
|
+
`/cityGzip/Building${c}.json.gzip`
|
|
54106
|
+
), Tt = Yt.getAsset(`/cityGzip/Road${c}.json.gzip`), Jt = Yt.getAsset(`/cityGzip/River${c}.json.gzip`), $t = Yt.getAsset(
|
|
54107
|
+
`/cityGzip/Grassland${c}.json.gzip`
|
|
54108
|
+
), de = {};
|
|
54079
54109
|
[
|
|
54080
54110
|
...(Jt == null ? void 0 : Jt.features) || [],
|
|
54081
54111
|
...($t == null ? void 0 : $t.features) || []
|
|
@@ -54865,7 +54895,7 @@ const objs$1 = Bi(mi({}, objs$5), {
|
|
|
54865
54895
|
constructor() {
|
|
54866
54896
|
super(...arguments);
|
|
54867
54897
|
//@ts-ignore
|
|
54868
|
-
J0(this, "drawController", new
|
|
54898
|
+
J0(this, "drawController", new ul(objs$1));
|
|
54869
54899
|
J0(this, "leftTruck", !1);
|
|
54870
54900
|
J0(this, "extendsOptions", {
|
|
54871
54901
|
mapDepth: () => this.options.mapDepth
|
|
@@ -55112,7 +55142,7 @@ const objs = Bi(mi({}, objs$5), {
|
|
|
55112
55142
|
super(...arguments);
|
|
55113
55143
|
J0(this, "leftTruck", !1);
|
|
55114
55144
|
//@ts-ignore
|
|
55115
|
-
J0(this, "drawController", new
|
|
55145
|
+
J0(this, "drawController", new ul(objs));
|
|
55116
55146
|
J0(this, "autoRotateSpeed", 0);
|
|
55117
55147
|
J0(this, "initSettingsObj", {
|
|
55118
55148
|
autoRotate: !1
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.21.
|
|
1
|
+
declare const _default: "0.21.53";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vis-core",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.53",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "npm run version && PORT=5173 bundler-dev",
|
|
6
6
|
"build:site": "npm run version &&PUBLIC_EXCLUDE=public/city bundler",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"build:type": "BUILD_LIBRARY=src/sdk/index.ts bundler-type",
|
|
9
9
|
"preview": "bundler-preview",
|
|
10
10
|
"version": "node ./scripts/generate-version",
|
|
11
|
+
"gzip": "node ./scripts/gzip",
|
|
11
12
|
"getPublic": "node ./scripts/getPublic",
|
|
12
13
|
"start:3dSite": "npm run version && VITE_SITE_3D=true bundler-dev",
|
|
13
14
|
"build:3dSite": "npm run version && VITE_SITE_3D=true bundler",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"archiver": "^7.0.1",
|
|
44
45
|
"dayjs": "^1.11.12",
|
|
45
46
|
"eslint-config-bundler": "^0.4.2",
|
|
46
|
-
"esus": "^0.4.
|
|
47
|
+
"esus": "^0.4.40",
|
|
47
48
|
"fs-extra": "^11.1.1",
|
|
48
49
|
"idb-keyval": "^6.2.1",
|
|
49
50
|
"pinia": "^2.2.4",
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
"esus-lite": "^0.2.8",
|
|
67
68
|
"events": "^3.3.0",
|
|
68
69
|
"geojson-cn": "^0.1.29",
|
|
69
|
-
"gl-draw": "0.11.
|
|
70
|
+
"gl-draw": "0.11.35",
|
|
70
71
|
"jsrsasign": "^11.1.0",
|
|
71
72
|
"lodash-es": "^4.17.21"
|
|
72
73
|
},
|