UNPKG

igniteui-webcomponents-charts

Version:

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

533 lines (524 loc) 19.5 kB
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core"; import { IgcNumericAngleAxisComponent } from "./igc-numeric-angle-axis-component"; import { IgcNumericRadiusAxisComponent } from "./igc-numeric-radius-axis-component"; import { TrendLineType_$type } from "igniteui-webcomponents-core"; import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode"; import { IgcAssigningPolarStyleEventArgs } from "./igc-assigning-polar-style-event-args"; import { IgcAssigningPolarMarkerStyleEventArgs } from "./igc-assigning-polar-marker-style-event-args"; import { IgcMarkerSeriesComponent } from "./igc-marker-series-component"; import { getAllPropertyNames, toSpinal, ensureBool, ensureEnum, enumToString, brushToString, stringToBrush, toDoubleCollection, fromDoubleCollection, doubleCollectionToString, toPoint, fromRect, fromPoint } from "igniteui-webcomponents-core"; let IgcPolarBaseComponent = /*@__PURE__*/ (() => { class IgcPolarBaseComponent extends IgcMarkerSeriesComponent { /** * @hidden */ get i() { return this._implementation; } constructor() { super(); this._angleAxisName = null; this._radiusAxisName = null; this._assigningPolarStyle = null; this._assigningPolarStyle_wrapped = null; this._assigningPolarMarkerStyle = null; this._assigningPolarMarkerStyle_wrapped = null; } 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 (IgcPolarBaseComponent._observedAttributesIgcPolarBaseComponent == null) { let names = getAllPropertyNames(IgcPolarBaseComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcPolarBaseComponent._observedAttributesIgcPolarBaseComponent = names; } return IgcPolarBaseComponent._observedAttributesIgcPolarBaseComponent; } /** * Checks if this series is a polar series */ get isPolar() { return this.i.fs; } /** * Gets or sets the path to use to find the angle values for the series. */ get angleMemberPath() { return this.i.aa4; } set angleMemberPath(v) { this.i.aa4 = v; } /** * Gets or sets the path to use to get the radius values for the series. */ get radiusMemberPath() { return this.i.abm; } set radiusMemberPath(v) { this.i.abm = v; } /** * Gets or sets the highlighted radius value mapping property for the current series object. */ get highlightedRadiusMemberPath() { return this.i.aa9; } set highlightedRadiusMemberPath(v) { this.i.aa9 = v; } /** * Gets or sets the highlighted angle value mapping property for the current series object. */ get highlightedAngleMemberPath() { return this.i.aa7; } set highlightedAngleMemberPath(v) { this.i.aa7 = v; } /** * Gets the effective angle axis for the current series object. */ get angleAxis() { const r = this.i.ze; if (r == null) { return null; } if (!r.externalObject) { let e = IgcNumericAngleAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set angleAxis(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.ze = null : this.i.ze = v.i; } /** * Gets or sets the name to use to resolve angleAxis from markup. */ get angleAxisName() { return this._angleAxisName; } set angleAxisName(v) { this._angleAxisName = v; } /** * Gets the effective radius axis for the current series object. */ get radiusAxis() { const r = this.i.zf; if (r == null) { return null; } if (!r.externalObject) { let e = IgcNumericRadiusAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set radiusAxis(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.zf = null : this.i.zf = v.i; } /** * Gets or sets the name to use to resolve radiusAxis from markup. */ get radiusAxisName() { return this._radiusAxisName; } set radiusAxisName(v) { this._radiusAxisName = v; } /** * Gets or sets whether Cartesian Interpolation should be used rather than Archimedian * spiral based interpolation. */ get useCartesianInterpolation() { return this.i.aak; } set useCartesianInterpolation(v) { this.i.aak = ensureBool(v); this._a("useCartesianInterpolation", this.i.aak); } /** * Gets or sets the maximum number of markers displayed by the current series. * If more than the specified number of markers are visible, the polar series will automatically * choose a representative set. */ get maximumMarkers() { return this.i.aau; } set maximumMarkers(v) { this.i.aau = +v; this._a("maximumMarkers", this.i.aau); } /** * Gets or sets the trend type for the current series object. */ get trendLineType() { return this.i.zw; } set trendLineType(v) { this.i.zw = ensureEnum(TrendLineType_$type, v); this._a("trendLineType", enumToString(TrendLineType_$type, this.i.zw)); } /** * Gets or sets the brush that specifies how the current series * object's trend line is drawn. */ get trendLineBrush() { return brushToString(this.i.act); } set trendLineBrush(v) { this.i.act = stringToBrush(v); this._a("trendLineBrush", brushToString(this.i.act)); } /** * Gets the effective TrendLineBrush for this series. */ get actualTrendLineBrush() { return brushToString(this.i.acs); } set actualTrendLineBrush(v) { this.i.acs = stringToBrush(v); this._a("actualTrendLineBrush", brushToString(this.i.acs)); } /** * Gets or sets the thickness of the current series object's trend line. */ get trendLineThickness() { return this.i.aas; } set trendLineThickness(v) { this.i.aas = +v; this._a("trendLineThickness", this.i.aas); } /** * Gets or sets a collection of double values that indicate the pattern of dashes and gaps that * is used to draw the trend line for the current series object. */ get trendLineDashArray() { return fromDoubleCollection(this.i.acu); } set trendLineDashArray(v) { this.i.acu = toDoubleCollection(v); this._a("trendLineDashArray", doubleCollectionToString(this.i.acu)); } /** * Gets or sets the moving average period for the current series object. */ get trendLinePeriod() { return this.i.aav; } set trendLinePeriod(v) { this.i.aav = +v; this._a("trendLinePeriod", this.i.aav); } /** * Sets or Gets the Trendline Z index. */ get trendLineZIndex() { return this.i.aaw; } set trendLineZIndex(v) { this.i.aaw = +v; this._a("trendLineZIndex", this.i.aaw); } /** * Gets or sets whether to clip the series to the bounds. * Setting this to true can effect performance. */ get clipSeriesToBounds() { return this.i.aaa; } set clipSeriesToBounds(v) { this.i.aaa = ensureBool(v); this._a("clipSeriesToBounds", this.i.aaa); } get actualItemSearchMode() { return this.i.zs; } set actualItemSearchMode(v) { this.i.zs = ensureEnum(ScatterItemSearchMode_$type, v); this._a("actualItemSearchMode", enumToString(ScatterItemSearchMode_$type, this.i.zs)); } /** * Gets or sets the mode the series will use to find the closest point to the cursor. */ get itemSearchMode() { return this.i.zu; } set itemSearchMode(v) { this.i.zu = ensureEnum(ScatterItemSearchMode_$type, v); this._a("itemSearchMode", enumToString(ScatterItemSearchMode_$type, this.i.zu)); } /** * Gets or sets the threshold to use when searching for items using ItemSearchMode. */ get itemSearchThreshold() { return this.i.aat; } set itemSearchThreshold(v) { this.i.aat = +v; this._a("itemSearchThreshold", this.i.aat); } /** * Gets or sets whether this Polar series should allow custom style overrides of its individual visuals. */ get isCustomPolarStyleAllowed() { return this.i.aad; } set isCustomPolarStyleAllowed(v) { this.i.aad = ensureBool(v); this._a("isCustomPolarStyleAllowed", this.i.aad); } /** * Gets or sets whether this Polar series should allow custom style overrides of its individual marker visuals. */ get isCustomPolarMarkerStyleAllowed() { return this.i.aac; } set isCustomPolarMarkerStyleAllowed(v) { this.i.aac = ensureBool(v); this._a("isCustomPolarMarkerStyleAllowed", this.i.aac); } /** * Gets or sets the label displayed before series' radius value in the Data Legend. */ get radiusMemberAsLegendLabel() { return this.i.abi; } set radiusMemberAsLegendLabel(v) { this.i.abi = v; } /** * Gets or sets the label displayed before series' angle value in the Data Legend. */ get angleMemberAsLegendLabel() { return this.i.aa0; } set angleMemberAsLegendLabel(v) { this.i.aa0 = v; } /** * Gets or sets the unit displayed after series' radius value in the Data Legend. */ get radiusMemberAsLegendUnit() { return this.i.abk; } set radiusMemberAsLegendUnit(v) { this.i.abk = v; } /** * Gets or sets the unit displayed after series' angle value in the Data Legend. */ get angleMemberAsLegendUnit() { return this.i.aa2; } set angleMemberAsLegendUnit(v) { this.i.aa2 = v; } bindAxes(axes) { super.bindAxes(axes); for (let i = 0; i < axes.length; i++) { if (this.angleAxisName && this.angleAxisName.length > 0 && axes[i].name == this.angleAxisName) { this.angleAxis = axes[i]; } } for (let i = 0; i < axes.length; i++) { if (this.radiusAxisName && this.radiusAxisName.length > 0 && axes[i].name == this.radiusAxisName) { this.radiusAxis = axes[i]; } } } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.angleAxis && this.angleAxis.name && this.angleAxis.name == name) { return this.angleAxis; } if (this.radiusAxis && this.radiusAxis.name && this.radiusAxis.name == name) { return this.radiusAxis; } return null; } _styling(container, component, parent) { super._styling(container, component, parent); this._inStyling = true; if (this.angleAxis && this.angleAxis._styling) { this.angleAxis._styling(container, component, this); } if (this.radiusAxis && this.radiusAxis._styling) { this.radiusAxis._styling(container, component, this); } this._inStyling = false; } /** * If possible, will return the best available value marker bounding box within the series that has the best value match for the world position provided. * @param world * The world coordinates for which to get a value marker bounding box for */ getSeriesValueMarkerBoundingBox(world) { let iv = this.i.xa(toPoint(world)); return fromRect(iv); } /** * Gets an unscaled position in terms of axis values from a viewport position. * @param pos * The viewport relative position */ getUnscaledPosition(pos) { let iv = this.i.w1(toPoint(pos)); return fromPoint(iv); } /** * Scrolls the requested item into view, if possible. * @param item * The item to scroll into view. */ scrollIntoView(item) { let iv = this.i.gj(item); return (iv); } /** * Gets the item that is the best match for the specified world coordinates. * @param world * The world coordinates to use. */ getItem(world) { let iv = this.i.kw(toPoint(world)); return (iv); } /** * Gets the index of the item that resides at the provided world coordinates. * @param world * The world coordinates of the requested item. */ getItemIndex(world) { let iv = this.i.kc(toPoint(world)); return (iv); } getExactItemIndex(world) { let iv = this.i.iy(toPoint(world)); return (iv); } getSeriesValuePosition(world, useInterpolation, skipUnknowns) { let iv = this.i.ww(toPoint(world), useInterpolation, skipUnknowns); return fromPoint(iv); } getItemValue(item, memberPathName) { let iv = this.i.kz(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 */ getMemberPathValue(memberPathName) { let iv = this.i.mo(memberPathName); return (iv); } /** * Determine if object can be used as RadiusAxis * @param axis * The object to check */ canUseAsRadiusAxis(axis) { let iv = this.i.z9(axis); return (iv); } /** * Determine if object can be used as AngleAxis * @param axis * The object to check */ canUseAsAngleAxis(axis) { let iv = this.i.z8(axis); return (iv); } /** * Event raised when Assigning Category Style */ get assigningPolarStyle() { return this._assigningPolarStyle; } set assigningPolarStyle(ev) { if (this._assigningPolarStyle_wrapped !== null) { this.i.assigningPolarStyle = delegateRemove(this.i.assigningPolarStyle, this._assigningPolarStyle_wrapped); this._assigningPolarStyle_wrapped = null; this._assigningPolarStyle = null; } this._assigningPolarStyle = ev; this._assigningPolarStyle_wrapped = (o, e) => { let outerArgs = new IgcAssigningPolarStyleEventArgs(); outerArgs._provideImplementation(e); if (this.beforeAssigningPolarStyle) { this.beforeAssigningPolarStyle(this, outerArgs); } if (this._assigningPolarStyle) { this._assigningPolarStyle(this, outerArgs); } }; this.i.assigningPolarStyle = delegateCombine(this.i.assigningPolarStyle, this._assigningPolarStyle_wrapped); ; } /** * Event raised when Assigning Polar Marker Style */ get assigningPolarMarkerStyle() { return this._assigningPolarMarkerStyle; } set assigningPolarMarkerStyle(ev) { if (this._assigningPolarMarkerStyle_wrapped !== null) { this.i.assigningPolarMarkerStyle = delegateRemove(this.i.assigningPolarMarkerStyle, this._assigningPolarMarkerStyle_wrapped); this._assigningPolarMarkerStyle_wrapped = null; this._assigningPolarMarkerStyle = null; } this._assigningPolarMarkerStyle = ev; this._assigningPolarMarkerStyle_wrapped = (o, e) => { let outerArgs = new IgcAssigningPolarMarkerStyleEventArgs(); outerArgs._provideImplementation(e); if (this.beforeAssigningPolarMarkerStyle) { this.beforeAssigningPolarMarkerStyle(this, outerArgs); } if (this._assigningPolarMarkerStyle) { this._assigningPolarMarkerStyle(this, outerArgs); } }; this.i.assigningPolarMarkerStyle = delegateCombine(this.i.assigningPolarMarkerStyle, this._assigningPolarMarkerStyle_wrapped); ; } } IgcPolarBaseComponent._observedAttributesIgcPolarBaseComponent = null; return IgcPolarBaseComponent; })(); export { IgcPolarBaseComponent };