Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mapbox visible false first draw #900

Merged
merged 1 commit into from
Sep 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/plots/mapbox/mapbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ proto.updateData = function(calcData) {
traceObj = traceHash[trace.uid];

if(traceObj) traceObj.update(calcTrace);
else {
else if(trace._module) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that visible: false traces do not get fullTrace._module during supply defaults.

traceHash[trace.uid] = trace._module.plot(this, calcTrace);
}
}
Expand Down
6 changes: 6 additions & 0 deletions test/jasmine/tests/mapbox_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ describe('mapbox plots', function() {
}).then(function() {
expect(countVisibleTraces(gd, modes)).toEqual(2);

mock.data[0].visible = false;

return Plotly.newPlot(gd, mock.data, mock.layout);
}).then(function() {
expect(countVisibleTraces(gd, modes)).toEqual(1);

done();
});
});
Expand Down