mermaid绘制子图

本文介绍了如何使用Mermaid库通过`graph`和`flowchart`语法来创建子图,提供了详细的代码示例,帮助读者掌握在图表中添加子图的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

graph

  mermaid可以使用graph绘制子图,代码如下:

graph TB
    subgraph one
        a1 --> a2
    end

    subgraph two
        b2 --> b2
    end

    subgraph three
        c1 --> c2
    end

    c1 --> a2
three
two
one
c2
c1
b2
a2
a1

  另一种语法如下:

graph LR
    subgraph Understand
        D[Transform]
        E[Visualise]
        F[Model]
    end

    A --> D
    D --> E
    F --> D
    E --> F
    F --> AA
Understand
Transform
Visualise
Model
A
AA

flowchart

  mermaid也可以使用flowchart绘制子图:

flowchart TB
    c1 --> a2

    subgraph one
        a1 --> a2
    end

    subgraph two
        b1 --> b2
    end

    subgraph three
        c1 --> c2
    end

    one --> two
    three --> two
    two --> c2
three
one
c2
c1
two
b2
b1
a2
a1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值