MCPcopy
hub / github.com/anvaka/VivaGraphJS / assertGraphHasPositions

Function assertGraphHasPositions

test/forceBasedLayout.js:27–34  ·  view source on GitHub ↗
(graph, layout, test)

Source from the content-addressed store, hash-verified

25});
26
27function assertGraphHasPositions(graph, layout, test) {
28 graph.forEachNode(function(node) {
29 var position = layout.getNodePosition(node.id);
30 test.ok(position, 'All nodes expected to have some position');
31 test.ok(typeof position.x === 'number', 'Node position does not have a valid x position');
32 test.ok(typeof position.y === 'number', 'Node position does not have a valid y position');
33 });
34}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected