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

Clear axis types on some restyle calls #1295

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@ axes.coercePosition = function(containerOut, gd, coerce, axRef, attr, dflt) {
// empty out types for all axes containing these traces
// so we auto-set them again
axes.clearTypes = function(gd, traces) {
if(!Array.isArray(traces) || !traces.length) {
traces = (gd._fullData).map(function(d, i) { return i; });
var fullData = gd._fullData;
var mockGd = { _fullLayout: gd.layout };

for(var i = 0; i < traces.length; i++) {
var trace = fullData[traces[i]];

(axes.getFromId(mockGd, trace.xaxis) || {}).type = '-';
(axes.getFromId(mockGd, trace.xaxis) || {}).type = '-';
}
traces.forEach(function(tracenum) {
var trace = gd.data[tracenum];
delete (axes.getFromId(gd, trace.xaxis) || {}).type;
delete (axes.getFromId(gd, trace.yaxis) || {}).type;
});
};

// get counteraxis letter for this axis (name or id)
Expand Down