Skip to content

sankey attributes ​

Sankey diagram: flows between nodes as links as wide as their value, nodes in columns sized by their flow; cycles drawn as loops, nodes draggable.

  • Categories: domain, noOpacity
  • Plotly equivalent: sankey
  • Guide: sankey chart page
  • Used in examples: demos/index-funds/sector-sankey, demos/science-basics/energy-sankey, demos/tqqq-soxl/counterparties-sankey, sankey/arrows, sankey/basic, sankey/circular, sankey/colorscales, sankey/fixed-positions, sankey/flow, sankey/groups, sankey/vertical

Generated from the attribute schema (96 entries). Machine-readable: plot-schema.json.

Attribute tree

type string ​

Trace type, e.g. 'scatter'. Defaults to 'scatter'.

  • Type: string (non-empty)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

visible enumerated ​

Whether the trace is drawn. legendonly hides it but keeps its (toggleable) legend entry.

  • Type: enumerated
  • Values: true | false | "legendonly"
  • Default: true
  • Array OK: no
  • Edit type: calc
  • Animatable: no

name string ​

Trace name shown in the legend and hover labels. Defaults to trace N.

  • Type: string
  • Default: none
  • Array OK: no
  • Edit type: legend+plot
  • Animatable: no

uid string ​

Stable identity used to match traces across updates, so reordered traces are moved instead of rebuilt.

  • Type: string
  • Default: none
  • Array OK: no
  • Edit type: plot
  • Animatable: no

showlegend boolean ​

Whether this trace has a legend entry.

  • Type: boolean
  • Default: true
  • Array OK: no
  • Edit type: legend+layout
  • Animatable: no

legend subplotid ​

The legend this trace's item is shown in: 'legend' (layout.legend), 'legend2' (layout.legend2), ….

  • Type: subplotid (legend, legend2, legend3, …)
  • Default: "legend"
  • Array OK: no
  • Edit type: legend+layout
  • Animatable: no

legendgroup string ​

Traces in the same legend group toggle together.

  • Type: string
  • Default: ""
  • Array OK: no
  • Edit type: legend
  • Animatable: no

hovertext string ​

Hover text per point; defaults to text.

  • Type: string
  • Default: ""
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

hoverinfo flaglist ​

Hover of nodes and links: labels ('all'), highlighting without labels ('none') or no hover at all ('skip'). The default of node.hoverinfo and link.hoverinfo.

  • Type: flaglist
  • Flags: (combine with +)
  • Also accepts: "all" | "none" | "skip"
  • Default: "all"
  • Array OK: no
  • Edit type: none
  • Animatable: no

hovertemplate string ​

Template for hover labels, e.g. '%{x}: %{y:.2f}<extra></extra>' (d3-format / d3-time-format after : / |). Overrides hoverinfo.

  • Type: string
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: none
  • Animatable: no

hoverlabel ​

Hover label style for this trace. Unset fields fall back to layout.hoverlabel (so there are no trace-level defaults).

  • Type: object
  • Edit type: none

hoverlabel.bgcolor color ​

Label background. Default: the point color.

  • Type: color
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: none
  • Animatable: no

hoverlabel.bordercolor color ​

Label border. Default: contrasting with the background.

  • Type: color
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: none
  • Animatable: no

hoverlabel.font ​

Label font.

  • Type: object
  • Edit type: none

hoverlabel.font.family string ​

Font family.

  • Type: string
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: none
  • Animatable: no

hoverlabel.font.size number ​

Font size in px.

  • Type: number ≥ 1
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: none
  • Animatable: no

hoverlabel.font.color color ​

Font color.

  • Type: color
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: none
  • Animatable: no

hoverlabel.align enumerated ​

Text alignment inside labels.

  • Type: enumerated
  • Values: "left" | "right" | "auto"
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: none
  • Animatable: no

hoverlabel.namelength integer ​

Characters of the trace name shown (-1: all, 0: none).

  • Type: integer ≥ -1
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: none
  • Animatable: no

selectedpoints any ​

Indices of the selected points (set by box/lasso selection, or programmatically). null clears the selection.

  • Type: any
  • Default: none
  • Array OK: no
  • Edit type: style
  • Animatable: no

legendrank number ​

Sort key for legend entries: lower ranks come first (top, or left). Ties keep trace order; traces default to 1000.

  • Type: number
  • Default: 1000
  • Array OK: no
  • Edit type: legend
  • Animatable: no

legendwidth number ​

Width of this trace's item in horizontal legends, overriding legend.entrywidth (same units). Default: its text's.

  • Type: number ≥ 0
  • Default: none
  • Array OK: no
  • Edit type: legend
  • Animatable: no

legendgrouptitle ​

Title of the legend group this trace belongs to.

  • Type: object
  • Edit type: legend

legendgrouptitle.text string ​

Title heading this trace's legend group.

  • Type: string
  • Default: ""
  • Array OK: no
  • Edit type: legend
  • Animatable: no

legendgrouptitle.font ​

Group title font. Unset fields come from legend.grouptitlefont.

  • Type: object
  • Edit type: legend

legendgrouptitle.font.family string ​

Font family.

  • Type: string
  • Default: none
  • Array OK: no
  • Edit type: legend
  • Animatable: no

legendgrouptitle.font.size number ​

Font size in px.

  • Type: number ≥ 1
  • Default: none
  • Array OK: no
  • Edit type: legend
  • Animatable: no

legendgrouptitle.font.color color ​

Font color.

  • Type: color
  • Default: none
  • Array OK: no
  • Edit type: legend
  • Animatable: no

legendgrouptitle.font.weight integer ​

Font weight: a CSS numeric weight (1–1000), normal or bold.

  • Type: integer from 1 to 1000, or "normal" | "bold"
  • Default: none
  • Array OK: no
  • Edit type: legend
  • Animatable: no

legendgrouptitle.font.style enumerated ​

Font style.

  • Type: enumerated
  • Values: "normal" | "italic"
  • Default: none
  • Array OK: no
  • Edit type: legend
  • Animatable: no

opacity number ​

Opacity of the whole trace.

  • Type: number from 0 to 1
  • Default: 1
  • Array OK: no
  • Edit type: style
  • Animatable: yes

meta any ​

Arbitrary user data, available in text templates as %{meta}.

  • Type: any
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: plot
  • Animatable: no

customdata data_array ​

Per-point user data, returned in events and available in hover templates.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

ids data_array ​

Per-point ids used to match points across animation frames.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

dataset string ​

Name of a figure-level dataset (figure.datasets). Data arrays, and per-point attributes whose values cannot start with @ (such as colors and sizes), may then reference its columns as '@column'; on string attributes such as text, '@…' stays literal text.

  • Type: string (non-empty)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

uirevision any ​

While unchanged, user interaction state for this trace (legend visibility, selections) is kept across updates.

  • Type: any
  • Default: none
  • Array OK: no
  • Edit type: none
  • Animatable: no

styleRules any ​

Conditional per-point styling as JSON (plan E8.5): [{ when: { y: { gt: 10 } }, set: { 'marker.color': 'gold' } }]. when tests fields of the point ('y', 'customdata[1]', 'pointNumber', …) with eq, ne, gt, gte, lt, lte, in, nin, between, regex, and, or and not; set gives per-point (arrayOk) attributes a value on the matching points. Later rules win; other points keep the trace's own value.

  • Type: any
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

domain ​

Where this trace is drawn, as a part of the plot area.

  • Type: object
  • Edit type: plot

domain.x info_array ​

Horizontal extent [start, end] of this trace as fractions of the plot area. Defaults to the layout.grid column when column is set, else [0, 1].

  • Type: info_array [number, number]
  • Default: [0, 1]
  • Array OK: no
  • Edit type: plot
  • Animatable: no

domain.y info_array ​

Vertical extent [start, end] of this trace as fractions of the plot area (from the bottom). Defaults to the layout.grid row when row is set, else [0, 1].

  • Type: info_array [number, number]
  • Default: [0, 1]
  • Array OK: no
  • Edit type: plot
  • Animatable: no

domain.row integer ​

Row of the layout.grid cell this trace is placed in (0 = first row in roworder). Only used with a grid.

  • Type: integer ≥ 0
  • Default: 0
  • Array OK: no
  • Edit type: plot
  • Animatable: no

domain.column integer ​

Column of the layout.grid cell this trace is placed in (0 = leftmost). Only used with a grid.

  • Type: integer ≥ 0
  • Default: 0
  • Array OK: no
  • Edit type: plot
  • Animatable: no

orientation enumerated ​

Flow direction: left to right ('h') or top to bottom ('v', the whole diagram transposed).

  • Type: enumerated
  • Values: "v" | "h"
  • Default: "h"
  • Array OK: no
  • Edit type: calc
  • Animatable: no

valueformat string ​

d3-format of the node and link values in hover labels (%{value}).

  • Type: string
  • Default: ".3s"
  • Array OK: no
  • Edit type: none
  • Animatable: no

valuesuffix string ​

Text after the values in hover labels (a unit such as TWh).

  • Type: string
  • Default: ""
  • Array OK: no
  • Edit type: none
  • Animatable: no

arrangement enumerated ​

Node dragging. 'snap': a node moves freely while dragged, the other nodes of its column make room, and it snaps back to its column when released. 'perpendicular': across the flow only. 'freeform': anywhere. 'fixed': nodes do not move. A drop restyles node.x / node.y of every node. Default: 'freeform' when node.x and node.y are given, else 'snap'.

  • Type: enumerated
  • Values: "snap" | "perpendicular" | "freeform" | "fixed"
  • Default: "snap"
  • Array OK: no
  • Edit type: calc
  • Animatable: no

textfont ​

Font of the node labels. Default: layout.font, with the automatic halo (shadow: auto).

  • Type: object
  • Edit type: plot

textfont.family string ​

CSS font-family list. Default: layout.font.family.

  • Type: string (non-empty)
  • Default: none
  • Array OK: no
  • Edit type: plot
  • Animatable: no

textfont.size number ​

Font size in CSS px.

  • Type: number ≥ 1
  • Default: none
  • Array OK: no
  • Edit type: plot
  • Animatable: no

textfont.color color ​

Text color. Default: layout.font.color.

  • Type: color
  • Default: none
  • Array OK: no
  • Edit type: plot
  • Animatable: no

textfont.weight integer ​

Font weight: a CSS numeric weight (1–1000), normal or bold.

  • Type: integer from 1 to 1000, or "normal" | "bold"
  • Default: none
  • Array OK: no
  • Edit type: plot
  • Animatable: no

textfont.style enumerated ​

Font style.

  • Type: enumerated
  • Values: "normal" | "italic"
  • Default: none
  • Array OK: no
  • Edit type: plot
  • Animatable: no

textfont.shadow string ​

CSS text-shadow (first shadow only), 'none', or 'auto' (the default): a thin halo in the text's contrast color, so labels read over the links.

  • Type: string
  • Default: none
  • Array OK: no
  • Edit type: plot
  • Animatable: no

node ​

The nodes.

  • Type: object
  • Edit type: calc

node.label data_array ​

Node labels, one per node index (Plotly pseudo-HTML allowed). A group made by node.groups takes the label after the last node referenced by a link.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

node.groups info_array ​

Groups of node indices, each drawn as one combined node: links between members of a group are dropped, links to and from members attach to the group.

  • Type: info_array [info_array, …], any length
  • Default: []
  • Array OK: no
  • Edit type: calc
  • Animatable: no

node.x data_array ​

Fixed node positions along the flow: the node center as a fraction of the domain (0 left, 1 right; top to bottom when vertical). Used with node.y; a position of 0 or a missing one leaves the node where the layout puts it (Plotly).

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

node.y data_array ​

Fixed node positions across the flow: the node center as a fraction of the domain (0 top, 1 bottom; left to right when vertical). Used with node.x.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

node.color color ​

Node color, or one per node index. Default: the colorway, one color per node at 0.8 opacity.

  • Type: color
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

node.customdata data_array ​

Extra data per node for %{customdata} and events.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

node.line ​

Outlines of the nodes.

  • Type: object
  • Edit type: style

node.line.color color ​

Outline color of the nodes, or one per node.

  • Type: color
  • Default: "#444"
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

node.line.width number ​

Outline width of the nodes in CSS px, or one per node.

  • Type: number ≥ 0
  • Default: 0.5
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

node.pad number ​

Space between the nodes of a column in CSS px (reduced when the column would not fit).

  • Type: number ≥ 0
  • Default: 20
  • Array OK: no
  • Edit type: calc
  • Animatable: no

node.thickness number ​

Node thickness along the flow direction, in CSS px.

  • Type: number ≥ 1
  • Default: 20
  • Array OK: no
  • Edit type: calc
  • Animatable: no

node.align enumerated ​

Column of nodes: by depth from the sources, sinks in the last column ('justify'); by depth ('left'); by height from the sinks ('right'); or by depth with sources next to their first target ('center').

  • Type: enumerated
  • Values: "justify" | "left" | "right" | "center"
  • Default: "justify"
  • Array OK: no
  • Edit type: calc
  • Animatable: no

node.hoverinfo enumerated ​

Hover of the nodes: labels ('all'), highlighting without labels ('none') or no hover and no events ('skip'). Default: the trace hoverinfo.

  • Type: enumerated
  • Values: "all" | "none" | "skip"
  • Default: "all"
  • Array OK: no
  • Edit type: none
  • Animatable: no

node.hovertemplate string ​

Template of the node hover labels: %{label}, %{value} (formatted with valueformat and valuesuffix), %{customdata}, %{color}, %{targetLinks.length} (incoming links), %{sourceLinks.length}, … <extra>…</extra> replaces the value box.

  • Type: string
  • Default: none
  • Array OK: no
  • Edit type: none
  • Animatable: no

The links.

  • Type: object
  • Edit type: calc

link.arrowlen number ​

Length of the arrowhead at the target end of every link, in CSS px (at most half the gap between the nodes); 0 draws no arrowheads.

  • Type: number ≥ 0
  • Default: 0
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.label data_array ​

Link labels: shown in hover labels, links with the same label highlight together, and a label names the link.colorscales entry of the link.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.color color ​

Link color, or one per link. Default: translucent black on light paper, translucent white on dark paper.

  • Type: color
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

link.hovercolor color ​

Link color while it (or a node it connects) is hovered, or one per link. Default: the link color 0.2 more opaque (brightened on dark paper, darkened on light paper when already that opaque).

  • Type: color
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

link.customdata data_array ​

Extra data per link for %{customdata} and events.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.line ​

Outlines of the links.

  • Type: object
  • Edit type: style

link.line.color color ​

Outline color of the links, or one per link.

  • Type: color
  • Default: "#444"
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

link.line.width number ​

Outline width of the links in CSS px, or one per link.

  • Type: number ≥ 0
  • Default: 0
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

link.source data_array ​

Source node index of every link.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.target data_array ​

Target node index of every link.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.value data_array ​

Flow of every link, which sets its width. Links without a positive value are dropped.

  • Type: data_array (array or typed array)
  • Default: none
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.hoverinfo enumerated ​

Hover of the links: labels ('all'), highlighting without labels ('none') or no hover and no events ('skip'). Default: the trace hoverinfo.

  • Type: enumerated
  • Values: "all" | "none" | "skip"
  • Default: "all"
  • Array OK: no
  • Edit type: none
  • Animatable: no

link.hovertemplate string ​

Template of the link hover labels: %{label}, %{value} (formatted with valueformat and valuesuffix), %{source.label}, %{target.label}, %{flow.labelConcentration}, %{customdata}, … <extra>…</extra> replaces the value box.

  • Type: string
  • Default: none
  • Array OK: no
  • Edit type: none
  • Animatable: no

link.flow ​

Flow particles (a Holochart extension): dots streaming along every link from its source to its target, spread across its width, as many as its size and density call for. Off unless link.flow is set (flow: {} turns them on). They dim with links outside a hover highlight, and hold still under prefers-reduced-motion: reduce.

  • Type: object
  • Edit type: style

link.flow.density number ​

Particles per 100 px of link length for every 10 px of link width (thinner links get one lane), or one density per link; 0 draws none.

  • Type: number ≥ 0
  • Default: 2
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

link.flow.speed number ​

Particle speed along the link in CSS px per second, or one per link; 0 holds the particles still.

  • Type: number ≥ 0
  • Default: 50
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

link.flow.size number ​

Particle diameter in CSS px, or one per link.

  • Type: number ≥ 0
  • Default: 3
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

link.flow.color color ​

Particle color, or one per link. Default: the link color, opaque.

  • Type: color
  • Default: none
  • Array OK: yes (one value per point)
  • Edit type: style
  • Animatable: no

link.flow.opacity number ​

Particle opacity.

  • Type: number from 0 to 1
  • Default: 1
  • Array OK: no
  • Edit type: style
  • Animatable: no

link.flow.time number ​

Freeze the particles where they are this many seconds into the animation: a still frame, e.g. for image export and visual tests. Default: the particles move.

  • Type: number
  • Default: none
  • Array OK: no
  • Edit type: style
  • Animatable: no

link.colorscales ​

Concentration colorscales: links labeled label are colored by their share of the flow between their two nodes (the links sharing the source and target), mapped from cmin–cmax through colorscale. Hover labels then show the concentration.

  • Type: array of concentrationscales objects; template defaults for every item go in concentrationscalesdefaults
  • Edit type: calc

link.colorscales[].label string ​

The link label this colorscale applies to.

  • Type: string
  • Default: ""
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.colorscales[].cmin number ​

Concentration mapped to the first color.

  • Type: number
  • Default: 0
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.colorscales[].cmax number ​

Concentration mapped to the last color.

  • Type: number
  • Default: 1
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.colorscales[].colorscale colorscale ​

Colorscale of the concentration.

  • Type: colorscale
  • Default: [[0, "white"], [1, "black"]]
  • Array OK: no
  • Edit type: calc
  • Animatable: no

link.colorscales[].name string ​

Name of this concentrationscales, used to reference it from a template via templateitemname.

  • Type: string
  • Default: none
  • Array OK: no
  • Edit type: none
  • Animatable: no

link.colorscales[].templateitemname string ​

Name of a template concentrationscales to inherit from. If no template item matches, this concentrationscales is hidden (visible: false).

  • Type: string
  • Default: none
  • Array OK: no
  • Edit type: plot
  • Animatable: no

Released under the MIT License.