public nodes: NodeModel[] = [
{
id: 'operation', width:100,height:100,offsetX:250,offsetY:200,
constraints: NodeConstraints.Default &~(NodeConstraints.OutConnect),
shape: { type: 'Flow', shape: 'Terminator' },
style: { fill: '#357BD2', strokeColor: 'white' },
annotations: [{
content: "",
style: { color: 'black' },
offset: {x: 1, y: 0.8},
}],
ports: [
{
id:'operation-port2',
offset: {x: 1, y:0.8},
shape: 'Circle',
constraints: (PortConstraints.Default | PortConstraints.Draw) &~PortConstraints.InConnect,
visibility: PortVisibility.Visible,
}
],
},
];
//Change Annotation Content
public onDefaultModeClick(){
this.diagram.nodes[0].annotations[0].content = "PortPortPortPort";
this.diagram.dataBind();
} |