igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
183 lines (182 loc) • 6.77 kB
JavaScript
import { IgcSeriesComponent } from "./igc-series-component";
import { TrendLineType_$type } from "igniteui-webcomponents-core";
import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component";
import { TrendLineLayer } from "./TrendLineLayer";
import { getAllPropertyNames, toSpinal, ensureEnum, enumToString } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis.
*/
export let IgcTrendLineLayerComponent = /*@__PURE__*/ (() => {
class IgcTrendLineLayerComponent extends IgcAnnotationLayerComponent {
createImplementation() {
return new TrendLineLayer();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor() {
super();
}
connectedCallback() {
if (super["connectedCallback"]) {
super["connectedCallback"]();
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
}
disconnectedCallback() {
if (super["disconnectedCallback"]) {
super["disconnectedCallback"]();
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
}
static get observedAttributes() {
if (IgcTrendLineLayerComponent._observedAttributesIgcTrendLineLayerComponent == null) {
let names = getAllPropertyNames(IgcTrendLineLayerComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcTrendLineLayerComponent._observedAttributesIgcTrendLineLayerComponent = names;
}
return IgcTrendLineLayerComponent._observedAttributesIgcTrendLineLayerComponent;
}
static register() {
if (!IgcTrendLineLayerComponent._isElementRegistered) {
IgcTrendLineLayerComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcTrendLineLayerComponent.htmlTagName, IgcTrendLineLayerComponent);
}
}
get isAnnotationLayer() {
return this.i.eu;
}
get isLineOnly() {
return this.i.fl;
}
/**
* Gets or sets the name of the series to target this annotation to.
*/
get targetSeriesName() {
return this.i.aah;
}
set targetSeriesName(v) {
this.i.aah = v;
}
/**
* Gets or sets the series to target this annotation to.
*/
get targetSeries() {
const r = this.i.aab;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgcSeriesComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
set targetSeries(v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aab = null : this.i.aab = v.i;
}
/**
* Gets the actual series being targeted by this annotation.
*/
get actualTargetSeries() {
const r = this.i.aaa;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgcSeriesComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
set actualTargetSeries(v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aaa = null : this.i.aaa = v.i;
}
/**
* Gets or sets the trend type for the current series object.
*/
get trendLineType() {
return this.i.aad;
}
set trendLineType(v) {
this.i.aad = ensureEnum(TrendLineType_$type, v);
this._a("trendLineType", enumToString(TrendLineType_$type, this.i.aad));
}
/**
* Gets or sets the trend line period for the target series.
* The typical, and initial, value for trend line period is 7.
*/
get trendLinePeriod() {
return this.i.aae;
}
set trendLinePeriod(v) {
this.i.aae = +v;
this._a("trendLinePeriod", this.i.aae);
}
get isUsableInLegend() {
return this.i.isUsableInLegend;
}
findByName(name) {
var baseResult = super.findByName(name);
if (baseResult) {
return baseResult;
}
if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
return this.targetSeries;
}
if (this.actualTargetSeries && this.actualTargetSeries.name && this.actualTargetSeries.name == name) {
return this.actualTargetSeries;
}
return null;
}
_styling(container, component, parent) {
super._styling(container, component, parent);
this._inStyling = true;
if (this.targetSeries && this.targetSeries._styling) {
this.targetSeries._styling(container, component, this);
}
if (this.actualTargetSeries && this.actualTargetSeries._styling) {
this.actualTargetSeries._styling(container, component, this);
}
this._inStyling = false;
}
onApplyTemplate() {
this.i.ac();
}
getManagerIdentifier() {
let iv = this.i.aag();
return (iv);
}
}
IgcTrendLineLayerComponent._observedAttributesIgcTrendLineLayerComponent = null;
IgcTrendLineLayerComponent.htmlTagName = "igc-trend-line-layer";
IgcTrendLineLayerComponent._isElementRegistered = false;
return IgcTrendLineLayerComponent;
})();