victory-cursor-container 36.9.2-next.3 → 37.0.0
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/CHANGELOG.md +12 -14
- package/README.md +2 -2
- package/dist/victory-cursor-container.js +1501 -2069
- package/dist/victory-cursor-container.min.js +1 -1
- package/es/cursor-helpers.d.ts +32 -32
- package/es/cursor-helpers.js +78 -110
- package/es/index.d.ts +2 -2
- package/es/victory-cursor-container.d.ts +133 -133
- package/es/victory-cursor-container.js +138 -205
- package/lib/cursor-helpers.d.ts +32 -32
- package/lib/cursor-helpers.js +79 -118
- package/lib/index.d.ts +2 -2
- package/lib/index.js +0 -4
- package/lib/victory-cursor-container.d.ts +133 -133
- package/lib/victory-cursor-container.js +138 -215
- package/package.json +6 -3
- package/src/victory-cursor-container.tsx +165 -186
package/lib/cursor-helpers.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
|
-
import { Selection } from "victory-core";
|
|
3
|
-
declare class CursorHelpersClass {
|
|
4
|
-
getDimension(props: any): any;
|
|
5
|
-
withinBounds(point: any, bounds: any): boolean;
|
|
6
|
-
private handleMouseMove;
|
|
7
|
-
onMouseMove: import("lodash").DebouncedFunc<(evt: any, targetProps: any) => {
|
|
8
|
-
target: string;
|
|
9
|
-
eventKey: string;
|
|
10
|
-
mutation: () => {
|
|
11
|
-
cursorValue: Selection.SVGCoordinateType | null;
|
|
12
|
-
parentSVG: any;
|
|
13
|
-
};
|
|
14
|
-
}[]>;
|
|
15
|
-
onMouseLeave: (evt: any, targetProps: any) => {
|
|
16
|
-
target: string;
|
|
17
|
-
eventKey: string;
|
|
18
|
-
mutation: () => {
|
|
19
|
-
cursorValue: Selection.SVGCoordinateType | null;
|
|
20
|
-
parentSVG: any;
|
|
21
|
-
};
|
|
22
|
-
}[];
|
|
23
|
-
onTouchEnd: (evt: any, targetProps: any) => {
|
|
24
|
-
target: string;
|
|
25
|
-
eventKey: string;
|
|
26
|
-
mutation: () => {
|
|
27
|
-
cursorValue: null;
|
|
28
|
-
};
|
|
29
|
-
}[];
|
|
30
|
-
}
|
|
31
|
-
export declare const CursorHelpers: CursorHelpersClass;
|
|
32
|
-
export {};
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { Selection } from "victory-core";
|
|
3
|
+
declare class CursorHelpersClass {
|
|
4
|
+
getDimension(props: any): any;
|
|
5
|
+
withinBounds(point: any, bounds: any): boolean;
|
|
6
|
+
private handleMouseMove;
|
|
7
|
+
onMouseMove: import("lodash").DebouncedFunc<(evt: any, targetProps: any) => {
|
|
8
|
+
target: string;
|
|
9
|
+
eventKey: string;
|
|
10
|
+
mutation: () => {
|
|
11
|
+
cursorValue: Selection.SVGCoordinateType | null;
|
|
12
|
+
parentSVG: any;
|
|
13
|
+
};
|
|
14
|
+
}[]>;
|
|
15
|
+
onMouseLeave: (evt: any, targetProps: any) => {
|
|
16
|
+
target: string;
|
|
17
|
+
eventKey: string;
|
|
18
|
+
mutation: () => {
|
|
19
|
+
cursorValue: Selection.SVGCoordinateType | null;
|
|
20
|
+
parentSVG: any;
|
|
21
|
+
};
|
|
22
|
+
}[];
|
|
23
|
+
onTouchEnd: (evt: any, targetProps: any) => {
|
|
24
|
+
target: string;
|
|
25
|
+
eventKey: string;
|
|
26
|
+
mutation: () => {
|
|
27
|
+
cursorValue: null;
|
|
28
|
+
};
|
|
29
|
+
}[];
|
|
30
|
+
}
|
|
31
|
+
export declare const CursorHelpers: CursorHelpersClass;
|
|
32
|
+
export {};
|
|
33
33
|
//# sourceMappingURL=cursor-helpers.d.ts.map
|
package/lib/cursor-helpers.js
CHANGED
|
@@ -4,129 +4,92 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CursorHelpers = void 0;
|
|
7
|
-
|
|
8
7
|
var _throttle2 = _interopRequireDefault(require("lodash/throttle"));
|
|
9
|
-
|
|
10
8
|
var _victoryCore = require("victory-core");
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _this = this;
|
|
25
|
-
|
|
26
|
-
_classCallCheck(this, CursorHelpersClass);
|
|
27
|
-
|
|
28
|
-
this.handleMouseMove = function (evt, targetProps) {
|
|
29
|
-
var onCursorChange = targetProps.onCursorChange,
|
|
30
|
-
domain = targetProps.domain;
|
|
31
|
-
|
|
32
|
-
var cursorDimension = _this.getDimension(targetProps);
|
|
33
|
-
|
|
34
|
-
var parentSVG = targetProps.parentSVG || _victoryCore.Selection.getParentSVG(evt);
|
|
35
|
-
|
|
36
|
-
var cursorSVGPosition = _victoryCore.Selection.getSVGEventCoordinates(evt, parentSVG);
|
|
37
|
-
|
|
38
|
-
var cursorValue = _victoryCore.Selection.getDataCoordinates(targetProps, targetProps.scale, cursorSVGPosition.x, cursorSVGPosition.y);
|
|
39
|
-
|
|
40
|
-
var inBounds = _this.withinBounds(cursorValue, {
|
|
41
|
-
x1: domain.x[0],
|
|
42
|
-
x2: domain.x[1],
|
|
43
|
-
y1: domain.y[0],
|
|
44
|
-
y2: domain.y[1]
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
if (!inBounds) {
|
|
48
|
-
cursorValue = null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (_victoryCore.Helpers.isFunction(onCursorChange)) {
|
|
52
|
-
if (cursorValue) {
|
|
53
|
-
var value = cursorDimension ? cursorValue[cursorDimension] : cursorValue;
|
|
54
|
-
onCursorChange(value, targetProps);
|
|
55
|
-
} else if (cursorValue !== targetProps.cursorValue) {
|
|
56
|
-
onCursorChange(targetProps.defaultCursorValue || null, targetProps);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return [{
|
|
61
|
-
target: "parent",
|
|
62
|
-
eventKey: "parent",
|
|
63
|
-
mutation: function () {
|
|
64
|
-
return {
|
|
65
|
-
cursorValue: cursorValue,
|
|
66
|
-
parentSVG: parentSVG
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
}];
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
this.onMouseMove = (0, _throttle2.default)(this.handleMouseMove, ON_MOUSE_MOVE_THROTTLE_MS, {
|
|
73
|
-
leading: true,
|
|
74
|
-
trailing: false
|
|
75
|
-
});
|
|
76
|
-
this.onMouseLeave = this.handleMouseMove;
|
|
77
|
-
|
|
78
|
-
this.onTouchEnd = function (evt, targetProps) {
|
|
79
|
-
var onCursorChange = targetProps.onCursorChange;
|
|
80
|
-
|
|
81
|
-
if (_victoryCore.Helpers.isFunction(targetProps.onCursorChange)) {
|
|
82
|
-
onCursorChange(null, targetProps);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return [{
|
|
86
|
-
target: "parent",
|
|
87
|
-
eventKey: "parent",
|
|
88
|
-
mutation: function () {
|
|
89
|
-
return {
|
|
90
|
-
cursorValue: null
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}];
|
|
94
|
-
};
|
|
10
|
+
const ON_MOUSE_MOVE_THROTTLE_MS = 16;
|
|
11
|
+
class CursorHelpersClass {
|
|
12
|
+
getDimension(props) {
|
|
13
|
+
const {
|
|
14
|
+
horizontal,
|
|
15
|
+
cursorDimension
|
|
16
|
+
} = props;
|
|
17
|
+
if (!horizontal || !cursorDimension) {
|
|
18
|
+
return cursorDimension;
|
|
19
|
+
}
|
|
20
|
+
return cursorDimension === "x" ? "y" : "x";
|
|
95
21
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
22
|
+
withinBounds(point, bounds) {
|
|
23
|
+
const {
|
|
24
|
+
x1,
|
|
25
|
+
x2,
|
|
26
|
+
y1,
|
|
27
|
+
y2
|
|
28
|
+
} = _victoryCore.Helpers.mapValues(bounds, Number);
|
|
29
|
+
const {
|
|
30
|
+
x,
|
|
31
|
+
y
|
|
32
|
+
} = _victoryCore.Helpers.mapValues(point, Number);
|
|
33
|
+
return x >= Math.min(x1, x2) && x <= Math.max(x1, x2) && y >= Math.min(y1, y2) && y <= Math.max(y1, y2);
|
|
34
|
+
}
|
|
35
|
+
handleMouseMove = (evt, targetProps) => {
|
|
36
|
+
const {
|
|
37
|
+
onCursorChange,
|
|
38
|
+
domain
|
|
39
|
+
} = targetProps;
|
|
40
|
+
const cursorDimension = this.getDimension(targetProps);
|
|
41
|
+
const parentSVG = targetProps.parentSVG || _victoryCore.Selection.getParentSVG(evt);
|
|
42
|
+
const cursorSVGPosition = _victoryCore.Selection.getSVGEventCoordinates(evt, parentSVG);
|
|
43
|
+
let cursorValue = _victoryCore.Selection.getDataCoordinates(targetProps, targetProps.scale, cursorSVGPosition.x, cursorSVGPosition.y);
|
|
44
|
+
const inBounds = this.withinBounds(cursorValue, {
|
|
45
|
+
x1: domain.x[0],
|
|
46
|
+
x2: domain.x[1],
|
|
47
|
+
y1: domain.y[0],
|
|
48
|
+
y2: domain.y[1]
|
|
49
|
+
});
|
|
50
|
+
if (!inBounds) {
|
|
51
|
+
cursorValue = null;
|
|
52
|
+
}
|
|
53
|
+
if (_victoryCore.Helpers.isFunction(onCursorChange)) {
|
|
54
|
+
if (cursorValue) {
|
|
55
|
+
const value = cursorDimension ? cursorValue[cursorDimension] : cursorValue;
|
|
56
|
+
onCursorChange(value, targetProps);
|
|
57
|
+
} else if (cursorValue !== targetProps.cursorValue) {
|
|
58
|
+
onCursorChange(targetProps.defaultCursorValue || null, targetProps);
|
|
105
59
|
}
|
|
106
|
-
|
|
107
|
-
return cursorDimension === "x" ? "y" : "x";
|
|
108
60
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
61
|
+
return [{
|
|
62
|
+
target: "parent",
|
|
63
|
+
eventKey: "parent",
|
|
64
|
+
mutation: () => ({
|
|
65
|
+
cursorValue,
|
|
66
|
+
parentSVG
|
|
67
|
+
})
|
|
68
|
+
}];
|
|
69
|
+
};
|
|
70
|
+
onMouseMove = (0, _throttle2.default)(this.handleMouseMove, ON_MOUSE_MOVE_THROTTLE_MS, {
|
|
71
|
+
leading: true,
|
|
72
|
+
trailing: false
|
|
73
|
+
});
|
|
74
|
+
onMouseLeave = this.handleMouseMove;
|
|
75
|
+
onTouchEnd = (evt, targetProps) => {
|
|
76
|
+
const {
|
|
77
|
+
onCursorChange
|
|
78
|
+
} = targetProps;
|
|
79
|
+
if (_victoryCore.Helpers.isFunction(targetProps.onCursorChange)) {
|
|
80
|
+
onCursorChange(null, targetProps);
|
|
123
81
|
}
|
|
124
|
-
|
|
82
|
+
return [{
|
|
83
|
+
target: "parent",
|
|
84
|
+
eventKey: "parent",
|
|
85
|
+
mutation: () => ({
|
|
86
|
+
cursorValue: null
|
|
87
|
+
})
|
|
88
|
+
}];
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const CursorHelpers = exports.CursorHelpers = new CursorHelpersClass();
|
|
125
92
|
|
|
126
|
-
return CursorHelpersClass;
|
|
127
|
-
}();
|
|
128
|
-
|
|
129
|
-
var CursorHelpers = new CursorHelpersClass();
|
|
130
93
|
/* {
|
|
131
94
|
...CursorHelpers,
|
|
132
95
|
onMouseMove: throttle(
|
|
@@ -142,6 +105,4 @@ var CursorHelpers = new CursorHelpersClass();
|
|
|
142
105
|
};
|
|
143
106
|
|
|
144
107
|
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
exports.CursorHelpers = CursorHelpers;
|
|
108
|
+
*/
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./cursor-helpers";
|
|
2
|
-
export * from "./victory-cursor-container";
|
|
1
|
+
export * from "./cursor-helpers";
|
|
2
|
+
export * from "./victory-cursor-container";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _cursorHelpers = require("./cursor-helpers");
|
|
8
|
-
|
|
9
7
|
Object.keys(_cursorHelpers).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _cursorHelpers[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_cursorHelpers).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _victoryCursorContainer = require("./victory-cursor-container");
|
|
21
|
-
|
|
22
18
|
Object.keys(_victoryCursorContainer).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _victoryCursorContainer[key]) return;
|
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VictoryContainer, VictoryContainerProps, CoordinatesPropType, VictoryLabelProps, ValueOrAccessor } from "victory-core";
|
|
3
|
-
export declare type CursorCoordinatesPropType = CoordinatesPropType | number;
|
|
4
|
-
export interface VictoryCursorContainerProps extends VictoryContainerProps {
|
|
5
|
-
cursorComponent?: React.ReactElement;
|
|
6
|
-
cursorDimension?: "x" | "y";
|
|
7
|
-
cursorLabel?: ValueOrAccessor<VictoryLabelProps["text"]>;
|
|
8
|
-
cursorLabelComponent?: React.ReactElement;
|
|
9
|
-
cursorLabelOffset?: CursorCoordinatesPropType;
|
|
10
|
-
defaultCursorValue?: CursorCoordinatesPropType;
|
|
11
|
-
disable?: boolean;
|
|
12
|
-
onCursorChange?: (value: CursorCoordinatesPropType, props: VictoryCursorContainerProps) => void;
|
|
13
|
-
}
|
|
14
|
-
declare type ComponentClass<TProps> = {
|
|
15
|
-
new (props: TProps): React.Component<TProps>;
|
|
16
|
-
};
|
|
17
|
-
export declare function cursorContainerMixin<TBase extends ComponentClass<TProps>, TProps extends VictoryCursorContainerProps>(Base: TBase): {
|
|
18
|
-
new (props: TProps): {
|
|
19
|
-
getCursorPosition(props: any): any;
|
|
20
|
-
getCursorLabelOffset(props: any): any;
|
|
21
|
-
getPadding(props: any): {
|
|
22
|
-
top: any;
|
|
23
|
-
bottom: any;
|
|
24
|
-
left: any;
|
|
25
|
-
right: any;
|
|
26
|
-
};
|
|
27
|
-
getCursorElements(props: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
28
|
-
getChildren(props: any): (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment)[];
|
|
29
|
-
context: unknown;
|
|
30
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<TProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
31
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
32
|
-
render(): React.ReactNode;
|
|
33
|
-
readonly props: Readonly<TProps>;
|
|
34
|
-
state: Readonly<{}>;
|
|
35
|
-
refs: {
|
|
36
|
-
[key: string]: React.ReactInstance;
|
|
37
|
-
};
|
|
38
|
-
componentDidMount?(): void;
|
|
39
|
-
shouldComponentUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
40
|
-
componentWillUnmount?(): void;
|
|
41
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
42
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>): any;
|
|
43
|
-
componentDidUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
44
|
-
componentWillMount?(): void;
|
|
45
|
-
UNSAFE_componentWillMount?(): void;
|
|
46
|
-
componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
|
|
47
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
|
|
48
|
-
componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
49
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
50
|
-
};
|
|
51
|
-
displayName: string;
|
|
52
|
-
defaultProps: {
|
|
53
|
-
cursorLabelComponent: JSX.Element;
|
|
54
|
-
cursorLabelOffset: {
|
|
55
|
-
x: number;
|
|
56
|
-
y: number;
|
|
57
|
-
};
|
|
58
|
-
cursorComponent: JSX.Element;
|
|
59
|
-
className: string;
|
|
60
|
-
portalComponent: JSX.Element;
|
|
61
|
-
portalZIndex: number;
|
|
62
|
-
responsive: boolean;
|
|
63
|
-
role: string;
|
|
64
|
-
};
|
|
65
|
-
defaultEvents: (props: any) => {
|
|
66
|
-
target: string;
|
|
67
|
-
eventHandlers: {
|
|
68
|
-
onMouseLeave: (evt: any, targetProps: any) => {};
|
|
69
|
-
onTouchCancel: () => never[];
|
|
70
|
-
onMouseMove: (evt: any, targetProps: any) => {} | undefined;
|
|
71
|
-
onTouchMove: (evt: any, targetProps: any) => {} | undefined;
|
|
72
|
-
};
|
|
73
|
-
}[];
|
|
74
|
-
} & TBase;
|
|
75
|
-
export declare const VictoryCursorContainer: {
|
|
76
|
-
new (props: VictoryCursorContainerProps): {
|
|
77
|
-
getCursorPosition(props: any): any;
|
|
78
|
-
getCursorLabelOffset(props: any): any;
|
|
79
|
-
getPadding(props: any): {
|
|
80
|
-
top: any;
|
|
81
|
-
bottom: any;
|
|
82
|
-
left: any;
|
|
83
|
-
right: any;
|
|
84
|
-
};
|
|
85
|
-
getCursorElements(props: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
86
|
-
getChildren(props: any): (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment)[];
|
|
87
|
-
context: unknown;
|
|
88
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<VictoryCursorContainerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
89
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
90
|
-
render(): React.ReactNode;
|
|
91
|
-
readonly props: Readonly<VictoryCursorContainerProps>;
|
|
92
|
-
state: Readonly<{}>;
|
|
93
|
-
refs: {
|
|
94
|
-
[key: string]: React.ReactInstance;
|
|
95
|
-
};
|
|
96
|
-
componentDidMount?(): void;
|
|
97
|
-
shouldComponentUpdate?(nextProps: Readonly<VictoryCursorContainerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
98
|
-
componentWillUnmount?(): void;
|
|
99
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
100
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<VictoryCursorContainerProps>, prevState: Readonly<{}>): any;
|
|
101
|
-
componentDidUpdate?(prevProps: Readonly<VictoryCursorContainerProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
102
|
-
componentWillMount?(): void;
|
|
103
|
-
UNSAFE_componentWillMount?(): void;
|
|
104
|
-
componentWillReceiveProps?(nextProps: Readonly<VictoryCursorContainerProps>, nextContext: any): void;
|
|
105
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<VictoryCursorContainerProps>, nextContext: any): void;
|
|
106
|
-
componentWillUpdate?(nextProps: Readonly<VictoryCursorContainerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
107
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<VictoryCursorContainerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
108
|
-
};
|
|
109
|
-
displayName: string;
|
|
110
|
-
defaultProps: {
|
|
111
|
-
cursorLabelComponent: JSX.Element;
|
|
112
|
-
cursorLabelOffset: {
|
|
113
|
-
x: number;
|
|
114
|
-
y: number;
|
|
115
|
-
};
|
|
116
|
-
cursorComponent: JSX.Element;
|
|
117
|
-
className: string;
|
|
118
|
-
portalComponent: JSX.Element;
|
|
119
|
-
portalZIndex: number;
|
|
120
|
-
responsive: boolean;
|
|
121
|
-
role: string;
|
|
122
|
-
};
|
|
123
|
-
defaultEvents: (props: any) => {
|
|
124
|
-
target: string;
|
|
125
|
-
eventHandlers: {
|
|
126
|
-
onMouseLeave: (evt: any, targetProps: any) => {};
|
|
127
|
-
onTouchCancel: () => never[];
|
|
128
|
-
onMouseMove: (evt: any, targetProps: any) => {} | undefined;
|
|
129
|
-
onTouchMove: (evt: any, targetProps: any) => {} | undefined;
|
|
130
|
-
};
|
|
131
|
-
}[];
|
|
132
|
-
} & typeof VictoryContainer;
|
|
133
|
-
export {};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryContainer, VictoryContainerProps, CoordinatesPropType, VictoryLabelProps, ValueOrAccessor } from "victory-core";
|
|
3
|
+
export declare type CursorCoordinatesPropType = CoordinatesPropType | number;
|
|
4
|
+
export interface VictoryCursorContainerProps extends VictoryContainerProps {
|
|
5
|
+
cursorComponent?: React.ReactElement;
|
|
6
|
+
cursorDimension?: "x" | "y";
|
|
7
|
+
cursorLabel?: ValueOrAccessor<VictoryLabelProps["text"]>;
|
|
8
|
+
cursorLabelComponent?: React.ReactElement;
|
|
9
|
+
cursorLabelOffset?: CursorCoordinatesPropType;
|
|
10
|
+
defaultCursorValue?: CursorCoordinatesPropType;
|
|
11
|
+
disable?: boolean;
|
|
12
|
+
onCursorChange?: (value: CursorCoordinatesPropType, props: VictoryCursorContainerProps) => void;
|
|
13
|
+
}
|
|
14
|
+
declare type ComponentClass<TProps> = {
|
|
15
|
+
new (props: TProps): React.Component<TProps>;
|
|
16
|
+
};
|
|
17
|
+
export declare function cursorContainerMixin<TBase extends ComponentClass<TProps>, TProps extends VictoryCursorContainerProps>(Base: TBase): {
|
|
18
|
+
new (props: TProps): {
|
|
19
|
+
getCursorPosition(props: any): any;
|
|
20
|
+
getCursorLabelOffset(props: any): any;
|
|
21
|
+
getPadding(props: any): {
|
|
22
|
+
top: any;
|
|
23
|
+
bottom: any;
|
|
24
|
+
left: any;
|
|
25
|
+
right: any;
|
|
26
|
+
};
|
|
27
|
+
getCursorElements(props: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
28
|
+
getChildren(props: any): (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment)[];
|
|
29
|
+
context: unknown;
|
|
30
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<TProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
31
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
32
|
+
render(): React.ReactNode;
|
|
33
|
+
readonly props: Readonly<TProps>;
|
|
34
|
+
state: Readonly<{}>;
|
|
35
|
+
refs: {
|
|
36
|
+
[key: string]: React.ReactInstance;
|
|
37
|
+
};
|
|
38
|
+
componentDidMount?(): void;
|
|
39
|
+
shouldComponentUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
40
|
+
componentWillUnmount?(): void;
|
|
41
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
42
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>): any;
|
|
43
|
+
componentDidUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
44
|
+
componentWillMount?(): void;
|
|
45
|
+
UNSAFE_componentWillMount?(): void;
|
|
46
|
+
componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
|
|
47
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
|
|
48
|
+
componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
49
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
50
|
+
};
|
|
51
|
+
displayName: string;
|
|
52
|
+
defaultProps: {
|
|
53
|
+
cursorLabelComponent: JSX.Element;
|
|
54
|
+
cursorLabelOffset: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
};
|
|
58
|
+
cursorComponent: JSX.Element;
|
|
59
|
+
className: string;
|
|
60
|
+
portalComponent: JSX.Element;
|
|
61
|
+
portalZIndex: number;
|
|
62
|
+
responsive: boolean;
|
|
63
|
+
role: string;
|
|
64
|
+
};
|
|
65
|
+
defaultEvents: (props: any) => {
|
|
66
|
+
target: string;
|
|
67
|
+
eventHandlers: {
|
|
68
|
+
onMouseLeave: (evt: any, targetProps: any) => {};
|
|
69
|
+
onTouchCancel: () => never[];
|
|
70
|
+
onMouseMove: (evt: any, targetProps: any) => {} | undefined;
|
|
71
|
+
onTouchMove: (evt: any, targetProps: any) => {} | undefined;
|
|
72
|
+
};
|
|
73
|
+
}[];
|
|
74
|
+
} & TBase;
|
|
75
|
+
export declare const VictoryCursorContainer: {
|
|
76
|
+
new (props: VictoryCursorContainerProps): {
|
|
77
|
+
getCursorPosition(props: any): any;
|
|
78
|
+
getCursorLabelOffset(props: any): any;
|
|
79
|
+
getPadding(props: any): {
|
|
80
|
+
top: any;
|
|
81
|
+
bottom: any;
|
|
82
|
+
left: any;
|
|
83
|
+
right: any;
|
|
84
|
+
};
|
|
85
|
+
getCursorElements(props: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
86
|
+
getChildren(props: any): (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment)[];
|
|
87
|
+
context: unknown;
|
|
88
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<VictoryCursorContainerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
89
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
90
|
+
render(): React.ReactNode;
|
|
91
|
+
readonly props: Readonly<VictoryCursorContainerProps>;
|
|
92
|
+
state: Readonly<{}>;
|
|
93
|
+
refs: {
|
|
94
|
+
[key: string]: React.ReactInstance;
|
|
95
|
+
};
|
|
96
|
+
componentDidMount?(): void;
|
|
97
|
+
shouldComponentUpdate?(nextProps: Readonly<VictoryCursorContainerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
98
|
+
componentWillUnmount?(): void;
|
|
99
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
100
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<VictoryCursorContainerProps>, prevState: Readonly<{}>): any;
|
|
101
|
+
componentDidUpdate?(prevProps: Readonly<VictoryCursorContainerProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
102
|
+
componentWillMount?(): void;
|
|
103
|
+
UNSAFE_componentWillMount?(): void;
|
|
104
|
+
componentWillReceiveProps?(nextProps: Readonly<VictoryCursorContainerProps>, nextContext: any): void;
|
|
105
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<VictoryCursorContainerProps>, nextContext: any): void;
|
|
106
|
+
componentWillUpdate?(nextProps: Readonly<VictoryCursorContainerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
107
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<VictoryCursorContainerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
108
|
+
};
|
|
109
|
+
displayName: string;
|
|
110
|
+
defaultProps: {
|
|
111
|
+
cursorLabelComponent: JSX.Element;
|
|
112
|
+
cursorLabelOffset: {
|
|
113
|
+
x: number;
|
|
114
|
+
y: number;
|
|
115
|
+
};
|
|
116
|
+
cursorComponent: JSX.Element;
|
|
117
|
+
className: string;
|
|
118
|
+
portalComponent: JSX.Element;
|
|
119
|
+
portalZIndex: number;
|
|
120
|
+
responsive: boolean;
|
|
121
|
+
role: string;
|
|
122
|
+
};
|
|
123
|
+
defaultEvents: (props: any) => {
|
|
124
|
+
target: string;
|
|
125
|
+
eventHandlers: {
|
|
126
|
+
onMouseLeave: (evt: any, targetProps: any) => {};
|
|
127
|
+
onTouchCancel: () => never[];
|
|
128
|
+
onMouseMove: (evt: any, targetProps: any) => {} | undefined;
|
|
129
|
+
onTouchMove: (evt: any, targetProps: any) => {} | undefined;
|
|
130
|
+
};
|
|
131
|
+
}[];
|
|
132
|
+
} & typeof VictoryContainer;
|
|
133
|
+
export {};
|
|
134
134
|
//# sourceMappingURL=victory-cursor-container.d.ts.map
|