MCPcopy Create free account
hub / github.com/apache/echarts / _resetRange

Method _resetRange

src/component/visualMap/ContinuousModel.ts:143–160  ·  view source on GitHub ↗

* @private

()

Source from the content-addressed store, hash-verified

141 * @private
142 */
143 _resetRange() {
144 const dataExtent = this.getExtent();
145 const range = this.option.range;
146
147 if (!range || (range as RangeWithAuto).auto) {
148 // `range` should always be array (so we don't use other
149 // value like 'auto') for user-friend. (consider getOption).
150 (dataExtent as RangeWithAuto).auto = 1;
151 this.option.range = dataExtent;
152 }
153 else if (zrUtil.isArray(range)) {
154 if (range[0] > range[1]) {
155 range.reverse();
156 }
157 range[0] = Math.max(range[0], dataExtent[0]);
158 range[1] = Math.min(range[1], dataExtent[1]);
159 }
160 }
161
162 /**
163 * @protected

Callers 2

optionUpdatedMethod · 0.95
setSelectedMethod · 0.95

Calls 1

getExtentMethod · 0.65

Tested by

no test coverage detected