UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

1,431 lines (1,421 loc) 51.5 kB
import { __extends, __values } from "tslib"; import * as React from 'react'; import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { LabelsPosition_$type } from "./LabelsPosition"; import { Visibility_$type } from "igniteui-react-core"; import { LeaderLineType_$type } from "./LeaderLineType"; import { OthersCategoryType_$type } from "igniteui-react-core"; import { IgrIndexCollection } from "./igr-index-collection"; import { SweepDirection_$type } from "igniteui-react-core"; import { LegendEmptyValuesMode_$type } from "igniteui-react-core"; import { SliceSelectionMode_$type } from "./SliceSelectionMode"; import { IgrObjectCollection } from "igniteui-react-core"; import { IgrLabelClickEventArgs } from "./igr-label-click-event-args"; import { IgrSelectedItemChangingEventArgs } from "./igr-selected-item-changing-event-args"; import { IgrSelectedItemsChangingEventArgs } from "./igr-selected-items-changing-event-args"; import { IgrSelectedItemChangedEventArgs } from "./igr-selected-item-changed-event-args"; import { IgrSelectedItemsChangedEventArgs } from "./igr-selected-items-changed-event-args"; import { IgrSliceClickEventArgs } from "./igr-slice-click-event-args"; import { IgrSliceEventArgs } from "./igr-slice-event-args"; import { TypeRegistrar, Number_$type, Base } from "igniteui-react-core"; import { NamePatcher, getModifiedProps, isValidProp, ensureEnum, brushToString, stringToBrush, ensureBool, toBrushCollection, fromBrushCollection, arrayFindByName, toSpinal, initializePropertiesFromCss, toPoint } from "igniteui-react-core"; import { IndexCollection as IndexCollection_internal } from "./IndexCollection"; import { SyncableObservableCollection$1 } from "igniteui-react-core"; import { Style } from "igniteui-react-core"; import { ObjectCollection as ObjectCollection_internal } from "igniteui-react-core"; /** * Represents the base class for the pie chart. */ var IgrPieChartBase = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrPieChartBase, _super); function IgrPieChartBase(props) { var _this = _super.call(this, props) || this; _this.mounted = false; _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._labelClick_wrapped = null; _this._selectedItemChanging = null; _this._selectedItemChanging_wrapped = null; _this._selectedItemsChanging = null; _this._selectedItemsChanging_wrapped = null; _this._selectedItemChanged = null; _this._selectedItemChanged_wrapped = null; _this._selectedItemsChanged = null; _this._selectedItemsChanged_wrapped = null; _this._sliceClick = null; _this._sliceClick_wrapped = null; _this._sliceEnter = null; _this._sliceEnter_wrapped = null; _this._sliceLeave = null; _this._sliceLeave_wrapped = null; _this._sliceHover = null; _this._sliceHover_wrapped = null; if (_this._styling) { NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this)); } _this._implementation = _this.createImplementation(); _this._implementation.externalObject = _this; _this.onImplementationCreated(); if (_this._initializeAdapters) { _this._initializeAdapters(); } return _this; } IgrPieChartBase.prototype.createImplementation = function () { return null; }; Object.defineProperty(IgrPieChartBase.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPieChartBase.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; } /** * @hidden */, enumerable: false, configurable: true }); IgrPieChartBase._createFromInternal = function (internal) { if (!internal) { return null; } if (!internal.$type) { return null; } var name = internal.$type.name; var externalName = "Igr" + name; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); }; IgrPieChartBase.prototype.onImplementationCreated = function () { }; IgrPieChartBase.prototype.componentDidMount = function () { var e_1, _a; this.mounted = true; try { for (var _b = __values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) { var p = _c.value; if (isValidProp(this, p)) { this[p] = this.props[p]; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } }; IgrPieChartBase.prototype.shouldComponentUpdate = function (nextProps, nextState) { var e_2, _a; var mod = getModifiedProps(this.props, nextProps); try { for (var _b = __values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) { var p = _c.value; if (isValidProp(this, p)) { this[p] = mod[p]; } } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } return true; }; IgrPieChartBase.prototype.render = function () { return null; }; Object.defineProperty(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.prototype, "explodedSlices", { /** * Gets or sets the collection of exploded slice indices. */ get: function () { if (this._explodedSlices === null) { var coll = new IgrIndexCollection(); 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 IgrIndexCollection(); 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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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 }); IgrPieChartBase.prototype.ensureOthersCategoryStyle = function () { if (this.i.jb) { return; } this.i.jb = new Style(); }; Object.defineProperty(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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 }); IgrPieChartBase.prototype.ensureSelectedStyle = function () { if (this.i.jc) { return; } this.i.jc = new Style(); }; Object.defineProperty(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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(IgrPieChartBase.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 IgrObjectCollection(); 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 IgrObjectCollection(); 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(IgrPieChartBase.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 }); IgrPieChartBase.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(IgrPieChartBase.prototype, "hasUserValues", { get: function () { return this._hasUserValues; }, enumerable: false, configurable: true }); IgrPieChartBase.prototype.__m = function (propertyName) { if (!this._inStyling) { this._hasUserValues.add(propertyName); } }; IgrPieChartBase.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("PieChartBase"); 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. */ IgrPieChartBase.prototype.flush = function () { this.i.f0(); }; /** * Returns the chart visuals expressed as a serialized string. */ IgrPieChartBase.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. */ IgrPieChartBase.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. */ IgrPieChartBase.prototype.provideContainer = function (container) { this.i.provideContainer(container); }; /** * Notification from the containing object that the container has been resized. */ IgrPieChartBase.prototype.notifyContainerResized = function () { this.i.notifyContainerResized(); }; /** * Invoked when the instance is being destroyed. */ IgrPieChartBase.prototype.destroy = function () { this.i.destroy(); }; IgrPieChartBase.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. */ IgrPieChartBase.prototype.notifyClearItems = function (source_) { this.i.f5(source_); }; IgrPieChartBase.prototype.notifyInsertItem = function (source_, index, newItem) { this.i.f7(source_, index, newItem); }; IgrPieChartBase.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. */ IgrPieChartBase.prototype.setWidgetLevelDataSource = function (source_) { this.i.g4(source_); }; /** * Resets items data source. */ IgrPieChartBase.prototype.removeWidgetLevelDataSource = function () { this.i.gv(); }; /** * Invoked when style is updated. */ IgrPieChartBase.prototype.styleUpdated = function () { this.i.g9(); }; Object.defineProperty(IgrPieChartBase.prototype, "labelClick", { /** * Raised when the slice's label is clicked. */ get: function () { return this._labelClick; }, set: function (ev) { var _this = this; if (this._labelClick_wrapped !== null) { this.i.labelClick = delegateRemove(this.i.labelClick, this._labelClick_wrapped); this._labelClick_wrapped = null; this._labelClick = null; } this._labelClick = ev; this._labelClick_wrapped = function (o, e) { var outerArgs = new IgrLabelClickEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeLabelClick) { _this.beforeLabelClick(_this, outerArgs); } if (_this._labelClick) { _this._labelClick(_this, outerArgs); } }; this.i.labelClick = delegateCombine(this.i.labelClick, this._labelClick_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPieChartBase.prototype, "selectedItemChanging", { /** * Raised when the SelectedItem property is changing. This event is cancelable. */ get: function () { return this._selectedItemChanging; }, set: function (ev) { var _this = this; if (this._selectedItemChanging_wrapped !== null) { this.i.selectedItemChanging = delegateRemove(this.i.selectedItemChanging, this._selectedItemChanging_wrapped); this._selectedItemChanging_wrapped = null; this._selectedItemChanging = null; } this._selectedItemChanging = ev; this._selectedItemChanging_wrapped = function (o, e) { var outerArgs = new IgrSelectedItemChangingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeSelectedItemChanging) { _this.beforeSelectedItemChanging(_this, outerArgs); } if (_this._selectedItemChanging) { _this._selectedItemChanging(_this, outerArgs); } }; this.i.selectedItemChanging = delegateCombine(this.i.selectedItemChanging, this._selectedItemChanging_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPieChartBase.prototype, "selectedItemsChanging", { /** * Raised when the SelectedItems collection is changing. This event is cancelable. */ get: function () { return this._selectedItemsChanging; }, set: function (ev) { var _this = this; if (this._selectedItemsChanging_wrapped !== null) { this.i.selectedItemsChanging = delegateRemove(this.i.selectedItemsChanging, this._selectedItemsChanging_wrapped); this._selectedItemsChanging_wrapped = null; this._selectedItemsChanging = null; } this._selectedItemsChanging = ev; this._selectedItemsChanging_wrapped = function (o, e) { var outerArgs = new IgrSelectedItemsChangingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeSelectedItemsChanging) { _this.beforeSelectedItemsChanging(_this, outerArgs); } if (_this._selectedItemsChanging) { _this._selectedItemsChanging(_this, outerArgs); } }; this.i.selectedItemsChanging = delegateCombine(this.i.selectedItemsChanging, this._selectedItemsChanging_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPieChartBase.prototype, "selectedItemChanged", { /** * Raised when the SelectedItem property has changed. */ get: function () { return this._selectedItemChanged; }, set: function (ev) { var _this = this; if (this._selectedItemChanged_wrapped !== null) { this.i.selectedItemChanged = delegateRemove(this.i.selectedItemChanged, this._selectedItemChanged_wrapped); this._selectedItemChanged_wrapped = null; this._selectedItemChanged = null; } this._selectedItemChanged = ev; this._selectedItemChanged_wrapped = function (o, e) { var outerArgs = new IgrSelectedItemChangedEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeSelectedItemChanged) { _this.beforeSelectedItemChanged(_this, outerArgs); } if (_this._selectedItemChanged) { _this._selectedItemChanged(_this, outerArgs); } }; this.i.selectedItemChanged = delegateCombine(this.i.selectedItemChanged, this._selectedItemChanged_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPieChartBase.prototype, "selectedItemsChanged", { /** * Raised when the SelectedItems collection has changed. */ get: function () { return this._selectedItemsChanged; }, set: function (ev) { var _this = this; if (this._selectedItemsChanged_wrapped !== null) { this.i.selectedItemsChanged = delegateRemove(this.i.selectedItemsChanged, this._selectedItemsChanged_wrapped); this._selectedItemsChanged_wrapped = null; this._selectedItemsChanged = null; } this._selectedItemsChanged = ev; this._selectedItemsChanged_wrapped = function (o, e) { var outerArgs = new IgrSelectedItemsChangedEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeSelectedItemsChanged) { _this.beforeSelectedItemsChanged(_this, outerArgs); } if (_this._selectedItemsChanged) { _this._selectedItemsChanged(_this, outerArgs); } }; this.i.selectedItemsChanged = delegateCombine(this.i.selectedItemsChanged, this._selectedItemsChanged_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPieChartBase.prototype, "sliceClick", { /** * Raised when the slice is clicked. */ get: function () { return this._sliceClick; }, set: function (ev) { var _this = this; if (this._sliceClick_wrapped !== null) { this.i.sliceClick = delegateRemove(this.i.sliceClick, this._sliceClick_wrapped); this._sliceClick_wrapped = null; this._sliceClick = null; } this._sliceClick = ev; this._sliceClick_wrapped = function (o, e) { var outerArgs = new IgrSliceClickEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeSliceClick) { _this.beforeSliceClick(_this, outerArgs); } if (_this._sliceClick) { _this._sliceClick(_this, outerArgs); } }; this.i.sliceClick = delegateCombine(this.i.sliceClick, this._sliceClick_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPieChartBase.prototype, "sliceEnter", { /** * Raised when a slice is entered by the pointer. */ get: function () { return this._sliceEnter; }, set: function (ev) { var _this = this; if (this._sliceEnter_wrapped !== null) { this.i.sliceEnter = delegateRemove(this.i.sliceEnter, this._sliceEnter_wrapped); this._sliceEnter_wrapped = null; this._sliceEnter = null; } this._sliceEnter = ev; this._sliceEnter_wrapped = function (o, e) { var outerArgs = new IgrSliceEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeSliceEnter) { _this.beforeSliceEnter(_this, outerArgs); } if (_this._sliceEnter) { _this._sliceEnter(_this, outerArgs); } }; this.i.sliceEnter = delegateCombine(this.i.sliceEnter, this._sliceEnter_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrPieChartBase.prototype, "sliceLeave", { /** * Raised when a slice is left by the pointer; */ get: function () { return this._sliceLeave; }, set: function (ev) { var _this = this; if (this._sliceLeave_wrapped !== null) { this.i.sliceLeave = delegateRemove(this.i.sliceLeave, this._sliceLeave_wrapped); this._sliceLeave_wrapped = null; this._sliceLeave = null; } this._sliceLeave = ev; this._sliceLeave_wrapped = function (o, e) { var outerArgs = new IgrSliceEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeSliceLeave) { _this.beforeSliceLeave(_this, outerArgs); } if (_this._sliceLeave) { _this._sliceLeave(_this, out