set up of react flow done, example of custom node created, not typed
This commit is contained in:
parent
464bd6c6f7
commit
1cc5a31127
4 changed files with 75 additions and 3 deletions
28
space_flow/src/CustomNodes/inputTextFolder/index.tsx
Normal file
28
space_flow/src/CustomNodes/inputTextFolder/index.tsx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { useCallback } from 'react';
|
||||
import { Handle, Position } from 'reactflow';
|
||||
|
||||
|
||||
const handleStyle = {left:10};
|
||||
|
||||
export default function TextUpdaterNode({data})
|
||||
{
|
||||
const onChange = useCallback((evt)=>{
|
||||
console.log(evt.target.value)
|
||||
},[])
|
||||
|
||||
|
||||
return (
|
||||
<div className="text-updater-node">
|
||||
<Handle type='target' position={Position.Top}/>
|
||||
<div>
|
||||
<label htmlFor='text'>Text:</label>
|
||||
<input id="text" name="text" onChange={onChange}></input>
|
||||
</div>
|
||||
<Handle type='source' id='a' position={Position.Bottom} style={handleStyle}/>
|
||||
<Handle type='source' id='b' position={Position.Bottom}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
14
space_flow/src/CustomNodes/inputTextFolder/inputText.css
Normal file
14
space_flow/src/CustomNodes/inputTextFolder/inputText.css
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
.text-updater-node {
|
||||
height: 50px;
|
||||
border: 1px solid black;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.text-updater-node label {
|
||||
display: block;
|
||||
color: #777;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue