1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

mermaid の graph/flowchart を良い感じに書く

Posted at

こういう謎のmermaidがあるとします

graph TD

A("犬"):::mammalian --> B("猫")
B --> C("ハムスター"):::mammalian
B:::mammalian --> D("亀"):::reptiles

classDef reptiles fill:red,color:white,stroke-width:0px;
classDef mammalian fill:blue,color:white,stroke-width:0px;

図にするとこうです

それを以下のように書くとdiffが発生した時に見やすい。と思う。皆さんどう思いますか。

graph TD

%% 要素を定義する部分
A("犬"):::mammalian
B("猫"):::mammalian
C("ハムスター"):::mammalian
D("亀"):::reptiles

%% 関係を定義する部分
A --> B
B --> C
B --> D

classDef reptiles fill:red,color:white,stroke-width:0px;
classDef mammalian fill:blue,color:white,stroke-width:0px;
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?