UNPKG

igniteui-react-charts

Version:

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

159 lines (154 loc) 4.81 kB
import { IgrColorScale } from "./igr-color-scale"; import { IgrScatterTriangulationSeries } from "./igr-scatter-triangulation-series"; import { ScatterAreaSeries } from "./ScatterAreaSeries"; import { toPoint } from "igniteui-react-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 IgrScatterAreaSeries extends IgrScatterTriangulationSeries { createImplementation() { return new ScatterAreaSeries(); } /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); } /** * Gets whether the current series shows an area shape. */ get isArea() { return this.i.ew; } /** * Gets or sets ColorScale used to resolve the color values of points in the series. */ get colorScale() { const r = this.i.y0; if (r == null) { return null; } if (!r.externalObject) { let e = IgrColorScale._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set colorScale(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.y0 = null : this.i.y0 = 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.zc; } set colorMemberPath(v) { this.i.zc = v; } /** * Gets actual color scale that is set on ColorScale property or default ColorScale */ get actualColorScale() { const r = this.i.yz; if (r == null) { return null; } if (!r.externalObject) { let e = IgrColorScale._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set actualColorScale(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.yz = null : this.i.yz = v.i; } /** * Gets or sets the label displayed before series color value in the Data Legend. */ get colorMemberAsLegendLabel() { return this.i.y8; } set colorMemberAsLegendLabel(v) { this.i.y8 = v; } /** * Gets or sets the unit displayed after series color value in the Data Legend. */ get colorMemberAsLegendUnit() { return this.i.za; } set colorMemberAsLegendUnit(v) { this.i.za = 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.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 */ getMemberPathValue(memberPathName) { let iv = this.i.mf(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.ko(toPoint(world)); return (iv); } /** * Updates ActualColorScale properties when the ColorScale property has changed */ updateActualColorScale() { this.i.zj(); } /** * Attaches an image to the view of this series */ attachImage(image) { this.i.zg(image); } }