Skip to content

Commit

Permalink
[deps] Upgraded KDBush initialization to version 4.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Oct 18, 2023
1 parent c4d9334 commit d151895
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["@babel/preset-env"],
};
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
]
},
"jest": {
"testEnvironment": "jsdom"
"testEnvironment": "jsdom",
"transformIgnorePatterns": [
"/node_modules/(?!(kdbush)/)",
"\\.pnp\\.[^\\/]+$"
]
},
"repository": "https://github.com/netjson/netjsongraph.js.git",
"author": "Federico Capoano <federico.capoano@gmail.com> (http://nemesisdesign.net/)",
Expand Down
10 changes: 5 additions & 5 deletions src/js/netjsongraph.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ class NetJSONGraphUtil {
node.cluster = null;
});

const index = new KDBush(
nodes,
(p) => p.x,
(p) => p.y,
);
const index = new KDBush(nodes.length);
/* eslint-disable no-restricted-syntax */
for (const {x, y} of nodes) index.add(x, y);
/* eslint-enable no-restricted-syntax */
index.finish();

nodes.forEach((node) => {
let cluster;
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@
"@babel/plugin-transform-modules-commonjs@^7.23.0":
version "7.23.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.0.tgz#b3dba4757133b2762c00f4f94590cf6d52602481"
integrity sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==
dependencies:
"@babel/helper-module-transforms" "^7.23.0"
"@babel/helper-plugin-utils" "^7.22.5"
Expand Down

0 comments on commit d151895

Please sign in to comment.