语法入门
图表语法规则
所有的图表定义都以一个图表类型开始,接下来才是图表的内容。
例如,以下内容使用 componentDiagram 声明开头,因此它描述的是一个 Component Diagram 组件图。
componentDiagram [Pintora] --> [DiagramRegistry] : Get diagram by type
注释
若在一行中使用 %% 开头,此行内容会被视为注释,不会被处理。
sequenceDiagram %% here is line comment %% another line comment A-->B: Hi there!
Directives 指令
@param 和 @config
可以使用这两个指令来覆盖当前图表配置。
更多细节请查看 Config。
erDiagram
@param fontSize 18
@config({
"themeConfig": {
"theme": "larkLight"
},
"er": {
"edgeType": "ortho"
}
})
CUSTOMER {
int id PK
int address FK
}
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
CUSTOMER }|..|{ DELIVERY-ADDRESS : uses