igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
509 lines (507 loc) • 18.5 kB
JavaScript
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 let IgcDataPieBaseChartComponent = /*@__PURE__*/ (() => {
class IgcDataPieBaseChartComponent extends IgcRadialBaseChartComponent {
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor() {
super();
}
connectedCallback() {
if (super["connectedCallback"]) {
super["connectedCallback"]();
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
}
disconnectedCallback() {
if (super["disconnectedCallback"]) {
super["disconnectedCallback"]();
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
}
static get observedAttributes() {
if (IgcDataPieBaseChartComponent._observedAttributesIgcDataPieBaseChartComponent == null) {
let names = getAllPropertyNames(IgcDataPieBaseChartComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcDataPieBaseChartComponent._observedAttributesIgcDataPieBaseChartComponent = names;
}
return IgcDataPieBaseChartComponent._observedAttributesIgcDataPieBaseChartComponent;
}
/**
* Gets or sets the label format for the slices.
*/
get sliceLabelFormat() {
return this.i.aki;
}
set sliceLabelFormat(v) {
this.i.aki = v;
}
/**
* Gets or sets the format specifiers to use with the labels for the slices.
*/
get sliceLabelFormatSpecifiers() {
return this.i.ahs;
}
set sliceLabelFormatSpecifiers(v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
const re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.ahs = v;
}
/**
* Gets or sets the label format for the LegendSlices.
*/
get legendSliceLabelFormat() {
return this.i.aj2;
}
set legendSliceLabelFormat(v) {
this.i.aj2 = v;
}
/**
* Gets or sets the format specifiers to use with the labels for the LegendSlices.
*/
get legendSliceLabelFormatSpecifiers() {
return this.i.ahq;
}
set legendSliceLabelFormatSpecifiers(v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
const re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.ahq = v;
}
/**
* Gets or sets the label format for the OthersSlices.
*/
get othersSliceLabelFormat() {
return this.i.akb;
}
set othersSliceLabelFormat(v) {
this.i.akb = v;
}
/**
* Gets or sets the format specifiers to use with the labels for the OthersSlices.
*/
get othersSliceLabelFormatSpecifiers() {
return this.i.ahr;
}
set othersSliceLabelFormatSpecifiers(v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
const re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.ahr = v;
}
/**
* Gets or sets the label format for the LegendOthersSlices.
*/
get legendOthersSliceLabelFormat() {
return this.i.ajy;
}
set legendOthersSliceLabelFormat(v) {
this.i.ajy = v;
}
/**
* Gets or sets the format specifiers to use with the labels for the LegendOthersSlices.
*/
get legendOthersSliceLabelFormatSpecifiers() {
return this.i.ahp;
}
set legendOthersSliceLabelFormatSpecifiers(v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
const re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.ahp = v;
}
/**
* 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 innerExtent() {
return this.i.ai2;
}
set innerExtent(v) {
this.i.ai2 = +v;
this._a("innerExtent", this.i.ai2);
}
/**
* 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 sweepDirection() {
return this.i.ah7;
}
set sweepDirection(v) {
this.i.ah7 = ensureEnum(PieChartSweepDirection_$type, v);
this._a("sweepDirection", enumToString(PieChartSweepDirection_$type, this.i.ah7));
}
/**
* Defines the positioning mode of the slice labels for the pie chart.
*/
get sliceLabelPositionMode() {
return this.i.ahw;
}
set sliceLabelPositionMode(v) {
this.i.ahw = ensureEnum(CalloutCollisionMode_$type, v);
this._a("sliceLabelPositionMode", enumToString(CalloutCollisionMode_$type, this.i.ahw));
}
/**
* Gets or sets the light color to use for slice labels.
*/
get lightSliceLabelColor() {
return brushToString(this.i.ala);
}
set lightSliceLabelColor(v) {
this.i.ala = stringToBrush(v);
this._a("lightSliceLabelColor", brushToString(this.i.ala));
}
/**
* Gets or sets the Dark color to use for slice labels.
*/
get darkSliceLabelColor() {
return brushToString(this.i.ak9);
}
set darkSliceLabelColor(v) {
this.i.ak9 = stringToBrush(v);
this._a("darkSliceLabelColor", brushToString(this.i.ak9));
}
/**
* Gets or sets the overridden value member path to use.
*/
get valueMemberPath() {
return this.i.aky;
}
set valueMemberPath(v) {
this.i.aky = v;
}
/**
* Gets or sets the legend label member path to use.
*/
get legendLabelMemberPath() {
return this.i.ajw;
}
set legendLabelMemberPath(v) {
this.i.ajw = v;
}
get legendEmptyValuesMode() {
return this.i.ah0;
}
set legendEmptyValuesMode(v) {
this.i.ah0 = ensureEnum(LegendEmptyValuesMode_$type, v);
this._a("legendEmptyValuesMode", enumToString(LegendEmptyValuesMode_$type, this.i.ah0));
}
/**
* Gets or sets whether to use numeric or percent-based threshold value.
*/
get othersCategoryType() {
return this.i.ah5;
}
set othersCategoryType(v) {
this.i.ah5 = ensureEnum(OthersCategoryType_$type, v);
this._a("othersCategoryType", enumToString(OthersCategoryType_$type, this.i.ah5));
}
/**
* Gets or sets the threshold value that determines if slices are grouped into the Others slice.
*/
get othersCategoryThreshold() {
return this.i.ai3;
}
set othersCategoryThreshold(v) {
this.i.ai3 = +v;
this._a("othersCategoryThreshold", this.i.ai3);
}
/**
* Gets or sets the label of the Others slice.
*/
get othersCategoryText() {
return this.i.aj7;
}
set othersCategoryText(v) {
this.i.aj7 = v;
}
/**
* Gets or sets the overridden value member path to use.
*/
get labelMemberPath() {
return this.i.ajt;
}
set labelMemberPath(v) {
this.i.ajt = v;
}
/**
* Gets or sets whether the axis should favor emitting a label at the end of the scale.
*/
get valueAxisFavorLabellingScaleEnd() {
return this.i.aio;
}
set valueAxisFavorLabellingScaleEnd(v) {
this.i.aio = ensureBool(v);
this._a("valueAxisFavorLabellingScaleEnd", this.i.aio);
}
/**
* Gets or sets how the numeric axis will adjust its range buffer to less closely fix the data from the series.
*/
get valueAxisAutoRangeBufferMode() {
return this.i.ahu;
}
set valueAxisAutoRangeBufferMode(v) {
this.i.ahu = ensureEnum(AxisRangeBufferMode_$type, v);
this._a("valueAxisAutoRangeBufferMode", enumToString(AxisRangeBufferMode_$type, this.i.ahu));
}
/**
* 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 angleAxisInterval() {
return this.i.ai0;
}
set angleAxisInterval(v) {
this.i.ai0 = +v;
this._a("angleAxisInterval", this.i.ai0);
}
/**
* 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 angleAxisMinorInterval() {
return this.i.ai1;
}
set angleAxisMinorInterval(v) {
this.i.ai1 = +v;
this._a("angleAxisMinorInterval", this.i.ai1);
}
/**
* Gets or sets the distance between each label and grid line along the Y-axis.
*/
get valueAxisInterval() {
return this.i.ai8;
}
set valueAxisInterval(v) {
this.i.ai8 = +v;
this._a("valueAxisInterval", this.i.ai8);
}
/**
* 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 valueAxisIsLogarithmic() {
return this.i.aip;
}
set valueAxisIsLogarithmic(v) {
this.i.aip = ensureBool(v);
this._a("valueAxisIsLogarithmic", this.i.aip);
}
/**
* 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 valueAxisLogarithmBase() {
return this.i.ajd;
}
set valueAxisLogarithmBase(v) {
this.i.ajd = +v;
this._a("valueAxisLogarithmBase", this.i.ajd);
}
/**
* Gets or sets the data value corresponding to the minimum value of the Y-axis.
*/
get valueAxisMinimumValue() {
return this.i.aja;
}
set valueAxisMinimumValue(v) {
this.i.aja = +v;
this._a("valueAxisMinimumValue", this.i.aja);
}
/**
* Gets or sets the data value corresponding to the maximum value of the Y-axis.
*/
get valueAxisMaximumValue() {
return this.i.ai9;
}
set valueAxisMaximumValue(v) {
this.i.ai9 = +v;
this._a("valueAxisMaximumValue", this.i.ai9);
}
/**
* Gets or sets the frequency of displayed minor lines along the Y-axis.
*/
get valueAxisMinorInterval() {
return this.i.ajb;
}
set valueAxisMinorInterval(v) {
this.i.ajb = +v;
this._a("valueAxisMinorInterval", this.i.ajb);
}
/**
* Gets the current minimum value for the Y-axis.
*/
get valueAxisActualMinimum() {
return this.i.ai7;
}
/**
* Gets the current maximum value for the Y-axis.
*/
get valueAxisActualMaximum() {
return this.i.ai6;
}
/**
* Gets or sets the extent of the chart's radius. Value between 0 and 1.
*/
get radiusExtent() {
return this.i.ai4;
}
set radiusExtent(v) {
this.i.ai4 = +v;
this._a("radiusExtent", this.i.ai4);
}
/**
* Gets or sets the start angle to use for the pie chart measured in degrees from the positive x axis.
*/
get startAngle() {
return this.i.ai5;
}
set startAngle(v) {
this.i.ai5 = +v;
this._a("startAngle", this.i.ai5);
}
/**
* Gets or sets the label of the Others slice.
*/
get sliceLabelContentSeparator() {
return this.i.akg;
}
set sliceLabelContentSeparator(v) {
this.i.akg = v;
}
/**
* Gets or sets the label of the Others slice.
*/
get sliceLabelContentMode() {
return this.i.aid;
}
set sliceLabelContentMode(v) {
this.i.aid = ensureEnum(RadialLabelMode_$type, v);
this._a("sliceLabelContentMode", enumToString(RadialLabelMode_$type, this.i.aid));
}
/**
* Gets or sets the label of the Others slice.
*/
get legendSliceLabelContentMode() {
return this.i.aic;
}
set legendSliceLabelContentMode(v) {
this.i.aic = ensureEnum(RadialLabelMode_$type, v);
this._a("legendSliceLabelContentMode", enumToString(RadialLabelMode_$type, this.i.aic));
}
/**
* Gets or sets whether to favor labelling the end of the scale.
*/
get angleAxisFavorLabellingScaleEnd() {
return this.i.aik;
}
set angleAxisFavorLabellingScaleEnd(v) {
this.i.aik = ensureBool(v);
this._a("angleAxisFavorLabellingScaleEnd", this.i.aik);
}
/**
* Gets or sets whether the large numbers on the Y-axis labels are abbreviated.
*/
get valueAxisAbbreviateLargeNumbers() {
return this.i.ain;
}
set valueAxisAbbreviateLargeNumbers(v) {
this.i.ain = ensureBool(v);
this._a("valueAxisAbbreviateLargeNumbers", this.i.ain);
}
/**
* Gets or sets collision avoidance between markers on series that support this behaviour.
*/
get markerCollision() {
return this.i.ahy;
}
set markerCollision(v) {
this.i.ahy = ensureEnum(CollisionAvoidanceType_$type, v);
this._a("markerCollision", enumToString(CollisionAvoidanceType_$type, this.i.ahy));
}
/**
* Gets or sets whether the mouse leave event should fire when a manipulation is starting.
*/
get fireMouseLeaveOnManipulationStart() {
return this.i.ail;
}
set fireMouseLeaveOnManipulationStart(v) {
this.i.ail = ensureBool(v);
this._a("fireMouseLeaveOnManipulationStart", this.i.ail);
}
findByName(name) {
var baseResult = super.findByName(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.
*/
getOthersContext() {
let iv = this.i.ah3();
let ret = null;
if (iv && iv.externalObject) {
ret = iv.externalObject;
}
else {
if (iv) {
let e = IgcOthersCategoryContextComponent._createFromInternal(iv);
e._implementation = iv;
iv.externalObject = e;
ret = e;
}
}
return ret;
}
}
IgcDataPieBaseChartComponent._observedAttributesIgcDataPieBaseChartComponent = null;
return IgcDataPieBaseChartComponent;
})();