Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions backend/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<link rel="icon" type="image/png" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>gDetour</title>
<script type="module" crossorigin src="./assets/index-e95dfd60.js"></script>
<link rel="stylesheet" href="./assets/index-2ee83d83.css">
<script type="module" crossorigin src="./assets/index-14264141.js"></script>
<link rel="stylesheet" href="./assets/index-8887144e.css">
</head>
<body>
<div id="app"></div>
Expand Down
20 changes: 20 additions & 0 deletions frontend/compile_svelte.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2025 Kwimbee
#
# This file is part of gDetour.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

npm run build
Remove-Item -Force -Verbose -Recurse ..\backend\static\*
Copy-Item -Force -Verbose -Recurse .\dist\* ..\backend\static\
11 changes: 10 additions & 1 deletion frontend/src/ButtonEdge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
useEdges,
} from "@xyflow/svelte";

import { nodes } from "./flow_stores.js";

type $$Props = EdgeProps;

export let id: $$Props["id"];
Expand All @@ -51,8 +53,15 @@

const edges = useEdges();

const onEdgeClick = () =>
function onEdgeClick() {
// makes the output node connectable again after deleting the edge
const current_edge = $edges.find((edge) => edge.id === id);
const output_node_id = current_edge.target;
const output_node = $nodes.find((node) => node.id === output_node_id);
output_node.connectable = true;

edges.update((eds) => eds.filter((edge) => edge.id !== id));
}
</script>

<BaseEdge path={edgePath} {markerEnd} {style} />
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/Edges.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
}
function clearEdges() {
edges.set([]);

// makes output nodes connectable after clearing all mappings
const outputs = $nodes.filter((node) => node.type === "output");
outputs.forEach((output) => {
output.connectable = true;
});
$nodes = $nodes;
}
</script>

Expand Down
19 changes: 12 additions & 7 deletions frontend/src/Flow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import { edges, nodes, dmx_mapping } from "./flow_stores.js";
import { Panel } from "@xyflow/svelte";


import {
SvelteFlow,
Controls,
Expand Down Expand Up @@ -72,10 +71,16 @@
//new_dmx_mapping[x] = y;
new_dmx_mapping.push([x, y]);
edge.type = "button"; // for the remove button

const output_node = $nodes.find((node) => node.id === edge.target);
output_node.connectable = false;
});
dmx_mapping.set(new_dmx_mapping);
console.log("dmx mapping", dmx_mapping);

$edges = $edges;
$nodes = $nodes;

sendMapping();
}
const snapGrid = [25, 25];
Expand All @@ -86,12 +91,12 @@
<SvelteFlow {nodes} {edges} {edgeTypes} {snapGrid} {proOptions} fitView>
<Controls />

<Panel position="top-right">
<ButtonOneToMany />
</Panel>
<Panel position="bottom-right">
<ButtonSelectSameAttribute />
</Panel>
<Panel position="top-right">
<ButtonOneToMany />
</Panel>
<Panel position="bottom-right">
<ButtonSelectSameAttribute />
</Panel>
<Background bgColor="#1d72aa" variant={BackgroundVariant.Dots} />
</SvelteFlow>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Modes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
},
address: `${item.geometry}_${item.id}`,
position: { x: node_x, y: node_y * index },
connectable: true,
});

console.log(
Expand Down