@@ -39,7 +39,7 @@ type Trace(traceTypeName: string) =
3939 /// <param name="marker">The new marker object</param>
4040 static member setMarker ( marker : Marker ) =
4141 ( fun ( trace : ( 'T : > Trace )) ->
42- trace.SetValue ( " marker" , marker)
42+ trace.SetProperty ( " marker" , marker)
4343 trace)
4444
4545 /// <summary>
@@ -49,7 +49,7 @@ type Trace(traceTypeName: string) =
4949 static member updateMarker ( marker : Marker ) =
5050 ( fun ( trace : #Trace ) ->
5151 let combined =
52- ( DynObj.combine ( trace |> Trace.getMarker) marker) :?> Marker
52+ ( DynObj.combine ( trace |> Trace.getMarker) marker)
5353
5454 trace |> Trace.setMarker combined)
5555
@@ -68,7 +68,7 @@ type Trace(traceTypeName: string) =
6868 /// <param name="line">The new line object</param>
6969 static member setLine ( line : Line ) =
7070 ( fun ( trace : #Trace ) ->
71- trace.SetValue ( " line" , line)
71+ trace.SetProperty ( " line" , line)
7272 trace)
7373
7474 /// <summary>
@@ -78,7 +78,7 @@ type Trace(traceTypeName: string) =
7878 static member updateLine ( line : Line ) =
7979 ( fun ( trace : #Trace ) ->
8080 let combined =
81- ( DynObj.combine ( trace |> Trace.getLine) line) :?> Line
81+ ( DynObj.combine ( trace |> Trace.getLine) line)
8282
8383 trace |> Trace.setLine combined)
8484
@@ -97,7 +97,7 @@ type Trace(traceTypeName: string) =
9797 /// <param name="error">The new error object</param>
9898 static member setXError ( error : Error ) =
9999 ( fun ( trace : #Trace ) ->
100- trace.SetValue ( " error_x" , error)
100+ trace.SetProperty ( " error_x" , error)
101101 trace)
102102
103103 /// <summary>
@@ -107,7 +107,7 @@ type Trace(traceTypeName: string) =
107107 static member updateXError ( error : Error ) =
108108 ( fun ( trace : #Trace ) ->
109109 let combined =
110- ( DynObj.combine ( trace |> Trace.getXError) error) :?> Error
110+ ( DynObj.combine ( trace |> Trace.getXError) error)
111111
112112 trace |> Trace.setXError combined)
113113
@@ -126,7 +126,7 @@ type Trace(traceTypeName: string) =
126126 /// <param name="error">The new error object</param>
127127 static member setYError ( error : Error ) =
128128 ( fun ( trace : #Trace ) ->
129- trace.SetValue ( " error_y" , error)
129+ trace.SetProperty ( " error_y" , error)
130130 trace)
131131
132132 /// <summary>
@@ -136,7 +136,7 @@ type Trace(traceTypeName: string) =
136136 static member updateYError ( error : Error ) =
137137 ( fun ( trace : #Trace ) ->
138138 let combined =
139- ( DynObj.combine ( trace |> Trace.getYError) error) :?> Error
139+ ( DynObj.combine ( trace |> Trace.getYError) error)
140140
141141 trace |> Trace.setYError combined)
142142
@@ -155,7 +155,7 @@ type Trace(traceTypeName: string) =
155155 /// <param name="error">The new error object</param>
156156 static member setZError ( error : Error ) =
157157 ( fun ( trace : #Trace ) ->
158- trace.SetValue ( " error_z" , error)
158+ trace.SetProperty ( " error_z" , error)
159159 trace)
160160
161161 /// <summary>
@@ -165,7 +165,7 @@ type Trace(traceTypeName: string) =
165165 static member updateZError ( error : Error ) =
166166 ( fun ( trace : #Trace ) ->
167167 let combined =
168- ( DynObj.combine ( trace |> Trace.getZError) error) :?> Error
168+ ( DynObj.combine ( trace |> Trace.getZError) error)
169169
170170 trace |> Trace.setZError combined)
171171
@@ -193,7 +193,7 @@ type Trace(traceTypeName: string) =
193193 StyleParam.SubPlotId.ColorAxis colorAxisId
194194
195195 ( fun ( trace : #Trace ) ->
196- trace.SetValue ( " coloraxis" , StyleParam.SubPlotId.convert id)
196+ trace.SetProperty ( " coloraxis" , StyleParam.SubPlotId.convert id)
197197 trace)
198198
199199 /// <summary>
@@ -220,7 +220,7 @@ type Trace(traceTypeName: string) =
220220 StyleParam.SubPlotId.Legend legendId
221221
222222 ( fun ( trace : #Trace ) ->
223- trace.SetValue ( " legend" , StyleParam.SubPlotId.convert id)
223+ trace.SetProperty ( " legend" , StyleParam.SubPlotId.convert id)
224224 trace)
225225
226226 /// <summary>
@@ -238,7 +238,7 @@ type Trace(traceTypeName: string) =
238238 /// <param name="domain">The new domain</param>
239239 static member setDomain ( domain : Domain ) =
240240 ( fun ( trace : ( 'T : > Trace )) ->
241- trace.SetValue ( " domain" , domain)
241+ trace.SetProperty ( " domain" , domain)
242242 trace)
243243
244244 /// <summary>
@@ -248,7 +248,7 @@ type Trace(traceTypeName: string) =
248248 static member updateDomain ( domain : Domain ) =
249249 ( fun ( trace : #Trace ) ->
250250 let combined =
251- ( DynObj.combine ( trace |> Trace.getDomain) domain) :?> Domain
251+ ( DynObj.combine ( trace |> Trace.getDomain) domain)
252252
253253 trace |> Trace.setDomain combined)
254254
@@ -267,7 +267,7 @@ type Trace(traceTypeName: string) =
267267 /// <param name="stackgroup">The new stackgroup</param>
268268 static member setStackGroup ( stackgroup : string ) =
269269 ( fun ( trace : ( 'T : > Trace )) ->
270- trace.SetValue ( " stackgroup" , stackgroup)
270+ trace.SetProperty ( " stackgroup" , stackgroup)
271271 trace)
272272
273273 /// <summary>
@@ -286,7 +286,7 @@ type Trace(traceTypeName: string) =
286286 static member setColorBar ( colorBar : ColorBar ) =
287287 ( fun ( trace : ( 'T : > Trace )) ->
288288
289- trace.SetValue ( " colorbar" , colorBar)
289+ trace.SetProperty ( " colorbar" , colorBar)
290290 trace)
291291
292292 /// <summary>
@@ -296,7 +296,7 @@ type Trace(traceTypeName: string) =
296296 static member updateColorBar ( colorBar : ColorBar ) =
297297 ( fun ( trace : #Trace ) ->
298298 let combined =
299- ( DynObj.combine ( trace |> Trace.getColorBar) colorBar) :?> ColorBar
299+ DynObj.combine ( trace |> Trace.getColorBar) colorBar
300300
301301 trace |> Trace.setColorBar combined)
302302
@@ -327,16 +327,14 @@ type TraceStyle() =
327327 [<Optional; DefaultParameterValue( null ) >] ? LegendGroup : string ,
328328 [<Optional; DefaultParameterValue( null ) >] ? LegendGroupTitle : Title
329329 ) =
330- ( fun ( trace : ( 'T : > Trace )) ->
331-
332- Name |> DynObj.setOptionalProperty trace " name"
333- Visible |> DynObj.setOptionalPropertyBy trace " visible" StyleParam.Visible.convert
334- ShowLegend |> DynObj.setOptionalProperty trace " showlegend"
335- LegendRank |> DynObj.setOptionalProperty trace " legendrank"
336- LegendGroup |> DynObj.setOptionalProperty trace " legendgroup"
337- LegendGroupTitle |> DynObj.setOptionalProperty trace " legendgrouptitle"
338-
339- trace)
330+ fun ( trace : #Trace ) ->
331+ trace
332+ |> DynObj.withOptionalProperty " name" Name
333+ |> DynObj.withOptionalPropertyBy " visible" Visible StyleParam.Visible.convert
334+ |> DynObj.withOptionalProperty " showlegend" ShowLegend
335+ |> DynObj.withOptionalProperty " legendrank" LegendRank
336+ |> DynObj.withOptionalProperty " legendgroup" LegendGroup
337+ |> DynObj.withOptionalProperty " legendgrouptitle" LegendGroupTitle
340338
341339 /// <summary>
342340 /// Returns a function that applies the given styles to the trace's marker object. Overwrites attributes with the same name that are already set.
@@ -704,13 +702,11 @@ type TraceStyle() =
704702 [<Optional; DefaultParameterValue( null ) >] ? Selected : TraceSelection ,
705703 [<Optional; DefaultParameterValue( null ) >] ? Unselected : TraceSelection
706704 ) =
707- ( fun ( trace : ( 'T : > Trace )) ->
708-
709- SelectedPoints |> DynObj.setOptionalProperty trace " selectedpoints"
710- Selected |> DynObj.setOptionalProperty trace " selected"
711- Unselected |> DynObj.setOptionalProperty trace " unselected"
712-
713- trace)
705+ fun ( trace : #Trace ) ->
706+ trace
707+ |> DynObj.withOptionalProperty " selectedpoints" SelectedPoints
708+ |> DynObj.withOptionalProperty " selected" Selected
709+ |> DynObj.withOptionalProperty " unselected" Unselected
714710
715711 /// <summary>
716712 /// Returns a function that applies the given styles to the trace's text items.
@@ -742,20 +738,15 @@ type TraceStyle() =
742738 [<Optional; DefaultParameterValue( null ) >] ? MultiHoverTemplate : seq < string >,
743739 [<Optional; DefaultParameterValue( null ) >] ? TextFont : Font
744740 ) =
745- ( fun ( trace : ( 'T : > Trace )) ->
746- ( Text, MultiText) |> DynObj.setOptionalSingleOrMultiProperty trace " text"
747-
748- ( TextPosition, MultiTextPosition)
749- |> DynObj.setSingleOrMultiOptBy trace " textposition" StyleParam.TextPosition.convert
750-
751- ( TextTemplate, MultiTextTemplate) |> DynObj.setOptionalSingleOrMultiProperty trace " texttemplate"
752- ( HoverText, MultiHoverText) |> DynObj.setOptionalSingleOrMultiProperty trace " hovertext"
753- HoverInfo |> DynObj.setOptionalPropertyBy trace " hoverinfo" StyleParam.HoverInfo.convert
754- ( HoverTemplate, MultiHoverTemplate) |> DynObj.setOptionalSingleOrMultiProperty trace " hovertemplate"
755-
756- TextFont |> DynObj.setOptionalProperty trace " textfont"
757-
758- trace)
741+ fun ( trace : #Trace ) ->
742+ trace
743+ |> DynObj.withOptionalSingleOrMultiProperty " text" ( Text, MultiText)
744+ |> DynObj.withOptionalSingleOrMultiPropertyBy " textposition" ( TextPosition, MultiTextPosition) StyleParam.TextPosition.convert
745+ |> DynObj.withOptionalSingleOrMultiProperty " texttemplate" ( TextTemplate, MultiTextTemplate)
746+ |> DynObj.withOptionalSingleOrMultiProperty " hovertext" ( HoverText, MultiHoverText)
747+ |> DynObj.withOptionalPropertyBy " hoverinfo" HoverInfo StyleParam.HoverInfo.convert
748+ |> DynObj.withOptionalSingleOrMultiProperty " hovertemplate" ( HoverTemplate, MultiHoverTemplate)
749+ |> DynObj.withOptionalProperty " textfont" TextFont
759750
760751 // <summary>
761752 /// Returns a function that applies the given styles to the trace's domain object.
0 commit comments