Performance with many Nodes

Hi Walter,

I’ve got performance issue (regarding to the number of Nodes created >1000), and that why I want to adapt your Virtualizing project to my need (As Node position is known after a layout computation).
My grid is a GridLayout, but we use an override DoLayout method .
So I wonder how I can used your example.
Can you help me please?

Second problem is that I’m using (as you know) Layout in layout. From now I’ve only calculate a relative position (always based on Position (0,0) ) in the layout and use Move method to have all the internal layout moved to the right place. I wonder how can I get the absolute Node position in the diagram.

Third Problem is that Node do not have a fix size, regarding to text and number of sub-Node.

Virtualization depends on knowing the positions and sizes of all nodes in the model before any Nodes or Links are created in the diagram. So the virtualized layout cannot depend on the precise sizes of the nodes, for example in case they depend on the measurement of TextBlocks, or for groups that have uncomputable sizes . Are you sure you cannot force all nodes to have either fixed or simply computable sizes?

OK, according to your comment it works with groups.
It means that I have to found a “simply computable sizes” algorithm.

As group position are relative to the layout they are included (start always from Point (0,0), how can I set the “right” location for a node. I’m blocked on this point.

The layout associated to the group should be a virtual layout too?

Thanks for helping.

Everything has to be positioned using only the model and its data, because there can be no Nodes or Links. There can only be a Group.Layout if there is a Group.

That’s everything has to be calculated outside the Diagram is clear. Until now I’ve set node position inside a group using a relative position to [0, 0] inside the group and the Diagram has moved all elements inside the group at the right position when parent layout was calculated. It was really comfortable.
Now I’m not able to use such advantage.
How should the data position being calculated when data is inside a group, and this group is also inside a group (and so on…).

Yes, it’s simpler for a Group.layout because whichever layout that is outside of the group will be responsible for moving the group as if it were an atomic entity. This is easy to accomplish by calling the Node.Move method.

The group-member relationship forms a tree-like structure. So if your layout is simple enough, you could do a tree-walk, starting at the top-level nodes and recursing down through the groups. At each point when you start laying out a group you know what it’s position (i.e. top-left corner) will be.

But if the layout you want is more complicated, a simple tree-walk won’t be sufficient, and you’ll need to layout each of the groups and then move the groups.

5 posts were split to a new topic: Group border in wrong place

Another question.

I’ve defined the diagram panel at the top left.

I’m using my own algorithm to place group and sub group.

Now if I set an offset on sub group location in layout algorithm (for example to add text above the diagram), part of sub-node is outside the diagram panel.

What should be the good way to process to managed my problem ?

Your layout code needs to take that extra space into account. Position the first member node of each group with a slightly larger Y value.

Hi Walter,

I’ve a question regarding Overview and Virtualization.

As you see in my screen copy, nodes visible in viewport are displayed in overview but I miss all other node.
When node have been at least once displayed in viewport they are still visible in overview (as I want it). I’ve adapted the method FilterNode to filter everithing in overview diagram except root group. That the reason why gray group are not visible in overview.

What should I do to display all root node in overview without been first being displayed in viewport?


Any Overview is inherently counter-productive to or antithetical to the idea of virtualization.

I suggest that you create your own overview that is just a regular Diagram with whatever nodes that you want to show.

A post was split to a new topic: Creating Groups