plantuml

PlantUML Render diagrams in Jupyter Lab Renderer for PlantUML - a rendering engine that converts text to diagrams.

Screenshot of plantUML

Types of Diagrams Supported

All PlantUML diagrams are supported - as they are managed by the server.

Screenshot of types of PlantUML Diagrams

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.

Learn more here

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
Name Type Attributes Default Description
format 'svg' | 'png' <optional>
'svg'

the format to use for this render

(static) getDefaultFormat() → {String}

Determines the default format to retrieve

Returns:

[svg | png]

Type
String

(static) render(plantUMLText, plantUMLOptions, showURLopt, debugopt)

Renders a PlantUML Text

Screenshot of plantUML

//-- 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
Name Type Attributes Default Description
format 'svg' | 'png' <optional>
'svg'

the format to use for this render

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