Skip to content

Commit

Permalink
plotlyjs v2.17: Add marker.cornerradius attribute to treemap trace (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Feb 14, 2023
1 parent 67378a3 commit 8ad20db
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/Plotly.NET/ChartAPI/Chart.fs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ type Chart =
/// <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>
/// <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>
/// <param name="ColorBar">Sets the marker's color bar.</param>
/// <param name="Colorscale"></param>
/// <param name="Colorscale">Sets the colorscale. Has an effect only if colors is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.cmin` and `marker.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd.</param>
/// <param name="CornerRadius">Sets the maximum rounding of corners (in px).</param>
/// <param name="Gradient">Sets the marker's gradient</param>
/// <param name="Outline">Sets the marker's outline.</param>
/// <param name="Opacity">Sets the marker opacity.</param>
Expand Down Expand Up @@ -229,6 +230,7 @@ type Chart =
[<Optional; DefaultParameterValue(null)>] ?ColorAxis: StyleParam.SubPlotId,
[<Optional; DefaultParameterValue(null)>] ?ColorBar: ColorBar,
[<Optional; DefaultParameterValue(null)>] ?Colorscale: StyleParam.Colorscale,
[<Optional; DefaultParameterValue(null)>] ?CornerRadius: int,
[<Optional; DefaultParameterValue(null)>] ?Gradient: Gradient,
[<Optional; DefaultParameterValue(null)>] ?Outline: Line,
[<Optional; DefaultParameterValue(null)>] ?MaxDisplayed: int,
Expand Down Expand Up @@ -267,6 +269,7 @@ type Chart =
?ColorAxis = ColorAxis,
?ColorBar = ColorBar,
?Colorscale = Colorscale,
?CornerRadius = CornerRadius,
?Gradient = Gradient,
?Outline = Outline,
?Size = Size,
Expand Down
2 changes: 2 additions & 0 deletions src/Plotly.NET/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Keep up with plotlyjs 2.x incremental updates:
- v2.17:
- [Add shift and autoshift to cartesian y axes to help avoid overlapping of multiple axes](https://github.com/plotly/Plotly.NET/commit/9f7edb8281ba87a2c122d99604af32d17efec168)
- [Introduce group attributes for scatter trace i.e. alignmentgroup, offsetgroup, scattermode and scattergap]()
- [Add marker.cornerradius attribute to treemap trace]()
- v2.16:
- [Add bounds to mapbox subplots](https://github.com/plotly/Plotly.NET/commit/046e3c472447c720ec7896f2109895028dba471c)
- [Add clustering options to scattermapbox](https://github.com/plotly/Plotly.NET/commit/0ee67e3e9251515d94a2f40858ed4fdd7398e104)
Expand Down
10 changes: 8 additions & 2 deletions src/Plotly.NET/Traces/ObjectAbstractions/Marker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ type Marker() =
/// <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>
/// <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>
/// <param name="ColorBar">Sets the marker's color bar.</param>
/// <param name="Colorscale"></param>
/// <param name="Colorscale">Sets the colorscale. Has an effect only if colors is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.cmin` and `marker.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd.</param>
/// <param name="CornerRadius">Sets the maximum rounding of corners (in px).</param>
/// <param name="Gradient">Sets the marker's gradient</param>
/// <param name="Outline">Sets the marker's outline.</param>
/// <param name="Opacity">Sets the marker opacity.</param>
Expand Down Expand Up @@ -60,6 +61,7 @@ type Marker() =
[<Optional; DefaultParameterValue(null)>] ?ColorAxis: StyleParam.SubPlotId,
[<Optional; DefaultParameterValue(null)>] ?ColorBar: ColorBar,
[<Optional; DefaultParameterValue(null)>] ?Colorscale: StyleParam.Colorscale,
[<Optional; DefaultParameterValue(null)>] ?CornerRadius: int,
[<Optional; DefaultParameterValue(null)>] ?Gradient: Gradient,
[<Optional; DefaultParameterValue(null)>] ?Outline: Line,
[<Optional; DefaultParameterValue(null)>] ?MaxDisplayed: int,
Expand Down Expand Up @@ -96,6 +98,7 @@ type Marker() =
?ColorAxis = ColorAxis,
?ColorBar = ColorBar,
?Colorscale = Colorscale,
?CornerRadius = CornerRadius,
?Gradient = Gradient,
?Outline = Outline,
?Size = Size,
Expand Down Expand Up @@ -133,7 +136,8 @@ type Marker() =
/// <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>
/// <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>
/// <param name="ColorBar">Sets the marker's color bar.</param>
/// <param name="Colorscale"></param>
/// <param name="Colorscale">Sets the colorscale. Has an effect only if colors is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.cmin` and `marker.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd.</param>
/// <param name="CornerRadius">Sets the maximum rounding of corners (in px).</param>
/// <param name="Gradient">Sets the marker's gradient</param>
/// <param name="Outline">Sets the marker's outline.</param>
/// <param name="Opacity">Sets the marker opacity.</param>
Expand Down Expand Up @@ -169,6 +173,7 @@ type Marker() =
[<Optional; DefaultParameterValue(null)>] ?ColorAxis: StyleParam.SubPlotId,
[<Optional; DefaultParameterValue(null)>] ?ColorBar: ColorBar,
[<Optional; DefaultParameterValue(null)>] ?Colorscale: StyleParam.Colorscale,
[<Optional; DefaultParameterValue(null)>] ?CornerRadius: int,
[<Optional; DefaultParameterValue(null)>] ?Gradient: Gradient,
[<Optional; DefaultParameterValue(null)>] ?Outline: Line,
[<Optional; DefaultParameterValue(null)>] ?MaxDisplayed: int,
Expand Down Expand Up @@ -205,6 +210,7 @@ type Marker() =
ColorAxis |> DynObj.setValueOptBy marker "coloraxis" StyleParam.SubPlotId.convert
ColorBar |> DynObj.setValueOpt marker "colorbar"
Colorscale |> DynObj.setValueOptBy marker "colorscale" StyleParam.Colorscale.convert
CornerRadius |> DynObj.setValueOpt marker "cornerradius"
Gradient |> DynObj.setValueOpt marker "gradient"
Outline |> DynObj.setValueOpt marker "line"
(Size, MultiSize) |> DynObj.setSingleOrMultiOpt marker "size"
Expand Down
8 changes: 7 additions & 1 deletion src/Plotly.NET/Traces/Trace.fs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ type TraceStyle() =
[<Optional; DefaultParameterValue(null)>] ?ColorAxis: StyleParam.SubPlotId,
[<Optional; DefaultParameterValue(null)>] ?ColorBar: ColorBar,
[<Optional; DefaultParameterValue(null)>] ?Colorscale: StyleParam.Colorscale,
[<Optional; DefaultParameterValue(null)>] ?CornerRadius: int,
[<Optional; DefaultParameterValue(null)>] ?Gradient: Gradient,
[<Optional; DefaultParameterValue(null)>] ?Outline: Line,
[<Optional; DefaultParameterValue(null)>] ?MaxDisplayed: int,
Expand Down Expand Up @@ -384,6 +385,8 @@ type TraceStyle() =
trace
|> Trace.getMarker
|> Marker.style (
?Angle = Angle,
?AngleRef = AngleRef,
?AutoColorScale = AutoColorScale,
?CAuto = CAuto,
?CMax = CMax,
Expand All @@ -394,6 +397,7 @@ type TraceStyle() =
?ColorAxis = ColorAxis,
?ColorBar = ColorBar,
?Colorscale = Colorscale,
?CornerRadius = CornerRadius,
?Gradient = Gradient,
?Outline = Outline,
?Size = Size,
Expand All @@ -412,7 +416,9 @@ type TraceStyle() =
?ShowScale = ShowScale,
?SizeMin = SizeMin,
?SizeMode = SizeMode,
?SizeRef = SizeRef
?SizeRef = SizeRef,
?StandOff = StandOff,
?MultiStandOff = MultiStandOff
)

trace |> Trace.setMarker (marker))
Expand Down

0 comments on commit 8ad20db

Please sign in to comment.