diff --git a/.github/workflows/verify-docs.yml b/.github/workflows/verify-docs.yml new file mode 100644 index 000000000..3d76b2418 --- /dev/null +++ b/.github/workflows/verify-docs.yml @@ -0,0 +1,25 @@ +name: Verify docs + +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] + +jobs: + verify-docs: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET 5 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '5.0.302' + + - name: Run verification script + run: | + dotnet tool restore + dotnet fake build -t verifydocs diff --git a/build.fsx b/build.fsx index d5c920c7a..cc292d27d 100644 --- a/build.fsx +++ b/build.fsx @@ -15,6 +15,8 @@ nuget Fake.Api.Github nuget Fake.DotNet.Testing.Expecto nuget Fake.Tools.Git //" +#r "FSharp.Compiler.Service.dll" + #if !FAKE #load "./.fake/build.fsx/intellisense.fsx" #r "netstandard" // Temp fix for https://github.com/dotnet/fsharp/issues/5216 @@ -168,6 +170,44 @@ module TestTasks = ) testProject } + +module VerificationTasks = + open FSharp.Compiler.Diagnostics + open BasicTasks + + let verifyDocs = BuildTask.create "VerifyDocs" [clean; build; copyBinaries] { + let targets = !! "docs/**.fsx" |> Seq.map (fun f -> f.ToString()) + + let checker = FSharp.Compiler.CodeAnalysis.FSharpChecker.Create () + + let ignoredDiagnostics = Set.ofList [ + 1182; // unused variable + ] + + targets + |> Seq.map ( + fun target -> + checker.Compile ( [| "fsc.exe"; "-o"; @"aaaaaaaaaaa.exe"; "-a"; target |] ) + |> Async.RunSynchronously + |> fst + |> Seq.where (fun diag -> match diag.Severity with FSharpDiagnosticSeverity.Error | FSharpDiagnosticSeverity.Warning -> true | _ -> false) + ) + |> Seq.collect id + |> Seq.where (fun c -> not (ignoredDiagnostics.Contains c.ErrorNumber)) + |> Seq.sortBy (fun diag -> (match diag.Severity with FSharpDiagnosticSeverity.Error -> 0 | _ -> 1), diag.FileName.[..6] (* to only count the numeric part *) ) + |> Seq.map (fun diag -> + (match diag.Severity with + | FSharpDiagnosticSeverity.Error -> "--- Error: " + | _ -> "--- Warning: ") + + diag.ToString()) + |> String.concat "\n" + |> (fun errorText -> + match errorText with + | "" -> () + | text -> raise (System.Exception $"Errors:\n{text}" ) + ) + } + /// Package creation module PackageTasks = @@ -404,4 +444,4 @@ let _preReleaseNoDocs = [setPrereleaseTag; clean; build; copyBinaries; runTests; packPrerelease; createPrereleaseTag; publishNugetPrerelease] // run copyBinaries by default -BuildTask.runOrDefault copyBinaries \ No newline at end of file +BuildTask.runOrDefault copyBinaries diff --git a/docs/0_0_basics.fsx b/docs/0_0_basics.fsx index d5cf251db..c2eb28b29 100644 --- a/docs/0_0_basics.fsx +++ b/docs/0_0_basics.fsx @@ -47,6 +47,7 @@ The central type that gets created by all Chart constructors is `GenericChart`, *) (***do-not-eval***) +[] type GenericChart = | Chart of Trace * Layout * Config * DisplayOptions | MultiChart of Trace list * Layout * Config * DisplayOptions @@ -75,7 +76,7 @@ myTrace?x <- [0;1;2] // set the x property (the x dimension of the data) myTrace?y <- [0;1;2] // set the y property (the y dimension of the data) GenericChart.ofTraceObject myTrace // create a generic chart (layout and config are empty objects) -|> Chart.Show +|> Chart.show (** lets have a look at the trace object that will be created. The relevant section of the html generated with Chart.Show is the following: diff --git a/docs/0_2_display-options.fsx b/docs/0_2_display-options.fsx index 77706c94b..78b115fd8 100644 --- a/docs/0_2_display-options.fsx +++ b/docs/0_2_display-options.fsx @@ -55,8 +55,8 @@ let description1 = (***do-not-eval***) let desc1 = Chart.Point(x,y,Name="desc1") - |> Chart.WithDescription(description1) - |> Chart.Show + |> Chart.withDescription(description1) + |> Chart.show (** @@ -71,8 +71,8 @@ let description2 = (***do-not-eval***) let desc2 = Chart.Point(x,y,Name="desc1") - |> Chart.WithDescription(description2) - |> Chart.Show + |> Chart.withDescription(description2) + |> Chart.show (** @@ -108,10 +108,10 @@ let description3 = (***do-not-eval***) let desc3 = Chart.Point(x,y,Name="desc3") - |> Chart.WithDescription description3 + |> Chart.withDescription description3 // Add reference to the bulma css framework - |> Chart.WithAdditionalHeadTags [""""""] - |> Chart.Show + |> Chart.withAdditionalHeadTags [""""""] + |> Chart.show (** @@ -128,11 +128,11 @@ By popular request, `Chart.WithMathTex` is a prebuilt function to enable MathTeX Chart.Point([(1.,2.)],@"$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$") Chart.Point([(2.,4.)],@"$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$") ] -|> Chart.Combine +|> Chart.combine |> Chart.withTitle @"$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$" // include mathtex tags in . pass true to append these scripts, false to ONLY include MathTeX. -|> Chart.WithMathTex(true) -|> Chart.Show +|> Chart.withMathTex(true) +|> Chart.show (** diff --git a/docs/1_0_axis-styling.fsx b/docs/1_0_axis-styling.fsx index 2de6bfd58..34cb4e2ad 100644 --- a/docs/1_0_axis-styling.fsx +++ b/docs/1_0_axis-styling.fsx @@ -45,8 +45,8 @@ To style a specific axis of a plot, use the respective `Chart.with*_AxisStyle` f let plot1 = Chart.Point(x,y) - |> Chart.withX_AxisStyle ("X axis title", MinMax = (-1.,10.)) - |> Chart.withY_AxisStyle ("Y axis title", MinMax = (-1.,10.)) + |> Chart.withXAxisStyle ("X axis title", MinMax = (-1.,10.)) + |> Chart.withYAxisStyle ("Y axis title", MinMax = (-1.,10.)) (*** condition: ipynb ***) #if IPYNB @@ -83,8 +83,8 @@ let mirroredLogYAxis = let plot2 = Chart.Point(x,y) - |> Chart.withX_Axis mirroredXAxis - |> Chart.withY_Axis mirroredLogYAxis + |> Chart.withXAxis mirroredXAxis + |> Chart.withYAxis mirroredLogYAxis (*** condition: ipynb ***) #if IPYNB @@ -122,13 +122,13 @@ let twoXAxes1 = anchoredAt1 anchoredAt2 ] - |> Chart.Combine - |> Chart.withY_AxisStyle( + |> Chart.combine + |> Chart.withYAxisStyle( "axis 1", Side=StyleParam.Side.Left, Id=1 ) - |> Chart.withY_AxisStyle( + |> Chart.withYAxisStyle( "axis2", Side=StyleParam.Side.Right, Id=2, @@ -156,16 +156,16 @@ let twoXAxes2 = anchoredAt1 anchoredAt2 ] - |> Chart.Combine - |> Chart.withY_AxisStyle( + |> Chart.combine + |> Chart.withYAxisStyle( "first y-axis", ShowLine=true ) - |> Chart.withX_AxisStyle( + |> Chart.withXAxisStyle( "x-axis", Domain=(0.3, 1.0) // moves the first axis and the whole plot to the right ) - |> Chart.withY_AxisStyle( + |> Chart.withYAxisStyle( "second y-axis", Side=StyleParam.Side.Left, Id=2, diff --git a/docs/1_2_multiple-charts.fsx b/docs/1_2_multiple-charts.fsx index 776532a7c..885e983dc 100644 --- a/docs/1_2_multiple-charts.fsx +++ b/docs/1_2_multiple-charts.fsx @@ -52,7 +52,7 @@ let combinedChart = Chart.Line(x,y,Name="first") Chart.Line(y,x,Name="second") ] - |> Chart.Combine + |> Chart.combine #if IPYNB combinedChart @@ -77,17 +77,17 @@ You can either use Chart.Grid with a 1 dimensional sequence of Charts and specif let grid = [ Chart.Point(x,y,Name="1,1") - |> Chart.withX_AxisStyle "x1" - |> Chart.withY_AxisStyle "y1" + |> Chart.withXAxisStyle "x1" + |> Chart.withYAxisStyle "y1" Chart.Line(x,y,Name="1,2") - |> Chart.withX_AxisStyle "x2" - |> Chart.withY_AxisStyle "y2" + |> Chart.withXAxisStyle "x2" + |> Chart.withYAxisStyle "y2" Chart.Spline(x,y,Name="2,1") - |> Chart.withX_AxisStyle "x3" - |> Chart.withY_AxisStyle "y3" + |> Chart.withXAxisStyle "x3" + |> Chart.withYAxisStyle "y3" Chart.Point(x,y,Name="2,2") - |> Chart.withX_AxisStyle "x4" - |> Chart.withY_AxisStyle "y4" + |> Chart.withXAxisStyle "x4" + |> Chart.withYAxisStyle "y4" ] |> Chart.Grid(2,2) @@ -109,19 +109,19 @@ let grid2 = [ [ Chart.Point(x,y,Name="1,1") - |> Chart.withX_AxisStyle "x1" - |> Chart.withY_AxisStyle "y1" + |> Chart.withXAxisStyle "x1" + |> Chart.withYAxisStyle "y1" Chart.Line(x,y,Name="1,2") - |> Chart.withX_AxisStyle "x2" - |> Chart.withY_AxisStyle "y2" + |> Chart.withXAxisStyle "x2" + |> Chart.withYAxisStyle "y2" ] [ Chart.Spline(x,y,Name="2,1") - |> Chart.withX_AxisStyle "x3" - |> Chart.withY_AxisStyle "y3" + |> Chart.withXAxisStyle "x3" + |> Chart.withYAxisStyle "y3" Chart.Point(x,y,Name="2,2") - |> Chart.withX_AxisStyle "x4" - |> Chart.withY_AxisStyle "y4" + |> Chart.withXAxisStyle "x4" + |> Chart.withYAxisStyle "y4" ] ] @@ -146,18 +146,18 @@ to the row with the highest amount of charts, and the other rows will be filled let grid3 = [ Chart.Point(x,y,Name="1,1") - |> Chart.withX_AxisStyle "x1" - |> Chart.withY_AxisStyle "y1" + |> Chart.withXAxisStyle "x1" + |> Chart.withYAxisStyle "y1" Chart.Invisible() Chart.Spline(x,y,Name="2,1") - |> Chart.withX_AxisStyle "x3" - |> Chart.withY_AxisStyle "y3" + |> Chart.withXAxisStyle "x3" + |> Chart.withYAxisStyle "y3" Chart.Point(x,y,Name="2,2") - |> Chart.withX_AxisStyle "x4" - |> Chart.withY_AxisStyle "y4" + |> Chart.withXAxisStyle "x4" + |> Chart.withYAxisStyle "y4" ] |> Chart.Grid(2,2) @@ -178,17 +178,17 @@ use `Pattern=StyleParam.LayoutGridPatter.Coupled` to use one shared x axis per c let grid4 = [ Chart.Point(x,y,Name="1,1") - |> Chart.withX_AxisStyle "x1" - |> Chart.withY_AxisStyle "y1" + |> Chart.withXAxisStyle "x1" + |> Chart.withYAxisStyle "y1" Chart.Line(x,y,Name="1,2") - |> Chart.withX_AxisStyle "x2" - |> Chart.withY_AxisStyle "y2" + |> Chart.withXAxisStyle "x2" + |> Chart.withYAxisStyle "y2" Chart.Spline(x,y,Name="2,1") - |> Chart.withX_AxisStyle "x3" - |> Chart.withY_AxisStyle "y3" + |> Chart.withXAxisStyle "x3" + |> Chart.withYAxisStyle "y3" Chart.Point(x,y,Name="2,2") - |> Chart.withX_AxisStyle "x4" - |> Chart.withY_AxisStyle "y4" + |> Chart.withXAxisStyle "x4" + |> Chart.withYAxisStyle "y4" ] |> Chart.Grid(2,2,Pattern=StyleParam.LayoutGridPattern.Coupled) @@ -214,19 +214,19 @@ As with all grid charts, you can also use the Chart.withLayoutGridStyle to style let singleStack = [ Chart.Point(x,y) - |> Chart.withY_AxisStyle("This title must") + |> Chart.withYAxisStyle("This title must") Chart.Line(x,y) - |> Chart.withY_AxisStyle("be set on the") + |> Chart.withYAxisStyle("be set on the") Chart.Spline(x,y) - |> Chart.withY_AxisStyle("respective subplots") + |> Chart.withYAxisStyle("respective subplots") ] |> Chart.SingleStack(Pattern= StyleParam.LayoutGridPattern.Coupled) //increase spacing between plots by using the withLayoutGridStyle function |> Chart.withLayoutGridStyle(YGap= 0.1) |> Chart.withTitle("Hi i am the new SingleStackChart") - |> Chart.withX_AxisStyle("im the shared xAxis") + |> Chart.withXAxisStyle("im the shared xAxis") (*** condition: ipynb ***) #if IPYNB diff --git a/docs/2_1_bar-and-column-charts.fsx b/docs/2_1_bar-and-column-charts.fsx index 1fa4ce55b..9be59b3a2 100644 --- a/docs/2_1_bar-and-column-charts.fsx +++ b/docs/2_1_bar-and-column-charts.fsx @@ -84,7 +84,7 @@ let stackedBar = Chart.StackedBar(keys,values,Name="old"); Chart.StackedBar(keys,[8; 21; 13;],Name="new") ] - |> Chart.Combine + |> Chart.combine (*** condition: ipynb ***) #if IPYNB @@ -104,7 +104,7 @@ let stackedColumn = Chart.StackedColumn(keys,values,Name="old"); Chart.StackedColumn(keys,[8; 21; 13;],Name="new") ] - |> Chart.Combine + |> Chart.combine (*** condition: ipynb ***) #if IPYNB diff --git a/docs/2_2_area-plots.fsx b/docs/2_2_area-plots.fsx index 21be24073..54d095745 100644 --- a/docs/2_2_area-plots.fsx +++ b/docs/2_2_area-plots.fsx @@ -80,7 +80,7 @@ let stackedArea = Chart.StackedArea(x,y) Chart.StackedArea(x,y |> Seq.rev) ] - |> Chart.Combine + |> Chart.combine (*** condition: ipynb ***) #if IPYNB diff --git a/docs/3_0_3d-scatter-plots.fsx b/docs/3_0_3d-scatter-plots.fsx index 89c7cd0f8..4912489c6 100644 --- a/docs/3_0_3d-scatter-plots.fsx +++ b/docs/3_0_3d-scatter-plots.fsx @@ -40,9 +40,9 @@ let z = [19; 26; 55;] let scatter3d = Chart.Scatter3d(x,y,z,StyleParam.Mode.Markers) - |> Chart.withX_AxisStyle("my x-axis") - |> Chart.withY_AxisStyle("my y-axis") - |> Chart.withZ_AxisStyle("my z-axis") + |> Chart.withXAxisStyle("my x-axis") + |> Chart.withYAxisStyle("my y-axis") + |> Chart.withZAxisStyle("my z-axis") |> Chart.withSize(800.,800.) (*** condition: ipynb ***) diff --git a/docs/3_1_3d-line-plots.fsx b/docs/3_1_3d-line-plots.fsx index 034bbbe60..ee7620845 100644 --- a/docs/3_1_3d-line-plots.fsx +++ b/docs/3_1_3d-line-plots.fsx @@ -52,9 +52,9 @@ When using `Lines_Markers` as the mode of the chart, you additionally render a l let scatter3dLine = Chart.Scatter3d(x,y,z,StyleParam.Mode.Lines_Markers) - |> Chart.withX_AxisStyle("x-axis") - |> Chart.withY_AxisStyle("y-axis") - |> Chart.withZ_AxisStyle("z-axis") + |> Chart.withXAxisStyle("x-axis") + |> Chart.withYAxisStyle("y-axis") + |> Chart.withZAxisStyle("z-axis") |> Chart.withSize(800.,800.) (*** condition: ipynb ***) diff --git a/docs/4_1_box-plots.fsx b/docs/4_1_box-plots.fsx index b695dbcab..fb73b58f5 100644 --- a/docs/4_1_box-plots.fsx +++ b/docs/4_1_box-plots.fsx @@ -81,7 +81,7 @@ let box3 = Chart.BoxPlot("y" ,y,Name="bin1",Jitter=0.1,Boxpoints=StyleParam.Boxpoints.All); Chart.BoxPlot("y'",y',Name="bin2",Jitter=0.1,Boxpoints=StyleParam.Boxpoints.All); ] - |> Chart.Combine + |> Chart.combine (*** condition: ipynb ***) #if IPYNB diff --git a/docs/4_2_violin-plots.fsx b/docs/4_2_violin-plots.fsx index e5c08ecae..13b22d1f3 100644 --- a/docs/4_2_violin-plots.fsx +++ b/docs/4_2_violin-plots.fsx @@ -90,7 +90,7 @@ let violin3 = Chart.Violin ("y" ,y,Name="bin1",Jitter=0.1,Points=StyleParam.Jitterpoints.All); Chart.Violin ("y'",y',Name="bin2",Jitter=0.1,Points=StyleParam.Jitterpoints.All); ] - |> Chart.Combine + |> Chart.combine (*** condition: ipynb ***) #if IPYNB diff --git a/docs/4_4_2d-histograms.fsx b/docs/4_4_2d-histograms.fsx index 8d2e2f125..b2a810392 100644 --- a/docs/4_4_2d-histograms.fsx +++ b/docs/4_4_2d-histograms.fsx @@ -64,7 +64,7 @@ let histogramContour = Chart.Histogram2dContour (x,y,Line=Line.init(Width=0.)) Chart.Point(x,y,Opacity=0.3) ] - |> Chart.Combine + |> Chart.combine (*** condition: ipynb ***) #if IPYNB diff --git a/docs/5_1_geo-plots.fsx b/docs/5_1_geo-plots.fsx index d068a990a..c1df1f873 100644 --- a/docs/5_1_geo-plots.fsx +++ b/docs/5_1_geo-plots.fsx @@ -106,7 +106,7 @@ let flights = Color = "red" ) ) - |> Chart.Combine + |> Chart.combine |> Chart.withLegend(false) |> Chart.withMapStyle( Scope=StyleParam.GeoScope.NorthAmerica, diff --git a/docs/6_1_mapbox-plots.fsx b/docs/6_1_mapbox-plots.fsx index 1c2cffee8..9683bfa7a 100644 --- a/docs/6_1_mapbox-plots.fsx +++ b/docs/6_1_mapbox-plots.fsx @@ -104,7 +104,7 @@ let flights = Color = "red" ) ) - |> Chart.Combine + |> Chart.combine |> Chart.withLegend(false) |> Chart.withMapbox( Mapbox.init( diff --git a/docs/7_0_candlestick.fsx b/docs/7_0_candlestick.fsx index d0a9f4365..9c65e3281 100644 --- a/docs/7_0_candlestick.fsx +++ b/docs/7_0_candlestick.fsx @@ -65,13 +65,13 @@ candles1 |> GenericChart.toChartHTML (***include-it-raw***) (** -If you want to hide the rangeslider, use `withX_AxisRangeSlider` and hide it: +If you want to hide the rangeslider, use `withXAxisRangeSlider` and hide it: *) let rangeslider = RangeSlider.init(Visible=false) let candles2 = Chart.Candlestick candles - |> Chart.withX_AxisRangeSlider rangeslider + |> Chart.withXAxisRangeSlider rangeslider (*** condition: ipynb ***) #if IPYNB diff --git a/docs/8_1_polar_bar_charts.fsx b/docs/8_1_polar_bar_charts.fsx index f3a489064..75ddca28a 100644 --- a/docs/8_1_polar_bar_charts.fsx +++ b/docs/8_1_polar_bar_charts.fsx @@ -57,7 +57,7 @@ let windrose1 = Chart.BarPolar (r3, t, Name="5-8 m/s") Chart.BarPolar (r4, t, Name="< 5 m/s") ] - |> Chart.Combine + |> Chart.combine |> Chart.withAngularAxis( Axis.AngularAxis.init( CategoryOrder = StyleParam.CategoryOrder.Array, diff --git a/docs/8_2_styling_polar_layouts.fsx b/docs/8_2_styling_polar_layouts.fsx index 1a5d969e4..496e87dc9 100644 --- a/docs/8_2_styling_polar_layouts.fsx +++ b/docs/8_2_styling_polar_layouts.fsx @@ -48,7 +48,8 @@ let combinedPolar = Chart.LinePolar(r2,t,Name="LinePolar", ShowMarkers = true) Chart.SplinePolar(r3,t,Name="SplinePolar", ShowMarkers = true) ] - |> Chart.Combine + + |> Chart.combine (*** condition: ipynb ***) #if IPYNB diff --git a/docs/index.fsx b/docs/index.fsx index 1bf696dc9..56be308d0 100644 --- a/docs/index.fsx +++ b/docs/index.fsx @@ -138,16 +138,16 @@ let myFirstChart = Chart.Point(xData,yData) Styling functions are generally the `Chart.with*` naming convention. The following styling example does: - set the chart title via `Chart.withTitle` - - set the x axis title and removes the gridline from the axis via `Chart.withX_AxisStyle` - - set the y axis title and removes the gridline from the axis via `Chart.withY_AxisStyle` + - set the x axis title and removes the gridline from the axis via `Chart.withXAxisStyle` + - set the y axis title and removes the gridline from the axis via `Chart.withYAxisStyle` *) let myFirstStyledChart = Chart.Point(xData,yData) |> Chart.withTitle "Hello world!" - |> Chart.withX_AxisStyle ("xAxis", Showgrid=false) - |> Chart.withY_AxisStyle ("yAxis", Showgrid=false) + |> Chart.withXAxisStyle ("xAxis", ShowGrid=false) + |> Chart.withYAxisStyle ("yAxis", ShowGrid=false) (** **Attention:** Styling functions mutate 😈 the input chart, therefore possibly affecting bindings to intermediary results. @@ -162,7 +162,7 @@ The `Chart.Show` function will open a browser window and render the input chart (***do-not-eval***) myFirstChart -|> Chart.Show +|> Chart.show (**Should render this chart in your brower:*) @@ -172,7 +172,7 @@ myFirstChart |> GenericChart.toChartHTML (***do-not-eval***) myFirstStyledChart -|> Chart.Show +|> Chart.show (**And here is what happened after applying the styles from above:*) @@ -196,8 +196,8 @@ Chart.Point(xData',yData') Chart.Point(xData,yData) |> Chart.withTitle "Hello world!" -|> Chart.withX_AxisStyle ("xAxis", Showgrid=false) -|> Chart.withY_AxisStyle ("yAxis", Showgrid=false) +|> Chart.withXAxisStyle ("xAxis", ShowGrid=false) +|> Chart.withYAxisStyle ("yAxis", ShowGrid=false) (** @@ -211,8 +211,8 @@ One of the main design points of Plotly.NET it is to provide support for multipl [(1,5);(2,10)] |> Chart.Point |> Chart.withTraceName("Hello from F#",Showlegend=true) -|> Chart.withY_AxisStyle("xAxis",Showgrid= false, Showline=true) -|> Chart.withX_AxisStyle("yAxis",Showgrid= false, Showline=true) +|> Chart.withYAxisStyle("xAxis",ShowGrid= false, ShowLine=true) +|> Chart.withXAxisStyle("yAxis",ShowGrid= false, ShowLine=true) (** ### Fluent interface style in C#: @@ -225,8 +225,8 @@ static void Main(string[] args) GenericChart.GenericChart chart = Chart.Point(x: x, y: y); chart .WithTraceName("Hello from C#", true) - .WithX_AxisStyle(title: "xAxis", Showgrid: false, Showline: true) - .WithY_AxisStyle(title: "yAxis", Showgrid: false, Showline: true) + .withXAxisStyle(title: "xAxis", Showgrid: false, Showline: true) + .withYAxisStyle(title: "yAxis", Showgrid: false, Showline: true) .Show(); } ``` diff --git a/src/Plotly.NET/ChartExtensions.fs b/src/Plotly.NET/ChartExtensions.fs index 7987f6f41..60997598e 100644 --- a/src/Plotly.NET/ChartExtensions.fs +++ b/src/Plotly.NET/ChartExtensions.fs @@ -188,9 +188,14 @@ module ChartExtensions = // ############################################################ // ####################### Apply to layout - // Sets x-Axis of 2d and 3d- Charts + [] [] - static member withX_Axis(xAxis:Axis.LinearAxis,[] ?Id) = + static member withX_Axis(xAxis:Axis.LinearAxis,[] ?Id : int) = + Chart.withXAxis(xAxis, ?Id = Id) + + // Sets x-Axis of 2d and 3d- Charts + [] + static member withXAxis(xAxis:Axis.LinearAxis,[] ?Id) = (fun (ch:GenericChart) -> let contains3d = ch @@ -214,7 +219,7 @@ module ChartExtensions = ) - // Sets x-Axis of 2d and 3d- Charts + [] [] static member withX_AxisStyle(title, [] ?TitleFont, @@ -228,22 +233,61 @@ module ChartExtensions = [] ?Position, [] ?Zeroline, [] ?Anchor) = + Chart.withXAxisStyle(title, + ?TitleFont = TitleFont, + ?MinMax = MinMax, + ?ShowGrid = ShowGrid, + ?ShowLine = ShowLine, + ?Side = Side, + ?Overlaying = Overlaying, + ?Id = Id, + ?Domain = Domain, + ?Position = Position, + ?Zeroline = Zeroline, + ?Anchor = Anchor) + + + // Sets x-Axis of 2d and 3d- Charts + [] + static member withXAxisStyle(title, + [] ?TitleFont, + [] ?MinMax, + [] ?ShowGrid, + [] ?ShowLine, + [] ?Side, + [] ?Overlaying, + [] ?Id, + [] ?Domain, + [] ?Position, + [] ?Zeroline, + [] ?Anchor) = let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None let xaxis = Axis.LinearAxis.init(Title=Title.init(Text=title, ?Font=TitleFont),?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine, ?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=Zeroline) - Chart.withX_Axis(xaxis,?Id=Id) + Chart.withXAxis(xaxis,?Id=Id) - /// Sets the range slider for the xAxis + [] [] static member withX_AxisRangeSlider(rangeSlider:RangeSlider, [] ?Id) = + Chart.withXAxisRangeSlider(rangeSlider, ?Id = Id) + + /// Sets the range slider for the xAxis + [] + static member withXAxisRangeSlider(rangeSlider:RangeSlider, + [] ?Id) = let xaxis = Axis.LinearAxis.init(RangeSlider = rangeSlider) - Chart.withX_Axis(xaxis,?Id=Id) + Chart.withXAxis(xaxis,?Id=Id) - // Sets y-Axis of 2d and 3d- Charts + [] [] - static member withY_Axis(yAxis:Axis.LinearAxis,[] ?Id) = + static member withY_Axis(yAxis:Axis.LinearAxis,[] ?Id : int) = + Chart.withYAxis(yAxis, ?Id = Id) + + // Sets y-Axis of 2d and 3d- Charts + [] + static member withYAxis(yAxis:Axis.LinearAxis,[] ?Id) = (fun (ch:GenericChart) -> let contains3d = ch @@ -267,7 +311,7 @@ module ChartExtensions = ) - // Sets y-Axis of 3d- Charts + [] [] static member withY_AxisStyle(title, [] ?TitleFont, @@ -281,16 +325,47 @@ module ChartExtensions = [] ?Position, [] ?ZeroLine, [] ?Anchor) = + Chart.withYAxisStyle(title, + ?MinMax = MinMax, + ?ShowGrid = ShowGrid, + ?ShowLine = ShowLine, + ?Side = Side, + ?Overlaying = Overlaying, + ?Id = Id, + ?Domain = Domain, + ?Position = Position, + ?ZeroLine = ZeroLine, + ?Anchor = Anchor) + + // Sets y-Axis of 3d- Charts + [] + static member withYAxisStyle(title, + [] ?TitleFont, + [] ?MinMax, + [] ?ShowGrid, + [] ?ShowLine, + [] ?Side, + [] ?Overlaying, + [] ?Id, + [] ?Domain, + [] ?Position, + [] ?ZeroLine, + [] ?Anchor) = let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None let yaxis = Axis.LinearAxis.init(Title=Title.init(Text=title, ?Font=TitleFont),?Range=range,?ShowGrid=ShowGrid, ?ShowLine=ShowLine,?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=ZeroLine) - Chart.withY_Axis(yaxis,?Id=Id) + Chart.withYAxis(yaxis,?Id=Id) - // Sets z-Axis of 3d- Charts + [] [] - static member withZ_Axis(zAxis:Axis.LinearAxis) = + static member withZ_Axis(xAxis:Axis.LinearAxis) = + Chart.withZAxis xAxis + + // Sets z-Axis of 3d- Charts + [] + static member withZAxis(zAxis:Axis.LinearAxis) = (fun (ch:GenericChart) -> let layout = Layout() @@ -299,9 +374,27 @@ module ChartExtensions = ) - // Sets z-Axis style with ... + + [] [] static member withZ_AxisStyle(title, + [] ?TitleFont, + [] ?MinMax, + [] ?ShowGrid, + [] ?ShowLine, + [] ?Domain, + [] ?Anchor) = + Chart.withZAxisStyle(title, + ?MinMax = MinMax, + ?ShowGrid = ShowGrid, + ?ShowLine = ShowLine, + ?Domain = Domain, + ?Anchor = Anchor) + + + // Sets z-Axis style with ... + [] + static member withZAxisStyle(title, [] ?TitleFont, [] ?MinMax, [] ?ShowGrid, @@ -737,7 +830,7 @@ module ChartExtensions = // ####################### /// Create a combined chart with the given charts merged [] - static member Combine(gCharts:seq) = + static member combine(gCharts:seq) = GenericChart.combine gCharts /// @@ -810,8 +903,8 @@ module ChartExtensions = gChart |> Chart.withAxisAnchor(xAnchor,yAnchor) // set adapted axis anchors - |> Chart.withX_Axis(xAxis,i+1) // set previous axis with adapted id (one individual axis for each subplot, wether or not they will be used later) - |> Chart.withY_Axis(yAxis,i+1) // set previous axis with adapted id (one individual axis for each subplot, wether or not they will be used later) + |> Chart.withXAxis(xAxis,i+1) // set previous axis with adapted id (one individual axis for each subplot, wether or not they will be used later) + |> Chart.withYAxis(yAxis,i+1) // set previous axis with adapted id (one individual axis for each subplot, wether or not they will be used later) |> GenericChart.mapLayout (fun l -> if i > 0 then // remove default axes from consecutive charts, otherwise they will override the first one @@ -820,7 +913,7 @@ module ChartExtensions = l ) ) - |> Chart.Combine + |> Chart.combine |> Chart.withLayoutGrid ( LayoutGrid.init( Rows = nRows, @@ -1061,11 +1154,11 @@ module ChartExtensions = ch |> GenericChart.setLayout layout |> Chart.withAxisAnchor(X=index,Y=index) - |> Chart.withX_Axis(xaxis,index) - |> Chart.withY_Axis(yaxis,index) + |> Chart.withXAxis(xaxis,index) + |> Chart.withYAxis(yaxis,index) ) - |> Chart.Combine + |> Chart.combine ) // ############################################################ @@ -1073,14 +1166,14 @@ module ChartExtensions = /// Show chart in browser [] - static member WithDescription (description:ChartDescription) (ch:GenericChart) = + static member withDescription (description:ChartDescription) (ch:GenericChart) = ch |> mapDisplayOptions (DisplayOptions.style(Description=description)) /// Adds the given additional html tags on the chart's DisplayOptions. They will be included in the document's [] - static member WithAdditionalHeadTags (additionalHeadTags:seq) (ch:GenericChart) = + static member withAdditionalHeadTags (additionalHeadTags:seq) (ch:GenericChart) = ch |> mapDisplayOptions ( fun d -> let tags = d.TryGetTypedValue>("AdditionalHeadTags") @@ -1093,14 +1186,14 @@ module ChartExtensions = /// Sets the given additional head tags on the chart's DisplayOptions. They will be included in the document's [] - static member WithHeadTags (headTags:seq) (ch:GenericChart) = + static member withHeadTags (headTags:seq) (ch:GenericChart) = ch |> mapDisplayOptions (DisplayOptions.style(AdditionalHeadTags=headTags)) /// Adds the necessary script tags to render tex strings to the chart's DisplayOptions [] - static member WithMathTex ([]?AppendTags:bool) = + static member withMathTex ([]?AppendTags:bool) = let tags = [ """""" """""" @@ -1108,14 +1201,14 @@ module ChartExtensions = (fun (ch:GenericChart) -> if (AppendTags |> Option.defaultValue true) then - ch |> Chart.WithAdditionalHeadTags tags + ch |> Chart.withAdditionalHeadTags tags else - ch |> Chart.WithHeadTags tags + ch |> Chart.withHeadTags tags ) /// Save chart as html single page [] - static member SaveHtmlAs pathName (ch:GenericChart,[] ?Verbose) = + static member saveHtmlAs pathName (ch:GenericChart,[] ?Verbose) = let html = GenericChart.toEmbeddedHTML ch let file = sprintf "%s.html" pathName // remove file extension File.WriteAllText(file, html) @@ -1126,7 +1219,7 @@ module ChartExtensions = /// Show chart in browser [] - static member Show (ch:GenericChart) = + static member show (ch:GenericChart) = let guid = Guid.NewGuid().ToString() let html = GenericChart.toEmbeddedHTML ch let tempPath = Path.GetTempPath() @@ -1137,7 +1230,7 @@ module ChartExtensions = /// Show chart in browser [] - static member ShowAsImage (format:StyleParam.ImageFormat) (ch:GenericChart) = + static member showAsImage (format:StyleParam.ImageFormat) (ch:GenericChart) = let guid = Guid.NewGuid().ToString() let html = GenericChart.toEmbeddedImage format ch let tempPath = Path.GetTempPath() diff --git a/src/Plotly.NET/GenericChartExtensions.fs b/src/Plotly.NET/GenericChartExtensions.fs index 2ca45b664..c66257426 100644 --- a/src/Plotly.NET/GenericChartExtensions.fs +++ b/src/Plotly.NET/GenericChartExtensions.fs @@ -158,9 +158,9 @@ module GenericChartExtensions = // ####################### Apply to layout // Sets x-Axis of 2d and 3d- Charts - [] + [] [] - member this.WithX_Axis(xAxis:Axis.LinearAxis,[] ?Id) = + member this.WithXAxis(xAxis:Axis.LinearAxis,[] ?Id) = let contains3d = this @@ -183,9 +183,9 @@ module GenericChartExtensions = GenericChart.addLayout layout this // Sets x-Axis of 2d and 3d- Charts - [] + [] [] - member this.WithX_AxisStyle(title, + member this.WithXAxisStyle(title, [] ?MinMax, [] ?ShowGrid, [] ?ShowLine, @@ -200,20 +200,20 @@ module GenericChartExtensions = let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None let xaxis = Axis.LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine, ?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=ZeroLine) - this |> Chart.withX_Axis(xaxis,?Id=Id) + this |> Chart.withXAxis(xaxis,?Id=Id) /// Sets the range slider for the xAxis - [] + [] [] - member this.WithX_AxisRangeSlider(rangeSlider:RangeSlider, + member this.WithXAxisRangeSlider(rangeSlider:RangeSlider, [] ?Id) = let xaxis = Axis.LinearAxis.init(RangeSlider = rangeSlider) - this |> Chart.withX_Axis(xaxis,?Id=Id) + this |> Chart.withXAxis(xaxis,?Id=Id) // Sets y-Axis of 2d and 3d- Charts - [] + [] [] - member this.WithY_Axis(yAxis:Axis.LinearAxis,[] ?Id) = + member this.WithYAxis(yAxis:Axis.LinearAxis,[] ?Id) = let contains3d = this @@ -236,9 +236,9 @@ module GenericChartExtensions = GenericChart.addLayout layout this // Sets y-Axis of 3d- Charts - [] + [] [] - member this.WithY_AxisStyle(title, + member this.WithYAxisStyle(title, [] ?MinMax, [] ?ShowGrid, [] ?ShowLine, @@ -253,13 +253,13 @@ module GenericChartExtensions = let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None let yaxis = Axis.LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid, ?ShowLine=ShowLine,?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=ZeroLine) - this |> Chart.withY_Axis(yaxis,?Id=Id) + this |> Chart.withYAxis(yaxis,?Id=Id) // Sets z-Axis of 3d- Charts - [] + [] [] - member this.WithZ_Axis(zAxis:Axis.LinearAxis) = + member this.WithZAxis(zAxis:Axis.LinearAxis) = let layout = Layout() |> Layout.style(Scene=Scene.init(zAxis=zAxis)) @@ -268,9 +268,9 @@ module GenericChartExtensions = // Sets z-Axis style with ... - [] + [] [] - member this.WithZ_AxisStyle(title, + member this.WithZAxisStyle(title, [] ?MinMax, [] ?ShowGrid, [] ?ShowLine, @@ -279,7 +279,7 @@ module GenericChartExtensions = let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None let zaxis = Axis.LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine,?Anchor=Anchor,?Domain=domain) - this |> Chart.withZ_Axis(zaxis) + this |> Chart.withZAxis(zaxis) [] [] @@ -652,43 +652,43 @@ module GenericChartExtensions = [] [] member this.WithDescription (description:ChartDescription) = - this |> Chart.WithDescription description + this |> Chart.withDescription description /// Adds the given additional script tags on the chart's DisplayOptions. They will be included in the document's [] [] member this.WithAdditionalHeadTags (additionalHeadTags:seq) = - this |> Chart.WithAdditionalHeadTags additionalHeadTags + this |> Chart.withAdditionalHeadTags additionalHeadTags /// Sets the given additional script tags on the chart's DisplayOptions. They will be included in the document's [] [] member this.WithHeadTags (headTags:seq) = - this |> Chart.WithHeadTags headTags + this |> Chart.withHeadTags headTags /// Adds the necessary script tags to render tex strings to the chart's DisplayOptions [] [] member this.WithMathTex([]?AppendTags:bool) = let append = Option.defaultValue true AppendTags - this |> Chart.WithMathTex(append) + this |> Chart.withMathTex(append) /// Save chart as html single page [] [] member this.SaveHtmlAs (pathName:string, [] ?Verbose) = - Chart.SaveHtmlAs pathName this + Chart.saveHtmlAs pathName this /// Show chart in browser [] [] - member this.Show() = this |> Chart.Show + member this.Show() = this |> Chart.show /// Show chart in browser [] [] member this.ShowAsImage (format:StyleParam.ImageFormat) = - this |> Chart.ShowAsImage format + this |> Chart.showAsImage format \ No newline at end of file diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs b/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs index 93ca69271..960f35f28 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs @@ -10,8 +10,8 @@ let axisStylingChart = let y = [2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.] let plot1 = Chart.Point(x,y) - |> Chart.withX_AxisStyle ("X axis title quack quack", MinMax = (-1.,10.)) - |> Chart.withY_AxisStyle ("Y axis title boo foo", MinMax = (-1.,10.)) + |> Chart.withXAxisStyle ("X axis title quack quack", MinMax = (-1.,10.)) + |> Chart.withYAxisStyle ("Y axis title boo foo", MinMax = (-1.,10.)) plot1 @@ -51,13 +51,13 @@ let multipleAxesChart = anchoredAt1 anchoredAt2 ] - |> Chart.Combine - |> Chart.withY_AxisStyle( + |> Chart.combine + |> Chart.withYAxisStyle( "axis 1", Side=StyleParam.Side.Left, Id=1 ) - |> Chart.withY_AxisStyle( + |> Chart.withYAxisStyle( "axis2", Side=StyleParam.Side.Right, Id=2, @@ -114,7 +114,7 @@ let combinedChart = Chart.Line(x, y, Name="first") Chart.Line(y, x, Name="second") ] - |> Chart.Combine + |> Chart.combine let subPlotChart = @@ -122,17 +122,17 @@ let subPlotChart = let y = [2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.] [ Chart.Point(x, y, Name="1,1") - |> Chart.withX_AxisStyle "x1" - |> Chart.withY_AxisStyle "y1" + |> Chart.withXAxisStyle "x1" + |> Chart.withYAxisStyle "y1" Chart.Line(x, y, Name="1,2") - |> Chart.withX_AxisStyle "x2" - |> Chart.withY_AxisStyle "y2" + |> Chart.withXAxisStyle "x2" + |> Chart.withYAxisStyle "y2" Chart.Spline(x, y, Name="2,1") - |> Chart.withX_AxisStyle "x3" - |> Chart.withY_AxisStyle "y3" + |> Chart.withXAxisStyle "x3" + |> Chart.withYAxisStyle "y3" Chart.Point(x, y, Name="2,2") - |> Chart.withX_AxisStyle "x4" - |> Chart.withY_AxisStyle "y4" + |> Chart.withXAxisStyle "x4" + |> Chart.withYAxisStyle "y4" ] |> Chart.Grid(2, 2) @@ -142,19 +142,19 @@ let singleStackChart = let y = [2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.] [ Chart.Point(x,y) - |> Chart.withY_AxisStyle("This title must") + |> Chart.withYAxisStyle("This title must") Chart.Line(x,y) - |> Chart.withY_AxisStyle("be set on the",ZeroLine=false) + |> Chart.withYAxisStyle("be set on the",ZeroLine=false) Chart.Spline(x,y) - |> Chart.withY_AxisStyle("respective subplots",ZeroLine=false) + |> Chart.withYAxisStyle("respective subplots",ZeroLine=false) ] |> Chart.SingleStack(Pattern = StyleParam.LayoutGridPattern.Coupled) //move xAxis to bottom and increase spacing between plots by using the withLayoutGridStyle function |> Chart.withLayoutGridStyle(XSide=StyleParam.LayoutGridXSide.Bottom,YGap= 0.1) |> Chart.withTitle("Hi i am the new SingleStackChart") - |> Chart.withX_AxisStyle("im the shared xAxis") + |> Chart.withXAxisStyle("im the shared xAxis") [] @@ -210,7 +210,7 @@ let displayOptionsChartDescriptionChart = let y = [2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.] let description1 = ChartDescription.create "Hello" "F#" Chart.Point(x,y,Name="desc1") - |> Chart.WithDescription(description1) + |> Chart.withDescription(description1) let additionalHeadTagsChart = let x = [1.; 2.; 3.; 4.; 5.; 6.; 7.; 8.; 9.; 10.; ] @@ -233,19 +233,19 @@ let additionalHeadTagsChart = """

I am heading

""" bulmaHero Chart.Point(x,y,Name="desc3") - |> Chart.WithDescription description3 + |> Chart.withDescription description3 // Add reference to the bulma css framework - |> Chart.WithAdditionalHeadTags [""""""] + |> Chart.withAdditionalHeadTags [""""""] let mathtexChart = [ Chart.Point([(1.,2.)],@"$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$") Chart.Point([(2.,4.)],@"$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$") ] - |> Chart.Combine + |> Chart.combine |> Chart.withTitle @"$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$" // include mathtex tags in . pass true to append these scripts, false to ONLY include MathTeX. - |> Chart.WithMathTex(true) + |> Chart.withMathTex(true) [] let ``Display options`` = diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/Charts3D.fs b/tests/Plotly.NET.Tests/HtmlCodegen/Charts3D.fs index 654a0ae80..657af80ae 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/Charts3D.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/Charts3D.fs @@ -12,9 +12,9 @@ let scatterChart = let z = [19; 26; 55;] Chart.Scatter3d(x,y,z,StyleParam.Mode.Markers) - |> Chart.withX_AxisStyle("my x-axis") - |> Chart.withY_AxisStyle("my y-axis") - |> Chart.withZ_AxisStyle("my z-axis") + |> Chart.withXAxisStyle("my x-axis") + |> Chart.withYAxisStyle("my y-axis") + |> Chart.withZAxisStyle("my z-axis") |> Chart.withSize(800.,800.) [] @@ -43,9 +43,9 @@ let lineChart = |> List.unzip3 Chart.Scatter3d(x, y, z, StyleParam.Mode.Lines_Markers) - |> Chart.withX_AxisStyle("x-axis") - |> Chart.withY_AxisStyle("y-axis") - |> Chart.withZ_AxisStyle("z-axis") + |> Chart.withXAxisStyle("x-axis") + |> Chart.withYAxisStyle("y-axis") + |> Chart.withZAxisStyle("z-axis") |> Chart.withSize(800., 800.) diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/DistributionCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/DistributionCharts.fs index 72ca69bbd..59a9a3807 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/DistributionCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/DistributionCharts.fs @@ -47,7 +47,7 @@ let box3Chart = Chart.BoxPlot("y" ,y,Name="bin1",Jitter=0.1,Boxpoints=StyleParam.Boxpoints.All); Chart.BoxPlot("y'",y',Name="bin2",Jitter=0.1,Boxpoints=StyleParam.Boxpoints.All); ] - |> Chart.Combine + |> Chart.combine [] let ``Box charts`` = @@ -102,7 +102,7 @@ let violin3Chart = Chart.Violin ("y" ,y,Name="bin1",Jitter=0.1,Points=StyleParam.Jitterpoints.All); Chart.Violin ("y'",y',Name="bin2",Jitter=0.1,Points=StyleParam.Jitterpoints.All); ] - |> Chart.Combine + |> Chart.combine [] let ``Violin charts`` = @@ -193,7 +193,7 @@ let histogramContourChart = Chart.Histogram2dContour (x,y,Line=Line.init(Width=0.)) Chart.Point(x,y,Opacity=0.3) ] - |> Chart.Combine + |> Chart.combine let histogram2dChart = diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/FinanceCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/FinanceCharts.fs index 0693fea38..22cbff569 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/FinanceCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/FinanceCharts.fs @@ -27,7 +27,7 @@ let candles1Chart = Chart.Candlestick candles let candles2Chart = let rangeslider = RangeSlider.init(Visible=false) Chart.Candlestick candles - |> Chart.withX_AxisRangeSlider rangeslider + |> Chart.withXAxisRangeSlider rangeslider [] let ``Candlestick charts`` = diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs index 27f9efb9f..f2ecd8afc 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs @@ -134,7 +134,7 @@ let flightsMapChart = Color = "red" ) ) - |> Chart.Combine + |> Chart.combine |> Chart.withLegend(false) |> Chart.withMapStyle( Scope=StyleParam.GeoScope.NorthAmerica, diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs index 042b6dbb5..447d1777f 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs @@ -87,7 +87,7 @@ let flightsChart = Color = "red" ) ) - |> Chart.Combine + |> Chart.combine |> Chart.withLegend(false) |> Chart.withMapbox( Mapbox.init( diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/PolarCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/PolarCharts.fs index d9cad92ee..8fc96c6a6 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/PolarCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/PolarCharts.fs @@ -67,7 +67,7 @@ let ``Polar charts`` = // Chart.WindRose (r'' ,t,Name="5-8 m/s") // Chart.WindRose (r''',t,Name="< 5 m/s") // ] -// |> Chart.Combine +// |> Chart.combine //[] //let ``Windrose charts`` = diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/SimpleCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/SimpleCharts.fs index 924682b01..e3922dccd 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/SimpleCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/SimpleCharts.fs @@ -87,7 +87,7 @@ let stackedBarChart = Chart.StackedBar(keys,values,Name="old"); Chart.StackedBar(keys,[8; 21; 13;],Name="new") ] - |> Chart.Combine + |> Chart.combine let stackedColumnChart = let values = [20; 14; 23;] @@ -96,7 +96,7 @@ let stackedColumnChart = Chart.StackedColumn(keys,values,Name="old"); Chart.StackedColumn(keys,[8; 21; 13;],Name="new") ] - |> Chart.Combine + |> Chart.combine [] let ``Bar and column charts`` = @@ -151,7 +151,7 @@ let stackedAreaChart = Chart.StackedArea(x,y) Chart.StackedArea(x,y |> Seq.rev) ] - |> Chart.Combine + |> Chart.combine [] let ``Area charts`` = diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/SimpleTests.fs b/tests/Plotly.NET.Tests/HtmlCodegen/SimpleTests.fs index a1557c514..3bd36492f 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/SimpleTests.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/SimpleTests.fs @@ -11,8 +11,8 @@ let simpleChart = let yData = [0. .. 10.] Chart.Point(xData, yData) |> Chart.withTitle "Hello world!" - |> Chart.withX_AxisStyle ("xAxis", ShowGrid=false) - |> Chart.withY_AxisStyle ("yAxis", ShowGrid=false) + |> Chart.withXAxisStyle ("xAxis", ShowGrid=false) + |> Chart.withYAxisStyle ("yAxis", ShowGrid=false) []