Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a709417

Browse filesBrowse files
authored
Merge pull request #6429 from plotly/fix6407-line-redraw
Fix line redraw
2 parents b03f295 + d6bd87c commit a709417
Copy full SHA for a709417

File tree

Expand file treeCollapse file tree

3 files changed

+23
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+23
-1
lines changed

‎draftlogs/6429_fix.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix line redraw (regression introduced in 2.15.0) [[#6429](https://github.com/plotly/plotly.js/pull/6429)]

‎src/traces/scatter/plot.js

Copy file name to clipboardExpand all lines: src/traces/scatter/plot.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
248248
revpath = thisrevpath + 'Z' + revpath;
249249
}
250250

251-
if(subTypes.hasLines(trace) && pts.length > 1) {
251+
if(subTypes.hasLines(trace)) {
252252
var el = d3.select(this);
253253

254254
// This makes the coloring work correctly:

‎test/jasmine/tests/scatter_test.js

Copy file name to clipboardExpand all lines: test/jasmine/tests/scatter_test.js
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,27 @@ describe('end-to-end scatter tests', function() {
10351035
.then(done, done.fail);
10361036
});
10371037

1038+
it('updates line segments on redraw when having null values', function(done) {
1039+
function checkSegments(exp, msg) {
1040+
var lineSelection = d3Select(gd).selectAll('.scatterlayer .js-line');
1041+
expect(lineSelection.size()).toBe(exp, msg);
1042+
}
1043+
1044+
Plotly.newPlot(gd, [{
1045+
y: [1, null, 2, 3],
1046+
mode: 'lines+markers'
1047+
}])
1048+
.then(function() {
1049+
checkSegments(2, 'inital');
1050+
1051+
return Plotly.relayout(gd, 'xaxis.range', [0, 10]);
1052+
})
1053+
.then(function() {
1054+
checkSegments(2, 'after redraw');
1055+
})
1056+
.then(done, done.fail);
1057+
});
1058+
10381059
it('correctly autoranges fill tonext traces across multiple subplots', function(done) {
10391060
Plotly.newPlot(gd, [
10401061
{y: [3, 4, 5], fill: 'tonexty'},

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.