Describe the bug
When calling .destroy() on the graph, the associated tip is not removed from the DOM
To Reproduce
Steps to reproduce the behavior:
Before creating a flamegraph, check document.querySelectorAll('.d3-flame-graph-tip').length. This should be 0.
Create a new flamegraph with a tooltip
Check document.querySelectorAll('.d3-flame-graph-tip').length again. There should now be 1 tooltip found
Call .destroy() on the graph, confirm that it is removed from the DOM
Check document.querySelectorAll('.d3-flame-graph-tip').length again. Note that it is still 1. Although the graph has been removed, the tooltip remains in the DOM
This can be repeated as desired, when each new graph is created the number of tooltips will increment.
Expected behavior
Tooltips are correctly removed from the DOM after their associated graph is destroyed.
At step 3 of the above, the command should return 0 and repeatedly creating and destroying graphs should not cause the result to grow infinitely.
Screenshots
Desktop (please complete the following information):
OS: Linux
Browser: Firefox
Version: 90.0 (64-bit)
Additional context
Sorry for spamming you with all of these issues :(
I'm fairly new to d3 otherwise I'd try to do a better job submitting prs instead of just sending in all of these reports :(
Thanks @nickgirardo! I usually clean the tooltip outside the flame graph code, since it was created outside too, but I added a hook to destroy it if .destroy() is called on the flame graph.
Describe the bug When calling
.destroy()
on the graph, the associated tip is not removed from the DOMTo Reproduce Steps to reproduce the behavior:
document.querySelectorAll('.d3-flame-graph-tip').length
. This should be 0.document.querySelectorAll('.d3-flame-graph-tip').length
again. There should now be 1 tooltip found.destroy()
on the graph, confirm that it is removed from the DOMdocument.querySelectorAll('.d3-flame-graph-tip').length
again. Note that it is still 1. Although the graph has been removed, the tooltip remains in the DOMExpected behavior Tooltips are correctly removed from the DOM after their associated graph is destroyed. At step 3 of the above, the command should return 0 and repeatedly creating and destroying graphs should not cause the result to grow infinitely.
Screenshots
Desktop (please complete the following information):
Additional context Sorry for spamming you with all of these issues :( I'm fairly new to d3 otherwise I'd try to do a better job submitting prs instead of just sending in all of these reports :(