Open
Description
This is issue is repeated in a echarts issue as well.
util 里面里的克隆函数应该防范环形引用,否则一些很合理的场景会抛出栈溢出异常,然后图表就不能显示了,这个 issue 我在 echarts 也提了。
我意见就是添加在 util.ts 里面添加一个全局变量,用 weakset ,只把克隆过程中遇到的对象放进去,递归前检查当前对象是否已经在这个 weakset 里面,如果在的话就不递归下去了。我就是不知道这样随意添加一个全局变量合适不合适,这个是模块私有的变量,应该也没问题。
[Bug] Circular reference in series.data causes stack overflow thus chart fails to show
- paste the follow code in to echarts official example editor
- open dev tool, read latest exception
const root = {
name: "root",
value: 20,
children: []
};
const a = {
name: "a",
value: 10,
parent: root
};
root.children.push(a);
option = {
series: {
type: 'sunburst',
data: [root]
}
};
Metadata
Metadata
Assignees
Labels
No labels