微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。