diff --git a/Plotly.NET.sln b/Plotly.NET.sln
index 543255e56..04e086deb 100644
--- a/Plotly.NET.sln
+++ b/Plotly.NET.sln
@@ -5,6 +5,7 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60BC93-E09B-4E5F-9D85-95A519479D54}"
ProjectSection(SolutionItems) = preProject
+ .editorconfig = .editorconfig
.config\dotnet-tools.json = .config\dotnet-tools.json
global.json = global.json
LICENSE = LICENSE
@@ -97,6 +98,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{7B09CC0A-F
docs\09_1_parallel-coords.fsx = docs\09_1_parallel-coords.fsx
docs\09_2_sankey.fsx = docs\09_2_sankey.fsx
docs\09_3_icicle.fsx = docs\09_3_icicle.fsx
+ docs\09_4_treemap.fsx = docs\09_4_treemap.fsx
+ docs\09_5_sunburst.fsx = docs\09_5_sunburst.fsx
docs\10_0_ternary_line_scatter_plots.fsx = docs\10_0_ternary_line_scatter_plots.fsx
docs\10_1_styling_ternary_layouts.fsx = docs\10_1_styling_ternary_layouts.fsx
docs\11_1_carpet_line_scatter_plots.fsx = docs\11_1_carpet_line_scatter_plots.fsx
@@ -142,11 +145,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.Tests.CSharp", "
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Plotly.NET.ImageExport.Tests", "tests\Plotly.NET.ImageExport.Tests\Plotly.NET.ImageExport.Tests.fsproj", "{55A461C3-8018-4020-B16E-D6005BDFCAED}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8E913083-86D3-4C55-B260-2AC4AC21B2D9}"
- ProjectSection(SolutionItems) = preProject
- .editorconfig = .editorconfig
- EndProjectSection
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
diff --git a/docs/02_5_pie-doughnut-charts.fsx b/docs/02_5_pie-doughnut-charts.fsx
index b166bf5cc..e7f29bc67 100644
--- a/docs/02_5_pie-doughnut-charts.fsx
+++ b/docs/02_5_pie-doughnut-charts.fsx
@@ -45,7 +45,7 @@ When creating pie charts, it is usually desirable to provide both labels and val
*)
let pie1 =
- Chart.Pie(values,labels)
+ Chart.Pie(values,Labels = labels)
(*** condition: ipynb ***)
#if IPYNB
@@ -59,9 +59,9 @@ pie1 |> GenericChart.toChartHTML
let doughnut1 =
Chart.Doughnut(
values,
- labels,
+ Labels = labels,
Hole=0.3,
- TextLabels=labels
+ MultiText = labels
)
(*** condition: ipynb ***)
@@ -73,19 +73,48 @@ doughnut1
doughnut1 |> GenericChart.toChartHTML
(***include-it-raw***)
-let sunburst1 =
- Chart.Sunburst(
- ["A";"B";"C";"D";"E"],
- ["";"";"B";"B";""],
- Values=[5.;0.;3.;2.;3.],
- Text=["At";"Bt";"Ct";"Dt";"Et"]
+(**
+## More styled example
+
+This example shows the usage of some of the styling possibility using `Chart.Pie`.
+For even more styling control, use the respective TraceStyle function `TraceDomainStyle.Pie`
+*)
+
+
+let pieStyled =
+
+ let values = [19; 26; 55;]
+ let labels = ["Residential"; "Non-Residential"; "Utility"]
+
+ Chart.Pie(
+ values,
+ Labels = labels,
+ SectionColors = [
+ Color.fromKeyword Aqua
+ Color.fromKeyword Salmon
+ Color.fromKeyword Tan
+ ],
+ SectionOutlineColor = Color.fromKeyword Black,
+ SectionOutlineWidth = 2.,
+ MultiText = [
+ "Some"
+ "More"
+ "Stuff"
+ ],
+ MultiTextPosition = [
+ StyleParam.TextPosition.Inside
+ StyleParam.TextPosition.Outside
+ StyleParam.TextPosition.Inside
+ ],
+ Rotation = 45.,
+ MultiPull = [0.; 0.3; 0.]
)
(*** condition: ipynb ***)
#if IPYNB
-sunburst1
+pieStyled
#endif // IPYNB
-
+
(***hide***)
-sunburst1 |> GenericChart.toChartHTML
+pieStyled |> GenericChart.toChartHTML
(***include-it-raw***)
diff --git a/docs/02_6_table.fsx b/docs/02_6_table.fsx
index 59fc541a7..14ff95e79 100644
--- a/docs/02_6_table.fsx
+++ b/docs/02_6_table.fsx
@@ -36,15 +36,15 @@ let's first create some data for the purpose of creating example charts:
open Plotly.NET
open Plotly.NET.StyleParam
-let header = ["RowIndex";"A";"simple";"table"]
-let rows =
- [
- ["0";"I" ;"am" ;"a"]
- ["1";"little";"example";"!"]
- ]
-
-let table1 = Chart.Table(header, rows)
+let table1 =
+ let header = ["RowIndex";"A";"simple";"table"]
+ let rows =
+ [
+ ["0";"I" ;"am" ;"a"]
+ ["1";"little";"example";"!"]
+ ]
+ Chart.Table(header, rows)
(*** condition: ipynb ***)
#if IPYNB
@@ -60,39 +60,25 @@ A little bit of styling:
*)
let table2 =
+ let header = ["RowIndex";"A";"simple";"table"]
+ let rows =
+ [
+ ["0";"I" ;"am" ;"a"]
+ ["1";"little";"example";"!"]
+ ]
Chart.Table(
header,
rows,
- //sets global header alignment
- AlignHeader = [HorizontalAlign.Center],
- //sets alignment for each column separately
- //(The last alignment is applied to all potential following columns)
- AlignCells = [HorizontalAlign.Left;HorizontalAlign.Center;HorizontalAlign.Right],
- //sets global header color
- ColorHeader = Color.fromString "#45546a",
- //sets specific color to each header column
- //ColorHeader=["#45546a";"#deebf7";"#45546a";"#deebf7"],
- //sets global cell color
- //ColorRows = "#deebf7",
- //sets cell column colors
- ColorCells = Color.fromColors [
- Color.fromString "#deebf7"
- Color.fromString "lightgrey"
- Color.fromString "#deebf7"
- Color.fromString "lightgrey"
- ],
- //sets cell row colors
- //ColorCells=[["#deebf7";"lightgrey"]],
- //sets font of header
- FontHeader = Font.init(FontFamily.Courier_New, Size=12., Color=Color.fromString "white"),
- //sets the height of the header
- HeightHeader= 30.,
- //sets lines of header
- LineHeader = Line.init(2.,Color.fromString "black"),
- ColumnWidth = [70;50;100;70],
- //defines order of columns
- ColumnOrder = [1;2;3;4]
- )
+ HeaderAlign = StyleParam.HorizontalAlign.Center,
+ CellsMultiAlign = [StyleParam.HorizontalAlign.Left; StyleParam.HorizontalAlign.Center; StyleParam.HorizontalAlign.Right],
+ HeaderFillColor = Color.fromString "#45546a",
+ CellsFillColor = Color.fromColors [Color.fromString "#deebf7"; Color.fromString "lightgrey"; Color.fromString "#deebf7"; Color.fromString "lightgrey"],
+ HeaderHeight = 30,
+ HeaderOutlineColor = Color.fromString "black",
+ HeaderOutlineWidth = 2.,
+ MultiColumnWidth = [70.; 50.; 100.; 70.],
+ ColumnOrder = [1; 2; 3; 4]
+ )
(*** condition: ipynb ***)
#if IPYNB
@@ -107,41 +93,46 @@ table2 |> GenericChart.toChartHTML
Value dependent cell coloring:
*)
-let header2 = ["Identifier";"T0";"T1";"T2";"T3"]
-let rowvalues =
- [
- [10001.;0.2;2.0;4.0;5.0]
- [10002.;2.1;2.0;1.8;2.1]
- [10003.;4.5;3.0;2.0;2.5]
- [10004.;0.0;0.1;0.3;0.2]
- [10005.;1.0;1.6;1.8;2.2]
- [10006.;1.0;0.8;1.5;0.7]
- [10007.;2.0;2.0;2.1;1.9]
- ]
- |> Seq.sortBy (fun x -> x.[1])
-
-//map color from value to hex representation
-let mapColor min max value =
- let proportion =
- (255. * (value - min) / (max - min))
- |> int
- Color.fromRGB 255 (255 - proportion) proportion
+let table3 =
+ let header2 = ["Identifier";"T0";"T1";"T2";"T3"]
+ let rowvalues =
+ [
+ [10001.;0.2;2.0;4.0;5.0]
+ [10002.;2.1;2.0;1.8;2.1]
+ [10003.;4.5;3.0;2.0;2.5]
+ [10004.;0.0;0.1;0.3;0.2]
+ [10005.;1.0;1.6;1.8;2.2]
+ [10006.;1.0;0.8;1.5;0.7]
+ [10007.;2.0;2.0;2.1;1.9]
+ ]
+ |> Seq.sortBy (fun x -> x.[1])
-//Assign a color to every cell seperately. Matrix must be transposed for correct orientation.
-let cellcolor =
- rowvalues
- |> Seq.map (fun row ->
- row
- |> Seq.mapi (fun index value ->
- if index = 0 then Color.fromString "white"
- else mapColor 0. 5. value
+ //map color from value to hex representation
+ let mapColor min max value =
+ let proportion =
+ (255. * (value - min) / (max - min))
+ |> int
+ Color.fromRGB 255 (255 - proportion) proportion
+
+ //Assign a color to every cell seperately. Matrix must be transposed for correct orientation.
+ let cellcolor =
+ rowvalues
+ |> Seq.map (fun row ->
+ row
+ |> Seq.mapi (fun index value ->
+ if index = 0 then Color.fromString "white"
+ else mapColor 0. 5. value
+ )
)
- )
- |> Seq.transpose
- |> Seq.map Color.fromColors
- |> Color.fromColors
+ |> Seq.transpose
+ |> Seq.map Color.fromColors
+ |> Color.fromColors
-let table3 = Chart.Table(header2,rowvalues,ColorCells=cellcolor)
+ Chart.Table(
+ header2,
+ rowvalues,
+ CellsFillColor=cellcolor
+ )
(*** condition: ipynb ***)
#if IPYNB
@@ -158,7 +149,8 @@ Sequence representation:
*)
-let sequence =
+let table4 =
+ let sequence =
[
"ATGAGACGTCGAGACTGATAGACGTCGATAGACGTCGATAGACCG"
"ATAGACTCGTGATAGACGTCGATAGACGTCGATAGAGTATAGACC"
@@ -168,59 +160,56 @@ let sequence =
]
|> String.concat ""
-let elementsPerRow = 60
+ let elementsPerRow = 60
-let headers =
- [0..elementsPerRow]
- |> Seq.map (fun x ->
- if x%10=0 && x <> 0 then "|"
- else ""
- )
+ let headers =
+ [0..elementsPerRow]
+ |> Seq.map (fun x ->
+ if x%10=0 && x <> 0 then "|"
+ else ""
+ )
-let cells =
- sequence
- |> Seq.chunkBySize elementsPerRow
- |> Seq.mapi (fun i x -> Seq.append [string (i * elementsPerRow)] (Seq.map string x))
-
-let cellcolors =
- cells
- |> Seq.map (fun row ->
- row
- |> Seq.map (fun element ->
- match element with
- //colors taken from DRuMS
- //(http://biomodel.uah.es/en/model4/dna/atgc.htm)
- | "A" -> Color.fromHex "#5050FF"
- | "T" -> Color.fromHex "#E6E600"
- | "G" -> Color.fromHex "#00C000"
- | "C" -> Color.fromHex "#E00000"
- | "U" -> Color.fromHex "#B48100"
- | _ -> Color.fromString "white"
+ let cells =
+ sequence
+ |> Seq.chunkBySize elementsPerRow
+ |> Seq.mapi (fun i x -> Seq.append [string (i * elementsPerRow)] (Seq.map string x))
+
+ let cellcolors =
+ cells
+ |> Seq.map (fun row ->
+ row
+ |> Seq.map (fun element ->
+ match element with
+ //colors taken from DRuMS
+ //(http://biomodel.uah.es/en/model4/dna/atgc.htm)
+ | "A" -> Color.fromString "#5050FF"
+ | "T" -> Color.fromString "#E6E600"
+ | "G" -> Color.fromString "#00C000"
+ | "C" -> Color.fromString "#E00000"
+ | "U" -> Color.fromString "#B48100"
+ | _ -> Color.fromString "white"
+ )
)
- )
- |> Seq.transpose
- |> Seq.map (fun x -> Seq.append x (seq [Color.fromString "white"]))
- |> Seq.map Color.fromColors
- |> Color.fromColors
+ |> Seq.transpose
+ |> Seq.map (fun x -> Seq.append x (seq [Color.fromString "white"]))
+ |> Seq.map Color.fromColors
+ |> Color.fromColors
-let font = Font.init(FontFamily.Consolas,Size=14.)
-let line = Line.init(0.,Color.fromString "white")
-let chartwidth = 50. + 10. * float elementsPerRow
+ let line = Line.init(Width = 0., Color = Color.fromString "white")
+ let chartwidth = 50 + 10 * elementsPerRow
-let table4 =
Chart.Table(
headers,
cells,
- LineCells = line,
- LineHeader = line,
- HeightCells = 20.,
- FontHeader = font,
- FontCells = font,
- ColumnWidth = [50;10],
- AlignCells = [HorizontalAlign.Right;HorizontalAlign.Center],
- ColorCells = cellcolors
+ CellsOutline = line,
+ HeaderOutline = line,
+ CellsHeight = 20,
+ MultiColumnWidth = [50.;10.],
+ CellsMultiAlign = [StyleParam.HorizontalAlign.Right;StyleParam.HorizontalAlign.Center],
+ CellsFillColor = cellcolors,
+ UseDefaults = false
)
- |> Chart.withSize(chartwidth,nan)
+ |> Chart.withSize(Width=chartwidth)
|> Chart.withTitle "Sequence A"
(*** condition: ipynb ***)
diff --git a/docs/07_3_funnel_area.fsx b/docs/07_3_funnel_area.fsx
index 7736d0c61..105aef81b 100644
--- a/docs/07_3_funnel_area.fsx
+++ b/docs/07_3_funnel_area.fsx
@@ -47,7 +47,7 @@ open Plotly.NET
let line = Line.init (Color=Color.fromString "purple", Width=3.)
let funnelArea =
- Chart.FunnelArea(Values=values, Text=text, Line=line)
+ Chart.FunnelArea(values, MultiText=text, SectionOutline=line)
(*** condition: ipynb ***)
#if IPYNB
@@ -58,3 +58,38 @@ funnelArea
funnelArea |> GenericChart.toChartHTML
(***include-it-raw***)
+
+(**
+## More styled example
+
+This example shows the usage of some of the styling possibility using `Chart.FunnelArea`.
+For even more styling control, use the respective TraceStyle function `TraceDomainStyle.FunnelArea`
+*)
+
+let funnelAreaStyled =
+ let values = [|5; 4; 3|]
+ let labels = [|"The 1st"; "The 2nd"; "The 3rd"|]
+
+ Chart.FunnelArea(
+ values,
+ Labels = labels,
+ MultiText = labels,
+ SectionColors = [
+ Color.fromKeyword Aqua
+ Color.fromKeyword Salmon
+ Color.fromKeyword Tan
+ ],
+ SectionOutlineColor = Color.fromKeyword Black,
+ SectionOutlineWidth = 2.,
+ AspectRatio = 0.75,
+ BaseRatio = 0.1
+ )
+
+(*** condition: ipynb ***)
+#if IPYNB
+funnelAreaStyled
+#endif // IPYNB
+
+(***hide***)
+funnelAreaStyled |> GenericChart.toChartHTML
+(***include-it-raw***)
\ No newline at end of file
diff --git a/docs/09_0_parallel-categories.fsx b/docs/09_0_parallel-categories.fsx
index a3b328900..ac7c704e2 100644
--- a/docs/09_0_parallel-categories.fsx
+++ b/docs/09_0_parallel-categories.fsx
@@ -45,8 +45,8 @@ let dims =
let parcats =
Chart.ParallelCategories(
dims,
- Color = Color.fromColorScaleValues [0.;1.;0.;1.;0.;0.;0.],
- Colorscale = StyleParam.Colorscale.Blackbody
+ LineColor = Color.fromColorScaleValues [0.;1.;0.;1.;0.;0.;0.],
+ LineColorScale = StyleParam.Colorscale.Blackbody
)
(*** condition: ipynb ***)
@@ -56,4 +56,35 @@ parcats
(***hide***)
parcats |> GenericChart.toChartHTML
-(***include-it-raw***)
\ No newline at end of file
+(***include-it-raw***)
+
+(**
+## More styled example
+
+This example shows the usage of some of the styling possibility using `Chart.ParallelCategories`.
+For even more styling control, use the respective TraceStyle function `TraceDomainStyle.ParallelCategories`
+*)
+
+let parcatsStyled =
+ let dims =
+ [
+ Dimension.initParallel(Values = ["A";"A";"A";"B";"B";"B";"C";"D"],Label="Lvl1")
+ Dimension.initParallel(Values = ["AA";"AA";"AB";"AB";"AB";"AB";"AB";"AB"],Label="Lvl2")
+ Dimension.initParallel(Values = ["AAA";"AAB";"AAC";"AAC";"AAB";"AAB";"AAA";"AAA"],Label="Lvl3")
+ ]
+
+ Chart.ParallelCategories(
+ dims,
+ LineColor = Color.fromColorScaleValues [0; 1; 2; 2; 1; 1; 0; 0], // These values map to the last category axis, meaning [AAA => 0; AAB = 1; AAC => 2]
+ LineColorScale = StyleParam.Colorscale.Viridis,
+ BundleColors = false
+ )
+
+(*** condition: ipynb ***)
+#if IPYNB
+parcatsStyled
+#endif // IPYNB
+
+(***hide***)
+parcatsStyled |> GenericChart.toChartHTML
+(***include-it-raw***)
diff --git a/docs/09_1_parallel-coords.fsx b/docs/09_1_parallel-coords.fsx
index cc9f5ba0a..daae58e71 100644
--- a/docs/09_1_parallel-coords.fsx
+++ b/docs/09_1_parallel-coords.fsx
@@ -53,7 +53,7 @@ the position of the vertex on the i-th axis corresponds to the i-th coordinate o
*)
let parcoords1 =
- Chart.ParallelCoord(data,Color=Color.fromString "blue", UseDefaults = false)
+ Chart.ParallelCoord(data,LineColor=Color.fromString "blue", UseDefaults = false)
(*** condition: ipynb ***)
#if IPYNB
@@ -64,48 +64,54 @@ parcoords1
parcoords1 |> GenericChart.toChartHTML
(***include-it-raw***)
+(**
+## More styled example
+
+This example shows the usage of some of the styling possibility using `Chart.ParallelCoord`.
+For even more styling control, use the respective TraceStyle function `TraceDomainStyle.ParallelCoord`
+*)
+
open Plotly.NET.TraceObjects
-// Dynamic object version
-
-let parcoords =
- let v = [|
- Dimension.initParallel(
- Values = [|1.;4.;|],
- Range = StyleParam.Range.MinMax (1.,5.),
- ConstraintRange = StyleParam.Range.MinMax (1.,2.),
- Label="A");
- Dimension.initParallel(
- Values = [|3.;1.5;|],
- Range = StyleParam.Range.MinMax (1.,5.),
- Label="B",
- Tickvals=[|1.5;3.;4.;5.;|]);
- Dimension.initParallel(
- Values = [|2.;4.;|],
- Range = StyleParam.Range.MinMax (1.,5.),
- Label= "C",
- Tickvals=[|1.;2.;4.;5.;|],
- TickText=[|"txt 1";"txt 2";"txt 4";"txt 5";|]);
- Dimension.initParallel(
- Values = [|4.;2.;|],
- Range = StyleParam.Range.MinMax (1.,5.),
- Label="D");
- |]
-
- let dyn = Trace("parcoords")
-
- dyn?dimensions <- v
- dyn?line <- Line.init(Color =Color.fromString "blue")
-
- dyn
- |> GenericChart.ofTraceObject false
+#r "nuget: FSharp.Data"
+#r "nuget: Deedle"
+
+open FSharp.Data
+open Deedle
+
+let parcoordsStyled =
+
+ let data =
+ "https://raw.githubusercontent.com/bcdunbar/datasets/master/iris.csv"
+ |> Http.RequestString
+ |> Frame.ReadCsvString
+
+ let dims =
+ [
+ Dimension.initParallel(Label = "sepal_length", Values = (data |> Frame.getCol "sepal_length" |> Series.values), Range = StyleParam.Range.MinMax(0., 8.))
+ Dimension.initParallel(Label = "sepal_width" , Values = (data |> Frame.getCol "sepal_width" |> Series.values), Range = StyleParam.Range.MinMax(0., 8.))
+ Dimension.initParallel(Label = "petal_length", Values = (data |> Frame.getCol "petal_length" |> Series.values), Range = StyleParam.Range.MinMax(0., 8.))
+ Dimension.initParallel(Label = "petal_width" , Values = (data |> Frame.getCol "petal_width" |> Series.values), Range = StyleParam.Range.MinMax(0., 8.))
+ ]
+
+ let colors =
+ data
+ |> Frame.getCol "species_id"
+ |> Series.values
+ |> Color.fromColorScaleValues
+
+ Chart.ParallelCoord(
+ dims,
+ LineColorScale = StyleParam.Colorscale.Viridis,
+ LineColor = colors
+ )
+
(*** condition: ipynb ***)
#if IPYNB
-parcoords
+parcoordsStyled
#endif // IPYNB
-
+
(***hide***)
-parcoords |> GenericChart.toChartHTML
+parcoordsStyled |> GenericChart.toChartHTML
(***include-it-raw***)
-
diff --git a/docs/09_2_sankey.fsx b/docs/09_2_sankey.fsx
index 745020821..2ac15f30a 100644
--- a/docs/09_2_sankey.fsx
+++ b/docs/09_2_sankey.fsx
@@ -35,29 +35,38 @@ These are usually used to depict flow between nodes or stations.
To create Sankey, a set of nodes and links between them are required.
These are created using the provided Node and Link structures.
*)
-
-open Plotly.NET
-
-// create nodes
-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")
-
-// create links between nodes
-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)
+open Plotly.NET
let sankey1 =
Chart.Sankey(
- [n1;n2;n3;n4;n5],
- [link1;link2;link3;link4;link5]
+ nodeLabels = ["A1"; "A2"; "B1"; "B2"; "C1"; "C2"; "D1"],
+ linkedNodeIds = [ // Edgelist, toupling sourceIndex => targetIndex of the link
+ 0,2
+ 0,3
+ 1,3
+ 2,4
+ 3,4
+ 3,5
+ 4,6
+ 5,6
+ ],
+ NodeOutlineColor = Color.fromKeyword Black,
+ NodeOutlineWidth = 1.,
+ linkValues = [8; 4; 2; 7; 3; 2; 5; 2],
+ LinkColor = Color.fromColors [
+ Color.fromHex "#828BFB"
+ Color.fromHex "#828BFB"
+ Color.fromHex "#F27762"
+ Color.fromHex "#33D6AB"
+ Color.fromHex "#BC82FB"
+ Color.fromHex "#BC82FB"
+ Color.fromHex "#FFB47B"
+ Color.fromHex "#47DCF5"
+ ],
+ LinkOutlineColor = Color.fromKeyword Black,
+ LinkOutlineWidth = 1.,
+ UseDefaults = false
)
- |> Chart.withTitle "Sankey Sample"
(*** condition: ipynb ***)
#if IPYNB
diff --git a/docs/09_3_icicle.fsx b/docs/09_3_icicle.fsx
index 288f9e615..04348f111 100644
--- a/docs/09_3_icicle.fsx
+++ b/docs/09_3_icicle.fsx
@@ -42,14 +42,14 @@ open Plotly.NET.TraceObjects
let character = ["Eve"; "Cain"; "Seth"; "Enos"; "Noam"; "Abel"; "Awan"; "Enoch"; "Azura"]
let parent = [""; "Eve"; "Eve"; "Seth"; "Seth"; "Eve"; "Eve"; "Awan"; "Eve" ]
-let icicle =
+let icicle =
Chart.Icicle(
character,
parent,
- ShowScale = true,
- ColorScale = StyleParam.Colorscale.Viridis,
- TilingOrientation = StyleParam.Orientation.Vertical, // wether the icicles will grow in the vertical (up/down) or horizontal (left/right) direction
- TilingFlip = StyleParam.TilingFlip.Y, // flip in the Y direction (grow up instead of down)
+ ShowSectionColorScale = true,
+ SectionColorScale = StyleParam.Colorscale.Viridis,
+ TilingOrientation = StyleParam.Orientation.Vertical,
+ TilingFlip = StyleParam.TilingFlip.Y,
PathBarEdgeShape = StyleParam.PathbarEdgeShape.BackSlash
)
@@ -62,3 +62,46 @@ icicle
icicle |> GenericChart.toChartHTML
(***include-it-raw***)
+(**
+## More styled example
+
+This example shows the usage of some of the styling possibility using `Chart.Icicle`.
+For even more styling control, use the respective TraceStyle function `TraceDomainStyle.Icicle`
+*)
+
+let icicleStyled =
+ let labelsParents = [
+ ("A",""), 20
+ ("B",""), 1
+ ("C",""), 2
+ ("D",""), 3
+ ("E",""), 4
+
+ ("AA","A"), 15
+ ("AB","A"), 5
+
+ ("BA","B"), 1
+
+ ("AAA", "AA"), 10
+ ("AAB", "AA"), 5
+ ]
+
+ Chart.Icicle(
+ labelsParents |> Seq.map fst,
+ Values = (labelsParents |> Seq.map snd),
+ BranchValues = StyleParam.BranchValues.Total, // branch values are the total of their childrens values
+ SectionColorScale = StyleParam.Colorscale.Viridis,
+ ShowSectionColorScale = true,
+ SectionOutlineColor = Color.fromKeyword Black,
+ Tiling = IcicleTiling.init(Flip = StyleParam.TilingFlip.XY),
+ UseDefaults = false
+ )
+
+(*** condition: ipynb ***)
+#if IPYNB
+icicleStyled
+#endif // IPYNB
+
+(***hide***)
+icicleStyled |> GenericChart.toChartHTML
+(***include-it-raw***)
diff --git a/docs/09_4_treemap.fsx b/docs/09_4_treemap.fsx
new file mode 100644
index 000000000..24bb778db
--- /dev/null
+++ b/docs/09_4_treemap.fsx
@@ -0,0 +1,81 @@
+(**
+---
+title: Treemap Charts
+category: Categorical Charts
+categoryindex: 10
+index: 5
+---
+*)
+
+
+(*** hide ***)
+
+(*** condition: prepare ***)
+#r "nuget: Newtonsoft.JSON, 12.0.3"
+#r "nuget: DynamicObj"
+#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
+
+(*** condition: ipynb ***)
+#if IPYNB
+#r "nuget: Plotly.NET, {{fsdocs-package-version}}"
+#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}"
+#endif // IPYNB
+
+(**
+# Treemap charts
+
+[](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb)
+[]({{root}}{{fsdocs-source-basename}}.fsx)
+[]({{root}}{{fsdocs-source-basename}}.ipynb)
+
+*Summary:* This example shows how to create treemap charts in F#.
+
+Treemap Chart is intended for the visualization of hierarchical data in the form of nested rectangles.
+Each level of such a tree structure is depicted as a colored rectangle, often called a branch, which contains other rectangles (leaves).
+The space inside each of the rectangles that compose a Treemap is highlighted based on the quantitative value in the corresponding data point.
+
+## Treemap example
+
+This example shows the usage of some of the styling possibility using `Chart.Treemap`.
+For even more styling control, use the respective TraceStyle function `TraceDomainStyle.Treemap`
+*)
+
+open Plotly.NET
+open Plotly.NET.TraceObjects
+
+let treemapStyled =
+ let labelsParents = [
+ ("A",""), 20
+ ("B",""), 1
+ ("C",""), 2
+ ("D",""), 3
+ ("E",""), 4
+
+ ("AA","A"), 15
+ ("AB","A"), 5
+
+ ("BA","B"), 1
+
+ ("AAA", "AA"), 10
+ ("AAB", "AA"), 5
+ ]
+
+ Chart.Treemap(
+ labelsParents |> Seq.map fst,
+ Values = (labelsParents |> Seq.map snd),
+ BranchValues = StyleParam.BranchValues.Total, // branch values are the total of their childrens values
+ SectionColorScale = StyleParam.Colorscale.Viridis,
+ ShowSectionColorScale = true,
+ SectionOutlineColor = Color.fromKeyword Black,
+ Tiling = TreemapTiling.init(Packing = StyleParam.TreemapTilingPacking.SliceDice)
+ )
+
+(*** condition: ipynb ***)
+#if IPYNB
+treemapStyled
+#endif // IPYNB
+
+(***hide***)
+treemapStyled |> GenericChart.toChartHTML
+(***include-it-raw***)
+
diff --git a/docs/09_5_sunburst.fsx b/docs/09_5_sunburst.fsx
new file mode 100644
index 000000000..649304092
--- /dev/null
+++ b/docs/09_5_sunburst.fsx
@@ -0,0 +1,94 @@
+(**
+---
+title: Sunburst Charts
+category: Categorical Charts
+categoryindex: 10
+index: 6
+---
+*)
+
+
+(*** hide ***)
+
+(*** condition: prepare ***)
+#r "nuget: Newtonsoft.JSON, 12.0.3"
+#r "nuget: DynamicObj"
+#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
+
+(*** condition: ipynb ***)
+#if IPYNB
+#r "nuget: Plotly.NET, {{fsdocs-package-version}}"
+#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}"
+#endif // IPYNB
+
+(**
+# Sunburst charts
+
+[](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb)
+[]({{root}}{{fsdocs-source-basename}}.fsx)
+[]({{root}}{{fsdocs-source-basename}}.ipynb)
+
+*Summary:* This example shows how to create sunburst charts in F#.
+
+Sunburst Chart � also known as Ring Chart, Multi-level Pie Chart, and Radial Treemap � is typically used to visualize hierarchical data structures.
+A Sunburst Chart consists of an inner circle surrounded by rings of deeper hierarchy levels.
+The angle of each segment is either proportional to a value or divided equally under its parent node.
+
+## Simple sunburst plot
+*)
+open Plotly.NET
+
+let values = [19; 26; 55;]
+let labels = ["Residential"; "Non-Residential"; "Utility"]
+
+let sunburstChart =
+ Chart.Sunburst(
+ ["A";"B";"C";"D";"E"],
+ ["";"";"B";"B";""],
+ Values=[5.;0.;3.;2.;3.],
+ MultiText=["At";"Bt";"Ct";"Dt";"Et"]
+ )
+
+(**
+## More styled example
+
+This example shows the usage of some of the styling possibility using `Chart.Sunburst`.
+For even more styling control, use the respective TraceStyle function `TraceDomainStyle.Sunburst`
+*)
+
+let sunburstStyled =
+ let labelsParents = [
+ ("A",""), 20
+ ("B",""), 1
+ ("C",""), 2
+ ("D",""), 3
+ ("E",""), 4
+
+ ("AA","A"), 15
+ ("AB","A"), 5
+
+ ("BA","B"), 1
+
+ ("AAA", "AA"), 10
+ ("AAB", "AA"), 5
+ ]
+
+ Chart.Sunburst(
+ labelsParents |> Seq.map fst,
+ Values = (labelsParents |> Seq.map snd),
+ BranchValues = StyleParam.BranchValues.Total, // branch values are the total of their childrens values
+ SectionColorScale = StyleParam.Colorscale.Viridis,
+ ShowSectionColorScale = true,
+ SectionOutlineColor = Color.fromKeyword Black,
+ Rotation = 45,
+ UseDefaults = false
+ )
+
+(*** condition: ipynb ***)
+#if IPYNB
+sunburstStyled
+#endif // IPYNB
+
+(***hide***)
+sunburstStyled |> GenericChart.toChartHTML
+(***include-it-raw***)
diff --git a/src/Plotly.NET/ChartAPI/Chart2D.fs b/src/Plotly.NET/ChartAPI/Chart2D.fs
index 724757491..e54744b19 100644
--- a/src/Plotly.NET/ChartAPI/Chart2D.fs
+++ b/src/Plotly.NET/ChartAPI/Chart2D.fs
@@ -30,6 +30,7 @@ module Chart2D =
Trace2D.initHeatmap style |> GenericChart.ofTraceObject useDefaults
+
///
/// Creates a Scatter chart. Scatter charts are the basis of Point, Line, and Bubble Charts in Plotly, and can be customized as such. We also provide abstractions for those: Chart.Line, Chart.Point, Chart.Bubble
///
diff --git a/src/Plotly.NET/ChartAPI/ChartDomain.fs b/src/Plotly.NET/ChartAPI/ChartDomain.fs
index fa3e862f6..77fcbe4f6 100644
--- a/src/Plotly.NET/ChartAPI/ChartDomain.fs
+++ b/src/Plotly.NET/ChartAPI/ChartDomain.fs
@@ -23,44 +23,70 @@ module ChartDomain =
static member Pie
(
values: seq<#IConvertible>,
- [] ?Labels: seq<#IConvertible>,
[] ?Name: string,
- [] ?TextLabels: seq<#IConvertible>,
- [] ?TextPosition: StyleParam.TextPosition,
- [] ?Direction: StyleParam.Direction,
- [] ?Pull: float,
[] ?ShowLegend: bool,
- [] ?SectionColors: seq,
[] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Labels: seq<#IConvertible>,
+ [] ?Pull: float,
+ [] ?MultiPull: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?SectionColors: seq,
+ [] ?SectionOutlineColor: Color,
+ [] ?SectionOutlineWidth: float,
+ [] ?SectionOutlineMultiWidth: seq,
+ [] ?SectionOutline: Line,
+ [] ?Marker: Marker,
+ [] ?TextInfo: StyleParam.TextInfo,
+ [] ?Direction: StyleParam.Direction,
+ [] ?Hole: float,
+ [] ?Rotation: float,
[] ?Sort: bool,
- [] ?UseDefaults: bool
+ [] ?UseDefaults: bool
) =
let useDefaults = defaultArg UseDefaults true
+ let outline =
+ SectionOutline
+ |> Option.defaultValue (Line.init ())
+ |> Line.style (
+ ?Color = SectionOutlineColor,
+ ?Width = SectionOutlineWidth,
+ ?MultiWidth = SectionOutlineMultiWidth
+ )
+
+ let marker =
+ Marker
+ |> Option.defaultValue (TraceObjects.Marker.init ())
+ |> TraceObjects.Marker.style (?Colors = SectionColors, ?MultiOpacity = MultiOpacity, Outline = outline)
+
+
TraceDomain.initPie (
TraceDomainStyle.Pie(
Values = values,
- ?Labels = Labels,
?Name = Name,
- ?Text = TextLabels,
- ?TextPosition = TextPosition,
- ?Direction = Direction,
- ?Pull = Pull,
?ShowLegend = ShowLegend,
?Opacity = Opacity,
+ ?Labels = Labels,
+ ?Pull = Pull,
+ ?MultiPull = MultiPull,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ Marker = marker,
+ ?TextInfo = TextInfo,
+ ?Direction = Direction,
+ ?Hole = Hole,
+ ?Rotation = Rotation,
?Sort = Sort
+
)
)
- |> TraceStyle.Marker(?Colors = SectionColors)
- |> TraceStyle.TextLabel(
- ?Text =
- (if TextLabels.IsSome then
- TextLabels
- else
- Labels),
- ?Textposition = TextPosition
- )
|> GenericChart.ofTraceObject useDefaults
/// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data.
@@ -69,15 +95,27 @@ module ChartDomain =
(
valuesLabels: seq<#IConvertible * #IConvertible>,
[] ?Name: string,
- [] ?TextLabels: seq<#IConvertible>,
- [] ?TextPosition: StyleParam.TextPosition,
- [] ?Direction: StyleParam.Direction,
- [] ?Pull: float,
[] ?ShowLegend: bool,
- [] ?SectionColors: seq,
[] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Pull: float,
+ [] ?MultiPull: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?SectionColors: seq,
+ [] ?SectionOutlineColor: Color,
+ [] ?SectionOutlineWidth: float,
+ [] ?SectionOutlineMultiWidth: seq,
+ [] ?SectionOutline: Line,
+ [] ?Marker: Marker,
+ [] ?TextInfo: StyleParam.TextInfo,
+ [] ?Direction: StyleParam.Direction,
+ [] ?Hole: float,
+ [] ?Rotation: float,
[] ?Sort: bool,
- [] ?UseDefaults: bool
+ [] ?UseDefaults: bool
) =
let values, labels = Seq.unzip valuesLabels
@@ -86,13 +124,25 @@ module ChartDomain =
values,
Labels = labels,
?Name = Name,
- ?TextLabels = TextLabels,
- ?TextPosition = TextPosition,
- ?Direction = Direction,
- ?Pull = Pull,
?ShowLegend = ShowLegend,
- ?SectionColors = SectionColors,
?Opacity = Opacity,
+ ?MultiOpacity = MultiOpacity,
+ ?Pull = Pull,
+ ?MultiPull = MultiPull,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?SectionColors = SectionColors,
+ ?SectionOutlineColor = SectionOutlineColor,
+ ?SectionOutlineWidth = SectionOutlineWidth,
+ ?SectionOutlineMultiWidth = SectionOutlineMultiWidth,
+ ?SectionOutline = SectionOutline,
+ ?Marker = Marker,
+ ?TextInfo = TextInfo,
+ ?Direction = Direction,
+ ?Hole = Hole,
+ ?Rotation = Rotation,
?Sort = Sort,
?UseDefaults = UseDefaults
)
@@ -103,48 +153,60 @@ module ChartDomain =
static member Doughnut
(
values: seq<#IConvertible>,
- [] ?Labels: seq<#IConvertible>,
- [] ?Hole: float,
[] ?Name: string,
- [] ?TextLabels: seq<#IConvertible>,
- [] ?TextPosition: StyleParam.TextPosition,
- [] ?Direction: StyleParam.Direction,
- [] ?Pull: float,
+ [] ?Hole: float,
[] ?ShowLegend: bool,
- [] ?SectionColors: seq,
[] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Labels: seq<#IConvertible>,
+ [] ?Pull: float,
+ [] ?MultiPull: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?SectionColors: seq,
+ [] ?SectionOutlineColor: Color,
+ [] ?SectionOutlineWidth: float,
+ [] ?SectionOutlineMultiWidth: seq,
+ [] ?SectionOutline: Line,
+ [] ?Marker: Marker,
+ [] ?TextInfo: StyleParam.TextInfo,
+ [] ?Direction: StyleParam.Direction,
+ [] ?Rotation: float,
[] ?Sort: bool,
- [] ?UseDefaults: bool
+ [] ?UseDefaults: bool
) =
let useDefaults = defaultArg UseDefaults true
- let hole' = Option.defaultValue 0.4 Hole
+ let hole = Option.defaultValue 0.4 Hole
- TraceDomain.initPie (
- TraceDomainStyle.Pie(
- Values = values,
- ?Labels = Labels,
- ?Name = Name,
- ?Text = TextLabels,
- ?TextPosition = TextPosition,
- ?Direction = Direction,
- ?Pull = Pull,
- ?ShowLegend = ShowLegend,
- ?Opacity = Opacity,
- Hole = hole',
- ?Sort = Sort
- )
- )
- |> TraceStyle.Marker(?Colors = SectionColors)
- |> TraceStyle.TextLabel(
- ?Text =
- (if TextLabels.IsSome then
- TextLabels
- else
- Labels),
- ?Textposition = TextPosition
+ Chart.Pie(
+ values,
+ Hole = hole,
+ ?Labels = Labels,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?MultiOpacity = MultiOpacity,
+ ?MultiPull = MultiPull,
+ ?Pull = Pull,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?SectionColors = SectionColors,
+ ?SectionOutlineColor = SectionOutlineColor,
+ ?SectionOutlineWidth = SectionOutlineWidth,
+ ?SectionOutlineMultiWidth = SectionOutlineMultiWidth,
+ ?SectionOutline = SectionOutline,
+ ?Marker = Marker,
+ ?TextInfo = TextInfo,
+ ?Direction = Direction,
+ ?Rotation = Rotation,
+ ?Sort = Sort,
+ ?UseDefaults = UseDefaults
)
- |> GenericChart.ofTraceObject useDefaults
/// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data as a whole.
@@ -154,30 +216,52 @@ module ChartDomain =
valuesLabels: seq<#IConvertible * #IConvertible>,
[] ?Hole: float,
[] ?Name: string,
- [] ?TextLabels: seq<#IConvertible>,
- [] ?TextPosition: StyleParam.TextPosition,
- [] ?Direction: StyleParam.Direction,
- [] ?Pull: float,
[] ?ShowLegend: bool,
- [] ?SectionColors: seq,
[] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Pull: float,
+ [] ?MultiPull: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?SectionColors: seq,
+ [] ?SectionOutlineColor: Color,
+ [] ?SectionOutlineWidth: float,
+ [] ?SectionOutlineMultiWidth: seq,
+ [] ?SectionOutline: Line,
+ [] ?Marker: Marker,
+ [] ?TextInfo: StyleParam.TextInfo,
+ [] ?Direction: StyleParam.Direction,
+ [] ?Rotation: float,
[] ?Sort: bool,
- [] ?UseDefaults: bool
+ [] ?UseDefaults: bool
) =
let values, labels = Seq.unzip valuesLabels
Chart.Doughnut(
values,
Labels = labels,
+ ?Hole = Hole,
?Name = Name,
- ?TextLabels = TextLabels,
- ?TextPosition = TextPosition,
- ?Direction = Direction,
- ?Pull = Pull,
?ShowLegend = ShowLegend,
- ?SectionColors = SectionColors,
?Opacity = Opacity,
- ?Hole = Hole,
+ ?MultiOpacity = MultiOpacity,
+ ?Pull = Pull,
+ ?MultiPull = MultiPull,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?SectionColors = SectionColors,
+ ?SectionOutlineColor = SectionOutlineColor,
+ ?SectionOutlineWidth = SectionOutlineWidth,
+ ?SectionOutlineMultiWidth = SectionOutlineMultiWidth,
+ ?SectionOutline = SectionOutline,
+ ?Marker = Marker,
+ ?TextInfo = TextInfo,
+ ?Direction = Direction,
+ ?Rotation = Rotation,
?Sort = Sort,
?UseDefaults = UseDefaults
)
@@ -185,422 +269,857 @@ module ChartDomain =
/// Creates a FunnelArea chart.
- /// FunnelArea charts visualize stages in a process using area-encoded trapezoids. This trace can be used to show data in a part-to-whole representation similar to a "pie" trace, wherein each item appears in a single stage. See also the "funnel" trace type for a different approach to visualizing funnel data.
- ///
- /// Parameters:
- ///
- /// Values : Sets the values of the sectors. If omitted, we count occurrences of each label.
- ///
- /// Labels : Sets the sector labels. If `labels` entries are duplicated, we sum associated `values` or simply count occurrences if `values` is not provided. For other array attributes (including color) we use the first non-empty entry among all occurrences of the label.
- ///
- /// dLabel : Sets the label step. See `label0` for more info.
- ///
- /// Label0 : Alternate to `labels`. Builds a numeric set of labels. Use with `dlabel` where `label0` is the starting label and `dlabel` the step.
- ///
- /// Name : Sets the trace name. The trace name appear as the legend item and on hover.
- ///
- /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend.
- ///
- /// Opacity : Sets the opacity of the trace.
- ///
- /// Color : Sets Marker Color
- ///
- /// Line : Line type
- ///
- /// Text : Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels.
- ///
- /// TextPosition : Specifies the location of the `textinfo`.
- ///
- /// X : Sets the horizontal domain of this funnelarea trace (in plot fraction).
- ///
- /// Y : Sets the vertical domain of this funnelarea trace (in plot fraction).
- ///
- /// Row : If there is a layout grid, use the domain for this row in the grid for this funnelarea trace .
- ///
- /// Column : If there is a layout grid, use the domain for this column in the grid for this funnelarea trace .
- ///
- /// Aspectratio : Sets the ratio between height and width
- ///
- /// Baseratio : Sets the ratio between bottom length and maximum top length.
- ///
- /// Insidetextfont: Sets the font used for `textinfo` lying inside the sector.
- ///
- /// Scalegroup : If there are multiple funnelareas that should be sized according to their totals, link them by providing a non-empty group id here shared by every trace in the same group.
[]
static member FunnelArea
(
- [] ?Values,
- [] ?Labels,
- [] ?dLabel,
- [] ?Label0,
- [] ?Name,
- [] ?ShowLegend,
- [] ?Opacity,
- [] ?Color,
- [] ?Line,
- [] ?Text,
- [] ?TextPosition,
- [] ?X,
- [] ?Y,
- [] ?Row,
- [] ?Column,
- [] ?Aspectratio,
- [] ?Baseratio,
- [] ?Insidetextfont,
- [] ?Scalegroup,
- [] ?UseDefaults: bool
+ values: seq<#IConvertible>,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Labels: seq<#IConvertible>,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?SectionColors: seq,
+ [] ?SectionOutlineColor: Color,
+ [] ?SectionOutlineWidth: float,
+ [] ?SectionOutlineMultiWidth: seq,
+ [] ?SectionOutline: Line,
+ [] ?Marker: Marker,
+ [] ?TextInfo: StyleParam.TextInfo,
+ [] ?AspectRatio: float,
+ [] ?BaseRatio: float,
+ [] ?UseDefaults: bool
) =
+
let useDefaults = defaultArg UseDefaults true
+ let outline =
+ SectionOutline
+ |> Option.defaultValue (Line.init ())
+ |> Line.style (
+ ?Color = SectionOutlineColor,
+ ?Width = SectionOutlineWidth,
+ ?MultiWidth = SectionOutlineMultiWidth
+ )
+
+ let marker =
+ Marker
+ |> Option.defaultValue (TraceObjects.Marker.init ())
+ |> TraceObjects.Marker.style (?Colors = SectionColors, ?MultiOpacity = MultiOpacity, Outline = outline)
+
+
TraceDomain.initFunnelArea (
TraceDomainStyle.FunnelArea(
- ?Values = Values,
+ Values = values,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
?Labels = Labels,
- ?dLabel = dLabel,
- ?Label0 = Label0,
- ?Aspectratio = Aspectratio,
- ?Baseratio = Baseratio,
- ?Insidetextfont = Insidetextfont,
- ?Scalegroup = Scalegroup
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ Marker = marker,
+ ?TextInfo = TextInfo,
+ ?AspectRatio = AspectRatio,
+ ?BaseRatio = BaseRatio
)
)
- |> TraceStyle.TraceInfo(?Name = Name, ?ShowLegend = ShowLegend, ?Opacity = Opacity)
- |> TraceStyle.Marker(?Color = Color, ?Outline = Line)
- |> TraceStyle.Domain(?X = X, ?Y = Y, ?Row = Row, ?Column = Column)
- |> TraceStyle.TextLabel(?Text = Text, ?Textposition = TextPosition)
|> GenericChart.ofTraceObject useDefaults
+ /// Creates a FunnelArea chart.
+ []
+ static member FunnelArea
+ (
+ valuesLabels: seq<#IConvertible * #IConvertible>,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?SectionColors: seq,
+ [] ?SectionOutlineColor: Color,
+ [] ?SectionOutlineWidth: float,
+ [] ?SectionOutlineMultiWidth: seq,
+ [] ?SectionOutline: Line,
+ [] ?Marker: Marker,
+ [] ?TextInfo: StyleParam.TextInfo,
+ [] ?AspectRatio: float,
+ [] ?BaseRatio: float,
+ [] ?UseDefaults: bool
+ ) =
+ let values, labels = Seq.unzip valuesLabels
+
+ Chart.FunnelArea(
+ values,
+ Labels = labels,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?MultiOpacity = MultiOpacity,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?SectionColors = SectionColors,
+ ?SectionOutlineColor = SectionOutlineColor,
+ ?SectionOutlineWidth = SectionOutlineWidth,
+ ?SectionOutlineMultiWidth = SectionOutlineMultiWidth,
+ ?SectionOutline = SectionOutline,
+ ?Marker = Marker,
+ ?TextInfo = TextInfo,
+ ?AspectRatio = AspectRatio,
+ ?BaseRatio = BaseRatio,
+ ?UseDefaults = UseDefaults
+ )
+
/// Creates a sunburst chart. Visualize hierarchical data spanning outward radially from root to leaves.
- /// Applies the styles of sundburst plot to TraceObjects
- ///
- /// Parameters:
- ///
- /// labels: Sets the labels of each of the sectors.
- ///
- /// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique.
- ///
- /// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation.
- ///
- /// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed.
- ///
- /// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels.
- ///
- /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves.
- ///
- /// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`.
- ///
- /// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy.
- ///
- /// ColorBar: Sets the ColorBar for the chart
- ///
- ///Colors: Sets the color of each sector of this trace. If not specified, the default trace color set is used to pick the sector colors.
[]
static member Sunburst
(
- labels,
- parents,
- [] ?Ids,
- [] ?Values,
- [] ?Text,
- [] ?Branchvalues,
- [] ?Level,
- [] ?Maxdepth,
- [] ?Color,
- [] ?ColorBar: ColorBar,
- [] ?UseDefaults: bool
+ labels: seq<#IConvertible>,
+ parents: seq<#IConvertible>,
+ [] ?Values: seq<#IConvertible>,
+ [] ?Ids: seq<#IConvertible>,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?SectionColors: seq,
+ [] ?SectionColorScale: StyleParam.Colorscale,
+ [] ?ShowSectionColorScale: bool,
+ [] ?ReverseSectionColorScale: bool,
+ [] ?SectionOutlineColor: Color,
+ [] ?SectionOutlineWidth: float,
+ [] ?SectionOutlineMultiWidth: seq,
+ [] ?SectionOutline: Line,
+ [] ?Marker: Marker,
+ [] ?TextInfo: StyleParam.TextInfo,
+ [] ?BranchValues: StyleParam.BranchValues,
+ [] ?Count: string,
+ [] ?Root: SunburstRoot,
+ [] ?Leaf: SunburstLeaf,
+ [] ?Level: string,
+ [] ?MaxDepth: int,
+ [] ?Rotation: int,
+ [] ?Sort: bool,
+ [] ?UseDefaults: bool
) =
let useDefaults = defaultArg UseDefaults true
+ let outline =
+ SectionOutline
+ |> Option.defaultValue (Line.init ())
+ |> Line.style (
+ ?Color = SectionOutlineColor,
+ ?Width = SectionOutlineWidth,
+ ?MultiWidth = SectionOutlineMultiWidth
+ )
+
+ let marker =
+ Marker
+ |> Option.defaultValue (TraceObjects.Marker.init ())
+ |> TraceObjects.Marker.style (
+ ?MultiOpacity = MultiOpacity,
+ ?Colors = SectionColors,
+ ?Colorscale = SectionColorScale,
+ ?ShowScale = ShowSectionColorScale,
+ ?ReverseScale = ReverseSectionColorScale,
+ Outline = outline
+ )
+
TraceDomain.initSunburst (
TraceDomainStyle.Sunburst(
- labels = labels,
- parents = parents,
- ?Ids = Ids,
+ Labels = labels,
+ Parents = parents,
+ Marker = marker,
?Values = Values,
+ ?Ids = Ids,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
?Text = Text,
- ?Branchvalues = Branchvalues,
+ ?MultiText = MultiText,
+ ?TextInfo = TextInfo,
+ ?Rotation = Rotation,
+ ?Sort = Sort,
+ ?BranchValues = BranchValues,
+ ?Count = Count,
+ ?Root = Root,
+ ?Leaf = Leaf,
?Level = Level,
- ?Maxdepth = Maxdepth
+ ?MaxDepth = MaxDepth
+
)
)
- |> TraceStyle.Marker(?Color = Color, ?ColorBar = ColorBar)
|> GenericChart.ofTraceObject useDefaults
- /// Creates a treemap chart. Treemap charts visualize hierarchical data using nested rectangles. Same as Sunburst the hierarchy is defined by labels and parents attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well.
- ///
- /// Parameters:
- ///
- /// labels: Sets the labels of each of the sectors.
- ///
- /// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique.
- ///
- /// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation.
- ///
- /// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed.
- ///
- /// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels.
- ///
- /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves.
- ///
- /// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`.
- ///
- /// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy.
- ///
- /// ColorBar: Sets the ColorBar for the chart
- ///
- ///Colors: Sets the color of each sector of this trace. If not specified, the default trace color set is used to pick the sector colors.
+ /// Creates a sunburst chart. Visualize hierarchical data spanning outward radially from root to leaves.
[]
- static member Treemap
+ static member Sunburst
(
+ labelsparents: seq<#IConvertible * #IConvertible>,
+ [] ?Values: seq<#IConvertible>,
+ [] ?Ids: seq<#IConvertible>,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [