igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
580 lines (579 loc) • 21.4 kB
JavaScript
import { __extends } from "tslib";
import { DataAnnotationDisplayMode_$type } from "./DataAnnotationDisplayMode";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { IgcAxisComponent } from "./igc-axis-component";
import { DataAnnotationTargetMode_$type } from "./DataAnnotationTargetMode";
import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component";
import { getAllPropertyNames, toSpinal, ensureBool, ensureEnum, enumToString, brushToString, stringToBrush } from "igniteui-webcomponents-core";
import { Thickness } from "igniteui-webcomponents-core";
/**
* Represents a base annotation layer that displays annotations over an axis.
*/
export var IgcDataAnnotationAxisLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcDataAnnotationAxisLayerComponent, _super);
function IgcDataAnnotationAxisLayerComponent() {
var _this = _super.call(this) || this;
_this._targetAxisName = null;
return _this;
}
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcDataAnnotationAxisLayerComponent.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();
}
};
IgcDataAnnotationAxisLayerComponent.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(IgcDataAnnotationAxisLayerComponent, "observedAttributes", {
get: function () {
if (IgcDataAnnotationAxisLayerComponent._observedAttributesIgcDataAnnotationAxisLayerComponent == null) {
var names = getAllPropertyNames(IgcDataAnnotationAxisLayerComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcDataAnnotationAxisLayerComponent._observedAttributesIgcDataAnnotationAxisLayerComponent = names;
}
return IgcDataAnnotationAxisLayerComponent._observedAttributesIgcDataAnnotationAxisLayerComponent;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "isAnnotationDataLayer", {
/**
* Gets whether the series is a data annotation layer that support binding to data source
*/
get: function () {
return this.i.es;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationLabelDisplayMode", {
/**
* Gets or sets display mode of label on axis annotation.
*/
get: function () {
return this.i.aaw;
},
set: function (v) {
this.i.aaw = ensureEnum(DataAnnotationDisplayMode_$type, v);
this._a("annotationLabelDisplayMode", enumToString(DataAnnotationDisplayMode_$type, this.i.aaw));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationLabelVisible", {
/**
* Gets or sets whether to show all annotations over target axis
*/
get: function () {
return this.i.aa2;
},
set: function (v) {
this.i.aa2 = ensureBool(v);
this._a("annotationLabelVisible", this.i.aa2);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationTextColor", {
/**
* Gets or sets the text color used in the axis annotation.
*/
get: function () {
return brushToString(this.i.ac8);
},
set: function (v) {
this.i.ac8 = stringToBrush(v);
this._a("annotationTextColor", brushToString(this.i.ac8));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationTextColorMode", {
/**
* Gets or sets the mode used for shifting the text color in axis annotation.
*/
get: function () {
return this.i.aau;
},
set: function (v) {
this.i.aau = ensureEnum(AnnotationAppearanceMode_$type, v);
this._a("annotationTextColorMode", enumToString(AnnotationAppearanceMode_$type, this.i.aau));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationTextColorShift", {
/**
* Gets or sets the percentage used to shift AnnotationTextColor. Value must range between -1.0 to 1.0, where 0 means no color shift.
*/
get: function () {
return this.i.abd;
},
set: function (v) {
this.i.abd = +v;
this._a("annotationTextColorShift", this.i.abd);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationTextColorMatchLayer", {
/**
* Gets or sets whether the annotation text color matches brush of the layer
*/
get: function () {
return this.i.aa3;
},
set: function (v) {
this.i.aa3 = ensureBool(v);
this._a("annotationTextColorMatchLayer", this.i.aa3);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBackground", {
/**
* Gets or sets the color used for backing of the axis annotation.
*/
get: function () {
return brushToString(this.i.ac4);
},
set: function (v) {
this.i.ac4 = stringToBrush(v);
this._a("annotationBackground", brushToString(this.i.ac4));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBorderRadius", {
/**
* Gets or sets the border radius used for displaying the axis annotation.
*/
get: function () {
return this.i.aba;
},
set: function (v) {
this.i.aba = +v;
this._a("annotationBorderRadius", this.i.aba);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBackgroundMode", {
/**
* Gets or sets the mode used for shifting the background of axis annotation.
*/
get: function () {
return this.i.aas;
},
set: function (v) {
this.i.aas = ensureEnum(AnnotationAppearanceMode_$type, v);
this._a("annotationBackgroundMode", enumToString(AnnotationAppearanceMode_$type, this.i.aas));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBackgroundShift", {
/**
* Gets or sets the percentage used to shift AnnotationBackground. Value must range between -1.0 to 1.0, where 0 means no color shift.
*/
get: function () {
return this.i.aa5;
},
set: function (v) {
this.i.aa5 = +v;
this._a("annotationBackgroundShift", this.i.aa5);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBackgroundMatchLayer", {
/**
* Gets or sets whether the annotation background matches brush of the layer
*/
get: function () {
return this.i.aaz;
},
set: function (v) {
this.i.aaz = ensureBool(v);
this._a("annotationBackgroundMatchLayer", this.i.aaz);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBorderMatchLayer", {
/**
* Gets or sets whether the annotation border matches outline of the layer (if it has a fill visual) otherwise brush of the layer
*/
get: function () {
return this.i.aa1;
},
set: function (v) {
this.i.aa1 = ensureBool(v);
this._a("annotationBorderMatchLayer", this.i.aa1);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBorderColor", {
/**
* Gets or sets the color used for border color of the axis annotation.
*/
get: function () {
return brushToString(this.i.ac7);
},
set: function (v) {
this.i.ac7 = stringToBrush(v);
this._a("annotationBorderColor", brushToString(this.i.ac7));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBorderMode", {
/**
* Gets or sets the mode used for shifting border color of the axis annotation.
*/
get: function () {
return this.i.aat;
},
set: function (v) {
this.i.aat = ensureEnum(AnnotationAppearanceMode_$type, v);
this._a("annotationBorderMode", enumToString(AnnotationAppearanceMode_$type, this.i.aat));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBorderShift", {
/**
* Gets or sets the percentage amount used to shift AnnotationBorderColor. Value must range between -1.0 to 1.0, where 0 means no color shift.
*/
get: function () {
return this.i.abb;
},
set: function (v) {
this.i.abb = +v;
this._a("annotationBorderShift", this.i.abb);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationPaddingBottom", {
get: function () {
return this.i.ac9 ? this.i.ac9.bottom : NaN;
},
set: function (v) {
this.ensureAnnotationPadding();
this.i.ac9.bottom = +v;
this._a("annotationPaddingBottom", this.i.ac9.bottom);
this.i.ac9 = this.i.ac9;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationPaddingLeft", {
get: function () {
return this.i.ac9 ? this.i.ac9.left : NaN;
},
set: function (v) {
this.ensureAnnotationPadding();
this.i.ac9.left = +v;
this._a("annotationPaddingLeft", this.i.ac9.left);
this.i.ac9 = this.i.ac9;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationPaddingRight", {
get: function () {
return this.i.ac9 ? this.i.ac9.right : NaN;
},
set: function (v) {
this.ensureAnnotationPadding();
this.i.ac9.right = +v;
this._a("annotationPaddingRight", this.i.ac9.right);
this.i.ac9 = this.i.ac9;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationPaddingTop", {
get: function () {
return this.i.ac9 ? this.i.ac9.top : NaN;
},
set: function (v) {
this.ensureAnnotationPadding();
this.i.ac9.top = +v;
this._a("annotationPaddingTop", this.i.ac9.top);
this.i.ac9 = this.i.ac9;
},
enumerable: false,
configurable: true
});
IgcDataAnnotationAxisLayerComponent.prototype.ensureAnnotationPadding = function () {
if (this.i.ac9) {
return;
}
this.i.ac9 = new Thickness(2);
};
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBorderThickness", {
/**
* Gets or sets border thickness of the axis annotations.
*/
get: function () {
return this.i.abc;
},
set: function (v) {
this.i.abc = +v;
this._a("annotationBorderThickness", this.i.abc);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationValueMaxPrecision", {
/**
* Gets or sets maximum precision for displaying values on axis annotation.
*/
get: function () {
return this.i.abe;
},
set: function (v) {
this.i.abe = +v;
this._a("annotationValueMaxPrecision", this.i.abe);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationValueMinPrecision", {
/**
* Gets or sets minimum precision for displaying values on axis annotation.
*/
get: function () {
return this.i.abf;
},
set: function (v) {
this.i.abf = +v;
this._a("annotationValueMinPrecision", this.i.abf);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "targetAxis", {
/**
* Gets or sets the target axis for this annotation. If null, this annotation will use TargetMode to determine target axis.
*/
get: function () {
var r = this.i.aav;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgcAxisComponent._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(IgcDataAnnotationAxisLayerComponent.prototype, "targetAxisName", {
/**
* Gets or sets the name to use to resolve targetAxis from markup.
*/
get: function () {
return this._targetAxisName;
},
set: function (v) {
this._targetAxisName = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "targetMode", {
/**
* Gets or sets the mode for targeting axes present in the chart. Defaults to targeting all category-axes present in the chart
*/
get: function () {
return this.i.aax;
},
set: function (v) {
this.i.aax = ensureEnum(DataAnnotationTargetMode_$type, v);
this._a("targetMode", enumToString(DataAnnotationTargetMode_$type, this.i.aax));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBadgeEnabled", {
/**
* Gets or sets whether the badge are rendered in annotations.
*/
get: function () {
return this.i.aa0;
},
set: function (v) {
this.i.aa0 = ensureBool(v);
this._a("annotationBadgeEnabled", this.i.aa0);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBadgeBackground", {
/**
* Gets or sets background of the badge annotations.
*/
get: function () {
return brushToString(this.i.ac5);
},
set: function (v) {
this.i.ac5 = stringToBrush(v);
this._a("annotationBadgeBackground", brushToString(this.i.ac5));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBadgeOutline", {
/**
* Gets or sets border outline of the badge annotations.
*/
get: function () {
return brushToString(this.i.ac6);
},
set: function (v) {
this.i.ac6 = stringToBrush(v);
this._a("annotationBadgeOutline", brushToString(this.i.ac6));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBadgeOutlineThickness", {
/**
* Gets or sets border thickness of the badge annotations.
*/
get: function () {
return this.i.aa8;
},
set: function (v) {
this.i.aa8 = +v;
this._a("annotationBadgeOutlineThickness", this.i.aa8);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBadgeCornerRadius", {
/**
* Gets or sets border radius of the badge annotations.
*/
get: function () {
return this.i.aa6;
},
set: function (v) {
this.i.aa6 = +v;
this._a("annotationBadgeCornerRadius", this.i.aa6);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBadgeImagePath", {
/**
* Gets or sets a member path for displaying an image in the badge annotations.
*/
get: function () {
return this.i.abn;
},
set: function (v) {
this.i.abn = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBadgeSize", {
/**
* Gets or sets size of the badge annotations.
*/
get: function () {
return this.i.aa9;
},
set: function (v) {
this.i.aa9 = +v;
this._a("annotationBadgeSize", this.i.aa9);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataAnnotationAxisLayerComponent.prototype, "annotationBadgeMargin", {
/**
* Gets or sets margin of the badge annotations.
*/
get: function () {
return this.i.aa7;
},
set: function (v) {
this.i.aa7 = +v;
this._a("annotationBadgeMargin", this.i.aa7);
},
enumerable: false,
configurable: true
});
IgcDataAnnotationAxisLayerComponent.prototype.bindAxes = function (axes) {
_super.prototype.bindAxes.call(this, axes);
for (var i = 0; i < axes.length; i++) {
if (this.targetAxisName && this.targetAxisName.length > 0 &&
axes[i].name == this.targetAxisName) {
this.targetAxis = axes[i];
}
}
};
IgcDataAnnotationAxisLayerComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
return this.targetAxis;
}
return null;
};
IgcDataAnnotationAxisLayerComponent.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, container, component, parent);
this._inStyling = true;
if (this.targetAxis && this.targetAxis._styling) {
this.targetAxis._styling(container, component, this);
}
this._inStyling = false;
};
IgcDataAnnotationAxisLayerComponent._observedAttributesIgcDataAnnotationAxisLayerComponent = null;
return IgcDataAnnotationAxisLayerComponent;
}(IgcAnnotationLayerComponent));