Plantuml examples
Key Points
References
Reference_description_with_linked_URLs_______________________ | Notes______________________________________________________________ |
---|---|
Design Tools | |
https://plantuml.com/ | |
https://plantuml.com/running | |
https://plantuml.com/guide | |
PlantUMLHitchhikersGuide/PlantUMLSpriteLibraries | |
https://crashedmind.github.io/PlantUMLHitchhikersGuide/aws/aws.html | AWS plantuml lib |
Key Concepts
plantuml online editor
http://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000
plantuml in vscode
https://www.youtube.com/watch?v=xkwJ9GwgZJU
PlantUML in Visual Studio Code
To get started with PlantUML in Visual Studio Code , you first need to install the PlantUML extension in the Visual Studio Code marketplace. To do this, follow these steps:
- Open Visual Studio Code
- Click on the Extensions icon in the Activity Bar on the side of the editor
- Search for “PlantUML” in the extensions marketplace
- Install the PlantUML extension
- Restart Visual Studio Code if necessary
- Once you have installed the PlantUML extension, you are ready to start using PlantUML in Visual Studio Code.
Using PlantUML in Visual Studio Code is straightforward. To create a new PlantUML diagram, simply create a new file with a .puml extension and start writing PlantUML syntax. For example:
https://plantuml.com/commons - common commands in plantuml
plantuml-layout-tutorial-styles. guide
PlantUMLHitchhikersGuide - github
Introduction | Sets context for PlantUML and this guide. |
Using Standard Library | Examples of what PlantUMLStdlib can do and how it does it. |
PlantUML Features | Details on the relevant PlantUML features for drawing diagrams. Some of these are lesser known or undocumented. |
Understanding Standard Library | My notes and experiments from trying to understand PlantUMLStdlib._ |
Standardising Standard Library | Sets the context for why PlantUMLStdlib should be standardised to benefit users and developers. This was the driver for the PlantUMLStdlibRFC. |
Future | Some thoughts to be explored and progressed. |
Annex Standard Library C4 | Details on C4 in general, and as supported in PlantUMLStdlib. |
Annex | Other items that may help the user, or set context. |
uml_modeling_with_plantuml_a_comprehensive_guide_with_examples - medium
existing plantuml sprites available
https://crashedmind.github.io/PlantUMLHitchhikersGuide/PlantUMLSpriteLibraries/plantuml_sprites.html
https://crashedmind.github.io/PlantUMLHitchhikersGuide/aws/aws.html
plantuml online editor and viewer
https://sujoyu.github.io/plantuml-previewer/
how to can I reference external image files from a plantuml script in the online plantuml viewer?
plantuml vscode plugin
https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml
The server render is now very recommended by this extension, since it's much faster and much easier to setup, while the major weakness has been improved:
- Enables
POST
method, you can now render very-large diagrams - The extension comes with a new
include processor
, you won't encounter include problems again.
To make sure you can benifit from this update, make sure your plantuml server enables POST
support.
If not, like the official https://www.plantuml.com/plantuml, the extension falls back to use GET
, and you may still encounter 414 URI Too Long
errors. Setup your own server is recommended.
Supported Formats
*.wsd
, *.pu
, *.puml
, *.plantuml
, *.iuml
How to install
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
ext install plantuml
Requirements for PlantUMLServer render
A plantuml server. See Use PlantUML Server as render.
Requirements for Local render
It's necessary to have following installed:
- Java : Platform for PlantUML running.
- Graphviz : PlantUML requires it to calculate positions in diagram.
Quick Install for Mac
brew install --cask temurin
brew install graphviz
HTLC Ethereum Smart Contracts examples with Plantuml Sequence Diagrams
https://github.com/chatch/hashed-timelock-contract-ethereum
includes tests, Solidity code etc
https://github.com/chatch/hashed-timelock-contract-ethereum/tree/master/contracts
Details for Plantuml Confluence Plugin App
Plantuml for C4 Tiers and Layers Diagrams Tutorial
https://www.alibabacloud.com/blog/597426
PlantUML_Language_Reference_Guide.pdf file
Combine Gen AI and Plantuml for Diagramming
- In a Chrome Browser
- Define a Gen AI prompt with optional definition files uploaded to create a plantuml diagram
- Describe the diagram clearly in text
- Generate the Plantuml code using Claude.ai or ChatGPT
- Edit the generated code as needed in a text editor like Sublime
- Use the Plantuml online viewer to paste the edited code
https://sujoyu.github.io/plantuml-previewer/ - Use the Save and Preview button to view the diagram
- Open the generated diagram in a new window
- Save or copy the generated image to use as needed
- If needed, repeat the process to fine tune the diagram starting with the Plantuml Prompt for Gen AI or the text editor
- then repeat the online viewer process to see the new resulting diagram image
Example of a Digital Ecosystem in Plantuml using Gen AI Prompt
Claude.ai response to request to create Plantuml diagram
Claude.ai generated plantuml code for the plantuml prompt request
Generated Plantuml Diagram in the online viewer after pasting the code
How to add icon image files to replace or add above a text box in Plantuml code
To replace text boxes with image icons in PlantUML code, you can use the !define
directive to define the image and then use <<icon>>
in the diagram elements. Here's an example of how to do this:
Example Code for Replacing Text Boxes with Icons in PlantUML
Place Your Image in an Accessible Location: First, make sure the image icon file (e.g., PNG or SVG) is accessible. You can use a local file path or a URL.
Define and Use the Image: Use the
!define
directive to load the image, and then assign it to specific elements or classes.
Steps:
!define ICON_PATH
allows you to define a URL or local path to the image.<<ICON_PATH>>
applies the image as an icon for the actor (or any other PlantUML element).- In this example, an actor (
User
) is shown with an image icon defined from the URL.
Important Notes:
- You can replace text boxes with images for different diagram elements, including actors, classes, use cases, and more.
- Ensure that the image URL or path is accessible when generating the diagram (e.g., for online rendering or local generation).
- PlantUML supports multiple image formats, including PNG, SVG, and JPEG.
Plantuml formatting examples and tips
creating multiple pages in 1 diagram spec
PlantUML in Action 009 - 01 Sequence Diagram - 12 grouping message - video
Here's a summarized breakdown of the content on grouping messages in PlantUML sequence diagrams:
Grouping Messages: The video explains how to group messages within a sequence diagram using PlantUML keywords to clarify the flow, structure, and execution logic.
Key Keywords:
- alt/else: Represents conditional branches, similar to an "if/else" structure where only one of the blocks executes.
- opt: Used for optional actions that may or may not occur, offering flexibility in the sequence flow.
- loop: Represents iterative actions, like loops, that execute multiple times.
- par: Allows parallel actions, visualized as concurrent message flows.
Special Keywords:
- break: Defines a point to stop the sequence, skipping further messages within the group.
- critical: Marks an uninterruptible sequence segment, ensuring messages within it execute without interleaving.
- group: A generic grouping tool that lets you name and nest groups, enhancing organization and clarity.
Examples & Structure Tips:
- For alt/else, structure branches for alternate outcomes, using "else" to define additional conditions.
- Use opt for optional message flows without compulsory execution.
- Apply loop to indicate repetitive sequences, specifying the repetition count.
- Organize par sections for messages that can occur simultaneously.
Practical Advice:
- Always pair
end
with each grouping keyword (e.g.,end alt
,end group
) to maintain syntax integrity. - Use indentation to enhance readability and organize nested groups clearly.
- Always pair
Comparison with Other Diagrams: Highlights differences in message grouping between options (optional execution) and alternates (exclusive branches), improving diagram clarity for complex logic.
Enhancing Readability: Organizing messages into groups significantly enhances readability and maintains clarity in complex diagrams, especially in collaborative or large-scale UML diagrams.
Testing Keywords in Practice: The video encourages viewers to experiment with these keywords in their UML diagramming IDEs to build familiarity with grouping structures in PlantUML.
Potential Value Opportunities
Potential Challenges
Candidate Solutions
Step-by-step guide for Example
sample code block