Hierarchical distribution of borders d3 v4 - the simplest example 2 node

I would like to make the simplest example of a hierarchical Edge Bundling that I can with two nodes. As soon as I fully understand how to do this correctly, I should (hopefully) be able to dynamically build a complete visualization.

I saw an example of a Mike Bostock D3 V4: https://bl.ocks.org/mbostock/7607999 and would like to use the same template. However, going through JSON data is a bit overwhelming. I was hoping with two nodes, I could see how the visualization is being created.

What does a JSON file with two nodes look like? I am trying my best to try to find out how it works. Any help is appreciated.

I cannot insert JSON here because it exceeds the maximum number of characters. For reference, please check: https://bl.ocks.org/mbostock/7607999#flare.json enter image description here

+4
source share
1 answer

Here is the data using 3 nodes (visualization would not be very useful with two nodes):

var data = [{
  "name": "iit.mumbai.pub1",
  "imports": ["iit.chennai.pub3"]
}, {
  "name": "iit.delhi.pub2",
  "imports": ["iit.mumbai.pub1"]
}, {
  "name": "iit.chennai.pub3",
  "imports": ["iit.delhi.pub2"]
}];

Here's what it looks like: https://bl.ocks.org/ckothari/raw/473320621a15a7ee1ed684bf3feb4255/ .

I gave an example of academic publications in the above example. The points in the names represent hierarchical relationships, therefore in this example iit(Institute) there are 3 children (locations) mumbai, delhiand chennai, and they have children (publications) pub1, pub2and pub3accordingly.

imports json . pub1 pub3, pub2 pub1 pub3 pub2.

+2

Source: https://habr.com/ru/post/1680570/


All Articles