에 JSON 파일에 대해 나는는 VAR
var links = [
{source:"one",target:"two", type:"a", typeKBP:"a"},
{source:"two",target:"three", type:"a", typeKBP:"a"},
{source:"three",target:"four", type:"a", typeKBP:"a"},
{source:"four",target:"five", type:"a", typeKBP:"b"},
{source:"five",target:"six", type:"b", typeKBP:"b"},
{source:"six",target:"seven", type:"b", typeKBP:"b"}
]
대신 D3.js 그래프에서 일하고 있습니다.
JSON 파일에서 데이터를 가져 오는 방법을 추가 한 다음에는이를 형식으로 추가하십시오.
d3.json ("/ 자산/sample.json", 기능 (JSON) { // 'json'객체를 사용하는 코드 }); – Uttam