Tuesday 20 June 2023

PlantUML: Add connecting notes on several entities in class diagram

Define a note using note keyword.

note "Human body parts" as HBP

 

Connect this note to other objects using .. symbol.

Human .. HBP
HBP .. Brain
HBP .. Lungs
HBP .. Liver
HBP .. Heart
HBP .. Stomach
HBP .. Kidney
HBP .. Bladder

 

connectingNotes.txt

@startuml

title "Class Composition"

class Human

Class Brain
class Lungs
class Liver
class Heart
class Stomach
class Kidney
class Bladder

class Frontal
class Parietal
class Temporal
class Occipital

Human *-- Brain
Human *-- Lungs
Human *-- Liver
Human *-- Heart
Human *-- Stomach
Human *-- Kidney
Human *-- Bladder

Brain *-- Frontal
Brain *-- Parietal
Brain *-- Temporal
Brain *-- Occipital

note "Human body parts" as HBP
Human .. HBP
HBP .. Brain
HBP .. Lungs
HBP .. Liver
HBP .. Heart
HBP .. Stomach
HBP .. Kidney
HBP .. Bladder

@enduml

 

Above snippet generate below diagram.

 


 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment