open XPlot.D3
let edges =
[ "A", "B"
"B", "C"
"C", "A"
"A", "D"
"B", "E"]
let chart =
edges
|> Chart.ForceLayout
|> Chart.WithHeight 300
|> Chart.WithWidth 400
|> Chart.WithGravity 0.5
|> Chart.WithCharge -2000.0
|> Chart.WithEdgeOptions (fun e ->
let pr = e.From.Name, e.To.Name
match pr with
| "A","B" -> { defaultEdgeOptions with Distance = 200.0 }
| "A","D" -> { defaultEdgeOptions with StrokeWidth = 4.5 }
| _ -> {defaultEdgeOptions with Distance = 100.0})
|> Chart.WithNodeOptions(fun n ->
match n.Name with
| "A" -> {defaultNodeOptions with Fill = {Red = 150uy; Green = 150uy; Blue=195uy}}
| "B" -> {defaultNodeOptions with RadiusScale=1.5; Fill = {Red = 150uy; Green = 195uy; Blue=150uy}}
| _ -> defaultNodeOptions)
D3 Chart
namespace XPlot
namespace XPlot.D3
val edges : (string * string) list
val chart : ForceLayoutChart
type Chart =
static member Create : nodes:seq<Node> -> ForceLayoutChart + 1 overload
static member ForceLayout : nodes:seq<Node> -> ForceLayoutChart + 1 overload
static member Show : chart:ForceLayoutChart -> unit
static member WithCharge : charge:float -> chart:ForceLayoutChart -> ForceLayoutChart
static member WithEdgeOptions : edgeOptions:(Edge -> EdgeOptions) -> chart:ForceLayoutChart -> ForceLayoutChart
static member WithGravity : gravity:float -> chart:ForceLayoutChart -> ForceLayoutChart
static member WithHeight : height:int -> chart:ForceLayoutChart -> ForceLayoutChart
static member WithNodeOptions : nodeOptions:(Node -> NodeOptions) -> chart:ForceLayoutChart -> ForceLayoutChart
static member WithWidth : width:int -> chart:ForceLayoutChart -> ForceLayoutChart
static member Chart.ForceLayout : edges:seq<string * string> -> ForceLayoutChart
static member Chart.ForceLayout : nodes:seq<Node> -> ForceLayoutChart
static member Chart.WithHeight : height:int -> chart:ForceLayoutChart -> ForceLayoutChart
static member Chart.WithWidth : width:int -> chart:ForceLayoutChart -> ForceLayoutChart
static member Chart.WithGravity : gravity:float -> chart:ForceLayoutChart -> ForceLayoutChart
static member Chart.WithCharge : charge:float -> chart:ForceLayoutChart -> ForceLayoutChart
static member Chart.WithEdgeOptions : edgeOptions:(Edge -> EdgeOptions) -> chart:ForceLayoutChart -> ForceLayoutChart
val e : Edge
val pr : string * string
Edge.From: Node
Node.Name: string
Edge.To: Node
val defaultEdgeOptions : EdgeOptions
static member Chart.WithNodeOptions : nodeOptions:(Node -> NodeOptions) -> chart:ForceLayoutChart -> ForceLayoutChart
val n : Node
val defaultNodeOptions : NodeOptions
member ForceLayoutChart.GetHtml : unit -> string