force-graph 1.42.13 → 1.42.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "force-graph",
3
- "version": "1.42.13",
3
+ "version": "1.42.14",
4
4
  "description": "2D force-directed graph rendered on HTML5 canvas",
5
5
  "unpkg": "dist/force-graph.min.js",
6
6
  "main": "dist/force-graph.common.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "scripts": {
34
34
  "build": "rimraf dist && rollup -c",
35
- "dev": "rollup -w -c rollup.config.dev.js",
35
+ "dev": "rollup -w -c rollup.config.dev.mjs",
36
36
  "prepare": "npm run build"
37
37
  },
38
38
  "files": [
@@ -57,19 +57,19 @@
57
57
  "lodash.throttle": "4"
58
58
  },
59
59
  "devDependencies": {
60
- "@babel/core": "^7.18.10",
60
+ "@babel/core": "^7.19.6",
61
61
  "@babel/plugin-proposal-class-properties": "^7.18.6",
62
- "@babel/plugin-proposal-object-rest-spread": "^7.18.9",
63
- "@babel/preset-env": "^7.18.10",
64
- "@rollup/plugin-babel": "^5.3.1",
65
- "@rollup/plugin-commonjs": "^22.0.2",
66
- "@rollup/plugin-node-resolve": "^13.3.0",
67
- "postcss": "^8.4.16",
62
+ "@babel/plugin-proposal-object-rest-spread": "^7.19.4",
63
+ "@babel/preset-env": "^7.19.4",
64
+ "@rollup/plugin-babel": "^6.0.2",
65
+ "@rollup/plugin-commonjs": "^23.0.2",
66
+ "@rollup/plugin-node-resolve": "^15.0.1",
67
+ "postcss": "^8.4.18",
68
68
  "rimraf": "^3.0.2",
69
- "rollup": "^2.78.0",
70
- "rollup-plugin-dts": "^4.2.2",
69
+ "rollup": "^3.2.5",
70
+ "rollup-plugin-dts": "^5.0.0",
71
71
  "rollup-plugin-postcss": "^4.0.2",
72
72
  "rollup-plugin-terser": "^7.0.2",
73
- "typescript": "^4.7.4"
73
+ "typescript": "^4.8.4"
74
74
  }
75
75
  }
@@ -8,7 +8,6 @@
8
8
  .force-graph-container .graph-tooltip {
9
9
  position: absolute;
10
10
  top: 0;
11
- transform: translate(-50%, 25px);
12
11
  font-family: sans-serif;
13
12
  font-size: 16px;
14
13
  padding: 4px;
@@ -518,6 +518,12 @@ export default Kapsule({
518
518
  toolTipElem.style.top = `${pointerPos.y}px`;
519
519
  toolTipElem.style.left = `${pointerPos.x}px`;
520
520
 
521
+ // adjust horizontal position to not exceed canvas boundaries
522
+ toolTipElem.style.transform = `translate(-${pointerPos.x / state.width * 100}%, ${
523
+ // flip to above if near bottom
524
+ state.height - pointerPos.y < 100 ? 'calc(-100% - 8px)' : '21px'
525
+ })`;
526
+
521
527
  //
522
528
 
523
529
  function getOffset(el) {