force-graph 1.49.5 → 1.49.6

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.
@@ -1539,6 +1539,9 @@ var forceGraph = Kapsule({
1539
1539
 
1540
1540
  // Handle click/touch events on nodes/links
1541
1541
  container.addEventListener('pointerup', function (ev) {
1542
+ if (!state.isPointerPressed) {
1543
+ return; // don't trigger click events if pointer is not pressed on the canvas
1544
+ }
1542
1545
  state.isPointerPressed = false;
1543
1546
  if (state.isPointerDragging) {
1544
1547
  state.isPointerDragging = false;
@@ -65,7 +65,7 @@
65
65
  .d3AlphaDecay(0.02)
66
66
  .d3VelocityDecay(0.3);
67
67
 
68
- fetch('//unpkg.com/d3@5.9.7/yarn.lock')
68
+ fetch('//cdn.jsdelivr.net/npm/d3@5.9.7/yarn.lock')
69
69
  .then(r => r.text())
70
70
  .then(text => {
71
71
  const yarnlock = _yarnpkg_lockfile.parse(text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "force-graph",
3
- "version": "1.49.5",
3
+ "version": "1.49.6",
4
4
  "description": "2D force-directed graph rendered on HTML5 canvas",
5
5
  "type": "module",
6
6
  "unpkg": "dist/force-graph.min.js",
@@ -59,24 +59,24 @@
59
59
  "d3-scale-chromatic": "1 - 3",
60
60
  "d3-selection": "2 - 3",
61
61
  "d3-zoom": "2 - 3",
62
- "float-tooltip": "^1.6",
62
+ "float-tooltip": "^1.7",
63
63
  "index-array-by": "1",
64
64
  "kapsule": "^1.16",
65
65
  "lodash-es": "4"
66
66
  },
67
67
  "devDependencies": {
68
- "@babel/core": "^7.26.9",
69
- "@babel/preset-env": "^7.26.9",
68
+ "@babel/core": "^7.27.1",
69
+ "@babel/preset-env": "^7.27.2",
70
70
  "@rollup/plugin-babel": "^6.0.4",
71
71
  "@rollup/plugin-commonjs": "^28.0.3",
72
- "@rollup/plugin-node-resolve": "^16.0.0",
72
+ "@rollup/plugin-node-resolve": "^16.0.1",
73
73
  "@rollup/plugin-terser": "^0.4.4",
74
74
  "postcss": "^8.5.3",
75
75
  "rimraf": "^6.0.1",
76
- "rollup": "^4.34.9",
77
- "rollup-plugin-dts": "^6.1.1",
76
+ "rollup": "^4.40.2",
77
+ "rollup-plugin-dts": "^6.2.1",
78
78
  "rollup-plugin-postcss": "^4.0.2",
79
- "typescript": "^5.8.2"
79
+ "typescript": "^5.8.3"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=12"
@@ -547,6 +547,10 @@ export default Kapsule({
547
547
 
548
548
  // Handle click/touch events on nodes/links
549
549
  container.addEventListener('pointerup', ev => {
550
+ if (!state.isPointerPressed) {
551
+ return; // don't trigger click events if pointer is not pressed on the canvas
552
+ }
553
+
550
554
  state.isPointerPressed = false;
551
555
  if (state.isPointerDragging) {
552
556
  state.isPointerDragging = false;