From dc8486b8a49549986626faaa053cf8dfdb2b4e18 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Sun, 8 Aug 2021 14:31:21 +0200 Subject: [PATCH 01/19] Add selection object --- src/Plotly.NET/Plotly.NET.fsproj | 3 +- src/Plotly.NET/Selection.fs | 79 ++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/Plotly.NET/Selection.fs diff --git a/src/Plotly.NET/Plotly.NET.fsproj b/src/Plotly.NET/Plotly.NET.fsproj index 5848525ee..ff2d76df7 100644 --- a/src/Plotly.NET/Plotly.NET.fsproj +++ b/src/Plotly.NET/Plotly.NET.fsproj @@ -36,8 +36,9 @@ - + + diff --git a/src/Plotly.NET/Selection.fs b/src/Plotly.NET/Selection.fs new file mode 100644 index 000000000..5c73953ef --- /dev/null +++ b/src/Plotly.NET/Selection.fs @@ -0,0 +1,79 @@ +namespace Plotly.NET + +type MarkerSelectionStyle() = + inherit DynamicObj () + + static member init + ( + ?Opacity: float, + ?Color: string, + ?Size: float + ) = + MarkerSelectionStyle() + |> MarkerSelectionStyle.style + ( + ?Opacity = Opacity, + ?Color = Color, + ?Size = Size + ) + + static member style + ( + ?Opacity: float, + ?Color: string, + ?Size: float + ) = + (fun (markerSelectionStyle:MarkerSelectionStyle) -> + Opacity |> DynObj.setValueOpt markerSelectionStyle "opacity" + Color |> DynObj.setValueOpt markerSelectionStyle "color" + Size |> DynObj.setValueOpt markerSelectionStyle "size" + ) + +type FontSelectionStyle() = + inherit DynamicObj () + + /// Init Font() + static member init + ( + ?Color: string + ) = + FontSelectionStyle() + |> FontSelectionStyle.style + ( + ?Color = Color + ) + + + // Applies the styles to Font() + static member style + ( + ?Color: string + ) = + (fun (fontSelectionStyle:FontSelectionStyle) -> + Color |> DynObj.setValueOpt fontSelectionStyle "color" + ) + +type Selection () = + inherit DynamicObj () + + static member init + ( + ?MarkerSelectionStyle: MarkerSelectionStyle, + ?FontSelectionStyle: FontSelectionStyle + ) = + Selection() + |> Selection.style + ( + ?MarkerSelectionStyle = MarkerSelectionStyle, + ?FontSelectionStyle = FontSelectionStyle + ) + + static member style + ( + ?MarkerSelectionStyle: MarkerSelectionStyle, + ?FontSelectionStyle: FontSelectionStyle + ) = + (fun (selection:Selection) -> + MarkerSelectionStyle |> DynObj.setValueOpt selection "marker" + FontSelectionStyle |> DynObj.setValueOpt selection "textfont" + ) From c35d9b3109739ee2d37a1433aa1a2d183e1b7993 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Sun, 8 Aug 2021 14:45:40 +0200 Subject: [PATCH 02/19] Fix Selection to return correct objects --- src/Plotly.NET/Selection.fs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Plotly.NET/Selection.fs b/src/Plotly.NET/Selection.fs index 5c73953ef..af90c9952 100644 --- a/src/Plotly.NET/Selection.fs +++ b/src/Plotly.NET/Selection.fs @@ -24,9 +24,12 @@ type MarkerSelectionStyle() = ?Size: float ) = (fun (markerSelectionStyle:MarkerSelectionStyle) -> + Opacity |> DynObj.setValueOpt markerSelectionStyle "opacity" Color |> DynObj.setValueOpt markerSelectionStyle "color" Size |> DynObj.setValueOpt markerSelectionStyle "size" + + markerSelectionStyle ) type FontSelectionStyle() = @@ -76,4 +79,5 @@ type Selection () = (fun (selection:Selection) -> MarkerSelectionStyle |> DynObj.setValueOpt selection "marker" FontSelectionStyle |> DynObj.setValueOpt selection "textfont" + selection ) From 074b6e0d1a7f3b26d0d923903f6b7429a3eeca46 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Sun, 8 Aug 2021 14:48:42 +0200 Subject: [PATCH 03/19] Add Title object --- src/Plotly.NET/Plotly.NET.fsproj | 1 + src/Plotly.NET/Title.fs | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/Plotly.NET/Title.fs diff --git a/src/Plotly.NET/Plotly.NET.fsproj b/src/Plotly.NET/Plotly.NET.fsproj index ff2d76df7..da85a14e8 100644 --- a/src/Plotly.NET/Plotly.NET.fsproj +++ b/src/Plotly.NET/Plotly.NET.fsproj @@ -41,6 +41,7 @@ + diff --git a/src/Plotly.NET/Title.fs b/src/Plotly.NET/Title.fs new file mode 100644 index 000000000..44f962aad --- /dev/null +++ b/src/Plotly.NET/Title.fs @@ -0,0 +1,29 @@ +namespace Plotly.NET + +type Title() = + inherit DynamicObj () + + static member init + ( + ?Text: string, + ?Font: Font + ) = + Title() + |> Title.style + ( + ?Text = Text, + ?Font = Font + ) + + static member style + ( + ?Text: string, + ?Font: Font + ) = + (fun (title:Title) -> + + Text |> DynObj.setValueOpt title "text" + Font |> DynObj.setValueOpt title "font" + + title + ) From c2d8390a190d7993f60cded866fbcf4d45269a9c Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Sun, 8 Aug 2021 15:19:20 +0200 Subject: [PATCH 04/19] Add TickFormatStop object --- src/Plotly.NET/Plotly.NET.fsproj | 1 + src/Plotly.NET/TickFormatStop.fs | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/Plotly.NET/TickFormatStop.fs diff --git a/src/Plotly.NET/Plotly.NET.fsproj b/src/Plotly.NET/Plotly.NET.fsproj index da85a14e8..613fb4c54 100644 --- a/src/Plotly.NET/Plotly.NET.fsproj +++ b/src/Plotly.NET/Plotly.NET.fsproj @@ -37,6 +37,7 @@ + diff --git a/src/Plotly.NET/TickFormatStop.fs b/src/Plotly.NET/TickFormatStop.fs new file mode 100644 index 000000000..04456b998 --- /dev/null +++ b/src/Plotly.NET/TickFormatStop.fs @@ -0,0 +1,42 @@ +namespace Plotly.NET + +type TickFormatStop() = + inherit DynamicObj () + + static member init + ( + ?Enabled : bool, + ?DTickRange : seq, + ?Value : string, + ?Name : string, + ?TemplateItemName : string + ) = + TickFormatStop() + |> TickFormatStop.style + ( + ?Enabled = Enabled , + ?DTickRange = DTickRange , + ?Value = Value , + ?Name = Name , + ?TemplateItemName = TemplateItemName + ) + + static member style + ( + ?Enabled : bool, + ?DTickRange : seq, + ?Value : string, + ?Name : string, + ?TemplateItemName : string + ) = + (fun (tickFormatStop:TickFormatStop) -> + + Enabled |> DynObj.setValueOpt tickFormatStop "enabled" + DTickRange |> DynObj.setValueOpt tickFormatStop "dtickrange" + Value |> DynObj.setValueOpt tickFormatStop "value" + Name |> DynObj.setValueOpt tickFormatStop "name" + TemplateItemName |> DynObj.setValueOpt tickFormatStop "templateitemname" + + + tickFormatStop + ) \ No newline at end of file From 3f740ba34b86137f3ecda5e1b835f0e7b367b11f Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Sun, 8 Aug 2021 15:32:17 +0200 Subject: [PATCH 05/19] Add RadialAxis object --- src/Plotly.NET/Axis.fs | 197 +++++++++++++++++++++++++++++++++- src/Plotly.NET/StyleParams.fs | 43 ++++++++ 2 files changed, 238 insertions(+), 2 deletions(-) diff --git a/src/Plotly.NET/Axis.fs b/src/Plotly.NET/Axis.fs index b6ba0c3ab..1da9f647e 100644 --- a/src/Plotly.NET/Axis.fs +++ b/src/Plotly.NET/Axis.fs @@ -366,8 +366,201 @@ module Axis = inherit DynamicObj () /// Init Radialaxis type - static member init (applyStyle:RadialAxis->RadialAxis) = - RadialAxis() |> applyStyle + static member init + ( + ?Visible : bool, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?AutoRange : StyleParam.AutoRange, + ?RangeMode : StyleParam.RangeMode, + ?Range : StyleParam.Range, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?Angle : float, + ?Side : StyleParam.RadialSide, + ?Title : Title, + ?HoverFormat : string, + ?UIRevision : string, + ?Color : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : int, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : int, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TickLen : int, + ?TickWidth : int, + ?TickColor : string, + ?ShowTickLabels : bool, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFont : Font, + ?TickAngle : int, + ?TickFormat : string, + ?TickFormatStops : seq, + ?Layer : StyleParam.Layer, + ?Calendar : StyleParam.Calendar + ) = + RadialAxis() + |> RadialAxis.style + ( + ?Visible = Visible , + ?AxisType = AxisType , + ?AutoTypeNumbers = AutoTypeNumbers , + ?AutoRange = AutoRange , + ?RangeMode = RangeMode , + ?Range = Range , + ?CategoryOrder = CategoryOrder , + ?CategoryArray = CategoryArray , + ?Angle = Angle , + ?Side = Side , + ?Title = Title , + ?HoverFormat = HoverFormat , + ?UIRevision = UIRevision , + ?Color = Color , + ?ShowLine = ShowLine , + ?LineColor = LineColor , + ?LineWidth = LineWidth , + ?ShowGrid = ShowGrid , + ?GridColor = GridColor , + ?GridWidth = GridWidth , + ?TickMode = TickMode , + ?NTicks = NTicks , + ?Tick0 = Tick0 , + ?DTick = DTick , + ?TickVals = TickVals , + ?TickText = TickText , + ?Ticks = Ticks , + ?TickLen = TickLen , + ?TickWidth = TickWidth , + ?TickColor = TickColor , + ?ShowTickLabels = ShowTickLabels , + ?ShowTickPrefix = ShowTickPrefix , + ?TickPrefix = TickPrefix , + ?ShowTickSuffix = ShowTickSuffix , + ?TickSuffix = TickSuffix , + ?ShowExponent = ShowExponent , + ?ExponentFormat = ExponentFormat , + ?MinExponent = MinExponent , + ?SeparateThousands = SeparateThousands , + ?TickFont = TickFont , + ?TickAngle = TickAngle , + ?TickFormat = TickFormat , + ?TickFormatStops = TickFormatStops , + ?Layer = Layer , + ?Calendar = Calendar + ) + + static member style + ( + ?Visible : bool, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?AutoRange : StyleParam.AutoRange, + ?RangeMode : StyleParam.RangeMode, + ?Range : StyleParam.Range, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?Angle : float, + ?Side : StyleParam.RadialSide, + ?Title : Title, + ?HoverFormat : string, + ?UIRevision : string, + ?Color : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : int, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : int, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TickLen : int, + ?TickWidth : int, + ?TickColor : string, + ?ShowTickLabels : bool, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFont : Font, + ?TickAngle : int, + ?TickFormat : string, + ?TickFormatStops : seq, + ?Layer : StyleParam.Layer, + ?Calendar : StyleParam.Calendar + ) = + fun (radialAxis:RadialAxis) -> + + Visible |> DynObj.setValueOpt radialAxis "visible" + AxisType |> DynObj.setValueOptBy radialAxis "type" StyleParam.AxisType.convert + AutoTypeNumbers |> DynObj.setValueOptBy radialAxis "autotypenumbers" StyleParam.AutoTypeNumbers.convert + AutoRange |> DynObj.setValueOptBy radialAxis "autorange" StyleParam.AutoRange.convert + RangeMode |> DynObj.setValueOptBy radialAxis "rangemode" StyleParam.RangeMode.convert + Range |> DynObj.setValueOptBy radialAxis "range" StyleParam.Range.convert + CategoryOrder |> DynObj.setValueOptBy radialAxis "categoryorder" StyleParam.CategoryOrder.convert + CategoryArray |> DynObj.setValueOpt radialAxis "categoryarray" + Angle |> DynObj.setValueOpt radialAxis "angle" + Side |> DynObj.setValueOptBy radialAxis "side" StyleParam.RadialSide.convert + Title |> DynObj.setValueOpt radialAxis "title" + HoverFormat |> DynObj.setValueOpt radialAxis "hoverformat" + UIRevision |> DynObj.setValueOpt radialAxis "uirevision" + Color |> DynObj.setValueOpt radialAxis "color" + ShowLine |> DynObj.setValueOpt radialAxis "showline" + LineColor |> DynObj.setValueOpt radialAxis "linecolor" + LineWidth |> DynObj.setValueOpt radialAxis "linewidth" + ShowGrid |> DynObj.setValueOpt radialAxis "showgrid" + GridColor |> DynObj.setValueOpt radialAxis "gridcolor" + GridWidth |> DynObj.setValueOpt radialAxis "gridwidth" + TickMode |> DynObj.setValueOptBy radialAxis "tickmode" StyleParam.TickMode.convert + NTicks |> DynObj.setValueOpt radialAxis "nticks" + Tick0 |> DynObj.setValueOpt radialAxis "tick0" + DTick |> DynObj.setValueOpt radialAxis "dtick" + TickVals |> DynObj.setValueOpt radialAxis "tickvals" + TickText |> DynObj.setValueOpt radialAxis "ticktext" + Ticks |> DynObj.setValueOptBy radialAxis "ticks" StyleParam.TickOptions.convert + TickLen |> DynObj.setValueOpt radialAxis "ticklen" + TickWidth |> DynObj.setValueOpt radialAxis "tickwidth" + TickColor |> DynObj.setValueOpt radialAxis "tickcolor" + ShowTickLabels |> DynObj.setValueOpt radialAxis "showticklabels" + ShowTickPrefix |> DynObj.setValueOptBy radialAxis "showtickprefix" StyleParam.ShowTickOption.convert + TickPrefix |> DynObj.setValueOpt radialAxis "tickprefix" + ShowTickSuffix |> DynObj.setValueOptBy radialAxis "showticksuffix" StyleParam.ShowTickOption.convert + TickSuffix |> DynObj.setValueOpt radialAxis "ticksuffix" + ShowExponent |> DynObj.setValueOptBy radialAxis "showexponent" StyleParam.ShowExponent.convert + ExponentFormat |> DynObj.setValueOptBy radialAxis "exponentformat" StyleParam.ExponentFormat.convert + MinExponent |> DynObj.setValueOpt radialAxis "minexponent" + SeparateThousands |> DynObj.setValueOpt radialAxis "separatethousands" + TickFont |> DynObj.setValueOpt radialAxis "tickfont" + TickAngle |> DynObj.setValueOpt radialAxis "tickangle" + TickFormat |> DynObj.setValueOpt radialAxis "tickformat" + TickFormatStops |> DynObj.setValueOpt radialAxis "tickformatstops" + Layer |> DynObj.setValueOptBy radialAxis "layer" StyleParam.Layer.convert + Calendar |> DynObj.setValueOptBy radialAxis "calendar" StyleParam.Calendar.convert + + radialAxis /// Angularaxis type inherits from dynamic object type AngularAxis () = diff --git a/src/Plotly.NET/StyleParams.fs b/src/Plotly.NET/StyleParams.fs index 556c333c9..126dd1681 100644 --- a/src/Plotly.NET/StyleParams.fs +++ b/src/Plotly.NET/StyleParams.fs @@ -127,6 +127,16 @@ module StyleParam = static member convert = AnnotationEditOptions.toString >> box + [] + type AutoTypeNumbers = + | ConvertTypes | Strict + + static member toString = function + | ConvertTypes -> "convert types" + | Strict -> "strict" + + static member convert = AutoTypeNumbers.toString >> box + //-------------------------- // #B# //-------------------------- @@ -986,6 +996,17 @@ module StyleParam = // #P# //-------------------------- + /// Sets the method used to compute the sample's Q1 and Q3 quartiles + [] + type PolarGridShape = + | Circular | Linear + + static member toString = function + | Circular -> "circular" + | Linear -> "linear" + + static member convert = PolarGridShape.toString >> box + //-------------------------- // #Q# //-------------------------- @@ -1030,6 +1051,15 @@ module StyleParam = | MinMax (min,max) -> box [|min;max|] | Values arr -> box arr + [] + type RadialSide = + | Clockwise | CounterClockwise + + static member toString = function + | Clockwise -> "clockwise" + | CounterClockwise -> "counterclockwise" + + static member convert = RadialSide.toString >> box //-------------------------- @@ -1349,6 +1379,19 @@ module StyleParam = static member convert = TraceItemClickOptions.toString >> box + [] + type AngularUnit = + | Radians + | Degrees + | Gradians + + static member toString = function + | Radians -> "radians" + | Degrees -> "degrees" + | Gradians -> "gradians" + + static member convert = AngularUnit.toString >> box + //-------------------------- // #U# From f6fee0a8bbf328f7e286eb68b5133a12f5bb3ea8 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Sun, 8 Aug 2021 17:07:26 +0200 Subject: [PATCH 06/19] Add AngularAxis object --- src/Plotly.NET/Axis.fs | 193 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 187 insertions(+), 6 deletions(-) diff --git a/src/Plotly.NET/Axis.fs b/src/Plotly.NET/Axis.fs index 1da9f647e..922489aa0 100644 --- a/src/Plotly.NET/Axis.fs +++ b/src/Plotly.NET/Axis.fs @@ -360,7 +360,6 @@ module Axis = axis ) - /// Radialaxis type inherits from dynamic object type RadialAxis () = inherit DynamicObj () @@ -377,7 +376,7 @@ module Axis = ?CategoryOrder : StyleParam.CategoryOrder, ?CategoryArray : seq<#IConvertible>, ?Angle : float, - ?Side : StyleParam.RadialSide, + ?Side : StyleParam.Direction, ?Title : Title, ?HoverFormat : string, ?UIRevision : string, @@ -475,7 +474,7 @@ module Axis = ?CategoryOrder : StyleParam.CategoryOrder, ?CategoryArray : seq<#IConvertible>, ?Angle : float, - ?Side : StyleParam.RadialSide, + ?Side : StyleParam.Direction, ?Title : Title, ?HoverFormat : string, ?UIRevision : string, @@ -523,7 +522,7 @@ module Axis = CategoryOrder |> DynObj.setValueOptBy radialAxis "categoryorder" StyleParam.CategoryOrder.convert CategoryArray |> DynObj.setValueOpt radialAxis "categoryarray" Angle |> DynObj.setValueOpt radialAxis "angle" - Side |> DynObj.setValueOptBy radialAxis "side" StyleParam.RadialSide.convert + Side |> DynObj.setValueOptBy radialAxis "side" StyleParam.Direction.convert Title |> DynObj.setValueOpt radialAxis "title" HoverFormat |> DynObj.setValueOpt radialAxis "hoverformat" UIRevision |> DynObj.setValueOpt radialAxis "uirevision" @@ -567,8 +566,190 @@ module Axis = inherit DynamicObj () /// Init Angularaxis type - static member init (applyStyle:AngularAxis->AngularAxis) = - AngularAxis() |> applyStyle + static member init + ( + ?Visible : bool, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?ThetaUnit : StyleParam.AngularUnit, + ?Period : float, + ?Direction : StyleParam.Direction, + ?Rotation : int, + ?HoverFormat : string, + ?UIRevision : string, + ?Color : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : int, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : int, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TickLen : int, + ?TickWidth : int, + ?TickColor : string, + ?ShowTickLabels : bool, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFont : Font, + ?TickAngle : int, + ?TickFormat : string, + ?TickFormatStops : seq, + ?Layer : StyleParam.Layer + ) = + AngularAxis() + |> AngularAxis.style + ( + ?Visible = Visible , + ?AxisType = AxisType , + ?AutoTypeNumbers = AutoTypeNumbers , + ?CategoryOrder = CategoryOrder , + ?CategoryArray = CategoryArray , + ?ThetaUnit = ThetaUnit , + ?Period = Period , + ?Direction = Direction , + ?Rotation = Rotation , + ?HoverFormat = HoverFormat , + ?UIRevision = UIRevision , + ?Color = Color , + ?ShowLine = ShowLine , + ?LineColor = LineColor , + ?LineWidth = LineWidth , + ?ShowGrid = ShowGrid , + ?GridColor = GridColor , + ?GridWidth = GridWidth , + ?TickMode = TickMode , + ?NTicks = NTicks , + ?Tick0 = Tick0 , + ?DTick = DTick , + ?TickVals = TickVals , + ?TickText = TickText , + ?Ticks = Ticks , + ?TickLen = TickLen , + ?TickWidth = TickWidth , + ?TickColor = TickColor , + ?ShowTickLabels = ShowTickLabels , + ?ShowTickPrefix = ShowTickPrefix , + ?TickPrefix = TickPrefix , + ?ShowTickSuffix = ShowTickSuffix , + ?TickSuffix = TickSuffix , + ?ShowExponent = ShowExponent , + ?ExponentFormat = ExponentFormat , + ?MinExponent = MinExponent , + ?SeparateThousands = SeparateThousands, + ?TickFont = TickFont , + ?TickAngle = TickAngle , + ?TickFormat = TickFormat , + ?TickFormatStops = TickFormatStops , + ?Layer = Layer + ) + + static member style + ( + ?Visible : bool, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?ThetaUnit : StyleParam.AngularUnit, + ?Period : float, + ?Direction : StyleParam.Direction, + ?Rotation : int, + ?HoverFormat : string, + ?UIRevision : string, + ?Color : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : int, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : int, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TickLen : int, + ?TickWidth : int, + ?TickColor : string, + ?ShowTickLabels : bool, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFont : Font, + ?TickAngle : int, + ?TickFormat : string, + ?TickFormatStops : seq, + ?Layer : StyleParam.Layer + ) = + fun (angularAxis: AngularAxis) -> + + Visible |> DynObj.setValueOpt angularAxis "visible" + AxisType |> DynObj.setValueOptBy angularAxis "type" StyleParam.AxisType.convert + AutoTypeNumbers |> DynObj.setValueOptBy angularAxis "autotypenumbers" StyleParam.AutoTypeNumbers.convert + CategoryOrder |> DynObj.setValueOptBy angularAxis "categoryorder" StyleParam.CategoryOrder.convert + CategoryArray |> DynObj.setValueOpt angularAxis "categoryarray" + ThetaUnit |> DynObj.setValueOpt angularAxis "thetaunit" + Period |> DynObj.setValueOpt angularAxis "Period" + Direction |> DynObj.setValueOpt angularAxis "Direction" + Rotation |> DynObj.setValueOpt angularAxis "Rotation" + HoverFormat |> DynObj.setValueOpt angularAxis "hoverformat" + UIRevision |> DynObj.setValueOpt angularAxis "uirevision" + Color |> DynObj.setValueOpt angularAxis "color" + ShowLine |> DynObj.setValueOpt angularAxis "showline" + LineColor |> DynObj.setValueOpt angularAxis "linecolor" + LineWidth |> DynObj.setValueOpt angularAxis "linewidth" + ShowGrid |> DynObj.setValueOpt angularAxis "showgrid" + GridColor |> DynObj.setValueOpt angularAxis "gridcolor" + GridWidth |> DynObj.setValueOpt angularAxis "gridwidth" + TickMode |> DynObj.setValueOptBy angularAxis "tickmode" StyleParam.TickMode.convert + NTicks |> DynObj.setValueOpt angularAxis "nticks" + Tick0 |> DynObj.setValueOpt angularAxis "tick0" + DTick |> DynObj.setValueOpt angularAxis "dtick" + TickVals |> DynObj.setValueOpt angularAxis "tickvals" + TickText |> DynObj.setValueOpt angularAxis "ticktext" + Ticks |> DynObj.setValueOptBy angularAxis "ticks" StyleParam.TickOptions.convert + TickLen |> DynObj.setValueOpt angularAxis "ticklen" + TickWidth |> DynObj.setValueOpt angularAxis "tickwidth" + TickColor |> DynObj.setValueOpt angularAxis "tickcolor" + ShowTickLabels |> DynObj.setValueOpt angularAxis "showticklabels" + ShowTickPrefix |> DynObj.setValueOptBy angularAxis "showtickprefix" StyleParam.ShowTickOption.convert + TickPrefix |> DynObj.setValueOpt angularAxis "tickprefix" + ShowTickSuffix |> DynObj.setValueOptBy angularAxis "showticksuffix" StyleParam.ShowTickOption.convert + TickSuffix |> DynObj.setValueOpt angularAxis "ticksuffix" + ShowExponent |> DynObj.setValueOptBy angularAxis "showexponent" StyleParam.ShowExponent.convert + ExponentFormat |> DynObj.setValueOptBy angularAxis "exponentformat" StyleParam.ExponentFormat.convert + MinExponent |> DynObj.setValueOpt angularAxis "minexponent" + SeparateThousands |> DynObj.setValueOpt angularAxis "separatethousands" + TickFont |> DynObj.setValueOpt angularAxis "tickfont" + TickAngle |> DynObj.setValueOpt angularAxis "tickangle" + TickFormat |> DynObj.setValueOpt angularAxis "tickformat" + TickFormatStops |> DynObj.setValueOpt angularAxis "tickformatstops" + Layer |> DynObj.setValueOptBy angularAxis "layer" StyleParam.Layer.convert + + angularAxis + From d735f6b93f2586ba993231aaa1647bce28e97354 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Sun, 8 Aug 2021 21:50:58 +0200 Subject: [PATCH 07/19] Add multiple objects for full axis param coverage --- src/Plotly.NET/Button.fs | 50 +++++++++++++++++++++++ src/Plotly.NET/Plotly.NET.fsproj | 4 ++ src/Plotly.NET/Polar.fs | 29 +++++++++++++ src/Plotly.NET/RangeSelector.fs | 66 ++++++++++++++++++++++++++++++ src/Plotly.NET/Rangebreak.fs | 70 ++++++++++++++++++++++++++++++++ src/Plotly.NET/Title.fs | 16 +++++--- 6 files changed, 229 insertions(+), 6 deletions(-) create mode 100644 src/Plotly.NET/Button.fs create mode 100644 src/Plotly.NET/Polar.fs create mode 100644 src/Plotly.NET/RangeSelector.fs create mode 100644 src/Plotly.NET/Rangebreak.fs diff --git a/src/Plotly.NET/Button.fs b/src/Plotly.NET/Button.fs new file mode 100644 index 000000000..6df438af1 --- /dev/null +++ b/src/Plotly.NET/Button.fs @@ -0,0 +1,50 @@ +namespace Plotly.NET + +/// Dimensions type inherits from dynamic object +type Button () = + inherit DynamicObj () + + static member init + ( + ?Visible : bool, + ?Step : StyleParam.TimeStep, + ?StepMode : StyleParam.TimeStepMode, + ?Count : int, + ?Label : string, + ?Name : string, + ?TemplateItemName : string + ) = + Button () + |> Button.style + ( + ?Visible = Visible , + ?Step = Step , + ?StepMode = StepMode , + ?Count = Count , + ?Label = Label , + ?Name = Name , + ?TemplateItemName = TemplateItemName + ) + + static member style + ( + ?Visible : bool, + ?Step : StyleParam.TimeStep, + ?StepMode : StyleParam.TimeStepMode, + ?Count : int, + ?Label : string, + ?Name : string, + ?TemplateItemName : string + ) = + (fun (button:Button) -> + + Visible |> DynObj.setValueOpt button "visible" + Step |> DynObj.setValueOptBy button "step" StyleParam.TimeStep.convert + StepMode |> DynObj.setValueOptBy button "stepmode" StyleParam.TimeStepMode.convert + Count |> DynObj.setValueOpt button "count" + Label |> DynObj.setValueOpt button "label" + Name |> DynObj.setValueOpt button "name" + TemplateItemName |> DynObj.setValueOpt button "templateitemname" + + button + ) \ No newline at end of file diff --git a/src/Plotly.NET/Plotly.NET.fsproj b/src/Plotly.NET/Plotly.NET.fsproj index 613fb4c54..63b297898 100644 --- a/src/Plotly.NET/Plotly.NET.fsproj +++ b/src/Plotly.NET/Plotly.NET.fsproj @@ -37,6 +37,7 @@ + @@ -47,6 +48,8 @@ + + @@ -60,6 +63,7 @@ + diff --git a/src/Plotly.NET/Polar.fs b/src/Plotly.NET/Polar.fs new file mode 100644 index 000000000..bd17ea19b --- /dev/null +++ b/src/Plotly.NET/Polar.fs @@ -0,0 +1,29 @@ +namespace Plotly.NET + +type Polar () = + inherit DynamicObj () + + static member init + ( + + ) = + Polar() + |> Polar.style + ( + + ) + + static member style + ( + ?Domain : Domain, + ?Sector : float*float, + ?Hole : float, + ?BgColor : string, + ?RadialAxis : Axis.RadialAxis, + ?AngularAxis: Axis.AngularAxis, + ?GridShape : StyleParam.PolarGridShape, + ?UIRevision : string + ) = + (fun (polar:Polar) -> + () + ) diff --git a/src/Plotly.NET/RangeSelector.fs b/src/Plotly.NET/RangeSelector.fs new file mode 100644 index 000000000..b4e19fe0f --- /dev/null +++ b/src/Plotly.NET/RangeSelector.fs @@ -0,0 +1,66 @@ +namespace Plotly.NET + +/// Dimensions type inherits from dynamic object +type RangeSelector () = + inherit DynamicObj () + + static member init + ( + ?Visible : bool, + ?Buttons : seq