2

I'm trying to create a shapes palette, which is a set of shapes our developers will choose from when creating documentation.

Some of the shapes I'm including are created by combining shapes from the shapes menu into a grouped shape.

Shapes Menu
Shapes Menu

I can isolate the shapes palette in its own diagram for use by the developers but I'm running into various issues specific to the grouped shapes. The grouped shapes may be accidentally ungrouped, and they may also behave in unexpected ways. For example, when scaling a grouped shape, the individual shapes may not scale consistently.

Do I need to manually create SVG files or is there a way within the app to convert a grouped shape into a single shape?

I am open to workarounds using graphical or XML tools even from the command line.

3
  • A semi-workaround is to make the set the style "part=1" on the shapes contained in the group. When you perform move operations they will take place on the group instead of the children. Commented Dec 2, 2017 at 15:27
  • But if you want a professional set of icons, I would suggest to build them using, at least, SVG. Commented Dec 2, 2017 at 15:28
  • @David, I didn't understand your workaround. You're suggesting that I ungroup, select individual shapes, and then "make the set the style "part=1". I put together a square and a circle, selected each in turn, chose Edit Style... from menu, and added 'part=1;' to the line of text. I was then unable to move them at all.
    – Chap
    Commented Dec 3, 2017 at 0:37

2 Answers 2

2

I've searched for a solution but found no in-app way to merge a group into a new shape. It is such basic functionality that I'm baffled it's missing.

The only options I've found are:

  1. Manually define a custom shape using XML as draw.io documented in "Create and edit complex custom shapes"
  2. Use an SVG creator to create your shape, then drop the exported file into your diagram. Note that you can't just paste the SVG code.
  3. Create grouped shapes in the apps and use them only directly from the scratchpad. It's helpful to isolate them on their own layer. Also, try to avoid saving the scratchpad (perhaps you wanted to delete an element) because the group will get bigger (see image below).

    Group size before and after saving to scratch
    Group before and after saving to scratch
0

I've tried @David's solution. It works, but you need to apply part=1 style ONLY to the elements inside the group and not to the group itself. Otherwise, you won't be able to move the entire group. Let's assume, that you have a rectangle with a circle inside the rectangle. Then you group them together. Next, you select one by one, the circle, and then the rectangle inside the group and set the style to part=1 for both using the "Edit Style" option. Then, no matter what you select from that group, you will move all the elements together. Unfortunately, it doesn't protect the grouped shapes from being resized though.

1
  • This answer would benefit from clarification. It refers to a solution but no answer predates it. If there is info in the comments that is relevant to the answer, please edit the answer to include that so that it is clear what you mean. Comments are disposable and questions and answers should include all relevant details.
    – Blindspots
    Commented Sep 16 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.