Skip to content

Sankey Diagram Config Schema

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

The object containing configurations specific for sankey diagrams.

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

The color of the links in the sankey diagram.

linkColor

linkColor Type

merged type (Details)

any of

linkColor Default Value

The default value is:

json
"gradient"

nodeAlignment

Controls the alignment of the Sankey diagrams.

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

Toggle to display or hide values along with title.

showValues

showValues Type

boolean

showValues Default Value

The default value is:

json
true

prefix

The prefix to use for values

prefix

prefix Type

string

prefix Default Value

The default value is:

json
""

suffix

The suffix to use for values

suffix

suffix Type

string

suffix Default Value

The default value is:

json
""

nodeWidth

The width of the nodes in the sankey diagram.

nodeWidth

nodeWidth Type

number

nodeWidth Default Value

The default value is:

json
10

nodePadding

The padding between nodes in the sankey diagram.

nodePadding

nodePadding Type

number

nodePadding Default Value

The default value is:

json
12

labelStyle

The style of labels in the sankey diagram.

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

A mapping of node IDs to their colors. Nodes not specified will use the default color scheme.

nodeColors

nodeColors Type

object (Details)

Opens in mermaid.ai