UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

1,519 lines 56.8 kB
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { LabelsPosition_$type } from "./LabelsPosition";
import { Visibility_$type } from "igniteui-angular-core";
import { LeaderLineType_$type } from "./LeaderLineType";
import { OthersCategoryType_$type } from "igniteui-angular-core";
import { IgxIndexCollection } from "./igx-index-collection";
import { SweepDirection_$type } from "igniteui-angular-core";
import { LegendEmptyValuesMode_$type } from "igniteui-angular-core";
import { SliceSelectionMode_$type } from "./SliceSelectionMode";
import { IgxObjectCollection } from "igniteui-angular-core";
import { IgxLabelClickEventArgs } from "./igx-label-click-event-args";
import { IgxSelectedItemChangingEventArgs } from "./igx-selected-item-changing-event-args";
import { IgxSelectedItemsChangingEventArgs } from "./igx-selected-items-changing-event-args";
import { IgxSelectedItemChangedEventArgs } from "./igx-selected-item-changed-event-args";
import { IgxSelectedItemsChangedEventArgs } from "./igx-selected-items-changed-event-args";
import { IgxSliceClickEventArgs } from "./igx-slice-click-event-args";
import { IgxSliceEventArgs } from "./igx-slice-event-args";
import { TypeRegistrar, Number_$type, Base } from "igniteui-angular-core";
import { NamePatcher, ensureEnum, brushToString, stringToBrush, ensureBool, toBrushCollection, fromBrushCollection, arrayFindByName, toSpinal, initializePropertiesFromCss, toPoint } from "igniteui-angular-core";
import { IndexCollection as IndexCollection_internal } from "./IndexCollection";
import { SyncableObservableCollection$1 } from "igniteui-angular-core";
import { Style } from "igniteui-angular-core";
import { ObjectCollection as ObjectCollection_internal } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the base class for the pie chart.
*/
var IgxPieChartBaseComponent = /** @class */ /*@__PURE__*/ (function () {
    function IgxPieChartBaseComponent() {
        this._explodedSlices = null;
        this._selectedItems = null;
        this.__p = null;
        this._hasUserValues = new Set();
        this._stylingContainer = null;
        this._stylingParent = null;
        this._inStyling = false;
        this._labelClick = null;
        this._selectedItemChanging = null;
        this._selectedItemsChanging = null;
        this._selectedItemChanged = null;
        this._selectedItemsChanged = null;
        this._sliceClick = null;
        this._sliceEnter = null;
        this._sliceLeave = null;
        this._sliceHover = null;
        this._zoneRunner = null;
        if (this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
        }
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._initializeAdapters) {
            this._initializeAdapters();
        }
    }
    IgxPieChartBaseComponent.prototype.createImplementation = function () {
        return null;
    };
    IgxPieChartBaseComponent.prototype.ngOnInit = function () {
    };
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        } /**
                                     * @hidden
                                     */,
        enumerable: false,
        configurable: true
    });
    IgxPieChartBaseComponent._createFromInternal = function (internal) {
        if (!internal) {
            return null;
        }
        if (!internal.$type) {
            return null;
        }
        var name = internal.$type.name;
        var externalName = "Igx" + name + "Component";
        if (!TypeRegistrar.isRegistered(externalName)) {
            return null;
        }
        return TypeRegistrar.create(externalName);
    };
    IgxPieChartBaseComponent.prototype.onImplementationCreated = function () {
    };
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "innerExtent", {
        /**
         * Gets or sets the amount of space between the center and the start of the arc. This property should be set between 0 and 1.
         * If InnerExtent is set to a value greater than 1, it will be interpreted as a percentage, effectively divided by 100.
        */
        get: function () {
            return this.i.da;
        },
        set: function (v) {
            this.i.da = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "valueMemberPath", {
        /**
         * Gets or Sets the property name that contains the values.
        */
        get: function () {
            return this.i.fv;
        },
        set: function (v) {
            this.i.fv = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "labelMemberPath", {
        /**
         * Gets or sets the property name that contains the labels.
        */
        get: function () {
            return this.i.ej;
        },
        set: function (v) {
            this.i.ej = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "legendLabelMemberPath", {
        /**
         * Gets or sets the property name that contains the legend labels.
        */
        get: function () {
            return this.i.ez;
        },
        set: function (v) {
            this.i.ez = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "labelsPosition", {
        /**
         * Gets or sets the position of chart labels.
        */
        get: function () {
            return this.i.az;
        },
        set: function (v) {
            this.i.az = ensureEnum(LabelsPosition_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "labelOuterColor", {
        /**
         * Gets or sets the color for labels rendered outside of the pie chart.
        */
        get: function () {
            return brushToString(this.i.i1);
        },
        set: function (v) {
            this.i.i1 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "labelInnerColor", {
        /**
         * Gets or sets the color for labels rendered inside of the pie chart.
        */
        get: function () {
            return brushToString(this.i.i0);
        },
        set: function (v) {
            this.i.i0 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "actualLabelOuterColor", {
        /**
         * Gets the actual color for labels rendered outside of the pie chart.
        */
        get: function () {
            return brushToString(this.i.iz);
        },
        set: function (v) {
            this.i.iz = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "actualLabelInnerColor", {
        /**
         * Gets the actual color for labels rendered inside of the pie chart.
        */
        get: function () {
            return brushToString(this.i.iy);
        },
        set: function (v) {
            this.i.iy = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "leaderLineVisibility", {
        /**
         * Gets or sets whether the leader lines are visible.
        */
        get: function () {
            return this.i.je;
        },
        set: function (v) {
            this.i.je = ensureEnum(Visibility_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "leaderLineType", {
        /**
         * Gets or sets what type of leader lines will be used for the outside end labels.
        */
        get: function () {
            return this.i.a0;
        },
        set: function (v) {
            this.i.a0 = ensureEnum(LeaderLineType_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "leaderLineMargin", {
        /**
         * Gets or sets the margin between a label and the end of its leader line. The default is 6 pixels.
        */
        get: function () {
            return this.i.dc;
        },
        set: function (v) {
            this.i.dc = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "toolTip", {
        /**
         * Gets or sets the ToolTip for the chart.
        */
        get: function () {
            return this.i.dr;
        },
        set: function (v) {
            this.i.dr = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "othersCategoryThreshold", {
        /**
         * Gets or sets the threshold value that determines if slices are grouped into the Others slice.
        */
        get: function () {
            return this.i.dd;
        },
        set: function (v) {
            this.i.dd = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "othersCategoryType", {
        /**
         * Gets or sets whether to use numeric or percent-based threshold value.
        */
        get: function () {
            return this.i.a2;
        },
        set: function (v) {
            this.i.a2 = ensureEnum(OthersCategoryType_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "othersCategoryText", {
        /**
         * Gets or sets the label of the Others slice.
        */
        get: function () {
            return this.i.e6;
        },
        set: function (v) {
            this.i.e6 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "explodedRadius", {
        /**
         * Determines how much the exploded slice is offset from the center. Value between 0 and 1.
        */
        get: function () {
            return this.i.c5;
        },
        set: function (v) {
            this.i.c5 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "radiusFactor", {
        /**
         * Gets or sets the scaling factor of the chart's radius. Value between 0 and 1.
        */
        get: function () {
            return this.i.dg;
        },
        set: function (v) {
            this.i.dg = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "allowSliceSelection", {
        /**
         * Gets or sets whether the slices can be selected.
        */
        get: function () {
            return this.i.b9;
        },
        set: function (v) {
            this.i.b9 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "allowSliceExplosion", {
        /**
         * Gets or sets whether the slices can be exploded.
        */
        get: function () {
            return this.i.b8;
        },
        set: function (v) {
            this.i.b8 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "explodedSlices", {
        /**
         * Gets or sets the collection of exploded slice indices.
        */
        get: function () {
            if (this._explodedSlices === null) {
                var coll = new IgxIndexCollection();
                var innerColl = this.i.explodedSlices;
                if (!innerColl) {
                    innerColl = new IndexCollection_internal();
                }
                this._explodedSlices = coll._fromInner(innerColl);
                this.i.explodedSlices = innerColl;
            }
            return this._explodedSlices;
        },
        set: function (v) {
            if (this._explodedSlices !== null) {
                this._explodedSlices._setSyncTarget(null);
                this._explodedSlices = null;
            }
            var coll = new IgxIndexCollection();
            this._explodedSlices = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(Number_$type);
            var innerColl = this.i.explodedSlices;
            if (!innerColl) {
                innerColl = new IndexCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._explodedSlices._setSyncTarget(syncColl);
            this.i.explodedSlices = innerColl;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "labelExtent", {
        /**
         * Gets or sets the pixel amount by which the labels are offset from the edge of the slices.
        */
        get: function () {
            return this.i.db;
        },
        set: function (v) {
            this.i.db = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "startAngle", {
        /**
         * Gets or sets the starting angle of the chart.
         * The default zero value is equivalent to 3 o'clock.
        */
        get: function () {
            return this.i.di;
        },
        set: function (v) {
            this.i.di = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "sweepDirection", {
        /**
         * Gets or sets the rotational direction of the chart.
        */
        get: function () {
            return this.i.i3;
        },
        set: function (v) {
            this.i.i3 = ensureEnum(SweepDirection_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "othersCategoryFill", {
        /**
         * Gets or sets the fill brush.
        */
        get: function () {
            return this.i.jb ? this.i.jb.fill : null;
        },
        set: function (v) {
            this.ensureOthersCategoryStyle();
            this.i.jb.fill = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "othersCategoryStroke", {
        /**
         * Gets or sets the stroke brush.
        */
        get: function () {
            return this.i.jb ? this.i.jb.stroke : null;
        },
        set: function (v) {
            this.ensureOthersCategoryStyle();
            this.i.jb.stroke = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "othersCategoryStrokeThickness", {
        /**
         * Gets or sets the stroke thickness.
        */
        get: function () {
            return this.i.jb ? this.i.jb.strokeThickness : NaN;
        },
        set: function (v) {
            this.ensureOthersCategoryStyle();
            this.i.jb.strokeThickness = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "othersCategoryOpacity", {
        /**
         * Gets or sets the opacity.
        */
        get: function () {
            return this.i.jb ? this.i.jb.opacity : NaN;
        },
        set: function (v) {
            this.ensureOthersCategoryStyle();
            this.i.jb.opacity = +v;
        },
        enumerable: false,
        configurable: true
    });
    IgxPieChartBaseComponent.prototype.ensureOthersCategoryStyle = function () {
        if (this.i.jb) {
            return;
        }
        this.i.jb = new Style();
    };
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedSliceFill", {
        /**
         * Gets or sets the fill brush.
        */
        get: function () {
            return this.i.jc ? this.i.jc.fill : null;
        },
        set: function (v) {
            this.ensureSelectedStyle();
            this.i.jc.fill = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedSliceStroke", {
        /**
         * Gets or sets the stroke brush.
        */
        get: function () {
            return this.i.jc ? this.i.jc.stroke : null;
        },
        set: function (v) {
            this.ensureSelectedStyle();
            this.i.jc.stroke = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedSliceStrokeThickness", {
        /**
         * Gets or sets the stroke thickness.
        */
        get: function () {
            return this.i.jc ? this.i.jc.strokeThickness : NaN;
        },
        set: function (v) {
            this.ensureSelectedStyle();
            this.i.jc.strokeThickness = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedSliceOpacity", {
        /**
         * Gets or sets the opacity.
        */
        get: function () {
            return this.i.jc ? this.i.jc.opacity : NaN;
        },
        set: function (v) {
            this.ensureSelectedStyle();
            this.i.jc.opacity = +v;
        },
        enumerable: false,
        configurable: true
    });
    IgxPieChartBaseComponent.prototype.ensureSelectedStyle = function () {
        if (this.i.jc) {
            return;
        }
        this.i.jc = new Style();
    };
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "brushes", {
        /**
         * Gets or sets the palette of brushes to use for coloring the slices.
        */
        get: function () {
            return fromBrushCollection(this.i.am);
        },
        set: function (v) {
            this.i.am = toBrushCollection(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "actualBrushes", {
        /**
         * Gets the actual palette of brushes to use for coloring the slices.
        */
        get: function () {
            return fromBrushCollection(this.i.ak);
        },
        set: function (v) {
            this.i.ak = toBrushCollection(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "outlines", {
        /**
         * Gets or sets the palette of brushes to use for outlines on the slices.
        */
        get: function () {
            return fromBrushCollection(this.i.an);
        },
        set: function (v) {
            this.i.an = toBrushCollection(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "actualOutlines", {
        /**
         * Gets the actual palette of brushes to use for outlines on the slices.
        */
        get: function () {
            return fromBrushCollection(this.i.al);
        },
        set: function (v) {
            this.i.al = toBrushCollection(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "labelFormat", {
        /**
         * Gets or sets the label format string to use for the label.
        */
        get: function () {
            return this.i.ef;
        },
        set: function (v) {
            this.i.ef = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "labelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the LabelFormat string.
        */
        get: function () {
            return this.i.ag;
        },
        set: function (v) {
            if (v && !Array.isArray(v) && typeof (v) == "string") {
                var re = /\s*(?:,|\s|$)\s*/gm;
                v = v.split(re);
            }
            this.i.ag = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "othersLabelFormat", {
        /**
         * Gets or sets the label format string to use for the label.
        */
        get: function () {
            return this.i.fa;
        },
        set: function (v) {
            this.i.fa = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "othersLabelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the OthersLabelFormat string.
        */
        get: function () {
            return this.i.aj;
        },
        set: function (v) {
            if (v && !Array.isArray(v) && typeof (v) == "string") {
                var re = /\s*(?:,|\s|$)\s*/gm;
                v = v.split(re);
            }
            this.i.aj = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "legendLabelFormat", {
        /**
         * Gets or sets the label format string to use for the label.
        */
        get: function () {
            return this.i.ew;
        },
        set: function (v) {
            this.i.ew = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "legendLabelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the LegendLabelFormat string.
        */
        get: function () {
            return this.i.ah;
        },
        set: function (v) {
            if (v && !Array.isArray(v) && typeof (v) == "string") {
                var re = /\s*(?:,|\s|$)\s*/gm;
                v = v.split(re);
            }
            this.i.ah = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "legendOthersLabelFormat", {
        /**
         * Gets or sets the label format string to use for the label.
        */
        get: function () {
            return this.i.e1;
        },
        set: function (v) {
            this.i.e1 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "legendOthersLabelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the LegendOthersLabelFormat string.
        */
        get: function () {
            return this.i.ai;
        },
        set: function (v) {
            if (v && !Array.isArray(v) && typeof (v) == "string") {
                var re = /\s*(?:,|\s|$)\s*/gm;
                v = v.split(re);
            }
            this.i.ai = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "legendItemTemplate", {
        /**
         * Gets or sets the LegendItemTemplate property.
         * The legend item control content is created according to the LegendItemTemplate on-demand by
         * the chart object itself.
        */
        get: function () {
            return this.i.legendItemTemplate;
        },
        set: function (v) {
            this.i.legendItemTemplate = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "legendItemBadgeTemplate", {
        /**
         * Gets or sets the LegendItemBadgeTemplate property.
         * The legend item badge is created according to the LegendItemBadgeTemplate on-demand by
         * the chart object itself.
        */
        get: function () {
            return this.i.legendItemBadgeTemplate;
        },
        set: function (v) {
            this.i.legendItemBadgeTemplate = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "isDragInteractionEnabled", {
        /**
         * Gets or sets whether the pie chart will handle drag interaction and make them avaiilable in its events.
        */
        get: function () {
            return this.i.ce;
        },
        set: function (v) {
            this.i.ce = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "isSurfaceInteractionDisabled", {
        /**
         * Gets or sets whether all surface interactions with the plot area should be disabled.
        */
        get: function () {
            return this.i.cf;
        },
        set: function (v) {
            this.i.cf = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "shouldDisplayMockData", {
        /**
         * Gets or sets whether the pie chart should display mock data when data isn't present.
        */
        get: function () {
            return this.i.ch;
        },
        set: function (v) {
            this.i.ch = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "shouldUseSkeletonStyleForMockData", {
        /**
         * Gets or sets whether the pie chart should use a skeleton style for mock data.
        */
        get: function () {
            return this.i.ci;
        },
        set: function (v) {
            this.i.ci = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "legendEmptyValuesMode", {
        /**
         * Determines display mode for zero values in the legend.
         * For example, handling zero values as valid slices and providing them with proper appearance settings.
        */
        get: function () {
            return this.i.a1;
        },
        set: function (v) {
            this.i.a1 = ensureEnum(LegendEmptyValuesMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "formatLabel", {
        /**
         * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart.
        */
        get: function () {
            return this.i.a5;
        },
        set: function (v) {
            this.i.a5 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "formatLegendLabel", {
        /**
         * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart's legend.
        */
        get: function () {
            return this.i.a6;
        },
        set: function (v) {
            this.i.a6 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "pixelScalingRatio", {
        /**
         * Gets or sets the scaling value used to affect the pixel density of the control.
         * A higher scaling ratio will produce crisper visuals at the expense of memory.  Lower values will cause the control
         * to appear blurry.
        */
        get: function () {
            return this.i.df;
        },
        set: function (v) {
            this.i.df = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "actualPixelScalingRatio", {
        /**
         * Resolved pixel scaling ratio. Unless explicitly overridden by the
         * PieChartBase.PixelScalingRatio property,
         * this one returns the default ratio enforced by device. High resolution devices will initialize this property
         * to a higher value.
        */
        get: function () {
            return this.i.c2;
        },
        set: function (v) {
            this.i.c2 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectionMode", {
        /**
         * Gets or sets which mode to use for selecting slices.
        */
        get: function () {
            return this.i.bk;
        },
        set: function (v) {
            this.i.bk = ensureEnum(SliceSelectionMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedItem", {
        /**
         * Gets or sets the currently selected data item.  If a different data item is provided the pie chart
         * will select the slice associated with the new item.
        */
        get: function () {
            return this.i.selectedItem;
        },
        set: function (v) {
            this.i.selectedItem = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedItems", {
        /**
         * Gets the currently selected data items.  Adding or removing data items from this collection will
         * select or deselect the slices associated with those items.
        */
        get: function () {
            if (this._selectedItems === null) {
                var coll = new IgxObjectCollection();
                var innerColl = this.i.selectedItems;
                if (!innerColl) {
                    innerColl = new ObjectCollection_internal(0);
                }
                this._selectedItems = coll._fromInner(innerColl);
                this.i.selectedItems = innerColl;
            }
            return this._selectedItems;
        },
        set: function (v) {
            if (this._selectedItems !== null) {
                this._selectedItems._setSyncTarget(null);
                this._selectedItems = null;
            }
            var coll = new IgxObjectCollection();
            this._selectedItems = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(Base.$type);
            var innerColl = this.i.selectedItems;
            if (!innerColl) {
                innerColl = new ObjectCollection_internal(0);
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._selectedItems._setSyncTarget(syncColl);
            this.i.selectedItems = innerColl;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "textStyle", {
        /**
         * Manually overrides the style to use for the labels.
        */
        get: function () {
            return this.i.fq;
        },
        set: function (v) {
            this.i.fq = v;
        },
        enumerable: false,
        configurable: true
    });
    IgxPieChartBaseComponent.prototype.findByName = function (name) {
        if (this.findEphemera) {
            if (name && name.indexOf("@@e:") == 0) {
                return this.findEphemera(name);
            }
        }
        if (this.legend && this.legend.name && this.legend.name == name) {
            return this.legend;
        }
        if (this.labelFormatSpecifiers != null && arrayFindByName(this.labelFormatSpecifiers, name)) {
            return arrayFindByName(this.labelFormatSpecifiers, name);
        }
        if (this.othersLabelFormatSpecifiers != null && arrayFindByName(this.othersLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.othersLabelFormatSpecifiers, name);
        }
        if (this.legendLabelFormatSpecifiers != null && arrayFindByName(this.legendLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.legendLabelFormatSpecifiers, name);
        }
        if (this.legendOthersLabelFormatSpecifiers != null && arrayFindByName(this.legendOthersLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.legendOthersLabelFormatSpecifiers, name);
        }
        return null;
    };
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "hasUserValues", {
        get: function () {
            return this._hasUserValues;
        },
        enumerable: false,
        configurable: true
    });
    IgxPieChartBaseComponent.prototype.__m = function (propertyName) {
        if (!this._inStyling) {
            this._hasUserValues.add(propertyName);
        }
    };
    IgxPieChartBaseComponent.prototype._styling = function (container, component, parent) {
        if (this._inStyling) {
            return;
        }
        this._inStyling = true;
        this._stylingContainer = container;
        this._stylingParent = component;
        var genericPrefix = "";
        var typeName = this.i.$type.name;
        if (typeName.indexOf("Xam") === 0) {
            typeName = typeName.substring(3);
        }
        genericPrefix = toSpinal("PieChartBaseComponent");
        var additionalPrefixes = [];
        var prefix = toSpinal(typeName);
        additionalPrefixes.push(prefix + "-");
        var b = this.i.$type.baseType;
        while (b && b.name != "Object" &&
            b.name != "Base" &&
            b.name != "Control" &&
            b.Name != "DependencyObject" &&
            b.Name != "FrameworkElement") {
            typeName = b.name;
            if (typeName.indexOf("Xam") === 0) {
                typeName = typeName.substring(3);
            }
            var basePrefix = toSpinal(typeName);
            additionalPrefixes.push(basePrefix + "-");
            b = b.baseType;
        }
        if (parent) {
            var parentTypeName = parent.i.$type.name;
            if (parentTypeName.indexOf("Xam") === 0) {
                parentTypeName = parentTypeName.substring(3);
            }
            var parentPrefix = toSpinal(parentTypeName);
            additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
            additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
        }
        initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
        if (this._otherStyling) {
            this._otherStyling(container, component, parent);
        }
        this._inStyling = false;
    };
    /**
     * Use to force the pie chart to finish any deferred work before printing or evaluating its visual.
     * This should only be called if the visual of the pie chart needs to be synchronously saved or evaluated.
     * Calling this method too often will hinder the performance of the pie chart.
    
    */
    IgxPieChartBaseComponent.prototype.flush = function () {
        this.i.f0();
    };
    /**
     * Returns the chart visuals expressed as a serialized string.
    
    */
    IgxPieChartBaseComponent.prototype.exportSerializedVisualData = function () {
        var iv = this.i.d4();
        return (iv);
    };
    /**
     * Simulates a mouse click action at the specified point.
    
    * @param point  * The point to click at.
    */
    IgxPieChartBaseComponent.prototype.simulateLeftClick = function (point) {
        this.i.g5(toPoint(point));
    };
    /**
     * Invoked by the containing object to provide reference to the container.
    
    * @param container  * Reference to the container.
    */
    IgxPieChartBaseComponent.prototype.provideContainer = function (container) {
        this.i.provideContainer(container);
    };
    /**
     * Notification from the containing object that the container has been resized.
    
    */
    IgxPieChartBaseComponent.prototype.notifyContainerResized = function () {
        this.i.notifyContainerResized();
    };
    /**
     * Invoked when the instance is being destroyed.
    
    */
    IgxPieChartBaseComponent.prototype.destroy = function () {
        this.i.destroy();
    };
    IgxPieChartBaseComponent.prototype.notifySetItem = function (source_, index, oldItem, newItem) {
        this.i.f9(source_, index, oldItem, newItem);
    };
    /**
     * Manually notifies the pie chart's data source that the data it has bound to has been cleared and needs to be re-examined.
     * This should not be called if the data that the pie chart is bound to is already observable.
    
    * @param source_  * The data source.
    */
    IgxPieChartBaseComponent.prototype.notifyClearItems = function (source_) {
        this.i.f5(source_);
    };
    IgxPieChartBaseComponent.prototype.notifyInsertItem = function (source_, index, newItem) {
        this.i.f7(source_, index, newItem);
    };
    IgxPieChartBaseComponent.prototype.notifyRemoveItem = function (source_, index, oldItem) {
        this.i.f8(source_, index, oldItem);
    };
    /**
     * Assigns data source for the items.
    
    * @param source_  * Array of the data source items.
    */
    IgxPieChartBaseComponent.prototype.setWidgetLevelDataSource = function (source_) {
        this.i.g4(source_);
    };
    /**
     * Resets items data source.
    
    */
    IgxPieChartBaseComponent.prototype.removeWidgetLevelDataSource = function () {
        this.i.gv();
    };
    /**
     * Invoked when style is updated.
    
    */
    IgxPieChartBaseComponent.prototype.styleUpdated = function () {
        this.i.g9();
    };
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "labelClick", {
        /**
         * Raised when the slice's label is clicked.
        */
        get: function () {
            var _this = this;
            if (this._labelClick == null) {
                this._labelClick = new EventEmitter();
                this.i.labelClick = delegateCombine(this.i.labelClick, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxLabelClickEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeLabelClick) {
                            _this.beforeLabelClick(_this, outerArgs);
                        }
                        _this._labelClick.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._labelClick;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedItemChanging", {
        /**
         * Raised when the SelectedItem property is changing.  This event is cancelable.
        */
        get: function () {
            var _this = this;
            if (this._selectedItemChanging == null) {
                this._selectedItemChanging = new EventEmitter();
                this.i.selectedItemChanging = delegateCombine(this.i.selectedItemChanging, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxSelectedItemChangingEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeSelectedItemChanging) {
                            _this.beforeSelectedItemChanging(_this, outerArgs);
                        }
                        _this._selectedItemChanging.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._selectedItemChanging;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedItemsChanging", {
        /**
         * Raised when the SelectedItems collection is changing.  This event is cancelable.
        */
        get: function () {
            var _this = this;
            if (this._selectedItemsChanging == null) {
                this._selectedItemsChanging = new EventEmitter();
                this.i.selectedItemsChanging = delegateCombine(this.i.selectedItemsChanging, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxSelectedItemsChangingEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeSelectedItemsChanging) {
                            _this.beforeSelectedItemsChanging(_this, outerArgs);
                        }
                        _this._selectedItemsChanging.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._selectedItemsChanging;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedItemChanged", {
        /**
         * Raised when the SelectedItem property has changed.
        */
        get: function () {
            var _this = this;
            if (this._selectedItemChanged == null) {
                this._selectedItemChanged = new EventEmitter();
                this.i.selectedItemChanged = delegateCombine(this.i.selectedItemChanged, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxSelectedItemChangedEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeSelectedItemChanged) {
                            _this.beforeSelectedItemChanged(_this, outerArgs);
                        }
                        _this._selectedItemChanged.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._selectedItemChanged;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "selectedItemsChanged", {
        /**
         * Raised when the SelectedItems collection has changed.
        */
        get: function () {
            var _this = this;
            if (this._selectedItemsChanged == null) {
                this._selectedItemsChanged = new EventEmitter();
                this.i.selectedItemsChanged = delegateCombine(this.i.selectedItemsChanged, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxSelectedItemsChangedEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeSelectedItemsChanged) {
                            _this.beforeSelectedItemsChanged(_this, outerArgs);
                        }
                        _this._selectedItemsChanged.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._selectedItemsChanged;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "sliceClick", {
        /**
         * Raised when the slice is clicked.
        */
        get: function () {
            var _this = this;
            if (this._sliceClick == null) {
                this._sliceClick = new EventEmitter();
                this.i.sliceClick = delegateCombine(this.i.sliceClick, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxSliceClickEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeSliceClick) {
                            _this.beforeSliceClick(_this, outerArgs);
                        }
                        _this._sliceClick.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._sliceClick;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "sliceEnter", {
        /**
         * Raised when a slice is entered by the pointer.
        */
        get: function () {
            var _this = this;
            if (this._sliceEnter == null) {
                this._sliceEnter = new EventEmitter();
                this.i.sliceEnter = delegateCombine(this.i.sliceEnter, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxSliceEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeSliceEnter) {
                            _this.beforeSliceEnter(_this, outerArgs);
                        }
                        _this._sliceEnter.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._sliceEnter;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "sliceLeave", {
        /**
         * Raised when a slice is left by the pointer;
        */
        get: function () {
            var _this = this;
            if (this._sliceLeave == null) {
                this._sliceLeave = new EventEmitter();
                this.i.sliceLeave = delegateCombine(this.i.sliceLeave, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxSliceEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeSliceLeave) {
                            _this.beforeSliceLeave(_this, outerArgs);
                        }
                        _this._sliceLeave.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._sliceLeave;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPieChartBaseComponent.prototype, "sliceHover", {
        /**
         * Raised when a pointer moves over a slice.
        */
        get: function () {
            var _this = this;
            if (this._sliceHover == null) {
                this._sliceHover = new EventEmitter();
                this.i.sliceHover = delegateCombine(this.i.sliceHover, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxSliceEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeSliceHover) {
                            _this.beforeSliceHover(_this, outerArgs);
                        }
                        _this._sliceHover.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._sliceHover;
        },
        enumerable: false,
        configurable: true
    });
    IgxPieChartBaseComponent.prototype._runInZone = function (act) {
        if (this._zoneRunner != null) {
            this._zoneRunner(act);
        }
        else {
            act();
        }
    };
    IgxPieChartBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxPieChartBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxPieChartBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxPieChartBaseComponent, selector: "ng-component", inputs: { innerExtent: "innerExtent", valueMemberPath: "valueMemberPath", labelMemberPath: "labelMemberPath", legendLabelMemberPath: "legendLabelMemberPath", labelsPosition: "labelsPosition", labelOuterColor: "labelOuterColor", labelInnerColor: "labelInnerColor", actualLabelOuterColor: "actualLabelOuterColor", actualLabelInnerColor: "actualLabelInnerColor", leaderLineVisibility: "leaderLineVisibility", leaderLineType: "leaderLineType", leaderLineMargin: "leaderLineMargin", toolTip: "toolTip", othersCategoryThreshold: "othersCategoryThreshold", othersCategoryType: "othersCategoryType", othersCategoryText: "othersCategoryText", explodedRadius: "explodedRadius", radiusFactor: "radiusFactor", allowSliceSelection: "allowSliceSelection", allowSliceExplosion: "allowSliceExplosion", explodedSlices: "explodedSlices", labelExtent: "labelExtent", startAngle: "startAngle", sweepDirection: "sweepDirection", othersCategoryFill: "othersCategoryFill", othersCategoryStroke: "othersCategoryStroke", othersCategoryStrokeThickness: "othersCategoryStrokeThickness", othersCategoryOpacity: "othersCategoryOpacity", selectedSliceFill: "selectedSliceFill", selectedSliceStroke: "selectedSliceStroke", selectedSliceStrokeThickness: "selectedSliceStrokeThickness", selectedSliceOpacity: "selectedSliceOpacity", brushes: "brushes", actualBrushes: "actualBrushes", outlines: "outlines", actualOutlines: "actualOutlines", labelFormat: "labelFormat", labelFormatSpecifiers: "labelFormatSpecifiers", othersLabelFormat: "othersLabelFormat", othersLabelFormatSpecifiers: "othersLabelFormatSpecifiers", legendLabelFormat: "legendLabelFormat", legendLabelFormatSpecifiers: "legendLabelFormatSpecifiers", legendOthersLabelFormat: "legendOthersLabelFormat", legendOthersLabelFormatSpecifiers: "legendOthersLabelFormatSpecifiers", legendItemTemplate: "legendItemTemplate", legendItemBadgeTemplate: "legendItemBadgeTemplate", isDragInteractionEnabled: "isDragInteractionEnabled", isSurfaceInteractionDisabled: "isSurfaceInteractionDisabled", shouldDisplayMockData: "shouldDisplayMockData", shouldUseSkeletonStyleForMockData: "shouldUseSkeletonStyleForMockData", legendEmptyValuesMode: "legendEmptyValuesMode", formatLabel: "formatLabel", formatLegendLabel: "formatLegendLabel", pixelScalingRatio: "pixelScalingRatio", actualPixelScalingRatio: "actualPixelScalingRatio", selectionMode: "selectionMode", selectedItem: "selectedItem", selectedItems: "selectedItems", textStyle: "textStyle" }, outputs: { labelClick: "labelClick", selectedItemChanging: "selectedItemChanging", selectedItemsChanging: "selectedItemsChanging", selectedItemChanged: "selectedItemChanged", selectedItemsChanged: "selectedItemsChanged", sliceClick: "sliceClick", sliceEnter: "sliceEnter", sliceLeave: "sliceLeave", sliceHover: "sliceHover" }, ngImport: i0, template: "", isInline: true });
    return IgxPieChartBaseComponent;
}());
export { IgxPieChartBaseComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxPieChartBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: "",
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { innerExtent: [{
                type: Input
            }], valueMemberPath: [{
                type: Input
            }], labelMemberPath: [{
                type: Input
            }], legendLabelMemberPath: [{
                type: Input
            }], labelsPosition: [{
                type: Input
            }], labelOuterColor: [{
                type: Input
            }], labelInnerColor: [{
                type: Input
            }], actualLabelOuterColor: [{
                type: Input
            }], actualLabelInnerColor: [{
                type: Input
            }], leaderLineVisibility: [{
                type: Input
            }], leaderLineType: [{
                type: Input
            }], leaderLineMargin: [{
                type: Input
            }], toolTip: [{
                type: Input
            }], othersCategoryThreshold: [{
                type: Input
            }], othersCategoryType: [{
                type: Input
            }], othersCategoryText: [{
                type: Input
            }], explodedRadius: [{
                type: Input
            }], radiusFactor: [{
                type: Input
            }], allowSliceSelection: [{
                type: Input
            }], allowSliceExplosion: [{
                type: Input
            }], explodedSlices: [{
                type: Input
            }], labelExtent: [{
                type: Input
            }], startAngle: [{
                type: Input
            }], sweepDirection: [{
                type: Input
            }], othersCategoryFill: [{
                type: Input
            }], othersCategoryStroke: [{
                type: Input
            }], othersCategoryStrokeThickness: [{
                type: Input
            }], othersCategoryOpacity: [{
                type: Input
            }], selectedSliceFill: [{
                type: Input
            }], selectedSliceStroke: [{
                type: Input
            }], selectedSliceStrokeThickness: [{
                type: Input
            }], selectedSliceOpacity: [{
                type: Input
            }], brushes: [{
                type: Input
            }], actualBrushes: [{
                type: Input
            }], outlines: [{
                type: Input
            }], actualOutlines: [{
                type: Input
            }], labelFormat: [{
                type: Input
            }], labelFormatSpecifiers: [{
                type: Input
            }], othersLabelFormat: [{
                type: Input
            }], othersLabelFormatSpecifiers: [{
                type: Input
            }], legendLabelFormat: [{
                type: Input
            }], legendLabelFormatSpecifiers: [{
                type: Input
            }], legendOthersLabelFormat: [{
                type: Input
            }], legendOthersLabelFormatSpecifiers: [{
                type: Input
            }], legendItemTemplate: [{
                type: Input
            }], legendItemBadgeTemplate: [{
                type: Input
            }], isDragInteractionEnabled: [{
                type: Input
            }], isSurfaceInteractionDisabled: [{
                type: Input
            }], shouldDisplayMockData: [{
                type: Input
            }], shouldUseSkeletonStyleForMockData: [{
                type: Input
            }], legendEmptyValuesMode: [{
                type: Input
            }], formatLabel: [{
                type: Input
            }], formatLegendLabel: [{
                type: Input
            }], pixelScalingRatio: [{
                type: Input
            }], actualPixelScalingRatio: [{
                type: Input
            }], selectionMode: [{
                type: Input
            }], selectedItem: [{
                type: Input
            }], selectedItems: [{
                type: Input
            }], textStyle: [{
                type: Input
            }], labelClick: [{
                type: Output
            }], selectedItemChanging: [{
                type: Output
            }], selectedItemsChanging: [{
                type: Output
            }], selectedItemChanged: [{
                type: Output
            }], selectedItemsChanged: [{
                type: Output
            }], sliceClick: [{
                type: Output
            }], sliceEnter: [{
                type: Output
            }], sliceLeave: [{
                type: Output
            }], sliceHover: [{
                type: Output
            }] } });