简体   繁体   中英

Nodes and links in Collapsible Force Layout in D3 Javascript

I am new to D3 Javascript and currently following some tutorials to understand how it works. I have looked through the codes in this link: > http://bl.ocks.org/mbostock/1093130 for Collapsible Force Layout I have tried to figure out how nodes and links are connecting. Unfortunately, I could not fully understand on what basis the nodes are connected to each other. However, I have understood how these nods are connected in the Force-Directed Graph > The links between the nodes in Force-Directed Graph in D3 Javascript , I could not really understand how the links in Collapsible Force Layout is working. How are the id and target working? Is is based on the array index? Could anyone please explain to me how they are working? Your assistance would be more than appreciated.

The links in the collapsible force layout example are based on parent-child relationships. That is, each node is connected to the nodes listed under .children .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM