import { __extends } from "../../../node_modules/tslib/tslib.es6.mjs";
import { bind, each } from "../../../../../../zrender@5.4.4/node_modules/zrender/lib/core/util.mjs";
import SeriesModel from "../../model/Series.mjs";
import createSeriesData from "../helper/createSeriesData.mjs";
var ParallelSeriesModel = (
  /** @class */
  function(_super) {
    __extends(ParallelSeriesModel2, _super);
    function ParallelSeriesModel2() {
      var _this = _super !== null && _super.apply(this, arguments) || this;
      _this.type = ParallelSeriesModel2.type;
      _this.visualStyleAccessPath = "lineStyle";
      _this.visualDrawType = "stroke";
      return _this;
    }
    ParallelSeriesModel2.prototype.getInitialData = function(option, ecModel) {
      return createSeriesData(null, this, {
        useEncodeDefaulter: bind(makeDefaultEncode, null, this)
      });
    };
    ParallelSeriesModel2.prototype.getRawIndicesByActiveState = function(activeState) {
      var coordSys = this.coordinateSystem;
      var data = this.getData();
      var indices = [];
      coordSys.eachActiveState(data, function(theActiveState, dataIndex) {
        if (activeState === theActiveState) {
          indices.push(data.getRawIndex(dataIndex));
        }
      });
      return indices;
    };
    ParallelSeriesModel2.type = "series.parallel";
    ParallelSeriesModel2.dependencies = ["parallel"];
    ParallelSeriesModel2.defaultOption = {
      // zlevel: 0,
      z: 2,
      coordinateSystem: "parallel",
      parallelIndex: 0,
      label: {
        show: false
      },
      inactiveOpacity: 0.05,
      activeOpacity: 1,
      lineStyle: {
        width: 1,
        opacity: 0.45,
        type: "solid"
      },
      emphasis: {
        label: {
          show: false
        }
      },
      progressive: 500,
      smooth: false,
      animationEasing: "linear"
    };
    return ParallelSeriesModel2;
  }(SeriesModel)
);
function makeDefaultEncode(seriesModel) {
  var parallelModel = seriesModel.ecModel.getComponent("parallel", seriesModel.get("parallelIndex"));
  if (!parallelModel) {
    return;
  }
  var encodeDefine = {};
  each(parallelModel.dimensions, function(axisDim) {
    var dataDimIndex = convertDimNameToNumber(axisDim);
    encodeDefine[axisDim] = dataDimIndex;
  });
  return encodeDefine;
}
function convertDimNameToNumber(dimName) {
  return +dimName.replace("dim", "");
}
const ParallelSeriesModel$1 = ParallelSeriesModel;
export {
  ParallelSeriesModel$1 as default
};
