Scale child nodes inside groups

I wanted to have a parent group of fixed size which can contain many child nodes.Also, what I want is that as the child nodes increase, the parent group size should not increase ,but the contents inside the parent should scale(shrink) accordingly.
Similarly if i delete any children nodes, the other remaining nodes inside the parent group should scale(expand) according to the space available in the parent group.

So,to summarize,i want 2 things,

  1. A fixed group
  2. Scalability inside each individual group according to the size and number of children nodes.

Thanks in advance,

Don’t use a Placeholder in your Group template. GoJS Sized Groups -- Northwoods Software

Hey walter,
Thanks, that helped with the group fixing.

Can you also help me out with the automatic resizing of child nodes in a group?

Attached below is a pic explaining the requirement.
The parent size is constant but the child nodes are automatically shrinking or expanding.

Thanks for providing some screenshots. But it’s still unclear in my mind exactly what you want to have happen. I’m assuming that the number of member Nodes changes over time, and at each such time you want those nodes to fit inside your Group.

It’s clear that you want to set the positions or locations of the member Nodes to be closer to each other or farther apart. It isn’t clear if you want to change their effective size by actually changing their desiredSize (or the width and height), either of the whole Node or of the Node.resizeObject. Or whether you just want to set their scale.

My guess at this time is that you want a custom Layout as your Group.layout. That layout will know the width of the group and you know what padding and spacing you want to maintain, so you can calculate what position you want each node to be at and what size you want each node to be. If the nodes are naturally different sizes from each other you’ll probably want to maintain relative sizes, but I don’t know what you want to do.

There are a bunch of example custom Layouts. Read Extending GoJS -- Northwoods Software and look at the many layout classes throughout the extensions and samples directories.

Hey Walter,

To answer your questions,

  1. That’s right, the number of member Nodes will change over time, items can be added to the group from panel via drap-drop.

  2. I would like to set the scale on my nodes.

  3. And as of now, the nodes are of the same size

Try Minimal GoJS Sample.

Here is the initial group along with two copies, each whose group width was resized: