li6in9muyou opened a new issue, #19703: URL: https://github.com/apache/echarts/issues/19703
### Version 5.5.0 ### Link to Minimal Reproduction https://echarts.apache.org/examples/zh/editor.html?c=sunburst-simple&code=MYewdgzgLgBATiEsC8MDeAoGNgAsCWANgCZwCmYAXDANoC6GAvgNwaiSwCGMqm2ADp3Jgo1BEiatxUAHR4ipCjP4BXCLgAUnAJSsMIflHzge6LDAhk4-MhGp9sMKAE9-ZagHIIKsACMVcNAeADTm2MScUJzUNNIM2IySQA ### Steps to Reproduce 1. paste the follow code in to echarts official example editor 2. open dev tool, read latest exception ```javascript 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] } }; ``` ### Current Behavior In step 2, a `RangeError: Maximum call stack size exceeded` is thrown and the chart is not displayed. ### Expected Behavior Chart is displayed properly. ### Environment ```markdown - OS: Win 10 - Browser: Chrome 122.0.6261.112 - Framework: vanillajs ``` ### Any additional comments? This issues is repeated in [zrender issue 1066](https://github.com/ecomfe/zrender/issues/1066). This stack overflow is caused by [a clone utility](https://github.com/ecomfe/zrender/blob/466328f944559bcc7a523e5ced5759be951d8cfe/src/core/util.ts#L78) that does not guard against circular reference. And this clone process is initiated by `OptionManager` [here](https://github.com/apache/echarts/blob/c576f0c395ef9af87461fe93bcaa4490d89a331a/src/model/OptionManager.ts#L111C38-L111C38). According to comments, `clone`ing here serves the purpose of avoiding modifying the user supplied option argument. In that regard, I suppose it's more robust to guard against circular references when `clone`ing. Circular reference is perfectly valid and reasonable in many cases. For example, series-sunburst accepts tree-like `series.data` and a user may store a parent link in every tree node so that click handlers on this chart can construct a path from node to tree root easily. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
