GodsDusk opened a new issue #14313:
URL: https://github.com/apache/echarts/issues/14313


   ### Version
   5.0.2
   
   ### Steps to reproduce
   here is the code running on 
https://echarts.apache.org/examples/zh/editor.html?c=graph-force
   ```js
   myChart.showLoading();
   $.get(ROOT_PATH   '/data/asset/data/les-miserables.json', function (graph) {
       myChart.hideLoading();
       graph.nodes.forEach(function (node) {
           node.symbolSize = 5;
       });
       option = {
           title: {
               text: 'Les Miserables',
               subtext: 'Default layout',
               top: 'bottom',
               left: 'right'
           },
           tooltip: {},
           legend: [{
               // selectedMode: 'single',
               data: graph.categories.map(function (a) {
                   return a.name;
               })
           }],
           series: [
               {
                   name: 'Les Miserables',
                   type: 'graph',
                   layout: 'force',
                   data: graph.nodes,
                   // links: graph.links,
                   categories: graph.categories,
                   roam: true,
                   label: {
                       position: 'right'
                   },
                   force: {
                       repulsion: 100
                   }
               }
           ]
       };
   myChart.on('click', function (params) {
           console.log(params)
           if (params.componentType === 'series') {
               if (params.componentSubType === 'graph') {
                   option.series[0].layout = 'none'
                   console.log(myChart._chartsMap)
                   const graphNodes = myChart._chartsMap["_ec_\u0000Les 
Miserables\u00000_series.graph"]._symbolDraw._data.graph.data._graphicEls
                   console.log(graphNodes)
                   for (let i = 0; i < graphNodes.length; i  ) {
   
                       option.series[0].data[i].x = graphNodes[i].x
                       option.series[0].data[i].y = graphNodes[i].y
                   }
                   console.log(option.series[0])
                   myChart.setOption(option)
               }
           }
       });
       myChart.setOption(option);
   });
   ```
   
   ### What is expected?
   nodes should on current position when click
   
   ### What is actually happening?
   move expansion
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to