Changing data sources with zoomable d3 treemap

225 Views Asked by At

I'm very new to d3 and would like some insight before I invest too much time into this code. This zoomable treemap (http://jsfiddle.net/08agmhej/, which I originally got from http://bost.ocks.org/mike/treemap/) uses d3 transitioning to only show two levels of data hierarchy at a time. The data is provided in a JSON file in the following format:

{
 "name": "layout",
       "children": [
        {"name": "AxisLayout", "value": 6725},
        {"name": "BundledEdgeRouter", "value": 3727}}
}

I would like to add a second dataset to the JSON that looks like the below code and allow the user to interact with the dataset via a dropdown such as in this example (http://mbostock.github.io/d3/talk/20111018/treemap.html)

{
 "name": "layout",
       "children": [
        {"name": "AxisLayout", "value": 6725, "othervalue" : 2},
        {"name": "BundledEdgeRouter", "value": 3727, "othervalue" : 2}
        ]
}

Is this possible or is it not since d3 couldn't handle the hidden node levels? For example, if zoomed in what would happen if the data source was changed, then zoomed out.

0

There are 0 best solutions below