Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
d3 JSON拓扑文件读取节点属性_Json_D3.js - Fatal编程技术网

d3 JSON拓扑文件读取节点属性

d3 JSON拓扑文件读取节点属性,json,d3.js,Json,D3.js,我是d3中的新一个json,我不知道如何读取拓扑图的节点x和y坐标,以以下格式编写: "node": [ { "id": "MPLS-Node-A", "data": [ { "key": "label", "Text": "M

我是d3中的新一个json,我不知道如何读取拓扑图的节点x和y坐标,以以下格式编写:

"node": [
                {
                    "id": "MPLS-Node-A",
                    "data": [
                        {
                            "key": "label",
                            "Text": "MPLS-Node-A"
                        }, {
                            "key": "Host_IP",
                            "Text": "10.10.20.3"
                        }, {
                            "key": "size",
                            "Text": 10.0
                        }, {
                            "key": "r",
                            "Text": 153
                        }, {
                            "key": "g",
                            "Text": 153
                        }, {
                            "key": "b",
                            "Text": 153
                        }, {
                            "key": "x",
                            "Text": 521
                        }, {
                            "key": "y",
                            "Text": 104
                        }
                    ]

谢谢你的帮助

你最好重新格式化你的JSON,让
x
y
等都是键。是的,我也这么想。实际上,这是Altova XMLSpy将GRAPHML转换为JSON的结果