主题
Usecase Diagram Config Schema
txt
https://mermaid.js.org/schemas/config.schema.json#/$defs/UsecaseDiagramConfig包含用例图特定配置的对象。
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|---|---|---|---|---|---|---|---|
| Can be instantiated | No | Unknown status | No | Forbidden | Allowed | none | config.schema.json* |
UsecaseDiagramConfig Type
object (Usecase Diagram Config)
all of
UsecaseDiagramConfig Properties
| Property | Type | Required | Nullable | Defined by |
|---|---|---|---|---|
| theme | string | Optional | cannot be null | Mermaid Config |
| look | string | Optional | cannot be null | Mermaid Config |
| actorFontSize | number | Optional | cannot be null | Mermaid Config |
| actorFontFamily | string | Optional | cannot be null | Mermaid Config |
| actorFontWeight | string | Optional | cannot be null | Mermaid Config |
| usecaseFontSize | number | Optional | cannot be null | Mermaid Config |
| usecaseFontFamily | string | Optional | cannot be null | Mermaid Config |
| usecaseFontWeight | string | Optional | cannot be null | Mermaid Config |
| nodeSpacing | number | Optional | cannot be null | Mermaid Config |
| rankSpacing | number | Optional | cannot be null | Mermaid Config |
| diagramPadding | number | Optional | cannot be null | Mermaid Config |
| colorScheme | string | Optional | cannot be null | Mermaid Config |
theme
主题,CSS 样式表。你也可以使用 themeCSS 覆盖此值。
theme
is optional
Type:
stringcannot be null
defined in: Mermaid Config
theme Type
string
theme Constraints
enum: the value of this property must be equal to one of the following values:
| Value | Explanation |
|---|---|
"default" | |
"base" | |
"dark" | |
"forest" | |
"neutral" | |
"neo" | |
"neo-dark" | |
"redux" | |
"redux-dark" | |
"redux-color" | |
"redux-dark-color" | |
"null" | Can be set to disable any pre-defined mermaid theme |
theme Default Value
The default value is:
json
"redux-color"look
定义图表要使用的主要外观。
look
is optional
Type:
stringcannot be null
defined in: Mermaid Config
look Type
string
look Constraints
enum: the value of this property must be equal to one of the following values:
| Value | Explanation |
|---|---|
"classic" | |
"handDrawn" | |
"neo" |
look Default Value
The default value is:
json
"neo"actorFontSize
角色标签的字体大小
actorFontSize
is optional
Type:
numbercannot be null
defined in: Mermaid Config
actorFontSize Type
number
actorFontSize Constraints
minimum: the value of this number must greater than or equal to: 1
actorFontSize Default Value
The default value is:
json
14actorFontFamily
演员标签的字体系列。逐字写入到内联 CSS 自定义属性中,因此可能出现的字符 terminate a declaration or open a new one are excluded: ;, <, >, (, ), {, }, and \. Quotes, commas, and spaces stay allowed for font stacks such as "Open Sans", sans-serif.
actorFontFamily
is optional
Type:
stringcannot be null
defined in: Mermaid Config
actorFontFamily Type
string
actorFontFamily Constraints
pattern: the string must match the following regular expression:
javascript
/^[^;<>(){}\\]*$/actorFontFamily Default Value
The default value is:
json
"\"Open Sans\", sans-serif"actorFontWeight
演员标签的字体粗细。仅限于 CSS 的 font-weight 关键字和数值粗细,因为这个值会直接写入内联 CSS 自定义属性。
actorFontWeight
is optional
Type:
stringcannot be null
defined in: Mermaid Config
actorFontWeight Type
string
actorFontWeight Constraints
pattern: the string must match the following regular expression:
javascript
/^(normal|bold|bolder|lighter|inherit|initial|revert|unset|[1-9][0-9]{0,3})$/actorFontWeight Default Value
The default value is:
json
"normal"usecaseFontSize
用例标签的字体大小
usecaseFontSize
is optional
Type:
numbercannot be null
defined in: Mermaid Config
usecaseFontSize Type
number
usecaseFontSize Constraints
minimum: the value of this number must greater than or equal to: 1
usecaseFontSize Default Value
The default value is:
json
12usecaseFontFamily
用于用例标签的字体系列。约束方式与 actorFontFamily 相同。
usecaseFontFamily
is optional
Type:
stringcannot be null
defined in: Mermaid Config
usecaseFontFamily Type
string
usecaseFontFamily Constraints
pattern: the string must match the following regular expression:
javascript
/^[^;<>(){}\\]*$/usecaseFontFamily Default Value
The default value is:
json
"\"Open Sans\", sans-serif"usecaseFontWeight
用例标签的字体粗细。约束方式与 actorFontWeight 相同。
usecaseFontWeight
is optional
Type:
stringcannot be null
defined in: Mermaid Config
usecaseFontWeight Type
string
usecaseFontWeight Constraints
pattern: the string must match the following regular expression:
javascript
/^(normal|bold|bolder|lighter|inherit|initial|revert|unset|[1-9][0-9]{0,3})$/usecaseFontWeight Default Value
The default value is:
json
"normal"nodeSpacing
同一级别节点之间的间距
nodeSpacing
is optional
Type:
numbercannot be null
defined in: Mermaid Config
nodeSpacing Type
number
nodeSpacing Constraints
minimum: the value of this number must greater than or equal to: 0
nodeSpacing Default Value
The default value is:
json
50rankSpacing
不同层节点之间的间距
rankSpacing
is optional
Type:
numbercannot be null
defined in: Mermaid Config
rankSpacing Type
number
rankSpacing Constraints
minimum: the value of this number must greater than or equal to: 0
rankSpacing Default Value
The default value is:
json
50diagramPadding
整个图表周围的内边距
diagramPadding
is optional
Type:
numbercannot be null
defined in: Mermaid Config
diagramPadding Type
number
diagramPadding Constraints
minimum: the value of this number must greater than or equal to: 0
diagramPadding Default Value
The default value is:
json
20colorScheme
用例图的颜色如何从活动主题中获取。role(默认)会给每种元素分配一种颜色,这些颜色取自 usecaseActorBkg / usecaseActorBorder、usecaseBkg / usecaseBorder 和 usecaseBoundaryBkg / usecaseBoundaryBorder 主题变量。颜色表示元素的“类型”,在插入、重新排序和重命名时保持不变——在中间添加一个用例不会重新着色后面的元素,因此差异对比、文档截图和视觉基线都保持稳定。而 rotate 则会给每个角色、用例和系统边界分配主题类别调色板(borderColorArray / bkgColorArray)中的独立槽,就像 ER 实体和类框的着色方式一样。角色和用例共享一个循环,而系统边界从零开始运行第二个循环,因此边界不会被迫与其中的元素匹配。在共享循环中,角色优先编号,用例紧随其后,按声明顺序排列——因此交错的 actor A、usecase U、actor B 的编号是 A、B、U,而不是 A, U, B. This buys per-instance variety at the cost of the stability role has: inserting an element shifts the colour of every later element of its own kind, and inserting an actor shifts the use cases too. Only the colour themes (redux-color, redux-dark-color) carry a palette, so on every other theme the two settings render identically.
classDef and style keep overriding both, whichever is set.
colorScheme
is optional
Type:
stringcannot be null
defined in: Mermaid Config
colorScheme Type
string
colorScheme Constraints
enum: the value of this property must be equal to one of the following values:
| Value | Explanation |
|---|---|
"role" | |
"rotate" |
colorScheme Default Value
The default value is:
json
"role"