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
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
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?
OK. Thanks Aravind