vis-core 0.13.0 → 0.13.1

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.
@@ -41145,7 +41145,7 @@ function Bl(n) {
41145
41145
  const t = new qt();
41146
41146
  return t.color.setScalar(n), t;
41147
41147
  }
41148
- const pX = "0.13.0", a1 = !1;
41148
+ const pX = "0.13.1", a1 = !1;
41149
41149
  class Na {
41150
41150
  constructor(t, e = {}) {
41151
41151
  D(this, "container");
@@ -41666,51 +41666,57 @@ class bX extends ye {
41666
41666
  }
41667
41667
  addPlane(e, i) {
41668
41668
  return Zt(this, null, function* () {
41669
- var d;
41670
- const { material: s } = i, l = this.geojson2Meta(e), a = this.pencil.getPlugin("worker"), o = this.pencil.getPlugin("draw"), c = (d = i.curvatureResolution) != null ? d : this.options.curvatureResolution;
41671
- return yield Promise.all(
41672
- l.map((h) => Zt(this, null, function* () {
41673
- const { coords: r, properties: u } = h, m = this.findGroup(this.getPropertiesKey(u)), b = yield a.geoGeometry(
41674
- c ? "conicPolygon" : "extrudePolygon",
41675
- {
41676
- mesaage: {
41677
- coordinatesArr: r,
41678
- projection: this.options.projection,
41679
- curvatureResolution: c,
41680
- depth: [0],
41681
- hasBottom: !1,
41682
- hasSide: !1,
41683
- useGroups: 0
41684
- }
41685
- }
41686
- ), G = yield o.draw(
41687
- this.options.curvatureResolution ? "ConicPolygon" : "ExtrudePolygon",
41688
- {
41689
- geometry: b,
41690
- material: s,
41691
- onTop: this.options.onTop
41692
- },
41693
- m
41694
- );
41695
- G.userData = Et({}, u), G.position.z = this.options.depth + 0.01;
41696
- const Z = yield a.geoGeometry("line", {
41669
+ var G;
41670
+ const { material: s } = i, l = this.geojson2Meta({
41671
+ type: "FeatureCollection",
41672
+ features: [e]
41673
+ }), a = this.pencil.getPlugin("worker"), o = this.pencil.getPlugin("draw"), c = (G = i.curvatureResolution) != null ? G : this.options.curvatureResolution, { coords: d, properties: h } = l[0], r = this.findGroup(this.getPropertiesKey(h)), u = yield o.draw("Group", {
41674
+ target: r
41675
+ });
41676
+ u.userData = Et({}, h);
41677
+ const [m, b] = yield Promise.all([
41678
+ a.geoGeometry(
41679
+ c ? "conicPolygon" : "extrudePolygon",
41680
+ {
41697
41681
  mesaage: {
41698
- coordinatesArr: r,
41699
- lineWidth: [1],
41700
- projection: this.options.projection
41682
+ coordinatesArr: d,
41683
+ projection: this.options.projection,
41684
+ curvatureResolution: c,
41685
+ depth: [0],
41686
+ hasBottom: !1,
41687
+ hasSide: !1,
41688
+ useGroups: 0
41701
41689
  }
41702
- }), p = yield o.draw(
41703
- "Line",
41704
- {
41705
- geometry: Z,
41706
- material: i.lineMaterial,
41707
- onTop: this.options.onTop + 2
41708
- },
41709
- m
41710
- );
41711
- p.userData = Et({}, u), p.position.z = this.options.depth + 0.01;
41712
- }))
41713
- );
41690
+ }
41691
+ ),
41692
+ a.geoGeometry("line", {
41693
+ mesaage: {
41694
+ coordinatesArr: d,
41695
+ lineWidth: [1],
41696
+ projection: this.options.projection
41697
+ }
41698
+ })
41699
+ ]);
41700
+ return yield Promise.all([
41701
+ o.draw(
41702
+ this.options.curvatureResolution ? "ConicPolygon" : "ExtrudePolygon",
41703
+ {
41704
+ geometry: m,
41705
+ material: s,
41706
+ onTop: this.options.onTop
41707
+ },
41708
+ u
41709
+ ),
41710
+ o.draw(
41711
+ "Line",
41712
+ {
41713
+ geometry: b,
41714
+ material: i.lineMaterial,
41715
+ onTop: this.options.onTop + 2
41716
+ },
41717
+ u
41718
+ )
41719
+ ]), u.position.z = this.options.depth + 0.01, u;
41714
41720
  });
41715
41721
  }
41716
41722
  addLine(e, i) {
@@ -42117,6 +42123,10 @@ const jI = {
42117
42123
  var e;
42118
42124
  return (e = this.map) == null ? void 0 : e.areaArr;
42119
42125
  }
42126
+ get mapLine() {
42127
+ var e;
42128
+ return (e = this.map) == null ? void 0 : e.lineArr;
42129
+ }
42120
42130
  get adcodes() {
42121
42131
  return this.mapHistory.map((e) => e.mapInfo.adcode);
42122
42132
  }
@@ -42170,7 +42180,7 @@ const jI = {
42170
42180
  });
42171
42181
  const i = yield this.drawController.draw("Light", {
42172
42182
  type: "SpotLight",
42173
- color: "#c1e6dd",
42183
+ color: this.options.worldPacificCentre ? "#82d9f2" : "#c1e6dd",
42174
42184
  intensity: 3,
42175
42185
  distance: 0,
42176
42186
  angle: this.options.continentsBg ? 1 : 0.5,
@@ -42287,30 +42297,28 @@ const jI = {
42287
42297
  var s;
42288
42298
  (s = this.map) == null || s.setColor(e, i);
42289
42299
  }
42290
- addAreaPlaneByProperty(e, i, s = {}) {
42291
- var o, c, d;
42292
- if (!this.map)
42293
- return;
42294
- const a = this.map.options.geojson.features.find(
42295
- (h) => h.properties && h.properties[e] === i
42296
- );
42297
- a && this.map.addPlane(
42298
- {
42299
- features: [a]
42300
- },
42301
- {
42302
- material: (o = s.material) != null ? o : new qt({
42303
- color: "red",
42304
- wireframe: !0
42305
- }),
42306
- lineMaterial: (c = s.lineMaterial) != null ? c : new Fe({
42307
- color: new rt("blue"),
42308
- sizeAttenuation: 0,
42309
- lineWidth: this.options.lineWidth
42310
- }),
42311
- curvatureResolution: (d = s.curvatureResolution) != null ? d : 0
42312
- }
42313
- );
42300
+ addAreaPlaneByProperty(l, a) {
42301
+ return Zt(this, arguments, function* (e, i, s = {}) {
42302
+ var d, h, r;
42303
+ if (!this.map)
42304
+ return;
42305
+ const c = this.map.options.geojson.features.find(
42306
+ (u) => u.properties && u.properties[e] === i
42307
+ );
42308
+ if (c)
42309
+ return yield this.map.addPlane(c, {
42310
+ material: (d = s.material) != null ? d : new qt({
42311
+ color: "red",
42312
+ wireframe: !0
42313
+ }),
42314
+ lineMaterial: (h = s.lineMaterial) != null ? h : new Fe({
42315
+ color: new rt("blue"),
42316
+ sizeAttenuation: 0,
42317
+ lineWidth: this.options.lineWidth
42318
+ }),
42319
+ curvatureResolution: (r = s.curvatureResolution) != null ? r : 0
42320
+ });
42321
+ });
42314
42322
  }
42315
42323
  show() {
42316
42324
  return Zt(this, null, function* () {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.13.0";
1
+ declare const _default: "0.13.1";
2
2
  export default _default;
@@ -79,6 +79,7 @@ export default class extends Base {
79
79
  get map(): PlaneMap | undefined;
80
80
  get mapInfo(): any;
81
81
  get mapArea(): import("gl-draw/dist/objects").ExtrudePolygon[] | undefined;
82
+ get mapLine(): import("gl-draw/dist/objects").Line[] | undefined;
82
83
  get adcodes(): any[];
83
84
  activePlaneMap: PlaneMap | null;
84
85
  isAnimating: boolean;
@@ -107,7 +108,7 @@ export default class extends Base {
107
108
  material?: THREE.Material;
108
109
  lineMaterial?: MeshLineMaterial;
109
110
  curvatureResolution?: number;
110
- }): void;
111
+ }): Promise<Group | undefined>;
111
112
  show(): Promise<void>;
112
113
  hide(): Promise<void>;
113
114
  shadowMapLight?: BaseObject;
@@ -1,7 +1,7 @@
1
1
  import { BaseObject } from 'gl-draw';
2
2
  import * as THREE from 'three';
3
3
  import { Line, ExtrudePolygon, MeshLineMaterial, Group } from 'gl-draw/dist/objects';
4
- import type { FeatureCollection, Polygon, MultiPolygon, Position } from 'geojson';
4
+ import type { FeatureCollection, Polygon, MultiPolygon, Position, Feature, GeoJsonProperties } from 'geojson';
5
5
  type GeoJSON = FeatureCollection<Polygon | MultiPolygon>;
6
6
  interface Options {
7
7
  areaGroup?: boolean;
@@ -50,11 +50,11 @@ export default class PlaneMap extends BaseObject {
50
50
  onTop?: number;
51
51
  }): Promise<ExtrudePolygon[]>;
52
52
  getPropertiesKey(properties: Record<string, any>): any;
53
- addPlane(geojson: any, options: {
53
+ addPlane(geojson: Feature<Polygon | MultiPolygon, GeoJsonProperties>, options: {
54
54
  material: THREE.Material | THREE.Material[];
55
55
  lineMaterial: MeshLineMaterial;
56
56
  curvatureResolution?: number;
57
- }): Promise<void[]>;
57
+ }): Promise<Group>;
58
58
  addLine(geojson: GeoJSON, options: {
59
59
  material?: MeshLineMaterial;
60
60
  onTop?: number;
@@ -62,7 +62,7 @@ export default class PlaneMap extends BaseObject {
62
62
  }): Promise<Line[]>;
63
63
  geojson2Meta(geojson: GeoJSON): {
64
64
  coords: Position[][];
65
- properties: import("geojson").GeoJsonProperties;
65
+ properties: GeoJsonProperties;
66
66
  }[];
67
67
  pickArea(e: MouseEvent): import("gl-draw/dist/core/BaseObject").IBaseObject | undefined;
68
68
  update(delta: number, elapsed: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
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",