/** @jsxImportSource react */ import { BoundedObject, BoundedObjectConfig, BoundedObjectInstance } from "../../svg/BoundedObject"; import { RenderingContext } from "../../ui/RenderingContext"; import { Instance } from "../../ui/Instance"; import { BooleanProp, StyleProp, ClassProp, Prop } from "../../ui/Prop"; export interface AxisConfig extends BoundedObjectConfig { /** Set to `true` for vertical axes. */ vertical?: boolean; /** Used as a secondary axis. Displayed at the top/right. */ secondary?: boolean; /** When set to `true`, the values are displayed in descending order. */ inverted?: BooleanProp; /** When set to `true`, rendering of visual elements of the axis, such as ticks and labels, is skipped, but their function is preserved. */ hidden?: boolean; /** Size of the axis tick line. Defaults to 3. */ tickSize?: number; /** Distance between ticks and the axis. Default is 0. Use negative values for offset to make ticks appear on both sides of the axis. */ tickOffset?: number; /** The smallest distance between two ticks on the axis. Defaults to 25. */ minTickDistance?: number; /** The smallest distance between two labels on the vertical axis. Defaults to 40. */ minLabelDistanceVertical?: number; /** The smallest distance between two labels on the horizontal axis. Defaults to 50. */ minLabelDistanceHorizontal?: number; /** Distance between labels and the axis. Defaults to 10. */ labelOffset?: number | string; /** Label rotation angle in degrees. */ labelRotation?: Prop; /** Label text-anchor value. Allowed values are start, end and middle. Default value is set based on the value of vertical and secondary flags. */ labelAnchor?: "start" | "end" | "middle" | "auto"; /** Horizontal text offset. */ labelDx?: number | string; /** Vertical text offset which can be used for vertical alignment. */ labelDy?: number | string; /** Set to `true` to break long labels into multiple lines. Default value is `false`. Text is split at space characters. See also `labelMaxLineLength` and `labelLineCountDyFactor`. */ labelWrap?: boolean; /** * Used for vertical adjustment of multi-line labels. Default value is `auto` which means * that value is initialized based on axis configuration. Value `0` means that label will grow towards * the bottom of the screen. Value `-1` will make labels to grow towards the top of the screen. * `-0.5` will make labels vertically centered. */ labelLineCountDyFactor?: number | string; /** * Used for vertical adjustment of multi-line labels. Default value is 1 which means * that labels are stacked without any space between them. Value of 1.4 will add 40% of the label height as a space between labels. */ labelLineHeight?: number | string; /** If `labelWrap` is on, this number is used as a measure to split labels into multiple lines. Default value is `10`. */ labelMaxLineLength?: number; /** Set to true to hide the axis labels. */ hideLabels?: boolean; /** Set to true to hide the axis line. */ hideLine?: boolean; /** Set to true to hide the axis ticks. */ hideTicks?: boolean; /** Additional CSS style to be applied to the axis line. */ lineStyle?: StyleProp; /** Additional CSS style to be applied to the axis ticks. */ tickStyle?: StyleProp; /** Additional CSS style to be applied to the axis labels. */ labelStyle?: StyleProp; /** Additional CSS class to be applied to the axis line. */ lineClass?: ClassProp; /** Additional CSS class to be applied to the axis ticks. */ tickClass?: ClassProp; /** Additional CSS class to be applied to the axis labels. */ labelClass?: ClassProp; onMeasured?: (info: any, instance: Instance) => void; /** A function used to create a formatter function for axis labels. */ onCreateLabelFormatter?: string | ((context: any, instance: Instance) => (formattedValue: string, value: any, info: { tickIndex: number; serieIndex: number; }) => { text: string; style?: any; className?: string; }[]); /** Distance between the even labels and the axis. */ alternateLabelOffset?: number | string; useGridlineTicks?: boolean; } export interface AxisInstance extends BoundedObjectInstance { calculator: any; labelFormatter?: any; cached: { axis?: any; }; } export declare class Axis extends BoundedObject { baseClass: string; vertical: boolean; secondary: boolean; inverted: boolean; hidden: boolean; hideLabels: boolean; hideTicks: boolean; hideLine: boolean; tickSize: number; tickOffset: number; minTickDistance: number; minLabelDistance: number; minLabelDistanceVertical: number; minLabelDistanceHorizontal: number; labelOffset: number; alternateLabelOffset: number | null; labelRotation: number; labelAnchor: string; labelDx: number | string; labelDy: number | string; labelWrap: boolean; labelLineCountDyFactor: number | string; labelLineHeight: number; labelMaxLineLength: number; lineStyle: any; tickStyle: any; labelStyle: any; useGridlineTicks: boolean; onCreateLabelFormatter: AxisConfig["onCreateLabelFormatter"]; onMeasured: AxisConfig["onMeasured"]; constructor(config?: AxisConfig); init(): void; declareData(...args: any[]): void; prepareData(context: RenderingContext, instance: AxisInstance): void; report(context: RenderingContext, instance: AxisInstance): any; reportData(context: RenderingContext, instance: AxisInstance): void; renderTicksAndLabels(context: RenderingContext, instance: AxisInstance, valueFormatter: (v: any) => string, minLabelDistance: number): any; wrapLines(str: any): { text: string; style?: any; className?: string; }[] | null; renderLabels(lines: { text: string; style?: any; className?: string; data?: Record; }[], x: number, dy: number | string, dx: number | string, offsetClass: string): React.ReactNode[]; prepare(context: RenderingContext, instance: AxisInstance): void; cleanup(context: RenderingContext, instance: AxisInstance): void; } //# sourceMappingURL=Axis.d.ts.map