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

Function applyAutorangeOptions

src/plots/cartesian/autorange.js:693–722  ·  view source on GitHub ↗
(range, ax)

Source from the content-addressed store, hash-verified

691// this function should be (and is) called before reversing the range
692// so range[0] is the minimum and range[1] is the maximum
693function applyAutorangeOptions(range, ax) {
694 if(!ax || !ax.autorangeoptions) return range;
695
696 var min = range[0];
697 var max = range[1];
698
699 var include = ax.autorangeoptions.include;
700 if(include !== undefined) {
701 var lMin = ax.d2l(min);
702 var lMax = ax.d2l(max);
703
704 if(!Lib.isArrayOrTypedArray(include)) include = [include];
705 for(var i = 0; i < include.length; i++) {
706 var v = ax.d2l(include[i]);
707 if(lMin >= v) {
708 lMin = v;
709 min = v;
710 }
711 if(lMax <= v) {
712 lMax = v;
713 max = v;
714 }
715 }
716 }
717
718 min = applyAutorangeMinOptions(min, ax);
719 max = applyAutorangeMaxOptions(max, ax);
720
721 return [min, max];
722}

Callers 2

scene.jsFile · 0.85
getAutoRangeFunction · 0.85

Calls 2

applyAutorangeMinOptionsFunction · 0.85
applyAutorangeMaxOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…