Search code examples
javascriptd3.jssunburst-diagramicicle-diagram

Updating a partition view (icicle or sunburst) while zoomed in


I am using these views to monitor things that are constantly updating, and I make a get request every minute or so to update the view. Currently, if someone is zoomed in while it gets the new data, they are zoomed back out to the first level. I was wondering if it was possible to keep the view zoomed in while updating, and in the chance that the update removes the node on which the view was focused on, say zoom out a level in that scenario. Here is a block of my code. Don't worry about the font resizing.

http://bl.ocks.org/JoshFerge/4ea29d16162d983e444b


Solution

  • After looking around some more I found this example http://bl.ocks.org/kerryrodden/477c1bfb081b783f80ad which switches between filters to update the data.