javascript - d3 clustered force layout, distance between cluster center -
(i'm d3js newbie)
i'm using d3.layout.force visualize graph of nodes divided clusters, (even if in version every cluster's node keep gravity focus set cluster's center):
http://bl.ocks.org/mbostock/1747543
what i'd accomplish keep each cluster separated other min distance.
i set random points each cluster center @ initial stage:
for(var = 0; < clusterlength; i++) { var basex = 3 var basey = 7 var x = halton(i + 1, basex) * width + (math.random() * 50) var y = halton(i + 1, basey) * height + (math.random() * 50) clustercoords.push({ x: x, y: y }) j += 1 } then i'd able reposition each cluster keeping distance between others.
hope it's clear.
this padding variable used in mbostock example.
see example padding set 30: http://bl.ocks.org/mccannf/5548435

Comments
Post a Comment