(12 intermediate revisions by the same user not shown) | |||
Line 66: | Line 66: | ||
.node circle { | .node circle { | ||
fill: #fff; | fill: #fff; | ||
− | stroke: | + | stroke: black; |
stroke-width: 2.5px; | stroke-width: 2.5px; | ||
r:15; | r:15; | ||
Line 72: | Line 72: | ||
.node text { | .node text { | ||
− | font: | + | font: 13px emulogic; |
} | } | ||
Line 99: | Line 99: | ||
<script> | <script> | ||
− | var margin = {top: 20, right: | + | var margin = {top: 20, right: 20, bottom: 20, left: 220}, |
− | width = | + | width = 1050 - margin.right - margin.left, |
height = 950 - margin.top - margin.bottom; | height = 950 - margin.top - margin.bottom; | ||
Line 161: | Line 161: | ||
nodeEnter.append("circle") | nodeEnter.append("circle") | ||
.attr("r", 2e-6) | .attr("r", 2e-6) | ||
− | .style("fill", function(d) { return d._children ? " | + | .style("fill", function(d) { return d._children ? "yellow" : "#fff"; }); |
nodeEnter.append("text") | nodeEnter.append("text") | ||
− | .attr("x", function(d) { return d.children || d._children ? - | + | .attr("x", function(d) { return d.children || d._children ? -20 : 20; }) |
.attr("dy", ".35em") | .attr("dy", ".35em") | ||
.attr("text-anchor", function(d) { return d.children || d._children ? "end" : "start"; }) | .attr("text-anchor", function(d) { return d.children || d._children ? "end" : "start"; }) | ||
Line 177: | Line 177: | ||
nodeUpdate.select("circle") | nodeUpdate.select("circle") | ||
.attr("r", 4.5) | .attr("r", 4.5) | ||
− | .style("fill", function(d) { return d._children ? " | + | .style("fill", function(d) { return d._children ? "yellow" : "#fff"; }); |
nodeUpdate.select("text") | nodeUpdate.select("text") |
Latest revision as of 02:51, 17 October 2016