Add property to define size of a node in Sankey Chart
See original GitHub issueWhat 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:
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
{
"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
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);
});
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Add property to define size of a node in Sankey Chart
What problem does this feature solve? In the current implementation the node size in a Sankey chart is determined by the bigger number...
Read more >Sankey Diagram
Sankey Diagram is a type of flow diagram that depicts the flow of resources from one node to another. ... You can set...
Read more >Vizlib Sankey Chart - Data and Data Handling
Vizlib Sankey Chart supports one measure with multiple dimensions. In the Data section, you can add dimensions or metrics dynamically and ...
Read more >Sankey Diagram | Charts
A sankey diagram is a visualization used to depict a flow from one set of values to another. The things being connected are...
Read more >Dynamically change width of d3.js sankey chart
So user clicks node, chart shrinks to half it's width, and I can append content into the new space... Thing is, the d3...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe I can add new property
value
of each node, to keep consistent with graph series.Yeah, it is an integer, thanks.