Skip to content

Architecture Diagram Config Schema

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

包含特定于架构图的配置的对象

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

ArchitectureDiagramConfig Type

object (Architecture Diagram Config)

all of

ArchitectureDiagramConfig Properties

PropertyTypeRequiredNullableDefined by
paddingnumberRequiredcannot be nullMermaid Config
iconSizenumberRequiredcannot be nullMermaid Config
fontSizenumberRequiredcannot be nullMermaid Config
randomizebooleanRequiredcannot be nullMermaid Config
nodeSeparationnumberRequiredcannot be nullMermaid Config
idealEdgeLengthMultipliernumberRequiredcannot be nullMermaid Config
edgeElasticitynumberRequiredcannot be nullMermaid Config
numIternumberRequiredcannot be nullMermaid Config
seednumberRequiredcannot be nullMermaid Config

padding

padding

padding Type

number

padding Default Value

The default value is:

json
40

iconSize

iconSize

iconSize Type

number

iconSize Default Value

The default value is:

json
80

fontSize

fontSize

fontSize Type

number

fontSize Default Value

The default value is:

json
16

randomize

在运行布局算法之前是否随机化初始节点位置。当为 false(默认值)时,节点从确定的初始位置开始。当为 true 时,节点从随机位置开始,这可能产生不同但潜在更合理间距的布局 layouts. Note: randomize: false alone does NOT guarantee identical renders, because the underlying fcose layout still uses Math.random() internally during its constraint solver — use the seed option for full determinism.

randomize

randomize Type

boolean

randomize Default Value

The default value is:

json
false

nodeSeparation

同一组中相邻节点之间的最小间距(以像素为单位),传递给底层 fcose 布局。当许多边共享相同的端口方向时,可增加此值以分开重叠的相邻节点。

nodeSeparation

nodeSeparation Type

number

nodeSeparation Default Value

The default value is:

json
75

idealEdgeLengthMultiplier

将乘数应用于 iconSize,以计算同一组内节点之间边的理想长度。增加该值可增加间距;减少该值可使图表更紧凑。跨组边界的边不受影响,并使用固定的较短长度。

idealEdgeLengthMultiplier

idealEdgeLengthMultiplier Type

number

idealEdgeLengthMultiplier Default Value

The default value is:

json
1.5

edgeElasticity

弹簧弹性(0–1)应用于同一组内节点之间的边,并传递给 fcose。较高的值会将连接的节点拉得更近;较低的值则让布局将它们分开。跨组边界的边不受影响。

edgeElasticity

edgeElasticity Type

number

edgeElasticity Default Value

The default value is:

json
0.45

numIter

fcose 布局算法在停止前运行的最大迭代次数。在大规模或密集连接的图表上提高此值可以获得更高质量,但会增加渲染时间。

numIter

numIter Type

number

numIter Default Value

The default value is:

json
2500

seed

fcose 布局的确定性种子。默认为 1,这会使同一图表的每次渲染产生相同的布局——这是保证视觉回归测试稳定所必需的。设置为 0 可选择不用,并使用未替换的 Math.random(布局在各次渲染之间仍会略有不同,与修复前的行为一致)。任何其他数字都会选择不同的可重现布局变体。

seed

seed Type

number

seed Default Value

The default value is:

json
1
Opens in mermaid.ai