Skip to content

Commit d011f56

Browse files
committed
Add XML docs for all Chart2D functions, add convenience constructors, fix small param errors and typos
1 parent 2bf12aa commit d011f56

6 files changed

Lines changed: 1345 additions & 243 deletions

File tree

src/Plotly.NET/ChartAPI/Chart2D.fs

Lines changed: 1291 additions & 164 deletions
Large diffs are not rendered by default.

src/Plotly.NET/Playground.fsx

Lines changed: 33 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -176,65 +176,40 @@ open Plotly.NET
176176
open System
177177
open Plotly.NET
178178

179-
let simpleAreaChart =
180-
let x = [1.; 2.; 3.; 4.; 5.; 6.; 7.; 8.; 9.; 10.; ]
181-
let y = [5.; 2.5; 5.; 7.5; 5.; 2.5; 7.5; 4.5; 5.5; 5.]
182-
Chart.Area(x,y, UseDefaults = false)
183-
|> Chart.show
184-
185-
let withSplineChart =
186-
let x = [1.; 2.; 3.; 4.; 5.; 6.; 7.; 8.; 9.; 10.; ]
187-
let y = [5.; 2.5; 5.; 7.5; 5.; 2.5; 7.5; 4.5; 5.5; 5.]
188-
Chart.SplineArea(x,y, UseDefaults = false)
189-
|> Chart.show
190-
191-
let stackedAreaChart =
192-
let x = [1.; 2.; 3.; 4.; 5.; 6.; 7.; 8.; 9.; 10.; ]
193-
let y = [5.; 2.5; 5.; 7.5; 5.; 2.5; 7.5; 4.5; 5.5; 5.]
179+
let multiTraceGrid =
194180
[
195-
Chart.StackedArea(x,y, UseDefaults = false)
196-
Chart.StackedArea(x,y |> Seq.rev, UseDefaults = false)
181+
Chart.Point([1,2; 2,3], UseDefaults = false)
182+
Chart.PointTernary([1,2,3; 2,3,4], UseDefaults = false)
183+
Chart.Heatmap([[1; 2];[3; 4]], ShowScale=false, UseDefaults = false)
184+
Chart.Point3D([1,3,2], UseDefaults = false)
185+
Chart.PointMapbox([1,2], UseDefaults = false) |> Chart.withMapbox(Mapbox.init(Style = StyleParam.MapboxStyle.OpenStreetMap))
186+
[
187+
// you can use nested combined charts, but they have to have the same trace type (Cartesian2D in this case)
188+
let y = [2.; 1.5; 5.; 1.5; 2.; 2.5; 2.1; 2.5; 1.5; 1.;2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.]
189+
Chart.BoxPlot("y" ,y,Name="bin1",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All, UseDefaults = false);
190+
Chart.BoxPlot("y'",y,Name="bin2",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All, UseDefaults = false);
191+
]
192+
|> Chart.combine
197193
]
198-
|> Chart.combine
194+
|> Chart.Grid(2,3)
195+
|> Chart.withSize(1000,1000)
199196
|> Chart.show
200197

201-
[
202-
Chart.StackedArea(
203-
[1,2; 3,7; 5,6],
204-
MultiText = ["A"; "B"; "C"],
205-
ShowMarkers = true,
206-
MultiTextPosition = [StyleParam.TextPosition.MiddleRight; StyleParam.TextPosition.BottomRight; StyleParam.TextPosition.MiddleLeft],
207-
MarkerColor = Color.fromColorScaleValues [2;7;6],
208-
Marker = Marker.init(Size = 30, ShowScale = true)
209-
)
210-
Chart.StackedArea(
211-
[1,2; 3,7; 5,6],
212-
MultiText = ["A"; "B"; "C"],
213-
ShowMarkers = true,
214-
MultiTextPosition = [StyleParam.TextPosition.MiddleRight; StyleParam.TextPosition.BottomRight; StyleParam.TextPosition.MiddleLeft],
215-
MarkerColor = Color.fromColorScaleValues [2;7;6],
216-
Marker = Marker.init(Size = 30, ShowScale = true)
217-
)
218-
219-
]
220-
|> Chart.combine
221-
|> Chart.show
222-
223-
224-
225-
Chart.Indicator(
226-
200., StyleParam.IndicatorMode.NumberDeltaGauge,
227-
Title = "Angular gauge",
228-
Delta = IndicatorDelta.init(Reference=160),
229-
Range = StyleParam.Range.MinMax(0., 250.),
230-
Domain = Domain.init(Row = 0, Column = 1),
231-
Gauge = IndicatorGauge.init(
232-
Bar = IndicatorBar.init(Color = Color.fromKeyword Black),
233-
Steps = [
234-
IndicatorStep.init(Range = StyleParam.Range.MinMax(0., 150.), Color = Color.fromKeyword Green)
235-
IndicatorStep.init(Range = StyleParam.Range.MinMax(150., 200.), Color = Color.fromKeyword Yellow)
236-
],
237-
Threshold = IndicatorThreshold.init(Value = 200., Line = Line.init(Color=Color.fromKeyword Red, Width = 20.))
238-
)
239-
)
240-
|> Chart.show
198+
let multiTraceSingleStack =
199+
[
200+
Chart.Point([1,2; 2,3], UseDefaults = false)
201+
Chart.PointTernary([1,2,3; 2,3,4], UseDefaults = false)
202+
Chart.Heatmap([[1; 2];[3; 4]], ShowScale=false, UseDefaults = false)
203+
Chart.Point3D([1,3,2], UseDefaults = false)
204+
Chart.PointMapbox([1,2], UseDefaults = false) |> Chart.withMapbox(Mapbox.init(Style = StyleParam.MapboxStyle.OpenStreetMap))
205+
[
206+
// you can use nested combined charts, but they have to have the same trace type (Cartesian2D in this case)
207+
let y = [2.; 1.5; 5.; 1.5; 2.; 2.5; 2.1; 2.5; 1.5; 1.;2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.]
208+
Chart.BoxPlot("y" ,y,Name="bin1",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All, UseDefaults = false);
209+
Chart.BoxPlot("y'",y,Name="bin2",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All, UseDefaults = false);
210+
]
211+
|> Chart.combine
212+
]
213+
|> Chart.SingleStack()
214+
|> Chart.withSize(1000,1000)
215+
|> Chart.show

src/Plotly.NET/Traces/ObjectAbstractions/FunnelConnector.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ type FunnelConnector() =
2020

2121
static member init
2222
(
23-
[<Optional; DefaultParameterValue(null)>] ?Fillcolor: Color,
23+
[<Optional; DefaultParameterValue(null)>] ?FillColor: Color,
2424
[<Optional; DefaultParameterValue(null)>] ?Line: Line,
2525
[<Optional; DefaultParameterValue(null)>] ?Visible: bool
2626
) =
2727

28-
FunnelConnector() |> FunnelConnector.style (?Fillcolor = Fillcolor, ?Line = Line, ?Visible = Visible)
28+
FunnelConnector() |> FunnelConnector.style (?FillColor = FillColor, ?Line = Line, ?Visible = Visible)
2929

3030
static member style
3131
(
32-
[<Optional; DefaultParameterValue(null)>] ?Fillcolor: Color,
32+
[<Optional; DefaultParameterValue(null)>] ?FillColor: Color,
3333
[<Optional; DefaultParameterValue(null)>] ?Line: Line,
3434
[<Optional; DefaultParameterValue(null)>] ?Visible: bool
3535
) =
3636
(fun (connector: FunnelConnector) ->
3737

38-
Fillcolor |> DynObj.setValueOpt connector "fillcolor"
38+
FillColor |> DynObj.setValueOpt connector "fillcolor"
3939
Line |> DynObj.setValueOpt connector "line"
4040
Visible |> DynObj.setValueOpt connector "visible"
4141

src/Plotly.NET/Traces/Trace2D.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ type Trace2DStyle() =
668668
)
669669

670670
/// <summary>
671-
/// Create a function that applies the styles of a funnel plot to a Trace object
671+
/// Create a function that applies the styles of a waterfall plot to a Trace object
672672
/// </summary>
673673
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover.</param>
674674
/// <param name="Visible">Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).</param>
@@ -1053,7 +1053,7 @@ type Trace2DStyle() =
10531053
/// <param name="BoxPoints">If "outliers", only the sample points lying outside the whiskers are shown If "suspectedoutliers", the outlier points are shown and points either less than 4"Q1-3"Q3 or greater than 4"Q3-3"Q1 are highlighted (see `outliercolor`) If "all", all sample points are shown If "false", only the box(es) are shown with no sample points Defaults to "suspectedoutliers" when `marker.outliercolor` or `marker.line.outliercolor` is set. Defaults to "all" under the q1/median/q3 signature. Otherwise defaults to "outliers".</param>
10541054
/// <param name="Notched">Determines whether or not notches are drawn. Notches displays a confidence interval around the median. We compute the confidence interval as median +/- 1.57 " IQR / sqrt(N), where IQR is the interquartile range and N is the sample size. If two boxes' notches do not overlap there is 95% confidence their medians differ. See https://sites.google.com/site/davidsstatistics/home/notched-box-plots for more info. Defaults to "false" unless `notchwidth` or `notchspan` is set.</param>
10551055
/// <param name="NotchWidth">Sets the width of the notches relative to the box' width. For example, with 0, the notches are as wide as the box(es).</param>
1056-
/// <param name="Whiskerwidth">Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es).</param>
1056+
/// <param name="WhiskerWidth">Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es).</param>
10571057
/// <param name="Q1">Sets the Quartile 1 values. There should be as many items as the number of boxes desired.</param>
10581058
/// <param name="Median">Sets the Quartile 1 values. There should be as many items as the number of boxes desired.</param>
10591059
/// <param name="Q3">Sets the Quartile 3 values. There should be as many items as the number of boxes desired.</param>
@@ -1119,7 +1119,7 @@ type Trace2DStyle() =
11191119
[<Optional; DefaultParameterValue(null)>] ?BoxPoints: StyleParam.BoxPoints,
11201120
[<Optional; DefaultParameterValue(null)>] ?Notched: bool,
11211121
[<Optional; DefaultParameterValue(null)>] ?NotchWidth: float,
1122-
[<Optional; DefaultParameterValue(null)>] ?Whiskerwidth: float,
1122+
[<Optional; DefaultParameterValue(null)>] ?WhiskerWidth: float,
11231123
[<Optional; DefaultParameterValue(null)>] ?Q1: seq<IConvertible>,
11241124
[<Optional; DefaultParameterValue(null)>] ?Median: seq<IConvertible>,
11251125
[<Optional; DefaultParameterValue(null)>] ?Q3: seq<IConvertible>,
@@ -1183,7 +1183,7 @@ type Trace2DStyle() =
11831183
BoxPoints |> DynObj.setValueOptBy boxPlot "boxpoints" StyleParam.BoxPoints.convert
11841184
Notched |> DynObj.setValueOpt boxPlot "notched"
11851185
NotchWidth |> DynObj.setValueOpt boxPlot "notchwidth"
1186-
Whiskerwidth |> DynObj.setValueOpt boxPlot "whiskerwidth"
1186+
WhiskerWidth |> DynObj.setValueOpt boxPlot "whiskerwidth"
11871187
Q1 |> DynObj.setValueOpt boxPlot "q1"
11881188
Median |> DynObj.setValueOpt boxPlot "median"
11891189
Q3 |> DynObj.setValueOpt boxPlot "q3"

tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ let ``Multicharts and subplots`` =
210210
|> chartGeneratedContains subPlotChart
211211
);
212212
testCase "MultiTrace Subplot grid data" ( fun () ->
213-
"""var data = [{"type":"scatter","mode":"markers","x":[1,2],"y":[2,3],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatterternary","mode":"markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{},"line":{},"subplot":"ternary2"},{"type":"heatmap","z":[[1,2],[3,4]],"showscale":false,"xaxis":"x3","yaxis":"y3"},{"type":"scatter3d","mode":"markers","x":[1],"y":[3],"z":[2],"marker":{},"line":{},"scene":"scene4"},{"type":"scattermapbox","mode":"markers","lat":[2],"lon":[1],"marker":{},"line":{},"subplot":"mapbox5"},{"type":"box","x":"y","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin1","marker":{},"xaxis":"x6","yaxis":"y6"},{"type":"box","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin2","marker":{},"xaxis":"x6","yaxis":"y6"}];"""
213+
"""var data = [{"type":"scatter","mode":"markers","x":[1,2],"y":[2,3],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatterternary","mode":"markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{},"line":{},"subplot":"ternary2"},{"type":"heatmap","z":[[1,2],[3,4]],"showscale":false,"xaxis":"x3","yaxis":"y3"},{"type":"scatter3d","mode":"markers","x":[1],"y":[3],"z":[2],"marker":{},"line":{},"scene":"scene4"},{"type":"scattermapbox","mode":"markers","lat":[2],"lon":[1],"marker":{},"line":{},"subplot":"mapbox5"},{"type":"box","name":"bin1","x":"y","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"marker":{},"line":{},"boxpoints":"all","jitter":0.1,"xaxis":"x6","yaxis":"y6"},{"type":"box","name":"bin2","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"marker":{},"line":{},"boxpoints":"all","jitter":0.1,"xaxis":"x6","yaxis":"y6"}];"""
214214
|> chartGeneratedContains multiTraceGrid
215215
);
216216
testCase "MultiTrace Subplot grid layout" ( fun () ->
@@ -227,7 +227,7 @@ let ``Multicharts and subplots`` =
227227
);
228228

229229
testCase "MultiTrace Single Stack data" ( fun () ->
230-
"""var data = [{"type":"scatter","mode":"markers","x":[1,2],"y":[2,3],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatterternary","mode":"markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{},"line":{},"subplot":"ternary2"},{"type":"heatmap","z":[[1,2],[3,4]],"showscale":false,"xaxis":"x3","yaxis":"y3"},{"type":"scatter3d","mode":"markers","x":[1],"y":[3],"z":[2],"marker":{},"line":{},"scene":"scene4"},{"type":"scattermapbox","mode":"markers","lat":[2],"lon":[1],"marker":{},"line":{},"subplot":"mapbox5"},{"type":"box","x":"y","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin1","marker":{},"xaxis":"x6","yaxis":"y6"},{"type":"box","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin2","marker":{},"xaxis":"x6","yaxis":"y6"}];"""
230+
"""var data = [{"type":"scatter","mode":"markers","x":[1,2],"y":[2,3],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatterternary","mode":"markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{},"line":{},"subplot":"ternary2"},{"type":"heatmap","z":[[1,2],[3,4]],"showscale":false,"xaxis":"x3","yaxis":"y3"},{"type":"scatter3d","mode":"markers","x":[1],"y":[3],"z":[2],"marker":{},"line":{},"scene":"scene4"},{"type":"scattermapbox","mode":"markers","lat":[2],"lon":[1],"marker":{},"line":{},"subplot":"mapbox5"},{"type":"box","name":"bin1","x":"y","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"marker":{},"line":{},"boxpoints":"all","jitter":0.1,"xaxis":"x6","yaxis":"y6"},{"type":"box","name":"bin2","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"marker":{},"line":{},"boxpoints":"all","jitter":0.1,"xaxis":"x6","yaxis":"y6"}];"""
231231
|> chartGeneratedContains multiTraceSingleStack
232232
);
233233
testCase "MultiTrace Single Stack layout" ( fun () ->

tests/Plotly.NET.Tests/HtmlCodegen/DistributionCharts.fs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,30 @@ let box3Chart =
4646
let y = [2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.]
4747
let y' = [2.; 1.5; 5.; 1.5; 2.; 2.5; 2.1; 2.5; 1.5; 1.;2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.]
4848
[
49-
Chart.BoxPlot("y" ,y,Name="bin1",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All, UseDefaults = false);
50-
Chart.BoxPlot("y'",y',Name="bin2",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All, UseDefaults = false);
49+
Chart.BoxPlot(data = y , orientation = StyleParam.Orientation.Horizontal, Name="bin1",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All, UseDefaults = false);
50+
Chart.BoxPlot(data = y', orientation = StyleParam.Orientation.Horizontal, Name="bin2",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All, UseDefaults = false);
5151
]
5252
|> Chart.combine
5353

5454
[<Tests>]
5555
let ``Box charts`` =
5656
testList "DistributionCharts.Box charts" [
5757
testCase "Box1 data" ( fun () ->
58-
"""var data = [{"type":"box","x":["bin1","bin2","bin1","bin2","bin1","bin2","bin1","bin1","bin2","bin1"],"y":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"marker":{}}];"""
58+
"""var data = [{"type":"box","x":["bin1","bin2","bin1","bin2","bin1","bin2","bin1","bin1","bin2","bin1"],"y":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"marker":{},"line":{},"boxpoints":"all","jitter":0.1}];"""
5959
|> chartGeneratedContains box1Chart
6060
);
6161
testCase "Box1 layout" ( fun () ->
6262
emptyLayout box1Chart
6363
);
6464
testCase "Box2 data" ( fun () ->
65-
"""var data = [{"type":"box","x":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"y":["bin1","bin2","bin1","bin2","bin1","bin2","bin1","bin1","bin2","bin1"],"orientation":"h","boxpoints":"all","jitter":0.1,"marker":{}}];"""
65+
"""var data = [{"type":"box","x":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"y":["bin1","bin2","bin1","bin2","bin1","bin2","bin1","bin1","bin2","bin1"],"orientation":"h","marker":{},"line":{},"boxpoints":"all","jitter":0.1}];"""
6666
|> chartGeneratedContains box2Chart
6767
);
6868
testCase "Box2 layout" ( fun () ->
6969
emptyLayout box2Chart
7070
);
7171
testCase "Box3 data" ( fun () ->
72-
"""ar data = [{"type":"box","x":"y","y":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin1","marker":{}},{"type":"box","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin2","marker":{}}];"""
72+
"""var data = [{"type":"box","name":"bin1","marker":{},"line":{},"boxpoints":"all","jitter":0.1,"x":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0]},{"type":"box","name":"bin2","marker":{},"line":{},"boxpoints":"all","jitter":0.1,"x":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0]}];"""
7373
|> chartGeneratedContains box3Chart
7474
);
7575
testCase "Box3 layout" ( fun () ->
@@ -103,30 +103,30 @@ let violin3Chart =
103103
let y = [2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.]
104104
let y' = [2.; 1.5; 5.; 1.5; 2.; 2.5; 2.1; 2.5; 1.5; 1.;2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.]
105105
[
106-
Chart.Violin ("y" ,y,Name="bin1",Jitter=0.1,Points=StyleParam.JitterPoints.All, UseDefaults = false);
107-
Chart.Violin ("y'",y',Name="bin2",Jitter=0.1,Points=StyleParam.JitterPoints.All, UseDefaults = false);
106+
Chart.Violin (data = y , orientation = StyleParam.Orientation.Horizontal, Name="bin1",Jitter=0.1,Points=StyleParam.BoxPoints.All, UseDefaults = false)
107+
Chart.Violin (data = y', orientation = StyleParam.Orientation.Horizontal, Name="bin2",Jitter=0.1,Points=StyleParam.BoxPoints.All, UseDefaults = false)
108108
]
109109
|> Chart.combine
110110

111111
[<Tests>]
112112
let ``Violin charts`` =
113113
testList "DistributionCharts.Violin charts" [
114114
testCase "Violin1 data" ( fun () ->
115-
"""var data = [{"type":"violin","x":["bin1","bin2","bin1","bin2","bin1","bin2","bin1","bin1","bin2","bin1"],"y":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"box":{},"points":"all","marker":{}}];"""
115+
"""var data = [{"type":"violin","x":["bin1","bin2","bin1","bin2","bin1","bin2","bin1","bin1","bin2","bin1"],"y":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"marker":{},"line":{},"box":{},"points":"all"}];"""
116116
|> chartGeneratedContains violin1Chart
117117
);
118118
testCase "Violin1 layout" ( fun () ->
119119
emptyLayout violin1Chart
120120
);
121121
testCase "Violin2 data" ( fun () ->
122-
"""var data = [{"type":"violin","x":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"y":["bin1","bin2","bin1","bin2","bin1","bin2","bin1","bin1","bin2","bin1"],"orientation":"h","box":{},"jitter":0.1,"meanline":{"visible":true},"points":"all","marker":{}}];"""
122+
"""var data = [{"type":"violin","x":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"y":["bin1","bin2","bin1","bin2","bin1","bin2","bin1","bin1","bin2","bin1"],"orientation":"h","marker":{},"line":{},"box":{},"jitter":0.1,"meanline":{"visible":true},"points":"all"}];"""
123123
|> chartGeneratedContains violin2Chart
124124
);
125125
testCase "Violin2 layout" ( fun () ->
126126
emptyLayout violin2Chart
127127
);
128128
testCase "Violin3 data" ( fun () ->
129-
"""var data = [{"type":"violin","name":"bin1","x":"y","y":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"box":{},"jitter":0.1,"points":"all","marker":{}},{"type":"violin","name":"bin2","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"box":{},"jitter":0.1,"points":"all","marker":{}}];"""
129+
"""var data = [{"type":"violin","name":"bin1","marker":{},"line":{},"box":{},"jitter":0.1,"points":"all","x":[2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0]},{"type":"violin","name":"bin2","marker":{},"line":{},"box":{},"jitter":0.1,"points":"all","x":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0]}];"""
130130
|> chartGeneratedContains violin3Chart
131131
);
132132
testCase "Violin3 layout" ( fun () ->
@@ -193,7 +193,7 @@ let histogramContourChart =
193193
let x = Array.init n (fun i -> ((step i)**3.) + (0.3 * (normal (rnd) 0. 2.) ))
194194
let y = Array.init n (fun i -> ((step i)**6.) + (0.3 * (normal (rnd) 0. 2.) ))
195195
[
196-
Chart.Histogram2DContour (x,y,Line=Line.init(Width=0.), UseDefaults = false)
196+
Chart.Histogram2DContour (x,y,ContourLine=Line.init(Width=0.), UseDefaults = false)
197197
Chart.Point(x,y,Opacity=0.3, UseDefaults = false)
198198
]
199199
|> Chart.combine

0 commit comments

Comments
 (0)