/// import { D3Scale, NumberLike, ScaleInput } from '@vx/scale'; import { TextProps } from '@vx/text/lib/Text'; import Orientation from './constants/orientation'; export declare type AxisScaleOutput = number | NumberLike | undefined; /** A catch-all type for scales that are compatible with axis */ export declare type AxisScale = D3Scale; declare type FormattedValue = string | undefined; export declare type TickFormatter = (value: T, index: number, values: { value: T; index: number; }[]) => FormattedValue; export declare type TickLabelProps = (value: T, index: number) => Partial; export declare type TickRendererProps = Partial & { x: number; y: number; formattedValue: FormattedValue; }; export declare type TicksRendererProps = { tickLabelProps: Partial[]; } & Pick, 'hideTicks' | 'horizontal' | 'orientation' | 'scale' | 'tickClassName' | 'tickComponent' | 'tickStroke' | 'tickTransform' | 'ticks'>; export declare type CommonProps = { /** The class name applied to the axis line element. */ axisLineClassName?: string; /** If true, will hide the axis line. */ hideAxisLine?: boolean; /** If true, will hide the ticks (but not the tick labels). */ hideTicks?: boolean; /** If true, will hide the '0' value tick and tick label. */ hideZero?: boolean; /** The text for the axis label. */ label?: string; /** The class name applied to the axis label text element. */ labelClassName?: string; /** Pixel offset of the axis label (does not include tick label font size, which is accounted for automatically) */ labelOffset?: number; /** Props applied to the axis label component. */ labelProps?: Partial; /** The number of ticks wanted for the axis (note this is approximate) */ numTicks?: number; /** Placement of the axis */ orientation?: Orientation; /** Pixel padding to apply to both sides of the axis. */ rangePadding?: number; /** The color for the stroke of the lines. */ stroke?: string; /** The pixel value for the width of the lines. */ strokeWidth?: number; /** The pattern of dashes in the stroke. */ strokeDasharray?: string; /** The class name applied to each tick group. */ tickClassName?: string; /** Override the component used to render tick labels (instead of from @vx/text). */ tickComponent?: (tickRendererProps: TickRendererProps) => React.ReactNode; /** Override the component used to render all tick lines and labels. */ ticksComponent?: (tickRendererProps: TicksRendererProps) => React.ReactNode; /** A [d3 formatter](https://github.com/d3/d3-scale/blob/master/README.md#continuous_tickFormat) for the tick text. */ tickFormat?: TickFormatter>; /** A function that returns props for a given tick label. */ tickLabelProps?: TickLabelProps>; /** The length of the tick lines. */ tickLength?: number; /** The color for the tick's stroke value. */ tickStroke?: string; /** A custom SVG transform value to be applied to each tick group. */ tickTransform?: string; }; interface Point { x: number; y: number; } export declare type ComputedTick = { value: ScaleInput; index: number; from: Point; to: Point; formattedValue: FormattedValue; }; export declare type AxisRendererProps = CommonProps & { /** Start point of the axis line */ axisFromPoint: Point; /** End point of the axis line */ axisToPoint: Point; /** Whether this axis is horizontal */ horizontal: boolean; /** A [d3](https://github.com/d3/d3-scale) or [vx](https://github.com/hshoff/vx/tree/master/packages/vx-scale) scale function. */ scale: Scale; /** Function to compute tick position along the axis from tick value */ tickPosition: (value: ScaleInput) => AxisScaleOutput; /** Axis coordinate sign, -1 for left or top orientation. */ tickSign: 1 | -1; /** Computed ticks with positions and formatted value */ ticks: ComputedTick[]; }; export declare type SharedAxisProps = CommonProps & { /** The class name applied to the outermost axis group element. */ axisClassName?: string; /** A left pixel offset applied to the entire axis. */ left?: number; /** A [d3](https://github.com/d3/d3-scale) or [vx](https://github.com/hshoff/vx/tree/master/packages/vx-scale) scale function. */ scale: Scale; /** An array of values that determine the number and values of the ticks. Falls back to `scale.ticks()` or `.domain()`. */ tickValues?: ScaleInput[]; /** A top pixel offset applied to the entire axis. */ top?: number; /** For more control over rendering or to add event handlers to datum, pass a function as children. */ children?: (renderProps: AxisRendererProps) => React.ReactNode; }; export {}; //# sourceMappingURL=types.d.ts.map