only create graph when needed
This commit is contained in:
parent
f2e32b9795
commit
2e336f1e39
|
|
@ -48,9 +48,9 @@
|
|||
|
||||
<script type="module">
|
||||
import '../src/standalone/folk-shape.ts';
|
||||
import '../src/standalone/folk-graph.ts';
|
||||
import '../src/standalone/folk-arrow.ts';
|
||||
import '../src/standalone/folk-rope.ts';
|
||||
import '../src/standalone/folk-graph.ts';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -29,8 +29,9 @@ export class FolkGraph extends FolkBaseSet implements AnimationFrameControllerHo
|
|||
|
||||
override update(changedProperties: PropertyValues<this>) {
|
||||
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() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue