link all nodes

This commit is contained in:
j 2018-08-10 14:29:27 +01:00
parent 3fd2380475
commit 059ac97dd4

View file

@ -47,9 +47,6 @@ function get_color(d) {
if (d.children || d._children) { if (d.children || d._children) {
return '#fff' return '#fff'
} }
if (d.size == 1) {
return "gray";
}
return "lightsteelblue"; return "lightsteelblue";
} }
function update(source) { function update(source) {
@ -80,7 +77,7 @@ function update(source) {
.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"; })
.text(function(d) { .text(function(d) {
if (d.children || d._children || d.size == 1) { if (d.children || d._children) {
return d.name; return d.name;
} }
return d.name + ' (' + d.size + ')'; return d.name + ' (' + d.size + ')';
@ -154,7 +151,7 @@ function click(d) {
d.children = d._children; d.children = d._children;
d._children = null; d._children = null;
} }
if (!d.children && ! d._children && d.size > 1) { if (!d.children && ! d._children) {
var name = d.parent.name + ': ' + d.name var name = d.parent.name + ': ' + d.name
document.location.href = '/clip/created/keywords=' + name document.location.href = '/clip/created/keywords=' + name
} }