nodeModel.constraints = NodeConstraints.Default &~(NodeConstraints.InConnect | NodeConstraints.OutConnect); |
public nodeDefaults(node: NodeModel): NodeModel {
let obj: NodeModel = {};
obj.constraints = NodeConstraints.Default &~NodeConstraints.OutConnect;
} |
//disable connection between node to node
obj.constraints = NodeConstraints.Default &~(NodeConstraints.OutConnect | NodeConstraints.InConnect);
public nodes: NodeModel[] = [
{
id: 'node1', width:100,height:100,offsetX:200,offsetY:200,
ports: [
{
id:'port1', offset: {x: 1, y:0.5},
//we can connect target end of the connector to the node
constraints: PortConstraints.Default &~PortConstraints.OutConnect, visibility: PortVisibility.Visible
}
]
},] |
public nodes: NodeModel[] = [
{
id: 'node1', width:100,height:100,offsetX:200,offsetY:200,
ports: [
{
id:'port1', offset: {x: 1, y:0.5},
//we can connect target end of the connector to the node
constraints: (PortConstraints.Default | PortConstraints.Draw) &~PortConstraints.InConnect, visibility: PortVisibility.Hover | PortVisibility.Connect
}
]
},
]; |
public nodes: NodeModel[] = [
{
id: 'node1', width:100,height:100,offsetX:200,offsetY:200,
ports: [
{
id:'port1', offset: {x: 1, y:0.5},
//we can connect target end of the connector to the node
constraints: (PortConstraints.Default | PortConstraints.Draw) &~PortConstraints.InConnect, visibility: PortVisibility.Hover | PortVisibility.Connect
}
]
},
{
id: 'node2', width:100,height:100,offsetX:400,offsetY:200,
ports: [
{
id:'port1', offset: {x: 1, y:0.5},
constraints: (PortConstraints.Default | PortConstraints.Draw) &~PortConstraints.OutConnect, visibility: PortVisibility.Visible
}
]
}
]; |