我有一个简单的 json 文件,它是:
{
"nodes":[
{"name":"Moe","group":1},
{"name":"Madih1","group":1},
{"name":"Madih2","group":1},
{"name":"Nora","group":1},
{"name":"Myna","group":1}
],
"links":[
{"source":35,"target":44,"value":1},
{"source":44,"target":35,"value":1},
{"source":45,"target":35,"value":1},
{"source":45,"target":44,"value":1},
{"source":35,"target":49,"value":1},
{"source":49,"target":35,"value":1}
]
}
当我保存它时,完全使用http://bl.ocks.org/4062045#index.html中所示的 html 代码并解决上面的 json,cancas 上什么也没有出现。
如果您能帮我解决这个问题,我将不胜感激,因为我对它不是很熟悉。此外,如果我知道使用 json 绘制这样的图形所需的最少代码,那就太好了。
最好的,