-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { CapableElement, ChartZoomOptions, ResolvedOptions } from "./options"; | ||
export declare const defaultAxisOptions: { | ||
readonly minDomain: number; | ||
readonly maxDomain: number; | ||
readonly minDomainExtent: 0; | ||
readonly maxDomainExtent: number; | ||
}; | ||
export declare const defaultOptions: { | ||
readonly panMouseButtons: number; | ||
readonly touchMinPoints: 1; | ||
}; | ||
export declare class ChartZoom { | ||
options: ResolvedOptions; | ||
private touch; | ||
private mouse; | ||
private wheel; | ||
private scaleUpdated; | ||
constructor(el: CapableElement, options?: ChartZoomOptions); | ||
onScaleUpdated(callback: () => void): void; | ||
/** Call this when scale updated outside */ | ||
update(): void; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { EventDispatcher } from '../utils'; | ||
import { CapableElement, ResolvedOptions } from './options'; | ||
export declare class ChartZoomMouse { | ||
private el; | ||
private options; | ||
scaleUpdated: EventDispatcher<() => void>; | ||
private previousPoint; | ||
constructor(el: CapableElement, options: ResolvedOptions); | ||
private point; | ||
private onMouseMove; | ||
private onMouseDown; | ||
private onMouseUp; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { ScaleLinear } from "d3-scale"; | ||
export declare enum DIRECTION { | ||
UNKNOWN = 0, | ||
X = 1, | ||
Y = 2 | ||
} | ||
export interface Point { | ||
[DIRECTION.X]: number; | ||
[DIRECTION.Y]: number; | ||
} | ||
export interface AxisOptions { | ||
scale: ScaleLinear<number, number>; | ||
minDomain?: number; | ||
maxDomain?: number; | ||
minDomainExtent?: number; | ||
maxDomainExtent?: number; | ||
} | ||
export interface ResolvedAxisOptions { | ||
scale: ScaleLinear<number, number>; | ||
minDomain: number; | ||
maxDomain: number; | ||
minDomainExtent: number; | ||
maxDomainExtent: number; | ||
} | ||
export interface ResolvedOptions { | ||
x?: ResolvedAxisOptions; | ||
y?: ResolvedAxisOptions; | ||
panMouseButtons: number; | ||
touchMinPoints: number; | ||
eventElement: CapableElement; | ||
} | ||
export interface ChartZoomOptions { | ||
x?: AxisOptions; | ||
y?: AxisOptions; | ||
panMouseButtons?: number; | ||
touchMinPoints?: number; | ||
eventElement?: CapableElement; | ||
} | ||
export interface CapableElement extends Element, ElementCSSInlineStyle { | ||
addEventListener<K extends keyof GlobalEventHandlersEventMap>(type: K, listener: (this: CapableElement, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; | ||
} | ||
export declare function dirOptions(options: ResolvedOptions): { | ||
dir: DIRECTION.X | DIRECTION.Y; | ||
op: ResolvedAxisOptions; | ||
}[]; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { EventDispatcher } from '../utils'; | ||
import { CapableElement, ResolvedOptions } from './options'; | ||
export declare class ChartZoomTouch { | ||
private el; | ||
private options; | ||
scaleUpdated: EventDispatcher<() => void>; | ||
private majorDirection; | ||
private previousPoints; | ||
private enabled; | ||
constructor(el: CapableElement, options: ResolvedOptions); | ||
update(): void; | ||
private syncEnabled; | ||
private syncTouchAction; | ||
private calcKB; | ||
private touchPoints; | ||
private dirOptions; | ||
private onTouchStart; | ||
private onTouchEnd; | ||
private onTouchMove; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.