Filling and Styling D3 Tree nodes based off of data

stuck on styling the Collapsible Tree example found at

D3 Code: https://bl.ocks.org/mbostock/4339083

JSON: https://bl.ocks.org/mbostock/4339083 (but instead of size, using a field called status to set to some single digit integer )

Based on status number, I highlight the node… that i got working. But I need the color of the parent node to take on the color of its child. Can someone direct me on how to do that?

Please provide a full working example of what you have so far, it will be this part of the code you need to modify.

nodeEnter.append("circle")
  .attr("r", 1e-6)
  .style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; });

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.