Skip to content

Commit 9187d05

Browse files
committed
Properly document and extend all functions that set/style marker objects
1 parent a9c9eef commit 9187d05

File tree

4 files changed

+214
-67
lines changed

4 files changed

+214
-67
lines changed

src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,23 @@ module GenericChartExtensions =
6969
[<Optional; DefaultParameterValue(null)>] ?Colorscale: StyleParam.Colorscale,
7070
[<Optional; DefaultParameterValue(null)>] ?Gradient: Gradient,
7171
[<Optional; DefaultParameterValue(null)>] ?Outline: Line,
72-
[<Optional; DefaultParameterValue(null)>] ?Size: int,
73-
[<Optional; DefaultParameterValue(null)>] ?MultiSize: seq<int>,
72+
[<Optional; DefaultParameterValue(null)>] ?MaxDisplayed: int,
7473
[<Optional; DefaultParameterValue(null)>] ?Opacity: float,
7574
[<Optional; DefaultParameterValue(null)>] ?MultiOpacity: seq<float>,
7675
[<Optional; DefaultParameterValue(null)>] ?Pattern: Pattern,
77-
[<Optional; DefaultParameterValue(null)>] ?Symbol: StyleParam.MarkerSymbol,
78-
[<Optional; DefaultParameterValue(null)>] ?MultiSymbols: seq<StyleParam.MarkerSymbol>,
79-
[<Optional; DefaultParameterValue(null)>] ?OutlierColor: Color,
80-
[<Optional; DefaultParameterValue(null)>] ?Maxdisplayed: int,
8176
[<Optional; DefaultParameterValue(null)>] ?ReverseScale: bool,
8277
[<Optional; DefaultParameterValue(null)>] ?ShowScale: bool,
78+
[<Optional; DefaultParameterValue(null)>] ?Size: int,
79+
[<Optional; DefaultParameterValue(null)>] ?MultiSize: seq<int>,
8380
[<Optional; DefaultParameterValue(null)>] ?SizeMin: int,
8481
[<Optional; DefaultParameterValue(null)>] ?SizeMode: StyleParam.MarkerSizeMode,
85-
[<Optional; DefaultParameterValue(null)>] ?SizeRef: int
82+
[<Optional; DefaultParameterValue(null)>] ?SizeRef: int,
83+
[<Optional; DefaultParameterValue(null)>] ?Symbol: StyleParam.MarkerSymbol,
84+
[<Optional; DefaultParameterValue(null)>] ?MultiSymbol: seq<StyleParam.MarkerSymbol>,
85+
[<Optional; DefaultParameterValue(null)>] ?Symbol3D: StyleParam.MarkerSymbol3D,
86+
[<Optional; DefaultParameterValue(null)>] ?MultiSymbol3D: seq<StyleParam.MarkerSymbol3D>,
87+
[<Optional; DefaultParameterValue(null)>] ?OutlierColor: Color,
88+
[<Optional; DefaultParameterValue(null)>] ?OutlierWidth: int
8689
) =
8790
this
8891
|> Chart.withMarkerStyle (
@@ -101,12 +104,15 @@ module GenericChartExtensions =
101104
?Size = Size,
102105
?MultiSize = MultiSize,
103106
?Opacity = Opacity,
104-
?MultiOpacity = MultiOpacity,
105107
?Pattern = Pattern,
108+
?MultiOpacity = MultiOpacity,
106109
?Symbol = Symbol,
107-
?MultiSymbols = MultiSymbols,
110+
?MultiSymbol = MultiSymbol,
111+
?Symbol3D = Symbol3D,
112+
?MultiSymbol3D = MultiSymbol3D,
108113
?OutlierColor = OutlierColor,
109-
?Maxdisplayed = Maxdisplayed,
114+
?OutlierWidth = OutlierWidth,
115+
?MaxDisplayed = MaxDisplayed,
110116
?ReverseScale = ReverseScale,
111117
?ShowScale = ShowScale,
112118
?SizeMin = SizeMin,

src/Plotly.NET/ChartAPI/Chart.fs

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@ type Chart =
101101

102102
))
103103

104-
/// Set the axis anchor id the trace is belonging to
104+
/// <summary>
105+
/// Sets the axis anchor ids for the chart's cartesian and/or carpet trace(s).
106+
///
107+
/// If the traces are not of these types, nothing will be set and a warning message will be displayed.
108+
/// </summary>
109+
/// <param name="X">The new x axis anchor id for the chart's cartesian and/or carpet trace(s)</param>
110+
/// <param name="Y">The new x axis anchor id for the chart's cartesian and/or carpet trace(s)</param>
105111
[<CompiledName("WithAxisAnchor")>]
106112
static member withAxisAnchor
107113
(
@@ -126,26 +132,54 @@ type Chart =
126132
printfn "the input was not a 2D cartesian or carpet trace. no axis anchors set."
127133
trace)
128134

129-
[<CompiledName("WithAxisAnchor")>]
130-
static member withAxisAnchor
131-
(
132-
(ch: GenericChart),
133-
[<Optional; DefaultParameterValue(null)>] ?X,
134-
[<Optional; DefaultParameterValue(null)>] ?Y
135-
) =
136-
ch |> Chart.withAxisAnchor (?X = X, ?Y = Y)
137-
138-
/// Set the axis anchor id the trace is belonging to
135+
/// <summary>
136+
/// Sets the color axis id for the chart's trace(s).
137+
/// </summary>
138+
/// <param name="Id">The new color axis id for the chart's trace(s)</param>
139139
[<CompiledName("WithColorAxisAnchor")>]
140140
static member withColorAxisAnchor([<Optional; DefaultParameterValue(null)>] ?Id: int) =
141141
fun (ch: GenericChart) -> ch |> mapTrace (TraceStyle.setColorAxisAnchor (?ColorAxisId = Id))
142142

143-
/// Apply styling to the Marker(s) of the chart as Object.
143+
/// <summary>
144+
/// Sets the marker for the chart's trace(s).
145+
/// </summary>
146+
/// <param name="marker">The new marker for the chart's trace(s)</param>
144147
[<CompiledName("WithMarker")>]
145148
static member withMarker(marker: Marker) =
146149
(fun (ch: GenericChart) -> ch |> mapTrace (TraceStyle.SetMarker(marker)))
147150

148-
/// Apply styling to the Marker(s) of the chart.
151+
/// <summary>
152+
/// Applies the given styles to the marker object(s) of the chart's trace(s).
153+
/// </summary>
154+
/// <param name="AutoColorScale">Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. Has an effect only if in `marker.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.</param>
155+
/// <param name="CAuto">Determines whether or not the color domain is computed with respect to the input data (here in `marker.color`) or the bounds set in `marker.cmin` and `marker.cmax` Has an effect only if in `marker.color`is set to a numerical array. Defaults to `false` when `marker.cmin` and `marker.cmax` are set by the user.</param>
156+
/// <param name="CMax">Sets the upper bound of the color domain. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmin` must be set as well.</param>
157+
/// <param name="CMid">Sets the mid-point of the color domain by scaling `marker.cmin` and/or `marker.cmax` to be equidistant to this point. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color`. Has no effect when `marker.cauto` is `false`.</param>
158+
/// <param name="CMin">Sets the lower bound of the color domain. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmax` must be set as well.</param>
159+
/// <param name="Color">Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set.</param>
160+
/// <param name="Colors">Sets the color of each sector. If not specified, the default trace color set is used to pick the sector colors.</param>
161+
/// <param name="ColorAxis">Sets a reference to a shared color axis. References to these shared color axes are "coloraxis", "coloraxis2", "coloraxis3", etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.</param>
162+
/// <param name="ColorBar">Sets the marker's color bar.</param>
163+
/// <param name="Colorscale"></param>
164+
/// <param name="Gradient">Sets the marker's gradient</param>
165+
/// <param name="Outline">Sets the marker's outline.</param>
166+
/// <param name="Opacity">Sets the marker opacity.</param>
167+
/// <param name="MaxDisplayed">Sets a maximum number of points to be drawn on the graph. "0" corresponds to no limit.</param>
168+
/// <param name="MultiOpacity">Sets the individual marker opacity.</param>
169+
/// <param name="Pattern">Sets the pattern within the marker.</param>
170+
/// <param name="ReverseScale">Reverses the color mapping if true. Has an effect only if in `marker.color`is set to a numerical array. If true, `marker.cmin` will correspond to the last color in the array and `marker.cmax` will correspond to the first color.</param>
171+
/// <param name="ShowScale">Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `marker.color`is set to a numerical array.</param>
172+
/// <param name="Size">Sets the marker's size.</param>
173+
/// <param name="MultiSize">Sets the individual marker's size.</param>
174+
/// <param name="SizeMin">Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.</param>
175+
/// <param name="SizeMode">Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.</param>
176+
/// <param name="SizeRef">Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.</param>
177+
/// <param name="Symbol">Sets the marker symbol.</param>
178+
/// <param name="MultiSymbol">Sets the individual marker symbols.</param>
179+
/// <param name="Symbol3D">Sets the marker symbol for 3d traces.</param>
180+
/// <param name="MultiSymbol3D">Sets the individual marker symbols for 3d traces.</param>
181+
/// <param name="OutlierColor">Sets the color of the outlier sample points.</param>
182+
/// <param name="OutlierWidth">Sets the width of the outlier sample points.</param>
149183
[<CompiledName("WithMarkerStyle")>]
150184
static member withMarkerStyle
151185
(
@@ -161,20 +195,23 @@ type Chart =
161195
[<Optional; DefaultParameterValue(null)>] ?Colorscale: StyleParam.Colorscale,
162196
[<Optional; DefaultParameterValue(null)>] ?Gradient: Gradient,
163197
[<Optional; DefaultParameterValue(null)>] ?Outline: Line,
164-
[<Optional; DefaultParameterValue(null)>] ?Size: int,
165-
[<Optional; DefaultParameterValue(null)>] ?MultiSize: seq<int>,
198+
[<Optional; DefaultParameterValue(null)>] ?MaxDisplayed: int,
166199
[<Optional; DefaultParameterValue(null)>] ?Opacity: float,
167200
[<Optional; DefaultParameterValue(null)>] ?MultiOpacity: seq<float>,
168201
[<Optional; DefaultParameterValue(null)>] ?Pattern: Pattern,
169-
[<Optional; DefaultParameterValue(null)>] ?Symbol: StyleParam.MarkerSymbol,
170-
[<Optional; DefaultParameterValue(null)>] ?MultiSymbols: seq<StyleParam.MarkerSymbol>,
171-
[<Optional; DefaultParameterValue(null)>] ?OutlierColor: Color,
172-
[<Optional; DefaultParameterValue(null)>] ?Maxdisplayed: int,
173202
[<Optional; DefaultParameterValue(null)>] ?ReverseScale: bool,
174203
[<Optional; DefaultParameterValue(null)>] ?ShowScale: bool,
204+
[<Optional; DefaultParameterValue(null)>] ?Size: int,
205+
[<Optional; DefaultParameterValue(null)>] ?MultiSize: seq<int>,
175206
[<Optional; DefaultParameterValue(null)>] ?SizeMin: int,
176207
[<Optional; DefaultParameterValue(null)>] ?SizeMode: StyleParam.MarkerSizeMode,
177-
[<Optional; DefaultParameterValue(null)>] ?SizeRef: int
208+
[<Optional; DefaultParameterValue(null)>] ?SizeRef: int,
209+
[<Optional; DefaultParameterValue(null)>] ?Symbol: StyleParam.MarkerSymbol,
210+
[<Optional; DefaultParameterValue(null)>] ?MultiSymbol: seq<StyleParam.MarkerSymbol>,
211+
[<Optional; DefaultParameterValue(null)>] ?Symbol3D: StyleParam.MarkerSymbol3D,
212+
[<Optional; DefaultParameterValue(null)>] ?MultiSymbol3D: seq<StyleParam.MarkerSymbol3D>,
213+
[<Optional; DefaultParameterValue(null)>] ?OutlierColor: Color,
214+
[<Optional; DefaultParameterValue(null)>] ?OutlierWidth: int
178215
) =
179216
fun (ch: GenericChart) ->
180217
ch
@@ -195,12 +232,15 @@ type Chart =
195232
?Size = Size,
196233
?MultiSize = MultiSize,
197234
?Opacity = Opacity,
198-
?MultiOpacity = MultiOpacity,
199235
?Pattern = Pattern,
236+
?MultiOpacity = MultiOpacity,
200237
?Symbol = Symbol,
201-
?MultiSymbol = MultiSymbols,
238+
?MultiSymbol = MultiSymbol,
239+
?Symbol3D = Symbol3D,
240+
?MultiSymbol3D = MultiSymbol3D,
202241
?OutlierColor = OutlierColor,
203-
?Maxdisplayed = Maxdisplayed,
242+
?OutlierWidth = OutlierWidth,
243+
?MaxDisplayed = MaxDisplayed,
204244
?ReverseScale = ReverseScale,
205245
?ShowScale = ShowScale,
206246
?SizeMin = SizeMin,

0 commit comments

Comments
 (0)