Draw problem when annotation is above port

Hello,
when annotation is added, port cannot be hovered with draw tool.

Example: https://stackblitz.com/edit/angular-khc79d-xeejrj



Attachment: chrome_BlUFc4cKaT_f506c2be.zip

4 Replies

GE Gabo EE April 20, 2020 09:54 AM UTC

It does not even work when annotation has 
{
     visibility: false,
}





AR Aravind Ravi Syncfusion Team April 21, 2020 06:25 AM UTC

Hi Gabo, 
 
Solution 1: When you add annotations at run time it will render over the port if both annotations and port have the same offset. In the sample, you have added annotations and ports both at the same offset. When you mouse over on port, annotation is got as an element under mouse, not port. So that when mouse over on port tool does not change as a drawing tool. We have modified your sample to a mouse hover on the port change tool as drawing tool. In this sample, we have added annotation content as “on the first render and change the annotation content through a button click. Please find below code snippet how to add annotation content 
 
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(); 
  } 
 
 
Solution 2: When you add an annotation at a run time add an annotation in different offset compared to port offset. So that annotation and port rendered in different offset and mouse hover on port drawing tool appears. 
 
 
Regards 
Aravind Ravi 



GE Gabo EE April 21, 2020 08:35 AM UTC

Can Solution 2 be achieved programmaticaly? Is there any property of annotation that can wrap annotation aroung port?



AR Aravind Ravi Syncfusion Team April 22, 2020 12:04 PM UTC

Hi Gabo, 
 
Yes we have an wrapping support for an annotation. By using textWrapping property in annotation we can wrap the annotation in node. For more information about annotation wrapping property please refer to below UG documentation link 
 
 
 
If we misunderstood your requirements please share us a screen shot of how do you want to arrange annotation around port which would help us to proceed further. 
 
Regards 
Aravind Ravi 


Loader.
Up arrow icon