Skip to content

Commit 96b2dde

Browse files
committed
mapbox: don't try to use plot method when trace module DNE
- this handles the case where a 'visible: false' are passed in during the first plot call (the restyle case worked and works fine) - note 'that visible: false' traces do not get fullTrace._module during supply defaults.
1 parent f07a274 commit 96b2dde

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/plots/mapbox/mapbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ proto.updateData = function(calcData) {
212212
traceObj = traceHash[trace.uid];
213213

214214
if(traceObj) traceObj.update(calcTrace);
215-
else {
215+
else if(trace._module) {
216216
traceHash[trace.uid] = trace._module.plot(this, calcTrace);
217217
}
218218
}

test/jasmine/tests/mapbox_test.js

+6
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,12 @@ describe('mapbox plots', function() {
295295
}).then(function() {
296296
expect(countVisibleTraces(gd, modes)).toEqual(2);
297297

298+
mock.data[0].visible = false;
299+
300+
return Plotly.newPlot(gd, mock.data, mock.layout);
301+
}).then(function() {
302+
expect(countVisibleTraces(gd, modes)).toEqual(1);
303+
298304
done();
299305
});
300306
});

0 commit comments

Comments
 (0)