I recently developed an AngularJS directive to generate a D3 sunburst chart, but I'm encountering issues. I'm receiving a maximum call stack error in Chrome and a too much recursion error in Firefox. After some investigation, I found that the problem lies within the d3.layout.partition function. This function is essential for creating sunburst charts and other hierarchical charts in D3.js. Unfortunately, I'm stuck and unsure of how to resolve this issue. Any suggestions or guidance would be greatly appreciated.
Thank you.
Chrome Error:
Firefox Error:
var partition = d3.layout.partition()
.children(function(d){ return d.values; })
.value(function(d) { console.log(d); return d.count; });
var root = d3.nest()
.key(function(k){ return k.key})
.entries(d);
root = {key:'All',values:root};
console.log(partition.nodes(root))
The issue arises when calling partition.nodes(root), resulting in the recursion error.