gpt4 book ai didi

javascript - 为多级树实现 d3-2way-tree

转载 作者:行者123 更新时间:2023-12-03 09:10:16 25 4
gpt4 key购买 nike

我指的是 d3 小部件,d3 2 way tree 。我希望树在顶部和底部都进一步生长,我无法为其形成 json 数据。

最佳答案

在以下 JSON 中,我向父级添加了两个节点,向子级添加了两个节点:

{
"name": "Airlines",
"parents": [
{
"name": "Aviation",
"isparent": true
},
{
"name": "Transparent_companies",
"isparent": true
},
{
"name": "Transport_operators",
"isparent": true,
"parents": [
{
"name" : "parent-foo1",
"isparent" : true
},
{
"name" : "parent-foo2",
"isparent" : true
}
]
}
],
"children": [
{
"name": "Airline_alliances",
"isparent": false
},
{
"name": "Airlines_by_continent",
"isparent": false
},
{
"name": "Airlines_by_type",
"isparent": false,
"children": [
{
"name" : "children-foo1",
"isparent" : false
},
{
"name" : "children-foo2",
"isparent" : true
}
]
},
{
"name": "Defunct_airlines",
"isparent": false
}
]
}

关于javascript - 为多级树实现 d3-2way-tree,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32095441/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com