[英]How to prevent overlapping of nodes in the cytoscape dagre layout
嘗試了以下選項:
avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space
avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true
nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm
spacingFactor: undefined,
但是在dagre布局中沒有用...。嘗試了“ nodeSep:1000”,但是該圖太遲了,因為它影響了所有節點
同心布局存在相同的問題,因此我必須自己通過以下方法進行布局:
cy.nodes("[id = '" + node + "']").shift('x', x);
cy.nodes("[id = '" + node + "']").shift('y', y);
如果找不到其他解決方案,則可以這樣做。 我先運行“ null”布局,然后獲取我的cytoscape圖中有多少個節點,利用這些信息,您可以據此設置x和y坐標。 有點復雜,如果您找到解決方案,請告訴我。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.