Hi and happy new year to you all.
I forked d3-collapsible-tree and I wanted to highlight the selected node with a mutable selection:
mutable selection = null
function nodeClicked(node){
mutable selection = node
}
....
nodeEnter.append("circle")
.attr("r", 2.5)
.style('fill', d=> selection&&d.id===selection.id?'orange':'black')
https://observablehq.com/@nicolas-despres/collapsible-tree
It show the selected node in orange but the tree does not collapse/expand anymore. I don’t understand the issue.
Any idea?
Thanks