When using d3js in my tree layout, I am looking to change certain properties of a selected node (choix1) and all its descendants. My goal is to assign a specific class (choix2) to all descendants.
.on("click", function() {
d3.select(this).classed("choix1", true); // selecting a node
d3.select(".choix1").children.classed("choix2", true); // assigning a class (choix2) to all descendants
})
While the selected node updates correctly, the properties of the descendants remain unchanged. The modifications I expect to see are not taking effect.