Z-Index issue for groups and links


#1

I have a diagram with groups. I want the groups to be in front of the
other elements in the diagram except for the links between the objects
in the diagram and the objects in the group. Those links should be
under the nodes in the diagram and in front of the groups.

For the things to be more clear in terms of z-index it should be like this:

  • groups : z-index = 0 (only the drawing of the group shape not the objects in it)

  • links : z-index = 1

  • objects not in group: z-index = 2

  • objects in group: z-index = 3

Is this possible? Thank you for your time.


#2

Yes, except that the objects in the groups automatically must have the same layer as the groups themselves. In other words, you can specify the layer for a top-level (i.e. parent-less) object, but not for child objects, which will always be in the same layer as it’s top-level object.


#3

This means that the links will always be on top of the objects? Because
in our model the diagram contains many links and the objects must have
priority when selecting (and also is not good to be overriden by links)


#4

Oh, you can still have a separate LinksLayer that is behind the other objects. In fact, I suggest you have four separate layers, as you said you wanted. It’s just that you’ll need to manipulate the “group shapes” separately from their logical children, since they’ll need to be structurally independent in order to be in a different layer.


#5

After analyzing the problem a bit more it seems that it can not be
resolved using z-index stuff or (layers). Here it is a bit of
explanation: The nodes not in a group must be drawn in front of links
but when a link is between a node n1 and another node n2 that is in a
group, the link must be also drawn in front of the group (actually in
front of the group shape). In addition, the group shape must be drawn
in front of nodes that are not in group.

The only solution seems to split the links lines in two parts and to
draw them separately: until the line reach the group margin draw it
before the nodes and after the group margin draw it after the group
shape. I do not think this is supported in GoDiagram and any way looks
very difficult to implement.

Any other clue will be greatly appreciated,
Thanks


#6

Are you saying that your original requirement for four layers isn’t sufficient?


#7

Yes my first post describing the z-index requirements was wrong because
using those z-idexes the group shapes were drawn below the nodes not in
groups. This mean that when a group is moved on top of such an node
visually the node will still be drawn on top of the group - and this is
not correct because would be no difference between a node not in group
and a node in group.