MCPcopy
hub / github.com/apache/echarts / setBatch

Method setBatch

src/component/toolbox/feature/DataZoom.ts:155–187  ·  view source on GitHub ↗
(
            dimName: 'x' | 'y',
            coordSys: Cartesian2D,
            coordSysRect: BoundingRect,
            minMax: number[]
        )

Source from the content-addressed store, hash-verified

153 this._dispatchZoomAction(snapshot);
154
155 function setBatch(
156 dimName: 'x' | 'y',
157 coordSys: Cartesian2D,
158 coordSysRect: BoundingRect,
159 minMax: number[]
160 ) {
161 const axis = coordSys.getAxis(dimName);
162 const axisModel = axis.model;
163 const dataZoomModel = findDataZoom(dimName, axisModel, ecModel);
164
165 // Restrict range.
166 const minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();
167 const scaleExtent = axis.scale.getExtent();
168 if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {
169 minMax = sliderMove(
170 0, minMax.slice(), scaleExtent, 0,
171 minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan
172 );
173 }
174
175 // Round for displayable.
176 const precision = getAcceptableTickPrecision(
177 scaleExtent,
178 coordSysRect[XY2WH[dimName]],
179 0.5
180 );
181
182 dataZoomModel && (snapshot[dataZoomModel.id] = {
183 dataZoomId: dataZoomModel.id,
184 startValue: isFinite(precision) ? round(minMax[0], precision) : minMax[0],
185 endValue: isFinite(precision) ? round(minMax[1], precision) : minMax[1]
186 });
187 }
188
189 function findDataZoom(
190 dimName: 'x' | 'y', axisModel: CartesianAxisModel, ecModel: GlobalModel

Callers

nothing calls this directly

Calls 7

roundFunction · 0.90
sliderMoveFunction · 0.85
getMinMaxSpanMethod · 0.80
getExtentMethod · 0.65
getAxisMethod · 0.45

Tested by

no test coverage detected