igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
298 lines (297 loc) • 11.7 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.
*/
export 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.et;
},
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.abh;
},
set: function (v) {
this.i.abh = 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.aav;
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.aav = null : this.i.aav = 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.aau;
},
set: function (v) {
this.i.aau = ensureEnum(FinalValueSelectionMode_$type, v);
this._a("finalValueSelectionMode", enumToString(FinalValueSelectionMode_$type, this.i.aau));
},
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.ab1);
},
set: function (v) {
this.i.ab1 = stringToBrush(v);
this._a("axisAnnotationTextColor", brushToString(this.i.ab1));
},
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.abz);
},
set: function (v) {
this.i.abz = stringToBrush(v);
this._a("axisAnnotationBackground", brushToString(this.i.abz));
},
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.aaz;
},
set: function (v) {
this.i.aaz = +v;
this._a("axisAnnotationBackgroundCornerRadius", this.i.aaz);
},
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.aa5;
},
set: function (v) {
this.i.aa5 = +v;
this._a("axisAnnotationInterpolatedValuePrecision", this.i.aa5);
},
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.ab0);
},
set: function (v) {
this.i.ab0 = stringToBrush(v);
this._a("axisAnnotationOutline", brushToString(this.i.ab0));
},
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.aa1;
},
set: function (v) {
this.i.aa1 = +v;
this._a("axisAnnotationPaddingLeft", this.i.aa1);
},
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.aa3;
},
set: function (v) {
this.i.aa3 = +v;
this._a("axisAnnotationPaddingTop", this.i.aa3);
},
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.aa2;
},
set: function (v) {
this.i.aa2 = +v;
this._a("axisAnnotationPaddingRight", this.i.aa2);
},
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.aa0;
},
set: function (v) {
this.i.aa0 = +v;
this._a("axisAnnotationPaddingBottom", this.i.aa0);
},
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.aa4;
},
set: function (v) {
this.i.aa4 = +v;
this._a("axisAnnotationStrokeThickness", this.i.aa4);
},
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));