Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/traces/sankey/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ function linkModel(uniqueKeys, d, l) {
var tc = tinycolor(l.color);
var basicKey = l.source.label + '|' + l.target.label;
var foundKey = uniqueKeys[basicKey];
uniqueKeys[basicKey] = (foundKey === void(0) ? foundKey : 0) + 1;
var key = basicKey + (foundKey === void(0) ? '' : '__' + foundKey);
uniqueKeys[basicKey] = (foundKey || 0) + 1;
var key = basicKey + '__' + uniqueKeys[basicKey];

// for event data
l.trace = d.trace;
Expand Down Expand Up @@ -186,8 +186,8 @@ function nodeModel(uniqueKeys, d, n) {

var basicKey = n.label;
var foundKey = uniqueKeys[basicKey];
uniqueKeys[basicKey] = (foundKey === void(0) ? foundKey : 0) + 1;
var key = basicKey + (foundKey === void(0) ? '' : '__' + foundKey);
uniqueKeys[basicKey] = (foundKey || 0) + 1;
var key = basicKey + '__' + uniqueKeys[basicKey];

// for event data
n.trace = d.trace;
Expand Down
Binary file modified test/image/baselines/sankey_energy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 15 additions & 5 deletions test/image/mocks/sankey_energy.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@
44,
45,
46,
47
47,
35,
35
],
"target": [
1,
Expand Down Expand Up @@ -263,7 +265,9 @@
15,
1,
15,
15
15,
26,
26
],
"value": [
124.729,
Expand Down Expand Up @@ -313,7 +317,7 @@
14.375,
122.952,
500,
339.978,
139.978,
504.287,
107.703,
611.99,
Expand All @@ -334,7 +338,9 @@
9.452,
182.01,
19.013,
289.366
289.366,
100,
100
],
"color": [
"rgba(0,0,96,0.2)",
Expand Down Expand Up @@ -405,7 +411,9 @@
"rgba(0,0,96,0.2)",
"rgba(0,0,96,0.2)",
"rgba(0,0,96,0.2)",
"rgba(0,0,96,0.2)"
"rgba(0,0,96,0.2)",
"lightgreen",
"goldenrod"
],
"label": [
"stream 1",
Expand Down Expand Up @@ -476,6 +484,8 @@
"",
"",
"",
"",
"",
""
]
}
Expand Down