Is it possible trigger a drawonce connector from a user handle click?

Hi, 

I was wondering if it possible to start drawing a connector line as I click on the user handle.  

It is quite hard to explain in words, so here is a video that explains.. 

And here is a stackblitz of what I have tried 

It would be fantastic if it is possible to do this!  

Many thanks,

Geoff


5 Replies

SG Shyam G Syncfusion Team March 4, 2022 02:08 PM UTC

Hi Geoff,


Yes, you can draw the connector from user handle by setting connector type to the diagram drawingObject property. We have modified your sample and shared below.


Code example:


 class AddArrowToRightTool extends ConnectorDrawingTool {

  public diagram: Diagram = null;

  public node: NodeModel = null;

 

  public mouseUp(args: MouseEventArgs): any {

    this.diagram.clearSelection();

  }

 

  public mouseDown(args: MouseEventArgs): Promise<void> {

    args.actualObject = this.node as IElement;

    this.diagram.drawingObject = {

      type: 'Orthogonal',

      sourceID: args.actualObject.id, // Code added

    };

    return super.mouseDown(args);

  }

}



Sample: https://stackblitz.com/edit/angular-bmptks-albrvc?file=app.component.ts


Regards,

Shyam G



GE Geoff March 5, 2022 02:09 AM UTC

Shyam, thanks so much!  That is perfect. 


Follow-up question.  I'd like to show the user a preview/hint when they hover over the user handle.  Is it possible to get the mouseover event? 



AR Aravind Ravi Syncfusion Team March 7, 2022 12:19 PM UTC

Hi Geoff, 

In the diagram we have mouseover support only for the nodes and connectors. We do not have mouseover event support or tooltip support for the userhandle. We have already logged the feature request for your requirement.  We will implement this feature in any of our upcoming releases. We will update you once the feature is implemented. 
   
You can track the feature status from the below link 


Regards 
Aravind Ravi 



GE Geoff March 8, 2022 05:17 AM UTC

OK. Thanks Aravind



AR Aravind Ravi Syncfusion Team March 9, 2022 10:19 AM UTC

Hi Geoff 

Most Welcome. 

Regards 
Aravind Ravi 


Loader.
Up arrow icon