2019-07-03 22:10:36 +00:00
|
|
|
addEventListener('message', (e) => {
|
2019-07-14 19:13:47 +00:00
|
|
|
if (e.data.command == 'ping') {
|
|
|
|
|
postMessage({
|
|
|
|
|
command: 'pong',
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-03 22:10:36 +00:00
|
|
|
let graph = new Graph(e.data);
|
2019-07-03 03:36:48 +00:00
|
|
|
let layout = new Layout(graph);
|
2019-07-03 22:10:36 +00:00
|
|
|
postMessage({
|
|
|
|
|
generation: e.data.generation,
|
|
|
|
|
steps: layout.getDrawSteps(),
|
|
|
|
|
});
|
|
|
|
|
});
|
2019-07-03 03:24:15 +00:00
|
|
|
|
|
|
|
|
<!--# include file="Graph.js" -->
|
2019-07-03 03:36:48 +00:00
|
|
|
<!--# include file="Layout.js" -->
|
2019-07-03 22:10:36 +00:00
|
|
|
|
|
|
|
|
<!--# include file="utils.js" -->
|