Speed up load time

i have the tree layout, and i am trying to load about 1800 nodes to the topology, it takes about 35 seconds.

our tree can support thousands of nodes,and this time is not so good, is there a way to speed up things, maybe a faster load, or maybe on each expand, load the children at run time, and not all of the tree on startup?



thanks.

Have you read this: Performance considerations?

Although virtualization might not be possible in your situation.
If you really need to show all 1800+ nodes at once initially, you’ll need to simplify the node DataTemplate(s).

i try to simplify my DataTemplate, and still its taking long time.



about the example you sent me:



i used your code on my application, and i can’t see any nodes (although in the model i can see that the nodes are there, and very quick i must say)

is it because the location of each node in my app is Nan?





if i want to see it like a tree, and all the nodes are collapsed, why do i need to specify the location? can i do a layout rearrange on expand node?





thanks.

Yes, a Node without a Location (i.e. Node.Location has X or Y value being NaN) means that the Node will not be seen.

Normally the Diagram.Layout would automatically assign a location to such a Node.

However, if you are using the example’s VirtualizingPartManager, the Node won’t even get created unless it’s data.Location is known to be within the diagram’s viewport bounds. Of course if there is no data.Location, it can’t be considered to be within the viewport bounds.

If you don’t mind organizing your application so that the initial diagram starts off with a limited number of nodes and allows the tree to grow dynamically, then you don’t need the example’s VirtualizingPartManager. You could just implement it in the same manner that the Incremental Tree sample does, in GoSilverlightDemo. The Incremental Tree sample is a lot simpler than the VirtualizingPartManager sample.

The Incremental Tree sample uses a Diagram.Layout that is a ForceDirectedLayout, but you could easily use a TreeLayout instead, if that’s what you want.