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

Function scaleCalcNice2

src/coord/axisNiceTicks.ts:246–275  ·  view source on GitHub ↗
(
    scale: Scale,
    model: AxisBaseModel<NumericAxisBaseOptionCommon>,
    // Some call from external source, such as echarts-gl, may have no `axis` and `ecModel`,
    // but has `externalDataExtent`.
    axis: Axis | NullUndefined,
    ecModel: GlobalModel | NullUndefined,
    externalDataExtent: number[] | NullUndefined
)

Source from the content-addressed store, hash-verified

244 * @see SCALE_EXTENT_CONSTRUCTION for the full processing flow.
245 */
246export function scaleCalcNice2(
247 scale: Scale,
248 model: AxisBaseModel<NumericAxisBaseOptionCommon>,
249 // Some call from external source, such as echarts-gl, may have no `axis` and `ecModel`,
250 // but has `externalDataExtent`.
251 axis: Axis | NullUndefined,
252 ecModel: GlobalModel | NullUndefined,
253 externalDataExtent: number[] | NullUndefined
254): void {
255
256 const rawExtentResult = adoptScaleRawExtentInfoAndPrepare(scale, model, ecModel, axis, externalDataExtent);
257
258 const isIntervalOrTime = isIntervalScale(scale) || isTimeScale(scale);
259 scaleCalcNiceDirectly(scale, {
260 splitNumber: model.get('splitNumber'), // Backward compat - not get('xxx', true).
261 fixMinMax: rawExtentResult.fixMM,
262 userInterval: model.get('interval'), // Backward compat - not get('xxx', true).
263 minInterval: isIntervalOrTime ? model.get('minInterval') : null,
264 maxInterval: isIntervalOrTime ? model.get('maxInterval') : null,
265 rawExtentResult
266 });
267
268 if (axis && ecModel) {
269 adoptScaleExtentKindMapping(axis, scale, rawExtentResult, ecModel);
270 }
271
272 if (__DEV__) {
273 scale.freeze();
274 }
275}
276
277export function scaleCalcNiceDirectly(
278 scale: Scale,

Callers 3

doSingleTestDealFunction · 0.90
createScaleFunction · 0.90
scaleCalcNiceFunction · 0.85

Calls 7

isIntervalScaleFunction · 0.90
isTimeScaleFunction · 0.90
scaleCalcNiceDirectlyFunction · 0.85
freezeMethod · 0.80
getMethod · 0.45

Tested by 1

doSingleTestDealFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…