vue-safe-force-graph 2.0.3 → 2.0.5

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.
@@ -31764,6 +31764,9 @@ const Q1e = {
31764
31764
  t && (e = !(Object.values(t).filter((r) => r === !1).length > 0));
31765
31765
  }
31766
31766
  return !e;
31767
+ },
31768
+ nodesLength() {
31769
+ return this.data.nodes.filter((e) => e.type !== "nodeType").length;
31767
31770
  }
31768
31771
  },
31769
31772
  watch: {
@@ -32206,7 +32209,7 @@ const Q1e = {
32206
32209
  }, N1e = {
32207
32210
  key: 1,
32208
32211
  class: "relation-title"
32209
- }, L1e = /* @__PURE__ */ W("h3", { class: "title-top" }, "关联列表", -1), O1e = {
32212
+ }, L1e = { class: "title-top" }, O1e = {
32210
32213
  key: 0,
32211
32214
  class: "extent-icon"
32212
32215
  }, D1e = {
@@ -32237,7 +32240,7 @@ function K1e(e, t, n, r, o, s) {
32237
32240
  }, null, 8, ["modelValue"])
32238
32241
  ])) : me("", !0),
32239
32242
  o.rootNode.type !== "nodeType" && !o.isAggregation ? (j(), oe("div", N1e, [
32240
- L1e,
32243
+ W("h3", L1e, "关联列表(共" + De(s.nodesLength) + "个节点)", 1),
32241
32244
  s.showAllExtent ? (j(), oe("div", O1e, [
32242
32245
  (j(!0), oe(vt, null, Jt(o.allOptions, (f, d) => (j(), oe("div", { key: d }, [
32243
32246
  f.namec === "拓线全部" ? (j(), Qe(l, {
@@ -51792,7 +51795,7 @@ const lSe = /* @__PURE__ */ Ht(BCe, [["render", ASe], ["__scopeId", "data-v-4d80
51792
51795
  utime: "2019-05-06 15:08:10",
51793
51796
  children: []
51794
51797
  }
51795
- ], uSe = "vue-safe-force-graph", fSe = "2.0.3", dSe = "force_graph in security area", hSe = "jason zhang", gSe = "./lib/vue-safe-force-graph.js", pSe = "./lib/vue-safe-force-graph.umd.cjs", mSe = "module", vSe = [
51798
+ ], uSe = "vue-safe-force-graph", fSe = "2.0.5", dSe = "force_graph in security area", hSe = "jason zhang", gSe = "./lib/vue-safe-force-graph.js", pSe = "./lib/vue-safe-force-graph.umd.cjs", mSe = "module", vSe = [
51796
51799
  "/lib/"
51797
51800
  ], ySe = {
51798
51801
  ".": {
@@ -52111,7 +52114,7 @@ const Ao = {}, USe = {
52111
52114
  }
52112
52115
  },
52113
52116
  created() {
52114
- na.setProject("QH_10542_1724").getTrack().getClickAndKeydown(), localStorage.getItem("showSafeForceGraphLog") && (eA("组件名称: " + xS.name), eA("组件版本: " + xS.version), eA("环境变量")), this.isThreatPath || this.initKeyEvent(), this.uniqueClass = "unique" + (/* @__PURE__ */ new Date()).getTime() + Math.floor(Math.random() * 1e5);
52117
+ console.log("graph created time", Date.now()), na.setProject("QH_10542_1724").getTrack().getClickAndKeydown(), localStorage.getItem("showSafeForceGraphLog") && (eA("组件名称: " + xS.name), eA("组件版本: " + xS.version), eA("环境变量")), this.isThreatPath || this.initKeyEvent(), this.uniqueClass = "unique" + (/* @__PURE__ */ new Date()).getTime() + Math.floor(Math.random() * 1e5);
52115
52118
  },
52116
52119
  mounted() {
52117
52120
  return It(this, null, function* () {
@@ -52181,7 +52184,7 @@ const Ao = {}, USe = {
52181
52184
  }
52182
52185
  const e = this.stage.width() / (2 * ss), t = this.stage.height() / (2 * ss);
52183
52186
  this.simulation = XU(this.nodes).force("link", YU(this.links).id((r) => r.id).distance(120).strength(1)).force("charge", JU().strength(-600)).force("x", ZU()).force("y", eT()).force("center", Db(e, t)).on("tick", this.ticked), this.simulation.alphaDecay = this.alphaDecay * 1, this.simulation.alphaMin = this.alphaMin * 1, this.simulation.on("end", () => {
52184
- console.log("simulation end"), this.isThreatPath && this.centerAndZoom(1);
52187
+ console.log("simulation end time", Date.now()), this.isThreatPath && this.centerAndZoom(1);
52185
52188
  });
52186
52189
  },
52187
52190
  update() {
@@ -52201,7 +52204,7 @@ const Ao = {}, USe = {
52201
52204
  const e = this.stage.width() / 2, t = this.stage.height() / 2, n = this.selection.map((r) => r.id);
52202
52205
  this.nodes.forEach((r) => It(this, null, function* () {
52203
52206
  var p, v, y, x, _, C, F, U, I, k, G, L, R, O;
52204
- const o = r.type === "nodeType" ? this.iconSizeComputed[r.icon] || this.iconSizeComputed.node_type : this.iconSizeComputed[r.type] || 24, s = (y = (v = (p = r == null ? void 0 : r.detail) == null ? void 0 : p.info) == null ? void 0 : v.basic) == null ? void 0 : y.level, a = (C = (_ = (x = r == null ? void 0 : r.detail) == null ? void 0 : x.info) == null ? void 0 : _.basic) == null ? void 0 : C.flag, A = yield this.getNodeImage(r);
52207
+ const o = (r.type === "nodeType" ? this.iconSizeComputed[r.icon] || this.iconSizeComputed.node_type : this.iconSizeComputed[r.type]) || 24, s = (y = (v = (p = r == null ? void 0 : r.detail) == null ? void 0 : p.info) == null ? void 0 : v.basic) == null ? void 0 : y.level, a = (C = (_ = (x = r == null ? void 0 : r.detail) == null ? void 0 : x.info) == null ? void 0 : _.basic) == null ? void 0 : C.flag, A = yield this.getNodeImage(r);
52205
52208
  Ar[r.id] && ((F = Ar[r.id]) == null || F.destroy());
52206
52209
  const l = new jn.Group({
52207
52210
  name: "nodeGroup",
@@ -52239,7 +52242,7 @@ const Ao = {}, USe = {
52239
52242
  l.add(N), l.add(q), l.add(V);
52240
52243
  const Z = (ie, Ae) => new jn.Animation(function(pe) {
52241
52244
  const ve = pe.time, xe = 0.5 - 0.5 * (ve % Ae) / Ae, Ue = 40 * (ve % Ae) / Ae;
52242
- ie.radius(Ue), ie.opacity(xe);
52245
+ ie.radius(Ue || 0), ie.opacity(xe);
52243
52246
  }, this.layer), J = Z(N, 1500), Y = Z(q, 1500), K = Z(V, 1500);
52244
52247
  J.start(), setTimeout(function() {
52245
52248
  Y.start();
@@ -52259,7 +52262,7 @@ const Ao = {}, USe = {
52259
52262
  l.add(M);
52260
52263
  }
52261
52264
  if (A) {
52262
- const M = a ? 20 : o, N = A && new jn.Image({
52265
+ const M = (a ? 20 : o) || 24, N = A && new jn.Image({
52263
52266
  x: 0,
52264
52267
  y: 0,
52265
52268
  offsetX: M / 2,
@@ -52455,7 +52458,7 @@ const Ao = {}, USe = {
52455
52458
  for (let n = 0; n < this.links.length; n++) {
52456
52459
  const r = this.links[n], o = Ci[`${r.source.id}-${r.target.id}`], s = o == null ? void 0 : o.findOne(".konvaLine"), a = o == null ? void 0 : o.findOne(".linkArrow"), A = o == null ? void 0 : o.findOne(".edgeLabel");
52457
52460
  let l = r.source.x, c = r.source.y, u = r.target.x, f = r.target.y;
52458
- const d = u - l || 1, h = f - c || 1, g = Math.sqrt(d * d + h * h), p = d / g || 1, v = h / g || 1, y = r.source.type === "nodeType" ? (this.iconSizeComputed[r.source.icon] || 14) / 2 - 1 : this.iconSizeComputed[r.source.type] / 2 - 1, x = r.target.type === "nodeType" ? (this.iconSizeComputed[r.target.icon] || 14) / 2 - 1 : (this.iconSizeComputed[r.target.type] || 14) / 2 - 1;
52461
+ const d = u - l || 1, h = f - c || 1, g = Math.sqrt(d * d + h * h), p = d / g || 1, v = h / g || 1, y = r.source.type === "nodeType" ? (this.iconSizeComputed[r.source.icon] || 14) / 2 - 1 : (this.iconSizeComputed[r.target.type] || 14) / 2 - 1, x = r.target.type === "nodeType" ? (this.iconSizeComputed[r.target.icon] || 14) / 2 - 1 : (this.iconSizeComputed[r.target.type] || 14) / 2 - 1;
52459
52462
  if (l = l + y * p, c = c + y * v, u = u - x * p, f = f - x * v, isNaN(l) || isNaN(c) || isNaN(u) || isNaN(f)) {
52460
52463
  e = !1;
52461
52464
  break;
@@ -52463,7 +52466,7 @@ const Ao = {}, USe = {
52463
52466
  s == null || s.points([l, c, u, f]);
52464
52467
  const _ = c4(l, c, u, f, T4);
52465
52468
  if (a == null || a.x((_ == null ? void 0 : _.x) || 0), a == null || a.y((_ == null ? void 0 : _.y) || 0), a == null || a.rotation(Math.atan2(f - c, u - l) * (180 / Math.PI)), A) {
52466
- A.x((l + u) / 2), A.y((c + f) / 2), A.offsetX(A.getWidth() / 2), A.offsetY(A.getHeight() / 2 + 8);
52469
+ A.x((l + u) / 2), A.y((c + f) / 2), A.offsetX(A.getWidth() / 2 || 0), A.offsetY(A.getHeight() / 2 + 8 || 0);
52467
52470
  const C = Math.atan2(f - c, u - l) * (180 / Math.PI);
52468
52471
  u < l ? A.rotation(C + 180) : A.rotation(C);
52469
52472
  }