-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathContours.fs
More file actions
240 lines (217 loc) · 7.16 KB
/
Contours.fs
File metadata and controls
240 lines (217 loc) · 7.
8000
16 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
namespace Plotly.NET.TraceObjects
open Plotly.NET
open Plotly.NET.LayoutObjects
8000
open Plotly.NET.TraceObjects
open DynamicObj
open System
open System.Runtime.InteropServices
type ContourProject() =
inherit DynamicObj()
static member init
(
?X: bool,
?Y: bool,
?Z: bool
) =
ContourProject() |> ContourProject.style (?X = X, ?Y = Y, ?Z = Z)
static member style
(
?X: bool,
?Y: bool,
?Z: bool
) =
fun (contourProject: ContourProject) ->
contourProject
|> DynObj.withOptionalProperty "x" X
|> DynObj.withOptionalProperty "y" Y
|> DynObj.withOptionalProperty "z" Z
/// Contour object inherits from dynamic object
type Contour() =
inherit DynamicObj()
/// Initialized a Contour object
static member init
(
?Color: Color,
?End: float,
?Highlight: bool,
?HighlightColor: Color,
?HighlightWidth: float,
?Project: ContourProject,
?Show: bool,
?Size: float,
?Start: float,
?UseColorMap: bool,
?Width: float
) =
Contour()
|> Contour.style (
?Color = Color,
?End = End,
?Highlight = Highlight,
?HighlightColor = HighlightColor,
?HighlightWidth = HighlightWidth,
?Project = Project,
?Show = Show,
?Size = Size,
?Start = Start,
?UseColorMap = UseColorMap,
?Width = Width
)
// Applies the styles to Contours()
static member style
(
?Color: Color,
?End: float,
?Highlight: bool,
?HighlightColor: Color,
?HighlightWidth: float,
?Project: ContourProject,
?Show: bool,
?Size: float,
?Start: float,
?UseColorMap: bool,
?Width: float
) =
fun (contour: Contour) ->
contour
|> DynObj.withOptionalProperty "color" Color
|> DynObj.withOptionalProperty "end" End
|> DynObj.withOptionalProperty "highlight" Highlight
|> DynObj.withOptionalProperty "highlightcolor" HighlightColor
|> DynObj.withOptionalProperty "highlightwidth" HighlightWidth
|> DynObj.withOptionalProperty "project" Project
|> DynObj.withOptionalProperty "show" Show
|> DynObj.withOptionalProperty "size" Size
|> DynObj.withOptionalProperty "start" Start
|> DynObj.withOptionalProperty "usecolormap" UseColorMap
|> DynObj.withOptionalProperty "width" Width
/// Contours type inherits from dynamic object
type Contours() =
inherit DynamicObj()
static member init
(
?Coloring: StyleParam.ContourColoring,
?End: float,
?LabelFont: Font,
?LabelFormat: string,
?Operation: StyleParam.ConstraintOperation,
?ShowLabels: bool,
?ShowLines: bool,
?Size: float,
?Start: float,
?Type: StyleParam.ContourType,
?Value: #IConvertible
) =
Contours()
|> Contours.style (
?Coloring = Coloring,
?End = End,
?LabelFont = LabelFont,
?LabelFormat = LabelFormat,
?Operation = Operation,
?ShowLabels = ShowLabels,
?ShowLines = ShowLines,
?Size = Size,
?Start = Start,
?Type = Type,
?Value = Value
)
/// Initialized Contours object
static member initSurface
(
?X: Contour,
?Y: Contour,
?Z: Contour
) =
Contours() |> Contours.style (?X = X, ?Y = Y, ?Z = Z)
// Applies the styles to Contours()
static member style
(
?X: Contour,
?Y: Contour,
?Z: Contour,
?Coloring: StyleParam.ContourColoring,
?End: float,
?LabelFont: Font,
?LabelFormat: string,
?Operation: StyleParam.ConstraintOperation,
?ShowLabels: bool,
?ShowLines: bool,
?Size: float,
?Start: float,
?Type: StyleParam.ContourType,
?Value: #IConvertible
) =
fun (contours: Contours) ->
contours
|> DynObj.withOptionalProperty "x" X
|> DynObj.withOptionalProperty "y" Y
|> DynObj.withOptionalProperty "z" Z
|> DynObj.withOptionalPropertyBy "coloring" Coloring StyleParam.ContourColoring.convert
|> DynObj.withOptionalProperty "end" End
|> DynObj.withOptionalProperty "labelfont" LabelFont
|> DynObj.withOptionalProperty "labelformat" LabelFormat
|> DynObj.withOptionalPropertyBy "operation" Operation StyleParam.ConstraintOperation.convert
|> DynObj.withOptionalProperty "showlabels" ShowLabels
|> DynObj.withOptionalProperty "showlines" ShowLines
|> DynObj.withOptionalProperty "size" Size
|> DynObj.withOptionalProperty "start" Start
|> DynObj.withOptionalPropertyBy "type" Type StyleParam.ContourType.convert
|> DynObj.withOptionalProperty "value" Value
// Initialized x-y-z-Contours with the same properties
static member initXyz
(
?Color: Color,
?End: float,
?Highlight: bool,
?HighlightColor: Color,
?HighlightWidth: float,
?Project: ContourProject,
?Show: bool,
?Size: float,
?Start: float,
?UseColorMap: bool,
?Width: float
) =
Contours()
|> Contours.styleXyz (
?Color = Color,
?End = End,
?Highlight = Highlight,
?HighlightColor = HighlightColor,
?HighlightWidth = HighlightWidth,
?Project = Project,
?Show = Show,
?Size = Size,
?Start = Start,
?UseColorMap = UseColorMap,
?Width = Width
)
// Applies the styles to Contours()
static member styleXyz
(
?Color: Color,
?End: float,
?Highlight: bool,
?HighlightColor: Color,
?HighlightWidth: float,
?Project: ContourProject,
?Show: bool,
?Size: float,
?Start: float,
?UseColorMap: bool,
?Width: float
) =
(fun (contours: Contours) ->
let xyzContour =
Contour.init (
?Show = Show,
?Color = Color,
?UseColorMap = UseColorMap,
?Width = Width,
?Highlight = Highlight,
?HighlightColor = HighlightColor,
?HighlightWidth = HighlightWidth,
?Project = Project
)
contours |> Contours.style (X = xyzContour, Y = xyzContour, Z = xyzContour))