Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
The Official Guide to Mermaid.js

You're reading from   The Official Guide to Mermaid.js Create complex diagrams and beautiful flowcharts easily using text and code

Arrow left icon
Product type Paperback
Published in Sep 2021
Publisher Packt
ISBN-13 9781801078023
Length 492 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Knut Sveidqvist Knut Sveidqvist
Author Profile Icon Knut Sveidqvist
Knut Sveidqvist
Ashish Jain Ashish Jain
Author Profile Icon Ashish Jain
Ashish Jain
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Getting Started with Mermaid
2. Chapter 1: The Art of Documentation with Mermaid FREE CHAPTER 3. Chapter 2: How to Use Mermaid 4. Chapter 3: Mermaid Versions and Using the Live Editor 5. Chapter 4: Modifying Configurations with or without Directives 6. Chapter 5: Changing Themes and Making Mermaid Look Good 7. Section 2: The Most Popular Diagrams
8. Chapter 6: Using Flowcharts 9. Chapter 7: Creating Sequence Diagrams 10. Chapter 8: Rendering Class Diagrams 11. Chapter 9: Illustrating Data with Pie Charts and Understanding Requirement Diagrams 12. Section 3: Powerful Diagrams for the Advanced User
13. Chapter 10: Demonstrating Connections Using Entity Relationship Diagrams 14. Chapter 11: Representing System Behavior with State Diagrams 15. Chapter 12: Visualizing Your Project Schedule with Gantt Chart 16. Chapter 13: Presenting User Behavior with User Journey Diagrams 17. Other Books You May Enjoy Appendix :Configuration Options

Using Annotations and comments

In this section, you will cover what annotations are and how to add them in a class diagram. You will also see how to add comments to your Mermaid code, such that it does not impact the rendering of the diagrams but still makes the code more meaningful. Let's start with annotations first.

Adding Annotations

Annotations in class diagrams are like decorative-marker text that is attached to a class, such that it adds a specific meaning to that class. In a way, you can say it is like assigning metadata or a tag to a specific class that clearly highlights its nature. For example, if a class is to be used as an interface or a service, adding an annotation will highlight that specific nature prominently in the class diagram as well.

As in a typical UML class diagram, annotations in Mermaid are specified between a set of opening and closing double angular brackets, such as << annotationText >>, and in the class diagram syntax, they are...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image