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

Skip to content

Commit bc8d225

Browse files
committed
make Axes.clearTypes functional again
1 parent 6ebf221 commit bc8d225

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/plots/cartesian/axes.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,15 @@ axes.coercePosition = function(containerOut, gd, coerce, axRef, attr, dflt) {
133133
// empty out types for all axes containing these traces
134134
// so we auto-set them again
135135
axes.clearTypes = function(gd, traces) {
136-
if(!Array.isArray(traces) || !traces.length) {
137-
traces = (gd._fullData).map(function(d, i) { return i; });
136+
var fullData = gd._fullData;
137+
var mockGd = { _fullLayout: gd.layout };
138+
139+
for(var i = 0; i < traces.length; i++) {
140+
var trace = fullData[traces[i]];
141+
142+
(axes.getFromId(mockGd, trace.xaxis) || {}).type = '-';
143+
(axes.getFromId(mockGd, trace.xaxis) || {}).type = '-';
138144
}
139-
traces.forEach(function(tracenum) {
140-
var trace = gd.data[tracenum];
141-
delete (axes.getFromId(gd, trace.xaxis) || {}).type;
142-
delete (axes.getFromId(gd, trace.yaxis) || {}).type;
143-
});
144145
};
145146

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

0 commit comments

Comments
 (0)