forked from plotly/Plotly.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCumulative.fs
More file actions
49 lines (39 loc) · 2.24 KB
/
Copy pathCumulative.fs
File metadata and controls
49 lines (39 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace Plotly.NET
//enabled (boolean)
//If true, display the cumulative distribution by summing the binned values. Use the `direction` and `centralbin` attributes to tune the accumulation method. Note: in this mode, the "density" `histnorm` settings behave the same as their equivalents without "density": "" and "density" both rise to the number of data points, and "probability" and "probability density" both rise to the number of sample points.
//direction ( enumerated : "increasing" | "decreasing" )
//default: "increasing"
//Only applies if cumulative is enabled. If "increasing" (default) we sum all prior bins, so the result increases from left to right. If "decreasing" we sum later bins so the result decreases from left to right.
//currentbin ( enumerated : "include" | "exclude" | "half" )
//default: "include"
//Only applies if cumulative is enabled. Sets whether the current bin is included, excluded, or has half of its value included in the current cumulative value. "include" is the default for compatibility with various other tools, however it introduces a half-bin bias to the results. "exclude" makes the opposite half-bin bias, and "half" removes it.
/// Cumulative type inherits from dynamic object
type Cumulative () =
inherit DynamicObj ()
// Init Cumulative()
static member init
(
?Enabled : bool,
?Direction : StyleParam.CumulativeDirection,
?Currentbin : StyleParam.Currentbin
) =
Cumulative ()
|> Cumulative.style
(
?Enabled = Enabled,
?Direction = Direction ,
?Currentbin = Currentbin
)
// Applies the styles to Cumulative()
static member style
(
?Enabled,
?Direction,
?Currentbin
) =
(fun (cumulative: Cumulative) ->
Enabled |> DynObj.setValueOpt cumulative "enabled"
Direction |> DynObj.setValueOptBy cumulative "direction" StyleParam.CumulativeDirection.convert
Currentbin |> DynObj.setValueOptBy cumulative "currentbin" StyleParam.Currentbin.convert
cumulative
)