Use Markdown syntax to create chart documents, this tool is really good

Use Markdown syntax to create chart documents, this tool is really good

2022-09-30 0 1,143
Resource Number 43925 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

In this episode, we recommend a Javascript based charting tool called Mermaid.

Use Markdown syntax to create chart documents, this tool is really good插图

Mermaid is a Javascript based chart drawing tool, by parsing Markdown-like text syntax to achieve chart creation and dynamic modification. The primary purpose of Mermaid is to keep documentation updated as development progresses.

Mapping and documentation takes valuable development time, and it quickly expires as the business changes. But a lack of charts or documentation can be a huge impediment to productivity and business learning for new team members. Mermaid solves this problem by allowing users to create diagrams that can be easily modified, or as part of a production script (or other code).

class=”pgc-h-arrow-right” data-track=”8″> How to use

1 Use it directly in the mermaid online editor: mermai.live

Use Markdown syntax to create chart documents, this tool is really good插图1

2 Use the Mermaid plugin

Mermaid currently adds default plugins to GitLab, Azure Devops, Tuleap, Joplin, Notion, and can be used directly. Other platforms, such as GitHub, GitBook, WordPress, Hexo, Vs Code, etc., need to add plugins manually.

View supported platforms:
https://mermaid-js.github.io/mermaid/#/./integrations

Use Markdown syntax to create chart documents, this tool is really good插图2

Use

in vs code

3 Call the Mermaid Javascript API

Call through CDN Example:

<html>
    <body>
        <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
        <script>
            mermaid.initialize({ startOnLoad: true });
        </script>

        Here is one mermaid diagram:
        <div class="mermaid">
            graph TD 
            A[Client] --> B[Load Balancer] 
            B --> C[Server1] 
            B --> D[Server2]
        </div>

        And here is another:
        <div class="mermaid">
            graph TD 
            A[Client] -->|tcp_123| 
            B(Load Balancer) 
            B -->|tcp_456| C[Server1] 
            B -->|tcp_456| D[Server2]
        </div>
    </body>
</html>

Or refer to a separate file:

<html lang="en">
    <head>
        <meta charset="utf-8" />
    </head>
    <body>
        <div class="mermaid">
            graph LR 
            A --- B 
            B-->C[fa:fa-ban forbidden] 
            B-->D(fa:fa-spinner);
        </div>
        <div class="mermaid">
            graph TD 
            A[Client] --> B[Load Balancer] 
            B --> C[Server1] 
            B --> D[Server2]
        </div>
        <script src="The\Path\In\Your\Package\mermaid.js"></script>
        <script>
            mermaid.initialize({ startOnLoad: true });
        </script>
    </body>
</html>

在Python 与 mermaid-js Example of integration:

import base64
from IPython.display import Image, display
import matplotlib.pyplot as plt

def mm(graph):
  graphbytes = graph.encode("ascii")
  base64_bytes = base64.b64encode(graphbytes)
  base64_string = base64_bytes.decode("ascii")
  display(Image(url="https://mermaid.ink/img/" + base64_string))

mm("""
graph LR;
    A--> B & C & D;
    B--> A & E;
    C--> A & E;
    D--> A & E;
    E--> B & C & D;
""")

4 Add Mermaid as dependency

npm:

 npm install -g yarn

yarn:

yarn add mermaid

or

 yarn add --dev mermaid

class=”pgc-h-arrow-right” data-track=”35″> Sample chart

flowchart LR
A[Hard] --> |Text| B(Round)
B -->  C{Decision}
C --> |One| D[Result 1]
C --> |Two| E[Result 2]
sequenceDiagram
Alice-> > John: Hello John, how are you?
loop Healthcheck
John-> > John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John--> > Alice: Great!
John-> > Bob: How about you?
Bob--> > John: Jolly good! 

Use Markdown syntax to create chart documents, this tool is really good插图3

Gantt chart

gantt
    section Section
    Completed :done,    des1, 2014-01-06,2014-01-08
    Active        :active,  des2, 2014-01-07, 3d
    Parallel 1   :         des3, after des1, 1d
    Parallel 2   :         des4, after des1, 1d
    Parallel 3   :         des5, after des3, 1d
    Parallel 4   :         des6, after des4, 1d
classDiagram
Class01 <|-- AveryLongClass : Cool
<<Interface>> Class01
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
  <<service>>
  int id
  size()
}

Use Markdown syntax to create chart documents, this tool is really good插图4

Class diagram

Diagram of state

stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]

Use Markdown syntax to create chart documents, this tool is really good插图5

Diagram of state

User experience journey diagram

  journey
    title My working day
    section Go to work
      Make tea: 5: Me
      Go upstairs: 3: Me
      Do work: 1: Me, Cat
    section Go home
      Go downstairs: 5: Me
      Sit down: 3: Me

Use Markdown syntax to create chart documents, this tool is really good插图6

User experience journey diagram

—END—

Open source protocol:MIT

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code Use Markdown syntax to create chart documents, this tool is really good https://ictcoder.com/kyym/use-markdown-syntax-to-create-chart-documents-this-tool-is-really-good.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service