节点在 Cytoscape 图中的自动位置
Automatic positions in Cytoscape graph for the nodes
我有 JSON 个有数据但没有位置的节点。我想根据边和父 json 自动创建图形而不给出位置。它做到了,但所有节点都在彼此之上。
https://stackblitz.com/edit/angular-kpnys1?file=src%2Fapp%2Fdemo_test.json
您正在使用预设布局,如您在 docs 中所见,它会将节点放置在您手动指定的位置。
如果您想使用自动定位的布局,请使用 cytoscape.js 提供的任何其他布局(null
布局除外)。
文档提供了有关 core layouts, but there are also layout extensions with some cool features here 的详细说明。
我有 JSON 个有数据但没有位置的节点。我想根据边和父 json 自动创建图形而不给出位置。它做到了,但所有节点都在彼此之上。
https://stackblitz.com/edit/angular-kpnys1?file=src%2Fapp%2Fdemo_test.json
您正在使用预设布局,如您在 docs 中所见,它会将节点放置在您手动指定的位置。
如果您想使用自动定位的布局,请使用 cytoscape.js 提供的任何其他布局(null
布局除外)。
文档提供了有关 core layouts, but there are also layout extensions with some cool features here 的详细说明。