feat: added ReactFlow-based node graph #11

Merged
j.gerla merged 68 commits from feat/visual-programming-interface into dev 2025-10-28 11:59:03 +00:00
3 changed files with 44 additions and 12 deletions
Showing only changes of commit 70ebb16359 - Show all commits

View File

@@ -1,7 +1,39 @@
.default-node { .default-node {
padding: 10px 20px; padding: 10px 15px;
background-color: white; background-color: white;
outline-style: solid;
border-radius: 5pt; border-radius: 5pt;
outline-width: 1pt; outline: black solid 2pt;
filter: drop-shadow(0 0 0.75rem black);
}
.default-node__norm {
padding: 10px 15px;
background-color: white;
border-radius: 5pt;
outline: forestgreen solid 2pt;
filter: drop-shadow(0 0 0.25rem forestgreen);
}
.default-node__phase {
padding: 10px 15px;
background-color: white;
border-radius: 5pt;
outline: dodgerblue solid 2pt;
filter: drop-shadow(0 0 0.25rem dodgerblue);
}
.default-node__start {
padding: 10px 15px;
background-color: white;
border-radius: 5pt;
outline: orange solid 2pt;
filter: drop-shadow(0 0 0.25rem orange);
}
.default-node__end {
padding: 10px 15px;
background-color: white;
border-radius: 5pt;
outline: red solid 2pt;
filter: drop-shadow(0 0 0.25rem red);
} }

View File

@@ -120,20 +120,20 @@ export function Sidebar() {
); );
return ( return (
<aside> <aside style={{padding: '10px 10px',outline: '2.5pt solid black',borderRadius: '5pt', borderColor:'dimgrey', display:'flex', flexDirection: 'column', gap: '1rem'}}>
<div className="description"> <div className="description">
You can drag these nodes to the pane to create new nodes. You can drag these nodes to the pane to create new nodes.
</div> </div>
<DraggableNode className="default" nodeType="start" onDrop={handleNodeDrop}> <DraggableNode className="start" nodeType="start" onDrop={handleNodeDrop}>
start Node start Node
</DraggableNode> </DraggableNode>
<DraggableNode className="default" nodeType="end" onDrop={handleNodeDrop}> <DraggableNode className="end" nodeType="end" onDrop={handleNodeDrop}>
end Node end Node
</DraggableNode> </DraggableNode>
<DraggableNode className="default" nodeType="phase" onDrop={handleNodeDrop}> <DraggableNode className="phase" nodeType="phase" onDrop={handleNodeDrop}>
phase Node phase Node
</DraggableNode> </DraggableNode>
<DraggableNode className="default" nodeType="norm" onDrop={handleNodeDrop}> <DraggableNode className="norm" nodeType="norm" onDrop={handleNodeDrop}>
norm Node norm Node
</DraggableNode> </DraggableNode>
</aside> </aside>

View File

@@ -48,7 +48,7 @@ export const StartNode= ({ id, data }: StartNodeProps) => {
return ( return (
<> <>
<Toolbar nodeId={id} /> <Toolbar nodeId={id} />
<div className="default-node"> <div className="default-node__start">
<div> data test {data.label} </div> <div> data test {data.label} </div>
<Handle type="source" position={Position.Right} id="start" /> <Handle type="source" position={Position.Right} id="start" />
</div> </div>
@@ -65,7 +65,7 @@ export const EndNode= ({ id, data }: EndNodeProps) => {
return ( return (
<> <>
<Toolbar nodeId={id}/> <Toolbar nodeId={id}/>
<div className="default-node"> <div className="default-node__end">
<div> {data.label} </div> <div> {data.label} </div>
<Handle type="target" position={Position.Left} id="end" /> <Handle type="target" position={Position.Left} id="end" />
</div> </div>
@@ -83,7 +83,7 @@ export const PhaseNode= ({ id, data }: PhaseNodeProps) => {
return ( return (
<> <>
<Toolbar nodeId={id}/> <Toolbar nodeId={id}/>
<div className="default-node"> <div className="default-node__phase">
<div> phase {data.number} {data.label} </div> <div> phase {data.number} {data.label} </div>
<Handle type="target" position={Position.Left} id="target" /> <Handle type="target" position={Position.Left} id="target" />
<Handle type="target" position={Position.Bottom } id="norms" /> <Handle type="target" position={Position.Bottom } id="norms" />
@@ -102,7 +102,7 @@ export const NormNode= ({ id, data }: NormNodeProps) => {
return ( return (
<> <>
<Toolbar nodeId={id} /> <Toolbar nodeId={id} />
<div className="default-node"> <div className="default-node__norm">
<div> Norm {data.label} </div> <div> Norm {data.label} </div>
<Handle type="source" position={Position.Right} id="NormSource" /> <Handle type="source" position={Position.Right} id="NormSource" />
</div> </div>