我有一个 JSON 字符串,它具有 Tree 的邻接表示。我需要编写一个程序来可视化这棵树。可能的方法是什么?我需要类似从 Weka 生成的东西..
示例 Json 是:
[{
"parent_index" : -1,
"ClassLable" : "TEMPERATURE",
"ChildNum" : 4,
"AttributeTest" : "NULL"
}, {
"parent_index" : 0,
"ClassLable" : "yes",
"ChildNum" : 0,
"AttributeTest" : "<65"
}, {
"parent_index" : 0,
"ClassLable" : "WINDY",
"ChildNum" : 2,
"AttributeTest" : "65-80.5"
}, {
"parent_index" : 2,
"ClassLable" : "yes",
"ChildNum" : 0,
"AttributeTest" : "false"
}, {
"parent_index" : 2,
"ClassLable" : "HUMIDITY",
"ChildNum" : 4,
"AttributeTest" : "true"
}, {
"parent_index" : 4,
"ClassLable" : "yes",
"ChildNum" : 0,
"AttributeTest" : "<64"
}, {
"parent_index" : 4,
"ClassLable" : "no",
"ChildNum" : 0,
"AttributeTest" : "64-74.5"
}, {
"parent_index" : 4,
"ClassLable" : "yes",
"ChildNum" : 0,
"AttributeTest" : "74.5-85"
}, {
"parent_index" : 4,
"ClassLable" : "yes",
"ChildNum" : 0,
"AttributeTest" : ">85"
}, {
"parent_index" : 0,
"ClassLable" : "HUMIDITY",
"ChildNum" : 4,
"AttributeTest" : "80.5-96"
}, {
"parent_index" : 9,
"ClassLable" : "no",
"ChildNum" : 0,
"AttributeTest" : "<64"
}, {
"parent_index" : 9,
"ClassLable" : "WINDY",
"ChildNum" : 2,
"AttributeTest" : "64-74.5"
}, {
"parent_index" : 11,
"ClassLable" : "no",
"ChildNum" : 0,
"AttributeTest" : "false"
}, {
"parent_index" : 11,
"ClassLable" : "no",
"ChildNum" : 0,
"AttributeTest" : "true"
}, {
"parent_index" : 9,
"ClassLable" : "WINDY",
"ChildNum" : 2,
"AttributeTest" : "74.5-85"
}, {
"parent_index" : 14,
"ClassLable" : "yes",
"ChildNum" : 0,
"AttributeTest" : "false"
}, {
"parent_index" : 14,
"ClassLable" : "no",
"ChildNum" : 0,
"AttributeTest" : "true"
}, {
"parent_index" : 9,
"ClassLable" : "no",
"ChildNum" : 0,
"AttributeTest" : ">85"
}, {
"parent_index" : 0,
"ClassLable" : "yes",
"ChildNum" : 0,
"AttributeTest" : ">96"
}
]