You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/12/05 08:52:14 UTC

[GitHub] fxxjdedd opened a new pull request #9531: fix(sankey): modify the calculation of node value

fxxjdedd opened a new pull request #9531: fix(sankey): modify the calculation of node value
URL: https://github.com/apache/incubator-echarts/pull/9531
 
 
   使用桑吉图的时候遇到一个问题:
   我的数据中,从某个node流出的数据可能会有流失,也就是说,这些node的outLinks的所有值的和,可能会小于node的值,所以就出问题了。
   ![image](https://user-images.githubusercontent.com/13739947/49501208-4bd3c300-f8ad-11e8-9071-bf31da00b7b5.png)
   
   出问题的原因,看了下源码,发现node的dy的计算方式为:
   ![image](https://user-images.githubusercontent.com/13739947/49501318-876e8d00-f8ad-11e8-9a50-e3539deb6f8f.png)
   是根据max(inLinks总值, outLinks总值)得出的,而links总值可能会<=node的总值,所以导致node的dy的计算出问题。
   所以做了如下改动:
   ![image](https://user-images.githubusercontent.com/13739947/49501438-cd2b5580-f8ad-11e8-949e-63a8c46dd3ec.png)
   我觉得这样做,不仅不影响sankey原来的效果,还能适应我说的这种流失情况。
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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