scichart
Version:
Fast WebGL JavaScript Charting Library and Framework
53 lines (52 loc) • 3.12 kB
TypeScript
import { NumberRange } from "../../../Core/NumberRange";
import { TSciChart } from "../../../types/TSciChart";
import { TSciChart3D } from "../../../types/TSciChart3D";
import { TickProvider } from "./TickProvider";
/**
* @summary The NumericTickProvider is a {@link TickProvider} implementation for Numeric 2D or 3D Axis.
* @description TickProviders are responsible for calculating the interval between major and minor gridlines, ticks and labels.
*
* * The method {@link getMajorTicks} returns an array of major ticks (data-values values where SciChart will place labels and major gridlines.
* * The method {@link getMinorTicks} returns an array of minor ticks (data-values values where SciChart will place minor gridlines.
* * The method {@link isParamsValid} performs some sanity checks.
* * The method {@link calculateTicks} performs the actual calculation
*
* Override these methods to create custom implementations of Tick intervals in SciChart
* @remarks
* See also {@link TickProvider} for the base implementation.
*/
export declare class NumericTickProvider extends TickProvider {
private readonly minDeltaValue;
private webAssemblyContext;
/**
* Creates an instance of a NumericTickProvider
* @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} or {@link TSciChart | SciChart 3D WebAssembly Context}
* containing native methods and access to our WebGL2 WebAssembly Rendering Engine
*/
constructor(webAssemblyContext: TSciChart | TSciChart3D);
/**
* @inheritDoc
*/
getMinorTicks(minorDelta: number, majorDelta: number, visibleRange: NumberRange): number[];
/**
* @inheritDoc
*/
getMajorTicks(minorDelta: number, majorDelta: number, visibleRange: NumberRange): number[];
/**
* @summary Performs sanity checks to see if parameters are valid.
* @description If this method returns false, then we should not process or compute major/minor gridlines, but instead should
* return empty array ```[]``` in {@link getMajorTicks} / {@link getMinorTicks}
* @param visibleRange The current {@link AxisCore.visibleRange} which is the minimum / maximum range visible on the Axis.
* @param deltaRange The current {@link AxisCore.minorDelta} and {@link AxisCore.majorDelta} which is the difference between minor
* and major gridlines requested by the {@link AxisCore | Axis}
*/
protected isParamsValid(visibleRange: NumberRange, deltaRange: NumberRange): boolean;
/**
* @summary Performs the Numeric tick calculation
* @param visibleRange The current {@link AxisCore.visibleRange} which is the minimum / maximum range visible on the Axis.
* @param delta The delta we are calculating for (could be major or minor delta)
* @param majorDelta The current {@link AxisCore.majorDelta} which is the difference between major
* gridlines requested by the {@link AxisCore | Axis}
*/
protected calculateTicks(visibleRange: NumberRange, delta: number, majorDelta: number): number[];
}