jit
jit copied to clipboard
Centering Nodes and Tooltips is weird when graph gets panned around
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.
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.