plotly.graph_objects.Sankey

class plotly.graph_objects.Sankey(arg=None, arrangement=None, customdata=None, customdatasrc=None, domain=None, hoverinfo=None, hoverlabel=None, ids=None, idssrc=None, legend=None, legendgrouptitle=None, legendrank=None, legendwidth=None, link=None, meta=None, metasrc=None, name=None, node=None, orientation=None, selectedpoints=None, stream=None, textfont=None, uid=None, uirevision=None, valueformat=None, valuesuffix=None, visible=None, **kwargs)
__init__(arg=None, arrangement=None, customdata=None, customdatasrc=None, domain=None, hoverinfo=None, hoverlabel=None, ids=None, idssrc=None, legend=None, legendgrouptitle=None, legendrank=None, legendwidth=None, link=None, meta=None, metasrc=None, name=None, node=None, orientation=None, selectedpoints=None, stream=None, textfont=None, uid=None, uirevision=None, valueformat=None, valuesuffix=None, visible=None, **kwargs)

Construct a new Sankey object

Sankey plots for network flow data analysis. The nodes are specified in nodes and the links between sources and targets in links. The colors are set in nodes[i].color and links[i].color, otherwise defaults are used.

Parameters
  • arg – dict of properties compatible with this constructor or an instance of plotly.graph_objects.Sankey

  • arrangement – If value is snap (the default), the node arrangement is assisted by automatic snapping of elements to preserve space between nodes specified via nodepad. If value is perpendicular, the nodes can only move along a line perpendicular to the flow. If value is freeform, the nodes can freely move on the plane. If value is fixed, the nodes are stationary.

  • customdata – Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements

  • customdatasrc – Sets the source reference on Chart Studio Cloud for customdata.

  • domainplotly.graph_objects.sankey.Domain instance or dict with compatible properties

  • hoverinfo – Determines which trace information appear on hover. If none or skip are set, no information is displayed upon hovering. But, if none is set, click and hover events are still fired. Note that this attribute is superseded by node.hoverinfo and node.hoverinfo for nodes and links respectively.

  • hoverlabelplotly.graph_objects.sankey.Hoverlabel instance or dict with compatible properties

  • ids – Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.

  • idssrc – Sets the source reference on Chart Studio Cloud for ids.

  • legend – Sets the reference to a legend to show this trace in. References to these legends are “legend”, “legend2”, “legend3”, etc. Settings for these legends are set in the layout, under layout.legend, layout.legend2, etc.

  • legendgrouptitleplotly.graph_objects.sankey.Legendgrouptitle instance or dict with compatible properties

  • legendrank – Sets the legend rank for this trace. Items and groups with smaller ranks are presented on top/left side while with “reversed” legend.traceorder they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items. When having unranked or equal rank items shapes would be displayed after traces i.e. according to their order in data and layout.

  • legendwidth – Sets the width (in px or fraction) of the legend for this trace.

  • link – The links of the Sankey plot.

  • meta – Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace name, graph, axis and colorbar title.text, annotation text rangeselector, updatemenues and sliders label text all support meta. To access the trace meta values in an attribute in the same trace, simply use %{meta[i]} where i is the index or key of the meta item in question. To access trace meta in layout attributes, use %{data[n[.meta[i]} where i is the index or key of the meta and n is the trace index.

  • metasrc – Sets the source reference on Chart Studio Cloud for meta.

  • name – Sets the trace name. The trace name appears as the legend item and on hover.

  • node – The nodes of the Sankey plot.

  • orientation – Sets the orientation of the Sankey diagram.

  • selectedpoints – Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the unselected are turned on for all points, whereas, any other non-array values means no selection all where the selected and unselected styles have no effect.

  • streamplotly.graph_objects.sankey.Stream instance or dict with compatible properties

  • textfont – Sets the font for node labels

  • uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.

  • uirevision – Controls persistence of some user-driven changes to the trace: constraintrange in parcoords traces, as well as some editable: true modifications such as name and colorbar.title. Defaults to layout.uirevision. Note that other user-driven trace attribute changes are controlled by layout attributes: trace.visible is controlled by layout.legend.uirevision, selectedpoints is controlled by layout.selectionrevision, and colorbar.(x|y) (accessible with config: {editable: true}) is controlled by layout.editrevision. Trace changes are tracked by uid, which only falls back on trace index if no uid is provided. So if your app can add/remove traces before the end of the data array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a uid that stays with it as it moves.

  • valueformat – Sets the value formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format.

  • valuesuffix – Adds a unit to follow the value in the hover tooltip. Add a space if a separation is necessary from the value.

  • visible – Determines whether or not this trace is visible. If “legendonly”, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).

Returns

Return type

Sankey

plotly.graph_objects.sankey

plotly.graph_objects.sankey

class plotly.graph_objects.sankey.Domain(arg=None, column=None, row=None, x=None, y=None, **kwargs)
property column

If there is a layout grid, use the domain for this column in the grid for this sankey trace .

The ‘column’ property is a integer and may be specified as:
  • An int (or float that will be cast to an int) in the interval [0, 9223372036854775807]

Returns

Return type

int

property row

If there is a layout grid, use the domain for this row in the grid for this sankey trace .

The ‘row’ property is a integer and may be specified as:
  • An int (or float that will be cast to an int) in the interval [0, 9223372036854775807]

Returns

Return type

int

property x
Sets the horizontal domain of this sankey trace (in plot

fraction).

The ‘x’ property is an info array that may be specified as:

  • a list or tuple of 2 elements where:

  1. The ‘x[0]’ property is a number and may be specified as:
    • An int or float in the interval [0, 1]

  2. The ‘x[1]’ property is a number and may be specified as:
    • An int or float in the interval [0, 1]

    list

property y
Sets the vertical domain of this sankey trace (in plot

fraction).

The ‘y’ property is an info array that may be specified as:

  • a list or tuple of 2 elements where:

  1. The ‘y[0]’ property is a number and may be specified as:
    • An int or float in the interval [0, 1]

  2. The ‘y[1]’ property is a number and may be specified as:
    • An int or float in the interval [0, 1]

    list

class plotly.graph_objects.sankey.Hoverlabel(arg=None, align=None, alignsrc=None, bgcolor=None, bgcolorsrc=None, bordercolor=None, bordercolorsrc=None, font=None, namelength=None, namelengthsrc=None, **kwargs)
property align

Sets the horizontal alignment of the text content within hover label box. Has an effect only if the hover label text spans more two or more lines

The ‘align’ property is an enumeration that may be specified as:
  • One of the following enumeration values:

    [‘left’, ‘right’, ‘auto’]

  • A tuple, list, or one-dimensional numpy array of the above

Returns

Return type

Any|numpy.ndarray

property alignsrc

Sets the source reference on Chart Studio Cloud for align.

The ‘alignsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property bgcolor

Sets the background color of the hover labels for this trace

The ‘bgcolor’ property is a color and may be specified as:
  • A hex string (e.g. ‘#ff0000’)

  • An rgb/rgba string (e.g. ‘rgb(255,0,0)’)

  • An hsl/hsla string (e.g. ‘hsl(0,100%,50%)’)

  • An hsv/hsva string (e.g. ‘hsv(0,100%,100%)’)

  • A named CSS color:

    aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgrey, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgrey, lightgreen, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, rebeccapurple, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen

  • A list or array of any of the above

Returns

Return type

str|numpy.ndarray

property bgcolorsrc

Sets the source reference on Chart Studio Cloud for bgcolor.

The ‘bgcolorsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property bordercolor

Sets the border color of the hover labels for this trace.

The ‘bordercolor’ property is a color and may be specified as:
  • A hex string (e.g. ‘#ff0000’)

  • An rgb/rgba string (e.g. ‘rgb(255,0,0)’)

  • An hsl/hsla string (e.g. ‘hsl(0,100%,50%)’)

  • An hsv/hsva string (e.g. ‘hsv(0,100%,100%)’)

  • A named CSS color:

    aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgrey, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgrey, lightgreen, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, rebeccapurple, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen

  • A list or array of any of the above

Returns

Return type

str|numpy.ndarray

property bordercolorsrc

Sets the source reference on Chart Studio Cloud for bordercolor.

The ‘bordercolorsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property font

Sets the font used in hover labels.

The ‘font’ property is an instance of Font that may be specified as:

  • An instance of plotly.graph_objects.sankey.hoverlabel.Font

  • A dict of string/value properties that will be passed to the Font constructor

    Supported dict properties:

    color

    colorsrc

    Sets the source reference on Chart Studio Cloud for color.

    family

    HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren’t available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include “Arial”, “Balto”, “Courier New”, “Droid Sans”, “Droid Serif”, “Droid Sans Mono”, “Gravitas One”, “Old Standard TT”, “Open Sans”, “Overpass”, “PT Sans Narrow”, “Raleway”, “Times New Roman”.

    familysrc

    Sets the source reference on Chart Studio Cloud for family.

    lineposition

    Sets the kind of decoration line(s) with text, such as an “under”, “over” or “through” as well as combinations e.g. “under+over”, etc.

    linepositionsrc

    Sets the source reference on Chart Studio Cloud for lineposition.

    shadow

    Sets the shape and color of the shadow behind text. “auto” places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en- US/docs/Web/CSS/text-shadow for additional options.

    shadowsrc

    Sets the source reference on Chart Studio Cloud for shadow.

    size

    sizesrc

    Sets the source reference on Chart Studio Cloud for size.

    style

    Sets whether a font should be styled with a normal or italic face from its family.

    stylesrc

    Sets the source reference on Chart Studio Cloud for style.

    textcase

    Sets capitalization of text. It can be used to make text appear in all-uppercase or all- lowercase, or with each word capitalized.

    textcasesrc

    Sets the source reference on Chart Studio Cloud for textcase.

    variant

    Sets the variant of the font.

    variantsrc

    Sets the source reference on Chart Studio Cloud for variant.

    weight

    Sets the weight (or boldness) of the font.

    weightsrc

    Sets the source reference on Chart Studio Cloud for weight.

Returns

Return type

plotly.graph_objects.sankey.hoverlabel.Font

property namelength

Sets the default length (in number of characters) of the trace name in the hover labels for all traces. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to namelength - 3 characters and add an ellipsis.

The ‘namelength’ property is a integer and may be specified as:
  • An int (or float that will be cast to an int) in the interval [-1, 9223372036854775807]

  • A tuple, list, or one-dimensional numpy array of the above

Returns

Return type

int|numpy.ndarray

property namelengthsrc

Sets the source reference on Chart Studio Cloud for namelength.

The ‘namelengthsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

class plotly.graph_objects.sankey.Legendgrouptitle(arg=None, font=None, text=None, **kwargs)
property font

Sets this legend group’s title font.

The ‘font’ property is an instance of Font that may be specified as:

  • An instance of plotly.graph_objects.sankey.legendgrouptitle.Font

  • A dict of string/value properties that will be passed to the Font constructor

    Supported dict properties:

    color

    family

    HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren’t available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include “Arial”, “Balto”, “Courier New”, “Droid Sans”, “Droid Serif”, “Droid Sans Mono”, “Gravitas One”, “Old Standard TT”, “Open Sans”, “Overpass”, “PT Sans Narrow”, “Raleway”, “Times New Roman”.

    lineposition

    Sets the kind of decoration line(s) with text, such as an “under”, “over” or “through” as well as combinations e.g. “under+over”, etc.

    shadow

    Sets the shape and color of the shadow behind text. “auto” places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en- US/docs/Web/CSS/text-shadow for additional options.

    size

    style

    Sets whether a font should be styled with a normal or italic face from its family.

    textcase

    Sets capitalization of text. It can be used to make text appear in all-uppercase or all- lowercase, or with each word capitalized.

    variant

    Sets the variant of the font.

    weight

    Sets the weight (or boldness) of the font.

Returns

Return type

plotly.graph_objects.sankey.legendgrouptitle.Font

property text

Sets the title of the legend group.

The ‘text’ property is a string and must be specified as:
  • A string

  • A number that will be converted to a string

Returns

Return type

str

property arrowlen

Sets the length (in px) of the links arrow, if 0 no arrow will be drawn.

The ‘arrowlen’ property is a number and may be specified as:
  • An int or float in the interval [0, inf]

Returns

Return type

int|float

property color

Sets the link color. It can be a single value, or an array for specifying color for each link. If link.color is omitted, then by default, a translucent grey link will be used.

The ‘color’ property is a color and may be specified as:
  • A hex string (e.g. ‘#ff0000’)

  • An rgb/rgba string (e.g. ‘rgb(255,0,0)’)

  • An hsl/hsla string (e.g. ‘hsl(0,100%,50%)’)

  • An hsv/hsva string (e.g. ‘hsv(0,100%,100%)’)

  • A named CSS color:

    aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgrey, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgrey, lightgreen, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, rebeccapurple, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen

  • A list or array of any of the above

Returns

Return type

str|numpy.ndarray

property colorscaledefaults

When used in a template (as layout.template.data.sankey.link.colorscaledefaults), sets the default property values to use for elements of sankey.link.colorscales

The ‘colorscaledefaults’ property is an instance of Colorscale that may be specified as:

Returns

Return type

plotly.graph_objects.sankey.link.Colorscale

property colorscales

The ‘colorscales’ property is a tuple of instances of Colorscale that may be specified as:

  • A list or tuple of instances of plotly.graph_objects.sankey.link.Colorscale

  • A list or tuple of dicts of string/value properties that will be passed to the Colorscale constructor

    Supported dict properties:

    cmax

    Sets the upper bound of the color domain.

    cmin

    Sets the lower bound of the color domain.

    colorscale

    Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, [[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]. To control the bounds of the colorscale in color space, use cmin and cmax. Alternatively, colorscale may be a palette name string of the following list: Blac kbody,Bluered,Blues,Cividis,Earth,Electric,Gree ns,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,R eds,Viridis,YlGnBu,YlOrRd.

    label

    The label of the links to color based on their concentration within a flow.

    name

    When used in a template, named items are created in the output figure in addition to any items the figure already has in this array. You can modify these items in the output figure by making your own item with templateitemname matching this name alongside your modifications (including visible: false or enabled: false to hide it). Has no effect outside of a template.

    templateitemname

    Used to refer to a named item in this array in the template. Named items from the template will be created even without a matching item in the input figure, but you can modify one by making an item with templateitemname matching its name, alongside your modifications (including visible: false or enabled: false to hide it). If there is no template or no matching item, this item will be hidden unless you explicitly show it with visible: true.

Returns

Return type

tuple[plotly.graph_objects.sankey.link.Colorscale]

property colorsrc

Sets the source reference on Chart Studio Cloud for color.

The ‘colorsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property customdata

Assigns extra data to each link.

The ‘customdata’ property is an array that may be specified as a tuple, list, numpy array, or pandas Series

Returns

Return type

numpy.ndarray

property customdatasrc

Sets the source reference on Chart Studio Cloud for customdata.

The ‘customdatasrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property hovercolor

Sets the link hover color. It can be a single value, or an array for specifying hover colors for each link. If link.hovercolor is omitted, then by default, links will become slightly more opaque when hovered over.

The ‘hovercolor’ property is a color and may be specified as:
  • A hex string (e.g. ‘#ff0000’)

  • An rgb/rgba string (e.g. ‘rgb(255,0,0)’)

  • An hsl/hsla string (e.g. ‘hsl(0,100%,50%)’)

  • An hsv/hsva string (e.g. ‘hsv(0,100%,100%)’)

  • A named CSS color:

    aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgrey, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgrey, lightgreen, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, rebeccapurple, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen

  • A list or array of any of the above

Returns

Return type

str|numpy.ndarray

property hovercolorsrc

Sets the source reference on Chart Studio Cloud for hovercolor.

The ‘hovercolorsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property hoverinfo

Determines which trace information appear when hovering links. If none or skip are set, no information is displayed upon hovering. But, if none is set, click and hover events are still fired.

The ‘hoverinfo’ property is an enumeration that may be specified as:
  • One of the following enumeration values:

    [‘all’, ‘none’, ‘skip’]

Returns

Return type

Any

property hoverlabel

The ‘hoverlabel’ property is an instance of Hoverlabel that may be specified as:

  • An instance of plotly.graph_objects.sankey.link.Hoverlabel

  • A dict of string/value properties that will be passed to the Hoverlabel constructor

    Supported dict properties:

    align

    Sets the horizontal alignment of the text content within hover label box. Has an effect only if the hover label text spans more two or more lines

    alignsrc

    Sets the source reference on Chart Studio Cloud for align.

    bgcolor

    Sets the background color of the hover labels for this trace

    bgcolorsrc

    Sets the source reference on Chart Studio Cloud for bgcolor.

    bordercolor

    Sets the border color of the hover labels for this trace.

    bordercolorsrc

    Sets the source reference on Chart Studio Cloud for bordercolor.

    font

    Sets the font used in hover labels.

    namelength

    Sets the default length (in number of characters) of the trace name in the hover labels for all traces. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to namelength - 3 characters and add an ellipsis.

    namelengthsrc

    Sets the source reference on Chart Studio Cloud for namelength.

Returns

Return type

plotly.graph_objects.sankey.link.Hoverlabel

property hovertemplate

Template string used for rendering the information that appear on hover box. Note that this will override hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}” as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, “xother” will be added to those with different x positions from the first point. An underscore before or after “(x|y)other” will add a space on that side, only when this field is shown. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time- format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in hovertemplate are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are arrayOk: true) are available. Variables source and target are node objects.Finally, the template string has access to variables value and label. Anything contained in tag <extra> is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag <extra></extra>.

The ‘hovertemplate’ property is a string and must be specified as:
  • A string

  • A number that will be converted to a string

  • A tuple, list, or one-dimensional numpy array of the above

Returns

Return type

str|numpy.ndarray

property hovertemplatesrc

Sets the source reference on Chart Studio Cloud for hovertemplate.

The ‘hovertemplatesrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property label

The shown name of the link.

The ‘label’ property is an array that may be specified as a tuple, list, numpy array, or pandas Series

Returns

Return type

numpy.ndarray

property labelsrc

Sets the source reference on Chart Studio Cloud for label.

The ‘labelsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property line

The ‘line’ property is an instance of Line that may be specified as:

  • An instance of plotly.graph_objects.sankey.link.Line

  • A dict of string/value properties that will be passed to the Line constructor

    Supported dict properties:

    color

    Sets the color of the line around each link.

    colorsrc

    Sets the source reference on Chart Studio Cloud for color.

    width

    Sets the width (in px) of the line around each link.

    widthsrc

    Sets the source reference on Chart Studio Cloud for width.

Returns

Return type

plotly.graph_objects.sankey.link.Line

property source

An integer number [0..nodes.length - 1] that represents the source node.

The ‘source’ property is an array that may be specified as a tuple, list, numpy array, or pandas Series

Returns

Return type

numpy.ndarray

property sourcesrc

Sets the source reference on Chart Studio Cloud for source.

The ‘sourcesrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property target

An integer number [0..nodes.length - 1] that represents the target node.

The ‘target’ property is an array that may be specified as a tuple, list, numpy array, or pandas Series

Returns

Return type

numpy.ndarray

property targetsrc

Sets the source reference on Chart Studio Cloud for target.

The ‘targetsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property value

A numeric value representing the flow volume value.

The ‘value’ property is an array that may be specified as a tuple, list, numpy array, or pandas Series

Returns

Return type

numpy.ndarray

property valuesrc

Sets the source reference on Chart Studio Cloud for value.

The ‘valuesrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

class plotly.graph_objects.sankey.Node(arg=None, align=None, color=None, colorsrc=None, customdata=None, customdatasrc=None, groups=None, hoverinfo=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, label=None, labelsrc=None, line=None, pad=None, thickness=None, x=None, xsrc=None, y=None, ysrc=None, **kwargs)
property align

Sets the alignment method used to position the nodes along the horizontal axis.

The ‘align’ property is an enumeration that may be specified as:
  • One of the following enumeration values:

    [‘justify’, ‘left’, ‘right’, ‘center’]

Returns

Return type

Any

property color

Sets the node color. It can be a single value, or an array for specifying color for each node. If node.color is omitted, then the default Plotly color palette will be cycled through to have a variety of colors. These defaults are not fully opaque, to allow some visibility of what is beneath the node.

The ‘color’ property is a color and may be specified as:
  • A hex string (e.g. ‘#ff0000’)

  • An rgb/rgba string (e.g. ‘rgb(255,0,0)’)

  • An hsl/hsla string (e.g. ‘hsl(0,100%,50%)’)

  • An hsv/hsva string (e.g. ‘hsv(0,100%,100%)’)

  • A named CSS color:

    aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgrey, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgrey, lightgreen, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, rebeccapurple, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen

  • A list or array of any of the above

Returns

Return type

str|numpy.ndarray

property colorsrc

Sets the source reference on Chart Studio Cloud for color.

The ‘colorsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property customdata

Assigns extra data to each node.

The ‘customdata’ property is an array that may be specified as a tuple, list, numpy array, or pandas Series

Returns

Return type

numpy.ndarray

property customdatasrc

Sets the source reference on Chart Studio Cloud for customdata.

The ‘customdatasrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property groups

Groups of nodes. Each group is defined by an array with the indices of the nodes it contains. Multiple groups can be specified.

The ‘groups’ property is an info array that may be specified as: * a 2D list where:

The ‘groups[i][j]’ property is a number and may be specified as: - An int or float

Returns

Return type

list

property hoverinfo

Determines which trace information appear when hovering nodes. If none or skip are set, no information is displayed upon hovering. But, if none is set, click and hover events are still fired.

The ‘hoverinfo’ property is an enumeration that may be specified as:
  • One of the following enumeration values:

    [‘all’, ‘none’, ‘skip’]

Returns

Return type

Any

property hoverlabel

The ‘hoverlabel’ property is an instance of Hoverlabel that may be specified as:

  • An instance of plotly.graph_objects.sankey.node.Hoverlabel

  • A dict of string/value properties that will be passed to the Hoverlabel constructor

    Supported dict properties:

    align

    Sets the horizontal alignment of the text content within hover label box. Has an effect only if the hover label text spans more two or more lines

    alignsrc

    Sets the source reference on Chart Studio Cloud for align.

    bgcolor

    Sets the background color of the hover labels for this trace

    bgcolorsrc

    Sets the source reference on Chart Studio Cloud for bgcolor.

    bordercolor

    Sets the border color of the hover labels for this trace.

    bordercolorsrc

    Sets the source reference on Chart Studio Cloud for bordercolor.

    font

    Sets the font used in hover labels.

    namelength

    Sets the default length (in number of characters) of the trace name in the hover labels for all traces. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to namelength - 3 characters and add an ellipsis.

    namelengthsrc

    Sets the source reference on Chart Studio Cloud for namelength.

Returns

Return type

plotly.graph_objects.sankey.node.Hoverlabel

property hovertemplate

Template string used for rendering the information that appear on hover box. Note that this will override hoverinfo. Variables are inserted using %{variable}, for example “y: %{y}” as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, “xother” will be added to those with different x positions from the first point. An underscore before or after “(x|y)other” will add a space on that side, only when this field is shown. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time- format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in hovertemplate are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are arrayOk: true) are available. Variables sourceLinks and targetLinks are arrays of link objects.Finally, the template string has access to variables value and label. Anything contained in tag <extra> is displayed in the secondary box, for example “<extra>{fullData.name}</extra>”. To hide the secondary box completely, use an empty tag <extra></extra>.

The ‘hovertemplate’ property is a string and must be specified as:
  • A string

  • A number that will be converted to a string

  • A tuple, list, or one-dimensional numpy array of the above

Returns

Return type

str|numpy.ndarray

property hovertemplatesrc

Sets the source reference on Chart Studio Cloud for hovertemplate.

The ‘hovertemplatesrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property label

The shown name of the node.

The ‘label’ property is an array that may be specified as a tuple, list, numpy array, or pandas Series

Returns

Return type

numpy.ndarray

property labelsrc

Sets the source reference on Chart Studio Cloud for label.

The ‘labelsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property line

The ‘line’ property is an instance of Line that may be specified as:

  • An instance of plotly.graph_objects.sankey.node.Line

  • A dict of string/value properties that will be passed to the Line constructor

    Supported dict properties:

    color

    Sets the color of the line around each node.

    colorsrc

    Sets the source reference on Chart Studio Cloud for color.

    width

    Sets the width (in px) of the line around each node.

    widthsrc

    Sets the source reference on Chart Studio Cloud for width.

Returns

Return type

plotly.graph_objects.sankey.node.Line

property pad

Sets the padding (in px) between the nodes.

The ‘pad’ property is a number and may be specified as:
  • An int or float in the interval [0, inf]

Returns

Return type

int|float

property thickness

Sets the thickness (in px) of the nodes.

The ‘thickness’ property is a number and may be specified as:
  • An int or float in the interval [1, inf]

Returns

Return type

int|float

property x

The normalized horizontal position of the node.

The ‘x’ property is an array that may be specified as a tuple, list, numpy array, or pandas Series

Returns

Return type

numpy.ndarray

property xsrc

Sets the source reference on Chart Studio Cloud for x.

The ‘xsrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

property y

The normalized vertical position of the node.

The ‘y’ property is an array that may be specified as a tuple, list, numpy array, or pandas Series

Returns

Return type

numpy.ndarray

property ysrc

Sets the source reference on Chart Studio Cloud for y.

The ‘ysrc’ property must be specified as a string or as a plotly.grid_objs.Column object

Returns

Return type

str

class plotly.graph_objects.sankey.Stream(arg=None, maxpoints=None, token=None, **kwargs)
property maxpoints

Sets the maximum number of points to keep on the plots from an incoming stream. If maxpoints is set to 50, only the newest 50 points will be displayed on the plot.

The ‘maxpoints’ property is a number and may be specified as:
  • An int or float in the interval [0, 10000]

Returns

Return type

int|float

property token

The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details.

The ‘token’ property is a string and must be specified as:
  • A non-empty string

Returns

Return type

str

class plotly.graph_objects.sankey.Textfont(arg=None, color=None, family=None, lineposition=None, shadow=None, size=None, style=None, textcase=None, variant=None, weight=None, **kwargs)
property color
The ‘color’ property is a color and may be specified as:
  • A hex string (e.g. ‘#ff0000’)

  • An rgb/rgba string (e.g. ‘rgb(255,0,0)’)

  • An hsl/hsla string (e.g. ‘hsl(0,100%,50%)’)

  • An hsv/hsva string (e.g. ‘hsv(0,100%,100%)’)

  • A named CSS color:

    aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgrey, darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgrey, lightgreen, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, rebeccapurple, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen

Returns

Return type

str

property family

HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren’t available on the system. The Chart Studio Cloud (at https://chart- studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include “Arial”, “Balto”, “Courier New”, “Droid Sans”, “Droid Serif”, “Droid Sans Mono”, “Gravitas One”, “Old Standard TT”, “Open Sans”, “Overpass”, “PT Sans Narrow”, “Raleway”, “Times New Roman”.

The ‘family’ property is a string and must be specified as:
  • A non-empty string

Returns

Return type

str

property lineposition

Sets the kind of decoration line(s) with text, such as an “under”, “over” or “through” as well as combinations e.g. “under+over”, etc.

The ‘lineposition’ property is a flaglist and may be specified as a string containing:

  • Any combination of [‘under’, ‘over’, ‘through’] joined with ‘+’ characters (e.g. ‘under+over’) OR exactly one of [‘none’] (e.g. ‘none’)

Returns

Return type

Any

property shadow

Sets the shape and color of the shadow behind text. “auto” places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.

The ‘shadow’ property is a string and must be specified as:
  • A string

  • A number that will be converted to a string

Returns

Return type

str

property size
The ‘size’ property is a number and may be specified as:
  • An int or float in the interval [1, inf]

Returns

Return type

int|float

property style

Sets whether a font should be styled with a normal or italic face from its family.

The ‘style’ property is an enumeration that may be specified as:
  • One of the following enumeration values:

    [‘normal’, ‘italic’]

Returns

Return type

Any

property textcase

Sets capitalization of text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized.

The ‘textcase’ property is an enumeration that may be specified as:
  • One of the following enumeration values:

    [‘normal’, ‘word caps’, ‘upper’, ‘lower’]

Returns

Return type

Any

property variant

Sets the variant of the font.

The ‘variant’ property is an enumeration that may be specified as:
  • One of the following enumeration values:

    [‘normal’, ‘small-caps’, ‘all-small-caps’, ‘all-petite-caps’, ‘petite-caps’, ‘unicase’]

Returns

Return type

Any

property weight

Sets the weight (or boldness) of the font.

The ‘weight’ property is a integer and may be specified as:
  • An int (or float that will be cast to an int) in the interval [1, 1000] OR exactly one of [‘normal’, ‘bold’] (e.g. ‘bold’)

Returns

Return type

int