only create graph when needed
This commit is contained in:
parent
f2e32b9795
commit
2e336f1e39
|
|
@ -48,9 +48,9 @@
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import '../src/standalone/folk-shape.ts';
|
import '../src/standalone/folk-shape.ts';
|
||||||
import '../src/standalone/folk-graph.ts';
|
|
||||||
import '../src/standalone/folk-arrow.ts';
|
import '../src/standalone/folk-arrow.ts';
|
||||||
import '../src/standalone/folk-rope.ts';
|
import '../src/standalone/folk-rope.ts';
|
||||||
|
import '../src/standalone/folk-graph.ts';
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,9 @@ export class FolkGraph extends FolkBaseSet implements AnimationFrameControllerHo
|
||||||
|
|
||||||
override update(changedProperties: PropertyValues<this>) {
|
override update(changedProperties: PropertyValues<this>) {
|
||||||
super.update(changedProperties);
|
super.update(changedProperties);
|
||||||
// TODO: we're recreating the graph every frame, need to.. not do that...
|
if (changedProperties.has('sourceElements')) {
|
||||||
this.createGraph();
|
this.createGraph();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tick() {
|
tick() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue