igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
390 lines (385 loc) • 15.9 kB
JavaScript
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxBrushScaleComponent } from "./igx-brush-scale-component";
import { ShapeItemSearchMode_$type } from "./ShapeItemSearchMode";
import { IgxNumericXAxisComponent } from "./igx-numeric-x-axis-component";
import { IgxNumericYAxisComponent } from "./igx-numeric-y-axis-component";
import { IgxAssigningShapeStyleEventArgs } from "./igx-assigning-shape-style-event-args";
import { IgxAssigningShapeMarkerStyleEventArgs } from "./igx-assigning-shape-marker-style-event-args";
import { IgxStyleShapeEventArgs } from "./igx-style-shape-event-args";
import { IgxSeriesComponent } from "./igx-series-component";
import { ensureBool, ensureEnum, toPoint, fromPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
* Series class for rendering polygons.
*/
export let IgxShapeSeriesBaseComponent = /*@__PURE__*/ (() => {
class IgxShapeSeriesBaseComponent extends IgxSeriesComponent {
constructor() {
super();
this._assigningShapeStyle = null;
this._assigningShapeMarkerStyle = null;
this._styleShape = null;
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
/**
* Gets or sets whether this Shape series should allow custom style overrides of its individual visuals.
*/
get isCustomShapeStyleAllowed() {
return this.i.ys;
}
set isCustomShapeStyleAllowed(v) {
this.i.ys = ensureBool(v);
}
/**
* Gets or sets whether this Shape series should allow custom style overrides of its individual marker visuals.
*/
get isCustomShapeMarkerStyleAllowed() {
return this.i.yr;
}
set isCustomShapeMarkerStyleAllowed(v) {
this.i.yr = ensureBool(v);
}
/**
* Gets or sets the fill mapping property for the current series object.
*/
get fillMemberPath() {
return this.i.ze;
}
set fillMemberPath(v) {
this.i.ze = v;
}
/**
* Gets or sets the brush scale for the fill brush of markers.
*/
get fillScale() {
const r = this.i.xu;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgxBrushScaleComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
set fillScale(v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.xu = null : this.i.xu = v.i;
}
/**
* 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 fillScaleUseGlobalValues() {
return this.i.yn;
}
set fillScaleUseGlobalValues(v) {
this.i.yn = ensureBool(v);
}
get actualItemSearchMode() {
return this.i.x2;
}
set actualItemSearchMode(v) {
this.i.x2 = ensureEnum(ShapeItemSearchMode_$type, v);
}
/**
* Gets or sets the mode the series will use to find the closest point to the cursor.
*/
get itemSearchMode() {
return this.i.x4;
}
set itemSearchMode(v) {
this.i.x4 = ensureEnum(ShapeItemSearchMode_$type, v);
}
/**
* Gets or sets the threshold to use when searching for items using ItemSearchMode.
*/
get itemSearchThreshold() {
return this.i.za;
}
set itemSearchThreshold(v) {
this.i.za = +v;
}
/**
* Gets or sets the points threshold to use when searching for items using ItemSearchMode.
*/
get itemSearchPointsThreshold() {
return this.i.y9;
}
set itemSearchPointsThreshold(v) {
this.i.y9 = +v;
}
/**
* 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 shapeMemberPath() {
return this.i.zr;
}
set shapeMemberPath(v) {
this.i.zr = v;
}
/**
* Gets or sets the value mapping property for the current series object.
*/
get highlightedShapeMemberPath() {
return this.i.zi;
}
set highlightedShapeMemberPath(v) {
this.i.zi = v;
}
/**
* Gets or sets the effective x-axis for the current ScatterBase object.
*/
get xAxis() {
const r = this.i.xy;
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.xy = null : this.i.xy = v.i;
}
/**
* Gets or sets the effective y-axis for the current ScatterBase object.
*/
get yAxis() {
const r = this.i.x0;
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.x0 = null : this.i.x0 = v.i;
}
/**
* 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 shapeFilterResolution() {
return this.i.y6;
}
set shapeFilterResolution(v) {
this.i.y6 = +v;
}
/**
* Gets whether or not this series is a shape series
*/
get isShape() {
return this.i.f0;
}
/**
* Overridden by derived series classes to indicate when marker-less display is preferred or not.
*/
get isMarkerlessDisplayPreferred() {
return this.i.fo;
}
findByName(name) {
var baseResult = super.findByName(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;
}
_styling(container, component, parent) {
super._styling(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;
}
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);
}
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);
}
/**
* 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);
}
/**
* Determine if object can be used as YAxis
* @param axis * The object to check
*/
canUseAsYAxis(axis) {
let iv = this.i.ym(axis);
return (iv);
}
/**
* Determine if object can be used as XAxis
* @param axis * The object to check
*/
canUseAsXAxis(axis) {
let iv = this.i.yl(axis);
return (iv);
}
/**
* Event raised when Assigning Shape Style. Note, if using this event, or highlighting, its best to avoid use of ShapeStyle/StyleShape/ShapeStyleSelector.
*/
get assigningShapeStyle() {
if (this._assigningShapeStyle == null) {
this._assigningShapeStyle = new EventEmitter();
this.i.assigningShapeStyle = delegateCombine(this.i.assigningShapeStyle, (o, e) => {
let outerArgs = new IgxAssigningShapeStyleEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeAssigningShapeStyle) {
this.beforeAssigningShapeStyle(this, outerArgs);
}
this._assigningShapeStyle.emit({
sender: this,
args: outerArgs
});
});
}
return this._assigningShapeStyle;
}
/**
* Event raised when Assigning Shape Marker Style
*/
get assigningShapeMarkerStyle() {
if (this._assigningShapeMarkerStyle == null) {
this._assigningShapeMarkerStyle = new EventEmitter();
this.i.assigningShapeMarkerStyle = delegateCombine(this.i.assigningShapeMarkerStyle, (o, e) => {
let outerArgs = new IgxAssigningShapeMarkerStyleEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeAssigningShapeMarkerStyle) {
this.beforeAssigningShapeMarkerStyle(this, outerArgs);
}
this._assigningShapeMarkerStyle.emit({
sender: this,
args: outerArgs
});
});
}
return this._assigningShapeMarkerStyle;
}
/**
* Raised when tile's image URI should be provided
*/
get styleShape() {
if (this._styleShape == null) {
this._styleShape = new EventEmitter();
this.i.styleShape = delegateCombine(this.i.styleShape, (o, e) => {
let outerArgs = new IgxStyleShapeEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeStyleShape) {
this.beforeStyleShape(this, outerArgs);
}
this._styleShape.emit({
sender: this,
args: outerArgs
});
});
}
return this._styleShape;
}
}
IgxShapeSeriesBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxShapeSeriesBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxShapeSeriesBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxShapeSeriesBaseComponent, selector: "ng-component", inputs: { isCustomShapeStyleAllowed: "isCustomShapeStyleAllowed", isCustomShapeMarkerStyleAllowed: "isCustomShapeMarkerStyleAllowed", fillMemberPath: "fillMemberPath", fillScale: "fillScale", fillScaleUseGlobalValues: "fillScaleUseGlobalValues", actualItemSearchMode: "actualItemSearchMode", itemSearchMode: "itemSearchMode", itemSearchThreshold: "itemSearchThreshold", itemSearchPointsThreshold: "itemSearchPointsThreshold", shapeMemberPath: "shapeMemberPath", highlightedShapeMemberPath: "highlightedShapeMemberPath", xAxis: "xAxis", yAxis: "yAxis", shapeFilterResolution: "shapeFilterResolution" }, outputs: { assigningShapeStyle: "assigningShapeStyle", assigningShapeMarkerStyle: "assigningShapeMarkerStyle", styleShape: "styleShape" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
return IgxShapeSeriesBaseComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxShapeSeriesBaseComponent, decorators: [{
type: Component,
args: [{
template: ``,
}]
}], ctorParameters: function () { return []; }, propDecorators: { isCustomShapeStyleAllowed: [{
type: Input
}], isCustomShapeMarkerStyleAllowed: [{
type: Input
}], fillMemberPath: [{
type: Input
}], fillScale: [{
type: Input
}], fillScaleUseGlobalValues: [{
type: Input
}], actualItemSearchMode: [{
type: Input
}], itemSearchMode: [{
type: Input
}], itemSearchThreshold: [{
type: Input
}], itemSearchPointsThreshold: [{
type: Input
}], shapeMemberPath: [{
type: Input
}], highlightedShapeMemberPath: [{
type: Input
}], xAxis: [{
type: Input
}], yAxis: [{
type: Input
}], shapeFilterResolution: [{
type: Input
}], assigningShapeStyle: [{
type: Output
}], assigningShapeMarkerStyle: [{
type: Output
}], styleShape: [{
type: Output
}] } });