/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as React from 'react';
import { Visibility_$type } from "igniteui-react-core";
import { HorizontalAlignment_$type } from "igniteui-react-core";
import { VerticalAlignment_$type } from "igniteui-react-core";
import { AxisLabelsLocation_$type } from './AxisLabelsLocation';
import { AxisLabelSettings } from './AxisLabelSettings';
import { TitleSettings } from './TitleSettings';
import { AxisTitlePosition_$type } from './AxisTitlePosition';
import { ensureEnum, arrayFindByName, brushToString, stringToBrush, ensureBool, isValidProp, getModifiedProps, toSpinal, initializePropertiesFromCss, NamePatcher } from "igniteui-react-core";
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrRenderRequestedEventArgs } from './igr-render-requested-event-args';
import { TypeRegistrar } from "igniteui-react-core";
import { IgrAxisRangeChangedEventArgs } from './igr-axis-range-changed-event-args';
import { IgrAxisAnnotationCollection } from './igr-axis-annotation-collection';
import { AxisAnnotationCollection as AxisAnnotationCollection_internal } from './AxisAnnotationCollection';
import { SyncableObservableCollection$1 } from "igniteui-react-core";
import { IAxisAnnotation_$type } from './IAxisAnnotation';
/**
 * Represents the base class from which all axis types are derived.
*
* The `IgrAxis` is an array of axis objects.
*
* ```ts
* <IgrDataChart
*     dataSource={this.state.dataSource} >
*
*     <IgrCategoryXAxis name="xAxis" label="Date" />
*     <IgrNumericYAxis  name="yAxis" />
*  </IgrDataChart>
* ```
*/
export class IgrAxis extends React.Component {
    constructor(props) {
        super(props);
        this._renderer = null;
        this._crossingAxisName = null;
        this._annotations = null;
        this.__p = null;
        this._hasUserValues = new Set();
        this._stylingContainer = null;
        this._stylingParent = null;
        this._inStyling = false;
        this._rangeChanged = null;
        this._rangeChanged_wrapped = null;
        this._renderRequested = null;
        this._renderRequested_wrapped = null;
        if (this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
        }
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    componentDidMount() {
        {
            for (const p of Object.keys(this.props)) {
                {
                    if (isValidProp(this, p)) {
                        {
                            this[p] = this.props[p];
                        }
                    }
                }
            }
        }
    }
    //private _crossingAxisName: string;
    //public set crossingAxisName(value: string) {
    //    this._crossingAxisName = value;
    //}
    //public get crossingAxisName(): string {
    //    return this._crossingAxisName;
    //}
    get axisInternal() {
        return this.i;
    }
    createImplementation() {
        return null;
    }
    shouldComponentUpdate(nextProps, nextState) {
        const mod = getModifiedProps(this.props, nextProps);
        for (const p of Object.keys(mod)) {
            if (isValidProp(this, p)) {
                this[p] = mod[p];
            }
        }
        return true;
    }
    render() {
        return null;
    }
    set name(value) {
        this.i.name = value;
    }
    get name() {
        return this.i.name;
    }
    provideData(data) {
    }
    _provideRenderer(renderer) {
        this._renderer = renderer;
    }
    static _createFromInternal(internal) {
        if (!internal) {
            return null;
        }
        if (!internal.$type) {
            return null;
        }
        let name = internal.$type.name;
        let externalName = "Igr" + name;
        if (!TypeRegistrar.isRegistered(externalName)) {
            return null;
        }
        return TypeRegistrar.create(externalName);
    }
    /**
 * Gets or sets if the current axis is of category axis type
*/
    get isCategory() {
        return this.i.b4;
    }
    /**
     * Gets or sets if the current axis is of numeric axis type
    *
    *     Gets or sets if the current axis is of numeric axis type
    */
    get isNumeric() {
        return this.i.cc;
    }
    /**
     * Gets if the current axis is of angular axis type
    */
    get isAngular() {
        return this.i.b2;
    }
    /**
     * Gets or sets if the current axis is of radial axis type
    */
    get isRadial() {
        return this.i.ce;
    }
    /**
     * Gets if the current axis is a vertical axis.
    */
    get isVertical() {
        return this.i.ch;
    }
    /**
     * Gets or sets if the current axis is sorting data items
    */
    get isSorting() {
        return this.i.cf;
    }
    /**
     * Gets or sets if the current axis is of date time axis type
    */
    get isDateTime() {
        return this.i.b7;
    }
    /**
     * Gets or sets if the axis is a piecewise scaling function.
    */
    get isPiecewise() {
        return this.i.cd;
    }
    /**
     * Gets if the current axis is of category date time axis type
    */
    get isCategoryDateTime() {
        return this.i.b5;
    }
    /**
     * Gets if the current axis is a continuous rather than a discrete scale
    */
    get isContinuous() {
        return this.i.b6;
    }
    /**
     * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart.
    *
    * The `formatLabel` function takes an object that produces a formatted label for displaying in the chart.
    *
    * ```ts
    * <IgrDataChart dataSource={this.data}   >
    *     <IgrCategoryXAxis
    * 		name="xAxis"
    * 		FormatLabel="xAxis_FormatLabel" />
    * </IgrDataChart>
    * ```
    */
    get formatLabel() {
        return this.i.at;
    }
    set formatLabel(v) {
        this.i.at = v;
    }
    /**
     * Gets or sets the Title property.
    *
    * Use `title` property to display the title of the component.
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     title="Country"
    *     titleTextColor="gray"
    *     titleTextStyle="12pt Verdana"
    *     titleAngle={90} />
    * ```
    */
    get title() {
        return this.i.gd;
    }
    set title(v) {
        this.i.gd = v;
    }
    /**
     * Gets or sets the Stroke property.
     * Null is treated as auto. The axis stroke will be displayed or not based on the axis type and series used with it.
    *
    * Use `stroke` property to set the stroke of the chart.
    *
    * ```ts
    * <IgrCategoryChart
    *         ref={this.onChartRef}
    *         width="100%"
    *         height="100%"
    *         dataSource={this.data}
    *         titleTopMargin={5}
    *         xAxisStroke="gray"/>
    * ```
    */
    get stroke() {
        return brushToString(this.i.iw);
    }
    set stroke(v) {
        this.i.iw = stringToBrush(v);
    }
    /**
     * Gets or sets the effective stroke used for the axis.
    */
    get actualStroke() {
        return brushToString(this.i.is);
    }
    set actualStroke(v) {
        this.i.is = stringToBrush(v);
    }
    /**
     * Gets or sets the StrokeThickness property.
    *
    * Use `strokeThickness` property for the thickness of the stroke.
    *
    * ```ts
    * <IgrCategoryChart
    *         ref={this.onChartRef}
    *         width="100%"
    *         height="100%"
    *         dataSource={this.data}
    *         titleTopMargin={5}
    *         xAxisStrokeThickness={2}>
    * ```
    */
    get strokeThickness() {
        return this.i.eq;
    }
    set strokeThickness(v) {
        this.i.eq = +v;
    }
    /**
     * Gets or sets the Strip property.
    *
    * Use `strip` property to set the strip of the chart.
    *
    * ```ts
    * <IgrCategoryChart
    *         ref={this.onChartRef}
    *         width="100%"
    *         height="100%"
    *         dataSource={this.data}
    *         titleTopMargin={5}
    *         xAxisStrip="gray"/>
    * ```
    */
    get strip() {
        return brushToString(this.i.iv);
    }
    set strip(v) {
        this.i.iv = stringToBrush(v);
    }
    /**
     * Gets or sets the MajorStroke property.
     * Null is treated as auto. Major lines will be displayed or not based on the axis type and series used with it.
    *
    * Gets or sets the `majorStroke` using this property.
    *
    * ```ts
    * <IgrNumericYAxis name="yAxis"
    *     interval={100}
    *     majorStroke="black"
    *     majorStrokeThickness={1}
    *     minorInterval={25}
    *     minorStroke="gray"
    *     minorStrokeThickness={0.5} />
    * ```
    */
    get majorStroke() {
        return brushToString(this.i.it);
    }
    set majorStroke(v) {
        this.i.it = stringToBrush(v);
    }
    /**
     * Gets or sets the ActualMajorStroke property.
    *
    * The `actualMajorStroke` property is used for ActualMajorStroke of the axis.
    */
    get actualMajorStroke() {
        return brushToString(this.i.iq);
    }
    set actualMajorStroke(v) {
        this.i.iq = stringToBrush(v);
    }
    /**
     * Gets or sets the MajorStrokeThickness property.
    *
    * Gets or sets the `majorStrokeThickness` using this property.
    *
    * ```ts
    * <IgrNumericYAxis name="yAxis"
    *     interval={100}
    *     majorStroke="black"
    *     majorStrokeThickness={1}
    *     minorInterval={25}
    *     minorStroke="gray"
    *     minorStrokeThickness={0.5} />
    * ```
    */
    get majorStrokeThickness() {
        return this.i.d6;
    }
    set majorStrokeThickness(v) {
        this.i.d6 = +v;
    }
    /**
     * Gets or sets the MinorStroke property.
    *
    * Gets or sets the minorStroke thickness using `minorStrokeThickness` property.
    *
    * ```ts
    * <IgrNumericYAxis name="yAxis"
    *     interval={100}
    *     majorStroke="black"
    *     majorStrokeThickness={1}
    *     minorInterval={25}
    *     minorStroke="gray"
    *     minorStrokeThickness={0.5} />
    * ```
    */
    get minorStroke() {
        return brushToString(this.i.iu);
    }
    set minorStroke(v) {
        this.i.iu = stringToBrush(v);
    }
    /**
     * Gets or sets the ActualMinorStroke property.
    *
    * The `actualMinorStroke` property is used for ActualMinorStroke of the axis.
    */
    get actualMinorStroke() {
        return brushToString(this.i.ir);
    }
    set actualMinorStroke(v) {
        this.i.ir = stringToBrush(v);
    }
    /**
     * Gets or sets the MinorStrokeThickness property.
    */
    get minorStrokeThickness() {
        return this.i.d9;
    }
    set minorStrokeThickness(v) {
        this.i.d9 = +v;
    }
    /**
     * Gets or sets the TickStroke property.
    *
    * Use `tickStroke` property for the color of the tickmarks.
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     tickLength={10}
    *     tickStrokeThickness={0.5}
    *     tickStroke="black" />
    * ```
    */
    get tickStroke() {
        return brushToString(this.i.ix);
    }
    set tickStroke(v) {
        this.i.ix = stringToBrush(v);
    }
    /**
     * Gets or sets the TickStrokeThickness property.
    *
    * Use `tickStrokeThickness` property for thickness of the stroke tickmarks.
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     tickLength={10}
    *     tickStrokeThickness={0.5}
    *     tickStroke="black" />
    * ```
    */
    get tickStrokeThickness() {
        return this.i.es;
    }
    set tickStrokeThickness(v) {
        this.i.es = +v;
    }
    /**
     * Gets or sets the TickLength property.
    *
    * Use `tickLength` property for The length of the tickmarks to display for this axis.
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     tickLength={10}
    *     tickStrokeThickness={0.5}
    *     tickStroke="black" />
    * ```
    */
    get tickLength() {
        return this.i.er;
    }
    set tickLength(v) {
        this.i.er = +v;
    }
    /**
     * Gets or sets the IsDisabled property. If true, the axis will not be rendered.
    *
    * The `isDisabled` property is used to decide if the axis will not be rendered.
    */
    get isDisabled() {
        return this.i.b8;
    }
    set isDisabled(v) {
        this.i.b8 = ensureBool(v);
    }
    /**
     * Gets or sets the IsInverted property.
    *
    * Gets or sets the `isInverted` property.
    */
    get isInverted() {
        return this.i.ca;
    }
    set isInverted(v) {
        this.i.ca = ensureBool(v);
    }
    /**
     * Gets or sets whether to use more advanced heuristics when determining the initial number of labels to render, before resolving collisions, etc.
    *
    * Use `useEnhancedIntervalManagement` property to gets/sets whether to use more advanced heuristics when determining the initial number of labels to render,
    * before resolving collisions, etc.
    */
    get useEnhancedIntervalManagement() {
        return this.i.cq;
    }
    set useEnhancedIntervalManagement(v) {
        this.i.cq = ensureBool(v);
    }
    /**
     * Gets or sets the mininum desired characters to be displayed for horizontal axes when using advanced label heuristics. -1 will attempt to adjust the interval to precisely fit the horizontal labels.
    *
    * The `enhancedIntervalMinimumCharacters` property is used to set the mininum desired characters to be displayed for horizontal axes when using advanced label heuristics.
    */
    get enhancedIntervalMinimumCharacters() {
        return this.i.e0;
    }
    set enhancedIntervalMinimumCharacters(v) {
        this.i.e0 = +v;
    }
    /**
     * Gets or sets the text style to use for axis labels.
    *
    * The `labelTextStyle` property Overrides the style of the text used for the axis labels.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *     <IgrCategoryXAxis name="xAxis"
    * 		label="Year"
    * 		titleTextStyle="12pt Verdana" />
    *     <IgrNumericYAxis  name="yAxis" />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     title="Country"
    *     titleTextColor="gray"
    *     titleTextStyle="12pt Verdana"
    *     titleAngle={90} />
    * ```
    */
    get labelTextStyle() {
        return this.i.ay ? this.i.ay.textStyle : null;
    }
    set labelTextStyle(v) {
        this.ensureLabelSettings();
        this.i.ay.textStyle = v;
    }
    /**
     * The color of the {0}.
    *
    * The `labelTextColor` property Overrides the color of the text used for the axis labels.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *     <IgrCategoryXAxis name="xAxis"
    * 		label="Year"
    * 		labelTextColor="gray"  />
    *     <IgrNumericYAxis  name="yAxis" />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     title="Country"
    *     titleTextColor="gray"
    *     titleTextStyle="12pt Verdana"
    *     titleAngle={90} />
    * ```
    */
    get labelTextColor() {
        return brushToString(this.i.ay ? this.i.ay.textColor : null);
    }
    set labelTextColor(v) {
        this.ensureLabelSettings();
        this.i.ay.textColor = stringToBrush(v);
    }
    /**
     * Gets or sets the location of the {0}.
    *
    * The `Location` property is used for the location.
    */
    get labelLocation() {
        return this.i.ay ? this.i.ay.location : 0;
    }
    set labelLocation(v) {
        this.ensureLabelSettings();
        this.i.ay.location = ensureEnum(AxisLabelsLocation_$type, v);
    }
    /**
     * Gets or sets the visibility of the {0}.
    *
    * The `Visibility` property is used for the visibility of the axis.
    */
    get labelVisibility() {
        return this.i.ay ? this.i.ay.visibility : 0;
    }
    set labelVisibility(v) {
        this.ensureLabelSettings();
        this.i.ay.visibility = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets or sets whether the first label is displayed when the zoom level is set to 1.
    *
    * The `ShowFirstLabel` is used to check whether the first label is displayed when the zoom level is set to 1.
    */
    get labelShowFirstLabel() {
        return this.i.ay ? this.i.ay.showFirstLabel : false;
    }
    set labelShowFirstLabel(v) {
        this.ensureLabelSettings();
        this.i.ay.showFirstLabel = ensureBool(v);
    }
    /**
     * Gets or sets the angle of the {0}.
    *
    * The `Angle` property is used to set the angle of the axis.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *     <IgrCategoryXAxis name="xAxis"
    * 		label="Year"
    * 		titleAngle={90} />
    *     <IgrNumericYAxis  name="yAxis" />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     title="Country"
    *     titleTextColor="gray"
    *     titleTextStyle="12pt Verdana"
    *     titleAngle={90} />
    * ```
    */
    get labelAngle() {
        return this.i.ay ? this.i.ay.angle : NaN;
    }
    set labelAngle(v) {
        this.ensureLabelSettings();
        this.i.ay.angle = +v;
    }
    /**
     * Distance between the axis and the edge of the control.
    *
    * The `Extent` property is used for the extent.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *     <IgrCategoryXAxis name="xAxis"
    * 		label="Year"/>
    *     <IgrNumericYAxis  name="yAxis" />
    *  </IgrDataChart>
    * ```
    */
    get labelExtent() {
        return this.i.ay ? this.i.ay.extent : NaN;
    }
    set labelExtent(v) {
        this.ensureLabelSettings();
        this.i.ay.extent = +v;
    }
    /**
     * Margin applied to the left of the {0}.
    *
    * The `labelLeftMargin` property is used for the left margin of the labels.
    */
    get labelLeftMargin() {
        return this.i.ay ? this.i.ay.leftMargin : NaN;
    }
    set labelLeftMargin(v) {
        this.ensureLabelSettings();
        this.i.ay.leftMargin = +v;
    }
    /**
     * Margin applied to the right of the {0}.
    *
    * The `labelRightMargin` property is used for the right margin of the labels.
    */
    get labelRightMargin() {
        return this.i.ay ? this.i.ay.rightMargin : NaN;
    }
    set labelRightMargin(v) {
        this.ensureLabelSettings();
        this.i.ay.rightMargin = +v;
    }
    /**
     * Margin applied above the {0}.
    *
    * The `labelTopMargin` property is used for the top margin of the labels.
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     label="Country"
    *     labelTextStyle="9pt Verdana"
    *     labelTopMargin={5}
    *     labelTextColor="gray" />
    * ```
    */
    get labelTopMargin() {
        return this.i.ay ? this.i.ay.topMargin : NaN;
    }
    set labelTopMargin(v) {
        this.ensureLabelSettings();
        this.i.ay.topMargin = +v;
    }
    /**
     * Margin applied below the {0}.
    *
    * The `labelBottomMargin` is used to set the bottom margin of the labels.
    */
    get labelBottomMargin() {
        return this.i.ay ? this.i.ay.bottomMargin : NaN;
    }
    set labelBottomMargin(v) {
        this.ensureLabelSettings();
        this.i.ay.bottomMargin = +v;
    }
    /**
     * Gets or sets the horizontal alignment of the {0}.
    *
    * The `HorizontalAlignment` property is used for the horizontal alignment.
    */
    get labelHorizontalAlignment() {
        return this.i.ay ? this.i.ay.horizontalAlignment : 0;
    }
    set labelHorizontalAlignment(v) {
        this.ensureLabelSettings();
        this.i.ay.horizontalAlignment = ensureEnum(HorizontalAlignment_$type, v);
    }
    /**
     * Gets or sets the vertical alignment of the {0}.
    *
    * The `VerticalAlignment` property is used for the vertical alignment of the axis.
    */
    get labelVerticalAlignment() {
        return this.i.ay ? this.i.ay.verticalAlignment : 0;
    }
    set labelVerticalAlignment(v) {
        this.ensureLabelSettings();
        this.i.ay.verticalAlignment = ensureEnum(VerticalAlignment_$type, v);
    }
    ensureLabelSettings() {
        if (this.i.ay) {
            return;
        }
        this.i.ay = new AxisLabelSettings();
        this.i.ay.location = this.i.az();
        this.i.ay.angle = this.i.dn();
        this.i.ay.leftMargin = this.i.dq();
        this.i.ay.rightMargin = this.i.dr();
        this.i.ay.topMargin = this.i.ds();
        this.i.ay.bottomMargin = this.i.dp();
        this.i.ay.horizontalAlignment = this.i.io();
        this.i.ay.verticalAlignment = this.i.jh();
    }
    /**
     * Gets or sets the CrossingAxis property.
    *
    * The `crossingAxis` property is used for CrossingAxis .
    *
    * ```ts
    *  <IgrDataChart
    *     dataSource={this.state.dataSource} >
    *
    *     <IgrNumericXAxis name="xAxis" />
    *     <IgrNumericYAxis name="yAxis"
    * 		 crossingAxisName= "xAxis"
    * 		crossingValue= {700}/>
    *  </IgrDataChart>
    * ```
    */
    get crossingAxis() {
        if (this.i.ai == null) {
            return null;
        }
        if (!this.i.ai.externalObject) {
            let e = IgrAxis._createFromInternal(this.i.ai);
            if (e) {
                e._implementation = this.i.ai;
            }
            this.i.ai.externalObject = e;
        }
        return this.i.ai.externalObject;
    }
    set crossingAxis(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.ai = null : this.i.ai = v.i;
    }
    /**
    * Gets or sets the name to use to resolve crossingAxis from markup.
    */
    get crossingAxisName() {
        return this._crossingAxisName;
    }
    set crossingAxisName(v) {
        this._crossingAxisName = v;
    }
    /**
     * Gets or sets the CrossingValue property.
    *
    * The `crossingValue` property is used for CrossingValue of the axis.
    *
    * ```ts
    *  <IgrDataChart
    *     dataSource={this.state.dataSource} >
    *
    *     <IgrNumericXAxis name="xAxis" />
    *     <IgrNumericYAxis name="yAxis"
    * 		 crossingAxis= "xAxis"
    * 		crossingValue= {700}/>
    *  </IgrDataChart>
    * ```
    */
    get crossingValue() {
        return this.i.e5;
    }
    set crossingValue(v) {
        this.i.e5 = v;
    }
    /**
     * Gets or sets the title position relative to the axis labels.
    */
    get titlePosition() {
        return this.i.be ? this.i.be.position : 0;
    }
    set titlePosition(v) {
        this.ensureTitleSettings();
        this.i.be.position = ensureEnum(AxisTitlePosition_$type, v);
    }
    /**
     * Gets or sets the text style to use for axis labels.
    *
    * The `labelTextStyle` property Overrides the style of the text used for the axis labels.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *     <IgrCategoryXAxis name="xAxis"
    * 		label="Year"
    * 		titleTextStyle="12pt Verdana" />
    *     <IgrNumericYAxis  name="yAxis" />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     title="Country"
    *     titleTextColor="gray"
    *     titleTextStyle="12pt Verdana"
    *     titleAngle={90} />
    * ```
    */
    get titleTextStyle() {
        return this.i.be ? this.i.be.textStyle : null;
    }
    set titleTextStyle(v) {
        this.ensureTitleSettings();
        this.i.be.textStyle = v;
    }
    /**
     * The color of the {0}.
    *
    * The `labelTextColor` property Overrides the color of the text used for the axis labels.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *     <IgrCategoryXAxis name="xAxis"
    * 		label="Year"
    * 		labelTextColor="gray"  />
    *     <IgrNumericYAxis  name="yAxis" />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     title="Country"
    *     titleTextColor="gray"
    *     titleTextStyle="12pt Verdana"
    *     titleAngle={90} />
    * ```
    */
    get titleTextColor() {
        return brushToString(this.i.be ? this.i.be.textColor : null);
    }
    set titleTextColor(v) {
        this.ensureTitleSettings();
        this.i.be.textColor = stringToBrush(v);
    }
    /**
     * Gets or sets the location of the {0}.
    *
    * The `Location` property is used for the location.
    */
    get titleLocation() {
        return this.i.be ? this.i.be.location : 0;
    }
    set titleLocation(v) {
        this.ensureTitleSettings();
        this.i.be.location = ensureEnum(AxisLabelsLocation_$type, v);
    }
    /**
     * Gets or sets the visibility of the {0}.
    *
    * The `Visibility` property is used for the visibility of the axis.
    */
    get titleVisibility() {
        return this.i.be ? this.i.be.visibility : 0;
    }
    set titleVisibility(v) {
        this.ensureTitleSettings();
        this.i.be.visibility = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets or sets whether the first label is displayed when the zoom level is set to 1.
    *
    * The `ShowFirstLabel` is used to check whether the first label is displayed when the zoom level is set to 1.
    */
    get titleShowFirstLabel() {
        return this.i.be ? this.i.be.showFirstLabel : false;
    }
    set titleShowFirstLabel(v) {
        this.ensureTitleSettings();
        this.i.be.showFirstLabel = ensureBool(v);
    }
    /**
     * Gets or sets the angle of the {0}.
    *
    * The `Angle` property is used to set the angle of the axis.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *     <IgrCategoryXAxis name="xAxis"
    * 		label="Year"
    * 		titleAngle={90} />
    *     <IgrNumericYAxis  name="yAxis" />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     title="Country"
    *     titleTextColor="gray"
    *     titleTextStyle="12pt Verdana"
    *     titleAngle={90} />
    * ```
    */
    get titleAngle() {
        return this.i.be ? this.i.be.angle : NaN;
    }
    set titleAngle(v) {
        this.ensureTitleSettings();
        this.i.be.angle = +v;
    }
    /**
     * Distance between the axis and the edge of the control.
    *
    * The `Extent` property is used for the extent.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *     <IgrCategoryXAxis name="xAxis"
    * 		label="Year"/>
    *     <IgrNumericYAxis  name="yAxis" />
    *  </IgrDataChart>
    * ```
    */
    get titleExtent() {
        return this.i.be ? this.i.be.extent : NaN;
    }
    set titleExtent(v) {
        this.ensureTitleSettings();
        this.i.be.extent = +v;
    }
    /**
     * Margin applied to the left of the {0}.
    *
    * The `labelLeftMargin` property is used for the left margin of the labels.
    */
    get titleLeftMargin() {
        return this.i.be ? this.i.be.leftMargin : NaN;
    }
    set titleLeftMargin(v) {
        this.ensureTitleSettings();
        this.i.be.leftMargin = +v;
    }
    /**
     * Margin applied to the right of the {0}.
    *
    * The `labelRightMargin` property is used for the right margin of the labels.
    */
    get titleRightMargin() {
        return this.i.be ? this.i.be.rightMargin : NaN;
    }
    set titleRightMargin(v) {
        this.ensureTitleSettings();
        this.i.be.rightMargin = +v;
    }
    /**
     * Margin applied above the {0}.
    *
    * The `labelTopMargin` property is used for the top margin of the labels.
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     label="Country"
    *     labelTextStyle="9pt Verdana"
    *     labelTopMargin={5}
    *     labelTextColor="gray" />
    * ```
    */
    get titleTopMargin() {
        return this.i.be ? this.i.be.topMargin : NaN;
    }
    set titleTopMargin(v) {
        this.ensureTitleSettings();
        this.i.be.topMargin = +v;
    }
    /**
     * Margin applied below the {0}.
    *
    * The `labelBottomMargin` is used to set the bottom margin of the labels.
    */
    get titleBottomMargin() {
        return this.i.be ? this.i.be.bottomMargin : NaN;
    }
    set titleBottomMargin(v) {
        this.ensureTitleSettings();
        this.i.be.bottomMargin = +v;
    }
    /**
     * Gets or sets the horizontal alignment of the {0}.
    *
    * The `HorizontalAlignment` property is used for the horizontal alignment.
    */
    get titleHorizontalAlignment() {
        return this.i.be ? this.i.be.horizontalAlignment : 0;
    }
    set titleHorizontalAlignment(v) {
        this.ensureTitleSettings();
        this.i.be.horizontalAlignment = ensureEnum(HorizontalAlignment_$type, v);
    }
    /**
     * Gets or sets the vertical alignment of the {0}.
    *
    * The `VerticalAlignment` property is used for the vertical alignment of the axis.
    */
    get titleVerticalAlignment() {
        return this.i.be ? this.i.be.verticalAlignment : 0;
    }
    set titleVerticalAlignment(v) {
        this.ensureTitleSettings();
        this.i.be.verticalAlignment = ensureEnum(VerticalAlignment_$type, v);
    }
    ensureTitleSettings() {
        if (this.i.be) {
            return;
        }
        this.i.be = new TitleSettings();
        this.i.be.location = this.i.a0();
        this.i.be.angle = this.i.dt();
        this.i.be.leftMargin = this.i.dv();
        this.i.be.rightMargin = this.i.dw();
        this.i.be.topMargin = this.i.dx();
        this.i.be.bottomMargin = this.i.du();
        this.i.be.horizontalAlignment = this.i.ip();
        this.i.be.verticalAlignment = this.i.ji();
    }
    /**
     * Gets the current annotations for the axis.
    */
    get annotations() {
        if (this._annotations === null) {
            let coll = new IgrAxisAnnotationCollection();
            let innerColl = this.i.am;
            if (!innerColl) {
                innerColl = new AxisAnnotationCollection_internal();
            }
            this._annotations = coll._fromInner(innerColl);
        }
        return this._annotations;
    }
    set annotations(v) {
        if (this._annotations !== null) {
            this._annotations._setSyncTarget(null);
            this._annotations = null;
        }
        let coll = new IgrAxisAnnotationCollection();
        this._annotations = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(IAxisAnnotation_$type);
        let innerColl = this.i.am;
        if (!innerColl) {
            innerColl = new AxisAnnotationCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._annotations._setSyncTarget(syncColl);
    }
    /**
     * Gets or sets the coercion methods to use when loading data from data sources.
     * Should be specified before setting any member paths, if being used. Setting it later
     * will not cause data to be re-imported into the chart.
    *
    * The	`coercionMethods` methods is to use when loading data from data sources. Should be specified before setting any member paths, if being used.
    * Setting it later will not cause data to be reimported into the chart.
    */
    get coercionMethods() {
        return this.i.coercionMethods;
    }
    set coercionMethods(v) {
        this.i.coercionMethods = v;
    }
    /**
     * Gets or sets whether the series should expect that properties in its items source may be functions that need to be
     * evaluated to yield their value. This defaults to false, as there will be a subtle performance impact to using this feature.
     * This value must be set before assigning an item's source to take effect.
    */
    get expectFunctions() {
        return this.i.expectFunctions;
    }
    set expectFunctions(v) {
        this.i.expectFunctions = ensureBool(v);
    }
    /**
     * Gets or sets the axis label format string.
    *
    * The `label` property is used for label mapping of the axis labels.
    *
    * ```ts
    * <IgrCategoryXAxis name="xAxis"
    *     label="Country"
    *     labelTextStyle="9pt Verdana"
    *     labelTopMargin={5}
    *     labelTextColor="gray" />
    * ```
    */
    get label() {
        return this.i.fa;
    }
    set label(v) {
        this.i.fa = v;
    }
    /**
     * Gets or sets the label format string to use for the label.
    */
    get labelFormat() {
        return this.i.fp;
    }
    set labelFormat(v) {
        this.i.fp = v;
    }
    /**
     * Gets or sets the format specifiers to use with the LabelFormat string.
    */
    get labelFormatSpecifiers() {
        return this.i.ag;
    }
    set labelFormatSpecifiers(v) {
        this.i.ag = v;
    }
    bindAxes(axes) {
        for (let i = 0; i < axes.length; i++) {
            if (this.crossingAxisName && this.crossingAxisName.length > 0 &&
                axes[i].name == this.crossingAxisName) {
                this.crossingAxis = axes[i];
            }
        }
    }
    findByName(name) {
        if (this.crossingAxis && this.crossingAxis.name && this.crossingAxis.name == name) {
            return this.crossingAxis;
        }
        if (this.annotations != null && this.annotations.findByName && this.annotations.findByName(name)) {
            return this.annotations.findByName(name);
        }
        if (this.labelFormatSpecifiers != null && arrayFindByName(this.labelFormatSpecifiers, name)) {
            return arrayFindByName(this.labelFormatSpecifiers, name);
        }
        return null;
    }
    get hasUserValues() {
        return this._hasUserValues;
    }
    __m(propertyName) {
        if (!this._inStyling) {
            this._hasUserValues.add(propertyName);
        }
    }
    _styling(container, component, parent) {
        if (this._inStyling) {
            return;
        }
        this._inStyling = true;
        this._stylingContainer = container;
        this._stylingParent = component;
        let genericPrefix = "";
        let typeName = this.i.$type.name;
        if (typeName.indexOf("Xam") === 0) {
            typeName = typeName.substring(3);
        }
        genericPrefix = toSpinal("Axis");
        let additionalPrefixes = [];
        let prefix = toSpinal(typeName);
        additionalPrefixes.push(prefix + "-");
        let b = this.i.$type.baseType;
        while (b && b.name != "Object" &&
            b.name != "Base" &&
            b.name != "Control" &&
            b.Name != "DependencyObject" &&
            b.Name != "FrameworkElement") {
            typeName = b.name;
            if (typeName.indexOf("Xam") === 0) {
                typeName = typeName.substring(3);
            }
            let basePrefix = toSpinal(typeName);
            additionalPrefixes.push(basePrefix + "-");
            b = b.baseType;
        }
        if (parent) {
            let parentTypeName = parent.i.$type.name;
            if (parentTypeName.indexOf("Xam") === 0) {
                parentTypeName = parentTypeName.substring(3);
            }
            let parentPrefix = toSpinal(parentTypeName);
            additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
            additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
        }
        initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
        if (this.crossingAxis && this.crossingAxis._styling) {
            this.crossingAxis._styling(container, component, this);
        }
        if (this._otherStyling) {
            this._otherStyling(container, component, parent);
        }
        this._inStyling = false;
    }
    /**
 * Renders the axis with no animation.

*/
    renderAxis() {
        this.i.hb();
    }
    /**
     * If using enhanced interval management and precise interval fitting, this will reset the cached maximum label width, and recalculate using the current labels.
    
    */
    resetCachedEnhancedInterval() {
        this.i.he();
    }
    getItemValue(item, memberPathName) {
        let iv = this.i.e7(item, memberPathName);
        return (iv);
    }
    /**
     * Gets the label for a data item.
    
    * @param value  * The unscaled value to get a label for.
    */
    getValueLabel(value) {
        let iv = this.i.fm(value);
        return (iv);
    }
    /**
     * Scales a value from axis space into screen space.
    
    * @param unscaledValue  * The unscaled axis value to scale.
    */
    scaleValue(unscaledValue) {
        let iv = this.i.ee(unscaledValue);
        return (iv);
    }
    /**
     * Occurs when the axis range changes.
    */
    get rangeChanged() {
        return this._rangeChanged;
    }
    set rangeChanged(ev) {
        if (this._rangeChanged_wrapped !== null) {
            this.i.rangeChanged = delegateRemove(this.i.rangeChanged, this._rangeChanged_wrapped);
            this._rangeChanged_wrapped = null;
            this._rangeChanged = null;
        }
        this._rangeChanged = ev;
        this._rangeChanged_wrapped = (o, e) => {
            let outerArgs = new IgrAxisRangeChangedEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeRangeChanged) {
                this.beforeRangeChanged(this, outerArgs);
            }
            if (this._rangeChanged) {
                this._rangeChanged(this, outerArgs);
            }
        };
        this.i.rangeChanged = delegateCombine(this.i.rangeChanged, this._rangeChanged_wrapped);
    }
    /**
     * This event is raised every time a render has been requested from a series.
    */
    get renderRequested() {
        return this._renderRequested;
    }
    set renderRequested(ev) {
        if (this._renderRequested_wrapped !== null) {
            this.i.renderRequested = delegateRemove(this.i.renderRequested, this._renderRequested_wrapped);
            this._renderRequested_wrapped = null;
            this._renderRequested = null;
        }
        this._renderRequested = ev;
        this._renderRequested_wrapped = (o, e) => {
            let outerArgs = new IgrRenderRequestedEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeRenderRequested) {
                this.beforeRenderRequested(this, outerArgs);
            }
            if (this._renderRequested) {
                this._renderRequested(this, outerArgs);
            }
        };
        this.i.renderRequested = delegateCombine(this.i.renderRequested, this._renderRequested_wrapped);
    }
}
//# sourceMappingURL=igr-axis.js.map
