From 376f55ebdfe05f68767a624a6629caae22c80e05 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Thu, 25 Aug 2022 19:40:25 +0200 Subject: [PATCH 1/4] WIP codegen --- .../ObjectAbstractions/TraceObjects/Bins.cs | 27 +++ .../ObjectAbstractions/TraceObjects/Box.cs | 31 ++++ .../ObjectAbstractions/TraceObjects/Caps.cs | 42 +++++ .../TraceObjects/Contours.cs | 95 ++++++++++ .../TraceObjects/Cumulative.cs | 27 +++ .../TraceObjects/Dimensions.cs | 57 ++++++ .../ObjectAbstractions/TraceObjects/Error.cs | 47 +++++ .../TraceObjects/FinanceMarker.cs | 29 +++ .../TraceObjects/FunnelConnector.cs | 27 +++ .../TraceObjects/Gradient.cs | 27 +++ .../ObjectAbstractions/TraceObjects/Icicle.cs | 57 ++++++ .../TraceObjects/Indicator.cs | 153 ++++++++++++++++ .../TraceObjects/Lighting.cs | 52 ++++++ .../ObjectAbstractions/TraceObjects/Marker.cs | 79 ++++++++ .../TraceObjects/MeanLine.cs | 27 +++ .../TraceObjects/Pathbar.cs | 31 ++++ .../TraceObjects/Pattern.cs | 39 ++++ .../TraceObjects/Projection.cs | 44 +++++ .../ObjectAbstractions/TraceObjects/Sankey.cs | 105 +++++++++++ .../TraceObjects/Selection.cs | 61 +++++++ .../ObjectAbstractions/TraceObjects/Slices.cs | 44 +++++ .../TraceObjects/SpaceFrame.cs | 25 +++ .../TraceObjects/SplomDiagonal.cs | 25 +++ .../TraceObjects/StockData.cs | 23 +++ .../TraceObjects/StreamTubeStarts.cs | 27 +++ .../TraceObjects/Sunburst.cs | 44 +++++ .../TraceObjects/Surface.cs | 29 +++ .../ObjectAbstractions/TraceObjects/Table.cs | 73 ++++++++ .../TraceObjects/Treemap.cs | 63 +++++++ .../TraceObjects/WaterfallConnector.cs | 27 +++ .../TraceObjects/traceobject-codegen.fsx | 170 ++++++++++++++++++ 31 files changed, 1607 insertions(+) create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Bins.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Box.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Caps.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Contours.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Cumulative.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Dimensions.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Error.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FinanceMarker.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FunnelConnector.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Gradient.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Icicle.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Indicator.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Lighting.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Marker.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/MeanLine.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pathbar.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pattern.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Projection.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sankey.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Selection.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Slices.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SpaceFrame.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SplomDiagonal.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StockData.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StreamTubeStarts.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sunburst.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Surface.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Treemap.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/WaterfallConnector.cs create mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/traceobject-codegen.fsx diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Bins.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Bins.cs new file mode 100644 index 000000000..56783f96b --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Bins.cs @@ -0,0 +1,27 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Bins Bins + ( + + Optional Start = default, + Optional End = default, + Optional Size = default + ) => + Plotly.NET.TraceObjects.Bins.init( + + Start: Start.ToOption(), + End: End.ToOption(), + Size: Size.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Box.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Box.cs new file mode 100644 index 000000000..8809ab393 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Box.cs @@ -0,0 +1,31 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Box Box + ( + + Optional Visible = default, + Optional Width = default, + Optional FillColor = default, + Optional LineColor = default, + Optional LineWidth = default + ) => + Plotly.NET.TraceObjects.Box.init( + + Visible: Visible.ToOption(), + Width: Width.ToOption(), + FillColor: FillColor.ToOption(), + LineColor: LineColor.ToOption(), + LineWidth: LineWidth.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Caps.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Caps.cs new file mode 100644 index 000000000..a5b632770 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Caps.cs @@ -0,0 +1,42 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.CapFill CapFill + ( + + Optional Fill = default, + Optional Show = default + ) => + Plotly.NET.TraceObjects.CapFill.init( + + Fill: Fill.ToOption(), + Show: Show.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Caps Caps + ( + + Optional X = default, + Optional Y = default, + Optional Z = default + ) => + Plotly.NET.TraceObjects.Caps.init( + + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Contours.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Contours.cs new file mode 100644 index 000000000..ece02af29 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Contours.cs @@ -0,0 +1,95 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.ContourProject ContourProject + ( + + Optional X = default, + Optional Y = default, + Optional Z = default + ) => + Plotly.NET.TraceObjects.ContourProject.init( + + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Contour Contour + ( + + Optional Color = default, + Optional End = default, + Optional Highlight = default, + Optional HighlightColor = default, + Optional HighlightWidth = default, + Optional Project = default, + Optional Show = default, + Optional Size = default, + Optional Start = default, + Optional UseColorMap = default, + Optional Width = default + ) => + Plotly.NET.TraceObjects.Contour.init( + + Color: Color.ToOption(), + End: End.ToOption(), + Highlight: Highlight.ToOption(), + HighlightColor: HighlightColor.ToOption(), + HighlightWidth: HighlightWidth.ToOption(), + Project: Project.ToOption(), + Show: Show.ToOption(), + Size: Size.ToOption(), + Start: Start.ToOption(), + UseColorMap: UseColorMap.ToOption(), + Width: Width.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Contours Contours + ( + + Optional Coloring = default, + Optional End = default, + Optional LabelFont = default, + Optional LabelFormat = default, + Optional Operation = default, + Optional ShowLabels = default, + Optional ShowLines = default, + Optional Size = default, + Optional Start = default, + Optional Type = default, + Optional Value = default + ) + where ValueType : IConvertible + => + Plotly.NET.TraceObjects.Contours.init( + + Coloring: Coloring.ToOption(), + End: End.ToOption(), + LabelFont: LabelFont.ToOption(), + LabelFormat: LabelFormat.ToOption(), + Operation: Operation.ToOption(), + ShowLabels: ShowLabels.ToOption(), + ShowLines: ShowLines.ToOption(), + Size: Size.ToOption(), + Start: Start.ToOption(), + Type: Type.ToOption(), + Value: Value.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Cumulative.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Cumulative.cs new file mode 100644 index 000000000..2a7dd309c --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Cumulative.cs @@ -0,0 +1,27 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Cumulative Cumulative + ( + + Optional Enabled = default, + Optional Direction = default, + Optional Currentbin = default + ) => + Plotly.NET.TraceObjects.Cumulative.init( + + Enabled: Enabled.ToOption(), + Direction: Direction.ToOption(), + Currentbin: Currentbin.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Dimensions.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Dimensions.cs new file mode 100644 index 000000000..66b250242 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Dimensions.cs @@ -0,0 +1,57 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Dimension Dimension + ( + + Optional ConstraintRange = default, + Optional Label = default, + Optional MultiSelect = default, + Optional Name = default, + Optional Range = default, + Optional TemplateItemName = default, + Optional TickFormat = default, + Optional> TickText = default, + Optional> Tickvals = default, + Optional> Values = default, + Optional Visible = default, + Optional AxisMatches = default, + Optional AxisType = default, + Optional<#IConvertible> Label = default, + Optional Name = default, + Optional TemplateItemName = default, + Optional> Values = default, + Optional Visible = default + ) => + Plotly.NET.TraceObjects.Dimension.init( + + ConstraintRange: ConstraintRange.ToOption(), + Label: Label.ToOption(), + MultiSelect: MultiSelect.ToOption(), + Name: Name.ToOption(), + Range: Range.ToOption(), + TemplateItemName: TemplateItemName.ToOption(), + TickFormat: TickFormat.ToOption(), + TickText: TickText.ToOption(), + Tickvals: Tickvals.ToOption(), + Values: Values.ToOption(), + Visible: Visible.ToOption(), + AxisMatches: AxisMatches.ToOption(), + AxisType: AxisType.ToOption(), + Label: Label.ToOption(), + Name: Name.ToOption(), + TemplateItemName: TemplateItemName.ToOption(), + Values: Values.ToOption(), + Visible: Visible.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Error.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Error.cs new file mode 100644 index 000000000..27d376363 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Error.cs @@ -0,0 +1,47 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Error Error + ( + + Optional Visible = default, + Optional Type = default, + Optional Symmetric = default, + Optional> Array = default, + Optional> Arrayminus = default, + Optional Value = default, + Optional Valueminus = default, + Optional Traceref = default, + Optional Tracerefminus = default, + Optional Copy_ystyle = default, + Optional Color = default, + Optional Thickness = default, + Optional Width = default + ) => + Plotly.NET.TraceObjects.Error.init( + + Visible: Visible.ToOption(), + Type: Type.ToOption(), + Symmetric: Symmetric.ToOption(), + Array: Array.ToOption(), + Arrayminus: Arrayminus.ToOption(), + Value: Value.ToOption(), + Valueminus: Valueminus.ToOption(), + Traceref: Traceref.ToOption(), + Tracerefminus: Tracerefminus.ToOption(), + Copy_ystyle: Copy_ystyle.ToOption(), + Color: Color.ToOption(), + Thickness: Thickness.ToOption(), + Width: Width.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FinanceMarker.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FinanceMarker.cs new file mode 100644 index 000000000..e2c7a76f6 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FinanceMarker.cs @@ -0,0 +1,29 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.FinanceMarker FinanceMarker + ( + + Optional MarkerColor = default, + Optional LineColor = default, + Optional LineWidth = default, + Optional LineDash = default + ) => + Plotly.NET.TraceObjects.FinanceMarker.init( + + MarkerColor: MarkerColor.ToOption(), + LineColor: LineColor.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FunnelConnector.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FunnelConnector.cs new file mode 100644 index 000000000..8c3a9e429 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FunnelConnector.cs @@ -0,0 +1,27 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.FunnelConnector FunnelConnector + ( + + Optional FillColor = default, + Optional Line = default, + Optional Visible = default + ) => + Plotly.NET.TraceObjects.FunnelConnector.init( + + FillColor: FillColor.ToOption(), + Line: Line.ToOption(), + Visible: Visible.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Gradient.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Gradient.cs new file mode 100644 index 000000000..debed6d6e --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Gradient.cs @@ -0,0 +1,27 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Gradient Gradient + ( + + Optional Color = default, + Optional Type = default, + Optional> MultiTypes = default + ) => + Plotly.NET.TraceObjects.Gradient.init( + + Color: Color.ToOption(), + Type: Type.ToOption(), + MultiTypes: MultiTypes.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Icicle.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Icicle.cs new file mode 100644 index 000000000..05622da35 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Icicle.cs @@ -0,0 +1,57 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IcicleRoot IcicleRoot + ( + , + + + ) => + Plotly.NET.TraceObjects.IcicleRoot.init( + : , + : + + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IcicleLeaf IcicleLeaf + ( + , + + + ) => + Plotly.NET.TraceObjects.IcicleLeaf.init( + : , + : + + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IcicleTiling IcicleTiling + ( + + Optional Flip = default, + Optional Orientation = default, + Optional Pad = default + ) => + Plotly.NET.TraceObjects.IcicleTiling.init( + + Flip: Flip.ToOption(), + Orientation: Orientation.ToOption(), + Pad: Pad.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Indicator.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Indicator.cs new file mode 100644 index 000000000..b862ddbfe --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Indicator.cs @@ -0,0 +1,153 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IndicatorSymbol IndicatorSymbol + ( + + Optional Color = default, + Optional Symbol = default + ) => + Plotly.NET.TraceObjects.IndicatorSymbol.init( + + Color: Color.ToOption(), + Symbol: Symbol.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IndicatorDelta IndicatorDelta + ( + + Optional Decreasing = default, + Optional Font = default, + Optional Increasing = default, + Optional Position = default, + Optional<#IConvertible> Reference = default, + Optional Relative = default, + Optional ValueFormat = default + ) => + Plotly.NET.TraceObjects.IndicatorDelta.init( + + Decreasing: Decreasing.ToOption(), + Font: Font.ToOption(), + Increasing: Increasing.ToOption(), + Position: Position.ToOption(), + Reference: Reference.ToOption(), + Relative: Relative.ToOption(), + ValueFormat: ValueFormat.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IndicatorNumber IndicatorNumber + ( + + Optional Font = default, + Optional Prefix = default, + Optional Suffix = default, + Optional ValueFormat = default + ) => + Plotly.NET.TraceObjects.IndicatorNumber.init( + + Font: Font.ToOption(), + Prefix: Prefix.ToOption(), + Suffix: Suffix.ToOption(), + ValueFormat: ValueFormat.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IndicatorBar IndicatorBar + ( + + Optional Color = default, + Optional Line = default, + Optional Thickness = default + ) => + Plotly.NET.TraceObjects.IndicatorBar.init( + + Color: Color.ToOption(), + Line: Line.ToOption(), + Thickness: Thickness.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IndicatorStep IndicatorStep + ( + + Optional Color = default, + Optional Line = default, + Optional Name = default, + Optional Range = default, + Optional TemplateItemName = default, + Optional Thickness = default + ) => + Plotly.NET.TraceObjects.IndicatorStep.init( + + Color: Color.ToOption(), + Line: Line.ToOption(), + Name: Name.ToOption(), + Range: Range.ToOption(), + TemplateItemName: TemplateItemName.ToOption(), + Thickness: Thickness.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IndicatorThreshold IndicatorThreshold + ( + + Optional Line = default, + Optional Thickness = default, + Optional<#IConvertible> Value = default + ) => + Plotly.NET.TraceObjects.IndicatorThreshold.init( + + Line: Line.ToOption(), + Thickness: Thickness.ToOption(), + Value: Value.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.IndicatorGauge IndicatorGauge + ( + + Optional Axis = default, + Optional Bar = default, + Optional BGColor = default, + Optional BorderColor = default, + Optional BorderWidth = default, + Optional Shape = default, + Optional> Steps = default, + Optional Threshold = default + ) => + Plotly.NET.TraceObjects.IndicatorGauge.init( + + Axis: Axis.ToOption(), + Bar: Bar.ToOption(), + BGColor: BGColor.ToOption(), + BorderColor: BorderColor.ToOption(), + BorderWidth: BorderWidth.ToOption(), + Shape: Shape.ToOption(), + Steps: Steps.ToOption(), + Threshold: Threshold.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Lighting.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Lighting.cs new file mode 100644 index 000000000..62eaacc65 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Lighting.cs @@ -0,0 +1,52 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Lighting Lighting + ( + + Optional Ambient = default, + Optional Diffuse = default, + Optional FaceNormalEpsilon = default, + Optional Fresnel = default, + Optional Roughness = default, + Optional Specular = default, + Optional VertexNormalEpsilon = default + ) => + Plotly.NET.TraceObjects.Lighting.init( + + Ambient: Ambient.ToOption(), + Diffuse: Diffuse.ToOption(), + FaceNormalEpsilon: FaceNormalEpsilon.ToOption(), + Fresnel: Fresnel.ToOption(), + Roughness: Roughness.ToOption(), + Specular: Specular.ToOption(), + VertexNormalEpsilon: VertexNormalEpsilon.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.LightPosition LightPosition + ( + + Optional X = default, + Optional Y = default, + Optional Z = default + ) => + Plotly.NET.TraceObjects.LightPosition.init( + + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Marker.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Marker.cs new file mode 100644 index 000000000..a5ceddc5e --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Marker.cs @@ -0,0 +1,79 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Marker Marker + ( + + Optional AutoColorScale = default, + Optional CAuto = default, + Optional CMax = default, + Optional CMid = default, + Optional CMin = default, + Optional Color = default, + Optional> Colors = default, + Optional ColorAxis = default, + Optional ColorBar = default, + Optional Colorscale = default, + Optional Gradient = default, + Optional Outline = default, + Optional MaxDisplayed = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Pattern = default, + Optional ReverseScale = default, + Optional ShowScale = default, + Optional Size = default, + Optional> MultiSize = default, + Optional SizeMin = default, + Optional SizeMode = default, + Optional SizeRef = default, + Optional Symbol = default, + Optional> MultiSymbol = default, + Optional Symbol3D = default, + Optional> MultiSymbol3D = default, + Optional OutlierColor = default, + Optional OutlierWidth = default + ) => + Plotly.NET.TraceObjects.Marker.init( + + AutoColorScale: AutoColorScale.ToOption(), + CAuto: CAuto.ToOption(), + CMax: CMax.ToOption(), + CMid: CMid.ToOption(), + CMin: CMin.ToOption(), + Color: Color.ToOption(), + Colors: Colors.ToOption(), + ColorAxis: ColorAxis.ToOption(), + ColorBar: ColorBar.ToOption(), + Colorscale: Colorscale.ToOption(), + Gradient: Gradient.ToOption(), + Outline: Outline.ToOption(), + MaxDisplayed: MaxDisplayed.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Pattern: Pattern.ToOption(), + ReverseScale: ReverseScale.ToOption(), + ShowScale: ShowScale.ToOption(), + Size: Size.ToOption(), + MultiSize: MultiSize.ToOption(), + SizeMin: SizeMin.ToOption(), + SizeMode: SizeMode.ToOption(), + SizeRef: SizeRef.ToOption(), + Symbol: Symbol.ToOption(), + MultiSymbol: MultiSymbol.ToOption(), + Symbol3D: Symbol3D.ToOption(), + MultiSymbol3D: MultiSymbol3D.ToOption(), + OutlierColor: OutlierColor.ToOption(), + OutlierWidth: OutlierWidth.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/MeanLine.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/MeanLine.cs new file mode 100644 index 000000000..3367aa068 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/MeanLine.cs @@ -0,0 +1,27 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.MeanLine MeanLine + ( + + Optional Visible = default, + Optional Color = default, + Optional Width = default + ) => + Plotly.NET.TraceObjects.MeanLine.init( + + Visible: Visible.ToOption(), + Color: Color.ToOption(), + Width: Width.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pathbar.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pathbar.cs new file mode 100644 index 000000000..a696e4867 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pathbar.cs @@ -0,0 +1,31 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Pathbar Pathbar + ( + + Optional Visible = default, + Optional Side = default, + Optional EdgeShape = default, + Optional Thickness = default, + Optional Textfont = default + ) => + Plotly.NET.TraceObjects.Pathbar.init( + + Visible: Visible.ToOption(), + Side: Side.ToOption(), + EdgeShape: EdgeShape.ToOption(), + Thickness: Thickness.ToOption(), + Textfont: Textfont.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pattern.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pattern.cs new file mode 100644 index 000000000..f04c2dcc1 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pattern.cs @@ -0,0 +1,39 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Pattern Pattern + ( + + Optional BGColor = default, + Optional FGColor = default, + Optional FGOpacity = default, + Optional FillMode = default, + Optional Shape = default, + Optional> MultiShape = default, + Optional Size = default, + Optional> MultiSize = default, + Optional Solidity = default + ) => + Plotly.NET.TraceObjects.Pattern.init( + + BGColor: BGColor.ToOption(), + FGColor: FGColor.ToOption(), + FGOpacity: FGOpacity.ToOption(), + FillMode: FillMode.ToOption(), + Shape: Shape.ToOption(), + MultiShape: MultiShape.ToOption(), + Size: Size.ToOption(), + MultiSize: MultiSize.ToOption(), + Solidity: Solidity.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Projection.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Projection.cs new file mode 100644 index 000000000..33853253b --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Projection.cs @@ -0,0 +1,44 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.ProjectionDimension ProjectionDimension + ( + + Optional Opacity = default, + Optional Scale = default, + Optional Show = default + ) => + Plotly.NET.TraceObjects.ProjectionDimension.init( + + Opacity: Opacity.ToOption(), + Scale: Scale.ToOption(), + Show: Show.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Projection Projection + ( + + Optional X = default, + Optional Y = default, + Optional Z = default + ) => + Plotly.NET.TraceObjects.Projection.init( + + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sankey.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sankey.cs new file mode 100644 index 000000000..548471c68 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sankey.cs @@ -0,0 +1,105 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.SankeyNodes SankeyNodes + ( + + Optional Color = default, + Optional> CustomData = default, + Optional>> Groups = default, + Optional HoverInfo = default, + Optional HoverLabel = default, + Optional HoverTemplate = default, + Optional> MultiHoverTemplate = default, + Optional> Label = default, + Optional Line = default, + Optional Pad = default, + Optional Thickness = default, + Optional> X = default, + Optional> Y = default + ) => + Plotly.NET.TraceObjects.SankeyNodes.init( + + Color: Color.ToOption(), + CustomData: CustomData.ToOption(), + Groups: Groups.ToOption(), + HoverInfo: HoverInfo.ToOption(), + HoverLabel: HoverLabel.ToOption(), + HoverTemplate: HoverTemplate.ToOption(), + MultiHoverTemplate: MultiHoverTemplate.ToOption(), + Label: Label.ToOption(), + Line: Line.ToOption(), + Pad: Pad.ToOption(), + Thickness: Thickness.ToOption(), + X: X.ToOption(), + Y: Y.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.SankeyLinkColorscale SankeyLinkColorscale + ( + + Optional CMax = default, + Optional CMin = default, + Optional ColorScale = default, + Optional Label = default, + Optional Name = default, + Optional TemplateItemName = default + ) => + Plotly.NET.TraceObjects.SankeyLinkColorscale.init( + + CMax: CMax.ToOption(), + CMin: CMin.ToOption(), + ColorScale: ColorScale.ToOption(), + Label: Label.ToOption(), + Name: Name.ToOption(), + TemplateItemName: TemplateItemName.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.SankeyLinks SankeyLinks + ( + + Optional Color = default, + Optional> ColorScales = default, + Optional> CustomData = default, + Optional HoverInfo = default, + Optional HoverLabel = default, + Optional HoverTemplate = default, + Optional> MultiHoverTemplate = default, + Optional> Label = default, + Optional Line = default, + Optional> Source = default, + Optional> Target = default, + Optional> Value = default + ) => + Plotly.NET.TraceObjects.SankeyLinks.init( + + Color: Color.ToOption(), + ColorScales: ColorScales.ToOption(), + CustomData: CustomData.ToOption(), + HoverInfo: HoverInfo.ToOption(), + HoverLabel: HoverLabel.ToOption(), + HoverTemplate: HoverTemplate.ToOption(), + MultiHoverTemplate: MultiHoverTemplate.ToOption(), + Label: Label.ToOption(), + Line: Line.ToOption(), + Source: Source.ToOption(), + Target: Target.ToOption(), + Value: Value.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Selection.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Selection.cs new file mode 100644 index 000000000..8b70443aa --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Selection.cs @@ -0,0 +1,61 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.MarkerSelectionStyle MarkerSelectionStyle + ( + + Optional Opacity = default, + Optional Color = default, + Optional Size = default + ) => + Plotly.NET.TraceObjects.MarkerSelectionStyle.init( + + Opacity: Opacity.ToOption(), + Color: Color.ToOption(), + Size: Size.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.FontSelectionStyle FontSelectionStyle + ( + , + , + , + + + ) => + Plotly.NET.TraceObjects.FontSelectionStyle.init( + : , + : , + : , + : + + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Selection Selection + ( + + Optional MarkerSelectionStyle = default, + Optional FontSelectionStyle = default + ) => + Plotly.NET.TraceObjects.Selection.init( + + MarkerSelectionStyle: MarkerSelectionStyle.ToOption(), + FontSelectionStyle: FontSelectionStyle.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Slices.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Slices.cs new file mode 100644 index 000000000..85a2df01c --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Slices.cs @@ -0,0 +1,44 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.SlicesFill SlicesFill + ( + + Optional Fill = default, + Optional> Locations = default, + Optional Show = default + ) => + Plotly.NET.TraceObjects.SlicesFill.init( + + Fill: Fill.ToOption(), + Locations: Locations.ToOption(), + Show: Show.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Slices Slices + ( + + Optional X = default, + Optional Y = default, + Optional Z = default + ) => + Plotly.NET.TraceObjects.Slices.init( + + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SpaceFrame.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SpaceFrame.cs new file mode 100644 index 000000000..de830f42b --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SpaceFrame.cs @@ -0,0 +1,25 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Spaceframe Spaceframe + ( + + Optional Fill = default, + Optional Show = default + ) => + Plotly.NET.TraceObjects.Spaceframe.init( + + Fill: Fill.ToOption(), + Show: Show.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SplomDiagonal.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SplomDiagonal.cs new file mode 100644 index 000000000..615061945 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SplomDiagonal.cs @@ -0,0 +1,25 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.SplomDiagonal SplomDiagonal + ( + , + + + ) => + Plotly.NET.TraceObjects.SplomDiagonal.init( + : , + : + + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StockData.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StockData.cs new file mode 100644 index 000000000..a9212c44d --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StockData.cs @@ -0,0 +1,23 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.StockData StockData + ( + + + ) => + Plotly.NET.TraceObjects.StockData.init( + + + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StreamTubeStarts.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StreamTubeStarts.cs new file mode 100644 index 000000000..d4d8bd51c --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StreamTubeStarts.cs @@ -0,0 +1,27 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.StreamTubeStarts StreamTubeStarts + ( + + Optional> X = default, + Optional> Y = default, + Optional> Z = default + ) => + Plotly.NET.TraceObjects.StreamTubeStarts.init( + + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sunburst.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sunburst.cs new file mode 100644 index 000000000..b9701ed44 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sunburst.cs @@ -0,0 +1,44 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.SunburstRoot SunburstRoot + ( + , + , + + + ) => + Plotly.NET.TraceObjects.SunburstRoot.init( + : , + : , + : + + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.SunburstLeaf SunburstLeaf + ( + , + , + + + ) => + Plotly.NET.TraceObjects.SunburstLeaf.init( + : , + : , + : + + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Surface.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Surface.cs new file mode 100644 index 000000000..33fcacebd --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Surface.cs @@ -0,0 +1,29 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Surface Surface + ( + + Optional Count = default, + Optional Fill = default, + Optional Pattern = default, + Optional Show = default + ) => + Plotly.NET.TraceObjects.Surface.init( + + Count: Count.ToOption(), + Fill: Fill.ToOption(), + Pattern: Pattern.ToOption(), + Show: Show.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs new file mode 100644 index 000000000..f4c63bd91 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs @@ -0,0 +1,73 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.TableFill TableFill + ( + , + + + ) => + Plotly.NET.TraceObjects.TableFill.init( + : , + : + + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.TableCells TableCells + ( + + Optional Align = default, + Optional> MultiAlign = default, + Optional Fill = default, + Optional Font = default, + Optional> Format = default, + Optional Height = default, + Optional Line = default, + Optional Prefix = default, + Optional> MultiPrefix = default, + Optional Suffix = default, + Optional> MultiSuffix = default, + Optional>> Values = default + ) => + Plotly.NET.TraceObjects.TableCells.init( + + Align: Align.ToOption(), + MultiAlign: MultiAlign.ToOption(), + Fill: Fill.ToOption(), + Font: Font.ToOption(), + Format: Format.ToOption(), + Height: Height.ToOption(), + Line: Line.ToOption(), + Prefix: Prefix.ToOption(), + MultiPrefix: MultiPrefix.ToOption(), + Suffix: Suffix.ToOption(), + MultiSuffix: MultiSuffix.ToOption(), + Values: Values.ToOption() + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.TableHeader TableHeader + ( + + + ) => + Plotly.NET.TraceObjects.TableHeader.init( + + + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Treemap.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Treemap.cs new file mode 100644 index 000000000..54973d60b --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Treemap.cs @@ -0,0 +1,63 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.TreemapRoot TreemapRoot + ( + , + , + + + ) => + Plotly.NET.TraceObjects.TreemapRoot.init( + : , + : , + : + + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.TreemapLeaf TreemapLeaf + ( + , + , + + + ) => + Plotly.NET.TraceObjects.TreemapLeaf.init( + : , + : , + : + + ); +} + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.TreemapTiling TreemapTiling + ( + + Optional Packing = default, + Optional SquarifyRatio = default, + Optional Flip = default, + Optional Pad = default + ) => + Plotly.NET.TraceObjects.TreemapTiling.init( + + Packing: Packing.ToOption(), + SquarifyRatio: SquarifyRatio.ToOption(), + Flip: Flip.ToOption(), + Pad: Pad.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/WaterfallConnector.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/WaterfallConnector.cs new file mode 100644 index 000000000..0e2024e97 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/WaterfallConnector.cs @@ -0,0 +1,27 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.WaterfallConnector WaterfallConnector + ( + + Optional Line = default, + Optional Visible = default, + Optional ConnectorMode = default + ) => + Plotly.NET.TraceObjects.WaterfallConnector.init( + + Line: Line.ToOption(), + Visible: Visible.ToOption(), + ConnectorMode: ConnectorMode.ToOption() + ); +} + diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/traceobject-codegen.fsx b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/traceobject-codegen.fsx new file mode 100644 index 000000000..cdb3693c9 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/traceobject-codegen.fsx @@ -0,0 +1,170 @@ +open System.IO +open System.Text +open System.Text.RegularExpressions + +type TraceObjectAbstraction = { + ObjectName: string + MandatoryParams: (string*string) list + OptionalParams: (string*string) list +} with + static member create name m o = + { + ObjectName = name + MandatoryParams = m + OptionalParams = o + } + +let objectNameRegex = new Regex("type (?[A-Za-z]*)()") + +let getObjectName (str:string) = + let m = objectNameRegex.Match(str) + m.Groups.Item("objectName").Value + +let paramRegex = new Regex("(?\S*):\s*(?[^,]*)") + +let getParam (str:string) = + let m = paramRegex.Match(str) + m.Groups.Item("pName").Value, + m.Groups.Item("pType").Value + +let optParamRegex = new Regex("\?(?\S*):\s*(?[^,]*)") + +let getOptParam (str:string) = + let m = optParamRegex.Match(str) + m.Groups.Item("pName").Value, + m.Groups.Item("pType").Value + +let parseSourceFile (path:string) = + let rec loop (lines: string list) (isFirstObj: bool) (isInit: bool) (currentName: string) (mParams: (string*string) list) (oParams: (string*string) list) (acc: TraceObjectAbstraction list) = + match lines with + | line::rest -> + match line with + | objectName when line.StartsWith("type") -> + let name = getObjectName objectName + if isFirstObj then + loop rest false isInit name mParams oParams acc + else + loop rest isFirstObj isInit name [] [] ((TraceObjectAbstraction.create currentName (List.rev mParams) (List.rev oParams)) :: acc) + + | init when init.Trim().StartsWith("static member init") -> + printfn "is init" + loop rest isFirstObj true currentName mParams oParams acc + + | otherMember when otherMember.Trim().StartsWith("static member") -> + printfn "is other member" + loop rest isFirstObj false currentName mParams oParams acc + + | bodyStart when + bodyStart.Trim().StartsWith("(") -> + printfn "is body start" + loop rest isFirstObj isInit currentName mParams oParams acc + + | bodyEnd when + bodyEnd.Trim().StartsWith(") =") -> + printfn "is body end" + loop rest isFirstObj false currentName mParams oParams acc + + | optParam when isInit && optParam.Trim().StartsWith("[ + printfn "is opt param" + loop rest isFirstObj isInit currentName mParams ((getOptParam optParam) :: oParams) acc + + | param when isInit -> + + printfn "is param" + loop rest isFirstObj isInit currentName ((getParam param) :: mParams) oParams acc + + | _ -> loop rest isFirstObj isInit currentName mParams oParams acc + + | [] -> (TraceObjectAbstraction.create currentName (List.rev mParams) (List.rev oParams))::acc |> List.rev + + loop (File.ReadAllLines path |> List.ofArray) true false "" [] [] [] + +let class_template = """public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.[OBJECT_NAME] [OBJECT_NAME] + ( +[MANDATORY_PARAMS] +[OPTIONAL_PARAMS] + ) => + Plotly.NET.TraceObjects.[OBJECT_NAME].init( +[MANDATORY_PARAMS_SETTERS] +[OPTIONAL_PARAMS_SETTERS] + ); +} +""" + +let mapFSharpType (typeName:string) = + typeName + .Replace("float","double") + .Replace("seq","IEnumerable") + +let populateClassTemplate (tObj: TraceObjectAbstraction) = + + let mParams = + tObj.MandatoryParams + |> List.map (fun (pName, pType) -> $" {mapFSharpType pType} {pName}") + |> String.concat $",{System.Environment.NewLine}" + + let mParamSetters = + tObj.MandatoryParams + |> List.map (fun (pName, _) -> $" {pName}: {pName}") + |> String.concat $",{System.Environment.NewLine}" + + let optParams = + tObj.OptionalParams + |> List.map (fun (pName, pType) -> $" Optional<{mapFSharpType pType}> {pName} = default") + |> String.concat $",{System.Environment.NewLine}" + + let optParamsSetters = + tObj.OptionalParams + |> List.map (fun (pName, pType) -> $" {pName}: {pName}.ToOption()") + |> String.concat $",{System.Environment.NewLine}" + + class_template + .Replace("[OBJECT_NAME]",tObj.ObjectName) + .Replace("[MANDATORY_PARAMS]",mParams) + .Replace("[OPTIONAL_PARAMS]",optParams) + .Replace("[MANDATORY_PARAMS_SETTERS]",mParamSetters) + .Replace("[OPTIONAL_PARAMS_SETTERS]",optParamsSetters) + +let file_template = """ +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +[CLASSES] +""" + +let createCSharpSourceFile (objectAbstractions: TraceObjectAbstraction list) = + let classes = + objectAbstractions + |> List.map populateClassTemplate + |> String.concat System.Environment.NewLine + + file_template.Replace("[CLASSES]",classes) + +let indicator = parseSourceFile @"C:\Users\schne\source\repos\plotly\Plotly.NET\src\Plotly.NET\Traces\ObjectAbstractions\Indicator.fs" + +let sourceFiles = + Directory.EnumerateFiles @"C:\Users\schne\source\repos\plotly\Plotly.NET\src\Plotly.NET\Traces\ObjectAbstractions\" + |> Seq.cast + |> Array.ofSeq + +let targetFiles = + sourceFiles + |> Array.map (fun path -> + path + .Replace(@"C:\Users\schne\source\repos\plotly\Plotly.NET\src\Plotly.NET\Traces\ObjectAbstractions\", @"C:\Users\schne\source\repos\plotly\Plotly.NET\src\Plotly.NET.CSharp\ObjectAbstractions\TraceObjects\") + .Replace(".fs", ".cs") + ) +Array.zip sourceFiles targetFiles +|> Array.iter (fun (source, target) -> + let classes = parseSourceFile source + let targetFile = createCSharpSourceFile classes + File.WriteAllText(target, targetFile) +) \ No newline at end of file From 030be13154b53134659fcb91bd93e9025a2d56b7 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Fri, 26 Aug 2022 15:43:24 +0200 Subject: [PATCH 2/4] Finish trace object bindings (codegen with some curation) --- .../ObjectAbstractions/TraceObjects/Bins.cs | 17 +- .../ObjectAbstractions/TraceObjects/Box.cs | 21 ++- .../ObjectAbstractions/TraceObjects/Caps.cs | 35 ++-- .../TraceObjects/Contours.cs | 79 ++++----- .../TraceObjects/Cumulative.cs | 17 +- .../TraceObjects/Dimensions.cs | 63 ++++--- .../ObjectAbstractions/TraceObjects/Error.cs | 43 ++--- .../TraceObjects/FinanceMarker.cs | 19 +- .../TraceObjects/FunnelConnector.cs | 16 +- .../TraceObjects/Gradient.cs | 17 +- .../ObjectAbstractions/TraceObjects/Icicle.cs | 50 +++--- .../TraceObjects/Indicator.cs | 166 ++++++++--------- .../TraceObjects/Lighting.cs | 36 ++-- .../ObjectAbstractions/TraceObjects/Marker.cs | 73 ++++---- .../TraceObjects/MeanLine.cs | 17 +- .../TraceObjects/Pathbar.cs | 21 ++- .../TraceObjects/Pattern.cs | 29 ++- .../TraceObjects/Projection.cs | 44 ++--- .../ObjectAbstractions/TraceObjects/Sankey.cs | 126 +++++++------ .../TraceObjects/Selection.cs | 65 +++---- .../ObjectAbstractions/TraceObjects/Slices.cs | 47 +++-- .../TraceObjects/SpaceFrame.cs | 15 +- .../TraceObjects/SplomDiagonal.cs | 17 +- .../TraceObjects/StockData.cs | 23 --- .../TraceObjects/StreamTubeStarts.cs | 26 +-- .../TraceObjects/Sunburst.cs | 42 ++--- .../TraceObjects/Surface.cs | 19 +- .../ObjectAbstractions/TraceObjects/Table.cs | 74 +++----- .../TraceObjects/Treemap.cs | 65 +++---- .../TraceObjects/WaterfallConnector.cs | 17 +- .../TraceObjects/traceobject-codegen.fsx | 167 ++++++++++++------ 31 files changed, 683 insertions(+), 783 deletions(-) delete mode 100644 src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StockData.cs diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Bins.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Bins.cs index 56783f96b..3b87d3cef 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Bins.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Bins.cs @@ -10,18 +10,17 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Bins Bins + public static Plotly.NET.TraceObjects.Bins InitBins ( - Optional Start = default, Optional End = default, Optional Size = default - ) => - Plotly.NET.TraceObjects.Bins.init( - - Start: Start.ToOption(), - End: End.ToOption(), - Size: Size.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Bins.init( + Start: Start.ToOption(), + End: End.ToOption(), + Size: Size.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Box.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Box.cs index 8809ab393..7eb1fb8ca 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Box.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Box.cs @@ -10,22 +10,21 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Box Box + public static Plotly.NET.TraceObjects.Box InitBox ( - Optional Visible = default, Optional Width = default, Optional FillColor = default, Optional LineColor = default, Optional LineWidth = default - ) => - Plotly.NET.TraceObjects.Box.init( - - Visible: Visible.ToOption(), - Width: Width.ToOption(), - FillColor: FillColor.ToOption(), - LineColor: LineColor.ToOption(), - LineWidth: LineWidth.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Box.init( + Visible: Visible.ToOption(), + Width: Width.ToOption(), + FillColor: FillColor.ToOption(), + LineColor: LineColor.ToOption(), + LineWidth: LineWidth.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Caps.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Caps.cs index a5b632770..be64cd6f7 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Caps.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Caps.cs @@ -10,33 +10,30 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.CapFill CapFill + public static Plotly.NET.TraceObjects.CapFill InitCapFill ( - Optional Fill = default, Optional Show = default - ) => - Plotly.NET.TraceObjects.CapFill.init( + ) + => + Plotly.NET.TraceObjects.CapFill.init( - Fill: Fill.ToOption(), - Show: Show.ToOption() - ); -} + Fill: Fill.ToOption(), + Show: Show.ToOption() + ); -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.Caps Caps + public static Plotly.NET.TraceObjects.Caps InitCaps ( - Optional X = default, Optional Y = default, Optional Z = default - ) => - Plotly.NET.TraceObjects.Caps.init( - - X: X.ToOption(), - Y: Y.ToOption(), - Z: Z.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Caps.init( + + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Contours.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Contours.cs index ece02af29..e23120f76 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Contours.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Contours.cs @@ -10,26 +10,24 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.ContourProject ContourProject + public static Plotly.NET.TraceObjects.ContourProject InitContourProject ( Optional X = default, Optional Y = default, Optional Z = default - ) => + ) + + => Plotly.NET.TraceObjects.ContourProject.init( X: X.ToOption(), Y: Y.ToOption(), Z: Z.ToOption() ); -} -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.Contour Contour + public static Plotly.NET.TraceObjects.Contour InitContour ( - Optional Color = default, Optional End = default, Optional Highlight = default, @@ -41,28 +39,24 @@ public static Plotly.NET.TraceObjects.Contour Contour Optional Start = default, Optional UseColorMap = default, Optional Width = default - ) => - Plotly.NET.TraceObjects.Contour.init( - - Color: Color.ToOption(), - End: End.ToOption(), - Highlight: Highlight.ToOption(), - HighlightColor: HighlightColor.ToOption(), - HighlightWidth: HighlightWidth.ToOption(), - Project: Project.ToOption(), - Show: Show.ToOption(), - Size: Size.ToOption(), - Start: Start.ToOption(), - UseColorMap: UseColorMap.ToOption(), - Width: Width.ToOption() - ); -} + ) + => + Plotly.NET.TraceObjects.Contour.init( + Color: Color.ToOption(), + End: End.ToOption(), + Highlight: Highlight.ToOption(), + HighlightColor: HighlightColor.ToOption(), + HighlightWidth: HighlightWidth.ToOption(), + Project: Project.ToOption(), + Show: Show.ToOption(), + Size: Size.ToOption(), + Start: Start.ToOption(), + UseColorMap: UseColorMap.ToOption(), + Width: Width.ToOption() + ); -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.Contours Contours + public static Plotly.NET.TraceObjects.Contours InitContours ( - Optional Coloring = default, Optional End = default, Optional LabelFont = default, @@ -75,21 +69,20 @@ public static Plotly.NET.TraceObjects.Contours Contours Optional Type = default, Optional Value = default ) - where ValueType : IConvertible - => - Plotly.NET.TraceObjects.Contours.init( - - Coloring: Coloring.ToOption(), - End: End.ToOption(), - LabelFont: LabelFont.ToOption(), - LabelFormat: LabelFormat.ToOption(), - Operation: Operation.ToOption(), - ShowLabels: ShowLabels.ToOption(), - ShowLines: ShowLines.ToOption(), - Size: Size.ToOption(), - Start: Start.ToOption(), - Type: Type.ToOption(), - Value: Value.ToOption() - ); + where ValueType: IConvertible + => + Plotly.NET.TraceObjects.Contours.init( + Coloring: Coloring.ToOption(), + End: End.ToOption(), + LabelFont: LabelFont.ToOption(), + LabelFormat: LabelFormat.ToOption(), + Operation: Operation.ToOption(), + ShowLabels: ShowLabels.ToOption(), + ShowLines: ShowLines.ToOption(), + Size: Size.ToOption(), + Start: Start.ToOption(), + Type: Type.ToOption(), + Value: Value.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Cumulative.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Cumulative.cs index 2a7dd309c..c3e4ce2b7 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Cumulative.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Cumulative.cs @@ -10,18 +10,17 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Cumulative Cumulative + public static Plotly.NET.TraceObjects.Cumulative InitCumulative ( - Optional Enabled = default, Optional Direction = default, Optional Currentbin = default - ) => - Plotly.NET.TraceObjects.Cumulative.init( - - Enabled: Enabled.ToOption(), - Direction: Direction.ToOption(), - Currentbin: Currentbin.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Cumulative.init( + Enabled: Enabled.ToOption(), + Direction: Direction.ToOption(), + Currentbin: Currentbin.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Dimensions.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Dimensions.cs index 66b250242..f197ba9b9 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Dimensions.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Dimensions.cs @@ -3,6 +3,8 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection.Emit; +using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; @@ -10,9 +12,8 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Dimension Dimension + public static Plotly.NET.TraceObjects.Dimension InitParallelDimension ( - Optional ConstraintRange = default, Optional Label = default, Optional MultiSelect = default, @@ -20,31 +21,43 @@ public static Plotly.NET.TraceObjects.Dimension Dimension Range = default, Optional TemplateItemName = default, Optional TickFormat = default, - Optional> TickText = default, - Optional> Tickvals = default, - Optional> Values = default, - Optional Visible = default, - Optional AxisMatches = default, - Optional AxisType = default, - Optional<#IConvertible> Label = default, - Optional Name = default, - Optional TemplateItemName = default, - Optional> Values = default, + Optional> TickText = default, + Optional> Tickvals = default, + Optional> Values = default, Optional Visible = default - ) => - Plotly.NET.TraceObjects.Dimension.init( + ) + where LabelType : IConvertible + where TickType : IConvertible + where ValuesType : IConvertible + => + Plotly.NET.TraceObjects.Dimension.initParallel( + ConstraintRange: ConstraintRange.ToOption(), + Label: Label.ToOption(), + MultiSelect: MultiSelect.ToOption(), + Name: Name.ToOption(), + Range: Range.ToOption(), + TemplateItemName: TemplateItemName.ToOption(), + TickFormat: TickFormat.ToOption(), + TickText: TickText.ToOption(), + Tickvals: Tickvals.ToOption(), + Values: Values.ToOption(), + Visible: Visible.ToOption() + ); - ConstraintRange: ConstraintRange.ToOption(), - Label: Label.ToOption(), - MultiSelect: MultiSelect.ToOption(), - Name: Name.ToOption(), - Range: Range.ToOption(), - TemplateItemName: TemplateItemName.ToOption(), - TickFormat: TickFormat.ToOption(), - TickText: TickText.ToOption(), - Tickvals: Tickvals.ToOption(), - Values: Values.ToOption(), - Visible: Visible.ToOption(), + public static Plotly.NET.TraceObjects.Dimension InitSplomDimension + ( + Optional AxisMatches = default, + Optional AxisType = default, + Optional Label = default, + Optional Name = default, + Optional TemplateItemName = default, + Optional> Values = default, + Optional Visible = default + ) + where LabelType : IConvertible + where ValuesType : IConvertible + => + Plotly.NET.TraceObjects.Dimension.initSplom( AxisMatches: AxisMatches.ToOption(), AxisType: AxisType.ToOption(), Label: Label.ToOption(), diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Error.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Error.cs index 27d376363..90fc52569 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Error.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Error.cs @@ -10,14 +10,13 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Error Error + public static Plotly.NET.TraceObjects.Error InitError ( - Optional Visible = default, Optional Type = default, Optional Symmetric = default, - Optional> Array = default, - Optional> Arrayminus = default, + Optional> Array = default, + Optional> Arrayminus = default, Optional Value = default, Optional Valueminus = default, Optional Traceref = default, @@ -26,22 +25,24 @@ public static Plotly.NET.TraceObjects.Error Error Optional Color = default, Optional Thickness = default, Optional Width = default - ) => - Plotly.NET.TraceObjects.Error.init( - - Visible: Visible.ToOption(), - Type: Type.ToOption(), - Symmetric: Symmetric.ToOption(), - Array: Array.ToOption(), - Arrayminus: Arrayminus.ToOption(), - Value: Value.ToOption(), - Valueminus: Valueminus.ToOption(), - Traceref: Traceref.ToOption(), - Tracerefminus: Tracerefminus.ToOption(), - Copy_ystyle: Copy_ystyle.ToOption(), - Color: Color.ToOption(), - Thickness: Thickness.ToOption(), - Width: Width.ToOption() - ); + ) + where ArrayType: IConvertible + where ArrayminusType: IConvertible + => + Plotly.NET.TraceObjects.Error.init( + Visible: Visible.ToOption(), + Type: Type.ToOption(), + Symmetric: Symmetric.ToOption(), + Array: Array.ToOption(), + Arrayminus: Arrayminus.ToOption(), + Value: Value.ToOption(), + Valueminus: Valueminus.ToOption(), + Traceref: Traceref.ToOption(), + Tracerefminus: Tracerefminus.ToOption(), + Copy_ystyle: Copy_ystyle.ToOption(), + Color: Color.ToOption(), + Thickness: Thickness.ToOption(), + Width: Width.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FinanceMarker.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FinanceMarker.cs index e2c7a76f6..d475a8e0f 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FinanceMarker.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FinanceMarker.cs @@ -10,20 +10,19 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.FinanceMarker FinanceMarker + public static Plotly.NET.TraceObjects.FinanceMarker InitFinanceMarker ( - Optional MarkerColor = default, Optional LineColor = default, Optional LineWidth = default, Optional LineDash = default - ) => - Plotly.NET.TraceObjects.FinanceMarker.init( - - MarkerColor: MarkerColor.ToOption(), - LineColor: LineColor.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.FinanceMarker.init( + MarkerColor: MarkerColor.ToOption(), + LineColor: LineColor.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FunnelConnector.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FunnelConnector.cs index 8c3a9e429..5ac39e987 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FunnelConnector.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FunnelConnector.cs @@ -10,18 +10,18 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.FunnelConnector FunnelConnector + public static Plotly.NET.TraceObjects.FunnelConnector InitFunnelConnector ( - Optional FillColor = default, Optional Line = default, Optional Visible = default - ) => - Plotly.NET.TraceObjects.FunnelConnector.init( + ) + => + Plotly.NET.TraceObjects.FunnelConnector.init( - FillColor: FillColor.ToOption(), - Line: Line.ToOption(), - Visible: Visible.ToOption() - ); + FillColor: FillColor.ToOption(), + Line: Line.ToOption(), + Visible: Visible.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Gradient.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Gradient.cs index debed6d6e..b30f182f1 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Gradient.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Gradient.cs @@ -10,18 +10,17 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Gradient Gradient + public static Plotly.NET.TraceObjects.Gradient InitGradient ( - Optional Color = default, Optional Type = default, Optional> MultiTypes = default - ) => - Plotly.NET.TraceObjects.Gradient.init( - - Color: Color.ToOption(), - Type: Type.ToOption(), - MultiTypes: MultiTypes.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Gradient.init( + Color: Color.ToOption(), + Type: Type.ToOption(), + MultiTypes: MultiTypes.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Icicle.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Icicle.cs index 05622da35..d2efb44aa 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Icicle.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Icicle.cs @@ -10,43 +10,33 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.IcicleRoot IcicleRoot + public static Plotly.NET.TraceObjects.IcicleRoot InitIcicleRoot ( - , - - - ) => - Plotly.NET.TraceObjects.IcicleRoot.init( - : , - : - - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.IcicleLeaf IcicleLeaf + Optional Color = default + ) + => + Plotly.NET.TraceObjects.IcicleRoot.init( + Color: Color.ToOption() + ); + + public static Plotly.NET.TraceObjects.IcicleLeaf InitIcicleLeaf ( - , - - - ) => - Plotly.NET.TraceObjects.IcicleLeaf.init( - : , - : - - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.IcicleTiling IcicleTiling + Optional Opacity = default + ) + => + Plotly.NET.TraceObjects.IcicleLeaf.init( + Opacity: Opacity.ToOption() + ); + + public static Plotly.NET.TraceObjects.IcicleTiling InitIcicleTiling ( Optional Flip = default, Optional Orientation = default, Optional Pad = default - ) => + ) + + => Plotly.NET.TraceObjects.IcicleTiling.init( Flip: Flip.ToOption(), diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Indicator.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Indicator.cs index b862ddbfe..80f33aee6 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Indicator.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Indicator.cs @@ -10,136 +10,108 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.IndicatorSymbol IndicatorSymbol + public static Plotly.NET.TraceObjects.IndicatorSymbol InitIndicatorSymbol ( - Optional Color = default, Optional Symbol = default - ) => - Plotly.NET.TraceObjects.IndicatorSymbol.init( - - Color: Color.ToOption(), - Symbol: Symbol.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.IndicatorDelta IndicatorDelta + ) + => + Plotly.NET.TraceObjects.IndicatorSymbol.init( + Color: Color.ToOption(), + Symbol: Symbol.ToOption() + ); + public static Plotly.NET.TraceObjects.IndicatorDelta InitIndicatorDelta ( - - Optional Decreasing = default, + Optional Decreasing = default, Optional Font = default, - Optional Increasing = default, + Optional Increasing = default, Optional Position = default, - Optional<#IConvertible> Reference = default, + Optional Reference = default, Optional Relative = default, Optional ValueFormat = default - ) => - Plotly.NET.TraceObjects.IndicatorDelta.init( - - Decreasing: Decreasing.ToOption(), - Font: Font.ToOption(), - Increasing: Increasing.ToOption(), - Position: Position.ToOption(), - Reference: Reference.ToOption(), - Relative: Relative.ToOption(), - ValueFormat: ValueFormat.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.IndicatorNumber IndicatorNumber + ) + where ReferenceType: IConvertible + => + Plotly.NET.TraceObjects.IndicatorDelta.init( + Decreasing: Decreasing.ToOption(), + Font: Font.ToOption(), + Increasing: Increasing.ToOption(), + Position: Position.ToOption(), + Reference: Reference.ToOption(), + Relative: Relative.ToOption(), + ValueFormat: ValueFormat.ToOption() + ); + public static Plotly.NET.TraceObjects.IndicatorNumber InitIndicatorNumber ( - Optional Font = default, Optional Prefix = default, Optional Suffix = default, Optional ValueFormat = default - ) => - Plotly.NET.TraceObjects.IndicatorNumber.init( - - Font: Font.ToOption(), - Prefix: Prefix.ToOption(), - Suffix: Suffix.ToOption(), - ValueFormat: ValueFormat.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.IndicatorBar IndicatorBar + ) + + => + Plotly.NET.TraceObjects.IndicatorNumber.init( + Font: Font.ToOption(), + Prefix: Prefix.ToOption(), + Suffix: Suffix.ToOption(), + ValueFormat: ValueFormat.ToOption() + ); + public static Plotly.NET.TraceObjects.IndicatorBar InitIndicatorBar ( - Optional Color = default, Optional Line = default, Optional Thickness = default - ) => - Plotly.NET.TraceObjects.IndicatorBar.init( - - Color: Color.ToOption(), - Line: Line.ToOption(), - Thickness: Thickness.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.IndicatorStep IndicatorStep + ) + => + Plotly.NET.TraceObjects.IndicatorBar.init( + Color: Color.ToOption(), + Line: Line.ToOption(), + Thickness: Thickness.ToOption() + ); + public static Plotly.NET.TraceObjects.IndicatorStep InitIndicatorStep ( - Optional Color = default, Optional Line = default, Optional Name = default, Optional Range = default, Optional TemplateItemName = default, Optional Thickness = default - ) => - Plotly.NET.TraceObjects.IndicatorStep.init( - - Color: Color.ToOption(), - Line: Line.ToOption(), - Name: Name.ToOption(), - Range: Range.ToOption(), - TemplateItemName: TemplateItemName.ToOption(), - Thickness: Thickness.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.IndicatorThreshold IndicatorThreshold + ) + => + Plotly.NET.TraceObjects.IndicatorStep.init( + Color: Color.ToOption(), + Line: Line.ToOption(), + Name: Name.ToOption(), + Range: Range.ToOption(), + TemplateItemName: TemplateItemName.ToOption(), + Thickness: Thickness.ToOption() + ); + public static Plotly.NET.TraceObjects.IndicatorThreshold InitIndicatorThreshold ( - Optional Line = default, Optional Thickness = default, - Optional<#IConvertible> Value = default - ) => - Plotly.NET.TraceObjects.IndicatorThreshold.init( - - Line: Line.ToOption(), - Thickness: Thickness.ToOption(), - Value: Value.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.IndicatorGauge IndicatorGauge + Optional Value = default + ) + where ValueType: IConvertible + => + Plotly.NET.TraceObjects.IndicatorThreshold.init( + Line: Line.ToOption(), + Thickness: Thickness.ToOption(), + Value: Value.ToOption() + ); + public static Plotly.NET.TraceObjects.IndicatorGauge InitIndicatorGauge ( - - Optional Axis = default, - Optional Bar = default, + Optional Axis = default, + Optional Bar = default, Optional BGColor = default, Optional BorderColor = default, Optional BorderWidth = default, Optional Shape = default, - Optional> Steps = default, - Optional Threshold = default - ) => + Optional> Steps = default, + Optional Threshold = default + ) + => Plotly.NET.TraceObjects.IndicatorGauge.init( - Axis: Axis.ToOption(), Bar: Bar.ToOption(), BGColor: BGColor.ToOption(), diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Lighting.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Lighting.cs index 62eaacc65..54261950e 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Lighting.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Lighting.cs @@ -10,9 +10,8 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Lighting Lighting + public static Plotly.NET.TraceObjects.Lighting InitLighting ( - Optional Ambient = default, Optional Diffuse = default, Optional FaceNormalEpsilon = default, @@ -20,30 +19,25 @@ public static Plotly.NET.TraceObjects.Lighting Lighting Optional Roughness = default, Optional Specular = default, Optional VertexNormalEpsilon = default - ) => - Plotly.NET.TraceObjects.Lighting.init( - - Ambient: Ambient.ToOption(), - Diffuse: Diffuse.ToOption(), - FaceNormalEpsilon: FaceNormalEpsilon.ToOption(), - Fresnel: Fresnel.ToOption(), - Roughness: Roughness.ToOption(), - Specular: Specular.ToOption(), - VertexNormalEpsilon: VertexNormalEpsilon.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.LightPosition LightPosition + ) + => + Plotly.NET.TraceObjects.Lighting.init( + Ambient: Ambient.ToOption(), + Diffuse: Diffuse.ToOption(), + FaceNormalEpsilon: FaceNormalEpsilon.ToOption(), + Fresnel: Fresnel.ToOption(), + Roughness: Roughness.ToOption(), + Specular: Specular.ToOption(), + VertexNormalEpsilon: VertexNormalEpsilon.ToOption() + ); + public static Plotly.NET.TraceObjects.LightPosition InitLightPosition ( - Optional X = default, Optional Y = default, Optional Z = default - ) => + ) + => Plotly.NET.TraceObjects.LightPosition.init( - X: X.ToOption(), Y: Y.ToOption(), Z: Z.ToOption() diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Marker.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Marker.cs index a5ceddc5e..7f162a2fe 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Marker.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Marker.cs @@ -10,9 +10,8 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Marker Marker + public static Plotly.NET.TraceObjects.Marker InitMarker ( - Optional AutoColorScale = default, Optional CAuto = default, Optional CMax = default, @@ -23,12 +22,12 @@ public static Plotly.NET.TraceObjects.Marker Marker Optional ColorAxis = default, Optional ColorBar = default, Optional Colorscale = default, - Optional Gradient = default, + Optional Gradient = default, Optional Outline = default, Optional MaxDisplayed = default, Optional Opacity = default, Optional> MultiOpacity = default, - Optional Pattern = default, + Optional Pattern = default, Optional ReverseScale = default, Optional ShowScale = default, Optional Size = default, @@ -42,38 +41,38 @@ public static Plotly.NET.TraceObjects.Marker Marker Optional> MultiSymbol3D = default, Optional OutlierColor = default, Optional OutlierWidth = default - ) => - Plotly.NET.TraceObjects.Marker.init( - - AutoColorScale: AutoColorScale.ToOption(), - CAuto: CAuto.ToOption(), - CMax: CMax.ToOption(), - CMid: CMid.ToOption(), - CMin: CMin.ToOption(), - Color: Color.ToOption(), - Colors: Colors.ToOption(), - ColorAxis: ColorAxis.ToOption(), - ColorBar: ColorBar.ToOption(), - Colorscale: Colorscale.ToOption(), - Gradient: Gradient.ToOption(), - Outline: Outline.ToOption(), - MaxDisplayed: MaxDisplayed.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Pattern: Pattern.ToOption(), - ReverseScale: ReverseScale.ToOption(), - ShowScale: ShowScale.ToOption(), - Size: Size.ToOption(), - MultiSize: MultiSize.ToOption(), - SizeMin: SizeMin.ToOption(), - SizeMode: SizeMode.ToOption(), - SizeRef: SizeRef.ToOption(), - Symbol: Symbol.ToOption(), - MultiSymbol: MultiSymbol.ToOption(), - Symbol3D: Symbol3D.ToOption(), - MultiSymbol3D: MultiSymbol3D.ToOption(), - OutlierColor: OutlierColor.ToOption(), - OutlierWidth: OutlierWidth.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Marker.init( + AutoColorScale: AutoColorScale.ToOption(), + CAuto: CAuto.ToOption(), + CMax: CMax.ToOption(), + CMid: CMid.ToOption(), + CMin: CMin.ToOption(), + Color: Color.ToOption(), + Colors: Colors.ToOption(), + ColorAxis: ColorAxis.ToOption(), + ColorBar: ColorBar.ToOption(), + Colorscale: Colorscale.ToOption(), + Gradient: Gradient.ToOption(), + Outline: Outline.ToOption(), + MaxDisplayed: MaxDisplayed.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Pattern: Pattern.ToOption(), + ReverseScale: ReverseScale.ToOption(), + ShowScale: ShowScale.ToOption(), + Size: Size.ToOption(), + MultiSize: MultiSize.ToOption(), + SizeMin: SizeMin.ToOption(), + SizeMode: SizeMode.ToOption(), + SizeRef: SizeRef.ToOption(), + Symbol: Symbol.ToOption(), + MultiSymbol: MultiSymbol.ToOption(), + Symbol3D: Symbol3D.ToOption(), + MultiSymbol3D: MultiSymbol3D.ToOption(), + OutlierColor: OutlierColor.ToOption(), + OutlierWidth: OutlierWidth.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/MeanLine.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/MeanLine.cs index 3367aa068..b38711c15 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/MeanLine.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/MeanLine.cs @@ -10,18 +10,17 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.MeanLine MeanLine + public static Plotly.NET.TraceObjects.MeanLine InitMeanLine ( - Optional Visible = default, Optional Color = default, Optional Width = default - ) => - Plotly.NET.TraceObjects.MeanLine.init( - - Visible: Visible.ToOption(), - Color: Color.ToOption(), - Width: Width.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.MeanLine.init( + Visible: Visible.ToOption(), + Color: Color.ToOption(), + Width: Width.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pathbar.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pathbar.cs index a696e4867..933bc47fd 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pathbar.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pathbar.cs @@ -10,22 +10,21 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Pathbar Pathbar + public static Plotly.NET.TraceObjects.Pathbar InitPathbar ( - Optional Visible = default, Optional Side = default, Optional EdgeShape = default, Optional Thickness = default, Optional Textfont = default - ) => - Plotly.NET.TraceObjects.Pathbar.init( - - Visible: Visible.ToOption(), - Side: Side.ToOption(), - EdgeShape: EdgeShape.ToOption(), - Thickness: Thickness.ToOption(), - Textfont: Textfont.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Pathbar.init( + Visible: Visible.ToOption(), + Side: Side.ToOption(), + EdgeShape: EdgeShape.ToOption(), + Thickness: Thickness.ToOption(), + Textfont: Textfont.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pattern.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pattern.cs index f04c2dcc1..987ad8729 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pattern.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pattern.cs @@ -10,9 +10,8 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Pattern Pattern + public static Plotly.NET.TraceObjects.Pattern InitPattern ( - Optional BGColor = default, Optional FGColor = default, Optional FGOpacity = default, @@ -22,18 +21,18 @@ public static Plotly.NET.TraceObjects.Pattern Pattern Optional Size = default, Optional> MultiSize = default, Optional Solidity = default - ) => - Plotly.NET.TraceObjects.Pattern.init( - - BGColor: BGColor.ToOption(), - FGColor: FGColor.ToOption(), - FGOpacity: FGOpacity.ToOption(), - FillMode: FillMode.ToOption(), - Shape: Shape.ToOption(), - MultiShape: MultiShape.ToOption(), - Size: Size.ToOption(), - MultiSize: MultiSize.ToOption(), - Solidity: Solidity.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Pattern.init( + BGColor: BGColor.ToOption(), + FGColor: FGColor.ToOption(), + FGOpacity: FGOpacity.ToOption(), + FillMode: FillMode.ToOption(), + Shape: Shape.ToOption(), + MultiShape: MultiShape.ToOption(), + Size: Size.ToOption(), + MultiSize: MultiSize.ToOption(), + Solidity: Solidity.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Projection.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Projection.cs index 33853253b..38cc6f844 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Projection.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Projection.cs @@ -10,35 +10,29 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.ProjectionDimension ProjectionDimension + public static Plotly.NET.TraceObjects.ProjectionDimension InitProjectionDimension ( - Optional Opacity = default, Optional Scale = default, Optional Show = default - ) => - Plotly.NET.TraceObjects.ProjectionDimension.init( - - Opacity: Opacity.ToOption(), - Scale: Scale.ToOption(), - Show: Show.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.Projection Projection + ) + => + Plotly.NET.TraceObjects.ProjectionDimension.init( + Opacity: Opacity.ToOption(), + Scale: Scale.ToOption(), + Show: Show.ToOption() + ); + public static Plotly.NET.TraceObjects.Projection InitProjection ( - - Optional X = default, - Optional Y = default, - Optional Z = default - ) => - Plotly.NET.TraceObjects.Projection.init( - - X: X.ToOption(), - Y: Y.ToOption(), - Z: Z.ToOption() - ); + Optional X = default, + Optional Y = default, + Optional Z = default + ) + => + Plotly.NET.TraceObjects.Projection.init( + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sankey.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sankey.cs index 548471c68..b06eedea2 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sankey.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sankey.cs @@ -10,96 +10,90 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.SankeyNodes SankeyNodes + public static Plotly.NET.TraceObjects.SankeyNodes InitSankeyNodes ( - Optional Color = default, - Optional> CustomData = default, - Optional>> Groups = default, + Optional> CustomData = default, + Optional>> Groups = default, Optional HoverInfo = default, - Optional HoverLabel = default, + Optional HoverLabel = default, Optional HoverTemplate = default, Optional> MultiHoverTemplate = default, Optional> Label = default, Optional Line = default, Optional Pad = default, Optional Thickness = default, - Optional> X = default, - Optional> Y = default - ) => - Plotly.NET.TraceObjects.SankeyNodes.init( - - Color: Color.ToOption(), - CustomData: CustomData.ToOption(), - Groups: Groups.ToOption(), - HoverInfo: HoverInfo.ToOption(), - HoverLabel: HoverLabel.ToOption(), - HoverTemplate: HoverTemplate.ToOption(), - MultiHoverTemplate: MultiHoverTemplate.ToOption(), - Label: Label.ToOption(), - Line: Line.ToOption(), - Pad: Pad.ToOption(), - Thickness: Thickness.ToOption(), - X: X.ToOption(), - Y: Y.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.SankeyLinkColorscale SankeyLinkColorscale + Optional> X = default, + Optional> Y = default + ) + where CustomDataType: IConvertible + where XType: IConvertible + where YType: IConvertible + => + Plotly.NET.TraceObjects.SankeyNodes.init( + Color: Color.ToOption(), + CustomData: CustomData.ToOption(), + Groups: Groups.ToOption(), + HoverInfo: HoverInfo.ToOption(), + HoverLabel: HoverLabel.ToOption(), + HoverTemplate: HoverTemplate.ToOption(), + MultiHoverTemplate: MultiHoverTemplate.ToOption(), + Label: Label.ToOption(), + Line: Line.ToOption(), + Pad: Pad.ToOption(), + Thickness: Thickness.ToOption(), + X: X.ToOption(), + Y: Y.ToOption() + ); + public static Plotly.NET.TraceObjects.SankeyLinkColorscale InitSankeyLinkColorscale ( - Optional CMax = default, Optional CMin = default, Optional ColorScale = default, Optional Label = default, Optional Name = default, Optional TemplateItemName = default - ) => - Plotly.NET.TraceObjects.SankeyLinkColorscale.init( - - CMax: CMax.ToOption(), - CMin: CMin.ToOption(), - ColorScale: ColorScale.ToOption(), - Label: Label.ToOption(), - Name: Name.ToOption(), - TemplateItemName: TemplateItemName.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.SankeyLinks SankeyLinks + ) + => + Plotly.NET.TraceObjects.SankeyLinkColorscale.init( + CMax: CMax.ToOption(), + CMin: CMin.ToOption(), + ColorScale: ColorScale.ToOption(), + Label: Label.ToOption(), + Name: Name.ToOption(), + TemplateItemName: TemplateItemName.ToOption() + ); + public static Plotly.NET.TraceObjects.SankeyLinks InitSankeyLinks ( - Optional Color = default, - Optional> ColorScales = default, - Optional> CustomData = default, + Optional> ColorScales = default, + Optional> CustomData = default, Optional HoverInfo = default, - Optional HoverLabel = default, + Optional HoverLabel = default, Optional HoverTemplate = default, Optional> MultiHoverTemplate = default, Optional> Label = default, Optional Line = default, Optional> Source = default, Optional> Target = default, - Optional> Value = default - ) => - Plotly.NET.TraceObjects.SankeyLinks.init( - - Color: Color.ToOption(), - ColorScales: ColorScales.ToOption(), - CustomData: CustomData.ToOption(), - HoverInfo: HoverInfo.ToOption(), - HoverLabel: HoverLabel.ToOption(), - HoverTemplate: HoverTemplate.ToOption(), - MultiHoverTemplate: MultiHoverTemplate.ToOption(), - Label: Label.ToOption(), - Line: Line.ToOption(), - Source: Source.ToOption(), - Target: Target.ToOption(), - Value: Value.ToOption() - ); + Optional> Value = default + ) + where CustomDataType: IConvertible + where ValueType: IConvertible + => + Plotly.NET.TraceObjects.SankeyLinks.init( + Color: Color.ToOption(), + ColorScales: ColorScales.ToOption(), + CustomData: CustomData.ToOption(), + HoverInfo: HoverInfo.ToOption(), + HoverLabel: HoverLabel.ToOption(), + HoverTemplate: HoverTemplate.ToOption(), + MultiHoverTemplate: MultiHoverTemplate.ToOption(), + Label: Label.ToOption(), + Line: Line.ToOption(), + Source: Source.ToOption(), + Target: Target.ToOption(), + Value: Value.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Selection.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Selection.cs index 8b70443aa..b587cd01d 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Selection.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Selection.cs @@ -10,52 +10,35 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.MarkerSelectionStyle MarkerSelectionStyle + public static Plotly.NET.TraceObjects.MarkerSelectionStyle InitMarkerSelectionStyle ( - Optional Opacity = default, Optional Color = default, Optional Size = default - ) => - Plotly.NET.TraceObjects.MarkerSelectionStyle.init( - - Opacity: Opacity.ToOption(), - Color: Color.ToOption(), - Size: Size.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.FontSelectionStyle FontSelectionStyle + ) + => + Plotly.NET.TraceObjects.MarkerSelectionStyle.init( + Opacity: Opacity.ToOption(), + Color: Color.ToOption(), + Size: Size.ToOption() + ); + public static Plotly.NET.TraceObjects.FontSelectionStyle InitFontSelectionStyle ( - , - , - , - - - ) => - Plotly.NET.TraceObjects.FontSelectionStyle.init( - : , - : , - : , - : - - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.Selection Selection + Optional Color = default + ) + => + Plotly.NET.TraceObjects.FontSelectionStyle.init( + Color: Color.ToOption() + ); + public static Plotly.NET.TraceObjects.Selection InitSelection ( - - Optional MarkerSelectionStyle = default, - Optional FontSelectionStyle = default - ) => - Plotly.NET.TraceObjects.Selection.init( - - MarkerSelectionStyle: MarkerSelectionStyle.ToOption(), - FontSelectionStyle: FontSelectionStyle.ToOption() - ); + Optional MarkerSelectionStyle = default, + Optional FontSelectionStyle = default + ) + => + Plotly.NET.TraceObjects.Selection.init( + MarkerSelectionStyle: MarkerSelectionStyle.ToOption(), + FontSelectionStyle: FontSelectionStyle.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Slices.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Slices.cs index 85a2df01c..4ff69e162 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Slices.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Slices.cs @@ -10,35 +10,30 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.SlicesFill SlicesFill + public static Plotly.NET.TraceObjects.SlicesFill InitSlicesFill ( - Optional Fill = default, - Optional> Locations = default, + Optional> Locations = default, Optional Show = default - ) => - Plotly.NET.TraceObjects.SlicesFill.init( - - Fill: Fill.ToOption(), - Locations: Locations.ToOption(), - Show: Show.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.Slices Slices + ) + where LocationsType: IConvertible + => + Plotly.NET.TraceObjects.SlicesFill.init( + Fill: Fill.ToOption(), + Locations: Locations.ToOption(), + Show: Show.ToOption() + ); + public static Plotly.NET.TraceObjects.Slices InitSlices ( - - Optional X = default, - Optional Y = default, - Optional Z = default - ) => - Plotly.NET.TraceObjects.Slices.init( - - X: X.ToOption(), - Y: Y.ToOption(), - Z: Z.ToOption() - ); + Optional X = default, + Optional Y = default, + Optional Z = default + ) + => + Plotly.NET.TraceObjects.Slices.init( + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SpaceFrame.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SpaceFrame.cs index de830f42b..d49d53f55 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SpaceFrame.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SpaceFrame.cs @@ -10,16 +10,15 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Spaceframe Spaceframe + public static Plotly.NET.TraceObjects.Spaceframe InitSpaceframe ( - Optional Fill = default, Optional Show = default - ) => - Plotly.NET.TraceObjects.Spaceframe.init( - - Fill: Fill.ToOption(), - Show: Show.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Spaceframe.init( + Fill: Fill.ToOption(), + Show: Show.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SplomDiagonal.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SplomDiagonal.cs index 615061945..53a43225d 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SplomDiagonal.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SplomDiagonal.cs @@ -10,16 +10,13 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.SplomDiagonal SplomDiagonal + public static Plotly.NET.TraceObjects.SplomDiagonal InitSplomDiagonal ( - , - - - ) => - Plotly.NET.TraceObjects.SplomDiagonal.init( - : , - : - - ); + Optional Visible = default + ) + => + Plotly.NET.TraceObjects.SplomDiagonal.init( + Visible: Visible.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StockData.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StockData.cs deleted file mode 100644 index a9212c44d..000000000 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StockData.cs +++ /dev/null @@ -1,23 +0,0 @@ - -using Microsoft.FSharp.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Plotly.NET.CSharp; - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.StockData StockData - ( - - - ) => - Plotly.NET.TraceObjects.StockData.init( - - - ); -} - diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StreamTubeStarts.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StreamTubeStarts.cs index d4d8bd51c..c97b12606 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StreamTubeStarts.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StreamTubeStarts.cs @@ -10,18 +10,20 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.StreamTubeStarts StreamTubeStarts + public static Plotly.NET.TraceObjects.StreamTubeStarts InitStreamTubeStarts ( - - Optional> X = default, - Optional> Y = default, - Optional> Z = default - ) => - Plotly.NET.TraceObjects.StreamTubeStarts.init( - - X: X.ToOption(), - Y: Y.ToOption(), - Z: Z.ToOption() - ); + Optional> X = default, + Optional> Y = default, + Optional> Z = default + ) + where XType: IConvertible + where YType: IConvertible + where ZType: IConvertible + => + Plotly.NET.TraceObjects.StreamTubeStarts.init( + X: X.ToOption(), + Y: Y.ToOption(), + Z: Z.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sunburst.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sunburst.cs index b9701ed44..2a7c93927 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sunburst.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sunburst.cs @@ -10,35 +10,21 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.SunburstRoot SunburstRoot + public static Plotly.NET.TraceObjects.SunburstRoot InitSunburstRoot ( - , - , - - - ) => - Plotly.NET.TraceObjects.SunburstRoot.init( - : , - : , - : - - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.SunburstLeaf SunburstLeaf + Optional Color = default + ) + => + Plotly.NET.TraceObjects.SunburstRoot.init( + Color: Color.ToOption() + ); + public static Plotly.NET.TraceObjects.SunburstLeaf InitSunburstLeaf ( - , - , - - - ) => - Plotly.NET.TraceObjects.SunburstLeaf.init( - : , - : , - : - - ); + Optional Opacity = default + ) + => + Plotly.NET.TraceObjects.SunburstLeaf.init( + Opacity: Opacity.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Surface.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Surface.cs index 33fcacebd..2768099b5 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Surface.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Surface.cs @@ -10,20 +10,19 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.Surface Surface + public static Plotly.NET.TraceObjects.Surface InitSurface ( - Optional Count = default, Optional Fill = default, Optional Pattern = default, Optional Show = default - ) => - Plotly.NET.TraceObjects.Surface.init( - - Count: Count.ToOption(), - Fill: Fill.ToOption(), - Pattern: Pattern.ToOption(), - Show: Show.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.Surface.init( + Count: Count.ToOption(), + Fill: Fill.ToOption(), + Pattern: Pattern.ToOption(), + Show: Show.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs index f4c63bd91..6d8d90b5b 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs @@ -10,27 +10,19 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.TableFill TableFill + public static Plotly.NET.TraceObjects.TableFill InitTableFill ( - , - - - ) => - Plotly.NET.TraceObjects.TableFill.init( - : , - : - - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.TableCells TableCells + Optional Color = default + ) + => + Plotly.NET.TraceObjects.TableFill.init( + Color: Color.ToOption() + ); + public static Plotly.NET.TraceObjects.TableCells InitTableCells ( - Optional Align = default, Optional> MultiAlign = default, - Optional Fill = default, + Optional Fill = default, Optional Font = default, Optional> Format = default, Optional Height = default, @@ -39,35 +31,23 @@ public static Plotly.NET.TraceObjects.TableCells TableCells Optional> MultiPrefix = default, Optional Suffix = default, Optional> MultiSuffix = default, - Optional>> Values = default - ) => - Plotly.NET.TraceObjects.TableCells.init( - - Align: Align.ToOption(), - MultiAlign: MultiAlign.ToOption(), - Fill: Fill.ToOption(), - Font: Font.ToOption(), - Format: Format.ToOption(), - Height: Height.ToOption(), - Line: Line.ToOption(), - Prefix: Prefix.ToOption(), - MultiPrefix: MultiPrefix.ToOption(), - Suffix: Suffix.ToOption(), - MultiSuffix: MultiSuffix.ToOption(), - Values: Values.ToOption() - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.TableHeader TableHeader - ( - - - ) => - Plotly.NET.TraceObjects.TableHeader.init( - - - ); + Optional>> Values = default + ) + where ValuesType: IConvertible + => + Plotly.NET.TraceObjects.TableCells.init( + Align: Align.ToOption(), + MultiAlign: MultiAlign.ToOption(), + Fill: Fill.ToOption(), + Font: Font.ToOption(), + Format: Format.ToOption(), + Height: Height.ToOption(), + Line: Line.ToOption(), + Prefix: Prefix.ToOption(), + MultiPrefix: MultiPrefix.ToOption(), + Suffix: Suffix.ToOption(), + MultiSuffix: MultiSuffix.ToOption(), + Values: Values.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Treemap.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Treemap.cs index 54973d60b..7de72bf78 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Treemap.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Treemap.cs @@ -10,54 +10,35 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.TreemapRoot TreemapRoot + public static Plotly.NET.TraceObjects.TreemapRoot InitTreemapRoot ( - , - , - - - ) => - Plotly.NET.TraceObjects.TreemapRoot.init( - : , - : , - : - - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.TreemapLeaf TreemapLeaf + Optional Color = default + ) + => + Plotly.NET.TraceObjects.TreemapRoot.init( + Color: Color.ToOption() + ); + public static Plotly.NET.TraceObjects.TreemapLeaf InitTreemapLeaf ( - , - , - - - ) => - Plotly.NET.TraceObjects.TreemapLeaf.init( - : , - : , - : - - ); -} - -public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.TreemapTiling TreemapTiling + Optional Opacity = default + ) + => + Plotly.NET.TraceObjects.TreemapLeaf.init( + Opacity: Opacity.ToOption() + ); + public static Plotly.NET.TraceObjects.TreemapTiling InitTreemapTiling ( - Optional Packing = default, Optional SquarifyRatio = default, Optional Flip = default, Optional Pad = default - ) => - Plotly.NET.TraceObjects.TreemapTiling.init( - - Packing: Packing.ToOption(), - SquarifyRatio: SquarifyRatio.ToOption(), - Flip: Flip.ToOption(), - Pad: Pad.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.TreemapTiling.init( + Packing: Packing.ToOption(), + SquarifyRatio: SquarifyRatio.ToOption(), + Flip: Flip.ToOption(), + Pad: Pad.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/WaterfallConnector.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/WaterfallConnector.cs index 0e2024e97..d057ca522 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/WaterfallConnector.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/WaterfallConnector.cs @@ -10,18 +10,17 @@ namespace Plotly.NET.CSharp; public static partial class TraceObjects { - public static Plotly.NET.TraceObjects.WaterfallConnector WaterfallConnector + public static Plotly.NET.TraceObjects.WaterfallConnector InitWaterfallConnector ( - Optional Line = default, Optional Visible = default, Optional ConnectorMode = default - ) => - Plotly.NET.TraceObjects.WaterfallConnector.init( - - Line: Line.ToOption(), - Visible: Visible.ToOption(), - ConnectorMode: ConnectorMode.ToOption() - ); + ) + => + Plotly.NET.TraceObjects.WaterfallConnector.init( + Line: Line.ToOption(), + Visible: Visible.ToOption(), + ConnectorMode: ConnectorMode.ToOption() + ); } diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/traceobject-codegen.fsx b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/traceobject-codegen.fsx index cdb3693c9..de7f53473 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/traceobject-codegen.fsx +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/traceobject-codegen.fsx @@ -2,18 +2,118 @@ open System.IO open System.Text open System.Text.RegularExpressions +let mapFSharpType (typeName:string) = + typeName + .Replace("float","double") + .Replace("seq","IEnumerable") + + +let class_template = """public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.[OBJECT_NAME] Init[OBJECT_NAME][GENERICS] + ( +[MANDATORY_PARAMS] +[OPTIONAL_PARAMS] + ) +[GENERICS_ANNOTATIONS] + Plotly.NET.TraceObjects.[OBJECT_NAME].init( +[MANDATORY_PARAMS_SETTERS] +[OPTIONAL_PARAMS_SETTERS] + ); +} +""" + type TraceObjectAbstraction = { ObjectName: string MandatoryParams: (string*string) list OptionalParams: (string*string) list + Generics: string list } with - static member create name m o = + static member create name (m: (string*string) list) (o: (string*string) list) = + + let generics = + List.concat [m; o] + |> List.filter (fun (pName, pType) -> pType.Contains("#IConvertible")) + |> List.map fst + |> List.map (fun pName -> pName, $"{pName}Type") + |> Map.ofList + + let csharpMandatoryParams = + m + |> List.map (fun (pName, pType) -> pName, mapFSharpType pType) + |> List.map (fun (pName, pType) -> + pName, + if pType.Contains("#IConvertible") then + pType.Replace("#IConvertible", generics[pName]) + else + pType + ) + let csharpOptionalyParams = + o + |> List.map (fun (pName, pType) -> pName, mapFSharpType pType) + |> List.map (fun (pName, pType) -> + pName, + if pType.Contains("#IConvertible") then + pType.Replace("#IConvertible", generics[pName]) + else + pType + ) + { ObjectName = name - MandatoryParams = m - OptionalParams = o + MandatoryParams = csharpMandatoryParams + OptionalParams = csharpOptionalyParams + Generics = generics.Values |> List.ofSeq } + static member toClassTemplate (tObj: TraceObjectAbstraction) = + + let mParams = + tObj.MandatoryParams + |> List.map (fun (pName, pType) -> $" {pType} {pName}") + |> String.concat $",{System.Environment.NewLine}" + + let mParamSetters = + tObj.MandatoryParams + |> List.map (fun (pName, _) -> $" {pName}: {pName}") + |> String.concat $",{System.Environment.NewLine}" + + let optParams = + tObj.OptionalParams + |> List.map (fun (pName, pType) -> $" Optional<{pType}> {pName} = default") + |> String.concat $",{System.Environment.NewLine}" + + let optParamsSetters = + tObj.OptionalParams + |> List.map (fun (pName, pType) -> $" {pName}: {pName}.ToOption()") + |> String.concat $",{System.Environment.NewLine}" + + let generics = + if tObj.Generics.IsEmpty then + $"" + else + let g = tObj.Generics |> String.concat ", " + $"<{g}>" + + let genericsAnnotations = + if tObj.Generics.IsEmpty then + $"{System.Environment.NewLine} =>" + else + let g = + tObj.Generics + |> List.map (fun generic -> $" where {generic}: IConvertible") + |> String.concat System.Environment.NewLine + $"{g}{System.Environment.NewLine} =>" + + class_template + .Replace("[OBJECT_NAME]", tObj.ObjectName) + .Replace("[MANDATORY_PARAMS]", mParams) + .Replace("[OPTIONAL_PARAMS]", optParams) + .Replace("[MANDATORY_PARAMS_SETTERS]", mParamSetters) + .Replace("[OPTIONAL_PARAMS_SETTERS]", optParamsSetters) + .Replace("[GENERICS]", generics) + .Replace("[GENERICS_ANNOTATIONS]", genericsAnnotations) + let objectNameRegex = new Regex("type (?[A-Za-z]*)()") let getObjectName (str:string) = @@ -46,9 +146,17 @@ let parseSourceFile (path:string) = else loop rest isFirstObj isInit name [] [] ((TraceObjectAbstraction.create currentName (List.rev mParams) (List.rev oParams)) :: acc) - | init when init.Trim().StartsWith("static member init") -> + | init when init.Trim() = "static member init" -> printfn "is init" loop rest isFirstObj true currentName mParams oParams acc + + | inlineInit when inlineInit.Trim().StartsWith("static member init(") -> + + if inlineInit.Contains("[ printfn "is other member" @@ -79,53 +187,6 @@ let parseSourceFile (path:string) = loop (File.ReadAllLines path |> List.ofArray) true false "" [] [] [] -let class_template = """public static partial class TraceObjects -{ - public static Plotly.NET.TraceObjects.[OBJECT_NAME] [OBJECT_NAME] - ( -[MANDATORY_PARAMS] -[OPTIONAL_PARAMS] - ) => - Plotly.NET.TraceObjects.[OBJECT_NAME].init( -[MANDATORY_PARAMS_SETTERS] -[OPTIONAL_PARAMS_SETTERS] - ); -} -""" - -let mapFSharpType (typeName:string) = - typeName - .Replace("float","double") - .Replace("seq","IEnumerable") - -let populateClassTemplate (tObj: TraceObjectAbstraction) = - - let mParams = - tObj.MandatoryParams - |> List.map (fun (pName, pType) -> $" {mapFSharpType pType} {pName}") - |> String.concat $",{System.Environment.NewLine}" - - let mParamSetters = - tObj.MandatoryParams - |> List.map (fun (pName, _) -> $" {pName}: {pName}") - |> String.concat $",{System.Environment.NewLine}" - - let optParams = - tObj.OptionalParams - |> List.map (fun (pName, pType) -> $" Optional<{mapFSharpType pType}> {pName} = default") - |> String.concat $",{System.Environment.NewLine}" - - let optParamsSetters = - tObj.OptionalParams - |> List.map (fun (pName, pType) -> $" {pName}: {pName}.ToOption()") - |> String.concat $",{System.Environment.NewLine}" - - class_template - .Replace("[OBJECT_NAME]",tObj.ObjectName) - .Replace("[MANDATORY_PARAMS]",mParams) - .Replace("[OPTIONAL_PARAMS]",optParams) - .Replace("[MANDATORY_PARAMS_SETTERS]",mParamSetters) - .Replace("[OPTIONAL_PARAMS_SETTERS]",optParamsSetters) let file_template = """ using Microsoft.FSharp.Core; @@ -143,13 +204,15 @@ namespace Plotly.NET.CSharp; let createCSharpSourceFile (objectAbstractions: TraceObjectAbstraction list) = let classes = objectAbstractions - |> List.map populateClassTemplate + |> List.map TraceObjectAbstraction.toClassTemplate |> String.concat System.Environment.NewLine file_template.Replace("[CLASSES]",classes) let indicator = parseSourceFile @"C:\Users\schne\source\repos\plotly\Plotly.NET\src\Plotly.NET\Traces\ObjectAbstractions\Indicator.fs" +createCSharpSourceFile indicator + let sourceFiles = Directory.EnumerateFiles @"C:\Users\schne\source\repos\plotly\Plotly.NET\src\Plotly.NET\Traces\ObjectAbstractions\" |> Seq.cast From a5087db134b7281688eb460dff2d3deeccc28c3d Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Mon, 5 Sep 2022 12:50:14 +0200 Subject: [PATCH 3/4] fix table object binding --- src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs index 6d8d90b5b..676ebd3d8 100644 --- a/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs @@ -35,7 +35,7 @@ public static Plotly.NET.TraceObjects.TableCells InitTableCells ) where ValuesType: IConvertible => - Plotly.NET.TraceObjects.TableCells.init( + Plotly.NET.TraceObjects.TableCells.init, ValuesType>( Align: Align.ToOption(), MultiAlign: MultiAlign.ToOption(), Fill: Fill.ToOption(), From 465af628159796e6fff7534d79e954236a49784a Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Mon, 5 Sep 2022 12:54:06 +0200 Subject: [PATCH 4/4] Add sample usage of trace object bindings --- tests/Plotly.NET.Tests.CSharpConsole/Program.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Plotly.NET.Tests.CSharpConsole/Program.cs b/tests/Plotly.NET.Tests.CSharpConsole/Program.cs index 6a8fc62f8..5c3a9902d 100644 --- a/tests/Plotly.NET.Tests.CSharpConsole/Program.cs +++ b/tests/Plotly.NET.Tests.CSharpConsole/Program.cs @@ -740,23 +740,23 @@ static void Main(string[] args) ), Chart.ParallelCoord( dimensions: new Plotly.NET.TraceObjects.Dimension [] { - Plotly.NET.TraceObjects.Dimension.initParallel(Label: "A", Values: new int [] {1, 4, 3}), - Plotly.NET.TraceObjects.Dimension.initParallel(Label: "B", Values: new int [] {3, 1, 2}) + TraceObjects.InitParallelDimension(Label: "A", Values: new int [] {1, 4, 3}), + TraceObjects.InitParallelDimension(Label: "B", Values: new int [] {3, 1, 2}) }, Name: "parcoords" ), Chart.ParallelCategories( dimensions: new Plotly.NET.TraceObjects.Dimension [] { - Plotly.NET.TraceObjects.Dimension.initParallel(Label: "A", Values: new int [] {1, 1, 2}), - Plotly.NET.TraceObjects.Dimension.initParallel(Label: "B", Values: new int [] {3, 3, 3}) + TraceObjects.InitParallelDimension(Label: "A", Values: new int [] {1, 1, 2}), + TraceObjects.InitParallelDimension(Label: "B", Values: new int [] {3, 3, 3}) }, Name: "parcats" ), Chart.Sankey( - nodes: Plotly.NET.TraceObjects.SankeyNodes.init( + nodes: TraceObjects.InitSankeyNodes( Label: new string [] {"A", "B", "C", "D"} ), - links: Plotly.NET.TraceObjects.SankeyLinks.init( + links: TraceObjects.InitSankeyLinks( Source: new int [] {0, 1, 1 }, Target: new int [] {2, 2, 3 }, Value: new int [] {1, 2, 5}