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 2021/12/26 07:38:35 UTC

[GitHub] [echarts] liucys edited a comment on issue #16279: [Bug] 关系图力导向设置edgeLength无效

liucys edited a comment on issue #16279:
URL: https://github.com/apache/echarts/issues/16279#issuecomment-1001118102


   The problem has been solved and it looks like there was a wash-in problem with other configurations.
    1.  the value attribute of the links needs to be configured.
    2.  after setting layout to force, the repulsion property cannot be set as an array in the configuration of force.
   
   ```js
   // first 
   let links = list.map((item) => {
         if (item.name !== '资金关系') {
           return {
             source: '资金关系',
             target: item.name,
             value: item.value, // add this
           };
         }
     return null;
   });
   
   links = links.filter((item) => item);
   
   // next
   series: [
       {
         type: 'graph',
         layout: 'force',
         force: {
           // edgeLength: [10, 50] 值最大的边长度会趋向于 10,值最小的边长度会趋向于 50
           repulsion: 2000,  // cannot set arrays
           edgeLength: [400, 50]
         },
   ]
   ```


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