I am trying to modify the Sequence Sunburst data found here:
http://bl.ocks.org/kerryrodden/7090426
I want it to change to a new dataset (csv, or json) when I click the button.
I tried reading the new csv and calling createVisualization(json);:
$('.toggle-data').click( function() {
d3.text("../csv/new-data.csv", function(text) {
var csv = d3.csv.parseRows(text);
var json = buildHierarchy(csv);
createVisualization(json);
});
});
I also tried calling createVisualization(json);directly using updated json.
In both cases, I get this error: Uncaught TypeError: Cannot read property '__data__' of null
What applies to this line of code:totalSize = path.node().__data__.value;
I also tried removing the old svg before creating a new one, but that did not change anything.
Question: How to change the underlying data of this sunlight (perfectly animating from one data set to another)?
, ( ): http://jsfiddle.net/zbZ3S/ ( - json, , )