Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f6f2048

Browse files
authored
Merge pull request #1567 from dfcreative/patch-1
Cast to empty array
2 parents e612205 + 569d7e5 commit f6f2048

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/components/errorbars/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ errorBars.calc = require('./calc');
1919

2020
errorBars.calcFromTrace = function(trace, layout) {
2121
var x = trace.x || [],
22-
y = trace.y,
22+
y = trace.y || [],
2323
len = x.length || y.length;
2424

2525
var calcdataMock = new Array(len);

test/jasmine/tests/gl_plot_interact_test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,20 @@ describe('Test gl2d plots', function() {
984984
.catch(fail)
985985
.then(done);
986986
});
987+
988+
it('should change plot type with incomplete data', function(done) {
989+
Plotly.plot(gd, [{}]);
990+
991+
expect(function() {
992+
Plotly.restyle(gd, {type: 'scattergl', x: [[1]]}, 0);
993+
}).not.toThrow();
994+
995+
expect(function() {
996+
Plotly.restyle(gd, {y: [[1]]}, 0);
997+
}).not.toThrow();
998+
999+
done();
1000+
});
9871001
});
9881002

9891003
describe('Test removal of gl contexts', function() {

0 commit comments

Comments
 (0)