diff --git a/sg-backend/test.json b/sg-backend/test.json deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/sg-frontend/index.html b/sg-frontend/index.html index 987317889a8841ec2a28bb9b64624beed6eb4bbd..fb6e4814765868099fd669c66f3cfd9e98126985 100644 --- a/sg-frontend/index.html +++ b/sg-frontend/index.html @@ -12,6 +12,7 @@ <div class="topnav"> <a id="home" class="active" href="/">Home</a> <a id="sigma" href="#/sigma-custom">Software graph</a> + <a id="add" href="#/add-node">Software graph</a> </div> </div> <script type="module" src="/src/main.ts"></script> diff --git a/sg-frontend/src/App.svelte b/sg-frontend/src/App.svelte index 1dc59f05b6b743164a08e73ccdd8ed545739e2bd..1ffb7ff7af9939f4e675697c57b62525817d9805 100644 --- a/sg-frontend/src/App.svelte +++ b/sg-frontend/src/App.svelte @@ -6,6 +6,7 @@ import NotFound from "./routes/NotFound.svelte"; import Sigma from "./routes/Sigma.svelte"; import SigmaCustom from "./routes/SigmaCustom.svelte"; + import AddNode from "./routes/AddNode.svelte"; let routes = { "/": Index, @@ -13,6 +14,7 @@ "/graph": Graph, "/sigma": Sigma, "/sigma-custom": SigmaCustom, + "/add-node": AddNode, "*": NotFound } </script> diff --git a/sg-frontend/src/routes/AddNode.svelte b/sg-frontend/src/routes/AddNode.svelte new file mode 100644 index 0000000000000000000000000000000000000000..6720a65385cd9c915e9c269604308f10d70ae694 --- /dev/null +++ b/sg-frontend/src/routes/AddNode.svelte @@ -0,0 +1,21 @@ +<script lang="ts"> + + import {onMount} from 'svelte'; + + onMount(() => { + fetch("http://localhost:8000/add-node") + .then(response => response.json()) + .then(data => { + // Retrieve some useful DOM elements: + const link = document.getElementById("sigma") as HTMLElement; + const home = document.getElementById("home") as HTMLElement; + const add = document.getElementById("add") as HTMLElement; + add.classList.add("active"); + home.classList.remove("active"); + link.classList.remove("active"); + }) + }); +</script> +<div id="app-base"> +<h1>Add new node</h1> +</div> \ No newline at end of file diff --git a/sg-frontend/src/routes/Index.svelte b/sg-frontend/src/routes/Index.svelte index 319e9611758d8420eb84045630f39663cec1eb99..e94811c279726a9d065736df3525a143ec277c07 100644 --- a/sg-frontend/src/routes/Index.svelte +++ b/sg-frontend/src/routes/Index.svelte @@ -2,8 +2,10 @@ import SoftwareMerger from "../components/SoftwareMerger.svelte"; const link = document.getElementById("sigma"); const home = document.getElementById("home"); + const add = document.getElementById("add"); home.classList.add("active"); link.classList.remove("active"); + add.classList.remove("active"); </script> <div id="app-base"> diff --git a/sg-frontend/src/routes/SigmaCustom.svelte b/sg-frontend/src/routes/SigmaCustom.svelte index 99d63de5293eaf784ea99d1e08937975fad61c67..430516090a0c42783bc1e0066f89681b0d399851 100644 --- a/sg-frontend/src/routes/SigmaCustom.svelte +++ b/sg-frontend/src/routes/SigmaCustom.svelte @@ -19,8 +19,10 @@ const container = document.getElementById("sigma-container") as HTMLElement; const link = document.getElementById("sigma") as HTMLElement; const home = document.getElementById("home") as HTMLElement; + const add = document.getElementById("add") as HTMLElement; link.classList.add("active"); home.classList.remove("active"); + add.classList.remove("active"); // Instantiate sigma: const graph = new Graph();