Commits

Casey Dunn  committed a5930f6

works now after refactoring

  • Participants
  • Parent commits 2611eeb

Comments (0)

Files changed (1)

File force/phyloforce.js

 // 
 // Based on http://mbostock.github.com/d3/ex/force.html
 
-// Initialize layout and appearance variables
-var width = 960,
-	height = 500;
-
-var color = d3.scale.category20();
-
-var force = d3.layout.force()
-	.charge(-60)
-	.linkDistance(30)
-	.size([width, height]);
-
-var svg = d3.select("#chart").append("svg")
-	.attr("width", width)
-	.attr("height", height);
 
 // Initialize tree variable
 var tree;	// Phylogeny in d3 json format with nodes and links
 function visualize() {
 	// Visualize the phylogeny stored in tree
 	
-	// document.write(tree.nodes);
+	
+	// Setup
+	var width = 960,
+	height = 500;
+
+	var color = d3.scale.category20();
+	
+	var force = d3.layout.force()
+		.charge(-60)
+		.linkDistance(30)
+		.size([width, height]);
+	
+	var svg = d3.select("#chart").append("svg")
+		.attr("width", width)
+		.attr("height", height);
+	
+	// Layout
 	
 	force
 		.nodes(tree.nodes)