11namespace Plotly.NET
22
3+ open Plotly.NET .LayoutObjects
4+ open Plotly.NET .TraceObjects
35open System
46open System.IO
57
@@ -39,7 +41,7 @@ module GenericChartExtensions =
3941 [<CompiledName( " WithMarker" ) >]
4042 [<Extension>]
4143 member this.WithMarker ( marker : Marker ) =
42- this |> mapTrace ( Trace.TraceStyle.SetMarker ( marker))
44+ this |> Chart.withMarker marker
4345
4446 /// Apply styling to the Marker(s) of the chart.
4547 [<CompiledName( " WithMarkerStyle" ) >]
@@ -51,17 +53,19 @@ module GenericChartExtensions =
5153 [<Optional; DefaultParameterValue( null ) >] ? Symbol ,
5254 [<Optional; DefaultParameterValue( null ) >] ? Opacity
5355 ) =
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+ )
5963
6064 /// Apply styling to the Line(s) of the chart as Object.
6165 [<CompiledName( " WithLine" ) >]
6266 [<Extension>]
6367 member this.WithLine ( line : Line ) =
64- this |> mapTrace ( Trace.TraceStyle.SetLine ( line))
68+ this |> Chart.withLine line
6569
6670 /// Apply styling to the Line(s) of the chart.
6771 [<CompiledName( " WithLineStyle" ) >]
@@ -75,17 +79,21 @@ module GenericChartExtensions =
7579 [<Optional; DefaultParameterValue( null ) >] ? Smoothing ,
7680 [<Optional; DefaultParameterValue( null ) >] ? Colorscale
7781 ) =
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+ )
8391
8492 /// Apply styling to the xError(s) of the chart as Object
8593 [<CompiledName( " WithXError" ) >]
8694 [<Extension>]
8795 member this.WithXError ( xError : Error ) =
88- this |> mapTrace ( Trace.TraceStyle.SetErrorX ( xError))
96+ this |> Chart.withXError xError
8997
9098 /// Apply styling to the xError(s) of the chart as Object
9199 [<CompiledName( " WithXErrorStyle" ) >]
@@ -106,7 +114,7 @@ module GenericChartExtensions =
106114 [<CompiledName( " WithYError" ) >]
107115 [<Extension>]
108116 member this.WithYError ( yError : Error ) =
109- this |> mapTrace ( Trace. TraceStyle.SetErrorY( yError))
117+ this |> mapTrace ( TraceStyle.SetErrorY( yError))
110118
111119 /// Apply styling to the yError(s) of the chart as Object
112120 [<CompiledName( " WithYErrorStyle" ) >]
@@ -127,7 +135,7 @@ module GenericChartExtensions =
127135 [<CompiledName( " WithZError" ) >]
128136 [<Extension>]
129137 member this.WithZError ( zError : Error ) =
130- this |> mapTrace ( Trace. TraceStyle.SetErrorZ( zError))
138+ this |> mapTrace ( TraceStyle.SetErrorZ( zError))
131139
132140
133141 /// Apply styling to the zError(s) of the chart as Object
@@ -152,7 +160,7 @@ module GenericChartExtensions =
152160 // Sets x-Axis of 2d and 3d- Charts
153161 [<CompiledName( " WithXAxis" ) >]
154162 [<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 ) =
156164 this |> Chart.withXAxis( xAxis, ?Id = Id)
157165
158166 // Sets x-Axis of 2d and 3d- Charts
@@ -171,7 +179,7 @@ module GenericChartExtensions =
171179 [<Optional; DefaultParameterValue( null ) >] ? Anchor ) =
172180 let range = if MinMax.IsSome then Some ( StyleParam.Range.MinMax ( MinMax.Value)) else None
173181 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,
175183 ?Anchor= Anchor,? Side= Side,? Domain= domain,? Overlaying= Overlaying,? Position= Position,? ZeroLine= ZeroLine)
176184 this |> Chart.withXAxis( xaxis,? Id= Id)
177185
@@ -180,13 +188,13 @@ module GenericChartExtensions =
180188 [<Extension>]
181189 member this.WithXAxisRangeSlider ( rangeSlider : RangeSlider ,
182190 [<Optional; DefaultParameterValue( null ) >] ? Id ) =
183- let xaxis = Axis. LinearAxis.init( RangeSlider = rangeSlider)
191+ let xaxis = LinearAxis.init( RangeSlider = rangeSlider)
184192 this |> Chart.withXAxis( xaxis,? Id= Id)
185193
186194 // Sets y-Axis of 2d and 3d- Charts
187195 [<CompiledName( " WithYAxis" ) >]
188196 [<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 ) =
190198 this |> Chart.withYAxis( yAxis, ?Id = Id)
191199
192200 // Sets y-Axis of 3d- Charts
@@ -205,15 +213,15 @@ module GenericChartExtensions =
205213 [<Optional; DefaultParameterValue( null ) >] ? Anchor ) =
206214 let range = if MinMax.IsSome then Some ( StyleParam.Range.MinMax ( MinMax.Value)) else None
207215 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,
209217 ?ShowLine= ShowLine,? Anchor= Anchor,? Side= Side,? Domain= domain,? Overlaying= Overlaying,? Position= Position,? ZeroLine= ZeroLine)
210218 this |> Chart.withYAxis( yaxis,? Id= Id)
211219
212220
213221 // Sets z-Axis of 3d- Charts
214222 [<CompiledName( " WithZAxis" ) >]
215223 [<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 ) =
217225 this |> Chart.withZAxis( zAxis, ?Id= Id)
218226
219227
@@ -229,7 +237,7 @@ module GenericChartExtensions =
229237 [<Optional; DefaultParameterValue( null ) >] ? Anchor ) =
230238 let range = if MinMax.IsSome then Some ( StyleParam.Range.MinMax ( MinMax.Value)) else None
231239 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)
233241 this |> Chart.withZAxis( zaxis)
234242
235243 [<CompiledName( " WithColorBar" ) >]
@@ -384,8 +392,8 @@ module GenericChartExtensions =
384392 [<Optional; DefaultParameterValue( null ) >] ? FrameColor ,
385393 [<Optional; DefaultParameterValue( null ) >] ? FrameWidth : float ,
386394 [<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
389397 ) =
390398 this
391399 |> Chart.withGeoStyle(
@@ -513,7 +521,7 @@ module GenericChartExtensions =
513521 member this.WithLegend ( showlegend ) =
514522 let layout =
515523 Layout()
516- |> Layout.style( Showlegend = showlegend)
524+ |> Layout.style( ShowLegend = showlegend)
517525 GenericChart.addLayout layout this
518526
519527 // Set the size of a Chart
@@ -633,17 +641,17 @@ module GenericChartExtensions =
633641
634642 /// Sets the angular axis of the polar object with the given id on the chart layout
635643 [<CompiledName( " WithAngularAxis" ) >]
636- member this.WithAngularAxis ( angularAxis : Axis. AngularAxis, [<Optional; DefaultParameterValue( null ) >] ? Id ) =
644+ member this.WithAngularAxis ( angularAxis : AngularAxis , [<Optional; DefaultParameterValue( null ) >] ? Id ) =
637645 this |> Chart.withAngularAxis( angularAxis,? Id= Id)
638646
639647 /// Sets the radial axis of the polar object with the given id on the chart layout
640648 [<CompiledName( " WithRadialAxis" ) >]
641- member this.WithRadialAxis ( radialAxis : Axis. RadialAxis, [<Optional; DefaultParameterValue( null ) >] ? Id ) =
649+ member this.WithRadialAxis ( radialAxis : RadialAxis , [<Optional; DefaultParameterValue( null ) >] ? Id ) =
642650 this |> Chart.withRadialAxis( radialAxis,? Id= Id)
643651
644652 /// Sets the color axis of the color axis with the given id on the chart layout
645653 [<CompiledName( " WithColorAxis" ) >]
646- member this.WithColorAxis ( colorAxis : Axis. ColorAxis, [<Optional; DefaultParameterValue( null ) >] ? Id ) =
654+ member this.WithColorAxis ( colorAxis : ColorAxis , [<Optional; DefaultParameterValue( null ) >] ? Id ) =
647655 this |> Chart.withColorAxis( colorAxis,? Id= Id)
648656
649657 /// Sets the scene object with the given id on the chart layout
0 commit comments