@kortexya/nodus 0.1.2 → 0.1.4

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.
@@ -8677,6 +8677,15 @@ var lc = class extends B {
8677
8677
  return t.setData(n, s), t.setData(r, u), t.setAttributes(c);
8678
8678
  }).then(() => this._nodus.modules.geo._updateNodesCoordinates(t)).then(() => l);
8679
8679
  };
8680
+ setNodeGeoCoordinates(e, t) {
8681
+ if (!e || !e._indexes || !e._indexes.length) return Promise.resolve(e);
8682
+ let { latitudePath: n, longitudePath: r } = this._settings, i = t || [], a = Array(e._indexes.length), o = Array(e._indexes.length);
8683
+ for (let t = 0; t < e._indexes.length; t++) {
8684
+ let e = i[t] || {};
8685
+ a[t] = e.latitude, o[t] = e.longitude;
8686
+ }
8687
+ return e.setData(n, a), e.setData(r, o), this._updateNodesCoordinates(e), Promise.resolve(e);
8688
+ }
8680
8689
  onMounted() {
8681
8690
  this._modules.events.register([
8682
8691
  "geoEnabled",
@@ -8687,16 +8696,16 @@ var lc = class extends B {
8687
8696
  "geoReady"
8688
8697
  ]), js() && (this.L = Ms("L") || Ms("leaflet"), this.L && qs(this.L)), this._modules.graph.createNodeAttribute({
8689
8698
  name: "geo.prevLat",
8690
- storage: "float"
8699
+ storage: "float64"
8691
8700
  }, !0), this._modules.graph.createNodeAttribute({
8692
8701
  name: Cs,
8693
- storage: "float"
8702
+ storage: "float64"
8694
8703
  }, !0), this._modules.graph.createNodeAttribute({
8695
8704
  name: bs,
8696
- storage: "float"
8705
+ storage: "float64"
8697
8706
  }, !0), this._modules.graph.createNodeAttribute({
8698
8707
  name: xs,
8699
- storage: "float"
8708
+ storage: "float64"
8700
8709
  }, !0), this._modules.events.register(["beforeGeoCameraMove"]), this._modules.events.on("addNodes", (e) => {
8701
8710
  e.virtual || this._refreshOrAddNodes(e.nodes, !0);
8702
8711
  }).on("updateNodeData", (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kortexya/nodus",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Nodus — a high-performance graph visualization engine (WebGL/WebGPU/Canvas/SVG).",
5
5
  "homepage": "https://kortexya.com",
6
6
  "author": "Kortexya <david.loiret@kortexya.com>",
@@ -41,6 +41,15 @@ export declare class Geo extends Module {
41
41
  longitude: number;
42
42
  };
43
43
  }) => Promise<any[]>;
44
+ /**
45
+ * Set geographic coordinates on a list of nodes. `coords[i]` is
46
+ * `{ latitude, longitude }` for `nodes.get(i)`. The values are written to each
47
+ * node's data at the configured latitude/longitude paths, then projected into
48
+ * the internal geo.lat/geo.lng arrays (and re-rendered if geo mode is on).
49
+ * Backs the public `node.setGeoCoordinates()` / `nodeList.setGeoCoordinates()`
50
+ * and the in-map node-drag handler.
51
+ */
52
+ setNodeGeoCoordinates(nodes: any, coords: any[]): Promise<any>;
44
53
  onMounted(): void;
45
54
  private _onDataChange;
46
55
  private _refreshOrAddNodes;