@tradingaction/core 2.0.12 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -24
- package/README.md +5 -5
- package/lib/CanvasContainer.d.ts +19 -19
- package/lib/CanvasContainer.js +27 -27
- package/lib/Chart.d.ts +32 -32
- package/lib/Chart.js +56 -56
- package/lib/Chart.js.map +1 -1
- package/lib/ChartCanvas.d.ts +235 -235
- package/lib/ChartCanvas.js +770 -770
- package/lib/ChartCanvas.js.map +1 -1
- package/lib/EventCapture.d.ts +131 -131
- package/lib/EventCapture.js +488 -488
- package/lib/GenericChartComponent.d.ts +21 -21
- package/lib/GenericChartComponent.js +74 -74
- package/lib/GenericComponent.d.ts +81 -81
- package/lib/GenericComponent.js +354 -354
- package/lib/GenericComponent.js.map +1 -1
- package/lib/MoreProps.d.ts +16 -16
- package/lib/MoreProps.js +1 -1
- package/lib/index.d.ts +7 -7
- package/lib/index.js +7 -7
- package/lib/useEvent.d.ts +1 -1
- package/lib/useEvent.js +12 -12
- package/lib/utils/ChartDataUtil.d.ts +49 -49
- package/lib/utils/ChartDataUtil.js +204 -204
- package/lib/utils/PureComponent.d.ts +4 -4
- package/lib/utils/PureComponent.js +9 -9
- package/lib/utils/accumulatingWindow.d.ts +15 -15
- package/lib/utils/accumulatingWindow.js +97 -97
- package/lib/utils/barWidth.d.ts +15 -15
- package/lib/utils/barWidth.js +26 -26
- package/lib/utils/closestItem.d.ts +5 -5
- package/lib/utils/closestItem.js +44 -44
- package/lib/utils/evaluator.d.ts +7 -7
- package/lib/utils/evaluator.js +93 -93
- package/lib/utils/identity.d.ts +1 -1
- package/lib/utils/identity.js +1 -1
- package/lib/utils/index.d.ts +46 -46
- package/lib/utils/index.js +125 -125
- package/lib/utils/noop.d.ts +1 -1
- package/lib/utils/noop.js +2 -2
- package/lib/utils/shallowEqual.d.ts +1 -1
- package/lib/utils/shallowEqual.js +21 -21
- package/lib/utils/slidingWindow.d.ts +19 -19
- package/lib/utils/slidingWindow.js +108 -108
- package/lib/utils/strokeDasharray.d.ts +3 -3
- package/lib/utils/strokeDasharray.js +36 -36
- package/lib/utils/zipper.d.ts +7 -7
- package/lib/utils/zipper.js +35 -35
- package/lib/zoom/index.d.ts +1 -1
- package/lib/zoom/index.js +1 -1
- package/lib/zoom/zoomBehavior.d.ts +10 -10
- package/lib/zoom/zoomBehavior.js +17 -17
- package/package.json +2 -2
- package/src/Chart.tsx +2 -2
- package/src/ChartCanvas.tsx +1 -1
- package/src/GenericComponent.tsx +1 -0
package/lib/ChartCanvas.d.ts
CHANGED
|
@@ -1,235 +1,235 @@
|
|
|
1
|
-
import { ScaleContinuousNumeric, ScaleTime } from "d3-scale";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { IZoomAnchorOptions } from "./zoom";
|
|
4
|
-
import { ChartConfig } from "./utils/ChartDataUtil";
|
|
5
|
-
import { ICanvasContexts } from "./CanvasContainer";
|
|
6
|
-
export interface ChartCanvasContextType<TXAxis extends number | Date> {
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
margin: {
|
|
10
|
-
top: number;
|
|
11
|
-
right: number;
|
|
12
|
-
bottom: number;
|
|
13
|
-
left: number;
|
|
14
|
-
};
|
|
15
|
-
chartId: number | string;
|
|
16
|
-
getCanvasContexts?: () => ICanvasContexts | undefined;
|
|
17
|
-
xScale: Function;
|
|
18
|
-
ratio: number;
|
|
19
|
-
xAccessor: (data: any) => TXAxis;
|
|
20
|
-
displayXAccessor: (data: any) => TXAxis;
|
|
21
|
-
xAxisZoom?: (newDomain: any) => void;
|
|
22
|
-
yAxisZoom?: (chartId: string, newDomain: any) => void;
|
|
23
|
-
redraw: () => void;
|
|
24
|
-
plotData: any[];
|
|
25
|
-
fullData: any[];
|
|
26
|
-
chartConfigs: ChartConfig[];
|
|
27
|
-
morePropsDecorator?: () => void;
|
|
28
|
-
generateSubscriptionId?: () => number;
|
|
29
|
-
getMutableState: () => {};
|
|
30
|
-
amIOnTop: (id: string | number) => boolean;
|
|
31
|
-
subscribe: (id: string | number, rest: any) => void;
|
|
32
|
-
unsubscribe: (id: string | number) => void;
|
|
33
|
-
setCursorClass: (className: string | null | undefined) => void;
|
|
34
|
-
}
|
|
35
|
-
export declare const chartCanvasContextDefaultValue: ChartCanvasContextType<number | Date>;
|
|
36
|
-
export declare const ChartCanvasContext: React.Context<ChartCanvasContextType<number | Date>>;
|
|
37
|
-
export interface ChartCanvasProps<TXAxis extends number | Date> {
|
|
38
|
-
readonly clamp?: boolean | ("left" | "right" | "both") | ((domain: [number, number], items: [number, number]) => [number, number]);
|
|
39
|
-
readonly className?: string;
|
|
40
|
-
readonly children?: React.ReactNode;
|
|
41
|
-
readonly data: any[];
|
|
42
|
-
readonly defaultFocus?: boolean;
|
|
43
|
-
readonly disableInteraction?: boolean;
|
|
44
|
-
readonly disablePan?: boolean;
|
|
45
|
-
readonly disableZoom?: boolean;
|
|
46
|
-
readonly displayXAccessor?: (data: any) => TXAxis;
|
|
47
|
-
readonly flipXScale?: boolean;
|
|
48
|
-
readonly height: number;
|
|
49
|
-
readonly margin: {
|
|
50
|
-
bottom: number;
|
|
51
|
-
left: number;
|
|
52
|
-
right: number;
|
|
53
|
-
top: number;
|
|
54
|
-
};
|
|
55
|
-
readonly maintainPointsPerPixelOnResize?: boolean;
|
|
56
|
-
readonly minPointsPerPxThreshold?: number;
|
|
57
|
-
readonly mouseMoveEvent?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Called when panning left past the first data point.
|
|
60
|
-
*/
|
|
61
|
-
readonly onLoadAfter?: (start: TXAxis, end: TXAxis) => void;
|
|
62
|
-
/**
|
|
63
|
-
* Called when panning right past the last data point.
|
|
64
|
-
*/
|
|
65
|
-
readonly onLoadBefore?: (start: TXAxis, end: TXAxis) => void;
|
|
66
|
-
/**
|
|
67
|
-
* Click event handler.
|
|
68
|
-
*/
|
|
69
|
-
readonly onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
70
|
-
/**
|
|
71
|
-
* Double click event handler.
|
|
72
|
-
*/
|
|
73
|
-
readonly onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
74
|
-
readonly padding?: number | {
|
|
75
|
-
bottom: number;
|
|
76
|
-
left: number;
|
|
77
|
-
right: number;
|
|
78
|
-
top: number;
|
|
79
|
-
};
|
|
80
|
-
readonly plotFull?: boolean;
|
|
81
|
-
readonly pointsPerPxThreshold?: number;
|
|
82
|
-
readonly postCalculator?: (plotData: any[]) => any[];
|
|
83
|
-
readonly ratio: number;
|
|
84
|
-
readonly seriesName: string;
|
|
85
|
-
readonly useCrossHairStyleCursor?: boolean;
|
|
86
|
-
readonly width: number;
|
|
87
|
-
readonly xAccessor: (data: any) => TXAxis;
|
|
88
|
-
readonly xExtents: ((data: any[]) => [TXAxis, TXAxis]) | (((data: any[]) => TXAxis) | TXAxis)[];
|
|
89
|
-
readonly xScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>;
|
|
90
|
-
readonly zIndex?: number;
|
|
91
|
-
readonly zoomAnchor?: (options: IZoomAnchorOptions<any, TXAxis>) => TXAxis;
|
|
92
|
-
readonly zoomMultiplier?: number;
|
|
93
|
-
}
|
|
94
|
-
interface ChartCanvasState<TXAxis extends number | Date> {
|
|
95
|
-
lastProps?: ChartCanvasProps<TXAxis>;
|
|
96
|
-
propIteration?: number;
|
|
97
|
-
xAccessor: (data: any) => TXAxis;
|
|
98
|
-
displayXAccessor?: any;
|
|
99
|
-
filterData?: any;
|
|
100
|
-
chartConfigs: ChartConfig[];
|
|
101
|
-
plotData: any[];
|
|
102
|
-
xScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>;
|
|
103
|
-
fullData: any[];
|
|
104
|
-
}
|
|
105
|
-
interface MutableState {
|
|
106
|
-
mouseXY: [number, number];
|
|
107
|
-
currentItem: any;
|
|
108
|
-
currentCharts: string[];
|
|
109
|
-
}
|
|
110
|
-
export declare class ChartCanvas<TXAxis extends number | Date> extends React.Component<ChartCanvasProps<TXAxis>, ChartCanvasState<TXAxis>> {
|
|
111
|
-
static defaultProps: {
|
|
112
|
-
clamp: boolean;
|
|
113
|
-
className: string;
|
|
114
|
-
defaultFocus: boolean;
|
|
115
|
-
disablePan: boolean;
|
|
116
|
-
disableInteraction: boolean;
|
|
117
|
-
disableZoom: boolean;
|
|
118
|
-
flipXScale: boolean;
|
|
119
|
-
maintainPointsPerPixelOnResize: boolean;
|
|
120
|
-
margin: {
|
|
121
|
-
top: number;
|
|
122
|
-
right: number;
|
|
123
|
-
bottom: number;
|
|
124
|
-
left: number;
|
|
125
|
-
};
|
|
126
|
-
minPointsPerPxThreshold: number;
|
|
127
|
-
mouseMoveEvent: boolean;
|
|
128
|
-
postCalculator: (d: any) => any;
|
|
129
|
-
padding: number;
|
|
130
|
-
pointsPerPxThreshold: number;
|
|
131
|
-
useCrossHairStyleCursor: boolean;
|
|
132
|
-
xAccessor: (data: any) => any;
|
|
133
|
-
xExtents: any[];
|
|
134
|
-
zIndex: number;
|
|
135
|
-
zoomAnchor: <TData, TXAxis_1 extends number | Date>(options: IZoomAnchorOptions<TData, TXAxis_1>) => TXAxis_1;
|
|
136
|
-
zoomMultiplier: number;
|
|
137
|
-
};
|
|
138
|
-
private readonly canvasContainerRef;
|
|
139
|
-
private readonly eventCaptureRef;
|
|
140
|
-
private finalPinch?;
|
|
141
|
-
private lastSubscriptionId;
|
|
142
|
-
private mutableState;
|
|
143
|
-
private panInProgress;
|
|
144
|
-
private prevMouseXY?;
|
|
145
|
-
private subscriptions;
|
|
146
|
-
private waitingForPinchZoomAnimationFrame?;
|
|
147
|
-
private waitingForPanAnimationFrame?;
|
|
148
|
-
private waitingForMouseMoveAnimationFrame?;
|
|
149
|
-
private hackyWayToStopPanBeyondBounds__plotData?;
|
|
150
|
-
private hackyWayToStopPanBeyondBounds__domain?;
|
|
151
|
-
constructor(props: ChartCanvasProps<TXAxis>);
|
|
152
|
-
static getDerivedStateFromProps<TXAxis extends number | Date>(props: ChartCanvasProps<TXAxis>, state: ChartCanvasState<TXAxis>): ChartCanvasState<TXAxis>;
|
|
153
|
-
getSnapshotBeforeUpdate(prevProps: Readonly<ChartCanvasProps<TXAxis>>, prevState: Readonly<ChartCanvasState<TXAxis>>): null;
|
|
154
|
-
componentDidUpdate(prevProps: ChartCanvasProps<TXAxis>): void;
|
|
155
|
-
getMutableState: () => MutableState;
|
|
156
|
-
getCanvasContexts: () => ICanvasContexts | undefined;
|
|
157
|
-
generateSubscriptionId: () => number;
|
|
158
|
-
clearBothCanvas(): void;
|
|
159
|
-
clearMouseCanvas(): void;
|
|
160
|
-
clearThreeCanvas(): void;
|
|
161
|
-
subscribe: (id: string | number, rest: any) => void;
|
|
162
|
-
unsubscribe: (id: string | number) => void;
|
|
163
|
-
getAllPanConditions: () => {
|
|
164
|
-
draggable: boolean;
|
|
165
|
-
panEnabled: boolean;
|
|
166
|
-
}[];
|
|
167
|
-
setCursorClass: (className: string | null | undefined) => void;
|
|
168
|
-
amIOnTop: (id: string | number) => boolean;
|
|
169
|
-
handleContextMenu: (mouseXY: number[], e: React.MouseEvent) => void;
|
|
170
|
-
calculateStateForDomain: (newDomain: any) => {
|
|
171
|
-
xScale: ScaleContinuousNumeric<number, number, never> | ScaleTime<number, number, never>;
|
|
172
|
-
plotData: any;
|
|
173
|
-
chartConfigs: ChartConfig[];
|
|
174
|
-
};
|
|
175
|
-
pinchZoomHelper: (initialPinch: any, finalPinch: any) => {
|
|
176
|
-
chartConfigs: ChartConfig[];
|
|
177
|
-
xScale: ScaleContinuousNumeric<number, number, never> | ScaleTime<number, number, never>;
|
|
178
|
-
plotData: any;
|
|
179
|
-
mouseXY: any;
|
|
180
|
-
currentItem: any;
|
|
181
|
-
xAccessor: (data: any) => TXAxis;
|
|
182
|
-
fullData: any[];
|
|
183
|
-
};
|
|
184
|
-
cancelDrag(): void;
|
|
185
|
-
handlePinchZoom: (initialPinch: any, finalPinch: any, e: any) => void;
|
|
186
|
-
handlePinchZoomEnd: (initialPinch: any, e: any) => void;
|
|
187
|
-
handleZoom: (zoomDirection: any, mouseXY: any, e: any) => void;
|
|
188
|
-
xAxisZoom: (newDomain: any) => void;
|
|
189
|
-
yAxisZoom: (chartId: string, newDomain: any) => void;
|
|
190
|
-
triggerEvent(type: any, props?: any, e?: any): void;
|
|
191
|
-
draw: (props: {
|
|
192
|
-
trigger: string;
|
|
193
|
-
} | {
|
|
194
|
-
force: boolean;
|
|
195
|
-
}) => void;
|
|
196
|
-
redraw: () => void;
|
|
197
|
-
panHelper: (mouseXY: [number, number], initialXScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>, { dx, dy }: {
|
|
198
|
-
dx: number;
|
|
199
|
-
dy: number;
|
|
200
|
-
}, chartsToPan: string[]) => {
|
|
201
|
-
xScale: ScaleContinuousNumeric<number, number, never> | ScaleTime<number, number, never>;
|
|
202
|
-
plotData: any;
|
|
203
|
-
chartConfigs: ChartConfig[];
|
|
204
|
-
mouseXY: [number, number];
|
|
205
|
-
currentCharts: any[];
|
|
206
|
-
currentItem: any;
|
|
207
|
-
};
|
|
208
|
-
handlePan: (mousePosition: [number, number], panStartXScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>, dxdy: {
|
|
209
|
-
dx: number;
|
|
210
|
-
dy: number;
|
|
211
|
-
}, chartsToPan: string[], e: React.MouseEvent) => void;
|
|
212
|
-
handlePanEnd: (mousePosition: [number, number], panStartXScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>, dxdy: {
|
|
213
|
-
dx: number;
|
|
214
|
-
dy: number;
|
|
215
|
-
}, chartsToPan: string[], e: React.MouseEvent | React.TouchEvent) => void;
|
|
216
|
-
handleMouseDown: (_: number[], __: string[], e: React.MouseEvent) => void;
|
|
217
|
-
handleMouseEnter: (e: React.MouseEvent) => void;
|
|
218
|
-
handleMouseMove: (mouseXY: [number, number], _: string, e: any) => void;
|
|
219
|
-
handleMouseLeave: (e: any) => void;
|
|
220
|
-
handleDragStart: ({ startPos }: any, e: any) => void;
|
|
221
|
-
handleDrag: ({ startPos, mouseXY }: {
|
|
222
|
-
startPos: [number, number];
|
|
223
|
-
mouseXY: [number, number];
|
|
224
|
-
}, e: React.MouseEvent) => void;
|
|
225
|
-
handleDragEnd: ({ mouseXY }: {
|
|
226
|
-
mouseXY: number[];
|
|
227
|
-
}, e: React.MouseEvent) => void;
|
|
228
|
-
handleClick: (_: number[], e: React.MouseEvent) => void;
|
|
229
|
-
handleDoubleClick: (_: number[], e: React.MouseEvent) => void;
|
|
230
|
-
getContextValues(): ChartCanvasContextType<TXAxis>;
|
|
231
|
-
resetYDomain: (chartId?: string) => void;
|
|
232
|
-
shouldComponentUpdate(): boolean;
|
|
233
|
-
render(): JSX.Element;
|
|
234
|
-
}
|
|
235
|
-
export {};
|
|
1
|
+
import { ScaleContinuousNumeric, ScaleTime } from "d3-scale";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { IZoomAnchorOptions } from "./zoom";
|
|
4
|
+
import { ChartConfig } from "./utils/ChartDataUtil";
|
|
5
|
+
import { ICanvasContexts } from "./CanvasContainer";
|
|
6
|
+
export interface ChartCanvasContextType<TXAxis extends number | Date> {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
margin: {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
};
|
|
15
|
+
chartId: number | string;
|
|
16
|
+
getCanvasContexts?: () => ICanvasContexts | undefined;
|
|
17
|
+
xScale: Function;
|
|
18
|
+
ratio: number;
|
|
19
|
+
xAccessor: (data: any) => TXAxis;
|
|
20
|
+
displayXAccessor: (data: any) => TXAxis;
|
|
21
|
+
xAxisZoom?: (newDomain: any) => void;
|
|
22
|
+
yAxisZoom?: (chartId: string, newDomain: any) => void;
|
|
23
|
+
redraw: () => void;
|
|
24
|
+
plotData: any[];
|
|
25
|
+
fullData: any[];
|
|
26
|
+
chartConfigs: ChartConfig[];
|
|
27
|
+
morePropsDecorator?: () => void;
|
|
28
|
+
generateSubscriptionId?: () => number;
|
|
29
|
+
getMutableState: () => {};
|
|
30
|
+
amIOnTop: (id: string | number) => boolean;
|
|
31
|
+
subscribe: (id: string | number, rest: any) => void;
|
|
32
|
+
unsubscribe: (id: string | number) => void;
|
|
33
|
+
setCursorClass: (className: string | null | undefined) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const chartCanvasContextDefaultValue: ChartCanvasContextType<number | Date>;
|
|
36
|
+
export declare const ChartCanvasContext: React.Context<ChartCanvasContextType<number | Date>>;
|
|
37
|
+
export interface ChartCanvasProps<TXAxis extends number | Date> {
|
|
38
|
+
readonly clamp?: boolean | ("left" | "right" | "both") | ((domain: [number, number], items: [number, number]) => [number, number]);
|
|
39
|
+
readonly className?: string;
|
|
40
|
+
readonly children?: React.ReactNode;
|
|
41
|
+
readonly data: any[];
|
|
42
|
+
readonly defaultFocus?: boolean;
|
|
43
|
+
readonly disableInteraction?: boolean;
|
|
44
|
+
readonly disablePan?: boolean;
|
|
45
|
+
readonly disableZoom?: boolean;
|
|
46
|
+
readonly displayXAccessor?: (data: any) => TXAxis;
|
|
47
|
+
readonly flipXScale?: boolean;
|
|
48
|
+
readonly height: number;
|
|
49
|
+
readonly margin: {
|
|
50
|
+
bottom: number;
|
|
51
|
+
left: number;
|
|
52
|
+
right: number;
|
|
53
|
+
top: number;
|
|
54
|
+
};
|
|
55
|
+
readonly maintainPointsPerPixelOnResize?: boolean;
|
|
56
|
+
readonly minPointsPerPxThreshold?: number;
|
|
57
|
+
readonly mouseMoveEvent?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Called when panning left past the first data point.
|
|
60
|
+
*/
|
|
61
|
+
readonly onLoadAfter?: (start: TXAxis, end: TXAxis) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Called when panning right past the last data point.
|
|
64
|
+
*/
|
|
65
|
+
readonly onLoadBefore?: (start: TXAxis, end: TXAxis) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Click event handler.
|
|
68
|
+
*/
|
|
69
|
+
readonly onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
70
|
+
/**
|
|
71
|
+
* Double click event handler.
|
|
72
|
+
*/
|
|
73
|
+
readonly onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
74
|
+
readonly padding?: number | {
|
|
75
|
+
bottom: number;
|
|
76
|
+
left: number;
|
|
77
|
+
right: number;
|
|
78
|
+
top: number;
|
|
79
|
+
};
|
|
80
|
+
readonly plotFull?: boolean;
|
|
81
|
+
readonly pointsPerPxThreshold?: number;
|
|
82
|
+
readonly postCalculator?: (plotData: any[]) => any[];
|
|
83
|
+
readonly ratio: number;
|
|
84
|
+
readonly seriesName: string;
|
|
85
|
+
readonly useCrossHairStyleCursor?: boolean;
|
|
86
|
+
readonly width: number;
|
|
87
|
+
readonly xAccessor: (data: any) => TXAxis;
|
|
88
|
+
readonly xExtents: ((data: any[]) => [TXAxis, TXAxis]) | (((data: any[]) => TXAxis) | TXAxis)[];
|
|
89
|
+
readonly xScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>;
|
|
90
|
+
readonly zIndex?: number;
|
|
91
|
+
readonly zoomAnchor?: (options: IZoomAnchorOptions<any, TXAxis>) => TXAxis;
|
|
92
|
+
readonly zoomMultiplier?: number;
|
|
93
|
+
}
|
|
94
|
+
interface ChartCanvasState<TXAxis extends number | Date> {
|
|
95
|
+
lastProps?: ChartCanvasProps<TXAxis>;
|
|
96
|
+
propIteration?: number;
|
|
97
|
+
xAccessor: (data: any) => TXAxis;
|
|
98
|
+
displayXAccessor?: any;
|
|
99
|
+
filterData?: any;
|
|
100
|
+
chartConfigs: ChartConfig[];
|
|
101
|
+
plotData: any[];
|
|
102
|
+
xScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>;
|
|
103
|
+
fullData: any[];
|
|
104
|
+
}
|
|
105
|
+
interface MutableState {
|
|
106
|
+
mouseXY: [number, number];
|
|
107
|
+
currentItem: any;
|
|
108
|
+
currentCharts: string[];
|
|
109
|
+
}
|
|
110
|
+
export declare class ChartCanvas<TXAxis extends number | Date> extends React.Component<ChartCanvasProps<TXAxis>, ChartCanvasState<TXAxis>> {
|
|
111
|
+
static defaultProps: {
|
|
112
|
+
clamp: boolean;
|
|
113
|
+
className: string;
|
|
114
|
+
defaultFocus: boolean;
|
|
115
|
+
disablePan: boolean;
|
|
116
|
+
disableInteraction: boolean;
|
|
117
|
+
disableZoom: boolean;
|
|
118
|
+
flipXScale: boolean;
|
|
119
|
+
maintainPointsPerPixelOnResize: boolean;
|
|
120
|
+
margin: {
|
|
121
|
+
top: number;
|
|
122
|
+
right: number;
|
|
123
|
+
bottom: number;
|
|
124
|
+
left: number;
|
|
125
|
+
};
|
|
126
|
+
minPointsPerPxThreshold: number;
|
|
127
|
+
mouseMoveEvent: boolean;
|
|
128
|
+
postCalculator: (d: any) => any;
|
|
129
|
+
padding: number;
|
|
130
|
+
pointsPerPxThreshold: number;
|
|
131
|
+
useCrossHairStyleCursor: boolean;
|
|
132
|
+
xAccessor: (data: any) => any;
|
|
133
|
+
xExtents: any[];
|
|
134
|
+
zIndex: number;
|
|
135
|
+
zoomAnchor: <TData, TXAxis_1 extends number | Date>(options: IZoomAnchorOptions<TData, TXAxis_1>) => TXAxis_1;
|
|
136
|
+
zoomMultiplier: number;
|
|
137
|
+
};
|
|
138
|
+
private readonly canvasContainerRef;
|
|
139
|
+
private readonly eventCaptureRef;
|
|
140
|
+
private finalPinch?;
|
|
141
|
+
private lastSubscriptionId;
|
|
142
|
+
private mutableState;
|
|
143
|
+
private panInProgress;
|
|
144
|
+
private prevMouseXY?;
|
|
145
|
+
private subscriptions;
|
|
146
|
+
private waitingForPinchZoomAnimationFrame?;
|
|
147
|
+
private waitingForPanAnimationFrame?;
|
|
148
|
+
private waitingForMouseMoveAnimationFrame?;
|
|
149
|
+
private hackyWayToStopPanBeyondBounds__plotData?;
|
|
150
|
+
private hackyWayToStopPanBeyondBounds__domain?;
|
|
151
|
+
constructor(props: ChartCanvasProps<TXAxis>);
|
|
152
|
+
static getDerivedStateFromProps<TXAxis extends number | Date>(props: ChartCanvasProps<TXAxis>, state: ChartCanvasState<TXAxis>): ChartCanvasState<TXAxis>;
|
|
153
|
+
getSnapshotBeforeUpdate(prevProps: Readonly<ChartCanvasProps<TXAxis>>, prevState: Readonly<ChartCanvasState<TXAxis>>): null;
|
|
154
|
+
componentDidUpdate(prevProps: ChartCanvasProps<TXAxis>): void;
|
|
155
|
+
getMutableState: () => MutableState;
|
|
156
|
+
getCanvasContexts: () => ICanvasContexts | undefined;
|
|
157
|
+
generateSubscriptionId: () => number;
|
|
158
|
+
clearBothCanvas(): void;
|
|
159
|
+
clearMouseCanvas(): void;
|
|
160
|
+
clearThreeCanvas(): void;
|
|
161
|
+
subscribe: (id: string | number, rest: any) => void;
|
|
162
|
+
unsubscribe: (id: string | number) => void;
|
|
163
|
+
getAllPanConditions: () => {
|
|
164
|
+
draggable: boolean;
|
|
165
|
+
panEnabled: boolean;
|
|
166
|
+
}[];
|
|
167
|
+
setCursorClass: (className: string | null | undefined) => void;
|
|
168
|
+
amIOnTop: (id: string | number) => boolean;
|
|
169
|
+
handleContextMenu: (mouseXY: number[], e: React.MouseEvent) => void;
|
|
170
|
+
calculateStateForDomain: (newDomain: any) => {
|
|
171
|
+
xScale: ScaleContinuousNumeric<number, number, never> | ScaleTime<number, number, never>;
|
|
172
|
+
plotData: any;
|
|
173
|
+
chartConfigs: ChartConfig[];
|
|
174
|
+
};
|
|
175
|
+
pinchZoomHelper: (initialPinch: any, finalPinch: any) => {
|
|
176
|
+
chartConfigs: ChartConfig[];
|
|
177
|
+
xScale: ScaleContinuousNumeric<number, number, never> | ScaleTime<number, number, never>;
|
|
178
|
+
plotData: any;
|
|
179
|
+
mouseXY: any;
|
|
180
|
+
currentItem: any;
|
|
181
|
+
xAccessor: (data: any) => TXAxis;
|
|
182
|
+
fullData: any[];
|
|
183
|
+
};
|
|
184
|
+
cancelDrag(): void;
|
|
185
|
+
handlePinchZoom: (initialPinch: any, finalPinch: any, e: any) => void;
|
|
186
|
+
handlePinchZoomEnd: (initialPinch: any, e: any) => void;
|
|
187
|
+
handleZoom: (zoomDirection: any, mouseXY: any, e: any) => void;
|
|
188
|
+
xAxisZoom: (newDomain: any) => void;
|
|
189
|
+
yAxisZoom: (chartId: string, newDomain: any) => void;
|
|
190
|
+
triggerEvent(type: any, props?: any, e?: any): void;
|
|
191
|
+
draw: (props: {
|
|
192
|
+
trigger: string;
|
|
193
|
+
} | {
|
|
194
|
+
force: boolean;
|
|
195
|
+
}) => void;
|
|
196
|
+
redraw: () => void;
|
|
197
|
+
panHelper: (mouseXY: [number, number], initialXScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>, { dx, dy }: {
|
|
198
|
+
dx: number;
|
|
199
|
+
dy: number;
|
|
200
|
+
}, chartsToPan: string[]) => {
|
|
201
|
+
xScale: ScaleContinuousNumeric<number, number, never> | ScaleTime<number, number, never>;
|
|
202
|
+
plotData: any;
|
|
203
|
+
chartConfigs: ChartConfig[];
|
|
204
|
+
mouseXY: [number, number];
|
|
205
|
+
currentCharts: any[];
|
|
206
|
+
currentItem: any;
|
|
207
|
+
};
|
|
208
|
+
handlePan: (mousePosition: [number, number], panStartXScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>, dxdy: {
|
|
209
|
+
dx: number;
|
|
210
|
+
dy: number;
|
|
211
|
+
}, chartsToPan: string[], e: React.MouseEvent) => void;
|
|
212
|
+
handlePanEnd: (mousePosition: [number, number], panStartXScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number>, dxdy: {
|
|
213
|
+
dx: number;
|
|
214
|
+
dy: number;
|
|
215
|
+
}, chartsToPan: string[], e: React.MouseEvent | React.TouchEvent) => void;
|
|
216
|
+
handleMouseDown: (_: number[], __: string[], e: React.MouseEvent) => void;
|
|
217
|
+
handleMouseEnter: (e: React.MouseEvent) => void;
|
|
218
|
+
handleMouseMove: (mouseXY: [number, number], _: string, e: any) => void;
|
|
219
|
+
handleMouseLeave: (e: any) => void;
|
|
220
|
+
handleDragStart: ({ startPos }: any, e: any) => void;
|
|
221
|
+
handleDrag: ({ startPos, mouseXY }: {
|
|
222
|
+
startPos: [number, number];
|
|
223
|
+
mouseXY: [number, number];
|
|
224
|
+
}, e: React.MouseEvent) => void;
|
|
225
|
+
handleDragEnd: ({ mouseXY }: {
|
|
226
|
+
mouseXY: number[];
|
|
227
|
+
}, e: React.MouseEvent) => void;
|
|
228
|
+
handleClick: (_: number[], e: React.MouseEvent) => void;
|
|
229
|
+
handleDoubleClick: (_: number[], e: React.MouseEvent) => void;
|
|
230
|
+
getContextValues(): ChartCanvasContextType<TXAxis>;
|
|
231
|
+
resetYDomain: (chartId?: string) => void;
|
|
232
|
+
shouldComponentUpdate(): boolean;
|
|
233
|
+
render(): JSX.Element;
|
|
234
|
+
}
|
|
235
|
+
export {};
|