Skip to content

Commit 5eb6202

Browse files
committed
replace .map with for-loops
1 parent 50d1288 commit 5eb6202

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/plots/cartesian/layout_defaults.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,22 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
123123

124124
function getCounterAxes(axLetter) {
125125
var list = {x: yaList, y: xaList}[axLetter];
126-
127-
return list.map(axisIds.name2id);
126+
return Lib.simpleMap(list, axisIds.name2id);
128127
}
129128

130129
function getOverlayableAxes(axLetter, axName) {
131130
var list = {x: xaList, y: yaList}[axLetter];
131+
var out = [];
132+
133+
for(var j = 0; j < list.length; j++) {
134+
var axName2 = list[j];
135+
136+
if(axName2 !== axName && !(layoutIn[axName2] || {}).overlaying) {
137+
out.push(axisIds.name2id(axName2));
138+
}
139+
}
132140

133-
return list.filter(function(axName2) {
134-
return axName2 !== axName && !(layoutIn[axName2] || {}).overlaying;
135-
})
136-
.map(axisIds.name2id);
141+
return out;
137142
}
138143

139144
for(i = 0; i < axesList.length; i++) {

0 commit comments

Comments
 (0)