awidener3 opened a new issue, #21299:
URL: https://github.com/apache/echarts/issues/21299

   ### What problem does this feature solve?
   
   Right now, there is no simple way to drill to specific levels in sunburst. 
By adding a method to specify either a node or a level to drill in to/out to, 
users will be able to create breadcrumb-style level selections.
   
   ### What does the proposed API look like?
   
   A non-working example can be found here: 
https://codepen.io/awidener3/pen/raxMBxp
   
   At the "root" level:
   
   <img width="1472" height="896" alt="Image" 
src="https://github.com/user-attachments/assets/c106f61d-d2c4-4872-b14d-8c744fadd76e";
 />
   
   Drilled to "Level 2":
   
   <img width="1472" height="896" alt="Image" 
src="https://github.com/user-attachments/assets/99c421fd-3473-4d66-844b-9bb1964845f5";
 />
   
   By clicking the links in the top left corner, it would utilize the 
`treePathInfo` data to move backwards in the tree to the clicked level. For 
example, If I was drilled to Level 2 then clicked Level 0 on the breadcrumb 
menu, it would traverse the tree to the parent sector within Level 0.
   
   In this example, I am trying to utilize the `dispatchAction()` method to 
pass a `sunburstRootToNode` to the dataIndex, which does not work.
   
   Instead, a method such as `rootToNode(id)` could be used to simplify the 
process. 
   
   ```js
   const myChart = echarts.init()
   const someButton = document.querySelector('.some-button')
   
   someButton.addEventListener('click', e => {
     const idToDrillTo = e.target.dataset.nodeId
   
     myChart.rootToNode(idToDrillTo)
   })
   
   ```
   


-- 
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: commits-unsubscr...@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to