Coder Social home page Coder Social logo

plantuml-stdlib's Introduction

plantuml-stdlib

Contains official Standard Library for PlantUML See http://plantuml.com/stdlib for more information.

This Standard Library is included in official release of PlantUML. Following the C convention for "C standard library" (see https://en.wikipedia.org/wiki/C_standard_library )

AWS library

The AWS library consists of Amazon AWS icons, it provides icons of two different sizes.

Use it by including the file that contains the sprite, eg: !include <aws/Storage/AmazonS3/AmazonS3>. When imported, you can use the sprite as normally you would, using <$sprite_name>.

You may also include the common.puml file, eg: !include <aws/common>, which contains helper macros defined. With the common.puml imported, you can use the NAME_OF_SPRITE(parameters...) macro.

Example of usage:

@startuml
!include <aws/common>
!include <aws/Storage/AmazonS3/AmazonS3>
!include <aws/Storage/AmazonS3/bucket/bucket>

AMAZONS3(s3_internal)
AMAZONS3(s3_partner,"Vendor's S3")
s3_internal <- s3_partner
@enduml

This example renders the following image:

Example

Azure library

The Azure library consists of Microsoft Azure icons.

Use it by including the file that contains the sprite, eg: !include <azure/Analytics/AzureEventHub.puml>. When imported, you can use the sprite as normally you would, using <$sprite_name>.

You may also include the AzureCommon.puml file, eg: !include <azure/AzureCommon.puml>, which contains helper macros defined. With the azure/AzureCommon.puml imported, you can use the NAME_OF_SPRITE(parameters...) macro.

Example of usage:

@startuml

!include <azure/AzureCommon.puml>
!include <azure/Analytics/AzureEventHub.puml>
!include <azure/Analytics/AzureStreamAnalytics.puml>
!include <azure/Databases/AzureCosmosDb.puml>

left to right direction

agent "Device Simulator" as devices #fff

AzureEventHub(fareDataEventHub, "Fare Data", "PK: Medallion HackLicense VendorId; 3 TUs")
AzureEventHub(tripDataEventHub, "Trip Data", "PK: Medallion HackLicense VendorId; 3 TUs")
AzureStreamAnalytics(streamAnalytics, "Stream Processing", "6 SUs")
AzureCosmosDb(outputCosmosDb, "Output Database", "1,000 RUs")

devices --> fareDataEventHub
devices --> tripDataEventHub
fareDataEventHub --> streamAnalytics
tripDataEventHub --> streamAnalytics
streamAnalytics --> outputCosmosDb

@enduml

This example renders the following image:

Example

Classy library

The Classy library allows for using an Object Oriented approach to diagramming in PlantUML.

That is to say that it allows you to define and instantiate your own classes as well as allow you to call methods defined on those classes. You can also inherit from one or more classes where desired.

Use it by including the file that contains the Classy class that you want to use within your diagram. Alternatively, if you want to define your own type, you can just include the core.puml file, eg: !include <classy/core>, which contains all of the necessary functions.

Example of usage:

@startuml

    !include <classy/core>

    $class(HelloWorld)
      $classVar(msg, string, "Hello World!")

      $classMethod(getMessage)
        !function HelloWorld__getMessage($this)
          !return $getInstanceVar($this, 'msg')
        !endfunction
      $endclassMethod(getMessage)

      $classMethod(setMessage)
        !function HelloWorld__setMessage($this, $args)
          $setInstanceVar($this, 'msg', $call($args, 'each'))
          !return $this
        !endfunction
      $endclassMethod(setMessage)
    $endclass(HelloWorld)

    !$hello = $new(HelloWorld)
    Alice -> Bob : $call($hello, 'getMessage')

    $call($hello, 'setMessage', array($new(array), '2nd message!'), $void=%true())

    Alice -> Bob : $call($hello, 'getMessage')

@enduml

This example renders the following image: Example

Classy C4 library

The Classy C4 library combines the Classy and C4 libraries by defining Classy classes that wrap the C4 macros.

Example of usage:

@startuml

    !include <classy-c4/container>
    !include <classy-c4/person>
    !include <classy-c4/system>

    !$system = $new(System)
    $call($system, 'setName', 'Label', $void=%true())
    $call($system, 'setDescription', 'Optional Description', $void=%true())

    !$person = $new(Person)
    $call($person, 'setName', 'Label', $void=%true())
    $call($person, 'setDescription', 'Optional Description', $void=%true())

    !$container = $new(Container)
    $call($container, 'setName', 'Label', $void=%true())
    $call($container, 'setDescription', 'Optional Description', $void=%true())
    $call($container, 'setTechnology', 'Technology', $void=%true())

    !$personAlias = $call($person, 'render')
    !$containerAlias = $call($container, 'render')
    $call($system, 'render', $void=%true())

    Rel($personAlias, $containerAlias, "Label", "Optional Technology")

@enduml

This example renders the following image: Example

Elastic library

The Elastic library consists of Elastic icons. It is similar in use to the AWS and Azure libraries (it used the same tool to create them).

Use it by including the file that contains the sprite, eg: !include <elastic/elasticsearch/elasticsearch.puml>. When imported, you can use the sprite as normally you would, using <$sprite_name>.

You may also include the common.puml file, eg: !include <elastic/common>, which contains helper macros defined. With the common.puml imported, you can use the NAME_OF_SPRITE(parameters...) macro.

Example of usage:

@startuml
    !include <elastic/common>
    !include <elastic/elasticsearch/elasticsearch>
    !include <elastic/logstash/logstash>
    !include <elastic/kibana/kibana>

    ELASTICSEARCH(ElasticSearch, "Search and Analyze",database)
    LOGSTASH(Logstash, "Parse and Transform",node)
    KIBANA(Kibana, "Visualize",agent) 
    
    Logstash -right-> ElasticSearch: Transformed Data
    ElasticSearch -right-> Kibana: Data to View

@enduml

This example renders the following image: Example

Tupadr3 library

This library contains several libraries of icons (including Devicons and Font Awesome )

Use it by including the file that contains the sprite, eg: !include <tupadr3/font-awesome/align_center>. When imported, you can use the sprite as normally you would, using <$sprite_name>.

You may also include the common.puml file, eg: !include <tupadr3/common>, which contains helper macros defined. With the common.puml imported, you can use the NAME_OF_SPRITE(parameters...) macro.

Example of usage:

@startuml
!include <tupadr3/common>
!include <tupadr3/font-awesome/server>
!include <tupadr3/font-awesome/database>

title Styling example

FA_SERVER(web1,web1) #Green
FA_SERVER(web2,web2) #Yellow
FA_SERVER(web3,web3) #Blue
FA_SERVER(web4,web4) #YellowGreen

FA_DATABASE(db1,LIVE,database,white) #RoyalBlue
FA_DATABASE(db2,SPARE,database) #Red

db1 <--> db2

web1 <--> db1
web2 <--> db1
web3 <--> db1
web4 <--> db1
@enduml

This example renders the following image: Example

Google Material Icons

This library consists of a free Material style icons from Google and other artists.

Use it by including the file that contains the sprite, eg: !include <material/ma_folder_move>. When imported, you can use the sprite as normally you would, using <$ma_sprite_name>. Notice that this library requires an ma_ preffix on sprites names, this is to avoid clash of names if multiple sprites have the same name on different libraries.

You may also include the common.puml file, eg: !include <material/common>, which contains helper macros defined. With the common.puml imported, you can use the MA_NAME_OF_SPRITE(parameters...) macro, note again the use of the prefix MA_.

Example of usage:

@startuml
!include <material/common>
' To import the sprite file you DON'T need to place a prefix!
!include <material/folder_move>

MA_FOLDER_MOVE(Red, 1, dir, rectangle, "A label")
@enduml

This example renders the following image: Example

Notes

When mixing sprites macros with other elements you may get a syntax error if, for example, trying to add a rectangle along with classes. In those cases, add { and } after the macro to create the empty rectangle.

Example of usage:

@startuml
!include <material/common>
' To import the sprite file you DON'T need to place a prefix!
!include <material/folder_move>

MA_FOLDER_MOVE(Red, 1, dir, rectangle, "A label") {
}

class foo {
    bar
}
@enduml

This example renders the following image: Example

Sources

You can create Pull Request to update or add some library here if you find it relevant.

plantuml-stdlib's People

Contributors

anthony-gaudino avatar arnaudroques avatar botux avatar crashedmind avatar deshorsley avatar dzordzu avatar esamson avatar fbartnitzek avatar james-gadrow-kr avatar javabean avatar kirchsth avatar matschaffer avatar milo-minderbinder avatar mmajis avatar mpegdash-user avatar neuhalje avatar potherca avatar ricardoniepel avatar talfco avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.