1
1
namespace Plotly.NET
2
2
3
+ open Plotly.NET .LayoutObjects
4
+ open Plotly.NET .TraceObjects
3
5
open System
4
6
open System.IO
5
7
@@ -39,7 +41,7 @@ module GenericChartExtensions =
39
41
[<CompiledName( " WithMarker" ) >]
40
42
[<Extension>]
41
43
member this.WithMarker ( marker : Marker ) =
42
- this |> mapTrace ( Trace.TraceStyle.SetMarker ( marker))
44
+ this |> Chart.withMarker marker
43
45
44
46
/// Apply styling to the Marker(s) of the chart.
45
47
[<CompiledName( " WithMarkerStyle" ) >]
@@ -51,17 +53,19 @@ module GenericChartExtensions =
51
53
[<Optional; DefaultParameterValue( null ) >] ? Symbol ,
52
54
[<Optional; DefaultParameterValue( null ) >] ? Opacity
53
55
) =
54
- let marker =
55
- Marker.init (
56
- ?Size= Size,? Color= Color,? Symbol= Symbol,? Opacity= Opacity
57
- )
58
- this |> Chart.withMarker( marker)
56
+ this
57
+ |> Chart.withMarkerStyle(
58
+ ?Size= Size,
59
+ ?Color= Color,
60
+ ?Symbol= Symbol,
61
+ ?Opacity= Opacity
62
+ )
59
63
60
64
/// Apply styling to the Line(s) of the chart as Object.
61
65
[<CompiledName( " WithLine" ) >]
62
66
[<Extension>]
63
67
member this.WithLine ( line : Line ) =
64
- this |> mapTrace ( Trace.TraceStyle.SetLine ( line))
68
+ this |> Chart.withLine line
65
69
66
70
/// Apply styling to the Line(s) of the chart.
67
71
[<CompiledName( " WithLineStyle" ) >]
@@ -75,17 +79,21 @@ module GenericChartExtensions =
75
79
[<Optional; DefaultParameterValue( null ) >] ? Smoothing ,
76
80
[<Optional; DefaultParameterValue( null ) >] ? Colorscale
77
81
) =
78
- let line =
79
- Line.init (
80
- ?Width= Width,? Color= Color,? Shape= Shape,? Dash= Dash,? Smoothing= Smoothing,? Colorscale= Colorscale)
81
-
82
- this |> Chart.withLine( line)
82
+ this
83
+ |> Chart.withLineStyle(
84
+ ?Width= Width,
85
+ ?Color= Color,
86
+ ?Shape= Shape,
87
+ ?Dash= Dash,
88
+ ?Smoothing= Smoothing,
89
+ ?Colorscale= Colorscale
90
+ )
83
91
84
92
/// Apply styling to the xError(s) of the chart as Object
85
93
[<CompiledName( " WithXError" ) >]
86
94
[<Extension>]
87
95
member this.WithXError ( xError : Error ) =
88
- this |> mapTrace ( Trace.TraceStyle.SetErrorX ( xError))
96
+ this |> Chart.withXError xError
89
97
90
98
/// Apply styling to the xError(s) of the chart as Object
91
99
[<CompiledName( " WithXErrorStyle" ) >]
@@ -106,7 +114,7 @@ module GenericChartExtensions =
106
114
[<CompiledName( " WithYError" ) >]
107
115
[<Extension>]
108
116
member this.WithYError ( yError : Error ) =
109
- this |> mapTrace ( Trace. TraceStyle.SetErrorY( yError))
117
+ this |> mapTrace ( TraceStyle.SetErrorY( yError))
110
118
111
119
/// Apply styling to the yError(s) of the chart as Object
112
120
[<CompiledName( " WithYErrorStyle" ) >]
@@ -127,7 +135,7 @@ module GenericChartExtensions =
127
135
[<CompiledName( " WithZError" ) >]
128
136
[<Extension>]
129
137
member this.WithZError ( zError : Error ) =
130
- this |> mapTrace ( Trace. TraceStyle.SetErrorZ( zError))
138
+ this |> mapTrace ( TraceStyle.SetErrorZ( zError))
131
139
132
140
133
141
/// Apply styling to the zError(s) of the chart as Object
@@ -152,7 +160,7 @@ module GenericChartExtensions =
152
160
// Sets x-Axis of 2d and 3d- Charts
153
161
[<CompiledName( " WithXAxis" ) >]
154
162
[<Extension>]
155
- member this.WithXAxis ( xAxis : Axis. LinearAxis, [<Optional; DefaultParameterValue( null ) >] ? Id : StyleParam.SubPlotId ) =
163
+ member this.WithXAxis ( xAxis : LinearAxis , [<Optional; DefaultParameterValue( null ) >] ? Id : StyleParam.SubPlotId ) =
156
164
this |> Chart.withXAxis( xAxis, ?Id = Id)
157
165
158
166
// Sets x-Axis of 2d and 3d- Charts
@@ -171,7 +179,7 @@ module GenericChartExtensions =
171
179
[<Optional; DefaultParameterValue( null ) >] ? Anchor ) =
172
180
let range = if MinMax.IsSome then Some ( StyleParam.Range.MinMax ( MinMax.Value)) else None
173
181
let domain = if Domain.IsSome then Some ( StyleParam.Range.MinMax ( Domain.Value)) else None
174
- let xaxis = Axis. LinearAxis.init( Title= title,? Range= range,? ShowGrid= ShowGrid,? ShowLine= ShowLine,
182
+ let xaxis = LinearAxis.init( Title= title,? Range= range,? ShowGrid= ShowGrid,? ShowLine= ShowLine,
175
183
?Anchor= Anchor,? Side= Side,? Domain= domain,? Overlaying= Overlaying,? Position= Position,? ZeroLine= ZeroLine)
176
184
this |> Chart.withXAxis( xaxis,? Id= Id)
177
185
@@ -180,13 +188,13 @@ module GenericChartExtensions =
180
188
[<Extension>]
181
189
member this.WithXAxisRangeSlider ( rangeSlider : RangeSlider ,
182
190
[<Optional; DefaultParameterValue( null ) >] ? Id ) =
183
- let xaxis = Axis. LinearAxis.init( RangeSlider = rangeSlider)
191
+ let xaxis = LinearAxis.init( RangeSlider = rangeSlider)
184
192
this |> Chart.withXAxis( xaxis,? Id= Id)
185
193
186
194
// Sets y-Axis of 2d and 3d- Charts
187
195
[<CompiledName( " WithYAxis" ) >]
188
196
[<Extension>]
189
- member this.WithYAxis ( yAxis : Axis. LinearAxis, [<Optional; DefaultParameterValue( null ) >] ? Id : StyleParam.SubPlotId ) =
197
+ member this.WithYAxis ( yAxis : LinearAxis , [<Optional; DefaultParameterValue( null ) >] ? Id : StyleParam.SubPlotId ) =
190
198
this |> Chart.withYAxis( yAxis, ?Id = Id)
191
199
192
200
// Sets y-Axis of 3d- Charts
@@ -205,15 +213,15 @@ module GenericChartExtensions =
205
213
[<Optional; DefaultParameterValue( null ) >] ? Anchor ) =
206
214
let range = if MinMax.IsSome then Some ( StyleParam.Range.MinMax ( MinMax.Value)) else None
207
215
let domain = if Domain.IsSome then Some ( StyleParam.Range.MinMax ( Domain.Value)) else None
208
- let yaxis = Axis. LinearAxis.init( Title= title,? Range= range,? ShowGrid= ShowGrid,
216
+ let yaxis = LinearAxis.init( Title= title,? Range= range,? ShowGrid= ShowGrid,
209
217
?ShowLine= ShowLine,? Anchor= Anchor,? Side= Side,? Domain= domain,? Overlaying= Overlaying,? Position= Position,? ZeroLine= ZeroLine)
210
218
this |> Chart.withYAxis( yaxis,? Id= Id)
211
219
212
220
213
221
// Sets z-Axis of 3d- Charts
214
222
[<CompiledName( " WithZAxis" ) >]
215
223
[<Extension>]
216
- member this.WithZAxis ( zAxis : Axis. LinearAxis, [<Optional; DefaultParameterValue( null ) >] ? Id : StyleParam.SubPlotId ) =
224
+ member this.WithZAxis ( zAxis : LinearAxis , [<Optional; DefaultParameterValue( null ) >] ? Id : StyleParam.SubPlotId ) =
217
225
this |> Chart.withZAxis( zAxis, ?Id= Id)
218
226
219
227
@@ -229,7 +237,7 @@ module GenericChartExtensions =
229
237
[<Optional; DefaultParameterValue( null ) >] ? Anchor ) =
230
238
let range = if MinMax.IsSome then Some ( StyleParam.Range.MinMax ( MinMax.Value)) else None
231
239
let domain = if Domain.IsSome then Some ( StyleParam.Range.MinMax ( Domain.Value)) else None
232
- let zaxis = Axis. LinearAxis.init( Title= title,? Range= range,? ShowGrid= ShowGrid,? ShowLine= ShowLine,? Anchor= Anchor,? Domain= domain)
240
+ let zaxis = LinearAxis.init( Title= title,? Range= range,? ShowGrid= ShowGrid,? ShowLine= ShowLine,? Anchor= Anchor,? Domain= domain)
233
241
this |> Chart.withZAxis( zaxis)
234
242
235
243
[<CompiledName( " WithColorBar" ) >]
@@ -384,8 +392,8 @@ module GenericChartExtensions =
384
392
[<Optional; DefaultParameterValue( null ) >] ? FrameColor ,
385
393
[<Optional; DefaultParameterValue( null ) >] ? FrameWidth : float ,
386
394
[<Optional; DefaultParameterValue( null ) >] ? BgColor ,
387
- [<Optional; DefaultParameterValue( null ) >] ? LatAxis : Axis. LinearAxis,
388
- [<Optional; DefaultParameterValue( null ) >] ? LonAxis : Axis. LinearAxis
395
+ [<Optional; DefaultParameterValue( null ) >] ? LatAxis : LinearAxis ,
396
+ [<Optional; DefaultParameterValue( null ) >] ? LonAxis : LinearAxis
389
397
) =
390
398
this
391
399
|> Chart.withGeoStyle(
@@ -513,7 +521,7 @@ module GenericChartExtensions =
513
521
member this.WithLegend ( showlegend ) =
514
522
let layout =
515
523
Layout()
516
- |> Layout.style( Showlegend = showlegend)
524
+ |> Layout.style( ShowLegend = showlegend)
517
525
GenericChart.addLayout layout this
518
526
519
527
// Set the size of a Chart
@@ -633,17 +641,17 @@ module GenericChartExtensions =
633
641
634
642
/// Sets the angular axis of the polar object with the given id on the chart layout
635
643
[<CompiledName( " WithAngularAxis" ) >]
636
- member this.WithAngularAxis ( angularAxis : Axis. AngularAxis, [<Optional; DefaultParameterValue( null ) >] ? Id ) =
644
+ member this.WithAngularAxis ( angularAxis : AngularAxis , [<Optional; DefaultParameterValue( null ) >] ? Id ) =
637
645
this |> Chart.withAngularAxis( angularAxis,? Id= Id)
638
646
639
647
/// Sets the radial axis of the polar object with the given id on the chart layout
640
648
[<CompiledName( " WithRadialAxis" ) >]
641
- member this.WithRadialAxis ( radialAxis : Axis. RadialAxis, [<Optional; DefaultParameterValue( null ) >] ? Id ) =
649
+ member this.WithRadialAxis ( radialAxis : RadialAxis , [<Optional; DefaultParameterValue( null ) >] ? Id ) =
642
650
this |> Chart.withRadialAxis( radialAxis,? Id= Id)
643
651
644
652
/// Sets the color axis of the color axis with the given id on the chart layout
645
653
[<CompiledName( " WithColorAxis" ) >]
646
- member this.WithColorAxis ( colorAxis : Axis. ColorAxis, [<Optional; DefaultParameterValue( null ) >] ? Id ) =
654
+ member this.WithColorAxis ( colorAxis : ColorAxis , [<Optional; DefaultParameterValue( null ) >] ? Id ) =
647
655
this |> Chart.withColorAxis( colorAxis,? Id= Id)
648
656
649
657
/// Sets the scene object with the given id on the chart layout
0 commit comments