Multi-select bounding boxes

Hi -

I was curious if you could point me in the right direction to implement a bounding box that would encompass everything you have selected - specifically I want this in the event that you have more than one object selected.

thank you,
Caleb

Take a look at: Minimal GoJS Sample with Multi Selection Box

Note that the Diagram.computePartsBounds ignores Links in its computation. If you care about Links, you’ll need to compute the union of the Part.actualBounds yourself.

What would it take for us to use multi select box example and do the following:

  1. Add rotate handle adornment onto the multiselect bounding box.
  2. Allow all selected objects within the bounding box to rotate around the center point of the bounding box.
  3. Provide resizing of all the objects within the bounding box as we stretch or compress the bounding box.

I used another popular diagramming tool to provide an example.

  1. So in IMAGE 1 below we have 8 squares that are all selected and contained in a bonding box with a rotation handle at the top center of the bounding box.

  2. We were able to rotate the bounding box and all the squares rotated around the center point of the bounding box.

  3. Then we grabbed the right bottom corner of the bounding box, stretched it to the bottom right and caused the bounding box to resize, along with all the squares relative to the stretching of the bounding box. The outcome in pictured in IMAGE 2.

We would also like to use GoJS to implement the same capability with groups.

IMAGE 1

IMAGE 2

So basically you want the functionality already offered by http://gojs.net/latest/extensions/RotateMultipleTool.js (and demonstrated in http://gojs.net/latest/extensions/FloorPlanEditor.html), but with a single rotation handle and surrounding box. Is that correct?

I would guess that it wouldn’t be too hard to extend the RotateMultipleTool to do that.

Walter. How are you. Thanks for the response.

Mostly true. But what I found with the Floor Plan Editor was that the multiple objects were all resizing but not within a confine of a bounding box, and also they were overlapping each other when they got big enough. What we are looking for is that all the objects resize and remain the same relative distance between each other. So it would seem there is a bit of positional movement going on as well.

Look forward to hearing back. Have a great evening sir.

Wait – I thought you were asking about rotating, not resizing, multiple nodes.

You don’t have to use either the RotateMultipleTool or the ResizeMultipleTool extension, or you can modify either or both of them to do what you want.

I am not sure I understand your response.

We could discuss this outside of the forum if need be.

Hello all. Please let me know if we can communicate outside of the forum to clarify your last response.

You can send email, gojs at nwoods.com