Skip to content

Commit 85470a0

Browse files
committed
nodes that are part of a group should be in the back
1 parent d5f3cd5 commit 85470a0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/traces/sankey/calc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ function convertToD3Sankey(trace) {
8282
}
8383

8484
// if link originates from a node in a group, relink source to that group
85-
// if(group.indexOf(source) !== -1) {
8685
if(groupLookup.hasOwnProperty(source)) {
8786
source = groupLookup[source];
8887
}

src/traces/sankey/render.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function sankeyModel(layout, d, traceIndex) {
7979
}
8080
}
8181

82-
graph.nodes.push({
82+
graph.nodes.unshift({
8383
pointNumber: parseInt(nodePointNumber),
8484
x0: groupingNode.x0,
8585
x1: groupingNode.x1,
@@ -474,19 +474,19 @@ function attachPointerEvents(selection, sankey, eventSet) {
474474
selection
475475
.on('.basic', null) // remove any preexisting handlers
476476
.on('mouseover.basic', function(d) {
477-
if(!d.interactionState.dragInProgress) {
477+
if(!d.interactionState.dragInProgress && !d.partOfGroup) {
478478
eventSet.hover(this, d, sankey);
479479
d.interactionState.hovered = [this, d];
480480
}
481481
})
482482
.on('mousemove.basic', function(d) {
483-
if(!d.interactionState.dragInProgress) {
483+
if(!d.interactionState.dragInProgress && !d.partOfGroup) {
484484
eventSet.follow(this, d);
485485
d.interactionState.hovered = [this, d];
486486
}
487487
})
488488
.on('mouseout.basic', function(d) {
489-
if(!d.interactionState.dragInProgress) {
489+
if(!d.interactionState.dragInProgress && !d.partOfGroup) {
490490
eventSet.unhover(this, d, sankey);
491491
d.interactionState.hovered = false;
492492
}
@@ -496,7 +496,7 @@ function attachPointerEvents(selection, sankey, eventSet) {
496496
eventSet.unhover(this, d, sankey);
497497
d.interactionState.hovered = false;
498498
}
499-
if(!d.interactionState.dragInProgress) {
499+
if(!d.interactionState.dragInProgress && !d.partOfGroup) {
500500
eventSet.select(this, d, sankey);
501501
}
502502
});

0 commit comments

Comments
 (0)