Skip to content

Commit 427f837

Browse files
committed
Add showPointerCursor method
1 parent b2377b2 commit 427f837

File tree

9 files changed

+19
-15
lines changed

9 files changed

+19
-15
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ Note that not all props listed below apply to all 4 components. The last 4 colum
245245
| <b>onBackgroundClick</b> | <i>func</i> | *-* | Callback function for click events on the empty space between the nodes and links. The event object is included as single argument `onBackgroundClick(event)`. | :heavy_check_mark: | :heavy_check_mark: | | |
246246
| <b>onBackgroundRightClick</b> | <i>func</i> | *-* | Callback function for right-click events on the empty space between the nodes and links. The event object is included as single argument `onBackgroundRightClick(event)`. | :heavy_check_mark: | :heavy_check_mark: | | |
247247
| <b>linkHoverPrecision</b> | <i>number</i> | 4 | Whether to display the link label when gazing the link closely (low value) or from far away (high value). | :heavy_check_mark: | :heavy_check_mark: | | |
248+
| <b>showPointerCursor</b> | <i>bool</i> or <i>func</i> | `true` | Whether to show a pointer cursor when hovering over clickable portions of the canvas. Accepts either a `boolean` constant or a callback function which receives the object currently under the cursor and is expected to return a `boolean` value. | :heavy_check_mark: | :heavy_check_mark: | | |
248249
| <b>onZoom</b> | <i>func</i> | *-* | Callback function for zoom/pan events. The current zoom transform is included as single argument `onZoom({ k, x, y })`. Note that `onZoom` is triggered by user interaction as well as programmatic zooming/panning with `zoom()` and `centerAt()`. | :heavy_check_mark: | | | |
249250
| <b>onZoomEnd</b> | <i>func</i> | *-* | Callback function for on 'end' of zoom/pan events. The current zoom transform is included as single argument `onZoomEnd({ k, x, y })`. Note that `onZoomEnd` is triggered by user interaction as well as programmatic zooming/panning with `zoom()` and `centerAt()`. | :heavy_check_mark: | | | |
250251
| <b>controlType</b> | <i>string</i> | `trackball` | Which type of control to use to control the camera on 3D mode. Choice between [trackball](https://threejs.org/examples/misc_controls_trackball.html), [orbit](https://threejs.org/examples/#misc_controls_orbit) or [fly](https://threejs.org/examples/misc_controls_fly.html). | | :heavy_check_mark: | | |

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,31 @@
4848
"dist/**/*"
4949
],
5050
"dependencies": {
51-
"3d-force-graph": "^1.78",
51+
"3d-force-graph": "^1.79",
5252
"3d-force-graph-ar": "^1.10",
5353
"3d-force-graph-vr": "^3.1",
54-
"force-graph": "^1.50",
54+
"force-graph": "^1.51",
5555
"prop-types": "15",
5656
"react-kapsule": "^2.5"
5757
},
5858
"peerDependencies": {
5959
"react": "*"
6060
},
6161
"devDependencies": {
62-
"@babel/core": "^7.28.0",
63-
"@babel/preset-env": "^7.28.0",
62+
"@babel/core": "^7.28.4",
63+
"@babel/preset-env": "^7.28.3",
6464
"@babel/preset-react": "^7.27.1",
6565
"@rollup/plugin-babel": "^6.0.4",
6666
"@rollup/plugin-commonjs": "^28.0.6",
6767
"@rollup/plugin-node-resolve": "^16.0.1",
6868
"@rollup/plugin-replace": "^6.0.2",
6969
"@rollup/plugin-terser": "^0.4.4",
70-
"@types/react": "^19.1.8",
71-
"@types/three": "^0.178.0",
70+
"@types/react": "^19.1.12",
71+
"@types/three": "^0.180.0",
7272
"rimraf": "^6.0.1",
73-
"rollup": "^4.44.1",
74-
"rollup-plugin-dts": "^6.2.1",
75-
"typescript": "^5.8.3"
73+
"rollup": "^4.50.0",
74+
"rollup-plugin-dts": "^6.2.3",
75+
"typescript": "^5.9.2"
7676
},
7777
"engines": {
7878
"node": ">=12"

src/forcegraph-proptypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const pointerBasedPropTypes = {
5959
linkHoverPrecision: PropTypes.number,
6060
onBackgroundClick: PropTypes.func,
6161
onBackgroundRightClick: PropTypes.func,
62+
showPointerCursor: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
6263
enablePointerInteraction: PropTypes.bool,
6364
enableNodeDrag: PropTypes.bool
6465
};

src/packages/react-force-graph-2d/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export interface ForceGraphProps<
122122
linkHoverPrecision?: number;
123123
onBackgroundClick?: (event: MouseEvent) => void;
124124
onBackgroundRightClick?: (event: MouseEvent) => void;
125+
showPointerCursor?: boolean | ((obj: NodeObject<NodeType> | LinkObject<NodeType, LinkType> | undefined) => boolean);
125126
onZoom?: (transform: {k: number, x: number, y: number}) => void;
126127
onZoomEnd?: (transform: {k: number, x: number, y: number}) => void;
127128
enableNodeDrag?: boolean;

src/packages/react-force-graph-2d/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"dist/**/*"
4444
],
4545
"dependencies": {
46-
"force-graph": "^1.50",
46+
"force-graph": "^1.51",
4747
"prop-types": "15",
4848
"react-kapsule": "^2.5"
4949
},
@@ -52,7 +52,7 @@
5252
},
5353
"devDependencies": {
5454
"rimraf": "^6.0.1",
55-
"rollup": "^4.44.1"
55+
"rollup": "^4.50.0"
5656
},
5757
"engines": {
5858
"node": ">=12"

src/packages/react-force-graph-3d/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export interface ForceGraphProps<
133133
linkHoverPrecision?: number;
134134
onBackgroundClick?: (event: MouseEvent) => void;
135135
onBackgroundRightClick?: (event: MouseEvent) => void;
136+
showPointerCursor?: boolean | ((obj: NodeObject<NodeType> | LinkObject<NodeType, LinkType> | undefined) => boolean);
136137
enableNodeDrag?: boolean;
137138
enableNavigationControls?: boolean;
138139
enablePointerInteraction?: boolean;

src/packages/react-force-graph-3d/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"dist/**/*"
4545
],
4646
"dependencies": {
47-
"3d-force-graph": "^1.78",
47+
"3d-force-graph": "^1.79",
4848
"prop-types": "15",
4949
"react-kapsule": "^2.5"
5050
},
@@ -53,7 +53,7 @@
5353
},
5454
"devDependencies": {
5555
"rimraf": "^6.0.1",
56-
"rollup": "^4.44.1"
56+
"rollup": "^4.50.0"
5757
},
5858
"engines": {
5959
"node": ">=12"

src/packages/react-force-graph-ar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
},
5555
"devDependencies": {
5656
"rimraf": "^6.0.1",
57-
"rollup": "^4.44.1"
57+
"rollup": "^4.50.0"
5858
},
5959
"engines": {
6060
"node": ">=12"

src/packages/react-force-graph-vr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
},
5555
"devDependencies": {
5656
"rimraf": "^6.0.1",
57-
"rollup": "^4.44.1"
57+
"rollup": "^4.50.0"
5858
},
5959
"engines": {
6060
"node": ">=12"

0 commit comments

Comments
 (0)