<script src="node_modules/d3/d3.min.js" type="text/javascript"></script>
<script type="text/javascript">
var graph = {nodes:[], edges:[]};
d3.text("https://localhost:8000/cbioportal.sif", function(sif) {
d3.tsv.parseRows(sif, function(rows){
if (graph.nodes.map(function(items) {
}).indexOf(rows[0]) === -1) {
graph.nodes.push({name:rows[0]});
if (graph.nodes.map(function(items) {
}).indexOf(rows[2]) === -1) {
graph.nodes.push({name:rows[2]});
d3.tsv.parseRows(sif, function(rows) {
graph.edges.push({source:graph.nodes.map(function(items) { return items.name; }).indexOf(rows[0]), target:graph.nodes.map(function(items) { return items.name; }).indexOf(rows[2])});
var color = d3.scale.category20();
var force = d3.layout.force()
var svg = d3.select("body").append("svg")
var link = svg.selectAll(".link")
.style("stroke-width", function(d) { return 0.5; });
var node = svg.selectAll(".node")
.enter().append("circle")
//.style("fill", function(d) { return color(d.group); })
.text(function(d) { return d.name; });
force.on("tick", function() {
link.attr("x1", function(d) { return d.source.x; })
.attr("y1", function(d) { return d.source.y; })
.attr("x2", function(d) { return d.target.x; })
.attr("y2", function(d) { return d.target.y; });
node.attr("cx", function(d) { return d.x; })
.attr("cy", function(d) { return d.y; });