Start building

plotly.graph_objs.sankey Module

Functions

plotly.graph_objs.sankey.Domain([column=], [row=], [x=], [y=]) → Domain

Create a new ‘Domain’ object

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

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

  • x - Sets the horizontal domain of this sankey trace (in plot fraction).

  • y - Sets the vertical domain of this sankey trace (in plot fraction).


plotly.graph_objs.sankey.Hoverlabel([align=], [bgcolor=], [bordercolor=], [font=], [namelength=], [showarrow=]) → Hoverlabel

Create a new ‘Hoverlabel’ object

  • 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

  • bgcolor - Sets the background color of the hover labels for this trace

  • bordercolor - Sets the border color of the hover labels for this trace.

  • 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.

  • showarrow - Sets whether or not to show the hover label arrow/triangle pointing to the data point.


plotly.graph_objs.sankey.Legendgrouptitle([font=], [text=]) → Legendgrouptitle

Create a new ‘Legendgrouptitle’ object

  • font - Sets this legend group's title font.

  • text - Sets the title of the legend group.


Create a new ‘Link’ object

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

  • 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.

  • customdata - Assigns extra data to each link.

  • 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.

  • hoverinfo - Determines what trace information appears 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.

  • 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. Variables that can't be found will be replaced with the specifier. For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing. Variables with an undefined value will be replaced with the fallback value. 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, all attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. 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>`.

  • hovertemplatefallback - Fallback string that's displayed when a variable referenced in a template is missing. If the boolean value 'false' is passed in, the specifier with the missing variable will be displayed.

  • label - The shown name of the link.

  • sort - For `auto` (the default), the order of links attached to each node is determined automatically by the layout. For `input`, the order of links at each node is kept the same as the order in the input array.

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

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

  • value - A numeric value representing the flow volume value.


plotly.graph_objs.sankey.Node([align=], [color=], [customdata=], [groups=], [hoverinfo=], [hoverlabel=], [hovertemplate=], [hovertemplatefallback=], [label=], [line=], [pad=], [sort=], [thickness=], [x=], [y=]) → Node

Create a new ‘Node’ object

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

  • 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.

  • customdata - Assigns extra data to each node.

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

  • hoverinfo - Determines what trace information appears 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.

  • 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. Variables that can't be found will be replaced with the specifier. For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing. Variables with an undefined value will be replaced with the fallback value. 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, all attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. 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>`.

  • hovertemplatefallback - Fallback string that's displayed when a variable referenced in a template is missing. If the boolean value 'false' is passed in, the specifier with the missing variable will be displayed.

  • label - The shown name of the node.

  • pad - Sets the padding (in px) between the `nodes`.

  • sort - For `auto` (the default), the vertical order of nodes will be determined automatically by the layout. For `input`, the vertical order of nodes is kept the same as the order in the input array.

  • thickness - Sets the thickness (in px) of the `nodes`.

  • x - The normalized horizontal position of the node.

  • y - The normalized vertical position of the node.


plotly.graph_objs.sankey.Textfont([color=], [family=], [lineposition=], [shadow=], [size=], [style=], [textcase=], [variant=], [weight=]) → Textfont

Create a new ‘Textfont’ object

  • family - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.

  • 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.

  • 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.


Globals






Do you still have questions?

Our Community Forum is full of helpful information and Anvil experts.

plotly.graph_objs.sankey