I am using angular nvd3 to plot a forced directed graph.
http://krispo.github.io/angular-nvd3/#/forceDirectedGraph
These are the configurations :
$scope.graphOption = {
chart: {
type: 'forceDirectedGraph',
height: 450,
width: (function(){ return nv.utils.windowSize().width - 350 })(),
margin:{top: 20, right: 20, bottom: 20, left: 20},
color: function(d){
return color(d.group)
},
charge: -300,
tooltip: {
contentGenerator: function (key, x, y, e, graph) {
var ttContent = $scope.getTooltilContent(key);
return '<div class="nvd3-tooltip-wls">'+ttContent+'</div>';
}
},
nodeExtras: function(node) {
node && node
.append("text")
.text(function(d) { return d.name })
.style('font-size', '11px');
}
}
};
HTML :
<nvd3 id="graphPlot" options="graphOption" data="graphData"></nvd3>
Graph edges are too short and nodes are too close, i wanted to increase edge length. This is the output :
This link gives option to modify link distance :
http://bl.ocks.org/sathomas/11550728
I tried like this in chrome console, it didnt change any thing :
var force = d3.layout.force()
.size([1000, 450])
.nodes(nodes)
.links(links);
force.linkDistance(1000);
force.start()
Edit: I also want to show font-awesome
icon on some of the nodes.