UNPKG

igniteui-react-charts

Version:

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

619 lines (609 loc) 22.6 kB
import { __extends } from "tslib"; import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { RadialLabelMode_$type } from "igniteui-react-core"; import { CategoryCollisionMode_$type } from "./CategoryCollisionMode"; import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode"; import { IgrCategoryAngleAxis } from "./igr-category-angle-axis"; import { IgrNumericRadiusAxis } from "./igr-numeric-radius-axis"; import { IgrAssigningRadialStyleEventArgs } from "./igr-assigning-radial-style-event-args"; import { IgrAssigningRadialMarkerStyleEventArgs } from "./igr-assigning-radial-marker-style-event-args"; import { IgrMarkerSeries } from "./igr-marker-series"; import { ensureEnum, ensureBool, arrayFindByName, toPoint } from "igniteui-react-core"; /** * Represents the base class for all IgxDataChartComponent radial series */ var IgrRadialBase = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrRadialBase, _super); function IgrRadialBase(props) { var _this = _super.call(this, props) || this; _this._angleAxisName = null; _this._valueAxisName = null; _this._assigningRadialStyle = null; _this._assigningRadialStyle_wrapped = null; _this._assigningRadialMarkerStyle = null; _this._assigningRadialMarkerStyle_wrapped = null; return _this; } Object.defineProperty(IgrRadialBase.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "autoCalloutLabelPrecision", { /** * Gets or sets the format string to use for the auto callout labels for the others category. */ get: function () { return this.i.z7; }, set: function (v) { this.i.z7 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "autoCalloutPercentagePrecision", { /** * Gets or sets the format string to use for the auto callout labels for the others category. */ get: function () { return this.i.z8; }, set: function (v) { this.i.z8 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "autoCalloutLabelValueSeparator", { /** * Gets or sets the labelling mode to use for the auto callouts in preference to their mode. */ get: function () { return this.i.aag; }, set: function (v) { this.i.aag = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "legendRadialLabelMode", { /** * Gets or sets the labelling mode to use for the auto callouts in preference to their mode. */ get: function () { return this.i.zi; }, set: function (v) { this.i.zi = ensureEnum(RadialLabelMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "categoryCollisionMode", { /** * Gets or sets the category collision mode selection behavior to use for the series. */ get: function () { return this.i.y5; }, set: function (v) { this.i.y5 = ensureEnum(CategoryCollisionMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "autoCalloutRadialLabelMode", { /** * Gets or sets the labelling mode to use for the auto callouts in preference to their mode. */ get: function () { return this.i.zh; }, set: function (v) { this.i.zh = ensureEnum(RadialLabelMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "autoCalloutOthersLabelFormat", { /** * Gets or sets the format string to use for the auto callout labels for the others category. */ get: function () { return this.i.aai; }, set: function (v) { this.i.aai = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "autoCalloutOthersLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the auto callouts for the others category. */ get: function () { return this.i.yr; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.yr = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "proportionalRadialLabelFormat", { /** * Gets or sets the format string to use for the auto callout labels for the others category. */ get: function () { return this.i.aa5; }, set: function (v) { this.i.aa5 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "proportionalRadialLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the auto callouts for the others category. */ get: function () { return this.i.yw; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.yw = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "legendProportionalRadialLabelFormat", { /** * Gets or sets the format string to use for the auto callout labels for the others category. */ get: function () { return this.i.aav; }, set: function (v) { this.i.aav = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "legendProportionalRadialLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the auto callouts for the others category. */ get: function () { return this.i.yt; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.yt = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "othersProportionalRadialLabelFormat", { /** * Gets or sets the format string to use for the auto callout labels for the others category. */ get: function () { return this.i.aa2; }, set: function (v) { this.i.aa2 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "othersProportionalRadialLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the auto callouts for the others category. */ get: function () { return this.i.yv; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.yv = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "othersLegendProportionalRadialLabelFormat", { /** * Gets or sets the format string to use for the auto callout labels for the others category. */ get: function () { return this.i.aaz; }, set: function (v) { this.i.aaz = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "othersLegendProportionalRadialLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the auto callouts for the others category. */ get: function () { return this.i.yu; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.yu = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "isRadial", { /** * Checks if this series is a radial series */ get: function () { return this.i.fu; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "isCustomRadialStyleAllowed", { /** * Gets or sets whether this Radial series should allow custom style overrides of its individual visuals. */ get: function () { return this.i.zv; }, set: function (v) { this.i.zv = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "isCustomRadialMarkerStyleAllowed", { /** * Gets or sets whether this Radial series should allow custom style overrides of its individual marker visuals. */ get: function () { return this.i.zu; }, set: function (v) { this.i.zu = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "transitionInMode", { /** * Gets or sets the method by which to animate the data into the chart when the chart data source is swapped. * Note: Transitions are not currently supported for stacked series. */ get: function () { return this.i.y8; }, set: function (v) { this.i.y8 = ensureEnum(CategoryTransitionInMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "isTransitionInEnabled", { /** * Gets or sets whether the series should transition into the plot area when a new data source is assigned. * Note: Transitions are not currently supported for stacked series. */ get: function () { return this.i.zw; }, set: function (v) { this.i.zw = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "angleAxis", { /** * Gets the effective angle axis for the current series object. */ get: function () { var r = this.i.y4; if (r == null) { return null; } if (!r.externalObject) { var e = IgrCategoryAngleAxis._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; }, set: function (v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.y4 = null : this.i.y4 = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "angleAxisName", { /** * Gets or sets the name to use to resolve angleAxis from markup. */ get: function () { return this._angleAxisName; }, set: function (v) { this._angleAxisName = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "valueAxis", { /** * Gets the effective value axis for the current series object. */ get: function () { var r = this.i.za; if (r == null) { return null; } if (!r.externalObject) { var e = IgrNumericRadiusAxis._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; }, set: function (v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.za = null : this.i.za = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "valueAxisName", { /** * Gets or sets the name to use to resolve valueAxis from markup. */ get: function () { return this._valueAxisName; }, set: function (v) { this._valueAxisName = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "clipSeriesToBounds", { /** * Gets or sets whether to clip the series to the bounds. * Setting this property to true will decrease chart performance. */ get: function () { return this.i.zt; }, set: function (v) { this.i.zt = ensureBool(v); }, enumerable: false, configurable: true }); IgrRadialBase.prototype.bindAxes = function (axes) { _super.prototype.bindAxes.call(this, axes); for (var i = 0; i < axes.length; i++) { if (this.angleAxisName && this.angleAxisName.length > 0 && axes[i].name == this.angleAxisName) { this.angleAxis = axes[i]; } } for (var i = 0; i < axes.length; i++) { if (this.valueAxisName && this.valueAxisName.length > 0 && axes[i].name == this.valueAxisName) { this.valueAxis = axes[i]; } } }; IgrRadialBase.prototype.findByName = function (name) { var baseResult = _super.prototype.findByName.call(this, name); if (baseResult) { return baseResult; } if (this.autoCalloutOthersLabelFormatSpecifiers != null && arrayFindByName(this.autoCalloutOthersLabelFormatSpecifiers, name)) { return arrayFindByName(this.autoCalloutOthersLabelFormatSpecifiers, name); } if (this.proportionalRadialLabelFormatSpecifiers != null && arrayFindByName(this.proportionalRadialLabelFormatSpecifiers, name)) { return arrayFindByName(this.proportionalRadialLabelFormatSpecifiers, name); } if (this.legendProportionalRadialLabelFormatSpecifiers != null && arrayFindByName(this.legendProportionalRadialLabelFormatSpecifiers, name)) { return arrayFindByName(this.legendProportionalRadialLabelFormatSpecifiers, name); } if (this.othersProportionalRadialLabelFormatSpecifiers != null && arrayFindByName(this.othersProportionalRadialLabelFormatSpecifiers, name)) { return arrayFindByName(this.othersProportionalRadialLabelFormatSpecifiers, name); } if (this.othersLegendProportionalRadialLabelFormatSpecifiers != null && arrayFindByName(this.othersLegendProportionalRadialLabelFormatSpecifiers, name)) { return arrayFindByName(this.othersLegendProportionalRadialLabelFormatSpecifiers, name); } if (this.angleAxis && this.angleAxis.name && this.angleAxis.name == name) { return this.angleAxis; } if (this.valueAxis && this.valueAxis.name && this.valueAxis.name == name) { return this.valueAxis; } return null; }; IgrRadialBase.prototype._styling = function (container, component, parent) { _super.prototype._styling.call(this, container, component, parent); this._inStyling = true; if (this.angleAxis && this.angleAxis._styling) { this.angleAxis._styling(container, component, this); } if (this.valueAxis && this.valueAxis._styling) { this.valueAxis._styling(container, component, this); } this._inStyling = false; }; /** * Determine if object can be used as ValueAxis * @param axis * The object to check */ IgrRadialBase.prototype.canUseAsValueAxis = function (axis) { var iv = this.i.zs(axis); return (iv); }; /** * Determine if object can be used as AngleAxis * @param axis * The object to check */ IgrRadialBase.prototype.canUseAsAngleAxis = function (axis) { var iv = this.i.zr(axis); return (iv); }; /** * Gets the item that is the best match for the specified world coordinates. * @param world * The world coordinates to use. */ IgrRadialBase.prototype.getItem = function (world) { var iv = this.i.ko(toPoint(world)); return (iv); }; /** * Gets the angle to the provided world position from the center of the radial series. * @param world * The world position to get the angle for */ IgrRadialBase.prototype.getAngleFromWorld = function (world) { var iv = this.i.z2(toPoint(world)); return (iv); }; /** * Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex. * @param world * The world position for which to return the index. */ IgrRadialBase.prototype.getExactItemIndex = function (world) { var iv = this.i.is(toPoint(world)); return (iv); }; /** * Get the index of the item near the provided world coordinates. * @param world * The world coordinates for which to getch the item index. */ IgrRadialBase.prototype.getItemIndex = function (world) { var iv = this.i.j4(toPoint(world)); return (iv); }; /** * Scrolls the specified item into the view. * @param item * The item to scroll into view. */ IgrRadialBase.prototype.scrollIntoView = function (item) { var iv = this.i.ge(item); return (iv); }; /** * Returns the offset value for this series if grouped on a category axis. */ IgrRadialBase.prototype.getOffsetValue = function () { var iv = this.i.getOffsetValue(); return (iv); }; /** * Returns the width of the category grouping this series is in. */ IgrRadialBase.prototype.getCategoryWidth = function () { var iv = this.i.getCategoryWidth(); return (iv); }; Object.defineProperty(IgrRadialBase.prototype, "assigningRadialStyle", { /** * Event raised when Assigning Category Style */ get: function () { return this._assigningRadialStyle; }, set: function (ev) { var _this = this; if (this._assigningRadialStyle_wrapped !== null) { this.i.assigningRadialStyle = delegateRemove(this.i.assigningRadialStyle, this._assigningRadialStyle_wrapped); this._assigningRadialStyle_wrapped = null; this._assigningRadialStyle = null; } this._assigningRadialStyle = ev; this._assigningRadialStyle_wrapped = function (o, e) { var outerArgs = new IgrAssigningRadialStyleEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeAssigningRadialStyle) { _this.beforeAssigningRadialStyle(_this, outerArgs); } if (_this._assigningRadialStyle) { _this._assigningRadialStyle(_this, outerArgs); } }; this.i.assigningRadialStyle = delegateCombine(this.i.assigningRadialStyle, this._assigningRadialStyle_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgrRadialBase.prototype, "assigningRadialMarkerStyle", { /** * Event raised when Assigning Radial Marker Style */ get: function () { return this._assigningRadialMarkerStyle; }, set: function (ev) { var _this = this; if (this._assigningRadialMarkerStyle_wrapped !== null) { this.i.assigningRadialMarkerStyle = delegateRemove(this.i.assigningRadialMarkerStyle, this._assigningRadialMarkerStyle_wrapped); this._assigningRadialMarkerStyle_wrapped = null; this._assigningRadialMarkerStyle = null; } this._assigningRadialMarkerStyle = ev; this._assigningRadialMarkerStyle_wrapped = function (o, e) { var outerArgs = new IgrAssigningRadialMarkerStyleEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeAssigningRadialMarkerStyle) { _this.beforeAssigningRadialMarkerStyle(_this, outerArgs); } if (_this._assigningRadialMarkerStyle) { _this._assigningRadialMarkerStyle(_this, outerArgs); } }; this.i.assigningRadialMarkerStyle = delegateCombine(this.i.assigningRadialMarkerStyle, this._assigningRadialMarkerStyle_wrapped); ; }, enumerable: false, configurable: true }); return IgrRadialBase; }(IgrMarkerSeries)); export { IgrRadialBase };