(axIn, axOut, coerce, subplotData, dataAttr, options)
| 237 | } |
| 238 | |
| 239 | function handleAxisTypeDefaults(axIn, axOut, coerce, subplotData, dataAttr, options) { |
| 240 | var autotypenumbers = coerce('autotypenumbers', options.autotypenumbersDflt); |
| 241 | var axType = coerce('type'); |
| 242 | |
| 243 | if(axType === '-') { |
| 244 | var trace; |
| 245 | |
| 246 | for(var i = 0; i < subplotData.length; i++) { |
| 247 | if(subplotData[i].visible) { |
| 248 | trace = subplotData[i]; |
| 249 | break; |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | if(trace && trace[dataAttr]) { |
| 254 | axOut.type = autoType(trace[dataAttr], 'gregorian', { |
| 255 | noMultiCategory: true, |
| 256 | autotypenumbers: autotypenumbers |
| 257 | }); |
| 258 | } |
| 259 | |
| 260 | if(axOut.type === '-') { |
| 261 | axOut.type = 'linear'; |
| 262 | } else { |
| 263 | // copy autoType back to input axis |
| 264 | // note that if this object didn't exist |
| 265 | // in the input layout, we have to put it in |
| 266 | // this happens in the main supplyDefaults function |
| 267 | axIn.type = axOut.type; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | return axOut.type; |
| 272 | } |
| 273 | |
| 274 | module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) { |
| 275 | handleSubplotDefaults(layoutIn, layoutOut, fullData, { |
no test coverage detected
searching dependent graphs…