How to create a network in D3 without using force layout

246 views
Skip to first unread message

Bharat K

unread,
Apr 12, 2017, 1:47:11 PM4/12/17
to d3-js
Hi,

I have used force layout to create a network of nodes. But, due to these forces my network is almost like a circle (as shown below). This visualization is not efficient in using the screen space as the screens are usually rectilinear. I tried playing with various force parameters like gravity, charge, distance and linkdistance, they made the graph look better but still in circular shape only.


I'm looking for various ways of creating networks in D3 with out using forces. I would appreciate any help that gives me some directions that I can try.

Thanks,
Bharat.

Olha Buchel

unread,
Apr 12, 2017, 4:31:13 PM4/12/17
to d3...@googlegroups.com
You can create a network layout in R using graph. Then take coordinates from R and plot them in D3.

Olha

--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Olha Buchel

unread,
Apr 12, 2017, 4:38:17 PM4/12/17
to d3...@googlegroups.com
Here is a link to various layouts in R:

Bharat K

unread,
Apr 13, 2017, 7:34:02 PM4/13/17
to d3-js
Thank you Olha. I'll try the R package. 

I have few follow up questions here - 
1. You suggested me an R package, Is it because there is no other layout for graphs in D3?
2.  If I use R and export the coordinates to plot in D3, Do I still need to use force layout along with specifying coordinates by myself?  

Bharat
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.

Olha Buchel

unread,
Apr 13, 2017, 8:13:52 PM4/13/17
to d3...@googlegroups.com
Force is the basic one. You could also use 
a chord digram or a hierarchical edge bundling.
These are the main network layouts.
R has a much wider variety of layouts.
I know this because recently I had to deal with an economic network 
that had an MDS-based layout. I found it in the R package.
I could not find an equivalent in D3.

Once you get the coordinates from R, you do not need the force layout, you can simply draw it as a scatter plot and add lines between points.
On the other hand, you could probably specify links between nodes, using the force layout. They might look nicer.

Olha


To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages