With default settings the mxGraphComponent component lets the user drag an edge so that it ends up with not being connected to any nodes. As seen from a graph theoretical point of view, this does not make sense.

Can this be prevented? If so: How?

asked 01 Mar '12, 09:20

roald's gravatar image

roald
5318
accept rate: 0%

edited 19 Oct '12, 06:05

David's gravatar image

David
4.9k21831


mxGraph.setAllowDanglingEdges(false).

link

answered 01 Mar '12, 20:41

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

Yes, this works! Excellent! I suspected there was an easy answer.

(01 Mar '12, 20:56) roald

I just found a minor problem with this.

f I select an existing edge and drag it while I have the CTRL key pressed, a copy edge is created. This copy of the edge the becomes dangling. I can see a certain logic to this, since it is not obvious to which nodes that edge should connect. A possible solution could be: Automatically drop the new edge when the edge is deselected (i.e. if it is still dangling).

link

answered 01 Mar '12, 23:24

roald's gravatar image

roald
5318
accept rate: 0%

edited 19 Oct '12, 06:07

David's gravatar image

David
4.9k21831

1

Thanks for the report, this will be fixed in the next release.

(02 Mar '12, 22:47) Gaudenz
1

graph.setDisconnectOnMove(false);

This will prevent you from creating new dangling edges when you hold Ctrl key and drag a edge.

(05 Oct '12, 06:27) Tilak
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×194
×100
×45
×37

Asked: 01 Mar '12, 09:20

Seen: 2,513 times

Last updated: 19 Oct '12, 06:07