Skip to content

Commit d1c63b9

Browse files
committed
plotlyjs 2.26: Add [n]-sigma (std deviations) box plots
1 parent 4497502 commit d1c63b9

File tree

6 files changed

+81
-147
lines changed

6 files changed

+81
-147
lines changed

src/Plotly.NET/ChartAPI/Chart2D.fs

+10-1
Original file line numberDiff line numberDiff line change
@@ -3817,6 +3817,7 @@ module Chart2D =
38173817
/// <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>
38183818
/// <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>
38193819
/// <param name="QuartileMethod">Sets the method used to compute the sample's Q1 and Q3 quartiles. The "linear" method uses the 25th percentile for Q1 and 75th percentile for Q3 as computed using method #10 (listed on http://www.amstat.org/publications/jse/v14n3/langford.html). The "exclusive" method uses the median to divide the ordered dataset into two halves if the sample is odd, it does not include the median in either half - Q1 is then the median of the lower half and Q3 the median of the upper half. The "inclusive" method also uses the median to divide the ordered dataset into two halves but if the sample is odd, it includes the median in both halves - Q1 is then the median of the lower half and Q3 the median of the upper half.</param>
3820+
/// <param name="SizeMode">Sets the upper and lower bound for the boxes quartiles means box is drawn between Q1 and Q3 SD means the box is drawn between Mean +- Standard Deviation Argument sdmultiple (default 1) to scale the box size So it could be drawn 1-stddev, 3-stddev etc</param>
38203821
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
38213822
[<Extension>]
38223823
static member BoxPlot
@@ -3847,6 +3848,7 @@ module Chart2D =
38473848
[<Optional; DefaultParameterValue(null)>] ?Notched: bool,
38483849
[<Optional; DefaultParameterValue(null)>] ?NotchWidth: float,
38493850
[<Optional; DefaultParameterValue(null)>] ?QuartileMethod: StyleParam.QuartileMethod,
3851+
[<Optional; DefaultParameterValue(null)>] ?SizeMode: StyleParam.BoxSizeMode,
38503852
[<Optional; DefaultParameterValue(true)>] ?UseDefaults: bool
38513853
) =
38523854

@@ -3888,7 +3890,8 @@ module Chart2D =
38883890
?OffsetGroup = OffsetGroup,
38893891
?Notched = Notched,
38903892
?NotchWidth = NotchWidth,
3891-
?QuartileMethod = QuartileMethod
3893+
?QuartileMethod = QuartileMethod,
3894+
?SizeMode = SizeMode
38923895
)
38933896
)
38943897
|> GenericChart.ofTraceObject useDefaults
@@ -3923,6 +3926,7 @@ module Chart2D =
39233926
/// <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>
39243927
/// <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>
39253928
/// <param name="QuartileMethod">Sets the method used to compute the sample's Q1 and Q3 quartiles. The "linear" method uses the 25th percentile for Q1 and 75th percentile for Q3 as computed using method #10 (listed on http://www.amstat.org/publications/jse/v14n3/langford.html). The "exclusive" method uses the median to divide the ordered dataset into two halves if the sample is odd, it does not include the median in either half - Q1 is then the median of the lower half and Q3 the median of the upper half. The "inclusive" method also uses the median to divide the ordered dataset into two halves but if the sample is odd, it includes the median in both halves - Q1 is then the median of the lower half and Q3 the median of the upper half.</param>
3929+
/// <param name="SizeMode">Sets the upper and lower bound for the boxes quartiles means box is drawn between Q1 and Q3 SD means the box is drawn between Mean +- Standard Deviation Argument sdmultiple (default 1) to scale the box size So it could be drawn 1-stddev, 3-stddev etc</param>
39263930
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
39273931
[<Extension>]
39283932
static member BoxPlot
@@ -3950,6 +3954,7 @@ module Chart2D =
39503954
[<Optional; DefaultParameterValue(null)>] ?Notched: bool,
39513955
[<Optional; DefaultParameterValue(null)>] ?NotchWidth: float,
39523956
[<Optional; DefaultParameterValue(null)>] ?QuartileMethod: StyleParam.QuartileMethod,
3957+
[<Optional; DefaultParameterValue(null)>] ?SizeMode: StyleParam.BoxSizeMode,
39533958
[<Optional; DefaultParameterValue(true)>] ?UseDefaults: bool
39543959
) =
39553960

@@ -3976,6 +3981,7 @@ module Chart2D =
39763981
?Notched = Notched,
39773982
?NotchWidth = NotchWidth,
39783983
?QuartileMethod = QuartileMethod,
3984+
?SizeMode = SizeMode,
39793985
?UseDefaults = UseDefaults
39803986
)
39813987

@@ -4014,6 +4020,7 @@ module Chart2D =
40144020
/// <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>
40154021
/// <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>
40164022
/// <param name="QuartileMethod">Sets the method used to compute the sample's Q1 and Q3 quartiles. The "linear" method uses the 25th percentile for Q1 and 75th percentile for Q3 as computed using method #10 (listed on http://www.amstat.org/publications/jse/v14n3/langford.html). The "exclusive" method uses the median to divide the ordered dataset into two halves if the sample is odd, it does not include the median in either half - Q1 is then the median of the lower half and Q3 the median of the upper half. The "inclusive" method also uses the median to divide the ordered dataset into two halves but if the sample is odd, it includes the median in both halves - Q1 is then the median of the lower half and Q3 the median of the upper half.</param>
4023+
/// <param name="SizeMode">Sets the upper and lower bound for the boxes quartiles means box is drawn between Q1 and Q3 SD means the box is drawn between Mean +- Standard Deviation Argument sdmultiple (default 1) to scale the box size So it could be drawn 1-stddev, 3-stddev etc</param>
40174024
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
40184025
[<Extension>]
40194026
static member BoxPlot
@@ -4041,6 +4048,7 @@ module Chart2D =
40414048
[<Optional; DefaultParameterValue(null)>] ?Notched: bool,
40424049
[<Optional; DefaultParameterValue(null)>] ?NotchWidth: float,
40434050
[<Optional; DefaultParameterValue(null)>] ?QuartileMethod: StyleParam.QuartileMethod,
4051+
[<Optional; DefaultParameterValue(null)>] ?SizeMode: StyleParam.BoxSizeMode,
40444052
[<Optional; DefaultParameterValue(true)>] ?UseDefaults: bool
40454053
) =
40464054

@@ -4071,6 +4079,7 @@ module Chart2D =
40714079
?Notched = Notched,
40724080
?NotchWidth = NotchWidth,
40734081
?QuartileMethod = QuartileMethod,
4082+
?SizeMode = SizeMode,
40744083
?UseDefaults = UseDefaults
40754084
)
40764085

src/Plotly.NET/CommonAbstractions/StyleParams.fs

+17
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,23 @@ module StyleParam =
356356

357357
member this.Convert() = this |> BoxPoints.convert
358358

359+
/// <summary>
360+
/// Sets the upper and lower bound for the boxes quartiles means box is drawn between Q1 and Q3 SD means the box is drawn between Mean +- Standard Deviation
361+
/// </summary>
362+
[<RequireQualifiedAccess>]
363+
type BoxSizeMode =
364+
| Quartiles
365+
| SD
366+
367+
static member toString =
368+
function
369+
| Quartiles -> "quartiles"
370+
| SD -> "sd"
371+
372+
static member convert = BoxSizeMode.toString >> box
373+
override this.ToString() = this |> BoxSizeMode.toString
374+
member this.Convert() = this |> BoxSizeMode.convert
375+
359376

360377

361378
[<RequireQualifiedAccess>]

0 commit comments

Comments
 (0)