Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您可以使用 d3.js 库轻松地从 json 文件中获取节点/链接属性。是否可以获得图形属性?示例 JSON 文件:
{"directed": true, "graph": [["name", "()"], ["label", "Graph Attribute"]], "nodes": [ {"node_attr": 1.0, "id": "001"}, {"node_attr": 0.5, "id": "002"}
...
d3.json返回一个 JSON,你可以做任何你想做的事情。在回调中,只需访问您需要的键(mydata.graph例如)。您是否有需要帮助的特定代码?
d3.json
mydata.graph