philogb / jit

The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web
http://thejit.org
Other
1.51k stars 297 forks source link

Clear out clickedNode reference on data load #179

Open meshulam opened 10 years ago

meshulam commented 10 years ago

I ran into an issue when reloading the data in a TreeMap. If I clicked on a node to set a new root, and then reloaded the data, compute() would try to set the root to the old value of this.clickedNode, resulting in an error and failure to redraw the graph.

This PR fixes the issue by clearing out the reference to clickedNode when loading data. The side effect is that reloading data and refreshing the plot will always bring you back to the root node, even if there's a new node with the same ID in the updated data.