2023-08-22 12:05:49 -04:00
|
|
|
<script>
|
2023-08-23 16:27:48 -04:00
|
|
|
import { nodes, edges} from "./stores.js";
|
2023-08-22 21:57:53 -04:00
|
|
|
import { SvelteFlow, Controls, Background, BackgroundVariant, MiniMap } from "@xyflow/svelte";
|
|
|
|
import Node from "./nodes/Node.svelte";
|
2023-08-22 13:12:24 -04:00
|
|
|
|
2023-08-22 21:57:53 -04:00
|
|
|
const nodeTypes = {
|
|
|
|
ffmpeg: Node,
|
|
|
|
};
|
2023-08-22 13:12:24 -04:00
|
|
|
|
2023-08-22 21:57:53 -04:00
|
|
|
const defaultEdgeOptions = {
|
|
|
|
deletable: true,
|
|
|
|
};
|
2023-08-22 12:05:49 -04:00
|
|
|
|
2023-08-22 21:57:53 -04:00
|
|
|
function onEdgeUpdate(e) {
|
|
|
|
console.log(e);
|
2023-08-22 12:05:49 -04:00
|
|
|
}
|
2023-08-22 13:12:24 -04:00
|
|
|
|
2023-08-22 21:57:53 -04:00
|
|
|
function onEdgeUpdateStart(e) {
|
|
|
|
console.log(e);
|
|
|
|
}
|
2023-08-22 13:12:24 -04:00
|
|
|
|
2023-08-22 21:57:53 -04:00
|
|
|
function onEdgeUpdateEnd(e) {
|
|
|
|
console.log(e);
|
2023-08-22 12:05:49 -04:00
|
|
|
}
|
2023-08-22 21:57:53 -04:00
|
|
|
function onMoveStart(e) {
|
|
|
|
console.log(e);
|
|
|
|
}
|
|
|
|
function onConnect(e){
|
|
|
|
console.log('connect', e);
|
|
|
|
}
|
2023-08-22 12:05:49 -04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
2023-08-22 21:57:53 -04:00
|
|
|
<div style="width: 900px; height: 500px;">
|
|
|
|
<SvelteFlow
|
|
|
|
{nodeTypes}
|
|
|
|
{nodes}
|
|
|
|
{edges}
|
|
|
|
snapGrid={[10, 10]}
|
|
|
|
fitView
|
|
|
|
>
|
|
|
|
<Controls />
|
|
|
|
<Background variant={BackgroundVariant.Dots} />
|
|
|
|
</SvelteFlow>
|
|
|
|
</div>
|