Note that I’ve already gone through How to detect a loop in a hierarchy of javascript elements In our case, we’re not dealing with a linked-list, but a hierarchical graph where each node may have multiple children linked to it. For example, In this graph, we should detect the loop a -> b -> c -> a. Answer If you
Tag: hierarchy
d3 Dendrogram: Replacing root retains old tree
I have a Dendrogram / cluster diagram’s root using d3.hierarchy. I’m trying to update the root with a selected node which should become the new head, with a new tree drawn with that node at the top. This should replace the old tree. The steps are as follows: read in flat data convert to hierarchy using d3.stratify convert this to