Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

d3.js: how to create "force-directed graph clusters"

I've been exploring the d3.js library, and especially the force directed graph creation. I perused the paper on it by Bostock et al, and noticed the precise type of graph I'm trying to create, basically a force directed graph with color coded regions surrounding groups of a feather.

It's the illustration on 3rd column, 2nd row, here, labelled "force-directed graph clusters": http://vis.stanford.edu/papers/d3

the code here generates the basic graph: http://mbostock.github.com/d3/ex/force.html

My question is: what is the code to dynamically generate the region polygons?

like image 322
AcroYogi Avatar asked May 24 '12 04:05

AcroYogi


1 Answers

You could try integrating the example hull code with the force nodes.

Hull: http://bl.ocks.org/mbostock/4341699

Force Layout: http://bl.ocks.org/mbostock/1021841

This is the answer I provided in the comments:

http://bl.ocks.org/donaldh/2920551

like image 59
donaldh Avatar answered Sep 30 '22 12:09

donaldh