= loadTasks();
+
+
+
+ Cool graf
+
+
+
+
+
diff --git a/frontend/src/Graph.svelte b/frontend/src/Graph.svelte
index 344acf3..b3fae06 100644
--- a/frontend/src/Graph.svelte
+++ b/frontend/src/Graph.svelte
@@ -1,7 +1,13 @@
@@ -95,4 +90,12 @@
}
-
+
+
+
diff --git a/frontend/src/GraphNode.svelte b/frontend/src/GraphNode.svelte
new file mode 100644
index 0000000..2f205cb
--- /dev/null
+++ b/frontend/src/GraphNode.svelte
@@ -0,0 +1,18 @@
+
+
+
+ {#if !focused}
+
+ {:else}
+
+ {/if} -->
+ {task.id}
+
diff --git a/frontend/src/Hoverable.svelte b/frontend/src/Hoverable.svelte
new file mode 100644
index 0000000..5923a22
--- /dev/null
+++ b/frontend/src/Hoverable.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+
diff --git a/frontend/src/TasksLoader.svelte b/frontend/src/TasksLoader.svelte
new file mode 100644
index 0000000..4d81661
--- /dev/null
+++ b/frontend/src/TasksLoader.svelte
@@ -0,0 +1,30 @@
+
+
+{#if data == null && err == null}
+ Loading...
+{/if}
+
+{#if data != null }
+
+{/if}
+
+{#if err != null }
+ Error - {err}
+{/if}
diff --git a/frontend/src/task-loader.ts b/frontend/src/task-loader.ts
index 2c00f02..77859f2 100644
--- a/frontend/src/task-loader.ts
+++ b/frontend/src/task-loader.ts
@@ -1,8 +1,10 @@
+import type { SimulationNodeDatum, SimulationLinkDatum } from "d3";
+
export type TaskDescriptor = {
id: string
requires: []
comment?: string
-}
+} & SimulationNodeDatum
export type TasksFile = {
@@ -12,11 +14,6 @@ export type TasksFile = {
export type TaskMap = Map;
-export type Link = {
- source: T,
- target: T
-}
-
export async function loadTasks(): Promise {
const r = await fetch("/tasks.json")
return await r.json()
@@ -34,8 +31,8 @@ export function createTaskMap(tasks: TasksFile): TaskMap {
return m;
}
-export function createLinksFromTaskMap(tasks: TasksFile): Link[] {
- let links: Link[] = [];
+export function createLinksFromTaskMap(tasks: TasksFile): SimulationLinkDatum[] {
+ let links: SimulationLinkDatum[] = [];
const taskMap = createTaskMap(tasks);
@@ -45,7 +42,7 @@ export function createLinksFromTaskMap(tasks: TasksFile): Link[]
if (t === undefined) throw `missing task with id ${id}`;
- const l: Link = {source: t, target: task};
+ const l: SimulationLinkDatum = {source: t, target: task};
links.push(l);
}
}