import { IgrSeries } from "./igr-series";
import { Visibility_$type } from "igniteui-react-core";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { CrosshairLayer } from "./CrosshairLayer";
import { brushToString, stringToBrush, ensureBool, ensureEnum } from "igniteui-react-core";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
export class IgrCrosshairLayer extends IgrAnnotationLayer {
    createImplementation() {
        return new CrosshairLayer();
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    constructor(props) {
        super(props);
    }
    /**
     * Gets or sets the color to use for the horizontal line. Leave null for an automatic value.
    */
    get horizontalLineStroke() {
        return brushToString(this.i.rm);
    }
    set horizontalLineStroke(v) {
        this.i.rm = stringToBrush(v);
    }
    /**
     * Gets or sets the color to use for vertical line. Leave null for an automatic value.
    */
    get verticalLineStroke() {
        return brushToString(this.i.rn);
    }
    set verticalLineStroke(v) {
        this.i.rn = stringToBrush(v);
    }
    /**
     * Gets or sets the name of the series series to target this annotation to. If null, this annotation targets all series simultaneously.
    */
    get targetSeriesName() {
        return this.i.p4;
    }
    set targetSeriesName(v) {
        this.i.p4 = v;
    }
    /**
     * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
    */
    get targetSeries() {
        if (this.i.pg == null) {
            return null;
        }
        if (!this.i.pg.externalObject) {
            let e = IgrSeries._createFromInternal(this.i.pg);
            if (e) {
                e._implementation = this.i.pg;
            }
            this.i.pg.externalObject = e;
        }
        return this.i.pg.externalObject;
    }
    set targetSeries(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.pg = null : this.i.pg = 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.pl;
    }
    set useInterpolation(v) {
        this.i.pl = ensureBool(v);
    }
    /**
     * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
    */
    get isAxisAnnotationEnabled() {
        return this.i.pj;
    }
    set isAxisAnnotationEnabled(v) {
        this.i.pj = ensureBool(v);
    }
    /**
     * 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.rq);
    }
    set xAxisAnnotationTextColor(v) {
        this.i.rq = stringToBrush(v);
    }
    /**
     * 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.ro);
    }
    set xAxisAnnotationBackground(v) {
        this.i.ro = stringToBrush(v);
    }
    /**
     * Gets or sets the precision to use displaying values for interpolated crosshair positions.
    */
    get xAxisAnnotationInterpolatedValuePrecision() {
        return this.i.py;
    }
    set xAxisAnnotationInterpolatedValuePrecision(v) {
        this.i.py = +v;
    }
    /**
     * 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.rp);
    }
    set xAxisAnnotationOutline(v) {
        this.i.rp = stringToBrush(v);
    }
    /**
     * 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.pp;
    }
    set xAxisAnnotationPaddingLeft(v) {
        this.i.pp = +v;
    }
    /**
     * 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.pr;
    }
    set xAxisAnnotationPaddingTop(v) {
        this.i.pr = +v;
    }
    /**
     * 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.pq;
    }
    set xAxisAnnotationPaddingRight(v) {
        this.i.pq = +v;
    }
    /**
     * 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.po;
    }
    set xAxisAnnotationPaddingBottom(v) {
        this.i.po = +v;
    }
    /**
     * 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.pu;
    }
    set yAxisAnnotationPaddingLeft(v) {
        this.i.pu = +v;
    }
    /**
     * 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.pw;
    }
    set yAxisAnnotationPaddingTop(v) {
        this.i.pw = +v;
    }
    /**
     * 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.pv;
    }
    set yAxisAnnotationPaddingRight(v) {
        this.i.pv = +v;
    }
    /**
     * 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.pt;
    }
    set yAxisAnnotationPaddingBottom(v) {
        this.i.pt = +v;
    }
    /**
     * Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value.
    */
    get xAxisAnnotationStrokeThickness() {
        return this.i.ps;
    }
    set xAxisAnnotationStrokeThickness(v) {
        this.i.ps = +v;
    }
    /**
     * 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.rt);
    }
    set yAxisAnnotationTextColor(v) {
        this.i.rt = stringToBrush(v);
    }
    /**
     * 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.rr);
    }
    set yAxisAnnotationBackground(v) {
        this.i.rr = stringToBrush(v);
    }
    /**
     * Gets or sets the precision to use displaying values for interpolated crosshair positions.
    */
    get yAxisAnnotationInterpolatedValuePrecision() {
        return this.i.pz;
    }
    set yAxisAnnotationInterpolatedValuePrecision(v) {
        this.i.pz = +v;
    }
    /**
     * 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.rs);
    }
    set yAxisAnnotationOutline(v) {
        this.i.rs = stringToBrush(v);
    }
    /**
     * Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value.
    */
    get yAxisAnnotationStrokeThickness() {
        return this.i.px;
    }
    set yAxisAnnotationStrokeThickness(v) {
        this.i.px = +v;
    }
    /**
     * Gets or sets whether to display the vertical line.
    */
    get verticalLineVisibility() {
        return this.i.rx;
    }
    set verticalLineVisibility(v) {
        this.i.rx = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets or sets whether to display the horizontal line.
    */
    get horizontalLineVisibility() {
        return this.i.rw;
    }
    set horizontalLineVisibility(v) {
        this.i.rw = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets or sets whether to skip unknown values when searching for series values.
    */
    get skipUnknownValues() {
        return this.i.pk;
    }
    set skipUnknownValues(v) {
        this.i.pk = ensureBool(v);
    }
    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;
    }
}
//# sourceMappingURL=igr-crosshair-layer.js.map
