Skip to content

Commit b233e91

Browse files
committed
Add ternary docs, prefix numbers for better ordering
1 parent 6501a3a commit b233e91

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+259
-53
lines changed

Diff for: Plotly.NET.sln

+52-51
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,60 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Plotly.NET.Interactive", "s
3939
EndProject
4040
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{7B09CC0A-F1E1-4094-9DE4-B047581E01F0}"
4141
ProjectSection(SolutionItems) = preProject
42+
docs\00_0_basics.fsx = docs\00_0_basics.fsx
43+
docs\00_1_image-export.fsx = docs\00_1_image-export.fsx
44+
docs\00_2_display-options.fsx = docs\00_2_display-options.fsx
45+
docs\00_3_chart-config.fsx = docs\00_3_chart-config.fsx
46+
docs\01_0_axis-styling.fsx = docs\01_0_axis-styling.fsx
47+
docs\01_1_errorbars.fsx = docs\01_1_errorbars.fsx
48+
docs\01_2_multiple-charts.fsx = docs\01_2_multiple-charts.fsx
49+
docs\01_3_shapes.fsx = docs\01_3_shapes.fsx
50+
docs\01_4_annotations.fsx = docs\01_4_annotations.fsx
51+
docs\02_0_line-scatter-plots.fsx = docs\02_0_line-scatter-plots.fsx
52+
docs\02_1_bar-and-column-charts.fsx = docs\02_1_bar-and-column-charts.fsx
53+
docs\02_2_area-plots.fsx = docs\02_2_area-plots.fsx
54+
docs\02_3_range-plots.fsx = docs\02_3_range-plots.fsx
55+
docs\02_4_bubble-charts.fsx = docs\02_4_bubble-charts.fsx
56+
docs\02_5_pie-doughnut-charts.fsx = docs\02_5_pie-doughnut-charts.fsx
57+
docs\02_6_table.fsx = docs\02_6_table.fsx
58+
docs\02_7_heatmaps.fsx = docs\02_7_heatmaps.fsx
59+
docs\03_0_3d-scatter-plots.fsx = docs\03_0_3d-scatter-plots.fsx
60+
docs\03_1_3d-surface-plots.fsx = docs\03_1_3d-surface-plots.fsx
61+
docs\03_2_3d-mesh-plots.fsx = docs\03_2_3d-mesh-plots.fsx
62+
docs\03_3_3d-cone-charts.fsx = docs\03_3_3d-cone-charts.fsx
63+
docs\03_4_3d-streamtube-plots.fsx = docs\03_4_3d-streamtube-plots.fsx
64+
docs\03_5_3d-volume-plots.fsx = docs\03_5_3d-volume-plots.fsx
65+
docs\03_6_3d-isosurface-plots .fsx = docs\03_6_3d-isosurface-plots .fsx
66+
docs\04_0_histograms.fsx = docs\04_0_histograms.fsx
67+
docs\04_1_box-plots.fsx = docs\04_1_box-plots.fsx
68+
docs\04_2_violin-plots.fsx = docs\04_2_violin-plots.fsx
69+
docs\04_3_contour-plots.fsx = docs\04_3_contour-plots.fsx
70+
docs\04_4_2d-histograms.fsx = docs\04_4_2d-histograms.fsx
71+
docs\04_5_splom.fsx = docs\04_5_splom.fsx
72+
docs\05_0_geo-vs-mapbox.fsx = docs\05_0_geo-vs-mapbox.fsx
73+
docs\05_1_geo-plots.fsx = docs\05_1_geo-plots.fsx
74+
docs\05_2_choropleth-map.fsx = docs\05_2_choropleth-map.fsx
75+
docs\06_0_geo-vs-mapbox.fsx = docs\06_0_geo-vs-mapbox.fsx
76+
docs\06_1_mapbox-plots.fsx = docs\06_1_mapbox-plots.fsx
77+
docs\06_2_choropleth-mapbox.fsx = docs\06_2_choropleth-mapbox.fsx
78+
docs\06_3_density-mapbox.fsx = docs\06_3_density-mapbox.fsx
79+
docs\07_0_candlestick.fsx = docs\07_0_candlestick.fsx
80+
docs\07_1_funnel.fsx = docs\07_1_funnel.fsx
81+
docs\07_2_funnel_area.fsx = docs\07_2_funnel_area.fsx
82+
docs\08_0_polar_line-scatter-plots.fsx = docs\08_0_polar_line-scatter-plots.fsx
83+
docs\08_1_polar_bar_charts.fsx = docs\08_1_polar_bar_charts.fsx
84+
docs\08_2_styling_polar_layouts.fsx = docs\08_2_styling_polar_layouts.fsx
85+
docs\09_0_parallel-categories.fsx = docs\09_0_parallel-categories.fsx
86+
docs\09_1_parallel-coords.fsx = docs\09_1_parallel-coords.fsx
87+
docs\09_2_sankey.fsx = docs\09_2_sankey.fsx
88+
docs\10_0_ternary_line_scatter_plots.fsx = docs\10_0_ternary_line_scatter_plots.fsx
89+
docs\10_1_styling_ternary_layouts.fsx = docs\10_1_styling_ternary_layouts.fsx
90+
docs\_template.fsx = docs\_template.fsx
4291
docs\_template.html = docs\_template.html
92+
docs\_template.ipynb = docs\_template.ipynb
93+
docs\Dockerfile = docs\Dockerfile
4394
docs\index.fsx = docs\index.fsx
95+
docs\NuGet.config = docs\NuGet.config
4496
EndProjectSection
4597
EndProject
4698
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "reference", "reference", "{5219BAC7-ACE6-435F-A983-BC63DD7B745E}"
@@ -50,58 +102,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "reference", "reference", "{
50102
EndProject
51103
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{60FB82C0-F472-494E-BCF7-7B3C54212406}"
52104
ProjectSection(SolutionItems) = preProject
53-
docs\0_0_basics.fsx = docs\0_0_basics.fsx
54-
docs\0_1_image-export.fsx = docs\0_1_image-export.fsx
55-
docs\0_2_display-options.fsx = docs\0_2_display-options.fsx
56-
docs\0_3_chart-config.fsx = docs\0_3_chart-config.fsx
57-
docs\1_0_axis-styling.fsx = docs\1_0_axis-styling.fsx
58-
docs\1_1_errorbars.fsx = docs\1_1_errorbars.fsx
59-
docs\1_2_multiple-charts.fsx = docs\1_2_multiple-charts.fsx
60-
docs\1_3_shapes.fsx = docs\1_3_shapes.fsx
61-
docs\1_4_annotations.fsx = docs\1_4_annotations.fsx
62-
docs\2_0_line-scatter-plots.fsx = docs\2_0_line-scatter-plots.fsx
63-
docs\2_1_bar-and-column-charts.fsx = docs\2_1_bar-and-column-charts.fsx
64-
docs\2_2_area-plots.fsx = docs\2_2_area-plots.fsx
65-
docs\2_3_range-plots.fsx = docs\2_3_range-plots.fsx
66-
docs\2_4_bubble-charts.fsx = docs\2_4_bubble-charts.fsx
67-
docs\2_5_pie-doughnut-charts.fsx = docs\2_5_pie-doughnut-charts.fsx
68-
docs\2_6_table.fsx = docs\2_6_table.fsx
69-
docs\2_7_heatmaps.fsx = docs\2_7_heatmaps.fsx
70-
docs\3_0_3d-scatter-plots.fsx = docs\3_0_3d-scatter-plots.fsx
71-
docs\3_1_3d-surface-plots.fsx = docs\3_1_3d-surface-plots.fsx
72-
docs\3_2_3d-mesh-plots.fsx = docs\3_2_3d-mesh-plots.fsx
73-
docs\3_3_3d-cone-charts.fsx = docs\3_3_3d-cone-charts.fsx
74-
docs\3_4_3d-streamtube-plots.fsx = docs\3_4_3d-streamtube-plots.fsx
75-
docs\3_5_3d-volume-plots.fsx = docs\3_5_3d-volume-plots.fsx
76-
docs\3_6_3d-isosurface-plots .fsx = docs\3_6_3d-isosurface-plots .fsx
77-
docs\4_0_histograms.fsx = docs\4_0_histograms.fsx
78-
docs\4_1_box-plots.fsx = docs\4_1_box-plots.fsx
79-
docs\4_2_violin-plots.fsx = docs\4_2_violin-plots.fsx
80-
docs\4_3_contour-plots.fsx = docs\4_3_contour-plots.fsx
81-
docs\4_4_2d-histograms.fsx = docs\4_4_2d-histograms.fsx
82-
docs\4_5_splom.fsx = docs\4_5_splom.fsx
83-
docs\5_0_geo-vs-mapbox.fsx = docs\5_0_geo-vs-mapbox.fsx
84-
docs\5_1_geo-plots.fsx = docs\5_1_geo-plots.fsx
85-
docs\5_2_choropleth-map.fsx = docs\5_2_choropleth-map.fsx
86-
docs\6_0_geo-vs-mapbox.fsx = docs\6_0_geo-vs-mapbox.fsx
87-
docs\6_1_mapbox-plots.fsx = docs\6_1_mapbox-plots.fsx
88-
docs\6_2_choropleth-mapbox.fsx = docs\6_2_choropleth-mapbox.fsx
89-
docs\6_3_density-mapbox.fsx = docs\6_3_density-mapbox.fsx
90-
docs\7_0_candlestick.fsx = docs\7_0_candlestick.fsx
91-
docs\7_1_funnel.fsx = docs\7_1_funnel.fsx
92-
docs\7_2_funnel_area.fsx = docs\7_2_funnel_area.fsx
93-
docs\8_0_polar_line-scatter-plots.fsx = docs\8_0_polar_line-scatter-plots.fsx
94-
docs\8_1_polar_bar_charts.fsx = docs\8_1_polar_bar_charts.fsx
95-
docs\8_2_styling_polar_layouts.fsx = docs\8_2_styling_polar_layouts.fsx
96-
docs\9_0_parallel-categories.fsx = docs\9_0_parallel-categories.fsx
97-
docs\9_1_parallel-coords.fsx = docs\9_1_parallel-coords.fsx
98-
docs\9_2_sankey.fsx = docs\9_2_sankey.fsx
99-
docs\_template.html = docs\_template.html
100-
docs\_template.ipynb = docs\_template.ipynb
101-
docs\Dockerfile = docs\Dockerfile
102105
docs\content\fsdocs-custom.css = docs\content\fsdocs-custom.css
103-
docs\index.fsx = docs\index.fsx
104-
docs\NuGet.config = docs\NuGet.config
105106
EndProjectSection
106107
EndProject
107108
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{CDB973F2-0F60-4ADB-84A8-924AFA8B6D49}"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: docs/2_6_table.fsx renamed to docs/02_6_table.fsx

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: docs/4_5_splom.fsx renamed to docs/04_5_splom.fsx

File renamed without changes.

Diff for: docs/5_0_geo-vs-mapbox.fsx renamed to docs/05_0_geo-vs-mapbox.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Plotly and therefore Plotly.NET supports two different kinds of maps:
3737
- **Geo maps** are outline-based maps. If your figure is created with a `Chart.ScatterGeo, `Chart.PointGeo`, `Chart.LineGeo` or `Chart.Choropleth` function or
3838
otherwise contains one or more traces of type `scattergeo` or `choropleth`, the layout.geo object in your figure contains configuration information for the map itself.
3939
40-
_This page documents Geo outline-based maps, and the [Mapbox Layers documentation]({{root}}/6_0_geo-vs-mapbox.html) describes how to configure Mapbox tile-based maps._
40+
_This page documents Geo outline-based maps, and the [Mapbox Layers documentation]({{root}}/06_0_geo-vs-mapbox.html) describes how to configure Mapbox tile-based maps._
4141
4242
## Physical Base Maps
4343
File renamed without changes.
File renamed without changes.

Diff for: docs/6_0_geo-vs-mapbox.fsx renamed to docs/06_0_geo-vs-mapbox.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Plotly and therefore Plotly.NET supports two different kinds of maps:
3737
- **Geo maps** are outline-based maps. If your figure is created with a `Chart.ScatterGeo, `Chart.PointGeo`, `Chart.LineGeo` or `Chart.Choropleth` function or
3838
otherwise contains one or more traces of type `scattergeo` or `choropleth`, the layout.geo object in your figure contains configuration information for the map itself.
3939
40-
_This page documents Mapbox tile-based maps, and the [Geo map documentation]({{root}}/5_0_geo-vs-mapbox.html) describes how to configure outline-based maps_
40+
_This page documents Mapbox tile-based maps, and the [Geo map documentation]({{root}}/05_0_geo-vs-mapbox.html) describes how to configure outline-based maps_
4141
4242
## How Layers Work in Mapbox Tile Maps
4343
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: docs/10_0_ternary_line_scatter_plots.fsx

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
(**
2+
---
3+
title: Ternary line and scatter plots
4+
category: Ternary Plots
5+
categoryindex: 10
6+
index: 1
7+
---
8+
*)
9+
10+
(*** hide ***)
11+
12+
(*** condition: prepare ***)
13+
#r "nuget: Newtonsoft.JSON, 12.0.3"
14+
#r "nuget: DynamicObj"
15+
#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
16+
17+
(*** condition: ipynb ***)
18+
#if IPYNB
19+
#r "nuget: Plotly.NET, {{fsdocs-package-version}}"
20+
#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}"
21+
#endif // IPYNB
22+
23+
(**
24+
# Ternary charts
25+
26+
[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb) 
27+
[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx) 
28+
[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb)
29+
30+
*Summary:* This example shows how to create ternary charts in F#.
31+
32+
let's first create some data for the purpose of creating example charts:
33+
34+
*)
35+
36+
open Plotly.NET
37+
38+
// a coordinates
39+
let a = [ 1; 2; 3; 4; 5; 6; 7;]
40+
41+
// b coordinates
42+
let b = a |> List.rev
43+
44+
//c
45+
let c = [ 2; 2; 2; 2; 2; 2; 2;]
46+
47+
48+
(**
49+
A Ternary plot is a barycentric plot on three variables which sum to a constant.
50+
51+
It graphically depicts the ratios of the three variables as positions in an equilateral triangle.
52+
53+
It is used in physical chemistry, petrology, mineralogy, metallurgy, and other physical sciences to show the compositions of systems composed of three species.
54+
In population genetics, a triangle plot of genotype frequencies is called a de Finetti diagram. In game theory, it is often called a simplex plot.
55+
56+
Ternary plots are tools for analyzing compositional data in the three-dimensional case.
57+
58+
## Ternary point charts
59+
60+
use `Chart.PointTernary` to create a ternary plot that displays points on a ternary coordinate system:
61+
*)
62+
63+
let ternaryPolar = Chart.PointTernary(a,b,c)
64+
(*** condition: ipynb ***)
65+
#if IPYNB
66+
ternaryPolar
67+
#endif // IPYNB
68+
69+
(***hide***)
70+
ternaryPolar |> GenericChart.toChartHTML
71+
(***include-it-raw***)
72+
73+
(**
74+
## Ternary line charts
75+
76+
use `Chart.LineTernary` to create a ternary plot that displays a line connecting input the data on a ternary coordinate system:
77+
78+
As values on ternary plots sum to a constant, you can omit one dimension ofd the data by providing that sum.
79+
80+
You can also for example change the line style using `Chart.withLineStyle`
81+
*)
82+
83+
let lineTernary =
84+
Chart.LineTernary(a,b,Sum = 10)
85+
|> Chart.withLineStyle(Color=Color.fromString "purple",Dash=StyleParam.DrawingStyle.DashDot)
86+
87+
(*** condition: ipynb ***)
88+
#if IPYNB
89+
lineTernary
90+
#endif // IPYNB
91+
92+
(***hide***)
93+
lineTernary |> GenericChart.toChartHTML
94+
(***include-it-raw***)

Diff for: docs/10_1_styling_ternary_layouts.fsx

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
(**
2+
---
3+
title: Styling ternary layouts
4+
category: Ternary Plots
5+
categoryindex: 9
6+
index: 3
7+
---
8+
*)
9+
10+
(*** hide ***)
11+
12+
(*** condition: prepare ***)
13+
#r "nuget: Newtonsoft.JSON, 12.0.3"
14+
#r "nuget: DynamicObj"
15+
#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
16+
17+
(*** condition: ipynb ***)
18+
#if IPYNB
19+
#r "nuget: Plotly.NET, {{fsdocs-package-version}}"
20+
#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}"
21+
#endif // IPYNB
22+
23+
(**
24+
# Styling ternary layouts
25+
26+
[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb) 
27+
[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx) 
28+
[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb)
29+
30+
*Summary:* This example shows how to style polar layouts in F#.
31+
32+
let's first create some data for the purpose of creating example charts:
33+
*)
34+
open Plotly.NET
35+
36+
// a coordinates
37+
let a = [ 1; 2; 3; 4; 5; 6; 7;]
38+
39+
// b coordinates
40+
let b = a |> List.rev
41+
42+
//c
43+
let c = [ 2; 2; 2; 2; 2; 2; 2;]
44+
45+
(**
46+
Consider this combined ternary chart:
47+
*)
48+
49+
let combinedTernary =
50+
[
51+
Chart.PointTernary(a,b,c)
52+
Chart.LineTernary(a,c,Sum = 10)
53+
]
54+
55+
|> Chart.combine
56+
57+
(*** condition: ipynb ***)
58+
#if IPYNB
59+
combinedTernary
60+
#endif // IPYNB
61+
62+
(***hide***)
63+
combinedTernary |> GenericChart.toChartHTML
64+
(***include-it-raw***)
65+
66+
(**
67+
## Styling the polar layout
68+
69+
Use the `Chart.withTernary` function and initialize a Ternary layout with the desired looks
70+
*)
71+
open Plotly.NET.LayoutObjects
72+
73+
let styledTernary =
74+
combinedTernary
75+
|> Chart.withTernary(
76+
Ternary.init(
77+
AAxis = LinearAxis.init(Title = Title.init("A"), Color = Color.fromKeyword ColorKeyword.DarkOrchid),
78+
BAxis = LinearAxis.init(Title = Title.init("B"), Color = Color.fromKeyword ColorKeyword.DarkRed)
79+
)
80+
)
81+
82+
(*** condition: ipynb ***)
83+
#if IPYNB
84+
styledTernary
85+
#endif // IPYNB
86+
87+
(***hide***)
88+
styledTernary |> GenericChart.toChartHTML
89+
(***include-it-raw***)
90+
91+
(**
92+
## Styling A, B, and C Axes
93+
94+
You could pass these axes to `Chart.withTernary` as above, but for the case where you want to specifically set one axis, there are the `Chart.withAAxis`, `Chart.withBAxis`, `Chart.withCAxis` functions:
95+
*)
96+
97+
let styledTernary2 =
98+
styledTernary
99+
|> Chart.withCAxis(LinearAxis.init(Title = Title.init("C"), Color = Color.fromKeyword ColorKeyword.DarkCyan))
100+
101+
102+
103+
(*** condition: ipynb ***)
104+
#if IPYNB
105+
styledTernary2
106+
#endif // IPYNB
107+
108+
(***hide***)
109+
styledTernary2 |> GenericChart.toChartHTML
110+
(***include-it-raw***)

Diff for: src/Plotly.NET/Playground.fsx

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ open Deedle
151151
open FSharpAux
152152

153153
open System
154+
open System.IO
154155

155156
Chart.ScatterTernary(
156157
A = [1; 2; 3],

0 commit comments

Comments
 (0)