diff --git a/Plotly.NET.sln b/Plotly.NET.sln index 107e080a2..c30783bb2 100644 --- a/Plotly.NET.sln +++ b/Plotly.NET.sln @@ -156,6 +156,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.CSharp.Tests", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.Tests.CSharpInteroperability", "tests\Plotly.NET.Tests.CSharpInteroperability\Plotly.NET.Tests.CSharpInteroperability.csproj", "{64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}" EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Plotly.NET.Codegen", "src\Plotly.NET.Codegen\Plotly.NET.Codegen.fsproj", "{92601FE7-4E86-41B7-B61D-5D9EB46733C7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -229,6 +231,12 @@ Global {64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Dotnet|Any CPU.Build.0 = Debug|Any CPU {64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Release|Any CPU.ActiveCfg = Release|Any CPU {64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB}.Release|Any CPU.Build.0 = Release|Any CPU + {92601FE7-4E86-41B7-B61D-5D9EB46733C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92601FE7-4E86-41B7-B61D-5D9EB46733C7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92601FE7-4E86-41B7-B61D-5D9EB46733C7}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU + {92601FE7-4E86-41B7-B61D-5D9EB46733C7}.Dotnet|Any CPU.Build.0 = Debug|Any CPU + {92601FE7-4E86-41B7-B61D-5D9EB46733C7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92601FE7-4E86-41B7-B61D-5D9EB46733C7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -248,6 +256,7 @@ Global {F944FE69-F4A5-4B48-8E4D-BE4B61E92B26} = {0E87E47E-9EDC-4525-AF72-F0E139D54236} {4C24BA53-F41C-4110-AD7A-28143DCF671E} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8} {64022D22-EB9A-4AE3-A0E6-BFA41E8B18CB} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8} + {92601FE7-4E86-41B7-B61D-5D9EB46733C7} = {0E87E47E-9EDC-4525-AF72-F0E139D54236} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7177F1E1-341C-48AB-9864-6B525FFF7633} diff --git a/src/Plotly.NET.CSharp/GenericChartExtensions.cs b/src/Plotly.NET.CSharp/GenericChartExtensions.cs index 033e82b40..cad9fa8f2 100644 --- a/src/Plotly.NET.CSharp/GenericChartExtensions.cs +++ b/src/Plotly.NET.CSharp/GenericChartExtensions.cs @@ -14,7 +14,7 @@ public static class GenericChartExtensions /// Returns the layout of the given chart /// /// The chart of which to get the layout - public static Layout GetLayout(this GenericChart.GenericChart gChart) => GenericChart.getLayout(gChart); + public static Plotly.NET.Layout GetLayout(this GenericChart.GenericChart gChart) => GenericChart.getLayout(gChart); /// /// Returns all traces of the given chart as an array diff --git a/src/Plotly.NET.CSharp/Layout.cs b/src/Plotly.NET.CSharp/Layout.cs new file mode 100644 index 000000000..5eadceb8c --- /dev/null +++ b/src/Plotly.NET.CSharp/Layout.cs @@ -0,0 +1,596 @@ +// this file was auto-generated using Plotly.NET.Codegen on 3/20/2023 targeting Plotly.NET, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c98c6d87097b7615. +// Do not edit this, as it will most likely be overwritten on the next codegen run. +// Instead, file an issue or target the codegen with your changes directly. +// Bugs that are not caused by wrong codegen are most likely not found in this file, but in the F# source this file is generated from. + +namespace Plotly.NET.CSharp; + +public static class Layout { + public static Plotly.NET.Layout Init( + Optional Title = default, + Optional ShowLegend = default, + Optional Legend = default, + Optional Margin = default, + Optional AutoSize = default, + Optional Width = default, + Optional Height = default, + Optional Font = default, + Optional UniformText = default, + Optional Separators = default, + Optional PaperBGColor = default, + Optional PlotBGColor = default, + Optional AutoTypeNumbers = default, + Optional Colorscale = default, + Optional Colorway = default, + Optional ModeBar = default, + Optional HoverMode = default, + Optional ClickMode = default, + Optional DragMode = default, + Optional SelectDirection = default, + Optional HoverDistance = default, + Optional SpikeDistance = default, + Optional Hoverlabel = default, + Optional Transition = default, + Optional DataRevision = default, + Optional UIRevision = default, + Optional EditRevision = default, + Optional SelectRevision = default, + Optional Template = default, + Optional Meta = default, + Optional Computed = default, + Optional Grid = default, + Optional Calendar = default, + Optional NewShape = default, + Optional ActiveShape = default, + Optional HideSources = default, + Optional BarGap = default, + Optional BarGroupGap = default, + Optional BarMode = default, + Optional BarNorm = default, + Optional ExtendPieColors = default, + Optional> HiddenLabels = default, + Optional PieColorWay = default, + Optional BoxGap = default, + Optional BoxGroupGap = default, + Optional BoxMode = default, + Optional ViolinGap = default, + Optional ViolinGroupGap = default, + Optional ViolinMode = default, + Optional WaterfallGap = default, + Optional WaterfallGroupGap = default, + Optional WaterfallMode = default, + Optional FunnelGap = default, + Optional FunnelGroupGap = default, + Optional FunnelMode = default, + Optional ExtendFunnelAreaColors = default, + Optional FunnelAreaColorWay = default, + Optional ExtendSunBurstColors = default, + Optional SunBurstColorWay = default, + Optional ExtendTreeMapColors = default, + Optional TreeMapColorWay = default, + Optional ExtendIcicleColors = default, + Optional IcicleColorWay = default, + Optional> Annotations = default, + Optional> Shapes = default, + Optional> Images = default, + Optional> Sliders = default, + Optional> UpdateMenus = default + ) + where a: System.IConvertible + => + Plotly.NET.Layout.init( + Title: Title.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Legend: Legend.ToOption(), + Margin: Margin.ToOption(), + AutoSize: AutoSize.ToOption(), + Width: Width.ToOption(), + Height: Height.ToOption(), + Font: Font.ToOption(), + UniformText: UniformText.ToOption(), + Separators: Separators.ToOption(), + PaperBGColor: PaperBGColor.ToOption(), + PlotBGColor: PlotBGColor.ToOption(), + AutoTypeNumbers: AutoTypeNumbers.ToOption(), + Colorscale: Colorscale.ToOption(), + Colorway: Colorway.ToOption(), + ModeBar: ModeBar.ToOption(), + HoverMode: HoverMode.ToOption(), + ClickMode: ClickMode.ToOption(), + DragMode: DragMode.ToOption(), + SelectDirection: SelectDirection.ToOption(), + HoverDistance: HoverDistance.ToOption(), + SpikeDistance: SpikeDistance.ToOption(), + Hoverlabel: Hoverlabel.ToOption(), + Transition: Transition.ToOption(), + DataRevision: DataRevision.ToOption(), + UIRevision: UIRevision.ToOption(), + EditRevision: EditRevision.ToOption(), + SelectRevision: SelectRevision.ToOption(), + Template: Template.ToOption(), + Meta: Meta.ToOption(), + Computed: Computed.ToOption(), + Grid: Grid.ToOption(), + Calendar: Calendar.ToOption(), + NewShape: NewShape.ToOption(), + ActiveShape: ActiveShape.ToOption(), + HideSources: HideSources.ToOption(), + BarGap: BarGap.ToOption(), + BarGroupGap: BarGroupGap.ToOption(), + BarMode: BarMode.ToOption(), + BarNorm: BarNorm.ToOption(), + ExtendPieColors: ExtendPieColors.ToOption(), + HiddenLabels: HiddenLabels.ToOption(), + PieColorWay: PieColorWay.ToOption(), + BoxGap: BoxGap.ToOption(), + BoxGroupGap: BoxGroupGap.ToOption(), + BoxMode: BoxMode.ToOption(), + ViolinGap: ViolinGap.ToOption(), + ViolinGroupGap: ViolinGroupGap.ToOption(), + ViolinMode: ViolinMode.ToOption(), + WaterfallGap: WaterfallGap.ToOption(), + WaterfallGroupGap: WaterfallGroupGap.ToOption(), + WaterfallMode: WaterfallMode.ToOption(), + FunnelGap: FunnelGap.ToOption(), + FunnelGroupGap: FunnelGroupGap.ToOption(), + FunnelMode: FunnelMode.ToOption(), + ExtendFunnelAreaColors: ExtendFunnelAreaColors.ToOption(), + FunnelAreaColorWay: FunnelAreaColorWay.ToOption(), + ExtendSunBurstColors: ExtendSunBurstColors.ToOption(), + SunBurstColorWay: SunBurstColorWay.ToOption(), + ExtendTreeMapColors: ExtendTreeMapColors.ToOption(), + TreeMapColorWay: TreeMapColorWay.ToOption(), + ExtendIcicleColors: ExtendIcicleColors.ToOption(), + IcicleColorWay: IcicleColorWay.ToOption(), + Annotations: Annotations.ToOption(), + Shapes: Shapes.ToOption(), + Images: Images.ToOption(), + Sliders: Sliders.ToOption(), + UpdateMenus: UpdateMenus.ToOption() + ); + public static Plotly.NET.Layout Style( + this Plotly.NET.Layout obj, + Optional Title = default, + Optional ShowLegend = default, + Optional Legend = default, + Optional Margin = default, + Optional AutoSize = default, + Optional Width = default, + Optional Height = default, + Optional Font = default, + Optional UniformText = default, + Optional Separators = default, + Optional PaperBGColor = default, + Optional PlotBGColor = default, + Optional AutoTypeNumbers = default, + Optional Colorscale = default, + Optional Colorway = default, + Optional ModeBar = default, + Optional HoverMode = default, + Optional ClickMode = default, + Optional DragMode = default, + Optional SelectDirection = default, + Optional HoverDistance = default, + Optional SpikeDistance = default, + Optional Hoverlabel = default, + Optional Transition = default, + Optional DataRevision = default, + Optional UIRevision = default, + Optional EditRevision = default, + Optional SelectRevision = default, + Optional Template = default, + Optional Meta = default, + Optional Computed = default, + Optional Grid = default, + Optional Calendar = default, + Optional NewShape = default, + Optional ActiveShape = default, + Optional HideSources = default, + Optional BarGap = default, + Optional BarGroupGap = default, + Optional BarMode = default, + Optional BarNorm = default, + Optional ExtendPieColors = default, + Optional> HiddenLabels = default, + Optional PieColorWay = default, + Optional BoxGap = default, + Optional BoxGroupGap = default, + Optional BoxMode = default, + Optional ViolinGap = default, + Optional ViolinGroupGap = default, + Optional ViolinMode = default, + Optional WaterfallGap = default, + Optional WaterfallGroupGap = default, + Optional WaterfallMode = default, + Optional FunnelGap = default, + Optional FunnelGroupGap = default, + Optional FunnelMode = default, + Optional ExtendFunnelAreaColors = default, + Optional FunnelAreaColorWay = default, + Optional ExtendSunBurstColors = default, + Optional SunBurstColorWay = default, + Optional ExtendTreeMapColors = default, + Optional TreeMapColorWay = default, + Optional ExtendIcicleColors = default, + Optional IcicleColorWay = default, + Optional> Annotations = default, + Optional> Shapes = default, + Optional> Images = default, + Optional> Sliders = default, + Optional> UpdateMenus = default + ) + where a: System.IConvertible + => + Plotly.NET.Layout.style( + Title: Title.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Legend: Legend.ToOption(), + Margin: Margin.ToOption(), + AutoSize: AutoSize.ToOption(), + Width: Width.ToOption(), + Height: Height.ToOption(), + Font: Font.ToOption(), + UniformText: UniformText.ToOption(), + Separators: Separators.ToOption(), + PaperBGColor: PaperBGColor.ToOption(), + PlotBGColor: PlotBGColor.ToOption(), + AutoTypeNumbers: AutoTypeNumbers.ToOption(), + Colorscale: Colorscale.ToOption(), + Colorway: Colorway.ToOption(), + ModeBar: ModeBar.ToOption(), + HoverMode: HoverMode.ToOption(), + ClickMode: ClickMode.ToOption(), + DragMode: DragMode.ToOption(), + SelectDirection: SelectDirection.ToOption(), + HoverDistance: HoverDistance.ToOption(), + SpikeDistance: SpikeDistance.ToOption(), + Hoverlabel: Hoverlabel.ToOption(), + Transition: Transition.ToOption(), + DataRevision: DataRevision.ToOption(), + UIRevision: UIRevision.ToOption(), + EditRevision: EditRevision.ToOption(), + SelectRevision: SelectRevision.ToOption(), + Template: Template.ToOption(), + Meta: Meta.ToOption(), + Computed: Computed.ToOption(), + Grid: Grid.ToOption(), + Calendar: Calendar.ToOption(), + NewShape: NewShape.ToOption(), + ActiveShape: ActiveShape.ToOption(), + HideSources: HideSources.ToOption(), + BarGap: BarGap.ToOption(), + BarGroupGap: BarGroupGap.ToOption(), + BarMode: BarMode.ToOption(), + BarNorm: BarNorm.ToOption(), + ExtendPieColors: ExtendPieColors.ToOption(), + HiddenLabels: HiddenLabels.ToOption(), + PieColorWay: PieColorWay.ToOption(), + BoxGap: BoxGap.ToOption(), + BoxGroupGap: BoxGroupGap.ToOption(), + BoxMode: BoxMode.ToOption(), + ViolinGap: ViolinGap.ToOption(), + ViolinGroupGap: ViolinGroupGap.ToOption(), + ViolinMode: ViolinMode.ToOption(), + WaterfallGap: WaterfallGap.ToOption(), + WaterfallGroupGap: WaterfallGroupGap.ToOption(), + WaterfallMode: WaterfallMode.ToOption(), + FunnelGap: FunnelGap.ToOption(), + FunnelGroupGap: FunnelGroupGap.ToOption(), + FunnelMode: FunnelMode.ToOption(), + ExtendFunnelAreaColors: ExtendFunnelAreaColors.ToOption(), + FunnelAreaColorWay: FunnelAreaColorWay.ToOption(), + ExtendSunBurstColors: ExtendSunBurstColors.ToOption(), + SunBurstColorWay: SunBurstColorWay.ToOption(), + ExtendTreeMapColors: ExtendTreeMapColors.ToOption(), + TreeMapColorWay: TreeMapColorWay.ToOption(), + ExtendIcicleColors: ExtendIcicleColors.ToOption(), + IcicleColorWay: IcicleColorWay.ToOption(), + Annotations: Annotations.ToOption(), + Shapes: Shapes.ToOption(), + Images: Images.ToOption(), + Sliders: Sliders.ToOption(), + UpdateMenus: UpdateMenus.ToOption() + ).Invoke(obj); + public static Plotly.NET.Layout UpdateLinearAxisById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.LinearAxis axis + ) + + => + Plotly.NET.Layout.updateLinearAxisById( + id: id, + axis: axis + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.LinearAxis GetLinearAxisById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id + ) + + => + Plotly.NET.Layout.getLinearAxisById( + id: id + ).Invoke(obj); + public static Plotly.NET.Layout SetLinearAxis( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.LinearAxis axis + ) + + => + Plotly.NET.Layout.setLinearAxis( + id: id, + axis: axis + ).Invoke(obj); + public static Plotly.NET.Layout UpdateSceneById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Scene scene + ) + + => + Plotly.NET.Layout.updateSceneById( + id: id, + scene: scene + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.Scene GetSceneById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id + ) + + => + Plotly.NET.Layout.getSceneById( + id: id + ).Invoke(obj); + public static Plotly.NET.Layout SetScene( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Scene scene + ) + + => + Plotly.NET.Layout.setScene( + id: id, + scene: scene + ).Invoke(obj); + public static Plotly.NET.Layout UpdateGeoById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Geo geo + ) + + => + Plotly.NET.Layout.updateGeoById( + id: id, + geo: geo + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.Geo GetGeoById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id + ) + + => + Plotly.NET.Layout.getGeoById( + id: id + ).Invoke(obj); + public static Plotly.NET.Layout SetGeo( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Geo geo + ) + + => + Plotly.NET.Layout.setGeo( + id: id, + geo: geo + ).Invoke(obj); + public static Plotly.NET.Layout UpdateMapboxById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Mapbox mapbox + ) + + => + Plotly.NET.Layout.updateMapboxById( + id: id, + mapbox: mapbox + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.Mapbox GetMapboxById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id + ) + + => + Plotly.NET.Layout.getMapboxById( + id: id + ).Invoke(obj); + public static Plotly.NET.Layout SetMapbox( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Mapbox mapbox + ) + + => + Plotly.NET.Layout.setMapbox( + id: id, + mapbox: mapbox + ).Invoke(obj); + public static Plotly.NET.Layout UpdatePolarById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Polar polar + ) + + => + Plotly.NET.Layout.updatePolarById( + id: id, + polar: polar + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.Polar GetPolarById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id + ) + + => + Plotly.NET.Layout.getPolarById( + id: id + ).Invoke(obj); + public static Plotly.NET.Layout SetPolar( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Polar polar + ) + + => + Plotly.NET.Layout.setPolar( + id: id, + polar: polar + ).Invoke(obj); + public static Plotly.NET.Layout UpdateSmithById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Smith smith + ) + + => + Plotly.NET.Layout.updateSmithById( + id: id, + smith: smith + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.Smith GetSmithById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id + ) + + => + Plotly.NET.Layout.getSmithById( + id: id + ).Invoke(obj); + public static Plotly.NET.Layout SetSmith( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Smith smith + ) + + => + Plotly.NET.Layout.setSmith( + id: id, + smith: smith + ).Invoke(obj); + public static Plotly.NET.Layout UpdateColorAxisById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.ColorAxis colorAxis + ) + + => + Plotly.NET.Layout.updateColorAxisById( + id: id, + colorAxis: colorAxis + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.ColorAxis GetColorAxisById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id + ) + + => + Plotly.NET.Layout.getColorAxisById( + id: id + ).Invoke(obj); + public static Plotly.NET.Layout SetColorAxis( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.ColorAxis colorAxis + ) + + => + Plotly.NET.Layout.setColorAxis( + id: id, + colorAxis: colorAxis + ).Invoke(obj); + public static Plotly.NET.Layout UpdateTernaryById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Ternary ternary + ) + + => + Plotly.NET.Layout.updateTernaryById( + id: id, + ternary: ternary + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.Ternary GetTernaryById( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id + ) + + => + Plotly.NET.Layout.getTernaryById( + id: id + ).Invoke(obj); + public static Plotly.NET.Layout SetTernary( + this Plotly.NET.Layout obj, + Plotly.NET.StyleParam.SubPlotId id, + Plotly.NET.LayoutObjects.Ternary ternary + ) + + => + Plotly.NET.Layout.setTernary( + id: id, + ternary: ternary + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.LayoutGrid GetLayoutGrid( + this Plotly.NET.Layout obj, + Plotly.NET.Layout layout + ) + + => + Plotly.NET.Layout.getLayoutGrid( + layout: layout + ); + public static Plotly.NET.Layout SetLayoutGrid( + this Plotly.NET.Layout obj, + Plotly.NET.LayoutObjects.LayoutGrid layoutGrid + ) + + => + Plotly.NET.Layout.setLayoutGrid( + layoutGrid: layoutGrid + ).Invoke(obj); + public static Plotly.NET.Layout UpdateLayoutGrid( + this Plotly.NET.Layout obj, + Plotly.NET.LayoutObjects.LayoutGrid layoutGrid + ) + + => + Plotly.NET.Layout.updateLayoutGrid( + layoutGrid: layoutGrid + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.Legend GetLegend( + this Plotly.NET.Layout obj, + Plotly.NET.Layout layout + ) + + => + Plotly.NET.Layout.getLegend( + layout: layout + ); + public static Plotly.NET.Layout SetLegend( + this Plotly.NET.Layout obj, + Plotly.NET.LayoutObjects.Legend legend + ) + + => + Plotly.NET.Layout.setLegend( + legend: legend + ).Invoke(obj); + public static Plotly.NET.Layout UpdateLegend( + this Plotly.NET.Layout obj, + Plotly.NET.LayoutObjects.Legend legend + ) + + => + Plotly.NET.Layout.updateLegend( + legend: legend + ).Invoke(obj); +} \ No newline at end of file diff --git a/src/Plotly.NET.CSharp/LayoutObjects/Geo.cs b/src/Plotly.NET.CSharp/LayoutObjects/Geo.cs new file mode 100644 index 000000000..102f43878 --- /dev/null +++ b/src/Plotly.NET.CSharp/LayoutObjects/Geo.cs @@ -0,0 +1,146 @@ +// this file was auto-generated using Plotly.NET.Codegen on 3/20/2023 targeting Plotly.NET, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c98c6d87097b7615. +// Do not edit this, as it will most likely be overwritten on the next codegen run. +// Instead, file an issue or target the codegen with your changes directly. +// Bugs that are not caused by wrong codegen are most likely not found in this file, but in the F# source this file is generated from. + +namespace Plotly.NET.CSharp.LayoutObjects; + +public static class Geo { + public static Plotly.NET.LayoutObjects.Geo Init( + Optional FitBounds = default, + Optional Resolution = default, + Optional Scope = default, + Optional Projection = default, + Optional> Center = default, + Optional Visible = default, + Optional Domain = default, + Optional ShowCoastLines = default, + Optional CoastLineColor = default, + Optional CoastLineWidth = default, + Optional ShowLand = default, + Optional LandColor = default, + Optional ShowOcean = default, + Optional OceanColor = default, + Optional ShowLakes = default, + Optional LakeColor = default, + Optional ShowRivers = default, + Optional RiverColor = default, + Optional RiverWidth = default, + Optional ShowCountries = default, + Optional CountryColor = default, + Optional CountryWidth = default, + Optional ShowSubunits = default, + Optional SubunitColor = default, + Optional SubunitWidth = default, + Optional ShowFrame = default, + Optional FrameColor = default, + Optional FrameWidth = default, + Optional BgColor = default, + Optional LatAxis = default, + Optional LonAxis = default + ) + + => + Plotly.NET.LayoutObjects.Geo.init( + FitBounds: FitBounds.ToOption(), + Resolution: Resolution.ToOption(), + Scope: Scope.ToOption(), + Projection: Projection.ToOption(), + Center: Center.ToOption(), + Visible: Visible.ToOption(), + Domain: Domain.ToOption(), + ShowCoastLines: ShowCoastLines.ToOption(), + CoastLineColor: CoastLineColor.ToOption(), + CoastLineWidth: CoastLineWidth.ToOption(), + ShowLand: ShowLand.ToOption(), + LandColor: LandColor.ToOption(), + ShowOcean: ShowOcean.ToOption(), + OceanColor: OceanColor.ToOption(), + ShowLakes: ShowLakes.ToOption(), + LakeColor: LakeColor.ToOption(), + ShowRivers: ShowRivers.ToOption(), + RiverColor: RiverColor.ToOption(), + RiverWidth: RiverWidth.ToOption(), + ShowCountries: ShowCountries.ToOption(), + CountryColor: CountryColor.ToOption(), + CountryWidth: CountryWidth.ToOption(), + ShowSubunits: ShowSubunits.ToOption(), + SubunitColor: SubunitColor.ToOption(), + SubunitWidth: SubunitWidth.ToOption(), + ShowFrame: ShowFrame.ToOption(), + FrameColor: FrameColor.ToOption(), + FrameWidth: FrameWidth.ToOption(), + BgColor: BgColor.ToOption(), + LatAxis: LatAxis.ToOption(), + LonAxis: LonAxis.ToOption() + ); + public static Plotly.NET.LayoutObjects.Geo Style( + this Plotly.NET.LayoutObjects.Geo obj, + Optional FitBounds = default, + Optional Resolution = default, + Optional Scope = default, + Optional Projection = default, + Optional> Center = default, + Optional Visible = default, + Optional Domain = default, + Optional ShowCoastLines = default, + Optional CoastLineColor = default, + Optional CoastLineWidth = default, + Optional ShowLand = default, + Optional LandColor = default, + Optional ShowOcean = default, + Optional OceanColor = default, + Optional ShowLakes = default, + Optional LakeColor = default, + Optional ShowRivers = default, + Optional RiverColor = default, + Optional RiverWidth = default, + Optional ShowCountries = default, + Optional CountryColor = default, + Optional CountryWidth = default, + Optional ShowSubunits = default, + Optional SubunitColor = default, + Optional SubunitWidth = default, + Optional ShowFrame = default, + Optional FrameColor = default, + Optional FrameWidth = default, + Optional BgColor = default, + Optional LatAxis = default, + Optional LonAxis = default + ) + + => + Plotly.NET.LayoutObjects.Geo.style( + FitBounds: FitBounds.ToOption(), + Resolution: Resolution.ToOption(), + Scope: Scope.ToOption(), + Projection: Projection.ToOption(), + Center: Center.ToOption(), + Visible: Visible.ToOption(), + Domain: Domain.ToOption(), + ShowCoastLines: ShowCoastLines.ToOption(), + CoastLineColor: CoastLineColor.ToOption(), + CoastLineWidth: CoastLineWidth.ToOption(), + ShowLand: ShowLand.ToOption(), + LandColor: LandColor.ToOption(), + ShowOcean: ShowOcean.ToOption(), + OceanColor: OceanColor.ToOption(), + ShowLakes: ShowLakes.ToOption(), + LakeColor: LakeColor.ToOption(), + ShowRivers: ShowRivers.ToOption(), + RiverColor: RiverColor.ToOption(), + RiverWidth: RiverWidth.ToOption(), + ShowCountries: ShowCountries.ToOption(), + CountryColor: CountryColor.ToOption(), + CountryWidth: CountryWidth.ToOption(), + ShowSubunits: ShowSubunits.ToOption(), + SubunitColor: SubunitColor.ToOption(), + SubunitWidth: SubunitWidth.ToOption(), + ShowFrame: ShowFrame.ToOption(), + FrameColor: FrameColor.ToOption(), + FrameWidth: FrameWidth.ToOption(), + BgColor: BgColor.ToOption(), + LatAxis: LatAxis.ToOption(), + LonAxis: LonAxis.ToOption() + ).Invoke(obj); +} \ No newline at end of file diff --git a/src/Plotly.NET.CSharp/LayoutObjects/Mapbox.cs b/src/Plotly.NET.CSharp/LayoutObjects/Mapbox.cs new file mode 100644 index 000000000..dbabda0da --- /dev/null +++ b/src/Plotly.NET.CSharp/LayoutObjects/Mapbox.cs @@ -0,0 +1,54 @@ +// this file was auto-generated using Plotly.NET.Codegen on 3/20/2023 targeting Plotly.NET, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c98c6d87097b7615. +// Do not edit this, as it will most likely be overwritten on the next codegen run. +// Instead, file an issue or target the codegen with your changes directly. +// Bugs that are not caused by wrong codegen are most likely not found in this file, but in the F# source this file is generated from. + +namespace Plotly.NET.CSharp.LayoutObjects; + +public static class Mapbox { + public static Plotly.NET.LayoutObjects.Mapbox Init( + Optional Domain = default, + Optional AccessToken = default, + Optional Style = default, + Optional> Center = default, + Optional Zoom = default, + Optional Bearing = default, + Optional Pitch = default, + Optional> Layers = default + ) + + => + Plotly.NET.LayoutObjects.Mapbox.init( + Domain: Domain.ToOption(), + AccessToken: AccessToken.ToOption(), + Style: Style.ToOption(), + Center: Center.ToOption(), + Zoom: Zoom.ToOption(), + Bearing: Bearing.ToOption(), + Pitch: Pitch.ToOption(), + Layers: Layers.ToOption() + ); + public static Plotly.NET.LayoutObjects.Mapbox Style( + this Plotly.NET.LayoutObjects.Mapbox obj, + Optional Domain = default, + Optional AccessToken = default, + Optional Style = default, + Optional> Center = default, + Optional Zoom = default, + Optional Bearing = default, + Optional Pitch = default, + Optional> Layers = default + ) + + => + Plotly.NET.LayoutObjects.Mapbox.style( + Domain: Domain.ToOption(), + AccessToken: AccessToken.ToOption(), + Style: Style.ToOption(), + Center: Center.ToOption(), + Zoom: Zoom.ToOption(), + Bearing: Bearing.ToOption(), + Pitch: Pitch.ToOption(), + Layers: Layers.ToOption() + ).Invoke(obj); +} \ No newline at end of file diff --git a/src/Plotly.NET.CSharp/LayoutObjects/Polar.cs b/src/Plotly.NET.CSharp/LayoutObjects/Polar.cs new file mode 100644 index 000000000..32da66b5c --- /dev/null +++ b/src/Plotly.NET.CSharp/LayoutObjects/Polar.cs @@ -0,0 +1,94 @@ +// this file was auto-generated using Plotly.NET.Codegen on 3/20/2023 targeting Plotly.NET, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c98c6d87097b7615. +// Do not edit this, as it will most likely be overwritten on the next codegen run. +// Instead, file an issue or target the codegen with your changes directly. +// Bugs that are not caused by wrong codegen are most likely not found in this file, but in the F# source this file is generated from. + +namespace Plotly.NET.CSharp.LayoutObjects; + +public static class Polar { + public static Plotly.NET.LayoutObjects.Polar Init( + Optional Domain = default, + Optional> Sector = default, + Optional Hole = default, + Optional BGColor = default, + Optional RadialAxis = default, + Optional AngularAxis = default, + Optional GridShape = default, + Optional UIRevision = default + ) + + => + Plotly.NET.LayoutObjects.Polar.init( + Domain: Domain.ToOption(), + Sector: Sector.ToOption(), + Hole: Hole.ToOption(), + BGColor: BGColor.ToOption(), + RadialAxis: RadialAxis.ToOption(), + AngularAxis: AngularAxis.ToOption(), + GridShape: GridShape.ToOption(), + UIRevision: UIRevision.ToOption() + ); + public static Plotly.NET.LayoutObjects.Polar Style( + this Plotly.NET.LayoutObjects.Polar obj, + Optional Domain = default, + Optional> Sector = default, + Optional Hole = default, + Optional BGColor = default, + Optional RadialAxis = default, + Optional AngularAxis = default, + Optional GridShape = default, + Optional UIRevision = default, + Optional BarMode = default, + Optional BarGap = default + ) + + => + Plotly.NET.LayoutObjects.Polar.style( + Domain: Domain.ToOption(), + Sector: Sector.ToOption(), + Hole: Hole.ToOption(), + BGColor: BGColor.ToOption(), + RadialAxis: RadialAxis.ToOption(), + AngularAxis: AngularAxis.ToOption(), + GridShape: GridShape.ToOption(), + UIRevision: UIRevision.ToOption(), + BarMode: BarMode.ToOption(), + BarGap: BarGap.ToOption() + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.AngularAxis GetAngularAxis( + this Plotly.NET.LayoutObjects.Polar obj, + Plotly.NET.LayoutObjects.Polar polar + ) + + => + Plotly.NET.LayoutObjects.Polar.getAngularAxis( + polar: polar + ); + public static Plotly.NET.LayoutObjects.Polar SetAngularAxis( + this Plotly.NET.LayoutObjects.Polar obj, + Plotly.NET.LayoutObjects.AngularAxis angularAxis + ) + + => + Plotly.NET.LayoutObjects.Polar.setAngularAxis( + angularAxis: angularAxis + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.RadialAxis GetRadialAxis( + this Plotly.NET.LayoutObjects.Polar obj, + Plotly.NET.LayoutObjects.Polar polar + ) + + => + Plotly.NET.LayoutObjects.Polar.getRadialAxis( + polar: polar + ); + public static Plotly.NET.LayoutObjects.Polar SetRadialAxis( + this Plotly.NET.LayoutObjects.Polar obj, + Plotly.NET.LayoutObjects.RadialAxis radialAxis + ) + + => + Plotly.NET.LayoutObjects.Polar.setRadialAxis( + radialAxis: radialAxis + ).Invoke(obj); +} \ No newline at end of file diff --git a/src/Plotly.NET.CSharp/LayoutObjects/Scene.cs b/src/Plotly.NET.CSharp/LayoutObjects/Scene.cs new file mode 100644 index 000000000..653fd1256 --- /dev/null +++ b/src/Plotly.NET.CSharp/LayoutObjects/Scene.cs @@ -0,0 +1,124 @@ +// this file was auto-generated using Plotly.NET.Codegen on 3/20/2023 targeting Plotly.NET, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c98c6d87097b7615. +// Do not edit this, as it will most likely be overwritten on the next codegen run. +// Instead, file an issue or target the codegen with your changes directly. +// Bugs that are not caused by wrong codegen are most likely not found in this file, but in the F# source this file is generated from. + +namespace Plotly.NET.CSharp.LayoutObjects; + +public static class Scene { + public static Plotly.NET.LayoutObjects.Scene Init( + Optional> Annotations = default, + Optional AspectMode = default, + Optional AspectRatio = default, + Optional BGColor = default, + Optional Camera = default, + Optional Domain = default, + Optional DragMode = default, + Optional HoverMode = default, + Optional UIRevision = default, + Optional XAxis = default, + Optional YAxis = default, + Optional ZAxis = default + ) + + => + Plotly.NET.LayoutObjects.Scene.init( + Annotations: Annotations.ToOption(), + AspectMode: AspectMode.ToOption(), + AspectRatio: AspectRatio.ToOption(), + BGColor: BGColor.ToOption(), + Camera: Camera.ToOption(), + Domain: Domain.ToOption(), + DragMode: DragMode.ToOption(), + HoverMode: HoverMode.ToOption(), + UIRevision: UIRevision.ToOption(), + XAxis: XAxis.ToOption(), + YAxis: YAxis.ToOption(), + ZAxis: ZAxis.ToOption() + ); + public static Plotly.NET.LayoutObjects.Scene Style( + this Plotly.NET.LayoutObjects.Scene obj, + Optional> Annotations = default, + Optional AspectMode = default, + Optional AspectRatio = default, + Optional BGColor = default, + Optional Camera = default, + Optional Domain = default, + Optional DragMode = default, + Optional HoverMode = default, + Optional UIRevision = default, + Optional XAxis = default, + Optional YAxis = default, + Optional ZAxis = default + ) + + => + Plotly.NET.LayoutObjects.Scene.style( + Annotations: Annotations.ToOption(), + AspectMode: AspectMode.ToOption(), + AspectRatio: AspectRatio.ToOption(), + BGColor: BGColor.ToOption(), + Camera: Camera.ToOption(), + Domain: Domain.ToOption(), + DragMode: DragMode.ToOption(), + HoverMode: HoverMode.ToOption(), + UIRevision: UIRevision.ToOption(), + XAxis: XAxis.ToOption(), + YAxis: YAxis.ToOption(), + ZAxis: ZAxis.ToOption() + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.LinearAxis GetXAxis( + this Plotly.NET.LayoutObjects.Scene obj, + Plotly.NET.LayoutObjects.Scene scene + ) + + => + Plotly.NET.LayoutObjects.Scene.getXAxis( + scene: scene + ); + public static Plotly.NET.LayoutObjects.Scene SetXAxis( + this Plotly.NET.LayoutObjects.Scene obj, + Plotly.NET.LayoutObjects.LinearAxis xAxis + ) + + => + Plotly.NET.LayoutObjects.Scene.setXAxis( + xAxis: xAxis + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.LinearAxis GetYAxis( + this Plotly.NET.LayoutObjects.Scene obj, + Plotly.NET.LayoutObjects.Scene scene + ) + + => + Plotly.NET.LayoutObjects.Scene.getYAxis( + scene: scene + ); + public static Plotly.NET.LayoutObjects.Scene SetYAxis( + this Plotly.NET.LayoutObjects.Scene obj, + Plotly.NET.LayoutObjects.LinearAxis yAxis + ) + + => + Plotly.NET.LayoutObjects.Scene.setYAxis( + yAxis: yAxis + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.LinearAxis GetZAxis( + this Plotly.NET.LayoutObjects.Scene obj, + Plotly.NET.LayoutObjects.Scene scene + ) + + => + Plotly.NET.LayoutObjects.Scene.getZAxis( + scene: scene + ); + public static Plotly.NET.LayoutObjects.Scene SetZAxis( + this Plotly.NET.LayoutObjects.Scene obj, + Plotly.NET.LayoutObjects.LinearAxis zAxis + ) + + => + Plotly.NET.LayoutObjects.Scene.setZAxis( + zAxis: zAxis + ).Invoke(obj); +} \ No newline at end of file diff --git a/src/Plotly.NET.CSharp/LayoutObjects/Smith.cs b/src/Plotly.NET.CSharp/LayoutObjects/Smith.cs new file mode 100644 index 000000000..7151c2097 --- /dev/null +++ b/src/Plotly.NET.CSharp/LayoutObjects/Smith.cs @@ -0,0 +1,74 @@ +// this file was auto-generated using Plotly.NET.Codegen on 3/20/2023 targeting Plotly.NET, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c98c6d87097b7615. +// Do not edit this, as it will most likely be overwritten on the next codegen run. +// Instead, file an issue or target the codegen with your changes directly. +// Bugs that are not caused by wrong codegen are most likely not found in this file, but in the F# source this file is generated from. + +namespace Plotly.NET.CSharp.LayoutObjects; + +public static class Smith { + public static Plotly.NET.LayoutObjects.Smith Init( + Optional BGColor = default, + Optional Domain = default, + Optional ImaginaryAxis = default, + Optional RealAxis = default + ) + + => + Plotly.NET.LayoutObjects.Smith.init( + BGColor: BGColor.ToOption(), + Domain: Domain.ToOption(), + ImaginaryAxis: ImaginaryAxis.ToOption(), + RealAxis: RealAxis.ToOption() + ); + public static Plotly.NET.LayoutObjects.Smith Style( + this Plotly.NET.LayoutObjects.Smith obj, + Optional BGColor = default, + Optional Domain = default, + Optional ImaginaryAxis = default, + Optional RealAxis = default + ) + + => + Plotly.NET.LayoutObjects.Smith.style( + BGColor: BGColor.ToOption(), + Domain: Domain.ToOption(), + ImaginaryAxis: ImaginaryAxis.ToOption(), + RealAxis: RealAxis.ToOption() + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.ImaginaryAxis GetImaginaryAxis( + this Plotly.NET.LayoutObjects.Smith obj, + Plotly.NET.LayoutObjects.Smith smith + ) + + => + Plotly.NET.LayoutObjects.Smith.getImaginaryAxis( + smith: smith + ); + public static Plotly.NET.LayoutObjects.Smith SetImaginaryAxis( + this Plotly.NET.LayoutObjects.Smith obj, + Plotly.NET.LayoutObjects.ImaginaryAxis imaginaryAxis + ) + + => + Plotly.NET.LayoutObjects.Smith.setImaginaryAxis( + imaginaryAxis: imaginaryAxis + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.RealAxis GetRealAxis( + this Plotly.NET.LayoutObjects.Smith obj, + Plotly.NET.LayoutObjects.Smith smith + ) + + => + Plotly.NET.LayoutObjects.Smith.getRealAxis( + smith: smith + ); + public static Plotly.NET.LayoutObjects.Smith SetRealAxis( + this Plotly.NET.LayoutObjects.Smith obj, + Plotly.NET.LayoutObjects.RealAxis realAxis + ) + + => + Plotly.NET.LayoutObjects.Smith.setRealAxis( + realAxis: realAxis + ).Invoke(obj); +} \ No newline at end of file diff --git a/src/Plotly.NET.CSharp/LayoutObjects/Ternary.cs b/src/Plotly.NET.CSharp/LayoutObjects/Ternary.cs new file mode 100644 index 000000000..cfb37323c --- /dev/null +++ b/src/Plotly.NET.CSharp/LayoutObjects/Ternary.cs @@ -0,0 +1,100 @@ +// this file was auto-generated using Plotly.NET.Codegen on 3/20/2023 targeting Plotly.NET, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c98c6d87097b7615. +// Do not edit this, as it will most likely be overwritten on the next codegen run. +// Instead, file an issue or target the codegen with your changes directly. +// Bugs that are not caused by wrong codegen are most likely not found in this file, but in the F# source this file is generated from. + +namespace Plotly.NET.CSharp.LayoutObjects; + +public static class Ternary { + public static Plotly.NET.LayoutObjects.Ternary Init( + Optional AAxis = default, + Optional BAxis = default, + Optional CAxis = default, + Optional Domain = default, + Optional Sum = default, + Optional BGColor = default + ) + where a: System.IConvertible + => + Plotly.NET.LayoutObjects.Ternary.init( + AAxis: AAxis.ToOption(), + BAxis: BAxis.ToOption(), + CAxis: CAxis.ToOption(), + Domain: Domain.ToOption(), + Sum: Sum.ToOption(), + BGColor: BGColor.ToOption() + ); + public static Plotly.NET.LayoutObjects.Ternary Style( + this Plotly.NET.LayoutObjects.Ternary obj, + Optional AAxis = default, + Optional BAxis = default, + Optional CAxis = default, + Optional Domain = default, + Optional Sum = default, + Optional BGColor = default + ) + where a: System.IConvertible + => + Plotly.NET.LayoutObjects.Ternary.style( + AAxis: AAxis.ToOption(), + BAxis: BAxis.ToOption(), + CAxis: CAxis.ToOption(), + Domain: Domain.ToOption(), + Sum: Sum.ToOption(), + BGColor: BGColor.ToOption() + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.LinearAxis GetAAxis( + this Plotly.NET.LayoutObjects.Ternary obj, + Plotly.NET.LayoutObjects.Ternary ternary + ) + + => + Plotly.NET.LayoutObjects.Ternary.getAAxis( + ternary: ternary + ); + public static Plotly.NET.LayoutObjects.Ternary SetAAxis( + this Plotly.NET.LayoutObjects.Ternary obj, + Plotly.NET.LayoutObjects.LinearAxis aAxis + ) + + => + Plotly.NET.LayoutObjects.Ternary.setAAxis( + aAxis: aAxis + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.LinearAxis GetBAxis( + this Plotly.NET.LayoutObjects.Ternary obj, + Plotly.NET.LayoutObjects.Ternary ternary + ) + + => + Plotly.NET.LayoutObjects.Ternary.getBAxis( + ternary: ternary + ); + public static Plotly.NET.LayoutObjects.Ternary SetBAxis( + this Plotly.NET.LayoutObjects.Ternary obj, + Plotly.NET.LayoutObjects.LinearAxis bAxis + ) + + => + Plotly.NET.LayoutObjects.Ternary.setBAxis( + bAxis: bAxis + ).Invoke(obj); + public static Plotly.NET.LayoutObjects.LinearAxis GetCAxis( + this Plotly.NET.LayoutObjects.Ternary obj, + Plotly.NET.LayoutObjects.Ternary ternary + ) + + => + Plotly.NET.LayoutObjects.Ternary.getCAxis( + ternary: ternary + ); + public static Plotly.NET.LayoutObjects.Ternary SetCAxis( + this Plotly.NET.LayoutObjects.Ternary obj, + Plotly.NET.LayoutObjects.LinearAxis cAxis + ) + + => + Plotly.NET.LayoutObjects.Ternary.setCAxis( + cAxis: cAxis + ).Invoke(obj); +} \ No newline at end of file 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..3b87d3cef --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Bins.cs @@ -0,0 +1,26 @@ + +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 InitBins + ( + 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..7eb1fb8ca --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Box.cs @@ -0,0 +1,30 @@ + +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 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() + ); +} + 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..be64cd6f7 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Caps.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.CapFill InitCapFill + ( + Optional Fill = default, + Optional Show = default + ) + => + Plotly.NET.TraceObjects.CapFill.init( + + Fill: Fill.ToOption(), + Show: Show.ToOption() + ); + + 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() + ); +} + 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..e23120f76 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Contours.cs @@ -0,0 +1,88 @@ + +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 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 Plotly.NET.TraceObjects.Contour InitContour + ( + 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 Plotly.NET.TraceObjects.Contours InitContours + ( + 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..c3e4ce2b7 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Cumulative.cs @@ -0,0 +1,26 @@ + +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 InitCumulative + ( + 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..f197ba9b9 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Dimensions.cs @@ -0,0 +1,70 @@ + +using Microsoft.FSharp.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Plotly.NET.CSharp; + +public static partial class TraceObjects +{ + public static Plotly.NET.TraceObjects.Dimension InitParallelDimension + ( + 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 + ) + 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() + ); + + 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(), + 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..90fc52569 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Error.cs @@ -0,0 +1,48 @@ + +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 InitError + ( + 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 + ) + 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 new file mode 100644 index 000000000..d475a8e0f --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/FinanceMarker.cs @@ -0,0 +1,28 @@ + +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 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() + ); +} + 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..5ac39e987 --- /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 InitFunnelConnector + ( + 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..b30f182f1 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Gradient.cs @@ -0,0 +1,26 @@ + +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 InitGradient + ( + 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..d2efb44aa --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Icicle.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.IcicleRoot InitIcicleRoot + ( + Optional Color = default + ) + => + Plotly.NET.TraceObjects.IcicleRoot.init( + Color: Color.ToOption() + ); + + public static Plotly.NET.TraceObjects.IcicleLeaf InitIcicleLeaf + ( + 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(), + 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..80f33aee6 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Indicator.cs @@ -0,0 +1,125 @@ + +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 InitIndicatorSymbol + ( + Optional Color = default, + Optional Symbol = default + ) + => + Plotly.NET.TraceObjects.IndicatorSymbol.init( + Color: Color.ToOption(), + Symbol: Symbol.ToOption() + ); + public static Plotly.NET.TraceObjects.IndicatorDelta InitIndicatorDelta + ( + Optional Decreasing = default, + Optional Font = default, + Optional Increasing = default, + Optional Position = default, + Optional Reference = default, + Optional Relative = default, + Optional ValueFormat = default + ) + 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 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 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 Plotly.NET.TraceObjects.IndicatorThreshold InitIndicatorThreshold + ( + Optional Line = default, + Optional Thickness = default, + 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 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..54261950e --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Lighting.cs @@ -0,0 +1,46 @@ + +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 InitLighting + ( + 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 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 new file mode 100644 index 000000000..7f162a2fe --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Marker.cs @@ -0,0 +1,78 @@ + +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 InitMarker + ( + 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..b38711c15 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/MeanLine.cs @@ -0,0 +1,26 @@ + +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 InitMeanLine + ( + 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..933bc47fd --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pathbar.cs @@ -0,0 +1,30 @@ + +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 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() + ); +} + 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..987ad8729 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Pattern.cs @@ -0,0 +1,38 @@ + +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 InitPattern + ( + 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..38cc6f844 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Projection.cs @@ -0,0 +1,38 @@ + +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 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 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() + ); +} + 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..b06eedea2 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sankey.cs @@ -0,0 +1,99 @@ + +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 InitSankeyNodes + ( + 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 + ) + 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 Plotly.NET.TraceObjects.SankeyLinks InitSankeyLinks + ( + 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 + ) + 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 new file mode 100644 index 000000000..b587cd01d --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Selection.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.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 Plotly.NET.TraceObjects.FontSelectionStyle InitFontSelectionStyle + ( + 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() + ); +} + 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..4ff69e162 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Slices.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.SlicesFill InitSlicesFill + ( + Optional Fill = default, + Optional> Locations = default, + Optional Show = default + ) + 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() + ); +} + 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..d49d53f55 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SpaceFrame.cs @@ -0,0 +1,24 @@ + +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 InitSpaceframe + ( + 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..53a43225d --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/SplomDiagonal.cs @@ -0,0 +1,22 @@ + +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 InitSplomDiagonal + ( + Optional Visible = default + ) + => + Plotly.NET.TraceObjects.SplomDiagonal.init( + Visible: Visible.ToOption() + ); +} + 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..c97b12606 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/StreamTubeStarts.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.StreamTubeStarts InitStreamTubeStarts + ( + 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 new file mode 100644 index 000000000..2a7c93927 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Sunburst.cs @@ -0,0 +1,30 @@ + +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 InitSunburstRoot + ( + Optional Color = default + ) + => + Plotly.NET.TraceObjects.SunburstRoot.init( + Color: Color.ToOption() + ); + public static Plotly.NET.TraceObjects.SunburstLeaf InitSunburstLeaf + ( + 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 new file mode 100644 index 000000000..2768099b5 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Surface.cs @@ -0,0 +1,28 @@ + +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 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() + ); +} + 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..676ebd3d8 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Table.cs @@ -0,0 +1,53 @@ + +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 InitTableFill + ( + 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 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 + ) + where ValuesType: IConvertible + => + Plotly.NET.TraceObjects.TableCells.init, ValuesType>( + 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 new file mode 100644 index 000000000..7de72bf78 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/Treemap.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.TreemapRoot InitTreemapRoot + ( + Optional Color = default + ) + => + Plotly.NET.TraceObjects.TreemapRoot.init( + Color: Color.ToOption() + ); + public static Plotly.NET.TraceObjects.TreemapLeaf InitTreemapLeaf + ( + 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() + ); +} + 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..d057ca522 --- /dev/null +++ b/src/Plotly.NET.CSharp/ObjectAbstractions/TraceObjects/WaterfallConnector.cs @@ -0,0 +1,26 @@ + +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 InitWaterfallConnector + ( + 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.Codegen/Common.fs b/src/Plotly.NET.Codegen/Common.fs new file mode 100644 index 000000000..0f09736a2 --- /dev/null +++ b/src/Plotly.NET.Codegen/Common.fs @@ -0,0 +1,45 @@ +module Common + +open Plotly.NET +open System +open System.Reflection +open System.IO +open System.Text +open System.Text.RegularExpressions + +let typeNumbers = [|for n in 1 .. 100 -> $"`{n}"|] + +let cleanTypeName (typeName:string) = + let typeName' = + typeNumbers + |> Array.fold (fun (acc: string) number -> acc.Replace(number,"")) typeName + typeName' + .Replace("+",".") + .Replace("[","<") + .Replace("]",">") + +let mapFSharpType (typeName:string) = + typeName + .Replace("float","double") + .Replace("seq","IEnumerable") + +let ident (level:int) (str: string) = + let identation = [for i in 0 .. level - 1 -> " "] |> String.concat "" + $"{identation}{str}" + +let capitalize (methodName:string) = + if methodName.Length > 0 then + $"{Char.ToUpper methodName[0]}{methodName[1..]}" + else + methodName + +let ensureDirectory path = + if not (Directory.Exists(path)) then Directory.CreateDirectory(path) |> ignore + +let plotlyVersion = typeof.Assembly + +let initFileHeader() = $"""// this file was auto-generated using Plotly.NET.Codegen on {System.DateTime.Now.ToShortDateString()} targeting {plotlyVersion}. +// Do not edit this, as it will most likely be overwritten on the next codegen run. +// Instead, file an issue or target the codegen with your changes directly. +// Bugs that are not caused by wrong codegen are most likely not found in this file, but in the F# source this file is generated from. +""" \ No newline at end of file diff --git a/src/Plotly.NET.Codegen/CoreObjects.fs b/src/Plotly.NET.Codegen/CoreObjects.fs new file mode 100644 index 000000000..603731387 --- /dev/null +++ b/src/Plotly.NET.Codegen/CoreObjects.fs @@ -0,0 +1,144 @@ +/// functions for creating core objects +/// +/// core objects are abstractions for plotly.js objects which come with more than simple init and style methods, such as custom getters and setters. +/// An example for such an object would be the Layout object. +/// Non-toplevel can also belong to this type of object abstraction, such as all the subplot types (e.g. Polar or Geo) +/// +/// The main difference for these objects is that they need a collection of extension methods in addition to static method abstractions. +module CoreObjects + +open Common +open TemplateStrings +open System.Reflection + +let getBindingMethods (t:System.Type) = + t.GetMembers() + |> Array.filter (fun m -> m.DeclaringType.Name = t.Name) + |> Array.filter (fun m -> m.MemberType = MemberTypes.Method) + |> Array.map (fun m -> + m.Name, + t.GetMethod(m.Name) + ) + +let generateStaticMethodBindings (methods: (string*MethodInfo) []) = + methods + |> Array.map (fun (methodName, method) -> + if methodName.Contains("try") then + None + else + let shouldBeExtension = not (methodName.Contains("init")) + + let mutable isFunc = false + + let parameters = method.GetParameters() + + let return_type = + if shouldBeExtension then + let n = method.ReturnType.Name + printfn "%s" n + match n with + | func when func.Contains("FSharpFunc") -> + let func_generics = method.ReturnType.GenericTypeArguments + isFunc <- true + let funcReturnType = cleanTypeName (func_generics[1].ToString()) + printfn "func return type: %s" funcReturnType + funcReturnType + | _ -> cleanTypeName (method.ReturnType.ToString()) + else + cleanTypeName (method.ReturnType.ToString()) + + let generics= + if method.ContainsGenericParameters then + method + .GetGenericMethodDefinition() + .GetGenericArguments() + |> Array.map (fun generic -> generic.Name, generic.GetGenericParameterConstraints()) + else + [||] + + let generic_annotations = + if generics.Length > 0 then + generics + |> Array.map fst + |> String.concat ", " + |> fun generics -> $"<{generics}>" + else + "" + + let generic_constraints = + if generics.Length > 0 then + generics + |> Array.map (fun (name,types) -> + if types.Length > 0 then + $"where {name}: {types[0]}" + else + "" + ) + else + [||] + + let parameter_bodies = + parameters + |> Array.map (fun p -> + if p.IsOptional then + let annotations = + p.ParameterType.GetTypeInfo().GetGenericArguments() + |> Array.map (fun t -> cleanTypeName (t.ToString())) + $"Optional<{annotations[0]}> {p.Name} = default" + else + let pType = cleanTypeName (p.ParameterType.ToString()) + $"{pType} {p.Name}" + ) + + + let parameter_bindings = + parameters + |> Array.map (fun p -> + if p.IsOptional then + $"{p.Name}: {p.Name}.ToOption()" + else + $"{p.Name}: {p.Name}" + ) + + let declaring_type = cleanTypeName (method.DeclaringType.ToString()) + + if shouldBeExtension then + Some( + MethodTemplates.initExtensionMethodTemplate( + identationLevel = 1, + isFunction = isFunc, + returnType = return_type, + capitalizedMethodName = capitalize methodName, + genericAnnotations = generic_annotations, + parameters = parameter_bodies, + genericConstraints = generic_constraints, + declaringType = declaring_type, + methodName = methodName, + parameterBindings = parameter_bindings + ) + ) + else + Some( + MethodTemplates.initStaticMethodTemplate( + identationLevel = 1, + returnType = return_type, + capitalizedMethodName = capitalize methodName, + genericAnnotations = generic_annotations, + parameters = parameter_bodies, + genericConstraints = generic_constraints, + declaringType = declaring_type, + methodName = methodName, + parameterBindings = parameter_bindings + ) + ) + ) + |> Array.choose id + +let generateClass (className:string) (nameSpace:string) (methods: string []) = + ClassTemplates.initCoreObjectAbstractionClassTemplate( + identationLevel = 0, + nameSpace = className, + className = nameSpace, + staticMethods = methods + ) + diff --git a/src/Plotly.NET.Codegen/Playground/important-objects-codegen.fsx b/src/Plotly.NET.Codegen/Playground/important-objects-codegen.fsx new file mode 100644 index 000000000..e5cd2eb9a --- /dev/null +++ b/src/Plotly.NET.Codegen/Playground/important-objects-codegen.fsx @@ -0,0 +1,102 @@ +open System.Reflection +open Plotly.NET + +let l = typeof + +let methods = + l.GetMembers() + |> Array.filter (fun m -> m.DeclaringType.Name = l.Name) + |> Array.filter (fun m -> m.MemberType = MemberTypes.Method) + |> Array.map (fun m -> + m.Name, + l.GetMethod(m.Name) + ) + + +let generated_methods = + methods + |> Array.map (fun (methodName, method) -> + + let return_type = method.ReturnType.ToString() + + let parameters = method.GetParameters() + + let generics= + method + .GetGenericMethodDefinition() + .GetGenericArguments() + |> Array.map (fun generic -> generic.Name, generic.GetGenericParameterConstraints()) + + + let generic_annotations = + if generics.Length > 0 then + generics + |> Array.map fst + |> String.concat ", " + |> fun generics -> $"<{generics}>" + else + "" + + let generic_constraints = + if generics.Length > 0 then + generics + |> Array.map (fun (name,types) -> + if types.Length > 0 then + $"where {name}: {types[0]}" + else + "" + ) + |> String.concat $"{System.Environment.NewLine} " + else + "" + + let parameter_bodies = + parameters + |> Array.map (fun p -> + if p.IsOptional then + let annotations = + p.ParameterType.GetTypeInfo().GetGenericArguments() + |> Array.map ( + fun t -> + t + .ToString() + .Replace("+",".") + .Replace("[","<") + .Replace("]",">") + .Replace("`1","") + ) + $"Optional<{annotations[0]}> {p.Name} = default" + else + let pType = + p.ParameterType + .ToString() + .Replace("+",".") + .Replace("[","<") + .Replace("]",">") + .Replace("`1","") + + $"{pType} {p.Name}" + ) + |> String.concat $",{System.Environment.NewLine} " + + + let parameter_bindings = + parameters + |> Array.map (fun p -> + $"{p.Name}: {p.Name}" + ) + |> String.concat $",{System.Environment.NewLine} " + + $"""public static {return_type} {methodName}{generic_annotations}( + {parameter_bodies} +) + {generic_constraints} + => + {method.DeclaringType}.{methodName}{generic_annotations}( + {parameter_bindings} + ); +""" + ) + +generated_methods[0] +|> printfn "%A" \ No newline at end of file diff --git a/src/Plotly.NET.Codegen/Playground/traceobject-codegen.fsx b/src/Plotly.NET.Codegen/Playground/traceobject-codegen.fsx new file mode 100644 index 000000000..d2609c84b --- /dev/null +++ b/src/Plotly.NET.Codegen/Playground/traceobject-codegen.fsx @@ -0,0 +1,31 @@ +#load "../Common.fs" +#load "../TraceObjects.fs" +open Common +open Plotly.NET.TraceObjects +open System.Text +open System.Text.RegularExpressions +open System.IO + + +let indicator = TraceObjectAbstraction.parseSourceFile @"C:\Users\schne\source\repos\plotly\Plotly.NET\src\Plotly.NET\Traces\ObjectAbstractions\Indicator.fs" + +TraceObjectAbstraction.createCSharpSourceFile indicator + +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 = TraceObjectAbstraction.parseSourceFile source + let targetFile = TraceObjectAbstraction.createCSharpSourceFile classes + File.WriteAllText(target, targetFile) +) \ No newline at end of file diff --git a/src/Plotly.NET.Codegen/Plotly.NET.Codegen.fsproj b/src/Plotly.NET.Codegen/Plotly.NET.Codegen.fsproj new file mode 100644 index 000000000..2565a6587 --- /dev/null +++ b/src/Plotly.NET.Codegen/Plotly.NET.Codegen.fsproj @@ -0,0 +1,22 @@ + + + + Exe + net6.0 + + + + + + + + + + + + + + + + + diff --git a/src/Plotly.NET.Codegen/Program.fs b/src/Plotly.NET.Codegen/Program.fs new file mode 100644 index 000000000..0b9e2a050 --- /dev/null +++ b/src/Plotly.NET.Codegen/Program.fs @@ -0,0 +1,42 @@ +open System.Reflection +open System +open System.IO + +open Common +open TemplateStrings + +[] +let main (args: string []) = + + //if args.Length <> 1 then + // failwith "provide root path plz" + + //let root = args[0] + + let root = @"C:\Users\schne\source\repos\plotly\Plotly.NET\src\Plotly.NET.CSharp" + + // tuple of type to generate bindings for, target namespace, and target filepath + let core_object_target_types = [ + // to-do problem with generic trace argument: typeof, "Plotly.NET.CSharp", Path.Combine(root, "") + typeof, "Plotly.NET.CSharp", Path.Combine(root, "") + // to-do (no custom setters/getters in core lib): + typeof, "Plotly.NET.CSharp.LayoutObjects", Path.Combine(root, "LayoutObjects") + // to-do (no custom setters/getters in core lib) + typeof, "Plotly.NET.CSharp.LayoutObjects", Path.Combine(root, "LayoutObjects") + typeof, "Plotly.NET.CSharp.LayoutObjects", Path.Combine(root, "LayoutObjects") + typeof, "Plotly.NET.CSharp.LayoutObjects", Path.Combine(root, "LayoutObjects") + typeof, "Plotly.NET.CSharp.LayoutObjects", Path.Combine(root, "LayoutObjects") + typeof, "Plotly.NET.CSharp.LayoutObjects", Path.Combine(root, "LayoutObjects") + ] + + core_object_target_types + |> List.iter(fun (coreType, targetNamespace, path) -> + ensureDirectory path + let methods = CoreObjects.getBindingMethods coreType + let static_method_bindings = CoreObjects.generateStaticMethodBindings methods + let class_binding = CoreObjects.generateClass targetNamespace coreType.Name static_method_bindings + let file_name = Path.Combine(path, $"{coreType.Name}.cs") + File.WriteAllText(file_name, class_binding) + ) + + 0 \ No newline at end of file diff --git a/src/Plotly.NET.Codegen/TemplateStrings.fs b/src/Plotly.NET.Codegen/TemplateStrings.fs new file mode 100644 index 000000000..7a103d3b1 --- /dev/null +++ b/src/Plotly.NET.Codegen/TemplateStrings.fs @@ -0,0 +1,72 @@ +module TemplateStrings +open Common + +type MethodTemplates() = + + static member initStaticMethodTemplate ( + identationLevel: int, + returnType: string, + capitalizedMethodName: string, + genericAnnotations: string, + parameters: string [], + genericConstraints: string [], + declaringType: string, + methodName: string, + parameterBindings: string [] + ) = + [ + ident identationLevel $"public static {returnType} {capitalizedMethodName}{genericAnnotations}(" + parameters |> Array.map (ident (identationLevel + 1)) |> String.concat $",{System.Environment.NewLine}" + ident identationLevel ")" + genericConstraints |> Array.map (ident (identationLevel + 1)) |> String.concat $"{System.Environment.NewLine}" + ident (identationLevel + 1) "=>" + ident (identationLevel + 2) $"{declaringType}.{methodName}{genericAnnotations}(" + parameterBindings |> Array.map (ident (identationLevel + 3)) |> String.concat $",{System.Environment.NewLine}" + ident (identationLevel + 2) ");" + ] + |> String.concat System.Environment.NewLine + + static member initExtensionMethodTemplate ( + identationLevel: int, + isFunction: bool, + returnType: string, + capitalizedMethodName: string, + genericAnnotations: string, + parameters: string [], + genericConstraints: string [], + declaringType: string, + methodName: string, + parameterBindings: string [] + ) = + let invoke = if isFunction then ".Invoke(obj)" else "" + + [ + ident identationLevel $"public static {returnType} {capitalizedMethodName}{genericAnnotations}(" + ident (identationLevel + 1) $"this {declaringType} obj," + parameters |> Array.map (ident (identationLevel + 1)) |> String.concat $",{System.Environment.NewLine}" + ident identationLevel ")" + genericConstraints |> Array.map (ident (identationLevel + 1)) |> String.concat $"{System.Environment.NewLine}" + ident (identationLevel + 1) "=>" + ident (identationLevel + 2) $"{declaringType}.{methodName}{genericAnnotations}(" + parameterBindings |> Array.map (ident (identationLevel + 3)) |> String.concat $",{System.Environment.NewLine}" + ident (identationLevel + 2) $"){invoke};" + ] + |> String.concat System.Environment.NewLine + +type ClassTemplates() = + + static member initCoreObjectAbstractionClassTemplate( + identationLevel: int, + nameSpace: string, + className: string, + staticMethods: string [] + ) = + [ + initFileHeader() + ident identationLevel $"namespace {nameSpace};" + "" + $"public static class {className} " + "{" + yield! staticMethods |> Array.map (ident identationLevel) + "}" + ] + |> String.concat System.Environment.NewLine \ No newline at end of file diff --git a/src/Plotly.NET.Codegen/TraceObjects.fs b/src/Plotly.NET.Codegen/TraceObjects.fs new file mode 100644 index 000000000..1ae4e6576 --- /dev/null +++ b/src/Plotly.NET.Codegen/TraceObjects.fs @@ -0,0 +1,211 @@ +namespace Plotly.NET.TraceObjects + +open Common +open System.Text +open System.Text.RegularExpressions +open System.IO + +module Templates = + + 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] + ); +} +""" + + + 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] +""" + +module Regex = + + 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 + +type TraceObjectAbstraction = { + ObjectName: string + MandatoryParams: (string*string) list + OptionalParams: (string*string) list + Generics: string list +} with + 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 = 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} =>" + + Templates.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) + + static member 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 = Regex.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() = "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" + 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 ((Regex.getOptParam optParam) :: oParams) acc + + | param when isInit -> + + printfn "is param" + loop rest isFirstObj isInit currentName ((Regex.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 "" [] [] [] + + static member createCSharpSourceFile (objectAbstractions: TraceObjectAbstraction list) = + let classes = + objectAbstractions + |> List.map TraceObjectAbstraction.toClassTemplate + |> String.concat System.Environment.NewLine + + Templates.file_template.Replace("[CLASSES]",classes) 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}