import prepareSeriesDataSchema from '../../data/helper/createDimensions.mjs';
import SeriesData from '../../data/SeriesData.mjs';
import { isArray, extend } from '../../../../../../zrender@6.0.0/node_modules/zrender/lib/core/util.mjs';

/**
 * [Usage]:
 * (1)
 * createListSimply(seriesModel, ['value']);
 * (2)
 * createListSimply(seriesModel, {
 *     coordDimensions: ['value'],
 *     dimensionsCount: 5
 * });
 */
function createSeriesDataSimply(seriesModel, opt, nameList) {
  opt = isArray(opt) && {
    coordDimensions: opt
  } || extend({
    encodeDefine: seriesModel.getEncode()
  }, opt);
  var source = seriesModel.getSource();
  var dimensions = prepareSeriesDataSchema(source, opt).dimensions;
  var list = new SeriesData(dimensions, seriesModel);
  list.initData(source, nameList);
  return list;
}

export { createSeriesDataSimply as default };
