From e685b85b1837a871622da8767dee4b589bc219b5 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Mon, 1 Jul 2019 23:02:45 +0000 Subject: [PATCH] Only iterate/reorigin on structure changes --- architype.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/architype.js b/architype.js index 039cf05..43d3c85 100644 --- a/architype.js +++ b/architype.js @@ -170,6 +170,10 @@ class Architype { this.bucketBySubgraph(graph); this.setInitialPositions(graph); this.setAffinity(graph); + + while (this.iterate(graph)); + this.fixOrigin(graph); + return graph; } @@ -439,10 +443,6 @@ class Architype { } buildGrid(graph) { - while (this.iterate(graph)); - - this.fixOrigin(graph); - this.grid_.innerHTML = ''; this.grid_.style.gridTemplateColumns =