Auto panel fixed location (in a group)

Hi,

The auto panel in a group automatically adjusts the location and desiredSize in order to contain the child elements. I am looking for a solution to put elements in a group while maintaining the location property of the group while maintaining a container that surrounds all elements in the group.

What I read about the Auto type, this is not possible since the shape is defined as width / height w.r.t. the location which means that the location needs to be adjusted in order to contain all nodes. Is this possible using another container? By giving the shape an offset w.r.t. the group location or something like this?

Thanks.

An “Auto” Panel in the simple common case just provides a border around an object.

The Placeholder is used in a Group to make sure the Group.location is determined by the bounds of the group’s members.

You can define your group template to be whatever you want, but if it includes a Placeholder, that is what determines the group’s location. Then you can have Shapes, TextBlocks, Pictures et al wherever you like however you like relative to the Placeholder.

Ok, but is it also possible to draw a border around a group but not using an explicit placeholder so that my group location will not get modified if my group member’s locations change?

You might want to read: https://gojs.net/latest/intro/sizedGroups.html

Just to be clear, it seems that you are asking for a group that has its own location independent of the locations of its members. If that is correct, then there is no way for the group to always be surrounding all of its members – a group’s location could be far away from where all of its members are.

Are you at least expecting a group’s location to be in or near its visuals, such as a Shape and/or a TextBlock?

As the Intro page mentions, you might want to constrain the movement of member nodes so that the user cannot drag or copy them beyond the visual bounds of the group. The same might be desired when resizing, if you allow that in your app, both when resizing a node and when resizing a group.

Maybe my question is not completely clear. I would like to have something like this:

So the group should hold a shape that includes all nods in the group but the location can be somewhere in the center (not necessarily).

You can set the Group.locationSpot to be whatever you need so that the Group.location has the point that you want.

But if there is a Group.placeholder and a member node moves (or is added or removed or resized), the Group.location may change. Of course you could modify the Group.locationSpot again.

If there is no Placeholder, the group’s location is independent of any and all member nodes.

In either case if the user moves a group, all of the group’s members are moved along. You can get the same effect programmatically by calling Group.move or Diagram.moveParts.

I still have no idea of what you want to accomplish and thus what your requirements really are.

Achieved desires behavior using the locationObjectName property and a go.Panel.Position panel.