igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
738 lines (736 loc) • 26.3 kB
JavaScript
import { __extends } from "tslib";
import { PieChartSweepDirection_$type } from "./PieChartSweepDirection";
import { CalloutCollisionMode_$type } from "igniteui-webcomponents-core";
import { LegendEmptyValuesMode_$type } from "igniteui-webcomponents-core";
import { OthersCategoryType_$type } from "igniteui-webcomponents-core";
import { AxisRangeBufferMode_$type } from "./AxisRangeBufferMode";
import { RadialLabelMode_$type } from "igniteui-webcomponents-core";
import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType";
import { IgcOthersCategoryContextComponent } from "./igc-others-category-context-component";
import { IgcRadialBaseChartComponent } from "./igc-radial-base-chart-component";
import { getAllPropertyNames, toSpinal, ensureEnum, enumToString, brushToString, stringToBrush, ensureBool, arrayFindByName } from "igniteui-webcomponents-core";
/**
* Represents a base class for PieBase chart control that can plot scatter data
*/
export var IgcDataPieBaseChartComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcDataPieBaseChartComponent, _super);
function IgcDataPieBaseChartComponent() {
return _super.call(this) || this;
}
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcDataPieBaseChartComponent.prototype.connectedCallback = function () {
if (_super.prototype["connectedCallback"]) {
_super.prototype["connectedCallback"].call(this);
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
};
IgcDataPieBaseChartComponent.prototype.disconnectedCallback = function () {
if (_super.prototype["disconnectedCallback"]) {
_super.prototype["disconnectedCallback"].call(this);
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
};
Object.defineProperty(IgcDataPieBaseChartComponent, "observedAttributes", {
get: function () {
if (IgcDataPieBaseChartComponent._observedAttributesIgcDataPieBaseChartComponent == null) {
var names = getAllPropertyNames(IgcDataPieBaseChartComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcDataPieBaseChartComponent._observedAttributesIgcDataPieBaseChartComponent = names;
}
return IgcDataPieBaseChartComponent._observedAttributesIgcDataPieBaseChartComponent;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "sliceLabelFormat", {
/**
* Gets or sets the label format for the slices.
*/
get: function () {
return this.i.al0;
},
set: function (v) {
this.i.al0 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "sliceLabelFormatSpecifiers", {
/**
* Gets or sets the format specifiers to use with the labels for the slices.
*/
get: function () {
return this.i.aiz;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.aiz = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "legendSliceLabelFormat", {
/**
* Gets or sets the label format for the LegendSlices.
*/
get: function () {
return this.i.alh;
},
set: function (v) {
this.i.alh = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "legendSliceLabelFormatSpecifiers", {
/**
* Gets or sets the format specifiers to use with the labels for the LegendSlices.
*/
get: function () {
return this.i.aix;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.aix = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "othersSliceLabelFormat", {
/**
* Gets or sets the label format for the OthersSlices.
*/
get: function () {
return this.i.alq;
},
set: function (v) {
this.i.alq = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "othersSliceLabelFormatSpecifiers", {
/**
* Gets or sets the format specifiers to use with the labels for the OthersSlices.
*/
get: function () {
return this.i.aiy;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.aiy = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "legendOthersSliceLabelFormat", {
/**
* Gets or sets the label format for the LegendOthersSlices.
*/
get: function () {
return this.i.ald;
},
set: function (v) {
this.i.ald = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "legendOthersSliceLabelFormatSpecifiers", {
/**
* Gets or sets the format specifiers to use with the labels for the LegendOthersSlices.
*/
get: function () {
return this.i.aiw;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.aiw = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "innerExtent", {
/**
* Defines the percentage of the maximum radius extent to leave blank at the center of the chart. Should be
* a value between 0.0 and 1.0.
*/
get: function () {
return this.i.ake;
},
set: function (v) {
this.i.ake = +v;
this._a("innerExtent", this.i.ake);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "sweepDirection", {
/**
* Defines the percentage of the maximum radius extent to leave blank at the center of the chart. Should be
* a value between 0.0 and 1.0.
*/
get: function () {
return this.i.aje;
},
set: function (v) {
this.i.aje = ensureEnum(PieChartSweepDirection_$type, v);
this._a("sweepDirection", enumToString(PieChartSweepDirection_$type, this.i.aje));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "sliceLabelPositionMode", {
/**
* Defines the positioning mode of the slice labels for the pie chart.
*/
get: function () {
return this.i.ai3;
},
set: function (v) {
this.i.ai3 = ensureEnum(CalloutCollisionMode_$type, v);
this._a("sliceLabelPositionMode", enumToString(CalloutCollisionMode_$type, this.i.ai3));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "lightSliceLabelColor", {
/**
* Gets or sets the light color to use for slice labels.
*/
get: function () {
return brushToString(this.i.amt);
},
set: function (v) {
this.i.amt = stringToBrush(v);
this._a("lightSliceLabelColor", brushToString(this.i.amt));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "darkSliceLabelColor", {
/**
* Gets or sets the Dark color to use for slice labels.
*/
get: function () {
return brushToString(this.i.ams);
},
set: function (v) {
this.i.ams = stringToBrush(v);
this._a("darkSliceLabelColor", brushToString(this.i.ams));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueMemberPath", {
/**
* Gets or sets the overridden value member path to use.
*/
get: function () {
return this.i.amh;
},
set: function (v) {
this.i.amh = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "legendLabelMemberPath", {
/**
* Gets or sets the legend label member path to use.
*/
get: function () {
return this.i.alb;
},
set: function (v) {
this.i.alb = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "legendEmptyValuesMode", {
get: function () {
return this.i.ai7;
},
set: function (v) {
this.i.ai7 = ensureEnum(LegendEmptyValuesMode_$type, v);
this._a("legendEmptyValuesMode", enumToString(LegendEmptyValuesMode_$type, this.i.ai7));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "othersCategoryType", {
/**
* Gets or sets whether to use numeric or percent-based threshold value.
*/
get: function () {
return this.i.ajc;
},
set: function (v) {
this.i.ajc = ensureEnum(OthersCategoryType_$type, v);
this._a("othersCategoryType", enumToString(OthersCategoryType_$type, this.i.ajc));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "othersCategoryThreshold", {
/**
* Gets or sets the threshold value that determines if slices are grouped into the Others slice.
*/
get: function () {
return this.i.akf;
},
set: function (v) {
this.i.akf = +v;
this._a("othersCategoryThreshold", this.i.akf);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "othersCategoryText", {
/**
* Gets or sets the label of the Others slice.
*/
get: function () {
return this.i.alm;
},
set: function (v) {
this.i.alm = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "labelMemberPath", {
/**
* Gets or sets the overridden value member path to use.
*/
get: function () {
return this.i.ak8;
},
set: function (v) {
this.i.ak8 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisFavorLabellingScaleEnd", {
/**
* Gets or sets whether the axis should favor emitting a label at the end of the scale.
*/
get: function () {
return this.i.ajx;
},
set: function (v) {
this.i.ajx = ensureBool(v);
this._a("valueAxisFavorLabellingScaleEnd", this.i.ajx);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisAutoRangeBufferMode", {
/**
* Gets or sets how the numeric axis will adjust its range buffer to less closely fix the data from the series.
*/
get: function () {
return this.i.ai1;
},
set: function (v) {
this.i.ai1 = ensureEnum(AxisRangeBufferMode_$type, v);
this._a("valueAxisAutoRangeBufferMode", enumToString(AxisRangeBufferMode_$type, this.i.ai1));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "angleAxisInterval", {
/**
* Gets or sets the frequency of displayed labels along the X-axis.
* Gets or sets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label.
*/
get: function () {
return this.i.akc;
},
set: function (v) {
this.i.akc = +v;
this._a("angleAxisInterval", this.i.akc);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "angleAxisMinorInterval", {
/**
* Gets or sets the frequency of displayed minor lines along the X-axis.
* Gets or sets the set value is a factor that determines how the minor lines will be displayed.
*/
get: function () {
return this.i.akd;
},
set: function (v) {
this.i.akd = +v;
this._a("angleAxisMinorInterval", this.i.akd);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisInterval", {
/**
* Gets or sets the distance between each label and grid line along the Y-axis.
*/
get: function () {
return this.i.akn;
},
set: function (v) {
this.i.akn = +v;
this._a("valueAxisInterval", this.i.akn);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisIsLogarithmic", {
/**
* Gets or sets whether the Y-axis should use a logarithmic scale instead of a linear one.
* Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero.
*/
get: function () {
return this.i.ajy;
},
set: function (v) {
this.i.ajy = ensureBool(v);
this._a("valueAxisIsLogarithmic", this.i.ajy);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisLogarithmBase", {
/**
* Gets or sets the base value to use in the log function when mapping the position of data items along the Y-axis.
* This property is effective only when ValueAxisIsLogarithmic is true.
*/
get: function () {
return this.i.aks;
},
set: function (v) {
this.i.aks = +v;
this._a("valueAxisLogarithmBase", this.i.aks);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisMinimumValue", {
/**
* Gets or sets the data value corresponding to the minimum value of the Y-axis.
*/
get: function () {
return this.i.akp;
},
set: function (v) {
this.i.akp = +v;
this._a("valueAxisMinimumValue", this.i.akp);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisMaximumValue", {
/**
* Gets or sets the data value corresponding to the maximum value of the Y-axis.
*/
get: function () {
return this.i.ako;
},
set: function (v) {
this.i.ako = +v;
this._a("valueAxisMaximumValue", this.i.ako);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisMinorInterval", {
/**
* Gets or sets the frequency of displayed minor lines along the Y-axis.
*/
get: function () {
return this.i.akq;
},
set: function (v) {
this.i.akq = +v;
this._a("valueAxisMinorInterval", this.i.akq);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisActualMinimum", {
/**
* Gets the current minimum value for the Y-axis.
*/
get: function () {
return this.i.akm;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisActualMaximum", {
/**
* Gets the current maximum value for the Y-axis.
*/
get: function () {
return this.i.akl;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "radiusExtent", {
/**
* Gets or sets the extent of the chart's radius. Value between 0 and 1.
*/
get: function () {
return this.i.akg;
},
set: function (v) {
this.i.akg = +v;
this._a("radiusExtent", this.i.akg);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "startAngle", {
/**
* Gets or sets the start angle to use for the pie chart measured in degrees from the positive x axis.
*/
get: function () {
return this.i.akk;
},
set: function (v) {
this.i.akk = +v;
this._a("startAngle", this.i.akk);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "sliceLabelContentSeparator", {
/**
* Gets or sets the label of the Others slice.
*/
get: function () {
return this.i.aly;
},
set: function (v) {
this.i.aly = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "sliceLabelContentMode", {
/**
* Gets or sets the label of the Others slice.
*/
get: function () {
return this.i.ajk;
},
set: function (v) {
this.i.ajk = ensureEnum(RadialLabelMode_$type, v);
this._a("sliceLabelContentMode", enumToString(RadialLabelMode_$type, this.i.ajk));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "legendSliceLabelContentMode", {
/**
* Gets or sets the label of the Others slice.
*/
get: function () {
return this.i.ajj;
},
set: function (v) {
this.i.ajj = ensureEnum(RadialLabelMode_$type, v);
this._a("legendSliceLabelContentMode", enumToString(RadialLabelMode_$type, this.i.ajj));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "radiusX", {
/**
* Gets or sets the x-radius of the ellipse that is used to round the corners of the slice.
*/
get: function () {
return this.i.akh;
},
set: function (v) {
this.i.akh = +v;
this._a("radiusX", this.i.akh);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "radiusY", {
/**
* Gets or sets the y-radius of the ellipse that is used to round the corners of the slice.
*/
get: function () {
return this.i.aki;
},
set: function (v) {
this.i.aki = +v;
this._a("radiusY", this.i.aki);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "selectionThickness", {
/**
* Gets or sets line thickness when the series is selected.
*/
get: function () {
return this.i.akj;
},
set: function (v) {
this.i.akj = +v;
this._a("selectionThickness", this.i.akj);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "useInsetOutlines", {
/**
* Specifies that slice outlines should be drawn inside the slice rather than halfway
* in and halfway out.
*/
get: function () {
return this.i.ajv;
},
set: function (v) {
this.i.ajv = ensureBool(v);
this._a("useInsetOutlines", this.i.ajv);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "angleAxisFavorLabellingScaleEnd", {
/**
* Gets or sets whether to favor labelling the end of the scale.
*/
get: function () {
return this.i.ajs;
},
set: function (v) {
this.i.ajs = ensureBool(v);
this._a("angleAxisFavorLabellingScaleEnd", this.i.ajs);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "valueAxisAbbreviateLargeNumbers", {
/**
* Gets or sets whether the large numbers on the Y-axis labels are abbreviated.
*/
get: function () {
return this.i.ajw;
},
set: function (v) {
this.i.ajw = ensureBool(v);
this._a("valueAxisAbbreviateLargeNumbers", this.i.ajw);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "markerCollision", {
/**
* Gets or sets collision avoidance between markers on series that support this behaviour.
*/
get: function () {
return this.i.ai5;
},
set: function (v) {
this.i.ai5 = ensureEnum(CollisionAvoidanceType_$type, v);
this._a("markerCollision", enumToString(CollisionAvoidanceType_$type, this.i.ai5));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataPieBaseChartComponent.prototype, "fireMouseLeaveOnManipulationStart", {
/**
* Gets or sets whether the mouse leave event should fire when a manipulation is starting.
*/
get: function () {
return this.i.ajt;
},
set: function (v) {
this.i.ajt = ensureBool(v);
this._a("fireMouseLeaveOnManipulationStart", this.i.ajt);
},
enumerable: false,
configurable: true
});
IgcDataPieBaseChartComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.sliceLabelFormatSpecifiers != null && arrayFindByName(this.sliceLabelFormatSpecifiers, name)) {
return arrayFindByName(this.sliceLabelFormatSpecifiers, name);
}
if (this.legendSliceLabelFormatSpecifiers != null && arrayFindByName(this.legendSliceLabelFormatSpecifiers, name)) {
return arrayFindByName(this.legendSliceLabelFormatSpecifiers, name);
}
if (this.othersSliceLabelFormatSpecifiers != null && arrayFindByName(this.othersSliceLabelFormatSpecifiers, name)) {
return arrayFindByName(this.othersSliceLabelFormatSpecifiers, name);
}
if (this.legendOthersSliceLabelFormatSpecifiers != null && arrayFindByName(this.legendOthersSliceLabelFormatSpecifiers, name)) {
return arrayFindByName(this.legendOthersSliceLabelFormatSpecifiers, name);
}
return null;
};
/**
* Gets the Others context which provides a current list of items in Others slice.
*/
IgcDataPieBaseChartComponent.prototype.getOthersContext = function () {
var iv = this.i.aja();
var ret = null;
if (iv && iv.externalObject) {
ret = iv.externalObject;
}
else {
if (iv) {
var e = IgcOthersCategoryContextComponent._createFromInternal(iv);
e._implementation = iv;
iv.externalObject = e;
ret = e;
}
}
return ret;
};
IgcDataPieBaseChartComponent._observedAttributesIgcDataPieBaseChartComponent = null;
return IgcDataPieBaseChartComponent;
}(IgcRadialBaseChartComponent));