igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
253 lines (252 loc) • 8.54 kB
JavaScript
import { AxisAnnotation as AxisAnnotation_internal } from "./AxisAnnotation";
import { brushToString, stringToBrush, arrayFindByName } from "igniteui-react-core";
/**
* Represents an axis annotation
*/
var IgrAxisAnnotation = /** @class */ /*@__PURE__*/ (function () {
function IgrAxisAnnotation() {
this.mounted = false;
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
IgrAxisAnnotation.prototype.createImplementation = function () {
return new AxisAnnotation_internal();
};
Object.defineProperty(IgrAxisAnnotation.prototype, "nativeElement", {
get: function () {
return this._implementation.nativeElement;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgrAxisAnnotation.prototype.onImplementationCreated = function () {
};
IgrAxisAnnotation.prototype._provideImplementation = function (i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
};
Object.defineProperty(IgrAxisAnnotation.prototype, "value", {
/**
* Gets or sets the value at which this annotation is displayed on the axis.
*/
get: function () {
return this.i.value;
},
set: function (v) {
this.i.value = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "text", {
/**
* Gets or sets the text that should be displayed for the annotation. Leave null to display the value automatically.
*/
get: function () {
return this.i.text;
},
set: function (v) {
this.i.text = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "backgroundCornerRadius", {
/**
* Gets or sets the corner radius to use for the axis annotation borders.
*/
get: function () {
return this.i.backgroundCornerRadius;
},
set: function (v) {
this.i.backgroundCornerRadius = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "labelFormat", {
/**
* Gets or sets the label format string to use for the label.
*/
get: function () {
return this.i.labelFormat;
},
set: function (v) {
this.i.labelFormat = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "labelFormatSpecifiers", {
/**
* Gets or sets the format specifiers to use with the LabelFormat string.
*/
get: function () {
return this.i.labelFormatSpecifiers;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.labelFormatSpecifiers = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "formatLabel", {
/**
* Sets or gets a function which takes an object that produces a formatted label for the value of this annotation.
*/
get: function () {
return this.i.formatLabel;
},
set: function (v) {
this.i.formatLabel = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "textColor", {
/**
* Gets or sets the color to use for the text in the annotation.
*/
get: function () {
return brushToString(this.i.textColor);
},
set: function (v) {
this.i.textColor = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "background", {
/**
* Gets or sets the background to use for tha axis annotation box.
*/
get: function () {
return brushToString(this.i.background);
},
set: function (v) {
this.i.background = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "outline", {
/**
* Gets or sets the Outline to use for tha axis annotation box.
*/
get: function () {
return brushToString(this.i.outline);
},
set: function (v) {
this.i.outline = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "strokeThickness", {
/**
* Gets or sets the border stroke thickness to use for tha axis annotation box.
*/
get: function () {
return this.i.strokeThickness;
},
set: function (v) {
this.i.strokeThickness = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "backgroundPaddingLeft", {
/**
* 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.backgroundPaddingLeft;
},
set: function (v) {
this.i.backgroundPaddingLeft = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "backgroundPaddingTop", {
/**
* 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.backgroundPaddingTop;
},
set: function (v) {
this.i.backgroundPaddingTop = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "backgroundPaddingRight", {
/**
* 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.backgroundPaddingRight;
},
set: function (v) {
this.i.backgroundPaddingRight = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrAxisAnnotation.prototype, "backgroundPaddingBottom", {
/**
* 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.backgroundPaddingBottom;
},
set: function (v) {
this.i.backgroundPaddingBottom = +v;
},
enumerable: false,
configurable: true
});
IgrAxisAnnotation.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
if (this.labelFormatSpecifiers != null && arrayFindByName(this.labelFormatSpecifiers, name)) {
return arrayFindByName(this.labelFormatSpecifiers, name);
}
return null;
};
IgrAxisAnnotation.prototype.resetCachedExtent = function () {
this.i.resetCachedExtent();
};
IgrAxisAnnotation.prototype.resolveLabelValue = function () {
var iv = this.i.resolveLabelValue();
return (iv);
};
return IgrAxisAnnotation;
}());
export { IgrAxisAnnotation };