Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

โ€œInvest in yourself โ€” your confidence is always worth it.โ€

Explore Cosmetic Hospitals

Start your journey today โ€” compare options in one place.

Mermaid.js – Make graph & charts using code: What, Why, and How


๐Ÿ“„ What is Mermaid.js?

Mermaid.js is an open-source JavaScript library that lets you create diagrams and visualizations using simple markdown-like syntax. It is especially useful for developers, technical writers, DevOps engineers, and data modelers who want to include flowcharts, sequence diagrams, class diagrams, and more directly in documentation or webpages.


โ“ Why Use Mermaid.js?

โœ… Benefits:

  • Simple syntax: Easy to learn and write.
  • Embeddable: Works with HTML, Markdown, GitHub, GitLab, VS Code, Notion, Obsidian, and more.
  • No external diagram tools needed: Write once, render anywhere.
  • Customizable: Themes, configs, and rendering options.
  • Open-source and client-side: No need for server processing.

โš–๏ธ Core Features

Diagram TypeSyntax KeywordUse Case
FlowchartgraphProcess maps, logic trees
Sequence DiagramsequenceDiagramAPI calls, user interactions
Class DiagramclassDiagramObject-oriented design
Gantt ChartganttProject timelines
State DiagramstateDiagramState machines
Entity RelationshiperDiagramDatabase schema visualization
Pie ChartpieProportion data
Journey DiagramjourneyCustomer/user journey mapping
Git GraphgitGraphGit commit history and branching
Mindmap (experimental)mindmapBrainstorming and ideation
Requirement DiagramrequirementDiagramSystem/software requirement modeling

๐Ÿ”ง How to Use Mermaid.js

Option 1: Using CDN (Recommended for Beginners)

<!DOCTYPE html>
<html>
<head>
  <script type="module">
    import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
    mermaid.initialize({ startOnLoad: true });
  </script>
</head>
<body>
  <pre class="mermaid">
    graph TD
      A[Start] --> B{Is it working?}
      B -- Yes --> C[Great]
      B -- No --> D[Fix it]
      D --> B
  </pre>
</body>
</html>
Code language: HTML, XML (xml)

Option 2: Install with NPM (Advanced)

npm install mermaid

Then in your JS:

import mermaid from 'mermaid';
mermaid.initialize({ startOnLoad: true });
Code language: JavaScript (javascript)

๐Ÿ“ˆ Examples

Flowchart

graph LR
  A[Start] --> B[Next Step]
  B --> C{Decision?}
  C -- Yes --> D[Do A]
  C -- No --> E[Do B]
Code language: PHP (php)

Sequence Diagram

sequenceDiagram
  Alice->>Bob: Hello Bob
  Bob-->>Alice: Hi Alice

Gantt Chart

gantt
  title Project Timeline
  dateFormat  YYYY-MM-DD
  section Development
  Planning       :done,    des1, 2026-01-01, 2026-01-05
  Development    :active,  des2, 2026-01-06, 10d
Code language: CSS (css)

โš™๏ธ Configuration

You can configure Mermaid using:

mermaid.initialize({
  startOnLoad: true,
  theme: 'default', // or 'dark', 'forest', 'neutral'
  securityLevel: 'strict',
  flowchart: { curve: 'basis' },
});
Code language: CSS (css)

๐ŸŒ Supported Platforms

PlatformMermaid Support
GitHub (Markdown)โœ… Yes
GitLabโœ… Yes
Obsidianโœ… Plugin
Notionโœ… Embed workaround
VS Codeโœ… With extension
HTML websitesโœ… Native
Docusaurus/MkDocsโœ… With plugins

โ“ Tips

  • Wrap Mermaid code in <pre class="mermaid"> for HTML rendering.
  • Use the Live Editor: https://mermaid.live/
  • Use flowchart TD or graph LR to control flow direction.
  • Prefer sequenceDiagram for time-based flows.

๐Ÿ“… Roadmap

  • Improvements to mindmap
  • Export to PDF/SVG
  • Accessibility enhancements

๐Ÿ“„ Conclusion

Mermaid.js is a flexible and lightweight diagramming solution perfect for developers, engineers, and technical writers. Whether you’re documenting infrastructure, user journeys, or system design, Mermaid makes it easy to visualize and maintain your diagrams directly in code or markdown.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
Iโ€™m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Top 10 Subscription Management Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction Subscription management software is designed to streamline and optimize the process of managing recurring billing, customer subscriptions, and related business operations. In 2026, with the rapid…

Read More

Top 10 AI Data Integration Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI data integration tools are pivotal for businesses navigating the complexities of modern data ecosystems. These tools combine artificial intelligence with data integration processes…

Read More

Top 10 Fleet Management Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, the logistics and transportation industries are evolving rapidly, and managing a fleet of vehicles has never been more complex. Fleet management software has become…

Read More

Top 10 AI Academic Plagiarism Checkers Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI academic plagiarism checkers have become indispensable tools for students, educators, researchers, and institutions striving to uphold academic integrity. With the rise of AI-generated…

Read More

Top 10 Travel Management Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, travel management software (TMS) has become a crucial tool for businesses, travel agencies, and frequent travelers. These tools automate the booking, tracking, and management…

Read More

Top 10 No-Code Platforms Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, no-code platforms have become essential for businesses and individuals looking to build powerful applications, websites, and automations without the need for programming knowledge. These…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x