You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/08/12 10:21:17 UTC

[GitHub] [echarts] Ovilia commented on issue #16152: [Feature] Multi-level drill-down

Ovilia commented on issue #16152:
URL: https://github.com/apache/echarts/issues/16152#issuecomment-1212957568

   @tyn1998 Thanks for the detailed plan. I have some questions about this:
   
   If we consider drilling-down only, then all `groupId`s the data items should be the same because typically we can only drill one thing down. But what happens if there are different `groupId`s in the new option?
   
   If I understand correctly, you want the developers to listen to all kinds of click events and call `setOption` again like this, right?
   
   ```ts
   chart.setOption(/* old option */);
   chart.on('click', () => {
     // check which item is clicked and find its children
     chart.setOption(/* new option with its children */);
   })
   ```
   
   One problem is that, in this design, the developer has to consider about all possible drilled down situations in the click callback and handle the corresponding new option.
   
   I think a better idea would be encapsulating the logic by ECharts like:
   
   ```ts
   chart.setOption({
     series: [{
       // ...
       data: [{
         value: 10,
         name: 'parent A',
         drilldown: {
           data: [{
             value: 2,
             name: 'first child of parent A'
           }],
           // other options for drilldown if you think is needed
         }
       }]
     }]
   });
   ```
   
   So the developers don't have to think about drilling down at all. Apache ECharts will update the chart just as it does with treemap drilldown right now.
   
   That's my personal point of view. Let's also hear about what other mentors think.


-- 
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-unsubscribe@echarts.apache.org

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


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