(dataExtent: number[], option: object | AxisBaseModel)
| 82 | * is specified, it can only be `'value'` currently. |
| 83 | */ |
| 84 | export 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 |
nothing calls this directly
no test coverage detected