vue-safe-force-graph 2.0.3 → 2.0.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.
|
@@ -51792,7 +51792,7 @@ const lSe = /* @__PURE__ */ Ht(BCe, [["render", ASe], ["__scopeId", "data-v-4d80
|
|
|
51792
51792
|
utime: "2019-05-06 15:08:10",
|
|
51793
51793
|
children: []
|
|
51794
51794
|
}
|
|
51795
|
-
], uSe = "vue-safe-force-graph", fSe = "2.0.
|
|
51795
|
+
], uSe = "vue-safe-force-graph", fSe = "2.0.4", 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
51796
|
"/lib/"
|
|
51797
51797
|
], ySe = {
|
|
51798
51798
|
".": {
|
|
@@ -52111,7 +52111,7 @@ const Ao = {}, USe = {
|
|
|
52111
52111
|
}
|
|
52112
52112
|
},
|
|
52113
52113
|
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);
|
|
52114
|
+
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
52115
|
},
|
|
52116
52116
|
mounted() {
|
|
52117
52117
|
return It(this, null, function* () {
|
|
@@ -52181,7 +52181,7 @@ const Ao = {}, USe = {
|
|
|
52181
52181
|
}
|
|
52182
52182
|
const e = this.stage.width() / (2 * ss), t = this.stage.height() / (2 * ss);
|
|
52183
52183
|
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);
|
|
52184
|
+
console.log("simulation end time", Date.now()), this.isThreatPath && this.centerAndZoom(1);
|
|
52185
52185
|
});
|
|
52186
52186
|
},
|
|
52187
52187
|
update() {
|
|
@@ -52201,7 +52201,7 @@ const Ao = {}, USe = {
|
|
|
52201
52201
|
const e = this.stage.width() / 2, t = this.stage.height() / 2, n = this.selection.map((r) => r.id);
|
|
52202
52202
|
this.nodes.forEach((r) => It(this, null, function* () {
|
|
52203
52203
|
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);
|
|
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);
|
|
52205
52205
|
Ar[r.id] && ((F = Ar[r.id]) == null || F.destroy());
|
|
52206
52206
|
const l = new jn.Group({
|
|
52207
52207
|
name: "nodeGroup",
|
|
@@ -52239,7 +52239,7 @@ const Ao = {}, USe = {
|
|
|
52239
52239
|
l.add(N), l.add(q), l.add(V);
|
|
52240
52240
|
const Z = (ie, Ae) => new jn.Animation(function(pe) {
|
|
52241
52241
|
const ve = pe.time, xe = 0.5 - 0.5 * (ve % Ae) / Ae, Ue = 40 * (ve % Ae) / Ae;
|
|
52242
|
-
ie.radius(Ue), ie.opacity(xe);
|
|
52242
|
+
ie.radius(Ue || 0), ie.opacity(xe);
|
|
52243
52243
|
}, this.layer), J = Z(N, 1500), Y = Z(q, 1500), K = Z(V, 1500);
|
|
52244
52244
|
J.start(), setTimeout(function() {
|
|
52245
52245
|
Y.start();
|
|
@@ -52259,7 +52259,7 @@ const Ao = {}, USe = {
|
|
|
52259
52259
|
l.add(M);
|
|
52260
52260
|
}
|
|
52261
52261
|
if (A) {
|
|
52262
|
-
const M = a ? 20 : o, N = A && new jn.Image({
|
|
52262
|
+
const M = (a ? 20 : o) || 24, N = A && new jn.Image({
|
|
52263
52263
|
x: 0,
|
|
52264
52264
|
y: 0,
|
|
52265
52265
|
offsetX: M / 2,
|
|
@@ -52455,7 +52455,7 @@ const Ao = {}, USe = {
|
|
|
52455
52455
|
for (let n = 0; n < this.links.length; n++) {
|
|
52456
52456
|
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
52457
|
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.
|
|
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.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
52459
|
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
52460
|
e = !1;
|
|
52461
52461
|
break;
|
|
@@ -52463,7 +52463,7 @@ const Ao = {}, USe = {
|
|
|
52463
52463
|
s == null || s.points([l, c, u, f]);
|
|
52464
52464
|
const _ = c4(l, c, u, f, T4);
|
|
52465
52465
|
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);
|
|
52466
|
+
A.x((l + u) / 2), A.y((c + f) / 2), A.offsetX(A.getWidth() / 2 || 0), A.offsetY(A.getHeight() / 2 + 8 || 0);
|
|
52467
52467
|
const C = Math.atan2(f - c, u - l) * (180 / Math.PI);
|
|
52468
52468
|
u < l ? A.rotation(C + 180) : A.rotation(C);
|
|
52469
52469
|
}
|