jit icon indicating copy to clipboard operation
jit copied to clipboard

Centering Nodes and Tooltips is weird when graph gets panned around

Open gossi opened this issue 14 years ago • 1 comments
trafficstars

When panning around the graph and clicking a node through graph.onClick() the clicked node gets center to where the center was before panning the graph around, it should be centric to the viewport, right?

Also tooltips jitter, when graph was panned around.

gossi avatar Dec 05 '10 00:12 gossi

We used the following workaround: https://groups.google.com/d/msg/javascript-information-visualization-toolkit/kfEXlKs8rak/D25M-NFUSvEJ

Seems though that the workaround doesn't completely work as wanted when we call chart.addSubtree(subNodes, 'replot') inside the label.onclick = function () {

Another workaround is to reset the canvas by chart.canvas.translate(-chart.canvas.translateOffsetX, -chart.canvas.translateOffsetY);. This worked also in the case of addSubtree. Ain't perfect though as it directly warps to the last centered node (prior to panning) before smoothly animating to the clicked one.

Gonnagle avatar Mar 09 '16 06:03 Gonnagle