Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
capan committed Nov 28, 2018
1 parent fde0d93 commit 5bb25ef
Show file tree
Hide file tree
Showing 3 changed files with 479 additions and 415 deletions.
9 changes: 6 additions & 3 deletions f_force.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ var node = svg.append("g")
.data(graph.nodes)
.enter().append("circle")
.attr("r", 3)
.attr("fill", function (d,i) { return color(i); })
.attr("fill", function (d, i) { return color(d.source); })
.call(d3.drag()
.on("start", dragstarted)
.on("drag", dragged)
.on("end", dragended));

node.append("title")
.text(function (d) { return d.name; });
// node.append("title")
// .text(function (d) { return d.name; });
node.on("mouseover", function (d) {
document.getElementById("nameText").innerHTML = d.name.split(' ')[0];
});

simulation
.nodes(graph.nodes)
Expand Down
Loading

0 comments on commit 5bb25ef

Please sign in to comment.