我的 .json 文件是:
{
"links":[
{source: "algorithms cormen", target: "irodov", type: "default"},
{source: "algorithms cormen", target: "skienna", type: "default"},
{source: "irodov", target: "skienna", type: "default"},
{source: "irodov", target: "algorithms cormen", type: "default"}
],
"data":[
{node: "algorithms cormen", data: "bible of algos"},
{node: "irodov", data: "bibile of physics"},
{node: "skienna", data: "cool book"}
]
}
现在在我的 javascript 文件中,我希望“链接”存储的数据转到链接变量。我想对“数据”做同样的事情我如何实现这一目标?我正在使用 d3.js 库,所以如果这个库中包含一些我可以使用的功能,请提及它们。