igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
299 lines (298 loc) • 11.8 kB
JavaScript
import { __extends } from "tslib";
import { IgcSeriesComponent } from "./igc-series-component";
import { FinalValueSelectionMode_$type } from "./FinalValueSelectionMode";
import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component";
import { FinalValueLayer } from "./FinalValueLayer";
import { getAllPropertyNames, toSpinal, ensureEnum, enumToString, brushToString, stringToBrush } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
var IgcFinalValueLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcFinalValueLayerComponent, _super);
function IgcFinalValueLayerComponent() {
return _super.call(this) || this;
}
IgcFinalValueLayerComponent.prototype.createImplementation = function () {
return new FinalValueLayer();
};
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcFinalValueLayerComponent.prototype.connectedCallback = function () {
if (_super.prototype["connectedCallback"]) {
_super.prototype["connectedCallback"].call(this);
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
};
IgcFinalValueLayerComponent.prototype.disconnectedCallback = function () {
if (_super.prototype["disconnectedCallback"]) {
_super.prototype["disconnectedCallback"].call(this);
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
};
Object.defineProperty(IgcFinalValueLayerComponent, "observedAttributes", {
get: function () {
if (IgcFinalValueLayerComponent._observedAttributesIgcFinalValueLayerComponent == null) {
var names = getAllPropertyNames(IgcFinalValueLayerComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcFinalValueLayerComponent._observedAttributesIgcFinalValueLayerComponent = names;
}
return IgcFinalValueLayerComponent._observedAttributesIgcFinalValueLayerComponent;
},
enumerable: false,
configurable: true
});
IgcFinalValueLayerComponent.register = function () {
if (!IgcFinalValueLayerComponent._isElementRegistered) {
IgcFinalValueLayerComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcFinalValueLayerComponent.htmlTagName, IgcFinalValueLayerComponent);
}
};
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "isAnnotationFinalValue", {
/**
* Gets whether the series is final value annotation layer.
*/
get: function () {
return this.i.es;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "targetSeriesName", {
/**
* Gets or sets the name of the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get: function () {
return this.i.aaz;
},
set: function (v) {
this.i.aaz = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "targetSeries", {
/**
* Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get: function () {
var r = this.i.aad;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgcSeriesComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aad = null : this.i.aad = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "finalValueSelectionMode", {
/**
* Gets or sets how to select the final value to annotate.
*/
get: function () {
return this.i.aac;
},
set: function (v) {
this.i.aac = ensureEnum(FinalValueSelectionMode_$type, v);
this._a("finalValueSelectionMode", enumToString(FinalValueSelectionMode_$type, this.i.aac));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationTextColor", {
/**
* Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value.
*/
get: function () {
return brushToString(this.i.abj);
},
set: function (v) {
this.i.abj = stringToBrush(v);
this._a("axisAnnotationTextColor", brushToString(this.i.abj));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationBackground", {
/**
* Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value.
*/
get: function () {
return brushToString(this.i.abh);
},
set: function (v) {
this.i.abh = stringToBrush(v);
this._a("axisAnnotationBackground", brushToString(this.i.abh));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationBackgroundCornerRadius", {
/**
* Gets or sets the corner radius to use for the axis annotation backing. Leave unset for an automatic value.
*/
get: function () {
return this.i.aah;
},
set: function (v) {
this.i.aah = +v;
this._a("axisAnnotationBackgroundCornerRadius", this.i.aah);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationInterpolatedValuePrecision", {
/**
* Gets or sets the precision to use displaying values for interpolated crosshair positions.
*/
get: function () {
return this.i.aan;
},
set: function (v) {
this.i.aan = +v;
this._a("axisAnnotationInterpolatedValuePrecision", this.i.aan);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationOutline", {
/**
* Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value.
*/
get: function () {
return brushToString(this.i.abi);
},
set: function (v) {
this.i.abi = stringToBrush(v);
this._a("axisAnnotationOutline", brushToString(this.i.abi));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationPaddingLeft", {
/**
* Gets or sets the left padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
*/
get: function () {
return this.i.aaj;
},
set: function (v) {
this.i.aaj = +v;
this._a("axisAnnotationPaddingLeft", this.i.aaj);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationPaddingTop", {
/**
* Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
*/
get: function () {
return this.i.aal;
},
set: function (v) {
this.i.aal = +v;
this._a("axisAnnotationPaddingTop", this.i.aal);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationPaddingRight", {
/**
* Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
*/
get: function () {
return this.i.aak;
},
set: function (v) {
this.i.aak = +v;
this._a("axisAnnotationPaddingRight", this.i.aak);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationPaddingBottom", {
/**
* Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
*/
get: function () {
return this.i.aai;
},
set: function (v) {
this.i.aai = +v;
this._a("axisAnnotationPaddingBottom", this.i.aai);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFinalValueLayerComponent.prototype, "axisAnnotationStrokeThickness", {
/**
* Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
*/
get: function () {
return this.i.aam;
},
set: function (v) {
this.i.aam = +v;
this._a("axisAnnotationStrokeThickness", this.i.aam);
},
enumerable: false,
configurable: true
});
IgcFinalValueLayerComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
return this.targetSeries;
}
return null;
};
IgcFinalValueLayerComponent.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, container, component, parent);
this._inStyling = true;
if (this.targetSeries && this.targetSeries._styling) {
this.targetSeries._styling(container, component, this);
}
this._inStyling = false;
};
IgcFinalValueLayerComponent._observedAttributesIgcFinalValueLayerComponent = null;
IgcFinalValueLayerComponent.htmlTagName = "igc-final-value-layer";
IgcFinalValueLayerComponent._isElementRegistered = false;
return IgcFinalValueLayerComponent;
}(IgcAnnotationLayerComponent));
export { IgcFinalValueLayerComponent };