Node
public struct Node : Encodable
The nodes of the Sankey plot.
-
The shown name of the node.
Declaration
Swift
public var label: [Double]?
-
Groups of nodes.
Each group is defined by an array with the indices of the nodes it contains. Multiple groups can be specified.
Declaration
Swift
public var groups: InfoArray?
-
The normalized horizontal position of the node.
Declaration
Swift
public var x: [Double]?
-
The normalized vertical position of the node.
Declaration
Swift
public var y: [Double]?
-
Sets the
node
color.It can be a single value, or an array for specifying color for each
node
. Ifnode.color
is omitted, then the defaultPlotly
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.Declaration
Swift
public var coloring: Coloring?
-
Assigns extra data to each node.
Declaration
Swift
public var customData: [Double]?
-
Undocumented
Declaration
Swift
public var line: VariableLine?
-
Sets the padding (in px) between the
nodes
.Declaration
Swift
public var padding: Double?
-
Sets the thickness (in px) of the
nodes
.Declaration
Swift
public var thickness: Double?
-
Determines which trace information appear when hovering nodes.
If
See morenone
orskip
are set, no information is displayed upon hovering. But, ifnone
is set, click and hover events are still fired.Declaration
Swift
public enum HoverInfo : String, Encodable
-
Determines which trace information appear when hovering nodes.
If
none
orskip
are set, no information is displayed upon hovering. But, ifnone
is set, click and hover events are still fired.Declaration
Swift
public var hoverInfo: HoverInfo?
-
Undocumented
Declaration
Swift
public var hoverLabel: HoverLabel?
-
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}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#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#locale_format for details on the date formatting syntax. The variables available inhovertemplate
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 arearrayOk: true
) are available. variablesvalue
andlabel
. Anything contained in tag<extra>
is displayed in the secondary box, for example “{fullData.name} ”. To hide the secondary box completely, use an empty tag<extra></extra>
.Declaration
Swift
public var hoverTemplate: Data<String>?
-
init(label:
groups: x: y: coloring: customData: line: padding: thickness: hoverInfo: hoverLabel: hoverTemplate: ) Creates
Node
object with specified properties.Declaration
Swift
public init(label: [Double]? = nil, groups: InfoArray? = nil, x: [Double]? = nil, y: [Double]? = nil, coloring: Coloring? = nil, customData: [Double]? = nil, line: VariableLine? = nil, padding: Double? = nil, thickness: Double? = nil, hoverInfo: HoverInfo? = nil, hoverLabel: HoverLabel? = nil, hoverTemplate: Data<String>? = nil)
Parameters
label
The shown name of the node.
groups
Groups of nodes.
x
The normalized horizontal position of the node.
y
The normalized vertical position of the node.
coloring
Sets the
node
color.customData
Assigns extra data to each node.
line
padding
Sets the padding (in px) between the
nodes
.thickness
Sets the thickness (in px) of the
nodes
.hoverInfo
Determines which trace information appear when hovering nodes.
hoverLabel
hoverTemplate
Template string used for rendering the information that appear on hover box.