D3NodeBasic
Basic force directed layout
HTML
<script src="http://labratrevenge.com/d3-tip/javascripts/d3.tip.v0.6.3.js"></script>
<body>
<div id="topo"></div>
</body>
CSS
.node {
stroke: #fff;
stroke-width: 1.5px;
}
.link {
stroke: #999;
stroke-opacity: .6;
}
JavaScript
//Constants for the SVG
var width = 500,
height = 500;
//Set up the colour scale
var color = d3.scale.category20();
//Set up the force layout
var force = d3.layout.force()
.charge(-120)
.linkDistance(30)
.size([width, height]);
//Append a SVG to the body of the html page. Assign this SVG as an object to svg
var svg = d3.select("#topo").append("svg")
.attr("width", width)
.attr("height", height);
//Read the data from the mis element
var mis =...