Cytoscape节点的相对位置和相对于背景图像的自动调整

问题描述

我有几个问题了,基本上我需要使用背景图片和像cytoscape这样的网络来创建地图

enter image description here

我正在保存节点的位置,但是当我从监视器切换到全屏模式或进入全屏模式时,显然会失去响应能力

无论屏幕大小(移动设备,台式机,桌子)如何,我如何使cytoscape对背景图像作出响应?

enter image description here

<div class='cy-container rotata0v'  id="cy" [ngStyle]="{'background-image': getUrl()}">
</div>

   this.style = this.style || cytoscape.stylesheet()
      .selector('node')
      .css({
        'shape': 'data(shapeType)','width': 'mapData(weight,40,80,20,60)','content': 'data(name)','text-valign': 'center','text-outline-width': 1,'text-outline-color': 'data(colorCode)','background-color': 'data(colorCode)','color': '#fff','font-size': 10
      })
      .selector(':selected')
      .css({
        'border-width': 1,'border-color': 'black'
      })
      .selector('edge')
      .css({
        'curve-style': 'bezier','opacity': 0.7,'width': 'mapData(strength,70,100,2,6)','target-arrow-shape': 'triangle','line-color': 'data(colorCode)','source-arrow-color': 'data(colorCode)','target-arrow-color': 'data(colorCode)'
      })
      .selector('edge.questionable')
      .css({
        'line-style': 'dotted','target-arrow-shape': 'diamond'
      })
      .selector('.faded')
      .css({
        'opacity': 0.25,'text-opacity': 0
      });
  }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)