MCPcopy Create free account
hub / github.com/ericdrowell/ElGrapho / applyLayout

Function applyLayout

gallery/scripts/build-models.js:74–83  ·  view source on GitHub ↗
(layout)

Source from the content-addressed store, hash-verified

72}
73
74function applyLayout(layout) {
75 console.log('applying ' + layout + ' layout...');
76 let startTime = new Date().getTime();
77 layouts[layout](model);
78 fs.writeFileSync('gallery/models/' + layout + '.js', 'const MODEL=' + JSON.stringify(model) + ';', 'utf-8');
79 let endTime = new Date().getTime();
80 let timeDiff = (endTime - startTime) / 1000; // seconds
81 console.log('done!');
82 console.log('applying ' + layout + ' layout took ' + timeDiff + ' seconds');
83}
84
85applyLayout('Tree');
86applyLayout('ForceDirected');

Callers 1

build-models.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected