How to use the @projectstorm/react-diagrams.PortModelAlignment.BOTTOM function in @projectstorm/react-diagrams

To help you get started, we’ve selected a few @projectstorm/react-diagrams examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github projectstorm / react-diagrams / packages / diagrams-demo-gallery / demos / demo-custom-node1 / index.tsx View on Github external
//3-C) link the 2 nodes together
	var link1 = port1.link(node2.getPort(PortModelAlignment.LEFT));
	var link2 = port3.link(node2.getPort(PortModelAlignment.RIGHT));

	var node4 = new DefaultNodeModel('Node 4', 'rgb(0,192,255)');
	var port4 = node4.addOutPort('Out');
	node4.setPosition(200, 10);

	var link3 = port4.link(node2.getPort(PortModelAlignment.TOP));

	var node5 = new DefaultNodeModel('Node 5', 'mediumpurple');
	var port5 = node5.addInPort('In');
	node5.setPosition(400, 300);

	var link4 = port5.link(node2.getPort(PortModelAlignment.BOTTOM));

	//4) add the models to the root graph
	model.addAll(node1, node2, node3, link1, link2, node4, link3, link4, node5);

	//5) load model into engine
	engine.setModel(model);

	//6) render the diagram!
	return (
		
			
		
	);
};
github projectstorm / react-diagrams / packages / diagrams-demo-gallery / demos / demo-custom-node1 / DiamondNodeWidget.tsx View on Github external
style={{
						left: this.props.size - 8,
						top: this.props.size / 2 - 8,
						position: 'absolute'
					}}
					port={this.props.node.getPort(PortModelAlignment.RIGHT)}
					engine={this.props.engine}>
					
				
				
					
				
			
		);
	}
}