more compact nodemap

This commit is contained in:
Nils Schneider 2012-06-03 13:24:14 +02:00
parent 973a39087d
commit 682e73e737
2 changed files with 5 additions and 5 deletions

View file

@ -1,10 +1,11 @@
.node ellipse { .node ellipse {
fill: #fff; fill: #fff;
stroke-width: 1.5px; stroke-width: 2.5px;
} }
.node text { .node text {
font-size: 14px; font-size: 10px;
color: #333;
} }
line.link { line.link {

View file

@ -49,15 +49,14 @@ d3.json("nodes.json", function(json) {
.call(force.drag); .call(force.drag);
node.append("ellipse") node.append("ellipse")
.attr("rx", function(d) { if (d.group == 3) return 4; else return Math.max(14, d.name.length * 5); }) .attr("rx", function(d) { if (d.group == 3) return 4; else return Math.max(10, d.name.length * 5); })
.attr("ry", function(d) { if (d.group == 3) return 4; else return 14; }) .attr("ry", function(d) { if (d.group == 3) return 4; else return 10; })
.style("fill", function(d) { if (d.group == 3) return fill(d.group); else return ""; }) .style("fill", function(d) { if (d.group == 3) return fill(d.group); else return ""; })
.style("stroke", function(d) { return fill(d.group); }); .style("stroke", function(d) { return fill(d.group); });
node.append("text") node.append("text")
.attr("text-anchor", "middle") .attr("text-anchor", "middle")
.attr("y", "4px") .attr("y", "4px")
.style("fill", function(d) { return fill(d.group); })
.text(function(d) { if (d.group == 3) return ""; else return d.name; }); .text(function(d) { if (d.group == 3) return ""; else return d.name; });
node.append("title") node.append("title")