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

Function applyAutorangeMaxOptions

src/plots/cartesian/autorange.js:656–676  ·  view source on GitHub ↗
(v, ax)

Source from the content-addressed store, hash-verified

654}
655
656function applyAutorangeMaxOptions(v, ax) {
657 var autorangeoptions = ax.autorangeoptions;
658
659 if(
660 autorangeoptions &&
661 autorangeoptions.maxallowed !== undefined &&
662 hasValidMinAndMax(ax, autorangeoptions.minallowed, autorangeoptions.maxallowed)
663 ) {
664 return autorangeoptions.maxallowed;
665 }
666
667 if(
668 autorangeoptions &&
669 autorangeoptions.clipmax !== undefined &&
670 hasValidMinAndMax(ax, autorangeoptions.clipmin, autorangeoptions.clipmax)
671 ) {
672 return Math.min(v, ax.d2l(autorangeoptions.clipmax));
673 }
674
675 return v;
676}
677
678function hasValidMinAndMax(ax, min, max) {
679 // in case both min and max are defined, ensure min < max

Callers 1

applyAutorangeOptionsFunction · 0.85

Calls 1

hasValidMinAndMaxFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…