MCPcopy
hub / github.com/chartjs/Chart.js / handleTickRangeOptions

Method handleTickRangeOptions

src/scales/scale.logarithmic.js:131–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129 }
130
131 handleTickRangeOptions() {
132 const {minDefined, maxDefined} = this.getUserBounds();
133 let min = this.min;
134 let max = this.max;
135
136 const setMin = v => (min = minDefined ? min : v);
137 const setMax = v => (max = maxDefined ? max : v);
138
139 if (min === max) {
140 if (min <= 0) { // includes null
141 setMin(1);
142 setMax(10);
143 } else {
144 setMin(changeExponent(min, -1));
145 setMax(changeExponent(max, +1));
146 }
147 }
148 if (min <= 0) {
149 setMin(changeExponent(max, -1));
150 }
151 if (max <= 0) {
152
153 setMax(changeExponent(min, +1));
154 }
155
156 this.min = min;
157 this.max = max;
158 }
159
160 buildTicks() {
161 const opts = this.options;

Callers 1

determineDataLimitsMethod · 0.95

Calls 2

changeExponentFunction · 0.85
getUserBoundsMethod · 0.65

Tested by

no test coverage detected