feat: improve loading times

This commit is contained in:
2024-03-20 17:39:52 +01:00
parent 92a7e62d6a
commit 84bcfa61d8
12 changed files with 62 additions and 51 deletions

View File

@@ -24,6 +24,7 @@
const status = graph.status;
const nodes = graph.nodes;
const edges = graph.edges;
const graphId = graph.id;
let camera: OrthographicCamera;
const minZoom = 1;
@@ -523,8 +524,6 @@
const clickedNodeId = getNodeIdFromEvent(event);
console.log({ clickedNodeId });
if (clickedNodeId !== -1) {
if (activeNode) {
if (!activeNode?.tmp?.isMoving && !event.ctrlKey && !event.shiftKey) {
@@ -676,7 +675,9 @@
to={{ x: mousePosition[0], y: mousePosition[1] }}
/>
{/if}
<GraphView {nodes} {edges} {cameraPosition} />
{#key $graphId}
<GraphView {nodes} {edges} {cameraPosition} />
{/key}
{:else if $status === "loading"}
<span>Loading</span>
{:else if $status === "error"}