Is it possible to use custom images for UML items in plantUML?
Asked Answered
B

3

20

PlantUML is very powerful when you would like to create standard UML diagrams.

But I currently think about using PlantUML to document EIP routes (like the routes on these images: https://www.google.de/search?q=camel+route&safe=off&source=lnms&tbm=isch).

This would be pretty easy if you could specify another image instead of normal boxes for a class. Something like an SVG or WMF image or a shape script as in Sparx Enterprise Architect.

The only custom images I found in the documentation where those tiny sprites...

Blowy answered 18/12, 2015 at 21:10 Comment(0)
E
33

From the PlantUML's Language Specification

Legacy HTML

You can mix Creole with the following HTML tags:

...

  • <img:file> : the file must be accessible by the filesystem
  • <img:http://plantuml.com/logo3.png> : the URL must be available from the Internet

It appears that it shouldn't be a problem. There is also a PlantUML Word Plug-in, that would possibly enable you to paste images over the default ones otherwise.

The following PlantUML code renders a simple diagram - the referenced images have to be in the proper location...

object "inbound message" as m1
object "XML Splitter" as s1

m1 : <img:MessageIcon.gif>
s1 : <img:SplitterIcon.gif>
m2 : <img:MessageIcon.gif>

m1 -> s1
s1 -> m2

enter image description here

Ephemerality answered 28/12, 2015 at 3:53 Comment(2)
that sounds like a solution which could work... can you come up with a working example which contains two elements linked together?Blowy
Images can be changed in size by using {scale} for instance: <img:http://plantuml.com/logo3.png{scale=0.5}>Albina
P
8

plantuml-icon-font-sprites allows using font-awesome icons within plantuml. It's awesome!

Polis answered 18/3, 2018 at 2:10 Comment(0)
N
0

If you are building a diagram include allow_mixing at the top of the code.

Noahnoak answered 24/2, 2020 at 12:58 Comment(1)
Then it doesn't work. PlantUML documentation isn't as easy to navigate.Noahnoak

© 2022 - 2024 — McMap. All rights reserved.