"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Area = void 0;
var tslib_1 = require("tslib");
var util_1 = require("@antv/util");
var plot_1 = require("../../core/plot");
var percent_1 = require("../../utils/transform/percent");
var utils_1 = require("../../utils");
var adaptor_1 = require("./adaptor");
var constants_1 = require("./constants");
var Area = /** @class */ (function (_super) {
    tslib_1.__extends(Area, _super);
    function Area() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        /** 图表类型 */
        _this.type = 'area';
        return _this;
    }
    /**
     * 获取 面积图 默认配置项
     * 供外部使用
     */
    Area.getDefaultOptions = function () {
        return constants_1.DEFAULT_OPTIONS;
    };
    /**
     * 获取 面积图 默认配置
     */
    Area.prototype.getDefaultOptions = function () {
        return Area.getDefaultOptions();
    };
    /**
     * @override
     * @param data
     */
    Area.prototype.changeData = function (data) {
        this.updateOption({ data: data });
        var _a = this, chart = _a.chart, options = _a.options;
        var isPercent = options.isPercent, xField = options.xField, yField = options.yField;
        adaptor_1.meta({ chart: chart, options: options });
        var chartdata = percent_1.getDataWhetherPecentage(data, yField, xField, yField, isPercent);
        this.chart.changeData(chartdata);
        var pointView = utils_1.findViewById(this.chart, constants_1.POINT_VIEW_ID);
        if (pointView) {
            pointView.changeData(data.filter(function (d) { return !util_1.isNil(d[yField]); }));
        }
    };
    /**
     * 获取 面积图 的适配器
     */
    Area.prototype.getSchemaAdaptor = function () {
        return adaptor_1.adaptor;
    };
    return Area;
}(plot_1.Plot));
exports.Area = Area;
//# sourceMappingURL=index.js.map