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

Function createScale

src/export/api/helper.ts:84–105  ·  view source on GitHub ↗
(dataExtent: number[], option: object | AxisBaseModel)

Source from the content-addressed store, hash-verified

82 * is specified, it can only be `'value'` currently.
83 */
84export function createScale(dataExtent: number[], option: object | AxisBaseModel) {
85 let axisModel = option;
86 if (!(option instanceof Model)) {
87 axisModel = new Model(option);
88 // FIXME
89 // Currently AxisModelCommonMixin has nothing to do with the
90 // the requirements of `axisHelper.createScaleByModel`. For
91 // example the methods `getCategories` and `getOrdinalMeta`
92 // are required for `'category'` axis, and ecModel is required
93 // for `'time'` axis. But occasionally echarts-gl happened
94 // to only use `'value'` axis.
95 // zrUtil.mixin(axisModel, AxisModelCommonMixin);
96 }
97
98 const axisType = axisHelper.determineAxisType(axisModel as AxisBaseModel);
99 const scale = axisHelper.createScaleByModel(axisModel as AxisBaseModel, axisType, false);
100 if (dataExtent[1] < dataExtent[0]) {
101 dataExtent = dataExtent.slice().reverse();
102 }
103 scaleCalcNice2(scale, axisModel as AxisBaseModel, null, null, dataExtent);
104 return scale;
105}
106
107/**
108 * Mixin common methods to axis model

Callers

nothing calls this directly

Calls 1

scaleCalcNice2Function · 0.90

Tested by

no test coverage detected