microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.35k stars 304 forks source link

MSAGL dragging slowness issue #94

Open Alfa123456 opened 7 years ago

Alfa123456 commented 7 years ago

I have created my own node by dropping a node using DrawNodeDelegate. I have used the method GeometryGraphCreator.CreateGeometryNode() to create the node. But my problem is, if I tried to move a Node using mouse move, it seems that node moving very very slowly and some graphics rendering issues also found. I have following the sample FindEmptySpotSample in MSAGL example, the same issue is found there also while drawing a rectangle in graghing pane using 'Insert rectangle' button.

Please anyone help to solve this issue.

Thanks, Sathish

levnach commented 7 years ago

Did you profile your application? Where is the time spent?

Alfa123456 commented 7 years ago

I have follow the same logic used in the sample FindEmptySpotSample, the same issue is found there also, could you please check that project?

smwikipedia commented 7 years ago

I encountered similar issue. I draw a graph with around 20 nodes. And drag a node is very slow. I drag the node but the node doesn't move at all. After I move the mouse to a new location and left-click that new location. The node suddenly moves to there. And the line is broken. Like this:

broken line

levnach commented 7 years ago

Were you running a Debug or Release build? The Debug configurations can be slow because of all kind of time additional correctness checks.

john-e-lewis commented 7 years ago

I'm getting the same behaviour with both debug and release builds. Would be great to get this fixed as async operation is a beautiful thing. Key Issue for me is the redrawing of the moved edges.

Attached zip has mp4 that shows the issue (release build) Test.zip

jasonumd commented 6 years ago

Anyone ever have a fix for this? I experience it as well.

amonroejj commented 2 years ago

This is still a problem in 3.0.0.0.

The undraggability problem does NOT occur if I build a Msagl.Drawing.Graph, populate it with Msagl.Drawing.Node, then hand the finished Graph to the viewer.

The undraggability problem DOES occur if, after the above steps, I add a node directly to the viewer at runtime when the user ctrl+clicks on the viewer control. I create an Msagl.Drawing.Node, pass that to Viewer.CreateIViewerNode to get an Msagl.Drawing.IViewerNode, manually set .GeometryNode.Center to the user's click coordinates, and it DOES appear on screen, but the NEW node's drag behavior is very faulty just as described by @smwikipedia. Note that the faulty drag behavior does NOT affect the still-present first generation nodes that were added at form open time.

amonroejj commented 2 years ago

This is still a problem in 3.0.0.0.

The drag behavior bug was later fixed in 8b9f6c2d924ed20f95a6c4b819e2ff3ab757b8fb. However, I was using the library from Nuget, which as of this writing (May 2022) is terribly outdated. That's why I was still experiencing this bug. Using a newer release downloaded directly from the github releases list fixed this.