spiermar / d3-flame-graph

A D3.js plugin that produces flame graphs from hierarchical data.
Apache License 2.0
891 stars 119 forks source link

Don't animate left & top of tooltip #202

Closed mhansen closed 2 years ago

mhansen commented 2 years ago

I accidentally inlined these in a previous commit, thinking if they were in the same d3 chain of methods, it would be a no-op.

But the .transition().duration(200) makes these properties animate, leading to a funny dance where the tooltip chases the pointer, 200ms behind.

Moving these property setting before the transition() fixes the problem.

I didn't notice this in my testing because I was only running with a tiny flamegraph with one node to check the HTML escaping!