Hi Walter, I’ve got a strange effect with Collapsed Group, link and virtualization.
I’m using your CollapseSubGraph method. When I do it intern link are showned on subgraph group.
At this point my intern doesn’t have a valid position anymore. I do not calculate a position for not visible node, therefor when a link to or from is not visible, I search for the first visible parent and check intersection from this node with the viewport.
When I’m moving the viewport link disappear when subgraph node is no more visible, but for a reason I cannot explain, some node are made visible again when link is in viewport again.
This adding is initiate by a call to the method AddNodeForData done in Virtualization check. The Status of the Subgraph node is unchanged (still collapsed). (Arrow show the Collapsed status)
I precise that when for example node to in viewport and node from not, when subgraph node From is partially in viewport (I would says parent Subgraph is in View but not visible node not) link is added but From is at position (0,0) not set on the Subgraph. And it’s when from should be visible in Viewport that Node to visibility value is changed.
It seems as if the problem is that in your virtualization code you are deciding to add a Link that should not be visible. But because it is visible, and because the nodes it connects are not both visible, the route that the link is taking is wrong.
So is the problem that you are deciding to show the link when you should not be showing that link? Whenever you decide to show a link, both connected nodes (in your case that includes the collapsed groups) had better be there first.
Node are not visible because they are in a collapsed group. Therefor to decide if link intersect the viewport I’m using group position, because when a node is not visible I do not calculate it’s position anymore.
In this case what should be the right way to deal with node position ?
1/ Reset Node position to NaN
2/ Give Node it’s parent group position
3/ it doesn’t care
As link between 2 sub-nodes is shown from group to group when both group are collapsed, logically for me link should be visible as soon as groups are in the viewport.
FYI I’m showing a link only when both source and destination are in the viewport.
– Update –
I could solved my problem by setting sub-node position and dimension to first visible parent group position and dimension.
I don’t know if this is the right way to proceed but it works.
So my question, when a group is collapsed what should be the parameters of sub-node in term of position and dimension ?
I hope you are using the Group’s Bounds, not just the Position. Otherwise you will have a problem with groups that are scrolling into the viewport from the top.