我使用cytoscape.js 2.7.5来显示由Cytoscape Desktop导出的图形,该图形将graph.cyjs转换为包含"var graph = ... the content of the cyjs file ...;"的Javascript文件graph.js。使用下面的HTML,我看到了节点和边,但没有导入样式(颜色,用作节点名称的属性)。如何也导入样式?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="cytoscape.js"></script>
<script src="graph.js"></script>
</head>
<body>
<div id="cy" style="width:100%;height:100vh;"></div>
<script>
var cy = cytoscape({
container: document.getElementById('cy') // container to render in
});
cy.add(graph.elements);
</script>
</body>
</html>https://stackoverflow.com/questions/38348172
复制相似问题