1 people like it.

Sankey Diagram extension to Plotly.NET

Extension of Plotly.NET to draw Sankey diagrams by leveraging the underlying capability offered by Plotly.js

  1: 
  2: 
  3: 
  4: 
  5: 
  6: 
  7: 
  8: 
  9: 
 10: 
 11: 
 12: 
 13: 
 14: 
 15: 
 16: 
 17: 
 18: 
 19: 
 20: 
 21: 
 22: 
 23: 
 24: 
 25: 
 26: 
 27: 
 28: 
 29: 
 30: 
 31: 
 32: 
 33: 
 34: 
 35: 
 36: 
 37: 
 38: 
 39: 
 40: 
 41: 
 42: 
 43: 
 44: 
 45: 
 46: 
 47: 
 48: 
 49: 
 50: 
 51: 
 52: 
 53: 
 54: 
 55: 
 56: 
 57: 
 58: 
 59: 
 60: 
 61: 
 62: 
 63: 
 64: 
 65: 
 66: 
 67: 
 68: 
 69: 
 70: 
 71: 
 72: 
 73: 
 74: 
 75: 
 76: 
 77: 
 78: 
 79: 
 80: 
 81: 
 82: 
 83: 
 84: 
 85: 
 86: 
 87: 
 88: 
 89: 
 90: 
 91: 
 92: 
 93: 
 94: 
 95: 
 96: 
 97: 
 98: 
 99: 
100: 
101: 
102: 
103: 
104: 
105: 
106: 
107: 
108: 
109: 
110: 
111: 
112: 
113: 
114: 
115: 
116: 
117: 
118: 
119: 
120: 
121: 
122: 
123: 
124: 
125: 
126: 
127: 
128: 
129: 
130: 
131: 
132: 
133: 
134: 
135: 
136: 
137: 
138: 
139: 
140: 
141: 
142: 
143: 
144: 
145: 
146: 
147: 
148: 
149: 
150: 
151: 
152: 
153: 
154: 
155: 
156: 
157: 
158: 
159: 
160: 
161: 
162: 
163: 
164: 
165: 
166: 
167: 
168: 
169: 
170: 
171: 
172: 
173: 
174: 
175: 
176: 
177: 
178: 
179: 
180: 
181: 
182: 
183: 
184: 
185: 
186: 
187: 
188: 
189: 
190: 
191: 
192: 
193: 
194: 
195: 
196: 
197: 
198: 
199: 
200: 
201: 
202: 
203: 
204: 
205: 
206: 
207: 
208: 
209: 
210: 
211: 
212: 
213: 
214: 
215: 
216: 
217: 
218: 
219: 
220: 
221: 
222: 
223: 
224: 
225: 
226: 
227: 
228: 
229: 
230: 
231: 
232: 
233: 
234: 
235: 
236: 
237: 
238: 
239: 
240: 
241: 
242: 
243: 
244: 
245: 
246: 
247: 
248: 
249: 
250: 
251: 
252: 
253: 
254: 
255: 
256: 
257: 
258: 
259: 
260: 
261: 
262: 
263: 
264: 
265: 
266: 
267: 
268: 
269: 
270: 
271: 
272: 
273: 
274: 
275: 
276: 
277: 
278: 
279: 
280: 
281: 
282: 
283: 
284: 
285: 
286: 
287: 
288: 
289: 
290: 
291: 
292: 
293: 
294: 
295: 
296: 
297: 
298: 
299: 
300: 
301: 
302: 
303: 
304: 
305: 
306: 
307: 
308: 
309: 
310: 
311: 
312: 
313: 
314: 
315: 
316: 
317: 
318: 
319: 
320: 
321: 
322: 
323: 
324: 
325: 
326: 
327: 
328: 
329: 
330: 
331: 
332: 
333: 
334: 
335: 
336: 
337: 
module PlotlyExts =
    open Plotly.NET
    open DynamicObj

    type Node =
        { Label: string
          Groups: string [] option
          XRank: int option
          YRank: int option
          Color: obj option
          LineColor: obj option
          LineWidth: float option }
        static member Create
            (
                label,
                ?groups,
                ?xRank,
                ?yRank,
                ?color,
                ?lineColor,
                ?lineWidth
            ) =
            { Label = label
              Groups = groups
              XRank = xRank
              YRank = yRank
              Color = color
              LineColor = lineColor
              LineWidth = lineWidth }

    type Link =
        { Source: Node
          Target: Node
          Value: float option
          Label: string option
          Color: obj option
          LineColor: obj option
          LineWidth: float option }
        static member Create
            (
                src,
                tgt,
                ?value,
                ?label,
                ?color,
                ?lineColor,
                ?lineWidth
            ) =
            { Source = src
              Target = tgt
              Value = value
              Label = label
              Color = color
              LineColor = lineColor
              LineWidth = lineWidth }


    module Trace =
        let initSankey (applyStyle: Trace -> Trace) =
            Plotly.NET.Trace("sankey") |> applyStyle

    type TraceStyle with
        static member Sankey
            (
                nodes: Node seq,
                links: Link seq,
                ?nodePadding: float,
                ?nodeThicknes: float,
                ?nodeColor: obj,
                ?nodeLineColor: obj,
                ?nodeLineWidth: float,
                ?linkColor: obj,
                ?linkLineColor: obj,
                ?linkLineWidth: float
            ) =
            (fun (trace: ('T :> Trace)) ->
                let nonUniqueLabels =
                    nodes
                    |> Seq.countBy (fun x -> x.Label)
                    |> Seq.filter (fun (_, c) -> c > 1)

                if nonUniqueLabels |> Seq.length > 0 then
                    failwithf
                        "duplicated label names %A"
                        (nonUniqueLabels |> Seq.map fst)

                let lblMap =
                    nodes
                    |> Seq.mapi (fun i x -> x.Label, i)
                    |> Map.ofSeq // give each node an index

                let link =
                    let linkClrs =
                        links
                        |> Seq.map (fun x -> x.Color)
                        |> Seq.map
                            (function
                            | Some x -> x
                            | None -> linkColor |> Option.defaultValue null)
                        |> fun xs ->
                            if xs |> Seq.exists (fun x -> x <> null) then
                                xs |> Seq.toArray |> Some
                            else
                                None

                    let linkLineClrs =
                        links
                        |> Seq.map (fun x -> x.LineColor)
                        |> Seq.map
                            (function
                            | Some x -> x
                            | None -> linkLineColor |> Option.defaultValue null)
                        |> fun xs ->
                            if xs |> Seq.exists (fun x -> x <> null) then
                                xs |> Seq.toArray |> Some
                            else
                                None

                    let linkLineWidths =
                        links
                        |> Seq.map (fun x -> x.LineWidth)
                        |> Seq.map
                            (function
                            | Some x -> x
                            | None -> linkLineWidth |> Option.defaultValue 0.5)
                        |> fun xs ->
                            if xs |> Seq.exists (fun x -> x <> 0.5) then
                                xs |> Seq.toArray |> Some
                            else
                                None

                    let values =
                        links
                        |> Seq.map (fun x -> x.Value)
                        |> fun xs ->
                            if xs |> Seq.exists Option.isSome then
                                xs
                                |> Seq.map
                                    (function
                                    | Some x -> box x
                                    | None -> null)
                                |> Seq.toArray
                                |> Some
                            else
                                None

                    let line =
                        match (linkLineClrs, linkLineWidths) with
                        | None, None -> None
                        | cs, ws ->
                            let ln = new DynamicObj()
                            DynObj.setValueOpt ln "color" cs
                            DynObj.setValueOpt ln "width" ws
                            Some ln

                    let l = new DynamicObj()

                    DynObj.setValue
                        l
                        "source"
                        (links
                         |> Seq.map (fun x -> lblMap.[x.Source.Label]))

                    DynObj.setValue
                        l
                        "target"
                        (links
                         |> Seq.map (fun x -> lblMap.[x.Target.Label]))

                    DynObj.setValueOpt l "color" linkClrs
                    DynObj.setValueOpt l "value" values
                    DynObj.setValueOpt l "line" line

                    l

                let node =
                    let groups =
                        nodes
                        |> Seq.collect
                            (fun x ->
                                x.Groups
                                |> Option.defaultValue [||]
                                |> Array.map (fun g -> g, lblMap.[x.Label]))
                        |> Seq.groupBy fst
                        |> Seq.map (fun (g, gs) -> gs |> Seq.map snd)
                        |> fun xs ->
                            if Seq.isEmpty xs then
                                Some(xs |> Seq.map Seq.toArray |> Seq.toArray)
                            else
                                None

                    let xRanks =
                        nodes
                        |> Seq.map
                            (fun x ->
                                x.XRank
                                |> Option.map box
                                |> Option.defaultValue null)
                        |> fun xs ->
                            if xs |> Seq.exists (fun x -> x <> null) then
                                xs |> Seq.toArray |> Some
                            else
                                None

                    let yRanks =
                        nodes
                        |> Seq.map
                            (fun x ->
                                x.YRank
                                |> Option.map box
                                |> Option.defaultValue null)
                        |> fun xs ->
                            if xs |> Seq.exists (fun x -> x <> null) then
                                xs |> Seq.toArray |> Some
                            else
                                None

                    let nodeClrs =
                        nodes
                        |> Seq.map (fun x -> x.Color)
                        |> Seq.map
                            (function
                            | Some x -> x
                            | None -> nodeColor |> Option.defaultValue null)
                        |> fun xs ->
                            if xs |> Seq.exists (fun x -> x <> null) then
                                xs |> Seq.toArray |> Some
                            else
                                None

                    let nodeLineClrs =
                        nodes
                        |> Seq.map (fun x -> x.LineColor)
                        |> Seq.map
                            (function
                            | Some x -> x
                            | None -> nodeLineColor |> Option.defaultValue null)
                        |> fun xs ->
                            if xs |> Seq.exists (fun x -> x <> null) then
                                xs |> Seq.toArray |> Some
                            else
                                None

                    let nodeLineWidths =
                        nodes
                        |> Seq.map (fun x -> x.LineWidth)
                        |> Seq.map
                            (function
                            | Some x -> x
                            | None -> nodeLineWidth |> Option.defaultValue 0.5)
                        |> fun xs ->
                            if xs |> Seq.exists (fun x -> x <> 0.5) then
                                xs |> Seq.toArray |> Some
                            else
                                None

                    let line =
                        match (nodeLineClrs, nodeLineWidths) with
                        | None, None -> None
                        | cs, ws ->
                            let ln = new DynamicObj()
                            DynObj.setValueOpt ln "color" cs
                            DynObj.setValueOpt ln "width" ws
                            Some ln

                    let n = new DynamicObj()

                    DynObj.setValue
                        n
                        "label"
                        (nodes |> Seq.map (fun x -> x.Label))

                    DynObj.setValueOpt n "groups" groups
                    DynObj.setValueOpt n "pad" nodePadding
                    DynObj.setValueOpt n "thickness" nodeThicknes
                    DynObj.setValueOpt n "x" xRanks
                    DynObj.setValueOpt n "y" yRanks
                    DynObj.setValueOpt n "color" nodeClrs
                    DynObj.setValueOpt n "line" line
                    DynObj.setValueOpt n "color" nodeClrs
                    n

                DynObj.setValue trace "node" node
                DynObj.setValue trace "link" link

                trace)

    type Chart with
        static member Sankey
            (
                nodes: Node seq,
                links: Link seq,
                ?nodePadding: float,
                ?nodeThicknes: float,
                ?nodeColor: obj,
                ?nodeLineColor: obj,
                ?nodeLineWidth: float,
                ?linkColor: obj,
                ?linkLineColor: obj,
                ?linkLineWidth: float
            ) =
            Trace.initSankey (
                TraceStyle.Sankey(
                    nodes,
                    links,
                    ?nodePadding = nodePadding,
                    ?nodeThicknes = nodeThicknes,
                    ?nodeColor = nodeColor,
                    ?nodeLineColor = nodeLineColor,
                    ?nodeLineWidth = nodeLineWidth,
                    ?linkColor = linkColor,
                    ?linkLineColor = linkLineColor,
                    ?linkLineWidth = linkLineWidth
                )
            )
            |> GenericChart.ofTraceObject

open Plotly.NET
open PlotlyExts

let testSankey () =
    let n1 = Node.Create("a", color = "Black")
    let n2 = Node.Create("b", color = "Red")
    let n3 = Node.Create("c", color = "Purple")
    let n4 = Node.Create("d", color = "Green")
    let n5 = Node.Create("e", color = "Orange")
    let link1 = Link.Create(n1, n2, value = 1.0)
    let link2 = Link.Create(n2, n3, value = 2.0)
    let link3 = Link.Create(n1, n5, value = 1.3)
    let link4 = Link.Create(n4, n5, value = 1.5)
    let link5 = Link.Create(n3, n5, value = 0.5)

    Chart.Sankey([ n1; n2; n3; n4; n5 ], [ link1; link2; link3; link4; link5 ])
    |> Chart.withTitle "Sankey Sample"
    |> Chart.show

testSankey ()
namespace Plotly
namespace Plotly.NET
type Node =
  { Label: string
    Groups: string [] option
    XRank: int option
    YRank: int option
    Color: obj option
    LineColor: obj option
    LineWidth: float option }
    static member Create : label:string * ?groups:string [] * ?xRank:int * ?yRank:int * ?color:obj * ?lineColor:obj * ?lineWidth:float -> Node
Node.Label: string
Multiple items
val string : value:'T -> string

--------------------
type string = System.String
Node.Groups: string [] option
type 'T option = Option<'T>
Node.XRank: int option
Multiple items
val int : value:'T -> int (requires member op_Explicit)

--------------------
type int = int32

--------------------
type int<'Measure> = int
Node.YRank: int option
Multiple items
Node.Color: obj option

--------------------
module Color

from Plotly.NET

--------------------
type Color =
  private new : obj:obj -> Color
  override Equals : other:obj -> bool
  override GetHashCode : unit -> int
  member Value : obj
  static member fromARGB : a:int -> r:int -> g:int -> b:int -> Color
  static member fromColorScaleValues : c:seq<#IConvertible> -> Color
  static member fromColors : c:seq<Color> -> Color
  static member fromHex : s:string -> Color
  static member fromKeyword : c:ColorKeyword -> Color
  static member fromRGB : r:int -> g:int -> b:int -> Color
  ...
type obj = System.Object
Node.LineColor: obj option
Node.LineWidth: float option
Multiple items
val float : value:'T -> float (requires member op_Explicit)

--------------------
type float = System.Double

--------------------
type float<'Measure> = float
val label : string
val groups : string [] option
val xRank : int option
val yRank : int option
val color : obj option
val lineColor : obj option
val lineWidth : float option
Multiple items
module Color

from Plotly.NET

--------------------
type Color =
  private new : obj:obj -> Color
  override Equals : other:obj -> bool
  override GetHashCode : unit -> int
  member Value : obj
  static member fromARGB : a:int -> r:int -> g:int -> b:int -> Color
  static member fromColorScaleValues : c:seq<#IConvertible> -> Color
  static member fromColors : c:seq<Color> -> Color
  static member fromHex : s:string -> Color
  static member fromKeyword : c:ColorKeyword -> Color
  static member fromRGB : r:int -> g:int -> b:int -> Color
  ...
type Link =
  { Source: Node
    Target: Node
    Value: float option
    Label: string option
    Color: obj option
    LineColor: obj option
    LineWidth: float option }
    static member Create : src:Node * tgt:Node * ?value:float * ?label:string * ?color:obj * ?lineColor:obj * ?lineWidth:float -> Link
Link.Source: Node
Link.Target: Node
Link.Value: float option
Link.Label: string option
Multiple items
Link.Color: obj option

--------------------
module Color

from Plotly.NET

--------------------
type Color =
  private new : obj:obj -> Color
  override Equals : other:obj -> bool
  override GetHashCode : unit -> int
  member Value : obj
  static member fromARGB : a:int -> r:int -> g:int -> b:int -> Color
  static member fromColorScaleValues : c:seq<#IConvertible> -> Color
  static member fromColors : c:seq<Color> -> Color
  static member fromHex : s:string -> Color
  static member fromKeyword : c:ColorKeyword -> Color
  static member fromRGB : r:int -> g:int -> b:int -> Color
  ...
Link.LineColor: obj option
Link.LineWidth: float option
val src : Node
val tgt : Node
val value : float option
val label : string option
Multiple items

--------------------
new : traceTypeName:string -> Trace
val initSankey : applyStyle:(Trace -> Trace) -> Trace
val applyStyle : (Trace -> Trace)
Multiple items
type TraceStyle =
  new : unit -> TraceStyle
  static member Domain : ?X:Range * ?Y:Range * ?Row:int * ?Column:int -> ('T -> 'T) (requires 'T :> Trace)
  static member Line : ?Width:float * ?Color:Color * ?Shape:Shape * ?Dash:DrawingStyle * ?Smoothing:float * ?Colorscale:Colorscale -> ('T -> 'T) (requires 'T :> Trace)
  static member Marker : ?AutoColorScale:bool * ?CAuto:bool * ?CMax:float * ?CMid:float * ?CMin:float * ?Color:Color * ?Colors:seq<Color> * ?ColorAxis:SubPlotId * ?ColorBar:ColorBar * ?Colorscale:Colorscale * ?Gradient:Gradient * ?Outline:Line * ?Size:int * ?MultiSize:seq<int> * ?Opacity:float * ?MultiOpacity:seq<float> * ?Pattern:Pattern * ?Symbol:MarkerSymbol * ?MultiSymbol:seq<MarkerSymbol> * ?OutlierColor:Color * ?OutlierWidth:int * ?Maxdisplayed:int * ?ReverseScale:bool * ?ShowScale:bool * ?SizeMin:int * ?SizeMode:MarkerSizeMode * ?SizeRef:int -> ('T -> 'T) (requires 'T :> Trace)
  static member SetDomain : domain:Domain -> ('T -> 'T) (requires 'T :> Trace)
  static member SetErrorX : error:Error -> ('T -> 'T) (requires 'T :> Trace)
  static member SetErrorY : error:Error -> ('T -> 'T) (requires 'T :> Trace)
  static member SetErrorZ : error:Error -> ('T -> 'T) (requires 'T :> Trace)
  static member SetLine : line:Line -> ('T -> 'T) (requires 'T :> Trace)
  static member SetMarker : marker:Marker -> ('T -> 'T) (requires 'T :> Trace)
  ...

--------------------
new : unit -> TraceStyle
val nodes : seq<Node>
Multiple items
val seq : sequence:seq<'T> -> seq<'T>

--------------------
type seq<'T> = System.Collections.Generic.IEnumerable<'T>
val links : seq<Link>
val nodePadding : float option
val nodeThicknes : float option
val nodeColor : obj option
val nodeLineColor : obj option
val nodeLineWidth : float option
val linkColor : obj option
val linkLineColor : obj option
val linkLineWidth : float option
val trace : #Trace
Multiple items
module Trace

from Script.PlotlyExts

--------------------

--------------------
new : traceTypeName:string -> Trace
val nonUniqueLabels : seq<string * int>
Multiple items
module Seq

from Plotly.NET

--------------------
module Seq

from Microsoft.FSharp.Collections
val countBy : projection:('T -> 'Key) -> source:seq<'T> -> seq<'Key * int> (requires equality)
val x : Node
val filter : predicate:('T -> bool) -> source:seq<'T> -> seq<'T>
val c : int
val length : source:seq<'T> -> int
val failwithf : format:Printf.StringFormat<'T,'Result> -> 'T
val map : mapping:('T -> 'U) -> source:seq<'T> -> seq<'U>
val fst : tuple:('T1 * 'T2) -> 'T1
val lblMap : Map<string,int>
val mapi : mapping:(int -> 'T -> 'U) -> source:seq<'T> -> seq<'U>
val i : int
Multiple items
module Map

from Microsoft.FSharp.Collections

--------------------
type Map<'Key,'Value (requires comparison)> =
  interface IReadOnlyDictionary<'Key,'Value>
  interface IReadOnlyCollection<KeyValuePair<'Key,'Value>>
  interface IEnumerable
  interface IComparable
  interface IEnumerable<KeyValuePair<'Key,'Value>>
  interface ICollection<KeyValuePair<'Key,'Value>>
  interface IDictionary<'Key,'Value>
  new : elements:seq<'Key * 'Value> -> Map<'Key,'Value>
  member Add : key:'Key * value:'Value -> Map<'Key,'Value>
  member ContainsKey : key:'Key -> bool
  ...

--------------------
new : elements:seq<'Key * 'Value> -> Map<'Key,'Value>
val ofSeq : elements:seq<'Key * 'T> -> Map<'Key,'T> (requires comparison)
val link : obj
val linkClrs : obj [] option
val x : Link
Link.Color: obj option
union case Option.Some: Value: 'T -> Option<'T>
val x : obj
union case Option.None: Option<'T>
module Option

from Microsoft.FSharp.Core
val defaultValue : value:'T -> option:'T option -> 'T
val xs : seq<obj>
val exists : predicate:('T -> bool) -> source:seq<'T> -> bool
val toArray : source:seq<'T> -> 'T []
val linkLineClrs : obj [] option
val linkLineWidths : float [] option
val x : float
val xs : seq<float>
val values : obj [] option
val xs : seq<float option>
val isSome : option:'T option -> bool
val box : value:'T -> obj
val line : obj option
val cs : obj [] option
val ws : float [] option
val ln : obj
val l : obj
val node : obj
val groups : int [] [] option
val collect : mapping:('T -> #seq<'U>) -> source:seq<'T> -> seq<'U>
module Array

from Microsoft.FSharp.Collections
val map : mapping:('T -> 'U) -> array:'T [] -> 'U []
val g : string
val groupBy : projection:('T -> 'Key) -> source:seq<'T> -> seq<'Key * seq<'T>> (requires equality)
val gs : seq<string * int>
val snd : tuple:('T1 * 'T2) -> 'T2
val xs : seq<seq<int>>
val isEmpty : source:seq<'T> -> bool
val xRanks : obj [] option
val map : mapping:('T -> 'U) -> option:'T option -> 'U option
val yRanks : obj [] option
val nodeClrs : obj [] option
Node.Color: obj option
val nodeLineClrs : obj [] option
val nodeLineWidths : float [] option
val n : obj
type Chart =
  static member Area : xy:seq<#IConvertible * #IConvertible> * ?Name:string * ?ShowMarkers:bool * ?ShowLegend:bool * ?MarkerSymbol:MarkerSymbol * ?Color:Color * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?Dash:DrawingStyle * ?Width:float -> GenericChart
  static member Area : x:seq<#IConvertible> * y:seq<#IConvertible> * ?Name:string * ?ShowMarkers:bool * ?ShowLegend:bool * ?MarkerSymbol:MarkerSymbol * ?Color:Color * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?Dash:DrawingStyle * ?Width:float -> GenericChart
  static member Bar : keysValues:seq<#IConvertible * #IConvertible> * ?Name:string * ?ShowLegend:bool * ?Color:Color * ?PatternShape:PatternShape * ?MultiPatternShape:seq<PatternShape> * ?Pattern:Pattern * ?Base:#IConvertible * ?Width:'a3 * ?MultiWidth:seq<'a3> * ?Opacity:float * ?MultiOpacity:seq<float> * ?Text:'a4 * ?MultiText:seq<'a4> * ?TextPosition:TextPosition * ?MultiTextPosition:seq<TextPosition> * ?TextFont:Font * ?Marker:Marker -> GenericChart (requires 'a3 :> IConvertible and 'a4 :> IConvertible)
  static member Bar : values:seq<#IConvertible> * ?Keys:seq<#IConvertible> * ?Name:string * ?ShowLegend:bool * ?Color:Color * ?PatternShape:PatternShape * ?MultiPatternShape:seq<PatternShape> * ?Pattern:Pattern * ?Base:#IConvertible * ?Width:'a3 * ?MultiWidth:seq<'a3> * ?Opacity:float * ?MultiOpacity:seq<float> * ?Text:'a4 * ?MultiText:seq<'a4> * ?TextPosition:TextPosition * ?MultiTextPosition:seq<TextPosition> * ?TextFont:Font * ?Marker:Marker -> GenericChart (requires 'a3 :> IConvertible and 'a4 :> IConvertible)
  static member BoxPlot : xy:seq<#IConvertible * #IConvertible> * ?Name:string * ?ShowLegend:bool * ?Text:'a2 * ?MultiText:seq<'a2> * ?Fillcolor:Color * ?MarkerColor:Color * ?OutlierColor:Color * ?OutlierWidth:int * ?Opacity:float * ?WhiskerWidth:float * ?BoxPoints:BoxPoints * ?BoxMean:BoxMean * ?Jitter:float * ?PointPos:float * ?Orientation:Orientation * ?Marker:Marker * ?Line:Line * ?AlignmentGroup:string * ?Offsetgroup:string * ?Notched:bool * ?NotchWidth:float * ?QuartileMethod:QuartileMethod -> GenericChart (requires 'a2 :> IConvertible)
  static member BoxPlot : ?x:seq<#IConvertible> * ?y:seq<#IConvertible> * ?Name:string * ?ShowLegend:bool * ?Text:'a2 * ?MultiText:seq<'a2> * ?Fillcolor:Color * ?MarkerColor:Color * ?OutlierColor:Color * ?OutlierWidth:int * ?Opacity:float * ?WhiskerWidth:float * ?BoxPoints:BoxPoints * ?BoxMean:BoxMean * ?Jitter:float * ?PointPos:float * ?Orientation:Orientation * ?Marker:Marker * ?Line:Line * ?AlignmentGroup:string * ?Offsetgroup:string * ?Notched:bool * ?NotchWidth:float * ?QuartileMethod:QuartileMethod -> GenericChart (requires 'a2 :> IConvertible)
  static member Bubble : xysizes:seq<#IConvertible * #IConvertible * int> * ?Name:string * ?ShowLegend:bool * ?MarkerSymbol:MarkerSymbol * ?Color:Color * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:Orientation * ?GroupNorm:GroupNorm * ?UseWebGL:bool -> GenericChart
  static member Bubble : x:seq<#IConvertible> * y:seq<#IConvertible> * sizes:seq<int> * ?Name:string * ?ShowLegend:bool * ?MarkerSymbol:MarkerSymbol * ?Color:Color * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:Orientation * ?GroupNorm:GroupNorm * ?UseWebGL:bool -> GenericChart
  static member Candlestick : stockTimeSeries:seq<DateTime * StockData> * ?Increasing:Line * ?Decreasing:Line * ?WhiskerWidth:float * ?Line:Line * ?XCalendar:Calendar -> GenericChart
  static member Candlestick : open:seq<#IConvertible> * high:seq<#IConvertible> * low:seq<#IConvertible> * close:seq<#IConvertible> * x:seq<#IConvertible> * ?Increasing:Line * ?Decreasing:Line * ?WhiskerWidth:float * ?Line:Line * ?XCalendar:Calendar -> GenericChart
  ...
static member TraceStyle.Sankey : nodes:seq<Node> * links:seq<Link> * ?nodePadding:float * ?nodeThicknes:float * ?nodeColor:obj * ?nodeLineColor:obj * ?nodeLineWidth:float * ?linkColor:obj * ?linkLineColor:obj * ?linkLineWidth:float -> ('T -> 'T) (requires 'T :> Trace)
module GenericChart

from Plotly.NET
val ofTraceObject : trace:Trace -> GenericChart.GenericChart
module PlotlyExts

from Script
val testSankey : unit -> unit
val n1 : Node
Multiple items
static member Node.Create : label:string * ?groups:string [] * ?xRank:int * ?yRank:int * ?color:obj * ?lineColor:obj * ?lineWidth:float -> Node

--------------------
static member Node.Create : label:string * ?groups:string [] * ?xRank:int * ?yRank:int * ?color:obj * ?lineColor:obj * ?lineWidth:float -> Node
val n2 : Node
val n3 : Node
val n4 : Node
val n5 : Node
val link1 : Link
Multiple items
static member Link.Create : src:Node * tgt:Node * ?value:float * ?label:string * ?color:obj * ?lineColor:obj * ?lineWidth:float -> Link

--------------------
static member Link.Create : src:Node * tgt:Node * ?value:float * ?label:string * ?color:obj * ?lineColor:obj * ?lineWidth:float -> Link
val link2 : Link
val link3 : Link
val link4 : Link
val link5 : Link
Multiple items
static member Chart.Sankey : nodes:seq<Node> * links:seq<Link> * ?nodePadding:float * ?nodeThicknes:float * ?nodeColor:obj * ?nodeLineColor:obj * ?nodeLineWidth:float * ?linkColor:obj * ?linkLineColor:obj * ?linkLineWidth:float -> GenericChart.GenericChart

--------------------
static member Chart.Sankey : nodes:seq<Node> * links:seq<Link> * ?nodePadding:float * ?nodeThickness:float * ?nodeColor:obj * ?nodeLineColor:obj * ?nodeLineWidth:float * ?linkColor:obj * ?linkLineColor:obj * ?linkLineWidth:float -> GenericChart.GenericChart
static member Chart.withTitle : title:string * ?TitleFont:Font -> (GenericChart.GenericChart -> GenericChart.GenericChart)
static member Chart.show : ch:GenericChart.GenericChart -> unit

More information

Link:http://fssnip.net/7WI
Posted:26 days ago
Author:Faisal Waris, Tobias Burger
Tags: charting , sankey , fsplotly