magjac / d3-graphviz

Graphviz DOT rendering and animated transitions using D3
BSD 3-Clause "New" or "Revised" License
1.68k stars 103 forks source link

Object Constancy broken when nodes are modified #227

Closed rumpeltux closed 2 years ago

rumpeltux commented 2 years ago

See demo: https://pastebin.com/TBp5BHNn

In some cases in a transition should keep/move a node, but the node fades out and an equal replacement fades in again.

Instructions to reproduce:

Note: weirdly enough, this seems only broken when the node is modified AND the subgraph is involved, e.g. click "highlight" then "render", the first transition is still fine.

rumpeltux commented 2 years ago

This can be worked around by replacing select('ellipsis') with selectWithoutDataPropagation('ellipsis')

magjac commented 2 years ago

Yes, this is common pitfall with D3. This is detailed in the README.