jsnetworkx

TypeError: undefined is not an object (evaluating 'M.layout.force')

孤街醉人 提交于 2019-12-25 07:22:05
问题 I'm new to JSNetworkX. I created a graph using the examples from jsnetworkx.org but I can only log it, I can't display it. So this is index.html file: <html> <head> <script src="https://d3js.org/d3.v4.js"></script> <script src="jsnetworkx.js"></script> </head> <body> <script src = "script.js"></script> </body> </html> And this the code written in script.js : var G = jsnx.completeGraph(6); console.log(G.nodes()); jsnx.draw(G, { element: 'body', weighted: true, edgeStyle: { 'stroke-width': 10 }