@@ -39,7 +39,7 @@ type Trace(traceTypeName: string) =
39
39
/// <param name="marker">The new marker object</param>
40
40
static member setMarker ( marker : Marker ) =
41
41
( fun ( trace : ( 'T : > Trace )) ->
42
- trace.SetValue ( " marker" , marker)
42
+ trace.SetProperty ( " marker" , marker)
43
43
trace)
44
44
45
45
/// <summary>
@@ -49,7 +49,7 @@ type Trace(traceTypeName: string) =
49
49
static member updateMarker ( marker : Marker ) =
50
50
( fun ( trace : #Trace ) ->
51
51
let combined =
52
- ( DynObj.combine ( trace |> Trace.getMarker) marker) :?> Marker
52
+ ( DynObj.combine ( trace |> Trace.getMarker) marker)
53
53
54
54
trace |> Trace.setMarker combined)
55
55
@@ -68,7 +68,7 @@ type Trace(traceTypeName: string) =
68
68
/// <param name="line">The new line object</param>
69
69
static member setLine ( line : Line ) =
70
70
( fun ( trace : #Trace ) ->
71
- trace.SetValue ( " line" , line)
71
+ trace.SetProperty ( " line" , line)
72
72
trace)
73
73
74
74
/// <summary>
@@ -78,7 +78,7 @@ type Trace(traceTypeName: string) =
78
78
static member updateLine ( line : Line ) =
79
79
( fun ( trace : #Trace ) ->
80
80
let combined =
81
- ( DynObj.combine ( trace |> Trace.getLine) line) :?> Line
81
+ ( DynObj.combine ( trace |> Trace.getLine) line)
82
82
83
83
trace |> Trace.setLine combined)
84
84
@@ -97,7 +97,7 @@ type Trace(traceTypeName: string) =
97
97
/// <param name="error">The new error object</param>
98
98
static member setXError ( error : Error ) =
99
99
( fun ( trace : #Trace ) ->
100
- trace.SetValue ( " error_x" , error)
100
+ trace.SetProperty ( " error_x" , error)
101
101
trace)
102
102
103
103
/// <summary>
@@ -107,7 +107,7 @@ type Trace(traceTypeName: string) =
107
107
static member updateXError ( error : Error ) =
108
108
( fun ( trace : #Trace ) ->
109
109
let combined =
110
- ( DynObj.combine ( trace |> Trace.getXError) error) :?> Error
110
+ ( DynObj.combine ( trace |> Trace.getXError) error)
111
111
112
112
trace |> Trace.setXError combined)
113
113
@@ -126,7 +126,7 @@ type Trace(traceTypeName: string) =
126
126
/// <param name="error">The new error object</param>
127
127
static member setYError ( error : Error ) =
128
128
( fun ( trace : #Trace ) ->
129
- trace.SetValue ( " error_y" , error)
129
+ trace.SetProperty ( " error_y" , error)
130
130
trace)
131
131
132
132
/// <summary>
@@ -136,7 +136,7 @@ type Trace(traceTypeName: string) =
136
136
static member updateYError ( error : Error ) =
137
137
( fun ( trace : #Trace ) ->
138
138
let combined =
139
- ( DynObj.combine ( trace |> Trace.getYError) error) :?> Error
139
+ ( DynObj.combine ( trace |> Trace.getYError) error)
140
140
141
141
trace |> Trace.setYError combined)
142
142
@@ -155,7 +155,7 @@ type Trace(traceTypeName: string) =
155
155
/// <param name="error">The new error object</param>
156
156
static member setZError ( error : Error ) =
157
157
( fun ( trace : #Trace ) ->
158
- trace.SetValue ( " error_z" , error)
158
+ trace.SetProperty ( " error_z" , error)
159
159
trace)
160
160
161
161
/// <summary>
@@ -165,7 +165,7 @@ type Trace(traceTypeName: string) =
165
165
static member updateZError ( error : Error ) =
166
166
( fun ( trace : #Trace ) ->
167
167
let combined =
168
- ( DynObj.combine ( trace |> Trace.getZError) error) :?> Error
168
+ ( DynObj.combine ( trace |> Trace.getZError) error)
169
169
170
170
trace |> Trace.setZError combined)
171
171
@@ -193,7 +193,7 @@ type Trace(traceTypeName: string) =
193
193
StyleParam.SubPlotId.ColorAxis colorAxisId
194
194
195
195
( fun ( trace : #Trace ) ->
196
- trace.SetValue ( " coloraxis" , StyleParam.SubPlotId.convert id)
196
+ trace.SetProperty ( " coloraxis" , StyleParam.SubPlotId.convert id)
197
197
trace)
198
198
199
199
/// <summary>
@@ -220,7 +220,7 @@ type Trace(traceTypeName: string) =
220
220
StyleParam.SubPlotId.Legend legendId
221
221
222
222
( fun ( trace : #Trace ) ->
223
- trace.SetValue ( " legend" , StyleParam.SubPlotId.convert id)
223
+ trace.SetProperty ( " legend" , StyleParam.SubPlotId.convert id)
224
224
trace)
225
225
226
226
/// <summary>
@@ -238,7 +238,7 @@ type Trace(traceTypeName: string) =
238
238
/// <param name="domain">The new domain</param>
239
239
static member setDomain ( domain : Domain ) =
240
240
( fun ( trace : ( 'T : > Trace )) ->
241
- trace.SetValue ( " domain" , domain)
241
+ trace.SetProperty ( " domain" , domain)
242
242
trace)
243
243
244
244
/// <summary>
@@ -248,7 +248,7 @@ type Trace(traceTypeName: string) =
248
248
static member updateDomain ( domain : Domain ) =
249
249
( fun ( trace : #Trace ) ->
250
250
let combined =
251
- ( DynObj.combine ( trace |> Trace.getDomain) domain) :?> Domain
251
+ ( DynObj.combine ( trace |> Trace.getDomain) domain)
252
252
253
253
trace |> Trace.setDomain combined)
254
254
@@ -267,7 +267,7 @@ type Trace(traceTypeName: string) =
267
267
/// <param name="stackgroup">The new stackgroup</param>
268
268
static member setStackGroup ( stackgroup : string ) =
269
269
( fun ( trace : ( 'T : > Trace )) ->
270
- trace.SetValue ( " stackgroup" , stackgroup)
270
+ trace.SetProperty ( " stackgroup" , stackgroup)
271
271
trace)
272
272
273
273
/// <summary>
@@ -286,7 +286,7 @@ type Trace(traceTypeName: string) =
286
286
static member setColorBar ( colorBar : ColorBar ) =
287
287
( fun ( trace : ( 'T : > Trace )) ->
288
288
289
- trace.SetValue ( " colorbar" , colorBar)
289
+ trace.SetProperty ( " colorbar" , colorBar)
290
290
trace)
291
291
292
292
/// <summary>
@@ -296,7 +296,7 @@ type Trace(traceTypeName: string) =
296
296
static member updateColorBar ( colorBar : ColorBar ) =
297
297
( fun ( trace : #Trace ) ->
298
298
let combined =
299
- ( DynObj.combine ( trace |> Trace.getColorBar) colorBar) :?> ColorBar
299
+ DynObj.combine ( trace |> Trace.getColorBar) colorBar
300
300
301
301
trace |> Trace.setColorBar combined)
302
302
@@ -327,16 +327,14 @@ type TraceStyle() =
327
327
[<Optional; DefaultParameterValue( null ) >] ? LegendGroup : string ,
328
328
[<Optional; DefaultParameterValue( null ) >] ? LegendGroupTitle : Title
329
329
) =
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
340
338
341
339
/// <summary>
342
340
/// 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() =
704
702
[<Optional; DefaultParameterValue( null ) >] ? Selected : TraceSelection ,
705
703
[<Optional; DefaultParameterValue( null ) >] ? Unselected : TraceSelection
706
704
) =
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
714
710
715
711
/// <summary>
716
712
/// Returns a function that applies the given styles to the trace's text items.
@@ -742,20 +738,15 @@ type TraceStyle() =
742
738
[<Optional; DefaultParameterValue( null ) >] ? MultiHoverTemplate : seq < string >,
743
739
[<Optional; DefaultParameterValue( null ) >] ? TextFont : Font
744
740
) =
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
759
750
760
751
// <summary>
761
752
/// Returns a function that applies the given styles to the trace's domain object.
0 commit comments