UNPKG

igniteui-webcomponents-charts

Version:

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

541 lines (536 loc) 21 kB
import { __extends } from "tslib"; import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core"; import { IgcBrushScaleComponent } from "./igc-brush-scale-component"; import { ShapeItemSearchMode_$type } from "./ShapeItemSearchMode"; import { IgcNumericXAxisComponent } from "./igc-numeric-x-axis-component"; import { IgcNumericYAxisComponent } from "./igc-numeric-y-axis-component"; import { IgcAssigningShapeStyleEventArgs } from "./igc-assigning-shape-style-event-args"; import { IgcAssigningShapeMarkerStyleEventArgs } from "./igc-assigning-shape-marker-style-event-args"; import { IgcStyleShapeEventArgs } from "./igc-style-shape-event-args"; import { IgcSeriesComponent } from "./igc-series-component"; import { getAllPropertyNames, toSpinal, ensureBool, ensureEnum, enumToString, toPoint, fromPoint } from "igniteui-webcomponents-core"; /** * Series class for rendering polygons. */ var IgcShapeSeriesBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcShapeSeriesBaseComponent, _super); function IgcShapeSeriesBaseComponent() { var _this = _super.call(this) || this; _this._xAxisName = null; _this._yAxisName = null; _this._assigningShapeStyle = null; _this._assigningShapeStyle_wrapped = null; _this._assigningShapeMarkerStyle = null; _this._assigningShapeMarkerStyle_wrapped = null; _this._styleShape = null; _this._styleShape_wrapped = null; return _this; } Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcShapeSeriesBaseComponent.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(); } }; IgcShapeSeriesBaseComponent.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(IgcShapeSeriesBaseComponent, "observedAttributes", { get: function () { if (IgcShapeSeriesBaseComponent._observedAttributesIgcShapeSeriesBaseComponent == null) { var names = getAllPropertyNames(IgcShapeSeriesBaseComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcShapeSeriesBaseComponent._observedAttributesIgcShapeSeriesBaseComponent = names; } return IgcShapeSeriesBaseComponent._observedAttributesIgcShapeSeriesBaseComponent; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "isCustomShapeStyleAllowed", { /** * Gets or sets whether this Shape series should allow custom style overrides of its individual visuals. */ get: function () { return this.i.yd; }, set: function (v) { this.i.yd = ensureBool(v); this._a("isCustomShapeStyleAllowed", this.i.yd); }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "isCustomShapeMarkerStyleAllowed", { /** * Gets or sets whether this Shape series should allow custom style overrides of its individual marker visuals. */ get: function () { return this.i.yc; }, set: function (v) { this.i.yc = ensureBool(v); this._a("isCustomShapeMarkerStyleAllowed", this.i.yc); }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "fillMemberPath", { /** * Gets or sets the fill mapping property for the current series object. */ get: function () { return this.i.yz; }, set: function (v) { this.i.yz = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "fillScale", { /** * Gets or sets the brush scale for the fill brush of markers. */ get: function () { var r = this.i.xf; if (r == null) { return null; } if (!r.externalObject) { var e = IgcBrushScaleComponent._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.xf = null : this.i.xf = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "fillScaleUseGlobalValues", { /** * Gets or sets whether or not the FillScale uses global min/max values of FillMemberPath from multiple series. * This setting applies only if multiple series are using the same FillScale. */ get: function () { return this.i.x8; }, set: function (v) { this.i.x8 = ensureBool(v); this._a("fillScaleUseGlobalValues", this.i.x8); }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "actualItemSearchMode", { get: function () { return this.i.xn; }, set: function (v) { this.i.xn = ensureEnum(ShapeItemSearchMode_$type, v); this._a("actualItemSearchMode", enumToString(ShapeItemSearchMode_$type, this.i.xn)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "itemSearchMode", { /** * Gets or sets the mode the series will use to find the closest point to the cursor. */ get: function () { return this.i.xp; }, set: function (v) { this.i.xp = ensureEnum(ShapeItemSearchMode_$type, v); this._a("itemSearchMode", enumToString(ShapeItemSearchMode_$type, this.i.xp)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "itemSearchThreshold", { /** * Gets or sets the threshold to use when searching for items using ItemSearchMode. */ get: function () { return this.i.yv; }, set: function (v) { this.i.yv = +v; this._a("itemSearchThreshold", this.i.yv); }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "itemSearchPointsThreshold", { /** * Gets or sets the points threshold to use when searching for items using ItemSearchMode. */ get: function () { return this.i.yu; }, set: function (v) { this.i.yu = +v; this._a("itemSearchPointsThreshold", this.i.yu); }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "shapeMemberPath", { /** * The name of the property on ItemsSource items which, for each shape, contains a list of points to be converted to a polygon. * To be consistent with the Shapefile technical description, it is expected that each list of points is defined as an IEnumerable of IEnumerable of Point, or in other words, a list of lists of points. */ get: function () { return this.i.zc; }, set: function (v) { this.i.zc = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "highlightedShapeMemberPath", { /** * Gets or sets the value mapping property for the current series object. */ get: function () { return this.i.y3; }, set: function (v) { this.i.y3 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "xAxis", { /** * Gets or sets the effective x-axis for the current ScatterBase object. */ get: function () { var r = this.i.xj; if (r == null) { return null; } if (!r.externalObject) { var e = IgcNumericXAxisComponent._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.xj = null : this.i.xj = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "xAxisName", { /** * Gets or sets the name to use to resolve xAxis from markup. */ get: function () { return this._xAxisName; }, set: function (v) { this._xAxisName = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "yAxis", { /** * Gets or sets the effective y-axis for the current ScatterBase object. */ get: function () { var r = this.i.xl; if (r == null) { return null; } if (!r.externalObject) { var e = IgcNumericYAxisComponent._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.xl = null : this.i.xl = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "yAxisName", { /** * Gets or sets the name to use to resolve yAxis from markup. */ get: function () { return this._yAxisName; }, set: function (v) { this._yAxisName = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "shapeFilterResolution", { /** * The resolution at which to filter out shapes in the series. For example, if the ShapeFilterResolution is set to 3, then elements with a bounding rectangle smaller than 3 X 3 pixels will be filtered out. * In the case of ScatterPolylineSeries, the resolution is compared to either dimension, rather than both. In other words, a polyline will not be filtered if its height or its width exceeds the value of this property. Whereas with a ShapeSeries, both the height and the width must exceed the value of this property. */ get: function () { return this.i.yr; }, set: function (v) { this.i.yr = +v; this._a("shapeFilterResolution", this.i.yr); }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "isShape", { /** * Gets whether or not this series is a shape series */ get: function () { return this.i.fy; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "isMarkerlessDisplayPreferred", { /** * Overridden by derived series classes to indicate when marker-less display is preferred or not. */ get: function () { return this.i.fm; }, enumerable: false, configurable: true }); IgcShapeSeriesBaseComponent.prototype.bindAxes = function (axes) { _super.prototype.bindAxes.call(this, axes); for (var i = 0; i < axes.length; i++) { if (this.xAxisName && this.xAxisName.length > 0 && axes[i].name == this.xAxisName) { this.xAxis = axes[i]; } } for (var i = 0; i < axes.length; i++) { if (this.yAxisName && this.yAxisName.length > 0 && axes[i].name == this.yAxisName) { this.yAxis = axes[i]; } } }; IgcShapeSeriesBaseComponent.prototype.findByName = function (name) { var baseResult = _super.prototype.findByName.call(this, name); if (baseResult) { return baseResult; } if (this.fillScale && this.fillScale.name && this.fillScale.name == name) { return this.fillScale; } if (this.xAxis && this.xAxis.name && this.xAxis.name == name) { return this.xAxis; } if (this.yAxis && this.yAxis.name && this.yAxis.name == name) { return this.yAxis; } return null; }; IgcShapeSeriesBaseComponent.prototype._styling = function (container, component, parent) { _super.prototype._styling.call(this, container, component, parent); this._inStyling = true; if (this.fillScale && this.fillScale._styling) { this.fillScale._styling(container, component, this); } if (this.xAxis && this.xAxis._styling) { this.xAxis._styling(container, component, this); } if (this.yAxis && this.yAxis._styling) { this.yAxis._styling(container, component, this); } this._inStyling = false; }; IgcShapeSeriesBaseComponent.prototype.getItemValue = function (item, memberPathName) { var iv = this.i.kr(item, memberPathName); return (iv); }; /** * Gets the value of a requested member path from the series. * @param memberPathName * The property name of a valid member path for the series */ IgcShapeSeriesBaseComponent.prototype.getMemberPathValue = function (memberPathName) { var iv = this.i.mf(memberPathName); return (iv); }; IgcShapeSeriesBaseComponent.prototype.getExactItemIndex = function (world) { var iv = this.i.is(toPoint(world)); return (iv); }; IgcShapeSeriesBaseComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) { var iv = this.i.wh(toPoint(world), useInterpolation, skipUnknowns); return fromPoint(iv); }; /** * Gets the item that is the best match for the specified world coordinates. * @param world * The world coordinates to use. */ IgcShapeSeriesBaseComponent.prototype.getItem = function (world) { var iv = this.i.ko(toPoint(world)); return (iv); }; /** * Determine if object can be used as YAxis * @param axis * The object to check */ IgcShapeSeriesBaseComponent.prototype.canUseAsYAxis = function (axis) { var iv = this.i.x7(axis); return (iv); }; /** * Determine if object can be used as XAxis * @param axis * The object to check */ IgcShapeSeriesBaseComponent.prototype.canUseAsXAxis = function (axis) { var iv = this.i.x6(axis); return (iv); }; Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "assigningShapeStyle", { /** * Event raised when Assigning Shape Style. Note, if using this event, or highlighting, its best to avoid use of ShapeStyle/StyleShape/ShapeStyleSelector. */ get: function () { return this._assigningShapeStyle; }, set: function (ev) { var _this = this; if (this._assigningShapeStyle_wrapped !== null) { this.i.assigningShapeStyle = delegateRemove(this.i.assigningShapeStyle, this._assigningShapeStyle_wrapped); this._assigningShapeStyle_wrapped = null; this._assigningShapeStyle = null; } this._assigningShapeStyle = ev; this._assigningShapeStyle_wrapped = function (o, e) { var outerArgs = new IgcAssigningShapeStyleEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeAssigningShapeStyle) { _this.beforeAssigningShapeStyle(_this, outerArgs); } if (_this._assigningShapeStyle) { _this._assigningShapeStyle(_this, outerArgs); } }; this.i.assigningShapeStyle = delegateCombine(this.i.assigningShapeStyle, this._assigningShapeStyle_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "assigningShapeMarkerStyle", { /** * Event raised when Assigning Shape Marker Style */ get: function () { return this._assigningShapeMarkerStyle; }, set: function (ev) { var _this = this; if (this._assigningShapeMarkerStyle_wrapped !== null) { this.i.assigningShapeMarkerStyle = delegateRemove(this.i.assigningShapeMarkerStyle, this._assigningShapeMarkerStyle_wrapped); this._assigningShapeMarkerStyle_wrapped = null; this._assigningShapeMarkerStyle = null; } this._assigningShapeMarkerStyle = ev; this._assigningShapeMarkerStyle_wrapped = function (o, e) { var outerArgs = new IgcAssigningShapeMarkerStyleEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeAssigningShapeMarkerStyle) { _this.beforeAssigningShapeMarkerStyle(_this, outerArgs); } if (_this._assigningShapeMarkerStyle) { _this._assigningShapeMarkerStyle(_this, outerArgs); } }; this.i.assigningShapeMarkerStyle = delegateCombine(this.i.assigningShapeMarkerStyle, this._assigningShapeMarkerStyle_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgcShapeSeriesBaseComponent.prototype, "styleShape", { /** * Raised when tile's image URI should be provided */ get: function () { return this._styleShape; }, set: function (ev) { var _this = this; if (this._styleShape_wrapped !== null) { this.i.styleShape = delegateRemove(this.i.styleShape, this._styleShape_wrapped); this._styleShape_wrapped = null; this._styleShape = null; } this._styleShape = ev; this._styleShape_wrapped = function (o, e) { var outerArgs = new IgcStyleShapeEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeStyleShape) { _this.beforeStyleShape(_this, outerArgs); } if (_this._styleShape) { _this._styleShape(_this, outerArgs); } }; this.i.styleShape = delegateCombine(this.i.styleShape, this._styleShape_wrapped); ; }, enumerable: false, configurable: true }); IgcShapeSeriesBaseComponent._observedAttributesIgcShapeSeriesBaseComponent = null; return IgcShapeSeriesBaseComponent; }(IgcSeriesComponent)); export { IgcShapeSeriesBaseComponent };