@@ -15,7 +15,8 @@ index: 3
1515#r " nuget: Giraffe.ViewEngine, 1.4.0"
1616#r " ../src/Plotly.NET/bin/Release/netstandard2.0/Plotly.NET.dll"
1717
18- Plotly.NET.Defaults.DefaultDisplayOptions <- Plotly.NET.DisplayOptions.init( PlotlyJSReference = Plotly.NET.PlotlyJSReference.NoReference)
18+ Plotly.NET.Defaults.DefaultDisplayOptions <-
19+ Plotly.NET.DisplayOptions.init ( PlotlyJSReference = Plotly.NET.PlotlyJSReference.NoReference)
1920
2021
2122(* ** condition: ipynb ***)
@@ -41,10 +42,10 @@ let's first create some data for the purpose of creating example charts:
4142
4243*)
4344
44- open Plotly.NET
45-
46- let x = [ 1. ; 2. ; 3. ; 4. ; 5. ; 6. ; 7. ; 8. ; 9. ; 10. ; ]
47- let y = [ 2. ; 1.5 ; 5. ; 1.5 ; 3. ; 2.5 ; 2.5 ; 1.5 ; 3.5 ; 1. ]
45+ open Plotly.NET
46+
47+ let x = [ 1. ; 2. ; 3. ; 4. ; 5. ; 6. ; 7. ; 8. ; 9. ; 10. ]
48+ let y = [ 2. ; 1.5 ; 5. ; 1.5 ; 3. ; 2.5 ; 2.5 ; 1.5 ; 3.5 ; 1. ]
4849
4950(**
5051## Referencing PlotlyJS
@@ -64,9 +65,7 @@ You can control this on a per-chart basis via `Chart.withDisplayOptionsStyle`, f
6465
6566(* **do-not-eval***)
6667Chart.Point( x = x, y = y)
67- |> Chart.withDisplayOptionsStyle(
68- PlotlyJSReference = Full
69- )
68+ |> Chart.withDisplayOptionsStyle ( PlotlyJSReference = Full)
7069
7170
7271(**
@@ -80,19 +79,11 @@ For example, use `Chart.withDescription` to append a list of html tags below the
8079open Giraffe.ViewEngine
8180
8281let desc1 =
83- Chart.Point(
84- x = x,
85- y = y,
86- Name= " desc1"
87- )
88- |> Chart.withDescription [
89- h1 [] [ str " Hello" ]
90- p [] [ str " F#" ]
91- ol [] [
92- li [] [ str " Item 1" ]
93- li [] [ str " Item 2" ]
94- ]
95- ]
82+ Chart.Point( x = x, y = y, Name = " desc1" )
83+ |> Chart.withDescription
84+ [ h1 [] [ str " Hello" ]
85+ p [] [ str " F#" ]
86+ ol [] [ li [] [ str " Item 1" ]; li [] [ str " Item 2" ] ] ]
9687
9788
9889(* ** condition: ipynb ***)
@@ -115,28 +106,22 @@ For example, you can load external css libraries to style the chart description:
115106*)
116107
117108//html for description containing bulma classes such as "hero"
118- let bulmaHero =
119- section [_ class " hero is-primary is-bold " ] [
120- div [ _ class " hero-body " ] [
121- p [_ class " title " ] [ str " Hero title " ]
122- p [ _ class " subtitle " ] [ str " Hero subtitle " ]
123- ]
124- ]
109+ let bulmaHero =
110+ section
111+ [ _ class " hero is-primary is-bold " ]
112+ [ div
113+ [ _ class " hero-body " ]
114+ [ p [ _ class " title " ] [ str " Hero title " ]
115+ p [ _ class " subtitle " ] [ str " Hero subtitle " ] ] ]
125116// chart description containing bulma classes
126- let description3 = [
127- h1 [_ class " title" ] [ str " I am heading" ]
128- bulmaHero
129- ]
117+ let description3 = [ h1 [ _ class " title" ] [ str " I am heading" ]; bulmaHero ]
130118
131119let desc3 =
132- Chart.Point(
133- x = x,
134- y = y,
135- Name= " desc3"
136- )
137- |> Chart.withAdditionalHeadTags [
138- link [_ rel " stylesheet" ; _ href " https://cdn.jsdelivr.net/npm/bulma@0.9.2/css/bulma.min.css" ]
139- ]
120+ Chart.Point( x = x, y = y, Name = " desc3" )
121+ |> Chart.withAdditionalHeadTags
122+ [ link
123+ [ _ rel " stylesheet"
124+ _ href " https://cdn.jsdelivr.net/npm/bulma@0.9.2/css/bulma.min.css" ] ]
140125 |> Chart.withDescription description3
141126
142127(**
@@ -150,13 +135,11 @@ It will add a MathJax script reference to your document based on which version (
150135*)
151136
152137let mathtex_chart =
153- [
154- Chart.Point( xy = [( 1. , 2. )], Name = @" $\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$" )
155- Chart.Point( xy = [( 2. , 4. )], Name = @" $\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$" )
156- ]
138+ [ Chart.Point( xy = [ ( 1. , 2. ) ], Name = @" $\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$" )
139+ Chart.Point( xy = [ ( 2. , 4. ) ], Name = @" $\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$" ) ]
157140 |> Chart.combine
158141 |> Chart.withTitle @" $\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$"
159- |> Chart.withMathTex( AppendTags = true , MathJaxVersion = 3 )
142+ |> Chart.withMathTex ( AppendTags = true , MathJaxVersion = 3 )
160143
161144(* ** condition: ipynb ***)
162145#if IPYNB
@@ -166,4 +149,3 @@ mathtex_chart
166149(* **hide***)
167150mathtex_ chart |> GenericChart.toChartHTML
168151(* **include-it-raw***)
169-
0 commit comments