UNPKG

@nativescript-community/ui-chart

Version:

A powerful chart / graph plugin, supporting line, bar, pie, radar, bubble, and candlestick charts as well as scaling, panning and animations.

101 lines (99 loc) 3.12 kB
import { GestureStateEventData, GestureTouchEventData, RotationGestureHandler, TapGestureHandler } from '@nativescript-community/gesturehandler'; import { PieRadarChartBase } from '../charts/PieRadarChartBase'; import { ChartTouchListener } from './ChartTouchListener'; /** * TouchListener for Pie- and RadarChart with handles all * touch interaction. * */ export declare class PieRadarChartTouchListener extends ChartTouchListener<PieRadarChartBase<any, any, any>> { rotationGestureHandler: RotationGestureHandler; tapGestureHandler: TapGestureHandler; /** * the angle where the dragging started */ private mStartAngle; private _velocitySamples; private mDecelerationLastTime; private mDecelerationAngularVelocity; /** * Constructor with initialization parameters. * * @param chart instance of the chart */ TAP_HANDLER_TAG: any; ROTATION_HANDLER_TAG: any; constructor(chart: PieRadarChartBase<any, any, any>); getTapGestureOptions(): { numberOfTaps?: number; maxDurationMs?: number; maxDelayMs?: number; maxDeltaX?: number; maxDeltaY?: number; maxDist?: number; minPointers?: number; enabled?: boolean; shouldCancelWhenOutside?: boolean; waitFor?: number[]; simultaneousHandlers?: number[]; nativeGetterKey?: string; gestureTag: any; }; getRotationGestureOptions(): { enabled?: boolean; shouldCancelWhenOutside?: boolean; waitFor?: number[]; simultaneousHandlers?: number[]; nativeGetterKey?: string; gestureTag: any; }; getOrCreateRotationGestureHandler(): RotationGestureHandler; getOrCreateTapGestureHandler(): TapGestureHandler; setRotation(enabled: boolean): void; setTap(enabled: boolean): void; dispose(): void; init(): void; /** * Returns the correct translation depending on the provided x and y touch * points * * @param x * @param y * @return */ getTrans(x: any, y: any): { x: number; y: number; }; /** * sets the starting angle of the rotation, this is only used by the touch * listener, x and y is the touch position * * @param x * @param y */ setGestureStartAngle(x: any, y: any): void; /** * updates the view rotation depending on the given touch position, also * takes the starting angle into consideration * * @param x * @param y */ updateGestureRotation(x: any, y: any): void; /** * ################ ################ ################ ################ */ /** GESTURE RECOGNITION BELOW */ onRotationGesture(event: GestureStateEventData): void; onRotationGestureTouch(event: GestureTouchEventData): void; onTapGesture(event: GestureStateEventData): void; private resetVelocity; private sampleVelocity; private calculateVelocity; /** * Sets the deceleration-angular-velocity to 0f */ stopDeceleration(): void; computeScroll(): void; }