Turn Your Vehicle Into a Smart Earning Asset

While you’re not driving your car or bike, it can still be working for you. MOTOSHARE helps you earn passive income by connecting your vehicle with trusted renters in your city.

šŸš— You set the rental price
šŸ” Secure bookings with verified renters
šŸ“ Track your vehicle with GPS integration
šŸ’° Start earning within 48 hours

Join as a Partner Today

It’s simple, safe, and rewarding. Your vehicle. Your rules. Your earnings.

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, 2025-01-01, 2025-01-05
  Development    :active,  des2, 2025-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.

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x