ngraph.forcelayout3d
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"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(); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109438
2748
127
+ Addedngraph.forcelayout@0.0.12(transitive)
+ Addedngraph.physics.simulator@0.0.8(transitive)
+ Addedngraph.quadtreebh@0.0.2(transitive)
- Removedngraph.events@0.0.3(transitive)
- Removedngraph.forcelayout@0.0.23(transitive)
- Removedngraph.physics.primitives@0.0.6(transitive)
- Removedngraph.physics.simulator@0.0.120.0.6(transitive)
- Removedngraph.quadtreebh@0.0.10.0.3(transitive)
Updatedngraph.forcelayout@0.0.12