hexa = ["#FFFFFF00" "#FF000000" "#00FF0000" "#FF000000" "#FF000000"
"#00FF0000" "#00FF0000" "#00FF0000" "#FFFFFF00" "#FFFFFF00" "#FFFFFF00"
"#FF000000"];
var margin = 20,
padding = 2,
diameter = 650,
root = flareData();
var color = d3.scale.linear()
.domain([0, depthCount(root)])
.range(["hsl(152,80%,80%)", "hsl(228,30%,40%)"])
.interpolate(d3.interpolateHcl);
var circle = svg.selectAll("circle")
.data(nodes)
.enter().append("circle")
.attr("class", function(d) {
return d.parent ? d.children ? "node" : "node node--leaf" : "node node--
root";
})
.style("fill", function(d) {return d.children ? color(d.depth) : null;})
.on("click", function(d) {
if (focus !== d) zoom(d), d3.event.stopPropagation();
});
function flareData() {
return {
"name": "flare",
"children": [{
"name": "L1",
"children": [{
"name": "L1.1",
"children": [{
"name": "L1.1.1",
"children": [{
"name": "L1.1.1.1",
"children": [{
"name": "L1.1.1.1.1",
"size": 35
}, {
"name": "L1.1.1.1.2",
"size": 35
}, {
"name": "L1.1.1.1.3",
"size": 35
}, {
"name": "L1.1.1.1.4",
"size": 35
}, {
"name": "L1.1.1.1.5",
"size": 35
}, {
"name": "L1.1.1.1.6",
"size": 35
}]
}]
}]
}]
}]
}
}