This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I built an application based on the LayoutAlgorithmExplorer with minimal changes. The graph contains 7000 nodes and about 16000 connections. The code hangs on the following statement: ds.Diagram = BuildSampleDiagram(); How can this be sped up? Thanks |
|
|
Hello The LayoutAlgorithmExplorer calls the DiagramSurface.SizeToFit method when the application window has loaded. If you are also doing this in your app, the diagram surface will be zooming out and then trying to render all 7000 nodes and 16000 connections. This is too much for WPF to handle. Similarly, this will be a problem if all your nodes are positioned in a small area. If you don't call SizeToFit, then there will still be a delay as the diagram loads that many model objects, but should come right in a few seconds and then you'll be able to edit and pan the diagram with little or no lagging. The DiagramSurface uses virtualization which allows it to handle a large number of items in the diagram by only rendering what fits in the vieport. If you do need to be able to zoom out to see a large number of nodes at once, the best option would be to create custom node templates that have different levels of detail. When zoomed out, you'd have your nodes render with a very simple template containing a couple of UI elements such as a colored border and possibly a label. Zooming in could then cause nodes to use the normal/full template with whatever detail you want. This technique has been used by a couple of our customers with much success. Let me know if you have further questions. -Jason Fauchelle |
|