Custom color (hexcodes) palette to cycle through for sankey nodes
nodeColorMode
SankeyOptions.Sankey.Node.ColorMode = .unique
Coloring mode for the sankey nodes
nodeWidth
Double? = nil
Thickness of the node
nodePadding
Double? = nil
Vertical distance between nodes
nodeLabelColor
String = "black"
Node label color (hexcode/html)
nodeLabelFontSize
Double = 24
Node label font size (pixels)
nodeLabelFontName
String? = nil
Node label font name
nodeLabelBold
Bool = false
Bold node label
nodeLabelItalic
Bool = false
Italicize node label
nodeLabelPadding
Double? = nil
Horizontal distance between the label and the node
nodeInteractivity
Bool = false
Allow users to select node
linkColors
[String]? = nil
Custom color (hexcode) palette to cycle through for sankey links
linkColorMode
SankeyOptions.Sankey.Link.ColorMode? = nil
Coloring mode for the links between nodes (this option will override any linkColor+ argument)
linkColorFill
String? = nil
Color of the link
linkColorFillOpacity
Double? = nil
Transparency of the link
linkColorStroke
String? = nil
Color of the link border
linkColorStrokeWidth
Double = 0
Thickness of the link border
tooltipValueLabel
String = ""
Name of the link value to be displayed in the tooltip
tooltipTextColor
String = "black"
Tooltip text color (html/hexcode)
tooltipTextFontSize
Double = 24
Tooltip text font size (pixels)
tooltipTextFontName
String? = nil
Tooltip text font name
tooltipTextBold
Bool = false
Bold tooltip label text
tooltipTextItalic
Bool = false
Italicize tooltip label text
layoutIterations
Int = 32
D3 layout engine layout search attempts to find the most optimal node positions (increasing this number may lead to more pleasing layouts of complex sankeys, at some cost)
About
Sankey diagrams in SwiftUI, powered by Google Charts‡
Quickstart
Make interactive charts like this:
With code as simple as this:
Examples
Inspired by the examples in the Google Charts Gallery
API
Optional
SankeyDiagram(data, ...)
styling arguments :nodeColors
[String]? = nil
nodeColorMode
SankeyOptions.Sankey.Node.ColorMode = .unique
nodeWidth
Double? = nil
nodePadding
Double? = nil
nodeLabelColor
String = "black"
nodeLabelFontSize
Double = 24
nodeLabelFontName
String? = nil
nodeLabelBold
Bool = false
nodeLabelItalic
Bool = false
nodeLabelPadding
Double? = nil
nodeInteractivity
Bool = false
linkColors
[String]? = nil
linkColorMode
SankeyOptions.Sankey.Link.ColorMode? = nil
linkColorFill
String? = nil
linkColorFillOpacity
Double? = nil
linkColorStroke
String? = nil
linkColorStrokeWidth
Double = 0
tooltipValueLabel
String = ""
tooltipTextColor
String = "black"
tooltipTextFontSize
Double = 24
tooltipTextFontName
String? = nil
tooltipTextBold
Bool = false
tooltipTextItalic
Bool = false
layoutIterations
Int = 32
For more information see configuration options
Swift Package Manager
Add to your project with:
Fine Print
‡ Active network connection required