Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngraph.forcelayout3d

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngraph.forcelayout3d - npm Package Compare versions

Comparing version 1.0.1 to 1.2.0

2

lib/createBody.js

@@ -1,2 +0,2 @@

var physics = require('ngraph.physics.primitives');
var physics = require('ngraph.forcelayout/lib/primitives');

@@ -3,0 +3,0 @@ module.exports = function(pos) {

@@ -10,3 +10,3 @@ /**

function integrate(bodies, timeStep) {
function integrate(bodies, timeStep, adaptiveTimeStepWeight) {
var dx = 0, tx = 0,

@@ -19,4 +19,7 @@ dy = 0, ty = 0,

for (i = 0; i < max; ++i) {
var body = bodies[i],
coeff = timeStep / body.mass;
var body = bodies[i];
if (adaptiveTimeStepWeight && body.springCount) {
timeStep = (adaptiveTimeStepWeight * body.springLength/body.springCount);
}
var coeff = timeStep / body.mass;

@@ -23,0 +26,0 @@ body.velocity.x += coeff * body.force.x;

@@ -15,3 +15,3 @@ /**

options = merge(options, {
springCoeff: 0.0002,
springCoeff: 0.8,
springLength: 80

@@ -41,3 +41,3 @@ });

var d = r - length;
var coeff = ((!spring.coeff || spring.coeff < 0) ? options.springCoeff : spring.coeff) * d / r * spring.weight;
var coeff = ((!spring.coeff || spring.coeff < 0) ? options.springCoeff : spring.coeff) * d / r;

@@ -47,2 +47,4 @@ body1.force.x += coeff * dx;

body1.force.z += coeff * dz;
body1.springCount += 1;
body1.springLength += r;

@@ -52,2 +54,4 @@ body2.force.x -= coeff * dx;

body2.force.z -= coeff * dz;
body2.springCount += 1;
body2.springLength += r;
}

@@ -54,0 +58,0 @@ };

{
"name": "ngraph.forcelayout3d",
"version": "1.0.1",
"version": "1.2.0",
"description": "Force directed graph layout in 3d",

@@ -34,5 +34,4 @@ "main": "index.js",

"ngraph.expose": "^1.0.0",
"ngraph.physics.primitives": "^1.0.0",
"ngraph.forcelayout": "^1.0.1"
"ngraph.forcelayout": "^1.2.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc