Skip to content

Commit

Permalink
Fix example application
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsobspinto committed Jul 18, 2022
1 parent 2b596b6 commit a550d1e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions example/components/widgets/CustomNodeWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {MetaNodeModel} from "../../../.";
import {Typography} from "@material-ui/core";

export interface CustomNodeWidgetProps {
node: MetaNodeModel;
model: MetaNodeModel;
engine: DiagramEngine;
}

Expand All @@ -22,9 +22,9 @@ export class CustomNodeWidget extends React.Component<CustomNodeWidgetProps> {
alignItems: "flex-start",
justifyContent: "space-between",
position: "relative",
background: this.props.node.getOptions()['color'] || "darkgray",
top: this.props.node.getOptions()['position']?.y || 0,
left: this.props.node.getOptions()['position']?.x || 0
background: this.props.model.getOptions()['color'] || "darkgray",
top: this.props.model.getOptions()['position']?.y || 0,
left: this.props.model.getOptions()['position']?.x || 0
}

const circlePortStyle = {
Expand All @@ -42,18 +42,18 @@ export class CustomNodeWidget extends React.Component<CustomNodeWidgetProps> {
<PortWidget
style={{position: 'absolute', top: '0px', left: '0px'}}
engine={this.props.engine}
port={this.props.node.getPort("in")}
port={this.props.model.getPort("in")}
>
<div style={circlePortStyle}/>
</PortWidget>
<PortWidget
style={{position: 'absolute', top: '0px', right: '0px'}}
engine={this.props.engine}
port={this.props.node.getPort("out")}
port={this.props.model.getPort("out")}
>
<div style={circlePortStyle}/>
</PortWidget>
<Typography>{this.props.node.getOptions()['name']}</Typography>
<Typography>{this.props.model.getOptions()['name']}</Typography>
</div>
</>
);
Expand Down

0 comments on commit a550d1e

Please sign in to comment.