Hello,
I'm actually facing two issues.
First: I'm struggling with the appearance of the nodes and connectors in my diagram. The nodes and connectors lay behind the gridlines and I tried to figure out how this happened, but can't find any property or similar issue facing this problem. I attached a screenshot of the diagram below.
Second: My nodes have Input-ports and Output-ports. I set the port constraints of the outputs to Draw, so I can simply drag a new connector out of the port and connect it with another input. Now I wanted to ensure, that only In- and Output ports get connected. Following an earlier forum request (https://www.syncfusion.com/forums/133147/restrict-target-node-port-when-drawing-a-connector ) I used the diagram event "connectionChange". This event gets triggered always an existing connection gets changed. But when I draw a new connection from an output-port to another Input, the connectionChange event does not get triggered (is this behaviour wanted?). However, following another forum request (https://www.syncfusion.com/forums/163850/set-port-connector-draw-constraints) I utilized the "collectionChange" event, which gets triggered when a node or connector is added/deleted. In combination this works fine and fullfills my requirements. But to make it more nicely I would like to show the user while dragging a new node, that the actual connection would be valid or invalid. So is there an event which gets always triggered, WHILE a new connection is drawn and not AFTER?
Bonus:
Is there a simple way to visualize something like a SVG graphic or
something in the middle of a connector (e.g. instead of text)? To make
it more clear: I mean something like such a graphic, to show the current
connection would be invalid and deleted if the user drops the endpoint
at the actual position...
Thanks a lot!
Regards,
Constantin
query |
Response |
First: I'm struggling with the appearance of the nodes and connectors in my diagram. The nodes and connectors lay behind the gridlines and I tried to figure out how this happened, but can't find any property or similar issue facing this problem. I attached a screenshot of the diagram below. |
We cannot be able to replicate the reported issue at our end, we have added the sample link for your references. We request you to share with us more details about the reported issue. Please share a simple sample to replicate the reported issue or replicate the reported issue in the shared a sample, that will help use to go ahead further.
Sample link: https://stackblitz.com/edit/1bmshi |
Second: My nodes have Input-ports and Output-ports. I set the port constraints of the outputs to Draw, so I can simply drag a new connector out of the port and connect it with another input. Now I wanted to ensure, that only In- and Output ports get connected. Following an earlier forum request (https://www.syncfusion.com/forums/133147/restrict-target-node-port-when-drawing-a-connector ) I used the diagram event "connectionChange". This event gets triggered always an existing connection gets changed. But when I draw a new connection from an output-port to another Input, the connectionChange event does not get triggered (is this behaviour wanted?). However, following another forum request (https://www.syncfusion.com/forums/163850/set-port-connector-draw-constraints) I utilized the "collectionChange" event, which gets triggered when a node or connector is added/deleted. In combination this works fine and fullfills my requirements. But to make it more nicely I would like to show the user while dragging a new node, that the actual connection would be valid or invalid. So is there an event which gets always triggered, WHILE a new connection is drawn and not AFTER?
|
Currently we don’t have any event to notify the port connector drawing tool. Only option is using the collection change event, that will trigger after the connector drawing completed. |
Bonus: Is there a simple way to visualize something like a SVG graphic or something in the middle of a connector (e.g. instead of text)? To make it more clear: I mean something like such a graphic, to show the current connection would be invalid and deleted if the user drops the endpoint at the actual position... |
We suggest you use the annotation template to render a SVG or HTML content in the connector instead of text. Please refer to the following sample for how to render a SVG element in the connector.
Sample link: https://stackblitz.com/edit/lbnkf5
We can also add the SVG node in diagram. We have added the documentation link for SVG node for your references.
|
Hi Gowtham,
thanks for the fast response. I've managed to find the cause for the overlaying gridlines. I did diagram.appendTo('#myDiagramSpace');
twice at different positions in my code. After removing the second call everything works as expected again! :)
To the second question: This is a pity, because it would be a very useful feature for a visualized feedback whether the current connection would be valid or not. Maybe I will try to write my own event, but not in the near future.
Thanks again!
Regards,
Constantin
Hi Gowtham,
thanks for these fantastic news!
The functionalities listed would completely fulfill my requirements.
I am already looking forward to the implementation.
Regards,
Constantin