
/*
* 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.
 */

"use strict";

exports.__esModule = true;

var prepareBoxplotData_1 = require("./prepareBoxplotData");

var util_1 = require("zrender/lib/core/util");

var log_1 = require("../../util/log");

exports.boxplotTransform = {
  type: 'echarts:boxplot',
  transform: function transform(params) {
    var source = params.source;
    var sourceData = source.data;

    if (!util_1.isArray(sourceData) || sourceData[0] && !util_1.isArray(sourceData[0])) {
      var errMsg = '';

      if (process.env.NODE_ENV !== 'production') {
        errMsg = log_1.makePrintable('source data is not applicable for this boxplot transform. Expect number[][].', 'But actually', sourceData);
      }

      log_1.throwError(errMsg);
    }

    var result = prepareBoxplotData_1["default"](source.data, params.config);
    return [{
      data: result.boxData
    }, {
      data: result.outliers
    }];
  }
};