UNPKG

igniteui-angular-charts

Version:

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

183 lines (178 loc) 7.21 kB
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { IgxColorScaleComponent } from "./igx-color-scale-component"; import { IgxScatterTriangulationSeriesComponent } from "./igx-scatter-triangulation-series-component"; import { IgxSeriesComponent } from "./igx-series-component"; import { ScatterAreaSeries } from "./ScatterAreaSeries"; import { toPoint } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Series class which draws a colored 2D surface based on a triangulation of XY data with numeric values assigned to each point. */ export class IgxScatterAreaSeriesComponent extends IgxScatterTriangulationSeriesComponent { createImplementation() { return new ScatterAreaSeries(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); } /** * Gets whether the current series shows an area shape. */ get isArea() { return this.i.ex; } /** * Gets or sets ColorScale used to resolve the color values of points in the series. */ get colorScale() { const r = this.i.zi; if (r == null) { return null; } if (!r.externalObject) { let e = IgxColorScaleComponent._createFromInternal(r); if (e) { e._implementation = r; } Object.defineProperty(r, 'externalObject', { value: e, enumerable: false, configurable: true, writable: true }); } return r.externalObject; } set colorScale(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.zi = null : this.i.zi = v.i; } /** * Gets or sets the name of the property on each data item containing a numeric value which can be converted to a color by the ColorScale. */ get colorMemberPath() { return this.i.zu; } set colorMemberPath(v) { this.i.zu = v; } /** * Gets actual color scale that is set on ColorScale property or default ColorScale */ get actualColorScale() { const r = this.i.zh; if (r == null) { return null; } if (!r.externalObject) { let e = IgxColorScaleComponent._createFromInternal(r); if (e) { e._implementation = r; } Object.defineProperty(r, 'externalObject', { value: e, enumerable: false, configurable: true, writable: true }); } return r.externalObject; } set actualColorScale(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.zh = null : this.i.zh = v.i; } /** * Gets or sets the label displayed before series color value in the Data Legend. */ get colorMemberAsLegendLabel() { return this.i.zq; } set colorMemberAsLegendLabel(v) { this.i.zq = v; } /** * Gets or sets the unit displayed after series color value in the Data Legend. */ get colorMemberAsLegendUnit() { return this.i.zs; } set colorMemberAsLegendUnit(v) { this.i.zs = v; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.colorScale && this.colorScale.name && this.colorScale.name == name) { return this.colorScale; } if (this.actualColorScale && this.actualColorScale.name && this.actualColorScale.name == name) { return this.actualColorScale; } return null; } _styling(container, component, parent) { super._styling(container, component, parent); this._inStyling = true; if (this.colorScale && this.colorScale._styling) { this.colorScale._styling(container, component, this); } if (this.actualColorScale && this.actualColorScale._styling) { this.actualColorScale._styling(container, component, this); } this._inStyling = false; } getItemValue(item, memberPathName) { let iv = this.i.k1(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.mq(memberPathName); 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.ky(toPoint(world)); return (iv); } /** * Updates ActualColorScale properties when the ColorScale property has changed */ updateActualColorScale() { this.i.z1(); } /** * Attaches an image to the view of this series */ attachImage(image) { this.i.zy(image); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxScatterAreaSeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0-rc.1", type: IgxScatterAreaSeriesComponent, isStandalone: true, selector: "igx-scatter-area-series", inputs: { colorScale: "colorScale", colorMemberPath: "colorMemberPath", actualColorScale: "actualColorScale", colorMemberAsLegendLabel: "colorMemberAsLegendLabel", colorMemberAsLegendUnit: "colorMemberAsLegendUnit" }, providers: [{ provide: IgxScatterTriangulationSeriesComponent, useExisting: forwardRef(() => IgxScatterAreaSeriesComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxScatterAreaSeriesComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxScatterAreaSeriesComponent, decorators: [{ type: Component, args: [{ selector: 'igx-scatter-area-series', template: ``, providers: [{ provide: IgxScatterTriangulationSeriesComponent, useExisting: forwardRef(() => IgxScatterAreaSeriesComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxScatterAreaSeriesComponent) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: () => [], propDecorators: { colorScale: [{ type: Input }], colorMemberPath: [{ type: Input }], actualColorScale: [{ type: Input }], colorMemberAsLegendLabel: [{ type: Input }], colorMemberAsLegendUnit: [{ type: Input }] } });