-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
843b552
commit 5959de3
Showing
2 changed files
with
66 additions
and
39 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
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,62 @@ | ||
import { Box, Button } from "@material-ui/core"; | ||
import { DiagramEngine, PortWidget } from "@projectstorm/react-diagrams"; | ||
import * as React from "react"; | ||
|
||
type styleObject = { | ||
background: string; | ||
borderColor: string; | ||
boxShadow: string; | ||
} | ||
|
||
export interface NodeSelectionProps { | ||
style: styleObject; | ||
engine: DiagramEngine; | ||
port: any; | ||
} | ||
|
||
class NodeSelection extends React.Component<NodeSelectionProps> { | ||
render() { | ||
const { style, engine, port } = this.props; | ||
return ( | ||
<> | ||
<Button className="node-button"> | ||
<Box | ||
className="icon" | ||
style={style} | ||
/> | ||
Show properties | ||
</Button> | ||
|
||
<Box className="nodes"> | ||
<PortWidget | ||
engine={engine} | ||
port={port.getPort("in")} | ||
> | ||
<Box style={{ left: '-0.375rem', top: '-0.375rem' }} className="pointer" /> | ||
</PortWidget> | ||
<PortWidget | ||
engine={engine} | ||
port={port.getPort("out")} | ||
> | ||
<Box style={{ right: '-0.375rem', top: '-0.375rem' }} className="pointer" /> | ||
</PortWidget> | ||
|
||
<PortWidget | ||
engine={engine} | ||
port={port.getPort("in")} | ||
> | ||
<Box style={{ left: '-0.375rem', bottom: '-0.375rem' }} className="pointer" /> | ||
</PortWidget> | ||
<PortWidget | ||
engine={engine} | ||
port={port.getPort("out")} | ||
> | ||
<Box style={{ bottom: '-0.375rem', right: '-0.375rem' }} className="pointer" /> | ||
</PortWidget> | ||
</Box> | ||
</> | ||
) | ||
} | ||
} | ||
|
||
export default NodeSelection; |