MCPcopy Index your code
hub / github.com/plotly/plotly.js / handleAxisTypeDefaults

Function handleAxisTypeDefaults

src/plots/polar/layout_defaults.js:239–272  ·  view source on GitHub ↗
(axIn, axOut, coerce, subplotData, dataAttr, options)

Source from the content-addressed store, hash-verified

237}
238
239function 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
274module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
275 handleSubplotDefaults(layoutIn, layoutOut, fullData, {

Callers 1

handleDefaultsFunction · 0.85

Calls 1

coerceFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…