-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first round of custom nodes for visualizer (#799)
- Loading branch information
1 parent
9f2a335
commit 8582077
Showing
5 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {Handle, Position} from "@xyflow/react"; | ||
import {Grid2} from "@mui/material"; | ||
import AccountIcon from "@mui/icons-material/Person4"; | ||
|
||
const AccountNode = ({ data }) => { | ||
return ( | ||
<> | ||
<Handle type="source" position={Position.Bottom} /> | ||
<Grid2 container sx={{ flexGrow: 1, p: 1 }} alignItems="center"> | ||
<Grid2 display="flex"><AccountIcon sx={{ fontSize: 15, mr: 0.5 }}/></Grid2> | ||
<Grid2 display="flex">{data.label}</Grid2> | ||
</Grid2> | ||
</> | ||
); | ||
} | ||
|
||
export default AccountNode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {Handle, Position} from "@xyflow/react"; | ||
import {Grid2} from "@mui/material"; | ||
import EnvironmentIcon from "@mui/icons-material/Computer"; | ||
|
||
const EnvironmentNode = ({ data }) => { | ||
let shareHandle = <Handle type="source" position={Position.Bottom} />; | ||
if(data.empty) { | ||
shareHandle = <></>; | ||
} | ||
return ( | ||
<> | ||
<Handle type="target" position={Position.Top} /> | ||
{shareHandle} | ||
<Grid2 container sx={{ flexGrow: 1, p: 1 }} alignItems="center"> | ||
<Grid2 display="flex"><EnvironmentIcon sx={{ fontSize: 15, mr: 0.5 }}/></Grid2> | ||
<Grid2 display="flex">{data.label}</Grid2> | ||
</Grid2> | ||
</> | ||
); | ||
} | ||
|
||
export default EnvironmentNode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {Handle, Position} from "@xyflow/react"; | ||
import {Grid2} from "@mui/material"; | ||
import ShareIcon from "@mui/icons-material/Share"; | ||
|
||
const ShareNode = ({ data }) => { | ||
return ( | ||
<> | ||
<Handle type="target" position={Position.Top} /> | ||
<Grid2 container sx={{ flexGrow: 1, p: 1 }} alignItems="center"> | ||
<Grid2 display="flex"><ShareIcon sx={{ fontSize: 15, mr: 0.5 }}/></Grid2> | ||
<Grid2 display="flex">{data.label}</Grid2> | ||
</Grid2> | ||
</> | ||
); | ||
} | ||
|
||
export default ShareNode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters