
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/


/**
 * AUTO-GENERATED FILE. DO NOT MODIFY.
 */

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
import { __extends } from "tslib";
// FIXME step not support polar
import LineDraw from '../helper/LineDraw.js';
import ChartView from '../../view/Chart.js';
import { createClipPath } from '../helper/createClipPathFromCoordSys.js';
import Line from '../helper/Line.js';
import { getECData } from '../../util/innerStore.js';
import { toggleHoverEmphasis } from '../../util/states.js';
var HLinesView = /** @class */function (_super) {
  __extends(HLinesView, _super);
  function HLinesView() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.type = HLinesView.type;
    return _this;
  }
  HLinesView.prototype.init = function (ecModel, api) {
    this._lineDraw = new LineDraw(Line);
    this.group.add(this._lineDraw.group);
  };
  HLinesView.prototype.render = function (seriesModel, ecModel, api) {
    var data = seriesModel.getData();
    var lineDraw = this._lineDraw;
    // const zlevel = seriesModel.get('zlevel');
    lineDraw.updateData(data);
    var emphasisState = seriesModel.get('emphasis').emphasisState;
    var groupId = seriesModel.get('groupId');
    var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);
    if (clipPath) {
      this.group.setClipPath(clipPath);
    } else {
      this.group.removeClipPath();
    }
    // this._lastZlevel = zlevel;
    this._finished = true;
    toggleHoverEmphasis(this.group, null, null, false);
    this.group.traverse(function (child) {
      child.states.emphasis = emphasisState;
    });
    getECData(this.group).groupId = groupId;
  };
  HLinesView.prototype.eachRendered = function (cb) {
    this._lineDraw && this._lineDraw.eachRendered(cb);
  };
  HLinesView.prototype.remove = function (ecModel, api) {
    this._lineDraw && this._lineDraw.remove();
    // this._lineDraw = null;
    // Clear motion when lineDraw is removed;
  };

  HLinesView.prototype.dispose = function (ecModel, api) {
    this._lineDraw && this._lineDraw.remove();
    this._lineDraw = null;
  };
  HLinesView.type = 'hlines';
  return HLinesView;
}(ChartView);
export default HLinesView;