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 2019/11/14 11:56:34 UTC

[GitHub] [incubator-echarts] peterviergutz opened a new issue #11644: Add property to define size of a node in Sankey Chart

peterviergutz opened a new issue #11644: Add property to define size of a node in Sankey Chart
URL: https://github.com/apache/incubator-echarts/issues/11644
 
 
   ### What problem does this feature solve?
   In the current implementation the node size in a Sankey chart is determined by the bigger number of incoming or outgoing edges. Our case involves a node size that is actually bigger than the connections between the nodes:
   
   ![expected](https://user-images.githubusercontent.com/568682/68852007-4bf05b80-06d7-11ea-9b0f-f18b10120181.png)
   
   ### What does the proposed API look like?
   An optional new property `size` on the nodes' properties could offer a clean option to define the node's size
   
   ```json
   {
     "nodes": [
       {
         "name": "a1",
         "size": 100
       }
   ...
   ```
   
   To get the node's size in the chart could then be determined by whatever is bigger: the sum of incoming and outgoing edges or the node's defined size in 
   
   https://github.com/apache/incubator-echarts/blob/fcfa95012ca561becab607b065a62b5f87220801/src/chart/sankey/sankeyLayout.js#L86
   
   ```js
   
   function computeNodeValues(nodes) {
     zrUtil.each(nodes, function (node) {
       var value1 = sum(node.outEdges, getEdgeValue);
       var value2 = sum(node.inEdges, getEdgeValue);
       var value = Math.max(value1, value2, node.size); // <-- node.size here
       node.setLayout({
         value: value
       }, true);
     });
   }
   ```
   
   <!-- 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:
users@infra.apache.org


With regards,
Apache Git Services

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