-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathBox.fs
More file actions
53 lines (46 loc) · 1.37 KB
/
Box.fs
File metadata and controls
53 lines (46 loc) · 1.37 KB
1
2
3
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
50
51
52
53
namespace Plotly.NET.TraceObjects
open Plotly.NET
open Plotly.NET.LayoutObjects
open DynamicObj
open System
open System.Runtime.InteropServices
/// Box type inherits from dynamic object (parent violin)
type Box() =
inherit DynamicObj()
/// Initialized Line object
static member init
(
?Visible: bool,
?Width: float,
?FillColor: Color,
?LineColor: Color,
?LineWidth: float
) =
Box()
|> Box.style (
?Visible = Visible,
?Width = Width,
?FillColor = FillColor,
?LineColor = LineColor,
?LineWidth = LineWidth
)
// Applies the styles to Line()
static member style
(
?Visible: bool,
?Width: float,
?FillColor: Color,
?LineColor: Color,
?LineWidth: float
) =
fun (box: Box) ->
let line =
if LineColor.IsSome || LineWidth.IsSome then
Some(Line.init (?Color = LineColor, ?Width = LineWidth))
else
None
box
|> DynObj.withOptionalProperty "visible" Visible
|> DynObj.withOptionalProperty "width" Width
|> DynObj.withOptionalProperty "fillcolor" FillColor
|> DynObj.withOptionalProperty "line" line