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

Function makePadAccessor

src/plots/cartesian/autorange.js:465–473  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

463 var i, v, di, dmin, dmax, ppadiplus, ppadiminus, vmin, vmax;
464
465 function makePadAccessor(item) {
466 if(Array.isArray(item)) {
467 hasArrayOption = true;
468 return function(i) { return Math.max(Number(item[i]||0), 0); };
469 } else {
470 var v = Math.max(Number(item||0), 0);
471 return function() { return v; };
472 }
473 }
474
475 var ppadplus = makePadAccessor((ax._m > 0 ?
476 opts.ppadplus : opts.ppadminus) || opts.ppad || 0);

Callers 1

findExtremesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…