Skip to content

Commit 0ed7584

Browse files
committed
refactor updateDerived method
1 parent cacf1e9 commit 0ed7584

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/plots/mapbox/mapbox.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
135135
Promise.all(promises).then(function() {
136136
self.fillBelowLookup(calcData, fullLayout);
137137
self.updateData(calcData);
138-
self.updateLayout(fullLayout, true);
138+
self.updateLayout(fullLayout);
139+
self.updateDerived();
139140
self.resolveOnRender(resolve);
140141
}).catch(reject);
141142
};
@@ -346,7 +347,7 @@ proto.updateData = function(calcData) {
346347
}
347348
};
348349

349-
proto.updateLayout = function(fullLayout, initialView) {
350+
proto.updateLayout = function(fullLayout) {
350351
var map = this.map;
351352
var opts = fullLayout[this.id];
352353

@@ -365,11 +366,10 @@ proto.updateLayout = function(fullLayout, initialView) {
365366
} else {
366367
map.scrollZoom.disable();
367368
}
368-
if(initialView === true) {
369-
// Add derived properties to viewInitial so they are included in
370-
// the plotly_relayout event that is emitted when the plot is reset
371-
this.viewInitial._derived = this.getView()._derived;
372-
}
369+
};
370+
371+
proto.updateDerived = function() {
372+
this.viewInitial._derived = this.getView()._derived;
373373
};
374374

375375
proto.resolveOnRender = function(resolve) {

0 commit comments

Comments
 (0)