Skip to content

Sankey Diagram Config Schema ​

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

包含特定于桑基图的配置的对象。

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

SankeyDiagramConfig Type ​

object (Sankey Diagram Config)

all of

SankeyDiagramConfig Properties ​

PropertyTypeRequiredNullableDefined by
widthnumberOptionalcannot be nullMermaid Config
heightnumberOptionalcannot be nullMermaid Config
linkColorMergedOptionalcannot be nullMermaid Config
nodeAlignmentstringOptionalcannot be nullMermaid Config
useMaxWidthbooleanOptionalcannot be nullMermaid Config
showValuesbooleanOptionalcannot be nullMermaid Config
prefixstringOptionalcannot be nullMermaid Config
suffixstringOptionalcannot be nullMermaid Config
nodeWidthnumberOptionalcannot be nullMermaid Config
nodePaddingnumberOptionalcannot be nullMermaid Config
labelStylestringOptionalcannot be nullMermaid Config
nodeColorsobjectOptionalcannot be nullMermaid Config

width ​

width

width Type ​

number

width Default Value ​

The default value is:

json
600

height ​

height

height Type ​

number

height Default Value ​

The default value is:

json
400

linkColor ​

桑基图中链接的颜色。

linkColor

linkColor Type ​

merged type (Details)

any of

linkColor Default Value ​

The default value is:

json
"gradient"

nodeAlignment ​

控制桑基图的对齐方式。

See https://github.com/d3/d3-sankey#alignments.

nodeAlignment

nodeAlignment Type ​

string

nodeAlignment Constraints ​

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

ValueExplanation
"left"Align all inputs to the left.
"right"Align all outputs to the right.
"center"Like `left`, except that nodes without any incoming links are moved as right as possible.
"justify"Like `left`, except that nodes without any outgoing links are moved to the far right.

nodeAlignment Default Value ​

The default value is:

json
"justify"

useMaxWidth ​

useMaxWidth

useMaxWidth Type ​

boolean

useMaxWidth Default Value ​

The default value is:

json
false

showValues ​

切换以显示或隐藏值以及标题。

showValues

showValues Type ​

boolean

showValues Default Value ​

The default value is:

json
true

prefix ​

用于值的前缀

prefix

prefix Type ​

string

prefix Default Value ​

The default value is:

json
""

suffix ​

用于值的后缀

suffix

suffix Type ​

string

suffix Default Value ​

The default value is:

json
""

nodeWidth ​

桑基图中节点的宽度。

nodeWidth

nodeWidth Type ​

number

nodeWidth Default Value ​

The default value is:

json
10

nodePadding ​

桑基图中节点之间的填充间距。

nodePadding

nodePadding Type ​

number

nodePadding Default Value ​

The default value is:

json
12

labelStyle ​

桑基图中标签的样式。

labelStyle

labelStyle Type ​

string

labelStyle Constraints ​

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

ValueExplanation
"legacy"Plain text labels (original style).
"outlined"Labels with a white outline for better readability against colored backgrounds.

labelStyle Default Value ​

The default value is:

json
"legacy"

nodeColors ​

节点 ID 到其颜色的映射。未指定的节点将使用默认配色方案。

nodeColors

nodeColors Type ​

object (Details)

Opens in mermaid.ai