How do I create Visio style connectable shapes with text in Inkscape?

I’d like to use Inkscape to create architecture diagrams like this one:

enter image description here

The connector tool that Inkscape has seem to work okay, from what I see.

What I’m still struggling with is an easy way to add connectable shapes with their own border, background color and possibly shadow that shrink or expand based on their text content.

Also, I’d like to anchor the text content to the middle of the shape.

Is this something that can be done reasonably well in Inkscape or should I use other, more specialized tools for diagrams like this?

Answer

Yes, there’s a kind of work around in Inkscape, although nothing that will resize the container automatically when typing, but certainly text can be flowed inside a shape automatically.

Here are the steps:

  1. Go into Edit > Preferences, select Behaviour, and choose Transforms – uncheck the “Scale Stroke Width” and “Scale Rounded Corners in Rectangles” options. This will ensure you can transform a shape without messing with the rounded corners or stroke width.

  2. Create a shape, such as a rectangle, add a stroke so you can see it.

  3. With the Text Tool, click once to type some text outside the rectangle – all the text should be on a single line at this stage. Select both shape and text, and click Text > Flow into Frame.

  4. Highlight the text with the Text Tool, and hit the Align Centre button in the toolbar along the top.

  5. With the Select and Transform Objects Tool (F1), select and move the text so it is centred inside the shape container.

  6. Select the text and the shape container, and group them

  7. Apply a Drop Shadow Filter to the group.

  8. When you need to edit the text inside, or resize the shape, double click using the Select and Transform Objects Tool (F1) to enter the group, then you can resize the shape, and the text will flow inside it, or you can type some new text, and then resize the shape container. Note: to exit the group, double click outside it.

Here’s the result shown below. It is a resizable container into which the text flows automatically.

enter image description here

Obviously, if you add an extra line, or one line less of text, or resize the shape vertically, then you are going to have to reposition the text inside the container manually again as in Step 5.

Here’s the Inskcape SVG file if you want to play with it. The text doesn’t show up in the browser, but should if you save the SVG and open it in Inkscape. I don’t know how long this link will last.

Attribution
Source : Link , Question Author : Gergely , Answer Author : Billy Kerr

Leave a Comment