mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-17 06:20:07 +02:00
chore: update ER diagram docs
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -135,6 +135,44 @@ erDiagram
|
||||
"This **is** _Markdown_"
|
||||
```
|
||||
|
||||
#### Optional Relationship Labels
|
||||
|
||||
Starting from Mermaid version 11.11.0, the relationship label in ER diagrams is optional. You can define relationships without specifying a label, and the diagram will render correctly.
|
||||
|
||||
For example, the following is valid:
|
||||
|
||||
```mermaid-example
|
||||
erDiagram
|
||||
BOOK }|..|{ AUTHOR
|
||||
BOOK }|..|{ GENRE
|
||||
AUTHOR }|..|{ GENRE
|
||||
```
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
BOOK }|..|{ AUTHOR
|
||||
BOOK }|..|{ GENRE
|
||||
AUTHOR }|..|{ GENRE
|
||||
```
|
||||
|
||||
This will show the relationships between the entities without any labels on the connecting lines.
|
||||
|
||||
You can still add a label if you want to describe the relationship:
|
||||
|
||||
```mermaid-example
|
||||
erDiagram
|
||||
BOOK }|..|{ AUTHOR : written_by
|
||||
BOOK }|..|{ GENRE : categorized_as
|
||||
AUTHOR }|..|{ GENRE : specializes_in
|
||||
```
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
BOOK }|..|{ AUTHOR : written_by
|
||||
BOOK }|..|{ GENRE : categorized_as
|
||||
AUTHOR }|..|{ GENRE : specializes_in
|
||||
```
|
||||
|
||||
### Relationship Syntax
|
||||
|
||||
The `relationship` part of each statement can be broken down into three sub-components:
|
||||
|
Reference in New Issue
Block a user