Skip to content

Commit dc26aa9

Browse files
committed
Revert handling of zero coords
1 parent 6ed737a commit dc26aa9

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

‎src/traces/sankey/render.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ function sankeyModel(layout, d, traceIndex) {
270270
if(forcedNode.partOfGroup) continue;
271271

272272
var p = forcedNode.pointNumber;
273-
// Allow values of zero for coordinates
274-
if (trace.node.x[p] != null && trace.node.y[p] != null) {
273+
if (trace.node.x[p] && trace.node.y[p]) {
275274
var pos = [trace.node.x[p] * width, trace.node.y[p] * height];
276275
forcedNode.x0 = pos[0] - nodeThickness / 2;
277276
forcedNode.x1 = pos[0] + nodeThickness / 2;
@@ -1119,4 +1118,4 @@ module.exports = function(gd, svg, calcData, layout, callbacks) {
11191118
nodeLabel
11201119
.transition()
11211120
.ease(c.ease).duration(c.duration);
1122-
};
1121+
};

‎test/jasmine/tests/sankey_test.js‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -749,18 +749,6 @@ describe('sankey tests', function () {
749749
.then(done, done.fail);
750750
});
751751

752-
it('respects explicit positions of 0', (done) => {
753-
const fig = makeFixedMock();
754-
fig.data[0].node.x[2] = 0;
755-
fig.data[0].node.y[3] = 0;
756-
757-
Plotly.newPlot(gd, fig)
758-
.then(() => {
759-
assertPositions(fig.data[0], getCentersByIndex(), [0, 2, 3, 4], 'zero');
760-
})
761-
.then(done, done.fail);
762-
});
763-
764752
it('applies positions to the right nodes when nodes are grouped', (done) => {
765753
const fig = makeFixedMock();
766754
// Grouping nodes 3 and 4 leaves them unlinked and adds group node 5

0 commit comments

Comments
 (0)