我需要渲染图形,并且我想使用cytoscape (plotly dash cytoscape)。因为有了划线包装器,就可以用python编写所有内容,而我不需要将(小)应用程序拆分为后端和前端两部分。
我希望图形使用整个屏幕,并以良好和可读的方式对节点进行排序。不幸的是,我在api文档中找不到对所有可能参数的描述。
而不是在

照片,我想把它放进去

道路。
你知道怎么解决这个问题吗?图形有整个可用的空间,我可以用我的鼠标把它移动到我想要的任何地方。
以下是我当前的属性:
cyto.Cytoscape(
id='knowledge-graph',
layout={
'name': 'cose',
'idealEdgeLength': 1000,
'nodeOverlap': 500,
'refresh': 20,
'fit': True,
'padding': 30,
'randomize': False,
'componentSpacing': 1000,
'nodeRepulsion': 400000,
'nestingFactor': 5,
'gravity': 800,
'numIter': 1000,
'initialTemp': 200,
'coolingFactor': 0.95,
'minTemp': 1.0
},
style={
"width": "100%",
"height": "calc(100vh - 150px)",
},
stylesheet=[
{'selector': 'edge', 'style': {'label': 'data(label)', 'curve-style': 'haystack',
'haystack-radius': 0,
'width': 5,
'opacity': 0.5,
'line-color': '#a8eae5'}, 'text-wrap': 'wrap'},
{'selector': 'node', 'style': {'label': 'data(label)', 'background-color': '#30c9bc'}, 'text-wrap': 'wrap'},
])
谢谢!
发布于 2021-11-26 15:26:06
您可以尝试使用cytoscape-spread布局,它首先对初始位置应用力定向布局,然后使用基于voronoi的方法在剩余空间中展开节点。你可以查看它的演示here和here。
https://stackoverflow.com/questions/70087311
复制相似问题