How to use a custom SVG as the box used for an object?

+2 votes
asked Apr 29, 2020 in Question / help by MineralUML (280 points)
edited Apr 29, 2020 by MineralUML

* This might be a "wanted features" if it isn't already part of the program. Also, the list code is formatted oddly, but I can't get it to look right here.

I see the following links with some information, but it isn't clear to me how I can import a SVG and use that as the entity's shape (box?). I do not want to just place an image within the box, rather I want to define a new type of box.

When I export to SVG and open it in inkscape it appears to me that the boxes are vector boxes that just normally get rendered to png, so I am guessing this is possible...

I was also wondering if it is possible to explicitly define the starting place of a box in absolute or percent relative to the generated image? Likewise, is it possible to explicitly place text starting at an X, Y within a box?

Related Links:

  1. https://forum.plantuml.net/11354/applying-style-to-multiline-node-in-mindmap-diagram
  2. https://plantuml.com/svg
  3. https://forum.plantuml.net/4080/please-provide-commands-import-png-and-svg-images-from-files
  4. https://plantuml.com/stdlib

Short list of 3 related questions:

  1. How does one import a SVG and use that to define a new entity type?
    •  Example: Instead of a box, I want a star shape and have an SVG made in inkscape for this. Example, to illustrate what I am wondering but this is NOT a thought out scripting method:
  1. @startuml
    @skinparam newboxtypeshape MyType ./box.svg
  2. start 
    MyType "Some Group" {
     :Hello world;
    }
  3. :This is defined on
    several **lines**;
    stop
    @enduml
    
  1. How can I tell plantuml to place a box in a specific location in the final rendering?
    • Example, to illustrate what I am wondering but this is NOT a thought out scripting method:
      @startuml
      start
      :Hello world; @ x=0, y=0
      :This is defined on
      several **lines**;
      stop
      @enduml
      
  2.  Is it possible to specify with a box where the text will be placed or aligned? If a custom SVG is used, that might be necessary, if for example the text has to be right below or the image has a region where the label would go.

I drew this up just now to illustrate what I am trying to find out :

Thanks!

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...