forked from plotly/Plotly.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnnotation.fs
More file actions
115 lines (110 loc) · 5.14 KB
/
Annotation.fs
File metadata and controls
115 lines (110 loc) · 5.14 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
namespace Plotly.NET
/// Text annotations inside a plot
type Annotation() =
inherit DynamicObj ()
/// Init Annotation type
static member init
(
X : System.IConvertible,
Y : System.IConvertible,
?XRef : System.IConvertible,
?YRef : System.IConvertible,
?ArrowTailX : float,
?ArrowTailY : float,
?ShowArrow : bool,
?ArrowColor : string,
?ArrowHead : StyleParam.ArrowHead,
?ArrowSize : float,
?ArrowWidth : float,
?Z : float,
?Text : string,
?TextAngle : float,
?Font : Font,
?Width : float,
?Height : float,
?Opacity : float,
?HorizontalAlign: StyleParam.HorizontalAlign,
?VerticalAlign : StyleParam.VerticalAlign,
?BGColor : string,
?BorderColor : string,
?Visible : bool
) =
Annotation()
|> Annotation.style
(
X = X ,
Y = Y ,
?XRef = XRef ,
?YRef = YRef ,
?ArrowTailX = ArrowTailX ,
?ArrowTailY = ArrowTailY ,
?ShowArrow = ShowArrow ,
?ArrowColor = ArrowColor ,
?ArrowHead = ArrowHead ,
?ArrowSize = ArrowSize ,
?ArrowWidth = ArrowWidth ,
?Z = Z ,
?Text = Text ,
?TextAngle = TextAngle ,
?Font = Font ,
?Width = Width ,
?Height = Height ,
?Opacity = Opacity ,
?HorizontalAlign = HorizontalAlign ,
?VerticalAlign = VerticalAlign ,
?BGColor = BGColor ,
?BorderColor = BorderColor ,
?Visible = Visible
)
static member style
(
X : System.IConvertible,
Y : System.IConvertible,
?XRef : System.IConvertible,
?YRef : System.IConvertible,
?ArrowTailX : float,
?ArrowTailY : float,
?ShowArrow : bool,
?ArrowColor : string,
?ArrowHead : StyleParam.ArrowHead,
?ArrowSize : float,
?ArrowWidth : float,
?Z : float,
?Text : string,
?TextAngle : float,
?Font : Font,
?Width : float,
?Height : float,
?Opacity : float,
?HorizontalAlign: StyleParam.HorizontalAlign,
?VerticalAlign : StyleParam.VerticalAlign,
?BGColor : string,
?BorderColor : string,
?Visible : bool
) =
(fun (ann:Annotation) ->
X |> DynObj.setValue ann "x"
Y |> DynObj.setValue ann "y"
XRef |> DynObj.setValueOpt ann "xref"
YRef |> DynObj.setValueOpt ann "yref"
ArrowTailX |> DynObj.setValueOpt ann "ax"
ArrowTailY |> DynObj.setValueOpt ann "ay"
ArrowHead |> DynObj.setValueOptBy ann "arrowhead" StyleParam.ArrowHead.convert
ArrowSize |> DynObj.setValueOpt ann "arrowsize"
ArrowWidth |> DynObj.setValueOpt ann "arrowwidth"
ShowArrow |> DynObj.setValueOpt ann "showarrow"
ArrowColor |> DynObj.setValueOpt ann "arrowcolor"
Z |> DynObj.setValueOpt ann "z"
Text |> DynObj.setValueOpt ann "text"
TextAngle |> DynObj.setValueOpt ann "textangle"
Font |> DynObj.setValueOpt ann "font"
Width |> DynObj.setValueOpt ann "width"
Height |> DynObj.setValueOpt ann "height"
Opacity |> DynObj.setValueOpt ann "opacity"
HorizontalAlign |> DynObj.setValueOptBy ann "align" StyleParam.HorizontalAlign.convert
VerticalAlign |> DynObj.setValueOptBy ann "valign" StyleParam.VerticalAlign.convert
BGColor |> DynObj.setValueOpt ann "bgcolor"
BorderColor |> DynObj.setValueOpt ann "bordercolor"
Visible |> DynObj.setValueOpt ann "visible"
ann
)