Skip to content

Commit 9a17149

Browse files
committed
Upgrade docs, prepare for migration to fslab template and fsdocs 8
1 parent ae66800 commit 9a17149

Some content is hidden

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

55 files changed

+10548
-1460
lines changed

.config/dotnet-tools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
"commands": [
1414
"paket"
1515
]
16+
},
17+
"fsharp.formatting.commandtool": {
18+
"version": "8.0.0",
19+
"commands": [
20+
"fsdocs"
21+
]
1622
}
1723
}
1824
}

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,10 @@ release.sh
179179
localpackages/
180180
paket-files
181181
*.orig
182-
docsrc/content/license.md
183-
docsrc/content/release-notes.md
184182
.fake
185-
docsrc/tools/FSharp.Formatting.svclog
186-
docs
187183
temp/gh-pages
188184
/src/FSharp.Plotly/TestScript.fsx
189185
/pkg
190186
.ionide/
187+
/.fsdocs
188+
/tmp/watch

docs/_template.html

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<title>{{fsdocs-page-title}}</title>
7+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8+
<meta name="author" content="{{fsdocs-authors}}">
9+
<link rel="shortcut icon" type="image/x-icon" href="{{root}}/img/favicon.ico">
10+
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
11+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
12+
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script> -->
13+
14+
<link type="text/css" rel="stylesheet" href="{{root}}content/fsdocs-default.css" />
15+
<link type="text/css" rel="stylesheet" href="{{root}}content/fsdocs-custom.css" />
16+
<script type="text/javascript" src="{{root}}content/fsdocs-tips.js"></script>
17+
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
18+
<!--[if lt IE 9]>
19+
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
20+
<![endif]-->
21+
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
22+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />
23+
<!-- END SEARCH BOX: this adds support for the search box -->
24+
{{fsdocs-watch-script}}
25+
</head>
26+
27+
<body>
28+
<div class="columns is-fullheight m-0">
29+
<div id="fsdocs-menu" class="column is-2 is-paddingless">
30+
<aside class="menu">
31+
<div class="container is-paddingless is-marginless has-background-dark">
32+
<a href="{{fsdocs-logo-link}}">
33+
<figure class="image is-128x128 container">
34+
<img src="{{fsdocs-logo-src}}">
35+
</figure>
36+
</a>
37+
<h2 class="title has-text-centered has-text-white pb-4">{{fsdocs-collection-name}}</h2>
38+
</div>
39+
<div class="content">
40+
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
41+
<div id="header">
42+
<div class="searchbox" id="fsdocs-searchbox">
43+
<label for="search-by">
44+
<i class="fas fa-search"></i>
45+
</label>
46+
<input data-search-input="" id="search-by" type="search" placeholder="Search..." class="input"/>
47+
<span data-search-clear="">
48+
<i class="fas fa-times"></i>
49+
</span>
50+
</div>
51+
</div>
52+
<!-- END SEARCH BOX: this adds support for the search box -->
53+
<ul class="navbar-nav">
54+
<li class="nav-header">Links</li>
55+
<li class="nav-item" id="fsdocs-license-link"><a class="nav-link" href="{{fsdocs-license-link}}">License (MIT)</a></li>
56+
<li class="nav-item" id="fsdocs-release-notes-link"><a class="nav-link" href="{{fsdocs-release-notes-link}}">Release Notes</a></li>
57+
<li class="nav-item" id="fsdocs-repository-link"><a class="nav-link" href="{{fsdocs-repository-link}}">Source Repository</a></li>
58+
{{fsdocs-list-of-documents}}
59+
{{fsdocs-list-of-namespaces}}
60+
</ul>
61+
</div>
62+
</aside>
63+
</div>
64+
<div class="column is-10 is-paddingless">
65+
<div class="section pt-4">
66+
<div class="container" id="fsdocs-content">
67+
{{fsdocs-content}}
68+
</div>
69+
</div>
70+
</div>
71+
{{fsdocs-tooltips}}
72+
</div>
73+
74+
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
75+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />
76+
<script type="text/javascript">var fsdocs_search_baseurl = '{{root}}'</script>
77+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.8/lunr.min.js"></script>
78+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.min.js"></script>
79+
<script type="text/javascript" src="{{root}}content/fsdocs-search.js"></script>
80+
<!-- END SEARCH BOX: this adds support for the search box -->
81+
</body>
82+
83+
</html>
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
(*** hide ***)
2-
#r "netstandard"
32
#r "../../packages/Newtonsoft.Json/lib/netstandard2.0/Newtonsoft.Json.dll"
4-
#r "../../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
5-
3+
#r "../../bin/Plotly.NET/net5.0/Plotly.NET.dll"
64

75

86
(**
9-
# Plotly.NET: Histogram2d
7+
# Histogram2D
108
119
*Summary:* This example shows how to create a bi-dimensional histogram of two data samples in F#.
1210
13-
A Histogram2d chart can be created using the `Chart.Histogram2d` or `Chart.Histogram2dContour` functions.
11+
let's first create some data for the purpose of creating example charts:
1412
*)
1513

1614
open Plotly.NET
1715

18-
// generate random normaly distributed data
16+
//---------------------- generate random normally distributed data ----------------------
1917
let normal (rnd:System.Random) mu tau =
2018
let mutable v1 = 2.0 * rnd.NextDouble() - 1.0
2119
let mutable v2 = 2.0 * rnd.NextDouble() - 1.0
@@ -27,39 +25,34 @@ let normal (rnd:System.Random) mu tau =
2725
let fac = sqrt(-2.0*(log r)/r)
2826
(tau * v1 * fac + mu)
2927

30-
31-
3228
let rnd = System.Random()
3329
let n = 2000
3430
let a = -1.
3531
let b = 1.2
3632
let step i = a + ((b - a) / float (n - 1)) * float i
3733

38-
// generate data disturbed in x and y direction
34+
//---------------------- generate data distributed in x and y direction ----------------------
3935
let x = Array.init n (fun i -> ((step i)**3.) + (0.3 * (normal (rnd) 0. 2.) ))
4036
let y = Array.init n (fun i -> ((step i)**6.) + (0.3 * (normal (rnd) 0. 2.) ))
4137

38+
(**
39+
A Histogram2d chart can be created using the `Chart.Histogram2d` or `Chart.Histogram2dContour` functions.
40+
*)
41+
4242
let histogramContour =
4343
[
4444
Chart.Histogram2dContour (x,y,Line=Line.init(Width=0))
4545
Chart.Point(x,y,Opacity=0.3)
4646
]
4747
|> Chart.Combine
4848

49-
(***do-not-eval***)
50-
histogramContour |> Chart.Show
51-
52-
(*** include-value:histogramContour ***)
49+
(***hide***)
50+
histogramContour |> GenericChart.toChartHTML
51+
(*** include-it-raw ***)
5352

5453
let histogram2d =
5554
Chart.Histogram2d (x,y)
5655

57-
(***do-not-eval***)
58-
histogram2d |> Chart.Show
59-
60-
(*** include-value:histogram2d ***)
61-
62-
63-
64-
65-
56+
(***hide***)
57+
histogram2d |> GenericChart.toChartHTML
58+
(*** include-it-raw ***)

docs/content/3d-line-plots.fsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
(*** hide ***)
2+
#r "../../bin/Plotly.NET/net5.0/Plotly.NET.dll"
3+
4+
(**
5+
# 3D line charts
6+
7+
*Summary:* This example shows how to create three-dimensional scatter charts in F#.
8+
9+
let's first create some data for the purpose of creating example charts:
10+
*)
11+
12+
open Plotly.NET
13+
open System
14+
15+
let c = [0. .. 0.5 .. 15.]
16+
17+
let x,y,z =
18+
c
19+
|> List.map (fun i ->
20+
let i' = float i
21+
let r = 10. * Math.Cos (i' / 10.)
22+
(r*Math.Cos i',r*Math.Sin i',i')
23+
)
24+
|> List.unzip3
25+
26+
(**
27+
A Scatter3 chart shows a three-dimensional spinnable view of your data.
28+
When using `Lines_Markers` as the mode of the chart, you additionally render a line between the points:
29+
*)
30+
31+
let scatter3dLine =
32+
Chart.Scatter3d(x,y,z,StyleParam.Mode.Lines_Markers)
33+
|> Chart.withX_AxisStyle("x-axis")
34+
|> Chart.withY_AxisStyle("y-axis")
35+
|> Chart.withZ_AxisStyle("z-axis")
36+
|> Chart.withSize(800.,800.)
37+
38+
(***hide***)
39+
scatter3dLine |> GenericChart.toChartHTML
40+
(*** include-it-raw ***)
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
(*** hide ***)
2-
#r "netstandard"
3-
#r "../../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
2+
#r "../../bin/Plotly.NET/net5.0/Plotly.NET.dll"
43

54

65
(**
7-
# Plotly.NET: Mesh3d
6+
# Mesh3d
87
98
*Summary:* This example shows how to create 3D-Mesh charts in F#.
109
10+
let's first create some data for the purpose of creating example charts:
1111
*)
1212

1313
open System
1414
open Plotly.NET
1515

1616

17-
// Generate linearly spaced vector
17+
//---------------------- Generate linearly spaced vector ----------------------
1818
let linspace (min,max,n) =
1919
if n <= 2 then failwithf "n needs to be larger then 2"
2020
let bw = float (max - min) / (float n - 1.)
2121
Array.init n (fun i -> min + (bw * float i))
2222
//[|min ..bw ..max|]
23-
2423

25-
// Create example data
24+
//---------------------- Create example data ----------------------
2625
let size = 100
2726
let x = linspace(-2. * Math.PI, 2. * Math.PI, size)
2827
let y = linspace(-2. * Math.PI, 2. * Math.PI, size)
@@ -31,19 +30,16 @@ let f x y = - (5. * x / (x**2. + y**2. + 1.) )
3130

3231
let z =
3332
Array.init size (fun i ->
34-
Array.init size (fun j -> f x.[j] y.[i] )
35-
)
33+
Array.init size (fun j ->
34+
f x.[j] y.[i]
35+
)
36+
)
3637

3738
let rnd = System.Random()
3839
let a = Array.init 50 (fun _ -> rnd.NextDouble())
3940
let b = Array.init 50 (fun _ -> rnd.NextDouble())
4041
let c = Array.init 50 (fun _ -> rnd.NextDouble())
4142

42-
let cont = DynamicObj()
43-
//cont?color <- ""
44-
cont?show <- true
45-
cont?width <- 3
46-
4743

4844
let mesh3d =
4945
Trace3d.initMesh3d
@@ -57,7 +53,6 @@ let mesh3d =
5753
)
5854
|> GenericChart.ofTraceObject
5955

60-
(***do-not-eval***)
61-
mesh3d |> Chart.Show
62-
63-
(*** include-value:mesh3d ***)
56+
(***hide***)
57+
mesh3d |> GenericChart.toChartHTML
58+
(*** include-it-raw ***)
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
(*** hide ***)
2-
#r "netstandard"
3-
#r "../../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
2+
#r "../../bin/Plotly.NET/net5.0/Plotly.NET.dll"
43

54
(**
6-
# Plotly.NET: Scatter3d Charts
5+
# Scatter3d charts
76
87
*Summary:* This example shows how to create three-dimensional scatter charts in F#.
98
@@ -16,18 +15,16 @@ let x = [19; 26; 55;]
1615
let y = [19; 26; 55;]
1716
let z = [19; 26; 55;]
1817

19-
2018
let scatter3d =
2119
Chart.Scatter3d(x,y,z,StyleParam.Mode.Markers)
2220
|> Chart.withX_AxisStyle("my x-axis")
2321
|> Chart.withY_AxisStyle("my y-axis")
2422
|> Chart.withZ_AxisStyle("my z-axis")
2523
|> Chart.withSize(800.,800.)
2624

27-
(***do-not-eval***)
28-
scatter3d |> Chart.Show
29-
30-
(*** include-value:scatter3d ***)
25+
(***hide***)
26+
scatter3d |> GenericChart.toChartHTML
27+
(*** include-it-raw ***)
3128

3229

3330

0 commit comments

Comments
 (0)