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 0.0.3 to 0.0.4

8

package.json
{
"name": "ngraph.forcelayout3d",
"version": "0.0.3",
"version": "0.0.4",
"description": "Force directed graph layout in 3d",

@@ -31,6 +31,6 @@ "main": "index.js",

"ngraph.expose": "0.0.0",
"ngraph.physics.primitives": "0.0.6",
"ngraph.physics.simulator": "0.0.6",
"ngraph.forcelayout": "~0.0"
"ngraph.physics.primitives": "0.0.7",
"ngraph.physics.simulator": "0.0.8",
"ngraph.forcelayout": "0.0.12"
}
}

@@ -64,2 +64,8 @@ Force Directed layout in 3D

What if you still want to move your node according to some external factor (e.g. you have initial positions, or user drags pinned node)? To do this, call `setNodePosition()` method:
``` js
layout.setNodePosition(nodeId, x, y, z);
```
## Monitoring changes

@@ -66,0 +72,0 @@

@@ -70,2 +70,21 @@ var test = require('tap').test,

// todo: layout.setNodePosition() should accept three arguments
test('Layout can set node position', function (t) {
var graph = createGraph();
graph.addLink(1, 2);
var layout = createLayout(graph);
layout.pinNode(graph.getNode(1), true);
layout.setNodePosition(1, 42, 43, 44);
// perform one iteration of layout:
layout.step();
// and make sure node 1 was not moved:
var actualPosition = layout.getNodePosition(1);
t.equals(actualPosition.x, 42, 'X has not changed');
t.equals(actualPosition.y, 43, 'Y has not changed');
t.equals(actualPosition.z, 44, 'Z has not changed');
t.end();
});
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