PlantUML Render diagrams in Jupyter Lab Renderer for PlantUML - a rendering engine that converts text to diagrams.
- Setting defaults:
- plantuml.protocol - ex: 'http://'
- plantuml.host - ex: 'localhost:8080'
- plantuml.setDefaultFormat(format) - whether to use 'png' or 'svg' as default
- plantuml.getDefaultFormat() - get the current default
- rendering
- plantuml.generateURL(string, options) - determine a url to generate the image
- plantuml.render(string, options) - render the results in a jupyter cell
Types of Diagrams Supported
All PlantUML diagrams are supported - as they are managed by the server.
Such as: Sequence diagrams, Usecase diagrams, Class diagrams, Object diagrams, Activity diagrams, Component diagrams, Deployment diagrams, State diagrams, Timing diagrams, and many others...
Running your own PlantUML Server
This library requires a PlantUML server to render the images, however the images will be preserved upon export.
(We are currently evaluating additional options like MermaidJS. They are available still through ijs.htmlScript, but are still determining a sufficient option)
PlantUML PicoWeb is a very simple PlantUML Server.
Members
(static) host :String
- Default Value:
- localhost:8080
The host domain of the PlantUML server
Type:
- String
(static) protocol :String
- Default Value:
- http://
The protocol used to access the PlantUML results
Type:
- String
Methods
(static) generateURL(plantUMLText, plantUMLOptions)
Generates a URL for a given plantUMLText
//-- note there should be no space after '@' character
//-- ex: '@' + 'startuml' and '@' + 'enduml'
utils.plantuml.generateURL(`@ startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@ enduml`);
// 'http://localhost:8080/plantuml/svg/SoWkIImgAStDuNBCoKnELT2rKt3AJx9IS2mjo...'
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
plantUMLText |
String | the text to render |
||||||||||
plantUMLOptions |
Object | the options to use Properties
|
(static) getDefaultFormat() → {String}
Determines the default format to retrieve
Returns:
[svg | png]
- Type
- String
(static) render(plantUMLText, plantUMLOptions, showURLopt, debugopt)
Renders a PlantUML Text
//-- note there should be no space after '@' character
//-- ex: '@' + 'startuml' and '@' + 'enduml'
utils.plantuml.render(`@ startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@ enduml`)
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
plantUMLText |
String | the text to render |
||||||||||||
plantUMLOptions |
Object | the options to use Properties
|
||||||||||||
showURL |
Boolean |
<optional> |
false
|
whether to show the URL at the bottom |
||||||||||
debug |
Boolean |
<optional> |
false
|
whether to provide debugging information |
(static) reset()
Resets the defaults
- format
- protocol
- host
(static) setDefaultFormat(format)
Sets the default format to retrieve
Parameters:
Name | Type | Description |
---|---|---|
format |
'svg' | 'png' | which format to default from now on |