
/*
* 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.
 */
/* global Float32Array */
import createRenderPlanner from '../helper/createRenderPlanner.js';
import { error } from '../../util/log.js';
import { each } from 'tvrender/lib/core/util.js';
var MinePolyLinesLayout = {
  seriesType: 'minePolyLines',
  plan: createRenderPlanner(),
  reset: function (seriesModel) {
    var coordSys = seriesModel.coordinateSystem;
    if (!coordSys) {
      if (process.env.NODE_ENV !== 'production') {
        error('The lines series must have a coordinate system.');
      }
      return;
    }
    var data = seriesModel.getData();
    return {
      progress: function (params, minePolyLinesData) {
        // const store = minePolyLinesData.getStore();
        var linesPointLayouts = [];
        var _loop_1 = function (i) {
          var itemModel = data.getItemModel(i);
          var _a = itemModel.get('itemStyle'),
            width = _a.width,
            _b = _a.color,
            color = _b === void 0 ? 'none' : _b,
            lineStyle = _a.lineStyle,
            _c = _a.fill,
            fill = _c === void 0 ? 'none' : _c,
            _d = _a.closed,
            closed_1 = _d === void 0 ? false : _d,
            _e = _a.curved,
            curved = _e === void 0 ? false : _e;
          if (!color && !fill) {
            return "continue";
          }
          var key = (color || 'none') + ":" + width + ":" + lineStyle + ":" + (fill || 'none') + ":" + closed_1 + ":" + curved;
          var points = itemModel.get('points');
          var itemPoints = [];
          each(points, function (item) {
            var point = coordSys.dataToPoint(item);
            itemPoints.push(point);
          });
          linesPointLayouts.push({
            key: key,
            points: itemPoints
          });
        };
        for (var i = params.start; i < params.end; i++) {
          _loop_1(i);
        }
        data.setLayout({
          linesPointLayouts: linesPointLayouts
        });
      }
    };
  }
};
export default MinePolyLinesLayout;