Skip to content

Commit 441ee32

Browse files
committed
Sankey multilink fix for 4+ multilinks
1 parent 98377fc commit 441ee32

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/traces/sankey/render.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function linkModel(uniqueKeys, d, l) {
155155
var tc = tinycolor(l.color);
156156
var basicKey = l.source.label + '|' + l.target.label;
157157
var foundKey = uniqueKeys[basicKey];
158-
uniqueKeys[basicKey] = (foundKey === void(0) ? foundKey : 0) + 1;
158+
uniqueKeys[basicKey] = (foundKey === void(0) ? 0 : foundKey) + 1;
159159
var key = basicKey + (foundKey === void(0) ? '' : '__' + foundKey);
160160

161161
// for event data

test/image/mocks/sankey_energy.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@
192192
44,
193193
45,
194194
46,
195-
47
195+
47,
196+
35,
197+
35
196198
],
197199
"target": [
198200
1,
@@ -263,7 +265,9 @@
263265
15,
264266
1,
265267
15,
266-
15
268+
15,
269+
26,
270+
26
267271
],
268272
"value": [
269273
124.729,
@@ -334,7 +338,9 @@
334338
9.452,
335339
182.01,
336340
19.013,
337-
289.366
341+
289.366,
342+
200,
343+
100
338344
],
339345
"color": [
340346
"rgba(0,0,96,0.2)",
@@ -405,7 +411,9 @@
405411
"rgba(0,0,96,0.2)",
406412
"rgba(0,0,96,0.2)",
407413
"rgba(0,0,96,0.2)",
408-
"rgba(0,0,96,0.2)"
414+
"rgba(0,0,96,0.2)",
415+
"lightgreen",
416+
"goldenrod"
409417
],
410418
"label": [
411419
"stream 1",
@@ -476,6 +484,8 @@
476484
"",
477485
"",
478486
"",
487+
"",
488+
"",
479489
""
480490
]
481491
}

0 commit comments

Comments
 (0)