I have implemented tree but the problem is that the information I want to show on the nodes, are too big. I am thinking of displaying those information in a separate div on click of any node in the tree.
the data that is pushed is having format like this (this one is the root node though). This Rule I have show on other div:
data.push({"name":"0","parent":" ","prediction":"N","RecordCount":"296","Rule":" ","RuleAttribute":" "})
I have declared a simple div like svg :
<div id="svgcontainer"> </div> <div id="info"> </div>
then I have click function outside update (source):
function click(d) {
if (d.children) {
d._children = d.children;
d.children = null;
} else {
d.children = d._children;
d._children = null;
}
d3.selectAll(".node").attr('r', 5)
.style("fill", function(d) { return color(d.group); })
.style("stroke","none");
d3.select(this).attr('r', 25)
.style("fill","lightcoral")
.style("stroke","red");
d3.select("#info").text(d.text);
update(d);
}
Request if someone can help me in understanding what is wrong with my code. Many thanks.