diff --git a/demo/graph-layout.html b/demo/graph-layout.html index cb0ecd4..e73e70f 100644 --- a/demo/graph-layout.html +++ b/demo/graph-layout.html @@ -48,9 +48,9 @@ diff --git a/src/folk-graph.ts b/src/folk-graph.ts index 91cb77a..6c5e5e1 100644 --- a/src/folk-graph.ts +++ b/src/folk-graph.ts @@ -29,8 +29,9 @@ export class FolkGraph extends FolkBaseSet implements AnimationFrameControllerHo override update(changedProperties: PropertyValues) { super.update(changedProperties); - // TODO: we're recreating the graph every frame, need to.. not do that... - this.createGraph(); + if (changedProperties.has('sourceElements')) { + this.createGraph(); + } } tick() {