import { AxisOptions } from "../../options"; import Konva from "konva"; import { ChartRenderableItem } from "../chart-renderable-item"; import { Chart } from "../chart"; import { MajorTicksGenerator, MinorTicksGenerator, Tick } from "./ticks"; import { DataTransformation, NumericPoint, Range, Size } from '../../geometry'; import { AxisOrientation } from "./axis-orientation"; import { LabelsLayout } from "./labels-layout"; export declare abstract class AxisBase extends ChartRenderableItem { /** * Vertical multiplier, which must be used for defining an offset for fillText canvas method. * Each text must be shifted by this constant in top direction (Y axis). */ static readonly textVerticalOffsetMultiplier: number; protected location: NumericPoint; protected range: Range; protected initialWidth: number | undefined; protected initialHeight: number | undefined; protected orientation: AxisOrientation; protected options: AxisOptionsType; private dataTransformation; protected _size: Size; get size(): Size; private borderShape; private ticksShape; protected majorTicks: Tick[]; protected minorTicks?: Tick[]; protected majorTicksLabelsSizes?: Size[]; protected majorTicksScreenCoords: number[]; protected minorTicksScreenCoords: number[]; protected readonly majorTicksGenerator: MajorTicksGenerator; protected readonly minorTicksGenerator?: MinorTicksGenerator; protected layerId: string; static readonly generateMajorTicksMaxAttempts = 12; protected constructor(location: NumericPoint, orientation: AxisOrientation, range: Range, dataTransformation: DataTransformation, options: AxisOptionsType, width?: number, height?: number); protected renderHorizontalMinorTicks(context: Konva.Context): void; protected renderVerticalMinorTicks(context: Konva.Context): void; protected validateAxisInitialWidth(): void; protected validateAxisInitialHeight(): void; protected abstract createMajorTicksGenerator(): MajorTicksGenerator; protected abstract createMinorTicksGenerator(): MinorTicksGenerator | undefined; placeOnChart(chart?: Chart): void; /** * Returns axis size * @returns {Size} axis size. */ getSize(): Size; /** * Returns axis orientation * @returns {AxisOrientation} axis orientation. */ getOrientation(): AxisOrientation; /** * Returns tick's screen coordinate * @returns {number} Tick's screen coordinate. */ protected getTickScreenCoordinate(tick: Tick, screenWidth: number, screenHeight: number, range: Range): number; /** * Converts value from axis inits to number. * */ abstract axisValueToNumber(tickValue: DataType): number; /** * Measures labels sizes for an array of major ticks * @param { Array} ticks - Array of ticks * @returns {Array} * */ protected measureLabelsSizesForMajorTicks(ticks: Array>): Array; /** * Measures label's size for specified major tick. * @param {string} tick - Tick for which to generate label size. * @returns {Size} Label's size. */ protected measureLabelSizeForMajorTick(tick: Tick): Size; /** * Generates label's size for specified label. * @param {string} label - Label to measure. * @returns {Size} Label's size. */ protected measureLabelSize(label: string): Size; /** * Updates axis state. * @param {Point} location - axis location on chart. * @param {Range} range - axis data range. * @param {number} width - axis width. May be undefined (for vertical axis only) * @param {number} height - axis height. May be undefined (for horizontal axis only) */ update(location: NumericPoint, range: Range, width?: number, height?: number): void; protected cleanMajorTicks(): void; protected updateMajorTicks(range: Range, size: Size): void; protected updateMinorTicks(range: Range): void; protected updateTicksScreenCoords(location: NumericPoint, range: Range, size: Size): void; protected updateAxisSize(): void; /** * Generates ticks for specified axis. * @param {Range} range - axis range. * @param {Size} size - axis size; * @returns {Array} * */ protected generateMajorTicks(range: Range, size: Size): Array>; /** * Evaluates labels layout for the axis (whether they overlap with each other or are too close). * Returns the result of labels layout evaluation. * @param {Size} axisSize - axis size; * @param {Array} ticksLabelsSizes - sizes of ticks labels; * @param {Array} ticks - ticks. * @param {Range} range - axis range. * @returns {LabelsLayout} * */ protected evaluateLabelsLayout(axisSize: Size, ticksLabelsSizes: Array, ticks: Array>, range: Range): LabelsLayout; /** * Returns major ticks screen coordinates * @returns {number} Major ticks screen coordinates * */ getMajorTicksScreenCoords(): number[]; private updateBorderShape; protected updateTicksShape(): void; } //# sourceMappingURL=axis-base.d.ts.map