igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
420 lines (419 loc) • 16.5 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";
/**
* Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
export 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.et;
}
/**
* 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.acv);
}
set horizontalLineStroke(v) {
this.i.acv = stringToBrush(v);
this._a("horizontalLineStroke", brushToString(this.i.acv));
}
/**
* Gets or sets the color to use for vertical line. Leave null for an automatic value.
*/
get verticalLineStroke() {
return brushToString(this.i.acw);
}
set verticalLineStroke(v) {
this.i.acw = stringToBrush(v);
this._a("verticalLineStroke", brushToString(this.i.acw));
}
/**
* 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.aa7;
}
set targetSeriesName(v) {
this.i.aa7 = 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.aad;
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.aad = null : this.i.aad = 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.aak;
}
set useInterpolation(v) {
this.i.aak = ensureBool(v);
this._a("useInterpolation", this.i.aak);
}
/**
* Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
*/
get isAxisAnnotationEnabled() {
return this.i.aag;
}
set isAxisAnnotationEnabled(v) {
this.i.aag = ensureBool(v);
this._a("isAxisAnnotationEnabled", this.i.aag);
}
/**
* 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.acz);
}
set xAxisAnnotationTextColor(v) {
this.i.acz = stringToBrush(v);
this._a("xAxisAnnotationTextColor", brushToString(this.i.acz));
}
/**
* 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.acx);
}
set xAxisAnnotationBackground(v) {
this.i.acx = stringToBrush(v);
this._a("xAxisAnnotationBackground", brushToString(this.i.acx));
}
/**
* 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.aan;
}
set xAxisAnnotationBackgroundCornerRadius(v) {
this.i.aan = +v;
this._a("xAxisAnnotationBackgroundCornerRadius", this.i.aan);
}
/**
* Gets or sets the precision to use displaying values for interpolated crosshair positions.
*/
get xAxisAnnotationInterpolatedValuePrecision() {
return this.i.aaz;
}
set xAxisAnnotationInterpolatedValuePrecision(v) {
this.i.aaz = +v;
this._a("xAxisAnnotationInterpolatedValuePrecision", this.i.aaz);
}
/**
* 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.acy);
}
set xAxisAnnotationOutline(v) {
this.i.acy = stringToBrush(v);
this._a("xAxisAnnotationOutline", brushToString(this.i.acy));
}
/**
* 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.aap;
}
set xAxisAnnotationPaddingLeft(v) {
this.i.aap = +v;
this._a("xAxisAnnotationPaddingLeft", this.i.aap);
}
/**
* 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.aar;
}
set xAxisAnnotationPaddingTop(v) {
this.i.aar = +v;
this._a("xAxisAnnotationPaddingTop", this.i.aar);
}
/**
* 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.aaq;
}
set xAxisAnnotationPaddingRight(v) {
this.i.aaq = +v;
this._a("xAxisAnnotationPaddingRight", this.i.aaq);
}
/**
* 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.aao;
}
set xAxisAnnotationPaddingBottom(v) {
this.i.aao = +v;
this._a("xAxisAnnotationPaddingBottom", this.i.aao);
}
/**
* 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.aav;
}
set yAxisAnnotationPaddingLeft(v) {
this.i.aav = +v;
this._a("yAxisAnnotationPaddingLeft", this.i.aav);
}
/**
* 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.aax;
}
set yAxisAnnotationPaddingTop(v) {
this.i.aax = +v;
this._a("yAxisAnnotationPaddingTop", this.i.aax);
}
/**
* 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.aaw;
}
set yAxisAnnotationPaddingRight(v) {
this.i.aaw = +v;
this._a("yAxisAnnotationPaddingRight", this.i.aaw);
}
/**
* 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.aau;
}
set yAxisAnnotationPaddingBottom(v) {
this.i.aau = +v;
this._a("yAxisAnnotationPaddingBottom", this.i.aau);
}
/**
* Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value.
*/
get xAxisAnnotationStrokeThickness() {
return this.i.aas;
}
set xAxisAnnotationStrokeThickness(v) {
this.i.aas = +v;
this._a("xAxisAnnotationStrokeThickness", this.i.aas);
}
/**
* 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.ac2);
}
set yAxisAnnotationTextColor(v) {
this.i.ac2 = stringToBrush(v);
this._a("yAxisAnnotationTextColor", brushToString(this.i.ac2));
}
/**
* 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.ac0);
}
set yAxisAnnotationBackground(v) {
this.i.ac0 = stringToBrush(v);
this._a("yAxisAnnotationBackground", brushToString(this.i.ac0));
}
/**
* 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.aat;
}
set yAxisAnnotationBackgroundCornerRadius(v) {
this.i.aat = +v;
this._a("yAxisAnnotationBackgroundCornerRadius", this.i.aat);
}
/**
* Gets or sets the precision to use displaying values for interpolated crosshair positions.
*/
get yAxisAnnotationInterpolatedValuePrecision() {
return this.i.aa0;
}
set yAxisAnnotationInterpolatedValuePrecision(v) {
this.i.aa0 = +v;
this._a("yAxisAnnotationInterpolatedValuePrecision", this.i.aa0);
}
/**
* 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.ac1);
}
set yAxisAnnotationOutline(v) {
this.i.ac1 = stringToBrush(v);
this._a("yAxisAnnotationOutline", brushToString(this.i.ac1));
}
/**
* Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value.
*/
get yAxisAnnotationStrokeThickness() {
return this.i.aay;
}
set yAxisAnnotationStrokeThickness(v) {
this.i.aay = +v;
this._a("yAxisAnnotationStrokeThickness", this.i.aay);
}
/**
* Gets or sets whether to display the vertical line.
*/
get verticalLineVisibility() {
return this.i.ac8;
}
set verticalLineVisibility(v) {
this.i.ac8 = ensureEnum(Visibility_$type, v);
this._a("verticalLineVisibility", enumToString(Visibility_$type, this.i.ac8));
}
/**
* Gets or sets whether to display the horizontal line.
*/
get horizontalLineVisibility() {
return this.i.ac7;
}
set horizontalLineVisibility(v) {
this.i.ac7 = ensureEnum(Visibility_$type, v);
this._a("horizontalLineVisibility", enumToString(Visibility_$type, this.i.ac7));
}
/**
* Gets or sets whether to skip unknown values when searching for series values.
*/
get skipUnknownValues() {
return this.i.aaj;
}
set skipUnknownValues(v) {
this.i.aaj = ensureBool(v);
this._a("skipUnknownValues", this.i.aaj);
}
/**
* Gets or sets whether axis annotation are skipped for zero-value fragments in a given position.
*/
get skipAxisAnnotationOnZeroValueFragments() {
return this.i.aai;
}
set skipAxisAnnotationOnZeroValueFragments(v) {
this.i.aai = ensureBool(v);
this._a("skipAxisAnnotationOnZeroValueFragments", this.i.aai);
}
/**
* Gets or sets whether axis annotation are skipped for invalid data in a given position.
*/
get skipAxisAnnotationOnInvalidData() {
return this.i.aah;
}
set skipAxisAnnotationOnInvalidData(v) {
this.i.aah = ensureBool(v);
this._a("skipAxisAnnotationOnInvalidData", this.i.aah);
}
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;
})();