Skip to content

State Diagram Config Schema ​

txt
https://mermaid.js.org/schemas/config.schema.json#/$defs/StateDiagramConfig

包含特定于实体关系图的配置的对象

AbstractExtensibleStatusIdentifiableCustom PropertiesAdditional PropertiesAccess RestrictionsDefined In
Can be instantiatedNoUnknown statusNoForbiddenAllowednoneconfig.schema.json*

StateDiagramConfig Type ​

object (State Diagram Config)

all of

StateDiagramConfig Properties ​

PropertyTypeRequiredNullableDefined by
themestringOptionalcannot be nullMermaid Config
lookstringOptionalcannot be nullMermaid Config
layoutstringOptionalcannot be nullMermaid Config
wrappingWidthnumberRequiredcannot be nullMermaid Config
minNodeWidthnumberRequiredcannot be nullMermaid Config
titleTopMarginintegerRequiredcannot be nullMermaid Config
arrowMarkerAbsolutebooleanOptionalcannot be nullMermaid Config
dividerMarginnumberOptionalcannot be nullMermaid Config
sizeUnitnumberOptionalcannot be nullMermaid Config
paddingnumberOptionalcannot be nullMermaid Config
textHeightnumberOptionalcannot be nullMermaid Config
titleShiftnumberOptionalcannot be nullMermaid Config
noteMarginnumberOptionalcannot be nullMermaid Config
nodeSpacingintegerOptionalcannot be nullMermaid Config
rankSpacingintegerOptionalcannot be nullMermaid Config
forkWidthnumberOptionalcannot be nullMermaid Config
forkHeightnumberOptionalcannot be nullMermaid Config
miniPaddingnumberOptionalcannot be nullMermaid Config
fontSizeFactornumberOptionalcannot be nullMermaid Config
fontSizenumberOptionalcannot be nullMermaid Config
labelHeightnumberOptionalcannot be nullMermaid Config
edgeLengthFactorstringOptionalcannot be nullMermaid Config
compositTitleSizenumberOptionalcannot be nullMermaid Config
radiusnumberOptionalcannot be nullMermaid Config

theme ​

主题,CSS 样式表。你也可以使用 themeCSS 覆盖此值。

theme

theme Type ​

string

theme Constraints ​

enum: the value of this property must be equal to one of the following values:

ValueExplanation
"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

look Type ​

string

look Constraints ​

enum: the value of this property must be equal to one of the following values:

ValueExplanation
"classic"
"handDrawn"
"neo"

look Default Value ​

The default value is:

json
"neo"

layout ​

定义用于渲染图表的布局算法。

layout

layout Type ​

string

layout Default Value ​

The default value is:

json
"elk"

wrappingWidth ​

文本换行的节点宽度。使用 Markdown 字符串时,文本会自动换行,此值设置文本在换行前的最大宽度。

wrappingWidth

wrappingWidth Type ​

number

wrappingWidth Default Value ​

The default value is:

json
120

minNodeWidth ​

节点标签区域的最小宽度。比这个宽的标签会被加宽,所以短文本的节点也会有统一的宽度;节点自身的内边距会叠加上去,就像 wrappingWidth 的情况一样。设置了明确宽度的节点不受影响。

minNodeWidth

minNodeWidth Type ​

number

minNodeWidth Default Value ​

The default value is:

json
120

titleTopMargin ​

图表上方文本的顶部边​​距

titleTopMargin

titleTopMargin Type ​

integer

titleTopMargin Constraints ​

minimum: the value of this number must greater than or equal to: 0

titleTopMargin Default Value ​

The default value is:

json
25

arrowMarkerAbsolute ​

arrowMarkerAbsolute

arrowMarkerAbsolute Type ​

boolean

dividerMargin ​

dividerMargin

dividerMargin Type ​

number

dividerMargin Default Value ​

The default value is:

json
10

sizeUnit ​

sizeUnit

sizeUnit Type ​

number

sizeUnit Default Value ​

The default value is:

json
5

padding ​

padding

padding Type ​

number

padding Default Value ​

The default value is:

json
8

textHeight ​

textHeight

textHeight Type ​

number

textHeight Default Value ​

The default value is:

json
10

titleShift ​

titleShift

titleShift Type ​

number

titleShift Default Value ​

The default value is:

json
-15

noteMargin ​

noteMargin

noteMargin Type ​

number

noteMargin Default Value ​

The default value is:

json
10

nodeSpacing ​

nodeSpacing

nodeSpacing Type ​

integer

nodeSpacing Constraints ​

minimum: the value of this number must greater than or equal to: 0

rankSpacing ​

rankSpacing

rankSpacing Type ​

integer

rankSpacing Constraints ​

minimum: the value of this number must greater than or equal to: 0

forkWidth ​

forkWidth

forkWidth Type ​

number

forkWidth Default Value ​

The default value is:

json
70

forkHeight ​

forkHeight

forkHeight Type ​

number

forkHeight Default Value ​

The default value is:

json
7

miniPadding ​

miniPadding

miniPadding Type ​

number

miniPadding Default Value ​

The default value is:

json
2

fontSizeFactor ​

字体大小因子,用于在通过 dagre 布局渲染之前猜测边标签的宽度。如果/当切换字体时,可能需要更新

fontSizeFactor

fontSizeFactor Type ​

number

fontSizeFactor Default Value ​

The default value is:

json
5.02

fontSize ​

fontSize

fontSize Type ​

number

fontSize Default Value ​

The default value is:

json
24

labelHeight ​

labelHeight

labelHeight Type ​

number

labelHeight Default Value ​

The default value is:

json
16

edgeLengthFactor ​

edgeLengthFactor

edgeLengthFactor Type ​

string

edgeLengthFactor Default Value ​

The default value is:

json
"20"

compositTitleSize ​

compositTitleSize

compositTitleSize Type ​

number

compositTitleSize Default Value ​

The default value is:

json
35

radius ​

radius

radius Type ​

number

radius Default Value ​

The default value is:

json
5
Opens in mermaid.ai