import { mixin } from '../../../../../../zrender@6.0.0/node_modules/zrender/lib/core/util.mjs';
import createSeriesData from '../../chart/helper/createSeriesData.mjs';
import { createScaleByModel, niceScaleExtent } from '../../coord/axisHelper.mjs';
import { AxisModelCommonMixin } from '../../coord/axisModelCommonMixin.mjs';
import Model from '../../model/Model.mjs';
export { getLayoutRect } from '../../util/layout.mjs';
import { getStackedDimension, enableDataStack, isDimensionStacked } from '../../data/helper/dataStackHelper.mjs';
export { getECData } from '../../util/innerStore.mjs';
import { createTextStyle as createTextStyle$1 } from '../../label/labelStyle.mjs';
export { createDimensions } from '../../data/helper/createDimensions.mjs';
export { createSymbol } from '../../util/symbol.mjs';
export { enableHoverEmphasis } from '../../util/states.mjs';

/**
 * Create a multi dimension List structure from seriesModel.
 */
function createList(seriesModel) {
  return createSeriesData(null, seriesModel);
}
var dataStack = {
  isDimensionStacked: isDimensionStacked,
  enableDataStack: enableDataStack,
  getStackedDimension: getStackedDimension
};
/**
 * Create scale
 * @param {Array.<number>} dataExtent
 * @param {Object|module:echarts/Model} option If `optoin.type`
 *        is secified, it can only be `'value'` currently.
 */
function createScale(dataExtent, option) {
  var axisModel = option;
  if (!(option instanceof Model)) {
    axisModel = new Model(option);
    // FIXME
    // Currently AxisModelCommonMixin has nothing to do with the
    // the requirements of `axisHelper.createScaleByModel`. For
    // example the methods `getCategories` and `getOrdinalMeta`
    // are required for `'category'` axis, and ecModel is required
    // for `'time'` axis. But occasionally echarts-gl happened
    // to only use `'value'` axis.
    // zrUtil.mixin(axisModel, AxisModelCommonMixin);
  }
  var scale = createScaleByModel(axisModel);
  scale.setExtent(dataExtent[0], dataExtent[1]);
  niceScaleExtent(scale, axisModel);
  return scale;
}
/**
 * Mixin common methods to axis model,
 *
 * Include methods
 * `getFormattedLabels() => Array.<string>`
 * `getCategories() => Array.<string>`
 * `getMin(origin: boolean) => number`
 * `getMax(origin: boolean) => number`
 * `getNeedCrossZero() => boolean`
 */
function mixinAxisModelCommonMethods(Model) {
  mixin(Model, AxisModelCommonMixin);
}
function createTextStyle(textStyleModel, opts) {
  opts = opts || {};
  return createTextStyle$1(textStyleModel, null, null, opts.state !== 'normal');
}

export { createList, createScale, createTextStyle, dataStack, mixinAxisModelCommonMethods };
