-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathChartPolar_Bar.fs
More file actions
256 lines (238 loc) · 12.7 KB
/
Copy pathChartPolar_Bar.fs
File metadata and controls
256 lines (238 loc) · 12.7 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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
namespace Plotly.NET
open Plotly.NET.LayoutObjects
open Plotly.NET.TraceObjects
open DynamicObj
open System
open System.IO
open StyleParam
open System.Runtime.InteropServices
open System.Runtime.CompilerServices
[<AutoOpen>]
module ChartPolar_Bar =
[<Extension>]
type Chart =
/// <summary>
/// Creates a polar bar chart.
///
/// A polar bar chart is a chart that presents categorical data on a polar coordinate system with bars with radial height proportional to the values that they represent.
/// </summary>
/// <param name="r">Sets the radial height of the bars</param>
/// <param name="theta">sets the angular position of the bars</param>
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
/// <param name="Opacity">Sets the opactity of the trace</param>
/// <param name="MultiOpacity">Sets the opactity of individual datum markers</param>
/// <param name="Text">Sets a text associated with each datum</param>
/// <param name="MultiText">Sets individual text for each datum</param>
/// <param name="MarkerColor">Sets the color of the bars</param>
/// <param name="MarkerColorScale">Sets the colorscale of the bars</param>
/// <param name="MarkerOutline">Sets the color of the bar outline</param>
/// <param name="MarkerPatternShape">Sets the pattern shape for all bars</param>
/// <param name="MultiMarkerPatternShape">Sets individual pattern shapes for the bars</param>
/// <param name="MarkerPattern">Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments).</param>
/// <param name="Marker">Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments).</param>
/// <param name="Base">Sets where the bar base is drawn (in position axis units).</param>
/// <param name="Width">Sets the bar width (in position axis units) of all bars.</param>
/// <param name="MultiWidth">Sets the individual bar width (in position axis units) for each bar.</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
[<Extension>]
static member BarPolar
(
r: seq<#IConvertible>,
theta: seq<#IConvertible>,
?Name: string,
?ShowLegend: bool,
?Opacity: float,
?MultiOpacity: seq<float>,
?Text: #IConvertible,
?MultiText: seq<#IConvertible>,
?MarkerColor: Color,
?MarkerColorScale: StyleParam.Colorscale,
?MarkerOutline: Line,
?MarkerPatternShape: StyleParam.PatternShape,
?MultiMarkerPatternShape: seq<StyleParam.PatternShape>,
?MarkerPattern: Pattern,
?Marker: Marker,
?Base: #IConvertible,
?Width: #IConvertible,
?MultiWidth: seq<#IConvertible>,
?UseDefaults: bool
) =
let useDefaults =
defaultArg UseDefaults true
let pattern =
MarkerPattern
|> Option.defaultValue (TraceObjects.Pattern.init ())
|> TraceObjects.Pattern.style (?Shape = MarkerPatternShape, ?MultiShape = MultiMarkerPatternShape)
let marker =
Marker
|> Option.defaultValue (TraceObjects.Marker.init ())
|> TraceObjects.Marker.style (
?Color = MarkerColor,
Pattern = pattern,
?MultiOpacity = MultiOpacity,
?Colorscale = MarkerColorScale,
?Outline = MarkerOutline
)
TracePolar.initBarPolar (
TracePolarStyle.BarPolar(
R = r,
Theta = theta,
Marker = marker,
?Name = Name,
?ShowLegend = ShowLegend,
?Opacity = Opacity,
?Text = Text,
?MultiText = MultiText,
?Base = Base,
?Width = Width,
?MultiWidth = MultiWidth
)
)
|> GenericChart.ofTraceObject useDefaults
/// <summary>
/// Creates a polar bar chart.
///
/// A polar bar chart is a chart that presents categorical data on a polar coordinate system with bars with radial height proportional to the values that they represent.
/// </summary>
/// <param name="rTheta">Sets the radial height and angular position of the bars</param>
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
/// <param name="Opacity">Sets the opactity of the trace</param>
/// <param name="MultiOpacity">Sets the opactity of individual datum markers</param>
/// <param name="Text">Sets a text associated with each datum</param>
/// <param name="MultiText">Sets individual text for each datum</param>
/// <param name="MarkerColor">Sets the color of the bars</param>
/// <param name="MarkerColorScale">Sets the colorscale of the bars</param>
/// <param name="MarkerOutline">Sets the color of the bar outline</param>
/// <param name="MarkerPatternShape">Sets the pattern shape for all bars</param>
/// <param name="MultiMarkerPatternShape">Sets individual pattern shapes for the bars</param>
/// <param name="MarkerPattern">Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments).</param>
/// <param name="Marker">Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments).</param>
/// <param name="Base">Sets where the bar base is drawn (in position axis units).</param>
/// <param name="Width">Sets the bar width (in position axis units) of all bars.</param>
/// <param name="MultiWidth">Sets the individual bar width (in position axis units) for each bar.</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
[<Extension>]
static member BarPolar
(
rTheta: seq<#IConvertible * #IConvertible>,
?Name: string,
?ShowLegend: bool,
?Opacity: float,
?MultiOpacity: seq<float>,
?Text: #IConvertible,
?MultiText: seq<#IConvertible>,
?MarkerColor: Color,
?MarkerColorScale: StyleParam.Colorscale,
?MarkerOutline: Line,
?MarkerPatternShape: StyleParam.PatternShape,
?MultiMarkerPatternShape: seq<StyleParam.PatternShape>,
?MarkerPattern: Pattern,
?Marker: Marker,
?Base: #IConvertible,
?Width: #IConvertible,
?MultiWidth: seq<#IConvertible>,
?UseDefaults: bool
) =
let r, theta = Seq.unzip rTheta
Chart.BarPolar(
r,
theta,
?Name = Name,
?ShowLegend = ShowLegend,
?Opacity = Opacity,
?MultiOpacity = MultiOpacity,
?Text = Text,
?MultiText = MultiText,
?MarkerColor = MarkerColor,
?MarkerColorScale = MarkerColorScale,
?MarkerOutline = MarkerOutline,
?MarkerPatternShape = MarkerPatternShape,
?MultiMarkerPatternShape = MultiMarkerPatternShape,
?MarkerPattern = MarkerPattern,
?Marker = Marker,
?Base = Base,
?Width = Width,
?MultiWidth = MultiWidth,
?UseDefaults = UseDefaults
)
/// <summary>
/// Creates a polar bar chart from encoded radial and angular coordinates.
///
/// A polar bar chart is a chart that presents categorical data on a polar coordinate system with bars with radial height proportional to the values that they represent.
/// </summary>
/// <param name="rEncoded">Sets the radial height of the bars as an encoded typed array.</param>
/// <param name="thetaEncoded">Sets the angular position of the bars as an encoded typed array.</param>
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
/// <param name="Opacity">Sets the opactity of the trace</param>
/// <param name="MultiOpacity">Sets the opactity of individual datum markers</param>
/// <param name="Text">Sets a text associated with each datum</param>
/// <param name="MultiText">Sets individual text for each datum</param>
/// <param name="MarkerColor">Sets the color of the bars</param>
/// <param name="MarkerColorScale">Sets the colorscale of the bars</param>
/// <param name="MarkerOutline">Sets the color of the bar outline</param>
/// <param name="MarkerPatternShape">Sets the pattern shape for all bars</param>
/// <param name="MultiMarkerPatternShape">Sets individual pattern shapes for the bars</param>
/// <param name="MarkerPattern">Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments).</param>
/// <param name="Marker">Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments).</param>
/// <param name="Base">Sets where the bar base is drawn (in position axis units).</param>
/// <param name="Width">Sets the bar width (in position axis units) of all bars.</param>
/// <param name="MultiWidthEncoded">Sets the individual bar width (in position axis units) for each bar as an encoded typed array.</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
[<Extension>]
static member BarPolar
(
rEncoded: EncodedTypedArray,
thetaEncoded: EncodedTypedArray,
?Name: string,
?ShowLegend: bool,
?Opacity: float,
?MultiOpacity: seq<float>,
?Text: #IConvertible,
?MultiText: seq<#IConvertible>,
?MarkerColor: Color,
?MarkerColorScale: StyleParam.Colorscale,
?MarkerOutline: Line,
?MarkerPatternShape: StyleParam.PatternShape,
?MultiMarkerPatternShape: seq<StyleParam.PatternShape>,
?MarkerPattern: Pattern,
?Marker: Marker,
?Base: #IConvertible,
?Width: #IConvertible,
?MultiWidthEncoded: EncodedTypedArray,
?UseDefaults: bool
) =
let useDefaults =
defaultArg UseDefaults true
let pattern =
MarkerPattern
|> Option.defaultValue (TraceObjects.Pattern.init ())
|> TraceObjects.Pattern.style (?Shape = MarkerPatternShape, ?MultiShape = MultiMarkerPatternShape)
let marker =
Marker
|> Option.defaultValue (TraceObjects.Marker.init ())
|> TraceObjects.Marker.style (
?Color = MarkerColor,
Pattern = pattern,
?MultiOpacity = MultiOpacity,
?Colorscale = MarkerColorScale,
?Outline = MarkerOutline
)
TracePolar.initBarPolar (
TracePolarStyle.BarPolar(
REncoded = rEncoded,
ThetaEncoded = thetaEncoded,
Marker = marker,
?Name = Name,
?ShowLegend = ShowLegend,
?Opacity = Opacity,
?Text = Text,
?MultiText = MultiText,
?Base = Base,
?Width = Width,
?MultiWidthEncoded = MultiWidthEncoded
)
)
|> GenericChart.ofTraceObject useDefaults