UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

501 lines (492 loc) 19.4 kB
import { EventEmitter, Output, Component, Input } from '@angular/core'; import { delegateCombine } from "igniteui-angular-core"; import { IgxNumericXAxisComponent } from "./igx-numeric-x-axis-component"; import { IgxNumericYAxisComponent } from "./igx-numeric-y-axis-component"; import { TrendLineType_$type } from "igniteui-angular-core"; import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType"; import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode"; import { IgxAssigningScatterStyleEventArgs } from "./igx-assigning-scatter-style-event-args"; import { IgxAssigningScatterMarkerStyleEventArgs } from "./igx-assigning-scatter-marker-style-event-args"; import { ValueLayerValueMode_$type } from "./ValueLayerValueMode"; import { IgxMarkerSeriesComponent } from "./igx-marker-series-component"; import { ensureBool, ensureEnum, brushToString, stringToBrush, toDoubleCollection, fromDoubleCollection, toPoint, fromRect, fromPoint } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents the base class for all IgxDataChartComponent scatter series */ export let IgxScatterBaseComponent = /*@__PURE__*/ (() => { class IgxScatterBaseComponent extends IgxMarkerSeriesComponent { constructor() { super(); this._assigningScatterStyle = null; this._assigningScatterMarkerStyle = null; } /** * @hidden */ get i() { return this._implementation; } /** * Checks if this series is a scatter series */ get isScatter() { return this.i.fz; } /** * Gets or sets the effective x-axis for the current object. */ get xAxis() { const r = this.i.xAxis; if (r == null) { return null; } if (!r.externalObject) { let e = IgxNumericXAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set xAxis(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.xAxis = null : this.i.xAxis = v.i; } /** * Gets or sets the effective y-axis for the current object. */ get yAxis() { const r = this.i.yAxis; if (r == null) { return null; } if (!r.externalObject) { let e = IgxNumericYAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set yAxis(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.yAxis = null : this.i.yAxis = v.i; } /** * Gets or sets the value mapping property for the current series object. */ get xMemberPath() { return this.i.abd; } set xMemberPath(v) { this.i.abd = v; } /** * Gets or sets the value mapping property for the current series object. */ get yMemberPath() { return this.i.abl; } set yMemberPath(v) { this.i.abl = v; } /** * Gets or sets the highlighted X value mapping property for the current series object. */ get highlightedXMemberPath() { return this.i.aax; } set highlightedXMemberPath(v) { this.i.aax = v; } /** * Gets or sets the highlighted Y value mapping property for the current series object. */ get highlightedYMemberPath() { return this.i.aaz; } set highlightedYMemberPath(v) { this.i.aaz = v; } /** * Gets or sets the label displayed before series X value in the Data Legend. */ get xMemberAsLegendLabel() { return this.i.aa9; } set xMemberAsLegendLabel(v) { this.i.aa9 = v; } /** * Gets or sets the label displayed before series Y value in the Data Legend. */ get yMemberAsLegendLabel() { return this.i.abh; } set yMemberAsLegendLabel(v) { this.i.abh = v; } /** * Gets or sets the unit after displayed after series X value in the Data Legend. */ get xMemberAsLegendUnit() { return this.i.abb; } set xMemberAsLegendUnit(v) { this.i.abb = v; } /** * Gets or sets the unit after displayed after series Y value in the Data Legend. */ get yMemberAsLegendUnit() { return this.i.abj; } set yMemberAsLegendUnit(v) { this.i.abj = v; } /** * Gets or sets the trend type for the current scatter series. */ get trendLineType() { return this.i.trendLineType; } set trendLineType(v) { this.i.trendLineType = ensureEnum(TrendLineType_$type, v); } /** * Gets or sets the brush to use to draw the trend line. */ get trendLineBrush() { return brushToString(this.i.trendLineBrush); } set trendLineBrush(v) { this.i.trendLineBrush = stringToBrush(v); } /** * Gets the effective TrendLineBrush for this series. */ get actualTrendLineBrush() { return brushToString(this.i.ac2); } set actualTrendLineBrush(v) { this.i.ac2 = stringToBrush(v); } /** * Gets or sets the thickness of the current scatter series object's trend line. */ get trendLineThickness() { return this.i.trendLineThickness; } set trendLineThickness(v) { this.i.trendLineThickness = +v; } /** * 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 scatter series object. */ get trendLineDashArray() { return fromDoubleCollection(this.i.ac3); } set trendLineDashArray(v) { this.i.ac3 = toDoubleCollection(v); } /** * Gets or sets the moving average period for the current scatter series object. * The typical, and initial, value for trend line period is 7. */ get trendLinePeriod() { return this.i.trendLinePeriod; } set trendLinePeriod(v) { this.i.trendLinePeriod = +v; } /** * The desired behavior for markers in this series which are placed too close together for the current view, resulting in a collision. */ get markerCollisionAvoidance() { return this.i.zd; } set markerCollisionAvoidance(v) { this.i.zd = ensureEnum(CollisionAvoidanceType_$type, v); } /** * Gets or sets the Z-Index of the trend line. Values greater than 1000 will result in the trend line being rendered in front of the series data. */ get trendLineZIndex() { return this.i.aau; } set trendLineZIndex(v) { this.i.aau = +v; } /** * Gets or sets the maximum number of markerItems displayed by the current series. * If more than the specified number of markerItems are visible, the series will automatically * choose a representative set. */ get maximumMarkers() { return this.i.aat; } set maximumMarkers(v) { this.i.aat = +v; } /** * Gets or sets the mode the series will use to find the closest point to the cursor. */ get itemSearchMode() { return this.i.zs; } set itemSearchMode(v) { this.i.zs = ensureEnum(ScatterItemSearchMode_$type, v); } /** * Gets or sets the threshold to use when searching for items using ItemSearchMode. */ get itemSearchThreshold() { return this.i.aas; } set itemSearchThreshold(v) { this.i.aas = +v; } get actualItemSearchMode() { return this.i.zq; } set actualItemSearchMode(v) { this.i.zq = ensureEnum(ScatterItemSearchMode_$type, v); } /** * Gets or sets whether this Scatter series should allow custom style overrides of its individual visuals. */ get isCustomScatterStyleAllowed() { return this.i.z9; } set isCustomScatterStyleAllowed(v) { this.i.z9 = ensureBool(v); } /** * Gets or sets whether this Scatter series should allow custom style overrides of its individual marker visuals. */ get isCustomScatterMarkerStyleAllowed() { return this.i.z8; } set isCustomScatterMarkerStyleAllowed(v) { this.i.z8 = ensureBool(v); } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } 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; } _styling(container, component, parent) { super._styling(container, component, parent); this._inStyling = true; 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; } 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); } /** * 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.w9(toPoint(world)); return fromRect(iv); } /** * Determine if object can be used as YAxis * @param axis * The object to check */ canUseAsYAxis(axis) { let iv = this.i.z7(axis); return (iv); } /** * Determine if object can be used as XAxis * @param axis * The object to check */ canUseAsXAxis(axis) { let iv = this.i.z6(axis); 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.wv(toPoint(world), useInterpolation, skipUnknowns); return fromPoint(iv); } /** * Scrolls the series to display the item for the specified data item. * The series is scrolled by the minimum amount required to place the specified data item within * the central 80% of the visible axis. * @param item * The data item (item) to scroll to. */ scrollIntoView(item) { let iv = this.i.gj(item); return (iv); } /** * Gets the numeric values from the X and Y axis associated with this scatter series that matches the desired * value mode. * @param mode * The type of value desired from the series numeric axis. */ getSeriesValueType(mode) { let iv = this.i.aq(ensureEnum(ValueLayerValueMode_$type, mode)); return (iv); } getSeriesValueTypePositionFromValue(values) { let iv = this.i.wz(values); return fromPoint(iv); } getSeriesValueTypePosition(mode) { let iv = this.i.wy(ensureEnum(ValueLayerValueMode_$type, mode)); return fromPoint(iv); } /** * Event raised when Assigning Category Style */ get assigningScatterStyle() { if (this._assigningScatterStyle == null) { this._assigningScatterStyle = new EventEmitter(); this.i.assigningScatterStyle = delegateCombine(this.i.assigningScatterStyle, (o, e) => { let outerArgs = new IgxAssigningScatterStyleEventArgs(); outerArgs._provideImplementation(e); if (this.beforeAssigningScatterStyle) { this.beforeAssigningScatterStyle(this, outerArgs); } this._assigningScatterStyle.emit({ sender: this, args: outerArgs }); }); } return this._assigningScatterStyle; } /** * Event raised when Assigning Scatter Marker Style */ get assigningScatterMarkerStyle() { if (this._assigningScatterMarkerStyle == null) { this._assigningScatterMarkerStyle = new EventEmitter(); this.i.assigningScatterMarkerStyle = delegateCombine(this.i.assigningScatterMarkerStyle, (o, e) => { let outerArgs = new IgxAssigningScatterMarkerStyleEventArgs(); outerArgs._provideImplementation(e); if (this.beforeAssigningScatterMarkerStyle) { this.beforeAssigningScatterMarkerStyle(this, outerArgs); } this._assigningScatterMarkerStyle.emit({ sender: this, args: outerArgs }); }); } return this._assigningScatterMarkerStyle; } } IgxScatterBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxScatterBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxScatterBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxScatterBaseComponent, selector: "ng-component", inputs: { xAxis: "xAxis", yAxis: "yAxis", xMemberPath: "xMemberPath", yMemberPath: "yMemberPath", highlightedXMemberPath: "highlightedXMemberPath", highlightedYMemberPath: "highlightedYMemberPath", xMemberAsLegendLabel: "xMemberAsLegendLabel", yMemberAsLegendLabel: "yMemberAsLegendLabel", xMemberAsLegendUnit: "xMemberAsLegendUnit", yMemberAsLegendUnit: "yMemberAsLegendUnit", trendLineType: "trendLineType", trendLineBrush: "trendLineBrush", actualTrendLineBrush: "actualTrendLineBrush", trendLineThickness: "trendLineThickness", trendLineDashArray: "trendLineDashArray", trendLinePeriod: "trendLinePeriod", markerCollisionAvoidance: "markerCollisionAvoidance", trendLineZIndex: "trendLineZIndex", maximumMarkers: "maximumMarkers", itemSearchMode: "itemSearchMode", itemSearchThreshold: "itemSearchThreshold", actualItemSearchMode: "actualItemSearchMode", isCustomScatterStyleAllowed: "isCustomScatterStyleAllowed", isCustomScatterMarkerStyleAllowed: "isCustomScatterMarkerStyleAllowed" }, outputs: { assigningScatterStyle: "assigningScatterStyle", assigningScatterMarkerStyle: "assigningScatterMarkerStyle" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true }); return IgxScatterBaseComponent; })(); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxScatterBaseComponent, decorators: [{ type: Component, args: [{ template: ``, }] }], ctorParameters: function () { return []; }, propDecorators: { xAxis: [{ type: Input }], yAxis: [{ type: Input }], xMemberPath: [{ type: Input }], yMemberPath: [{ type: Input }], highlightedXMemberPath: [{ type: Input }], highlightedYMemberPath: [{ type: Input }], xMemberAsLegendLabel: [{ type: Input }], yMemberAsLegendLabel: [{ type: Input }], xMemberAsLegendUnit: [{ type: Input }], yMemberAsLegendUnit: [{ type: Input }], trendLineType: [{ type: Input }], trendLineBrush: [{ type: Input }], actualTrendLineBrush: [{ type: Input }], trendLineThickness: [{ type: Input }], trendLineDashArray: [{ type: Input }], trendLinePeriod: [{ type: Input }], markerCollisionAvoidance: [{ type: Input }], trendLineZIndex: [{ type: Input }], maximumMarkers: [{ type: Input }], itemSearchMode: [{ type: Input }], itemSearchThreshold: [{ type: Input }], actualItemSearchMode: [{ type: Input }], isCustomScatterStyleAllowed: [{ type: Input }], isCustomScatterMarkerStyleAllowed: [{ type: Input }], assigningScatterStyle: [{ type: Output }], assigningScatterMarkerStyle: [{ type: Output }] } });