mstefaniuk / graph-viz-d3-js

Graphviz web D3.js renderer
MIT License
313 stars 38 forks source link

Transition of a graph with HTML-like labels into another leaves some text in the old place #35

Closed magjac closed 7 years ago

magjac commented 7 years ago

Steps to reproduce:

Render a graph with dot1.txt. Re-render with dot2.txt.

The result is:

diagram

The text is both in the old and the new place. The text left behind is the second table cell in that table row.

Tested on http://graphviz.it and with my own application.

Tested with Firefox 48.0 and Chrome Version 57.0.2987.110 (64-bit) on Ubuntu 14.04.

It's the same behavior on all of them.

magjac commented 7 years ago

It's the same problem in Windows 7 with Firefox 52.0.2 (32-bit) and Chrome Version 57.0.2987.133 (64-bit).

magjac commented 7 years ago

The original graph (from dot1.txt) looked like this:

diagram

The re-rendered graph (from dot2.txt) above has fewer node label text elements. The problem is that the surplus text elements are not removed because there is no handling of the node labels exit selection.

I have a fix that works, but will wait to supply a PR until I've dug into some other issues.

magjac commented 7 years ago

(Wrong comment deleted)

magjac commented 7 years ago

The comment above that I now have deleted should have gone into another bug.,

magjac commented 7 years ago

The problem also occurs when the number of node shapes path elements decreases. The surplus path elements are not removed because there is no handling of the node labels shapes selection.