igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
329 lines (323 loc) • 12.8 kB
JavaScript
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { CategoryCollisionMode_$type } from "./CategoryCollisionMode";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { IgxAssigningCategoryStyleEventArgs } from "./igx-assigning-category-style-event-args";
import { IgxAssigningCategoryMarkerStyleEventArgs } from "./igx-assigning-category-marker-style-event-args";
import { IgxMarkerSeriesComponent } from "./igx-marker-series-component";
import { ensureBool, ensureEnum, toPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
* Represents the base class for IgxDataChartComponent category series.
*
* `CategorySeries` class represents the base class for IgxDataChartComponent category series.
*
* ```html
* <igx-data-chart [dataSource]="data" >
* <igx-category-x-axis
* label="label"
* #xAxis>
* </igx-category-x-axis>
* <igx-numeric-y-axis #yAxis>
* </igx-numeric-y-axis>
* <igx-column-series
* [xAxis]="xAxis"
* [yAxis]="yAxis"
* valueMemberPath="value"
* isTransitionInEnabled="true">
* </igx-column-series>
* </igx-data-chart>
* ```
*
* ```ts
* let series = new IgxColumnSeriesComponent();
* series.xAxis = this.xAxis;
* series.yAxis = this.yAxis;
* series.valueMemberPath="value";
* this.chart.series.add(series);
* ```
*/
export let IgxCategorySeriesComponent = /*@__PURE__*/ (() => {
class IgxCategorySeriesComponent extends IgxMarkerSeriesComponent {
constructor() {
super();
this._assigningCategoryStyle = null;
this._assigningCategoryMarkerStyle = null;
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
get hasValueAxis() {
return this.i.em;
}
get isValueAxisInverted() {
return this.i.gb;
}
/**
* Gets whether or not this series is Category series
*/
get isCategory() {
return this.i.e1;
}
/**
* Gets or sets whether this category series should allow custom style overrides of its individual visuals.
*/
get isCustomCategoryStyleAllowed() {
return this.i.z4;
}
set isCustomCategoryStyleAllowed(v) {
this.i.z4 = ensureBool(v);
}
/**
* Gets or sets whether this category series should allow custom style overrides of its individual marker visuals.
*/
get isCustomCategoryMarkerStyleAllowed() {
return this.i.z3;
}
set isCustomCategoryMarkerStyleAllowed(v) {
this.i.z3 = ensureBool(v);
}
/**
* Gets or sets the category collision mode selection behavior to use for the series.
*/
get categoryCollisionMode() {
return this.i.zd;
}
set categoryCollisionMode(v) {
this.i.zd = ensureEnum(CategoryCollisionMode_$type, v);
}
/**
* Sets or Gets whether to increase marker fidelity for extreme data shapes that have lots of Y variation over short X intervals.
*
* Set `UseHighMarkerFidelity` when your data has high variation along the y-axis within a short span of this x-axis.
*
* ```html
* <igx-data-chart [dataSource]="data">
* <igx-category-x-axis
* label="label"
* #xAxis>
* </igx-category-x-axis>
* <igx-numeric-y-axis #yAxis>
* </igx-numeric-y-axis>
* <igx-column-series
* [xAxis]="xAxis"
* [yAxis]="yAxis"
* valueMemberPath="value"
* markerType="circle"
* useHighMarkerFidelity="true">
* </igx-column-series>
* </igx-data-chart>
* ```
*
* ```ts
* let series = new IgxColumnSeriesComponent();
* series.xAxis = this.xAxis;
* series.yAxis = this.yAxis;
* series.valueMemberPath= "value";
* series.useHighMarkerFidelity= "true";
* this.chart.series.add(series);
* ```
*
* ```ts
* this.columnSeries2.useHighMarkerFidelity= "true";
* ```
*/
get useHighMarkerFidelity() {
return this.i.aaa;
}
set useHighMarkerFidelity(v) {
this.i.aaa = ensureBool(v);
}
/**
* Gets or sets the method by which to animate the data into the chart when the chart data source is swapped.
* Note: Transitions are not currently supported for stacked series.
*
* `TransitionInMode` controls the direction of the transition-in animation.
*
* ```html
* <igx-data-chart
* [dataSource]="data" >
* <igx-category-x-axis
* label="label"
* #xAxis>
* </igx-category-x-axis>
* <igx-numeric-y-axis #yAxis>
* </igx-numeric-y-axis>
*
* <igx-column-series
* [xAxis]="xAxis"
* [yAxis]="yAxis"
* valueMemberPath="value"
* isTransitionInEnabled="true"
* transitionInMode="accordionfromRight">
* </igx-column-series>
* </igx-data-chart>
* ```
*
* ```ts
* let series = new IgxColumnSeriesComponent();
* series.xAxis = this.xAxis;
* series.yAxis = this.yAxis;
* series.valueMemberPath="value";
* series.transitionInMode="accordionfromRight";
* this.chart.series.add(series);
* ```
*
* ```ts
*
* this.columnSeries2.transitionInMode= "accordionfromRight";
* ```
*/
get transitionInMode() {
return this.i.zp;
}
set transitionInMode(v) {
this.i.zp = ensureEnum(CategoryTransitionInMode_$type, v);
}
/**
* Gets or sets whether the series should transition into the plot area when a new data source is assigned.
* Note: Transitions are not currently supported for stacked series.
*
* Set `IsTransitionInEnabled` to true if you want your chart series to animate into position when the chart is loading into view.
*
* ```html
* <igx-data-chart [dataSource]="data" >
* <igx-category-x-axis
* label="label"
* #xAxis>
* </igx-category-x-axis>
* <igx-numeric-y-axis #yAxis>
* </igx-numeric-y-axis>
*
* <igx-column-series
* [xAxis]="xAxis"
* [yAxis]="yAxis"
* valueMemberPath="value"
* isTransitionInEnabled="true">
* </igx-column-series>
* </igx-data-chart>
* ```
*
* ```ts
* let series = new IgxColumnSeriesComponent();
* series.xAxis = this.xAxis;
* series.yAxis = this.yAxis;
* series.valueMemberPath="value";
* series.isTransitionInEnabled="true";
* this.chart.series.add(series);
* ```
*/
get isTransitionInEnabled() {
return this.i.z5;
}
set isTransitionInEnabled(v) {
this.i.z5 = ensureBool(v);
}
/**
* Returns the offset value for this series if grouped on a category axis.
*/
getOffsetValue() {
let iv = this.i.getOffsetValue();
return (iv);
}
/**
* Returns the width of the category grouping this series is in.
*/
getCategoryWidth() {
let iv = this.i.getCategoryWidth();
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 based on world coordinates.
* @param world * The world coordinates to use.
*/
getItemIndex(world) {
let iv = this.i.kc(toPoint(world));
return (iv);
}
/**
* Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex.
* @param world * The world position for which to return the index.
*/
getExactItemIndex(world) {
let iv = this.i.iy(toPoint(world));
return (iv);
}
/**
* Event raised when Assigning Category Style
*/
get assigningCategoryStyle() {
if (this._assigningCategoryStyle == null) {
this._assigningCategoryStyle = new EventEmitter();
this.i.assigningCategoryStyle = delegateCombine(this.i.assigningCategoryStyle, (o, e) => {
let outerArgs = new IgxAssigningCategoryStyleEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeAssigningCategoryStyle) {
this.beforeAssigningCategoryStyle(this, outerArgs);
}
this._assigningCategoryStyle.emit({
sender: this,
args: outerArgs
});
});
}
return this._assigningCategoryStyle;
}
/**
* Event raised when Assigning Category Marker Style
*/
get assigningCategoryMarkerStyle() {
if (this._assigningCategoryMarkerStyle == null) {
this._assigningCategoryMarkerStyle = new EventEmitter();
this.i.assigningCategoryMarkerStyle = delegateCombine(this.i.assigningCategoryMarkerStyle, (o, e) => {
let outerArgs = new IgxAssigningCategoryMarkerStyleEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeAssigningCategoryMarkerStyle) {
this.beforeAssigningCategoryMarkerStyle(this, outerArgs);
}
this._assigningCategoryMarkerStyle.emit({
sender: this,
args: outerArgs
});
});
}
return this._assigningCategoryMarkerStyle;
}
}
IgxCategorySeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategorySeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxCategorySeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxCategorySeriesComponent, selector: "ng-component", inputs: { isCustomCategoryStyleAllowed: "isCustomCategoryStyleAllowed", isCustomCategoryMarkerStyleAllowed: "isCustomCategoryMarkerStyleAllowed", categoryCollisionMode: "categoryCollisionMode", useHighMarkerFidelity: "useHighMarkerFidelity", transitionInMode: "transitionInMode", isTransitionInEnabled: "isTransitionInEnabled" }, outputs: { assigningCategoryStyle: "assigningCategoryStyle", assigningCategoryMarkerStyle: "assigningCategoryMarkerStyle" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
return IgxCategorySeriesComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategorySeriesComponent, decorators: [{
type: Component,
args: [{
template: ``,
}]
}], ctorParameters: function () { return []; }, propDecorators: { isCustomCategoryStyleAllowed: [{
type: Input
}], isCustomCategoryMarkerStyleAllowed: [{
type: Input
}], categoryCollisionMode: [{
type: Input
}], useHighMarkerFidelity: [{
type: Input
}], transitionInMode: [{
type: Input
}], isTransitionInEnabled: [{
type: Input
}], assigningCategoryStyle: [{
type: Output
}], assigningCategoryMarkerStyle: [{
type: Output
}] } });