igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
501 lines (492 loc) • 19.1 kB
JavaScript
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxNumericAngleAxisComponent } from "./igx-numeric-angle-axis-component";
import { IgxNumericRadiusAxisComponent } from "./igx-numeric-radius-axis-component";
import { TrendLineType_$type } from "igniteui-angular-core";
import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { IgxAssigningPolarStyleEventArgs } from "./igx-assigning-polar-style-event-args";
import { IgxAssigningPolarMarkerStyleEventArgs } from "./igx-assigning-polar-marker-style-event-args";
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 from which all IgxDataChartComponent polar series are derived.
*/
export let IgxPolarBaseComponent = /*@__PURE__*/ (() => {
class IgxPolarBaseComponent extends IgxMarkerSeriesComponent {
constructor() {
super();
this._assigningPolarStyle = null;
this._assigningPolarMarkerStyle = null;
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
/**
* 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.aa3;
}
set angleMemberPath(v) {
this.i.aa3 = v;
}
/**
* Gets or sets the path to use to get the radius values for the series.
*/
get radiusMemberPath() {
return this.i.abl;
}
set radiusMemberPath(v) {
this.i.abl = v;
}
/**
* Gets or sets the highlighted radius value mapping property for the current series object.
*/
get highlightedRadiusMemberPath() {
return this.i.aa8;
}
set highlightedRadiusMemberPath(v) {
this.i.aa8 = v;
}
/**
* Gets or sets the highlighted angle value mapping property for the current series object.
*/
get highlightedAngleMemberPath() {
return this.i.aa6;
}
set highlightedAngleMemberPath(v) {
this.i.aa6 = v;
}
/**
* Gets the effective angle axis for the current series object.
*/
get angleAxis() {
const r = this.i.zd;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgxNumericAngleAxisComponent._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.zd = null : this.i.zd = v.i;
}
/**
* Gets the effective radius axis for the current series object.
*/
get radiusAxis() {
const r = this.i.ze;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgxNumericRadiusAxisComponent._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.ze = null : this.i.ze = v.i;
}
/**
* Gets or sets whether Cartesian Interpolation should be used rather than Archimedian
* spiral based interpolation.
*/
get useCartesianInterpolation() {
return this.i.aaj;
}
set useCartesianInterpolation(v) {
this.i.aaj = ensureBool(v);
}
/**
* 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.aat;
}
set maximumMarkers(v) {
this.i.aat = +v;
}
/**
* Gets or sets the trend type for the current series object.
*/
get trendLineType() {
return this.i.zv;
}
set trendLineType(v) {
this.i.zv = ensureEnum(TrendLineType_$type, v);
}
/**
* Gets or sets the brush that specifies how the current series
* object's trend line is drawn.
*/
get trendLineBrush() {
return brushToString(this.i.acs);
}
set trendLineBrush(v) {
this.i.acs = stringToBrush(v);
}
/**
* Gets the effective TrendLineBrush for this series.
*/
get actualTrendLineBrush() {
return brushToString(this.i.acr);
}
set actualTrendLineBrush(v) {
this.i.acr = stringToBrush(v);
}
/**
* Gets or sets the thickness of the current series object's trend line.
*/
get trendLineThickness() {
return this.i.aar;
}
set trendLineThickness(v) {
this.i.aar = +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 series object.
*/
get trendLineDashArray() {
return fromDoubleCollection(this.i.act);
}
set trendLineDashArray(v) {
this.i.act = toDoubleCollection(v);
}
/**
* Gets or sets the moving average period for the current series object.
*/
get trendLinePeriod() {
return this.i.aau;
}
set trendLinePeriod(v) {
this.i.aau = +v;
}
/**
* Sets or Gets the Trendline Z index.
*/
get trendLineZIndex() {
return this.i.aav;
}
set trendLineZIndex(v) {
this.i.aav = +v;
}
/**
* Gets or sets whether to clip the series to the bounds.
* Setting this to true can effect performance.
*/
get clipSeriesToBounds() {
return this.i.z9;
}
set clipSeriesToBounds(v) {
this.i.z9 = ensureBool(v);
}
get actualItemSearchMode() {
return this.i.zr;
}
set actualItemSearchMode(v) {
this.i.zr = ensureEnum(ScatterItemSearchMode_$type, v);
}
/**
* Gets or sets the mode the series will use to find the closest point to the cursor.
*/
get itemSearchMode() {
return this.i.zt;
}
set itemSearchMode(v) {
this.i.zt = 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;
}
/**
* Gets or sets whether this Polar series should allow custom style overrides of its individual visuals.
*/
get isCustomPolarStyleAllowed() {
return this.i.aac;
}
set isCustomPolarStyleAllowed(v) {
this.i.aac = ensureBool(v);
}
/**
* Gets or sets whether this Polar series should allow custom style overrides of its individual marker visuals.
*/
get isCustomPolarMarkerStyleAllowed() {
return this.i.aab;
}
set isCustomPolarMarkerStyleAllowed(v) {
this.i.aab = ensureBool(v);
}
/**
* Gets or sets the label displayed before series' radius value in the Data Legend.
*/
get radiusMemberAsLegendLabel() {
return this.i.abh;
}
set radiusMemberAsLegendLabel(v) {
this.i.abh = v;
}
/**
* Gets or sets the label displayed before series' angle value in the Data Legend.
*/
get angleMemberAsLegendLabel() {
return this.i.aaz;
}
set angleMemberAsLegendLabel(v) {
this.i.aaz = v;
}
/**
* Gets or sets the unit displayed after series' radius value in the Data Legend.
*/
get radiusMemberAsLegendUnit() {
return this.i.abj;
}
set radiusMemberAsLegendUnit(v) {
this.i.abj = v;
}
/**
* Gets or sets the unit displayed after series' angle value in the Data Legend.
*/
get angleMemberAsLegendUnit() {
return this.i.aa1;
}
set angleMemberAsLegendUnit(v) {
this.i.aa1 = v;
}
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.w9(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.w0(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.wv(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.z8(axis);
return (iv);
}
/**
* Determine if object can be used as AngleAxis
* @param axis * The object to check
*/
canUseAsAngleAxis(axis) {
let iv = this.i.z7(axis);
return (iv);
}
/**
* Event raised when Assigning Category Style
*/
get assigningPolarStyle() {
if (this._assigningPolarStyle == null) {
this._assigningPolarStyle = new EventEmitter();
this.i.assigningPolarStyle = delegateCombine(this.i.assigningPolarStyle, (o, e) => {
let outerArgs = new IgxAssigningPolarStyleEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeAssigningPolarStyle) {
this.beforeAssigningPolarStyle(this, outerArgs);
}
this._assigningPolarStyle.emit({
sender: this,
args: outerArgs
});
});
}
return this._assigningPolarStyle;
}
/**
* Event raised when Assigning Polar Marker Style
*/
get assigningPolarMarkerStyle() {
if (this._assigningPolarMarkerStyle == null) {
this._assigningPolarMarkerStyle = new EventEmitter();
this.i.assigningPolarMarkerStyle = delegateCombine(this.i.assigningPolarMarkerStyle, (o, e) => {
let outerArgs = new IgxAssigningPolarMarkerStyleEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeAssigningPolarMarkerStyle) {
this.beforeAssigningPolarMarkerStyle(this, outerArgs);
}
this._assigningPolarMarkerStyle.emit({
sender: this,
args: outerArgs
});
});
}
return this._assigningPolarMarkerStyle;
}
}
IgxPolarBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxPolarBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxPolarBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxPolarBaseComponent, selector: "ng-component", inputs: { angleMemberPath: "angleMemberPath", radiusMemberPath: "radiusMemberPath", highlightedRadiusMemberPath: "highlightedRadiusMemberPath", highlightedAngleMemberPath: "highlightedAngleMemberPath", angleAxis: "angleAxis", radiusAxis: "radiusAxis", useCartesianInterpolation: "useCartesianInterpolation", maximumMarkers: "maximumMarkers", trendLineType: "trendLineType", trendLineBrush: "trendLineBrush", actualTrendLineBrush: "actualTrendLineBrush", trendLineThickness: "trendLineThickness", trendLineDashArray: "trendLineDashArray", trendLinePeriod: "trendLinePeriod", trendLineZIndex: "trendLineZIndex", clipSeriesToBounds: "clipSeriesToBounds", actualItemSearchMode: "actualItemSearchMode", itemSearchMode: "itemSearchMode", itemSearchThreshold: "itemSearchThreshold", isCustomPolarStyleAllowed: "isCustomPolarStyleAllowed", isCustomPolarMarkerStyleAllowed: "isCustomPolarMarkerStyleAllowed", radiusMemberAsLegendLabel: "radiusMemberAsLegendLabel", angleMemberAsLegendLabel: "angleMemberAsLegendLabel", radiusMemberAsLegendUnit: "radiusMemberAsLegendUnit", angleMemberAsLegendUnit: "angleMemberAsLegendUnit" }, outputs: { assigningPolarStyle: "assigningPolarStyle", assigningPolarMarkerStyle: "assigningPolarMarkerStyle" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
return IgxPolarBaseComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxPolarBaseComponent, decorators: [{
type: Component,
args: [{
template: ``,
}]
}], ctorParameters: function () { return []; }, propDecorators: { angleMemberPath: [{
type: Input
}], radiusMemberPath: [{
type: Input
}], highlightedRadiusMemberPath: [{
type: Input
}], highlightedAngleMemberPath: [{
type: Input
}], angleAxis: [{
type: Input
}], radiusAxis: [{
type: Input
}], useCartesianInterpolation: [{
type: Input
}], maximumMarkers: [{
type: Input
}], trendLineType: [{
type: Input
}], trendLineBrush: [{
type: Input
}], actualTrendLineBrush: [{
type: Input
}], trendLineThickness: [{
type: Input
}], trendLineDashArray: [{
type: Input
}], trendLinePeriod: [{
type: Input
}], trendLineZIndex: [{
type: Input
}], clipSeriesToBounds: [{
type: Input
}], actualItemSearchMode: [{
type: Input
}], itemSearchMode: [{
type: Input
}], itemSearchThreshold: [{
type: Input
}], isCustomPolarStyleAllowed: [{
type: Input
}], isCustomPolarMarkerStyleAllowed: [{
type: Input
}], radiusMemberAsLegendLabel: [{
type: Input
}], angleMemberAsLegendLabel: [{
type: Input
}], radiusMemberAsLegendUnit: [{
type: Input
}], angleMemberAsLegendUnit: [{
type: Input
}], assigningPolarStyle: [{
type: Output
}], assigningPolarMarkerStyle: [{
type: Output
}] } });