Reputation: 3448
Similarly to this SO question I would like to build a colored radial tree with d3.js, starting from the example in here. I am a complete newbie in both javascript and d3.
I'd like to make it so that the nodes - and/or the terminal part of the edges - are colored with different intensity according to some property encoded in the original csv. Example would be:
id,value
flare,
flare.analytics,
flare.analytics.cluster,
flare.analytics.cluster.AgglomerativeCluster,3938
flare.analytics.cluster.CommunityStructure,3812
flare.analytics.cluster.HierarchicalCluster,6714
flare.analytics.cluster.MergeEdge,743
where I would like to color nodes depending on "value" This does not work:
node.append("circle")
.attr("r", 2.5)
.style('fill', function(d) {
if (Number(d.value) > Number(4000)){
return "orange";
}
});
Upvotes: 1
Views: 139