igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
418 lines (417 loc) • 16.4 kB
JavaScript
import { IgcSeriesComponent } from "./igc-series-component";
import { Visibility_$type } from "igniteui-webcomponents-core";
import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component";
import { CrosshairLayer } from "./CrosshairLayer";
import { getAllPropertyNames, toSpinal, ensureBool, brushToString, stringToBrush, ensureEnum, enumToString } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
let IgcCrosshairLayerComponent = /*@__PURE__*/ (() => {
class IgcCrosshairLayerComponent extends IgcAnnotationLayerComponent {
createImplementation() {
return new CrosshairLayer();
}
/**
* @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 (IgcCrosshairLayerComponent._observedAttributesIgcCrosshairLayerComponent == null) {
let names = getAllPropertyNames(IgcCrosshairLayerComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcCrosshairLayerComponent._observedAttributesIgcCrosshairLayerComponent = names;
}
return IgcCrosshairLayerComponent._observedAttributesIgcCrosshairLayerComponent;
}
static register() {
if (!IgcCrosshairLayerComponent._isElementRegistered) {
IgcCrosshairLayerComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcCrosshairLayerComponent.htmlTagName, IgcCrosshairLayerComponent);
}
}
/**
* Gets whether the series is an annotation layer displayed only when hovering over the chart.
*/
get isAnnotationHoverLayer() {
return this.i.eu;
}
/**
* Gets whether the series is an crosshair annotation layer.
*/
get isAnnotationCrosshairLayer() {
return this.i.er;
}
/**
* Gets or sets the color to use for the horizontal line. Leave null for an automatic value.
*/
get horizontalLineStroke() {
return brushToString(this.i.add);
}
set horizontalLineStroke(v) {
this.i.add = stringToBrush(v);
this._a("horizontalLineStroke", brushToString(this.i.add));
}
/**
* Gets or sets the color to use for vertical line. Leave null for an automatic value.
*/
get verticalLineStroke() {
return brushToString(this.i.ade);
}
set verticalLineStroke(v) {
this.i.ade = stringToBrush(v);
this._a("verticalLineStroke", brushToString(this.i.ade));
}
/**
* Gets or sets the name of the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get targetSeriesName() {
return this.i.abp;
}
set targetSeriesName(v) {
this.i.abp = v;
}
/**
* Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get targetSeries() {
const r = this.i.aav;
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.aav = null : this.i.aav = v.i;
}
/**
* Gets or sets whether to use value interpolation when drawing a line through the best value for the cursor position.
*/
get useInterpolation() {
return this.i.aa2;
}
set useInterpolation(v) {
this.i.aa2 = ensureBool(v);
this._a("useInterpolation", this.i.aa2);
}
/**
* Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
*/
get isAxisAnnotationEnabled() {
return this.i.aay;
}
set isAxisAnnotationEnabled(v) {
this.i.aay = ensureBool(v);
this._a("isAxisAnnotationEnabled", this.i.aay);
}
/**
* Gets or sets the color to use for the x axis annotation text. Leave unset for an automatic value.
*/
get xAxisAnnotationTextColor() {
return brushToString(this.i.adh);
}
set xAxisAnnotationTextColor(v) {
this.i.adh = stringToBrush(v);
this._a("xAxisAnnotationTextColor", brushToString(this.i.adh));
}
/**
* Gets or sets the color to use for the x axis annotation backing. Leave unset for an automatic value.
*/
get xAxisAnnotationBackground() {
return brushToString(this.i.adf);
}
set xAxisAnnotationBackground(v) {
this.i.adf = stringToBrush(v);
this._a("xAxisAnnotationBackground", brushToString(this.i.adf));
}
/**
* Gets or sets the corner radius to use for the x axis annotation backing. Leave unset for an automatic value.
*/
get xAxisAnnotationBackgroundCornerRadius() {
return this.i.aa5;
}
set xAxisAnnotationBackgroundCornerRadius(v) {
this.i.aa5 = +v;
this._a("xAxisAnnotationBackgroundCornerRadius", this.i.aa5);
}
/**
* Gets or sets the precision to use displaying values for interpolated crosshair positions.
*/
get xAxisAnnotationInterpolatedValuePrecision() {
return this.i.abh;
}
set xAxisAnnotationInterpolatedValuePrecision(v) {
this.i.abh = +v;
this._a("xAxisAnnotationInterpolatedValuePrecision", this.i.abh);
}
/**
* Gets or sets the color to use for the x axis annotation outline. Leave unset for an automatic value.
*/
get xAxisAnnotationOutline() {
return brushToString(this.i.adg);
}
set xAxisAnnotationOutline(v) {
this.i.adg = stringToBrush(v);
this._a("xAxisAnnotationOutline", brushToString(this.i.adg));
}
/**
* 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 xAxisAnnotationPaddingLeft() {
return this.i.aa7;
}
set xAxisAnnotationPaddingLeft(v) {
this.i.aa7 = +v;
this._a("xAxisAnnotationPaddingLeft", this.i.aa7);
}
/**
* 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 xAxisAnnotationPaddingTop() {
return this.i.aa9;
}
set xAxisAnnotationPaddingTop(v) {
this.i.aa9 = +v;
this._a("xAxisAnnotationPaddingTop", this.i.aa9);
}
/**
* 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 xAxisAnnotationPaddingRight() {
return this.i.aa8;
}
set xAxisAnnotationPaddingRight(v) {
this.i.aa8 = +v;
this._a("xAxisAnnotationPaddingRight", this.i.aa8);
}
/**
* 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 xAxisAnnotationPaddingBottom() {
return this.i.aa6;
}
set xAxisAnnotationPaddingBottom(v) {
this.i.aa6 = +v;
this._a("xAxisAnnotationPaddingBottom", this.i.aa6);
}
/**
* 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 yAxisAnnotationPaddingLeft() {
return this.i.abd;
}
set yAxisAnnotationPaddingLeft(v) {
this.i.abd = +v;
this._a("yAxisAnnotationPaddingLeft", this.i.abd);
}
/**
* 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 yAxisAnnotationPaddingTop() {
return this.i.abf;
}
set yAxisAnnotationPaddingTop(v) {
this.i.abf = +v;
this._a("yAxisAnnotationPaddingTop", this.i.abf);
}
/**
* 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 yAxisAnnotationPaddingRight() {
return this.i.abe;
}
set yAxisAnnotationPaddingRight(v) {
this.i.abe = +v;
this._a("yAxisAnnotationPaddingRight", this.i.abe);
}
/**
* 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 yAxisAnnotationPaddingBottom() {
return this.i.abc;
}
set yAxisAnnotationPaddingBottom(v) {
this.i.abc = +v;
this._a("yAxisAnnotationPaddingBottom", this.i.abc);
}
/**
* Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value.
*/
get xAxisAnnotationStrokeThickness() {
return this.i.aba;
}
set xAxisAnnotationStrokeThickness(v) {
this.i.aba = +v;
this._a("xAxisAnnotationStrokeThickness", this.i.aba);
}
/**
* Gets or sets the color to use for the y axis annotation text. Leave unset for an automatic value.
*/
get yAxisAnnotationTextColor() {
return brushToString(this.i.adk);
}
set yAxisAnnotationTextColor(v) {
this.i.adk = stringToBrush(v);
this._a("yAxisAnnotationTextColor", brushToString(this.i.adk));
}
/**
* Gets or sets the color to use for the y axis annotation backing. Leave unset for an automatic value.
*/
get yAxisAnnotationBackground() {
return brushToString(this.i.adi);
}
set yAxisAnnotationBackground(v) {
this.i.adi = stringToBrush(v);
this._a("yAxisAnnotationBackground", brushToString(this.i.adi));
}
/**
* Gets or sets the corner radius to use for the y axis annotation backing. Leave unset for an automatic value.
*/
get yAxisAnnotationBackgroundCornerRadius() {
return this.i.abb;
}
set yAxisAnnotationBackgroundCornerRadius(v) {
this.i.abb = +v;
this._a("yAxisAnnotationBackgroundCornerRadius", this.i.abb);
}
/**
* Gets or sets the precision to use displaying values for interpolated crosshair positions.
*/
get yAxisAnnotationInterpolatedValuePrecision() {
return this.i.abi;
}
set yAxisAnnotationInterpolatedValuePrecision(v) {
this.i.abi = +v;
this._a("yAxisAnnotationInterpolatedValuePrecision", this.i.abi);
}
/**
* Gets or sets the color to use for the y axis annotation outline. Leave unset for an automatic value.
*/
get yAxisAnnotationOutline() {
return brushToString(this.i.adj);
}
set yAxisAnnotationOutline(v) {
this.i.adj = stringToBrush(v);
this._a("yAxisAnnotationOutline", brushToString(this.i.adj));
}
/**
* Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value.
*/
get yAxisAnnotationStrokeThickness() {
return this.i.abg;
}
set yAxisAnnotationStrokeThickness(v) {
this.i.abg = +v;
this._a("yAxisAnnotationStrokeThickness", this.i.abg);
}
/**
* Gets or sets whether to display the vertical line.
*/
get verticalLineVisibility() {
return this.i.adq;
}
set verticalLineVisibility(v) {
this.i.adq = ensureEnum(Visibility_$type, v);
this._a("verticalLineVisibility", enumToString(Visibility_$type, this.i.adq));
}
/**
* Gets or sets whether to display the horizontal line.
*/
get horizontalLineVisibility() {
return this.i.adp;
}
set horizontalLineVisibility(v) {
this.i.adp = ensureEnum(Visibility_$type, v);
this._a("horizontalLineVisibility", enumToString(Visibility_$type, this.i.adp));
}
/**
* Gets or sets whether to skip unknown values when searching for series values.
*/
get skipUnknownValues() {
return this.i.aa1;
}
set skipUnknownValues(v) {
this.i.aa1 = ensureBool(v);
this._a("skipUnknownValues", this.i.aa1);
}
/**
* Gets or sets whether axis annotation are skipped for zero-value fragments in a given position.
*/
get skipAxisAnnotationOnZeroValueFragments() {
return this.i.aa0;
}
set skipAxisAnnotationOnZeroValueFragments(v) {
this.i.aa0 = ensureBool(v);
this._a("skipAxisAnnotationOnZeroValueFragments", this.i.aa0);
}
/**
* Gets or sets whether axis annotation are skipped for invalid data in a given position.
*/
get skipAxisAnnotationOnInvalidData() {
return this.i.aaz;
}
set skipAxisAnnotationOnInvalidData(v) {
this.i.aaz = ensureBool(v);
this._a("skipAxisAnnotationOnInvalidData", this.i.aaz);
}
findByName(name) {
var baseResult = super.findByName(name);
if (baseResult) {
return baseResult;
}
if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
return this.targetSeries;
}
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);
}
this._inStyling = false;
}
}
IgcCrosshairLayerComponent._observedAttributesIgcCrosshairLayerComponent = null;
IgcCrosshairLayerComponent.htmlTagName = "igc-crosshair-layer";
IgcCrosshairLayerComponent._isElementRegistered = false;
return IgcCrosshairLayerComponent;
})();
export { IgcCrosshairLayerComponent };