MCPcopy Index your code
hub / github.com/marijnh/Eloquent-JavaScript / randomLayout

Function randomLayout

code/chapter/22_fast.js:24–31  ·  view source on GitHub ↗
(graph)

Source from the content-addressed store, hash-verified

22}
23
24function randomLayout(graph) {
25 let layout = [];
26 for (let i = 0; i < graph.size; i++) {
27 layout.push(new Vec(Math.random() * 1000,
28 Math.random() * 1000));
29 }
30 return layout;
31}
32
33function gridGraph(size) {
34 let grid = new Graph();

Callers 1

runLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected