Drawing directed graph using Force Directed Layout

63 views
Skip to first unread message

Nithin Q

unread,
Feb 8, 2017, 11:16:56 PM2/8/17
to JavaScript InfoVis Toolkit
 var json = [
{
      "adjacencies": [  
      ], 
      "data": {
        '$color': "#83548B", 
        '$type': "circle"
      }, 
      "id": "graphnode2.0", 
      "name": "graphnode2.0"
    },
    {
      "adjacencies": [  
       
      ], 
      "data": {
        '$color': "#83548B", 
        '$type': "circle"
      }, 
      "id": "graphnode1.0", 
      "name": "graphnode1.0"
    },
 {
      "adjacencies": [  
      {
          "nodeTo": "graphnode1.0",
"nodeFrom": "graphnode0.0",  
          "data": {"$type":"arrow",
          "$direction":"['graphnode0.0','graphnode1.0']"}
        } ,
  {
          "nodeTo": "graphnode2.0",
"nodeFrom": "graphnode0.0",  
          "data": {"$type":"arrow",
          "$direction":"['graphnode0.0','graphnode2.0']"}
        }  
      ], 
      "data": {
        '$color': "#83548B", 
        '$type': "circle"
      }, 
      "id": "graphnode0.0", 
      "name": "graphnode0.0"
    },
   
  ];

This is the json which I used for the graph construction.I want edges from 0->1,0->2 .But I adjacency list I am getting 2->0,1->0 along with 0->1 and 0->2 ,i.e graph is plotted in both directions.

What is the proper way to draw singe directed graphs,so that I can get all the outgoing and incoming edges of it separately.
Reply all
Reply to author
Forward
0 new messages