Skip to content

Commit 4968f8d

Browse files
authored
Merge pull request #26 from kurkle/issue25
Fix overlap with unbalanced flows
2 parents 0facf08 + 72aa15c commit 4968f8d

File tree

6 files changed

+1068
-4
lines changed

6 files changed

+1068
-4
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.html]
13+
indent_style = tab
14+
indent_size = 4

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chartjs-chart-sankey",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Chart.js module for creating sankey diagrams",
55
"main": "dist/chartjs-chart-sankey.js",
66
"module": "dist/chartjs-chart-sankey.esm.js",

src/layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function calculateYUsingPriority(nodeArray, maxX) {
119119
const nodes = nodeArray.filter(node => node.x === x).sort((a, b) => a.priority - b.priority);
120120
for (const node of nodes) {
121121
node.y = y;
122-
y += node.out;
122+
y += Math.max(node.out, node.in);
123123
}
124124
maxY = Math.max(y, maxY);
125125
}

0 commit comments

Comments
 (0)