vue-safe-force-graph 2.0.75 → 2.0.77

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.
@@ -27867,23 +27867,23 @@ const KG = {
27867
27867
  },
27868
27868
  svgToUrl() {
27869
27869
  return ze(this, null, function* () {
27870
- this.$parent.centerAndZoom(), this.$parent.addCanvasBg();
27870
+ this.$parent.centerAndZoom();
27871
27871
  const t = this.$parent.getCanvasStage().toDataURL({
27872
27872
  mimeType: "image/png"
27873
27873
  });
27874
- return this.$parent.removeCanvasBg(), this.$parent.reset(), t;
27874
+ return this.$parent.reset(), t;
27875
27875
  });
27876
27876
  },
27877
27877
  svgToBlob() {
27878
27878
  return ze(this, null, function* () {
27879
- this.$parent.centerAndZoom(), this.$parent.addCanvasBg();
27879
+ this.$parent.centerAndZoom();
27880
27880
  const e = this.$parent.getCanvasStage();
27881
27881
  e.find("Image").forEach((n) => {
27882
27882
  const r = n.image();
27883
27883
  r && (r.crossOrigin = "Anonymous");
27884
27884
  });
27885
27885
  const t = yield e.toBlob();
27886
- return this.$parent.removeCanvasBg(), this.$parent.reset(), t;
27886
+ return this.$parent.reset(), t;
27887
27887
  });
27888
27888
  },
27889
27889
  deleteNodes() {
@@ -38385,7 +38385,7 @@ const qoe = /* @__PURE__ */ Xt(ooe, [["render", Voe], ["__scopeId", "data-v-194a
38385
38385
  utime: "2019-05-06 15:08:10",
38386
38386
  children: []
38387
38387
  }
38388
- ], zoe = "vue-safe-force-graph", Hoe = "2.0.75", Goe = "force_graph in security area", Woe = "jason zhang", Koe = "./lib/vue-safe-force-graph.js", Yoe = "./lib/vue-safe-force-graph.umd.cjs", Joe = "module", Xoe = [
38388
+ ], zoe = "vue-safe-force-graph", Hoe = "2.0.77", Goe = "force_graph in security area", Woe = "jason zhang", Koe = "./lib/vue-safe-force-graph.js", Yoe = "./lib/vue-safe-force-graph.umd.cjs", Joe = "module", Xoe = [
38389
38389
  "/lib/"
38390
38390
  ], Qoe = {
38391
38391
  ".": {
@@ -38616,6 +38616,14 @@ const { toClipboard: sae } = Wd(), oae = "Arial,Helvetica Neue,Helvetica,PingFan
38616
38616
  type: Object,
38617
38617
  default: () => {
38618
38618
  }
38619
+ },
38620
+ enablePopover: {
38621
+ type: Boolean,
38622
+ default: !0
38623
+ },
38624
+ canvasBg: {
38625
+ type: String,
38626
+ default: "transparent"
38619
38627
  }
38620
38628
  },
38621
38629
  emits: [
@@ -38797,7 +38805,7 @@ const { toClipboard: sae } = Wd(), oae = "Arial,Helvetica Neue,Helvetica,PingFan
38797
38805
  id: "grab",
38798
38806
  x: 0,
38799
38807
  y: 0
38800
- }), this.layer.add(this.grab);
38808
+ }), this.layer.add(this.grab), this.addCanvasBg();
38801
38809
  const r = this.layer.getCanvas()._canvas;
38802
38810
  this.canvasElement = r, this.stage.on("mousemove", (s) => {
38803
38811
  if (!this.mousedownNode || !s.evt[this.actKey]) {
@@ -38878,7 +38886,7 @@ const { toClipboard: sae } = Wd(), oae = "Arial,Helvetica Neue,Helvetica,PingFan
38878
38886
  id: "grab",
38879
38887
  x: 0,
38880
38888
  y: 0
38881
- }), this.layer.add(this.grab);
38889
+ }), this.layer.add(this.grab), this.addCanvasBg();
38882
38890
  },
38883
38891
  paintNodes() {
38884
38892
  const e = this.stage.width() / 2, t = this.stage.height() / 2, n = this.selection.map((r) => r.id);
@@ -40124,16 +40132,15 @@ const { toClipboard: sae } = Wd(), oae = "Arial,Helvetica Neue,Helvetica,PingFan
40124
40132
  });
40125
40133
  },
40126
40134
  addCanvasBg() {
40127
- this.darkMode && (this.darkBgRect = new Et.Rect({
40135
+ this.darkBgRect = new Et.Rect({
40128
40136
  x: 0,
40129
40137
  y: 0,
40130
40138
  width: this.stage.width() / this.scale,
40131
40139
  height: this.stage.height() / this.scale,
40132
- fill: "#021212",
40133
- stroke: "#021212",
40140
+ fill: this.canvasBg,
40134
40141
  listening: !1,
40135
40142
  draggable: !1
40136
- }), this.layer.add(this.darkBgRect), this.darkBgRect.moveToBottom(), this.stage.draw());
40143
+ }), this.layer.add(this.darkBgRect), this.darkBgRect.moveToBottom(), this.stage.draw();
40137
40144
  },
40138
40145
  removeCanvasBg() {
40139
40146
  this.darkBgRect && this.darkBgRect.destroy(), this.darkBgRect = null, this.stage.draw();
@@ -40157,7 +40164,8 @@ function dae(e, t, n, r, s, o) {
40157
40164
  ])), [
40158
40165
  [c, s.ticking]
40159
40166
  ]),
40160
- ne(a, {
40167
+ n.enablePopover ? (O(), he(a, {
40168
+ key: 0,
40161
40169
  "dark-mode": n.darkMode,
40162
40170
  "show-popover": s.showPopover && !s.isDragging,
40163
40171
  "mouse-position": s.hoverNodePosition,
@@ -40167,9 +40175,9 @@ function dae(e, t, n, r, s, o) {
40167
40175
  "custom-tooltip": n.customTooltip,
40168
40176
  history: n.history,
40169
40177
  data: n.history.dataNow
40170
- }, null, 8, ["dark-mode", "show-popover", "mouse-position", "node-info", "module-detail", "type", "custom-tooltip", "history", "data"]),
40178
+ }, null, 8, ["dark-mode", "show-popover", "mouse-position", "node-info", "module-detail", "type", "custom-tooltip", "history", "data"])) : re("", !0),
40171
40179
  n.isThreatPath ? re("", !0) : (O(), he(l, {
40172
- key: 0,
40180
+ key: 1,
40173
40181
  show: o.showContextMenuFlag,
40174
40182
  axis: s.mousePosition,
40175
40183
  "node-info": o.contextMenuNodes,
@@ -40670,6 +40678,14 @@ const Nae = {
40670
40678
  type: Boolean,
40671
40679
  default: !0
40672
40680
  },
40681
+ enablePopover: {
40682
+ type: Boolean,
40683
+ default: !0
40684
+ },
40685
+ canvasBg: {
40686
+ type: String,
40687
+ default: "transparent"
40688
+ },
40673
40689
  // 需要隐藏的顶部按钮。
40674
40690
  hideButtonList: {
40675
40691
  type: Array,
@@ -40942,7 +40958,7 @@ const Nae = {
40942
40958
  },
40943
40959
  mounted() {
40944
40960
  return ze(this, null, function* () {
40945
- console.log('"2024/11/19 14:43:09"', "2024/11/19 14:43:09"), this.initializeGraphApi(), window.onresize = () => {
40961
+ console.log('"2024/11/19 19:21:53"', "2024/11/19 19:21:53"), this.initializeGraphApi(), window.onresize = () => {
40946
40962
  this.fullScreen = !!document.fullscreenElement, this.screenHeight = document.body.clientHeight;
40947
40963
  }, this.margin = this.changeMargin(), ps(nt, "emitDataLoaded", () => {
40948
40964
  this.emitDataLoaded();
@@ -41644,11 +41660,13 @@ function Mae(e, t, n, r, s, o) {
41644
41660
  "custom-tooltip": n.customTooltip,
41645
41661
  "edge-label-max-length": n.edgeLabelMaxLength,
41646
41662
  "custom-node-images": n.customNodeImages,
41663
+ "enable-popover": n.enablePopover,
41664
+ "canvas-bg": n.canvasBg,
41647
41665
  onUpdateSelection: o.updateSelection,
41648
41666
  onOnaction: o.onAction,
41649
41667
  onHandleSelectNode: o.handleSelectNode,
41650
41668
  onCustomContextmenuClick: o.handleCustomContextMenuClick
41651
- }, null, 8, ["enable-script", "module-detail", "history", "level-list", "selection", "data", "request-graph-data", "dark-mode", "node-type-scale", "node-type-list", "link-distance", "strength", "node-width", "start-node-width", "start-node-animation", "custom-tooltip", "edge-label-max-length", "custom-node-images", "onUpdateSelection", "onOnaction", "onHandleSelectNode", "onCustomContextmenuClick"]),
41669
+ }, null, 8, ["enable-script", "module-detail", "history", "level-list", "selection", "data", "request-graph-data", "dark-mode", "node-type-scale", "node-type-list", "link-distance", "strength", "node-width", "start-node-width", "start-node-animation", "custom-tooltip", "edge-label-max-length", "custom-node-images", "enable-popover", "canvas-bg", "onUpdateSelection", "onOnaction", "onHandleSelectNode", "onCustomContextmenuClick"]),
41652
41670
  s.selection.length > 0 ? (O(), U("p", Pae, [
41653
41671
  t[2] || (t[2] = Pe(" 已选择")),
41654
41672
  q("span", Lae, _e(s.selection.length), 1),