我们正在使用Cytoscape + neo4j +弹簧靴+ REST。我们试图使用graphml作为格式传递给前端,但是graphml效果不佳。因此,寻找使用Cytoscape js的最佳结构。预先感谢。
就我而言,前端应尽可能少地进行计算。因此,请尝试发送尽可能接近cytoscape.js规范中指定的format
的JSON。图形的基本思想是它由nodes和edges组成,那些elements(如cytoscape称呼它们)具有ids可以帮助您在图形中选择它们。更简单的方法。
后端无计算
如果您想使用CALL apoc.export.json.all("all.json",{useTypes:true})
中的内置格式.json,那么您将需要在前端进行一些转换:
responseJson => {
responseJson.map(element => {
return {
group: element.type,
data : {
id: `${element.type}${element.id}`,
myFavouriteProperty: element.property
}
}
}