From 3d1e86fcad336ebdebd474d1d75fe3b2c714d4f2 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Sun, 8 Jan 2023 16:39:23 -0500 Subject: [PATCH 1/3] fix clear lines - issue 6407 --- src/traces/scatter/plot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/traces/scatter/plot.js b/src/traces/scatter/plot.js index 3a63470687e..6a3bc9ee0d3 100644 --- a/src/traces/scatter/plot.js +++ b/src/traces/scatter/plot.js @@ -248,7 +248,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition revpath = thisrevpath + 'Z' + revpath; } - if(subTypes.hasLines(trace) && pts.length > 1) { + if(subTypes.hasLines(trace)) { var el = d3.select(this); // This makes the coloring work correctly: From 1d61cf06ee0b9450207c83c3656c99ba5f9e0b25 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Sun, 8 Jan 2023 17:11:39 -0500 Subject: [PATCH 2/3] add test to lock issue 6407 --- test/jasmine/tests/scatter_test.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/jasmine/tests/scatter_test.js b/test/jasmine/tests/scatter_test.js index 570c13aef9a..d6b537535b0 100644 --- a/test/jasmine/tests/scatter_test.js +++ b/test/jasmine/tests/scatter_test.js @@ -1035,6 +1035,27 @@ describe('end-to-end scatter tests', function() { .then(done, done.fail); }); + it('updates line segments on redraw when having null values', function(done) { + function checkSegments(exp, msg) { + var lineSelection = d3Select(gd).selectAll('.scatterlayer .js-line'); + expect(lineSelection.size()).toBe(exp, msg); + } + + Plotly.newPlot(gd, [{ + y: [1, null, 2, 3], + mode: 'lines+markers' + }]) + .then(function() { + checkSegments(2, 'inital'); + + return Plotly.relayout(gd, 'xaxis.range', [0, 10]); + }) + .then(function() { + checkSegments(2, 'after redraw'); + }) + .then(done, done.fail); + }); + it('correctly autoranges fill tonext traces across multiple subplots', function(done) { Plotly.newPlot(gd, [ {y: [3, 4, 5], fill: 'tonexty'}, From d6bd87c45de8a6d206e91b635120caae4bd72fc7 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Mon, 9 Jan 2023 09:42:53 -0500 Subject: [PATCH 3/3] log for PR 6429 --- draftlogs/6429_fix.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 draftlogs/6429_fix.md diff --git a/draftlogs/6429_fix.md b/draftlogs/6429_fix.md new file mode 100644 index 00000000000..a6f2f8f205a --- /dev/null +++ b/draftlogs/6429_fix.md @@ -0,0 +1 @@ + - Fix line redraw (regression introduced in 2.15.0) [[#6429](https://github.com/plotly/plotly.js/pull/6429)]