diff --git a/docs/index.fsx b/docs/index.fsx index f2e129ba5..c78a266be 100644 --- a/docs/index.fsx +++ b/docs/index.fsx @@ -290,25 +290,25 @@ double[] x = new double[] { 1, 2 }; double[] y = new double[] { 5, 10 }; LinearAxis xAxis = new LinearAxis(); -xAxis.SetValue("title", "xAxis"); -xAxis.SetValue("showgrid", false); -xAxis.SetValue("showline", true); +xAxis.SetProperty("title", "xAxis"); +xAxis.SetProperty("showgrid", false); +xAxis.SetProperty("showline", true); LinearAxis yAxis = new LinearAxis(); -yAxis.SetValue("title", "yAxis"); -yAxis.SetValue("showgrid", false); -yAxis.SetValue("showline", true); +yAxis.SetProperty("title", "yAxis"); +yAxis.SetProperty("showgrid", false); +yAxis.SetProperty("showline", true); Layout layout = new Layout(); -layout.SetValue("xaxis", xAxis); -layout.SetValue("yaxis", yAxis); -layout.SetValue("showlegend", true); +layout.SetProperty("xaxis", xAxis); +layout.SetProperty("yaxis", yAxis); +layout.SetProperty("showlegend", true); Trace trace = new Trace("scatter"); -trace.SetValue("x", x); -trace.SetValue("y", y); -trace.SetValue("mode", "markers"); -trace.SetValue("name", "Hello from C#"); +trace.SetProperty("x", x); +trace.SetProperty("y", y); +trace.SetProperty("mode", "markers"); +trace.SetProperty("name", "Hello from C#"); GenericChart .ofTraceObject(true, trace) diff --git a/src/Plotly.NET.ImageExport/PuppeteerSharpRenderer.fs b/src/Plotly.NET.ImageExport/PuppeteerSharpRenderer.fs index 3a49fc868..fedbbe8aa 100644 --- a/src/Plotly.NET.ImageExport/PuppeteerSharpRenderer.fs +++ b/src/Plotly.NET.ImageExport/PuppeteerSharpRenderer.fs @@ -31,12 +31,13 @@ type PuppeteerSharpRenderer() = gChart |> GenericChart.mapConfig (fun c -> - DynObj.setValue c "responsive" true - c) + c |> DynObj.withProperty "responsive" true + ) |> GenericChart.mapLayout (fun l -> - DynObj.setValue l "width" "100%" - DynObj.setValue l "height" "100%" - l) + l + |> DynObj.withProperty "width" "100%" + |> DynObj.withProperty "height" "100%" + ) |> GenericChart.toEmbeddedHTML // this should be done via regex, as this only captures the default width and height. |> fun html -> html.Replace("width: 600px; height: 600px;", "width: 100%; height: 100%;") diff --git a/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs b/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs index cf346c11a..aadeb6dd0 100644 --- a/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs +++ b/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs @@ -426,8 +426,8 @@ module GenericChartExtensions = member this.withColorBar(colorbar: ColorBar) = this |> GenericChart.mapTrace (fun t -> - colorbar |> DynObj.setValue t "colorbar" - t) + t |> DynObj.withProperty "colorbar" colorbar + ) [] [] @@ -805,7 +805,7 @@ module GenericChartExtensions = let updatedGrid = let currentGrid = - match layout.TryGetTypedValue "grid" with + match layout.TryGetTypedPropertyValue "grid" with | Some grid -> grid | None -> LayoutGrid() @@ -913,8 +913,8 @@ module GenericChartExtensions = member this.WithTemplate(template: Template) = this |> GenericChart.mapLayout (fun l -> - template |> DynObj.setValue l "template" - l) + l |> DynObj.withProperty "template" template + ) // TODO: Include withLegend & withLegendStyle diff --git a/src/Plotly.NET/ChartAPI/Chart.fs b/src/Plotly.NET/ChartAPI/Chart.fs index 151c896ea..0eef89cd0 100644 --- a/src/Plotly.NET/ChartAPI/Chart.fs +++ b/src/Plotly.NET/ChartAPI/Chart.fs @@ -68,7 +68,7 @@ type Chart = LinearAxis.init (ShowGrid = false, ShowLine = false, ShowTickLabels = false, ZeroLine = false) let trace = Trace2D.initScatter (id) - trace.Remove("type") |> ignore + trace.RemoveProperty("type") |> ignore GenericChart.ofTraceObject false trace |> GenericChart.mapLayout (fun l -> @@ -1131,8 +1131,7 @@ type Chart = | StyleParam.SubPlotId.ZAxis -> scene |> Scene.getZAxis | _ -> failwith "invalid scene axis id" - let updatedAxis = - (DynObj.combine currentAxis axis) :?> LinearAxis + let updatedAxis = DynObj.combine currentAxis axis let updatedScene = scene @@ -1752,8 +1751,7 @@ type Chart = let currentAxis = polar |> Polar.getAngularAxis - let updatedAxis = - (DynObj.combine currentAxis angularAxis) :?> AngularAxis + let updatedAxis = DynObj.combine currentAxis angularAxis |> unbox let updatedPolar = polar |> Polar.setAngularAxis updatedAxis @@ -1812,7 +1810,7 @@ type Chart = polar |> Polar.getRadialAxis let updatedAxis = - (DynObj.combine currentAxis radialAxis) :?> RadialAxis + DynObj.combine currentAxis radialAxis |> unbox let updatedPolar = polar |> Polar.setRadialAxis updatedAxis @@ -1927,11 +1925,10 @@ type Chart = let currentAxis = smith |> Smith.getImaginaryAxis - let updatedAxis = - (DynObj.combine currentAxis imaginaryAxis) :?> ImaginaryAxis + let updatedAxis = DynObj.combine currentAxis imaginaryAxis |> unbox let updatedSmith = - smith |> Smith.setImaginaryAxis updatedAxis + smith |> Smith.setImaginaryAxis updatedAxis layout |> Layout.updateSmithById (id, updatedSmith) @@ -1985,11 +1982,10 @@ type Chart = if combine then let currentAxis = smith |> Smith.getRealAxis - let updatedAxis = - (DynObj.combine currentAxis realAxis) :?> RealAxis + let updatedAxis = DynObj.combine currentAxis realAxis |> unbox let updatedSmith = - smith |> Smith.setRealAxis updatedAxis + smith |> Smith.setRealAxis updatedAxis layout |> Layout.updateSmithById (id, updatedSmith) @@ -2368,11 +2364,10 @@ type Chart = let currentAxis = ternary |> Ternary.getAAxis - let updatedAxis = - (DynObj.combine currentAxis aAxis) :?> LinearAxis + let updatedAxis = DynObj.combine currentAxis aAxis |> unbox let updatedTernary = - ternary |> Ternary.setAAxis updatedAxis + ternary |> Ternary.setAAxis updatedAxis layout |> Layout.updateTernaryById (id, updatedTernary) @@ -2428,8 +2423,7 @@ type Chart = let currentAxis = ternary |> Ternary.getBAxis - let updatedAxis = - (DynObj.combine currentAxis bAxis) :?> LinearAxis + let updatedAxis = DynObj.combine currentAxis bAxis |> unbox let updatedTernary = ternary |> Ternary.setBAxis updatedAxis @@ -2488,8 +2482,7 @@ type Chart = let currentAxis = ternary |> Ternary.getCAxis - let updatedAxis = - (DynObj.combine currentAxis cAxis) :?> LinearAxis + let updatedAxis = DynObj.combine currentAxis cAxis |> unbox let updatedTernary = ternary |> Ternary.setCAxis updatedAxis @@ -2746,7 +2739,7 @@ type Chart = let layout = GenericChart.getLayout ch - layout.TryGetTypedValue>("annotations") + layout.TryGetTypedPropertyValue>("annotations") |> Option.defaultValue Seq.empty |> Seq.append annotations @@ -2857,7 +2850,7 @@ type Chart = let layout = GenericChart.getLayout ch - layout.TryGetTypedValue>("shapes") |> Option.defaultValue Seq.empty |> Seq.append shapes + layout.TryGetTypedPropertyValue>("shapes") |> Option.defaultValue Seq.empty |> Seq.append shapes else shapes @@ -2885,7 +2878,7 @@ type Chart = let layout = GenericChart.getLayout ch - layout.TryGetTypedValue>("selections") + layout.TryGetTypedPropertyValue>("selections") |> Option.defaultValue Seq.empty |> Seq.append selections @@ -3183,8 +3176,9 @@ type Chart = calculateSubplotTitlePositions 0. 1. xGap yGap nRows nCols reversed titles - |> Seq.zip positions[0 .. (Seq.length titles) - 1] - |> Seq.map (fun (((rowIndex, colIndex), (x, y)), title) -> + |> Array.ofSeq + |> Array.zip positions[0 .. (Seq.length titles) - 1] + |> Array.map (fun (((rowIndex, colIndex), (x, y)), title) -> Annotation.init( X = x, XRef = "paper", @@ -3206,7 +3200,8 @@ type Chart = gCharts |> Seq.zip gridCoordinates - |> Seq.mapi (fun i ((rowIndex, colIndex), gChart) -> + |> Array.ofSeq + |> Array.mapi (fun i ((rowIndex, colIndex), gChart) -> let layout = gChart |> GenericChart.getLayout @@ -3219,17 +3214,17 @@ type Chart = | TraceID.Carpet -> let xAxis = - layout.TryGetTypedValue "xaxis" |> Option.defaultValue (LinearAxis.init ()) + layout.TryGetTypedPropertyValue "xaxis" |> Option.defaultValue (LinearAxis.init ()) let yAxis = - layout.TryGetTypedValue "yaxis" |> Option.defaultValue (LinearAxis.init ()) + layout.TryGetTypedPropertyValue "yaxis" |> Option.defaultValue (LinearAxis.init ()) - let allXAxes = Layout.getXAxes layout |> Seq.map fst - let allYAxes = Layout.getYAxes layout |> Seq.map fst + let allXAxes = Layout.getXAxes layout |> Array.map fst + let allYAxes = Layout.getYAxes layout |> Array.map fst // remove all axes from layout. Only cartesian axis in each dimension is supported per grid cell, and leaving anything else on this layout may lead to property name clashes on combine. - allXAxes |> Seq.iter (fun propName -> layout.Remove(propName) |> ignore) - allYAxes |> Seq.iter (fun propName -> layout.Remove(propName) |> ignore) + allXAxes |> Array.iter (fun propName -> layout.RemoveProperty(propName) |> ignore) + allYAxes |> Array.iter (fun propName -> layout.RemoveProperty(propName) |> ignore) let xAnchor, yAnchor = if hasSharedAxes then @@ -3237,22 +3232,23 @@ type Chart = else i + 1, i + 1 - gChart - |> Chart.withAxisAnchor (xAnchor, yAnchor) // set adapted axis anchors - |> Chart.withXAxis (xAxis, (StyleParam.SubPlotId.XAxis(i + 1))) // set previous axis with adapted id (one individual axis for each subplot, whether or not they will be used later) - |> Chart.withYAxis (yAxis, (StyleParam.SubPlotId.YAxis(i + 1))) // set previous axis with adapted id (one individual axis for each subplot, whether or not they will be used later) - + let lol = + gChart + |> Chart.withAxisAnchor (xAnchor, yAnchor) // set adapted axis anchors + |> Chart.withXAxis (xAxis, (StyleParam.SubPlotId.XAxis(i + 1))) // set previous axis with adapted id (one individual axis for each subplot, whether or not they will be used later) + |> Chart.withYAxis (yAxis, (StyleParam.SubPlotId.YAxis(i + 1))) // set previous axis with adapted id (one individual axis for each subplot, whether or not they will be used later) + lol | TraceID.Cartesian3D -> let scene = - layout.TryGetTypedValue "scene" + layout.TryGetTypedPropertyValue "scene" |> Option.defaultValue (Scene.init ()) |> Scene.style (Domain = LayoutObjects.Domain.init (Row = rowIndex - 1, Column = colIndex - 1)) - let allScenes = Layout.getScenes layout |> Seq.map fst + let allScenes = Layout.getScenes layout |> Array.map fst // remove all scenes from layout. Only one scene is supported per grid cell, and leaving anything else on this layout may lead to property name clashes on combine. - allScenes |> Seq.iter (fun propName -> layout.Remove(propName) |> ignore) + allScenes |> Array.iter (fun propName -> layout.RemoveProperty(propName) |> ignore) let sceneAnchor = StyleParam.SubPlotId.Scene(i + 1) @@ -3263,14 +3259,14 @@ type Chart = | TraceID.Polar -> let polar = - layout.TryGetTypedValue "polar" + layout.TryGetTypedPropertyValue "polar" |> Option.defaultValue (Polar.init ()) |> Polar.style (Domain = LayoutObjects.Domain.init (Row = rowIndex - 1, Column = colIndex - 1)) - let allPolars = Layout.getPolars layout |> Seq.map fst + let allPolars = Layout.getPolars layout |> Array.map fst // remove all polar subplots from layout. Only one polar subplot is supported per grid cell, and leaving anything else on this layout may lead to property name clashes on combine. - allPolars |> Seq.iter (fun propName -> layout.Remove(propName) |> ignore) + allPolars |> Array.iter (fun propName -> layout.RemoveProperty(propName) |> ignore) let polarAnchor = StyleParam.SubPlotId.Polar(i + 1) @@ -3283,14 +3279,14 @@ type Chart = | TraceID.Smith -> let smith = - layout.TryGetTypedValue "smith" + layout.TryGetTypedPropertyValue "smith" |> Option.defaultValue (Smith.init ()) |> Smith.style (Domain = LayoutObjects.Domain.init (Row = rowIndex - 1, Column = colIndex - 1)) - let allSmiths = Layout.getSmiths layout |> Seq.map fst + let allSmiths = Layout.getSmiths layout |> Array.map fst // remove all smith subplots from layout. Only one smith subplot is supported per grid cell, and leaving anything else on this layout may lead to property name clashes on combine. - allSmiths |> Seq.iter (fun propName -> layout.Remove(propName) |> ignore) + allSmiths |> Array.iter (fun propName -> layout.RemoveProperty(propName) |> ignore) let polarAnchor = StyleParam.SubPlotId.Smith(i + 1) @@ -3302,14 +3298,14 @@ type Chart = | TraceID.Geo -> let geo = - layout.TryGetTypedValue "geo" + layout.TryGetTypedPropertyValue "geo" |> Option.defaultValue (Geo.init ()) |> Geo.style (Domain = LayoutObjects.Domain.init (Row = rowIndex - 1, Column = colIndex - 1)) - let allGeos = Layout.getGeos layout |> Seq.map fst + let allGeos = Layout.getGeos layout |> Array.map fst // remove all geo subplots from layout. Only one geo subplot is supported per grid cell, and leaving anything else on this layout may lead to property name clashes on combine. - allGeos |> Seq.iter (fun propName -> layout.Remove(propName) |> ignore) + allGeos |> Array.iter (fun propName -> layout.RemoveProperty(propName) |> ignore) let geoAnchor = StyleParam.SubPlotId.Geo(i + 1) @@ -3320,16 +3316,16 @@ type Chart = | TraceID.Mapbox -> let mapbox = - layout.TryGetTypedValue "mapbox" + layout.TryGetTypedPropertyValue "mapbox" |> Option.defaultValue (Mapbox.init ()) |> Mapbox.style ( Domain = LayoutObjects.Domain.init (Row = rowIndex - 1, Column = colIndex - 1) ) - let allMapboxes = Layout.getMapboxes layout |> Seq.map fst + let allMapboxes = Layout.getMapboxes layout |> Array.map fst // remove all mapbox subplots from layout. Only one mapbox subplot is supported per grid cell, and leaving anything else on this layout may lead to property name clashes on combine. - allMapboxes |> Seq.iter (fun propName -> layout.Remove(propName) |> ignore) + allMapboxes |> Array.iter (fun propName -> layout.RemoveProperty(propName) |> ignore) let geoAnchor = StyleParam.SubPlotId.Geo(i + 1) @@ -3345,16 +3341,16 @@ type Chart = | TraceID.Ternary -> let ternary = - layout.TryGetTypedValue "ternary" + layout.TryGetTypedPropertyValue "ternary" |> Option.defaultValue (Ternary.init ()) |> Ternary.style ( Domain = LayoutObjects.Domain.init (Row = rowIndex - 1, Column = colIndex - 1) ) - let allTernaries = Layout.getTernaries layout |> Seq.map fst + let allTernaries = Layout.getTernaries layout |> Array.map fst // remove all ternary subplots from layout. Only one ternary subplot is supported per grid cell, and leaving anything else on this layout may lead to property name clashes on combine. - allTernaries |> Seq.iter (fun propName -> layout.Remove(propName) |> ignore) + allTernaries |> Array.iter (fun propName -> layout.RemoveProperty(propName) |> ignore) let ternaryAnchor = StyleParam.SubPlotId.Ternary(i + 1) @@ -3612,7 +3608,7 @@ type Chart = let layout = GenericChart.getLayout ch - layout.TryGetTypedValue>("images") + layout.TryGetTypedPropertyValue>("images") |> Option.defaultValue Seq.empty |> Seq.append images @@ -3647,7 +3643,7 @@ type Chart = let layout = GenericChart.getLayout ch - layout.TryGetTypedValue>("updatemenus") + layout.TryGetTypedPropertyValue>("updatemenus") |> Option.defaultValue Seq.empty |> Seq.append updateMenus diff --git a/src/Plotly.NET/ChartAPI/GenericChart.fs b/src/Plotly.NET/ChartAPI/GenericChart.fs index 8bcf86fb0..e8c9ad6bc 100644 --- a/src/Plotly.NET/ChartAPI/GenericChart.fs +++ b/src/Plotly.NET/ChartAPI/GenericChart.fs @@ -162,7 +162,7 @@ type GenericChart = /// the input GenericChart to get the layout size from static member tryGetLayoutSize gChart = let layout = GenericChart.getLayout gChart - layout.TryGetTypedValue "width", layout.TryGetTypedValue "height" + layout.TryGetTypedPropertyValue "width", layout.TryGetTypedPropertyValue "height" /// /// Returns the config of a given GenericChart. diff --git a/src/Plotly.NET/CommonAbstractions/AutoRangeOptions.fs b/src/Plotly.NET/CommonAbstractions/AutoRangeOptions.fs index 6065e752a..be571d0f2 100644 --- a/src/Plotly.NET/CommonAbstractions/AutoRangeOptions.fs +++ b/src/Plotly.NET/CommonAbstractions/AutoRangeOptions.fs @@ -52,10 +52,10 @@ type AutoRangeOptions() = ) = (fun (autoRangeOptions: AutoRangeOptions) -> - ClipMax |> DynObj.setValueOpt autoRangeOptions "clipmax" - ClipMin |> DynObj.setValueOpt autoRangeOptions "clipmin" - Include |> DynObj.setValueOpt autoRangeOptions "include" - MaxAllowed |> DynObj.setValueOpt autoRangeOptions "maxallowed" - MinAllowed |> DynObj.setValueOpt autoRangeOptions "minallowed" - - autoRangeOptions) \ No newline at end of file + autoRangeOptions + |> DynObj.withOptionalProperty "clipmax" ClipMax + |> DynObj.withOptionalProperty "clipmin" ClipMin + |> DynObj.withOptionalProperty "include" Include + |> DynObj.withOptionalProperty "maxallowed" MaxAllowed + |> DynObj.withOptionalProperty "minallowed" MinAllowed + ) \ No newline at end of file diff --git a/src/Plotly.NET/CommonAbstractions/ColorBar.fs b/src/Plotly.NET/CommonAbstractions/ColorBar.fs index 91bc1475c..1451213bc 100644 --- a/src/Plotly.NET/CommonAbstractions/ColorBar.fs +++ b/src/Plotly.NET/CommonAbstractions/ColorBar.fs @@ -254,52 +254,52 @@ type ColorBar() = ) = (fun (colorBar: ColorBar) -> + colorBar + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "bordercolor" BorderColor + |> DynObj.withOptionalProperty "borderwidth" BorderWidth + |> DynObj.withOptionalProperty "dtick" DTick + |> DynObj.withOptionalPropertyBy "exponentformat" ExponentFormat StyleParam.ExponentFormat.convert + |> DynObj.withOptionalProperty "labelalias" LabelAlias + |> DynObj.withOptionalProperty "len" Len + |> DynObj.withOptionalPropertyBy "lenmode" LenMode StyleParam.UnitMode.convert + |> DynObj.withOptionalProperty "min3xponent" MinExponent + |> DynObj.withOptionalProperty "nticks" NTicks + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "outlinecolor" OutlineColor + |> DynObj.withOptionalProperty "outlinewidth" OutlineWidth + |> DynObj.withOptionalProperty "separatethousands" SeparateThousands + |> DynObj.withOptionalPropertyBy "showexponent" ShowExponent StyleParam.ShowExponent.convert + |> DynObj.withOptionalProperty "showticklabels" ShowTickLabels + |> DynObj.withOptionalPropertyBy "showtickprefix" ShowTickPrefix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalPropertyBy "showticksuffix" ShowTickSuffix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalProperty "thickness" Thickness + |> DynObj.withOptionalPropertyBy "thicknessmode" ThicknessMode StyleParam.UnitMode.convert + |> DynObj.withOptionalProperty "tick0" Tick0 + |> DynObj.withOptionalProperty "tickangle" TickAngle + |> DynObj.withOptionalProperty "tickcolor" TickColor + |> DynObj.withOptionalProperty "tickfont" TickFont + |> DynObj.withOptionalProperty "tickformat" TickFormat + |> DynObj.withOptionalProperty "tickformatstops" TickFormatStops + |> DynObj.withOptionalPropertyBy "ticklabeloverflow" TickLabelOverflow StyleParam.TickLabelOverflow.convert + |> DynObj.withOptionalPropertyBy "ticklabelposition" TickLabelPosition StyleParam.TickLabelPosition.convert + |> DynObj.withOptionalProperty "ticklabelstep" TickLabelStep + |> DynObj.withOptionalProperty "ticklen" TickLen + |> DynObj.withOptionalPropertyBy "tickmode" TickMode StyleParam.TickMode.convert + |> DynObj.withOptionalProperty "tickprefix" TickPrefix + |> DynObj.withOptionalPropertyBy "ticks" Ticks StyleParam.TickOptions.convert + |> DynObj.withOptionalProperty "ticksuffix" TickSuffix + |> DynObj.withOptionalProperty "ticktext" TickText + |> DynObj.withOptionalProperty "tickvals" TickVals + |> DynObj.withOptionalProperty "tickwidth" TickWidth + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.HorizontalAlign.convert + |> DynObj.withOptionalProperty "xpad" XPad + |> DynObj.withOptionalProperty "xref" XRef + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.VerticalAlign.convert + |> DynObj.withOptionalProperty "ypad" YPad + |> DynObj.withOptionalProperty "yref" YRef - BGColor |> DynObj.setValueOpt colorBar "bgcolor" - BorderColor |> DynObj.setValueOpt colorBar "bordercolor" - BorderWidth |> DynObj.setValueOpt colorBar "borderwidth" - DTick |> DynObj.setValueOpt colorBar "dtick" - ExponentFormat |> DynObj.setValueOptBy colorBar "exponentformat" StyleParam.ExponentFormat.convert - LabelAlias |> DynObj.setValueOpt colorBar "labelalias" - Len |> DynObj.setValueOpt colorBar "len" - LenMode |> DynObj.setValueOptBy colorBar "lenmode" StyleParam.UnitMode.convert - MinExponent |> DynObj.setValueOpt colorBar "min3xponent" - NTicks |> DynObj.setValueOpt colorBar "nticks" - Orientation |> DynObj.setValueOptBy colorBar "orientation" StyleParam.Orientation.convert - OutlineColor |> DynObj.setValueOpt colorBar "outlinecolor" - OutlineWidth |> DynObj.setValueOpt colorBar "outlinewidth" - SeparateThousands |> DynObj.setValueOpt colorBar "separatethousands" - ShowExponent |> DynObj.setValueOptBy colorBar "showexponent" StyleParam.ShowExponent.convert - ShowTickLabels |> DynObj.setValueOpt colorBar "showticklabels" - ShowTickPrefix |> DynObj.setValueOptBy colorBar "showtickprefix" StyleParam.ShowTickOption.convert - ShowTickSuffix |> DynObj.setValueOptBy colorBar "showticksuffix" StyleParam.ShowTickOption.convert - Thickness |> DynObj.setValueOpt colorBar "thickness" - ThicknessMode |> DynObj.setValueOptBy colorBar "thicknessmode" StyleParam.UnitMode.convert - Tick0 |> DynObj.setValueOpt colorBar "tick0" - TickAngle |> DynObj.setValueOpt colorBar "tickangle" - TickColor |> DynObj.setValueOpt colorBar "tickcolor" - TickFont |> DynObj.setValueOpt colorBar "tickfont" - TickFormat |> DynObj.setValueOpt colorBar "tickformat" - TickFormatStops |> DynObj.setValueOpt colorBar "tickformatstops" - TickLabelOverflow |> DynObj.setValueOptBy colorBar "ticklabeloverflow" StyleParam.TickLabelOverflow.convert - TickLabelPosition |> DynObj.setValueOptBy colorBar "ticklabelposition" StyleParam.TickLabelPosition.convert - TickLabelStep |> DynObj.setValueOpt colorBar "ticklabelstep" - TickLen |> DynObj.setValueOpt colorBar "ticklen" - TickMode |> DynObj.setValueOptBy colorBar "tickmode" StyleParam.TickMode.convert - TickPrefix |> DynObj.setValueOpt colorBar "tickprefix" - Ticks |> DynObj.setValueOptBy colorBar "ticks" StyleParam.TickOptions.convert - TickSuffix |> DynObj.setValueOpt colorBar "ticksuffix" - TickText |> DynObj.setValueOpt colorBar "ticktext" - TickVals |> DynObj.setValueOpt colorBar "tickvals" - TickWidth |> DynObj.setValueOpt colorBar "tickwidth" - Title |> DynObj.setValueOpt colorBar "title" - X |> DynObj.setValueOpt colorBar "x" - XAnchor |> DynObj.setValueOptBy colorBar "xanchor" StyleParam.HorizontalAlign.convert - XPad |> DynObj.setValueOpt colorBar "xpad" - XRef |> DynObj.setValueOpt colorBar "xref" - Y |> DynObj.setValueOpt colorBar "y" - YAnchor |> DynObj.setValueOptBy colorBar "yanchor" StyleParam.VerticalAlign.convert - YPad |> DynObj.setValueOpt colorBar "ypad" - YRef |> DynObj.setValueOpt colorBar "yref" - - colorBar) + ) diff --git a/src/Plotly.NET/CommonAbstractions/Font.fs b/src/Plotly.NET/CommonAbstractions/Font.fs index fd4852979..8b208f958 100644 --- a/src/Plotly.NET/CommonAbstractions/Font.fs +++ b/src/Plotly.NET/CommonAbstractions/Font.fs @@ -26,9 +26,8 @@ type Font() = [] ?Color: Color ) = (fun (font: Font) -> - - Family |> DynObj.setValueOptBy font "family" StyleParam.FontFamily.toString - Size |> DynObj.setValueOpt font "size" - Color |> DynObj.setValueOpt font "color" - - font) + font + |> DynObj.withOptionalPropertyBy "family" Family StyleParam.FontFamily.toString + |> DynObj.withOptionalProperty "size" Size + |> DynObj.withOptionalProperty "color" Color + ) diff --git a/src/Plotly.NET/CommonAbstractions/Line.fs b/src/Plotly.NET/CommonAbstractions/Line.fs index f9991a2d8..6d5e9d257 100644 --- a/src/Plotly.NET/CommonAbstractions/Line.fs +++ b/src/Plotly.NET/CommonAbstractions/Line.fs @@ -125,25 +125,26 @@ type Line() = [] ?OutlierWidth: float ) = (fun (line: Line) -> - BackOff |> DynObj.setValueOptBy line "backoff" StyleParam.BackOff.convert - Color |> DynObj.setValueOpt line "color" - (Width, MultiWidth) |> DynObj.setSingleOrMultiOpt line "width" - Shape |> DynObj.setValueOptBy line "shape" StyleParam.Shape.convert - Smoothing |> DynObj.setValueOpt line "smoothing" - Dash |> DynObj.setValueOptBy line "dash" StyleParam.DrawingStyle.convert - OutlierColor |> DynObj.setValueOpt line "outliercolor" - OutlierWidth |> DynObj.setValueOpt line "outlierwidth" - AutoColorScale |> DynObj.setValueOpt line "autocolorscale" - CAuto |> DynObj.setValueOpt line "cauto" - CMax |> DynObj.setValueOpt line "cmax" - CMid |> DynObj.setValueOpt line "cmid" - CMin |> DynObj.setValueOpt line "cmin" - Color |> DynObj.setValueOpt line "color" - ColorAxis |> DynObj.setValueOptBy line "coloraxis" StyleParam.SubPlotId.convert - Colorscale |> DynObj.setValueOptBy line "colorscale" StyleParam.Colorscale.convert - ReverseScale |> DynObj.setValueOpt line "reversescale" - ShowScale |> DynObj.setValueOpt line "showscale" - ColorBar |> DynObj.setValueOpt line "colorbar" - Simplify |> DynObj.setValueOpt line "simplify" + line + |> DynObj.withOptionalPropertyBy "backoff" BackOff StyleParam.BackOff.convert + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalSingleOrMultiProperty "width" (Width, MultiWidth) + |> DynObj.withOptionalPropertyBy "shape" Shape StyleParam.Shape.convert + |> DynObj.withOptionalProperty "smoothing" Smoothing + |> DynObj.withOptionalPropertyBy "dash" Dash StyleParam.DrawingStyle.convert + |> DynObj.withOptionalProperty "outliercolor" OutlierColor + |> DynObj.withOptionalProperty "outlierwidth" OutlierWidth + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalProperty "cauto" CAuto + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalProperty "cmid" CMid + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalPropertyBy "colorscale" Colorscale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "simplify" Simplify - line) + ) diff --git a/src/Plotly.NET/CommonAbstractions/Padding.fs b/src/Plotly.NET/CommonAbstractions/Padding.fs index 53d71900b..708d710f9 100644 --- a/src/Plotly.NET/CommonAbstractions/Padding.fs +++ b/src/Plotly.NET/CommonAbstractions/Padding.fs @@ -37,8 +37,9 @@ type Padding() = [] ?T: int ) = (fun (padding: Padding) -> - B |> DynObj.setValueOpt padding "b" - L |> DynObj.setValueOpt padding "l" - R |> DynObj.setValueOpt padding "r" - T |> DynObj.setValueOpt padding "t" - padding) + padding + |> DynObj.withOptionalProperty "b" B + |> DynObj.withOptionalProperty "l" L + |> DynObj.withOptionalProperty "r" R + |> DynObj.withOptionalProperty "t" T + ) diff --git a/src/Plotly.NET/CommonAbstractions/TickFormatStop.fs b/src/Plotly.NET/CommonAbstractions/TickFormatStop.fs index 358e7589a..684d7ad58 100644 --- a/src/Plotly.NET/CommonAbstractions/TickFormatStop.fs +++ b/src/Plotly.NET/CommonAbstractions/TickFormatStop.fs @@ -35,11 +35,10 @@ type TickFormatStop() = ) = (fun (tickFormatStop: TickFormatStop) -> - Enabled |> DynObj.setValueOpt tickFormatStop "enabled" - DTickRange |> DynObj.setValueOpt tickFormatStop "dtickrange" - Value |> DynObj.setValueOpt tickFormatStop "value" - Name |> DynObj.setValueOpt tickFormatStop "name" - TemplateItemName |> DynObj.setValueOpt tickFormatStop "templateitemname" - - - tickFormatStop) + tickFormatStop + |> DynObj.withOptionalProperty "enabled" Enabled + |> DynObj.withOptionalProperty "dtickrange" DTickRange + |> DynObj.withOptionalProperty "value" Value + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + ) diff --git a/src/Plotly.NET/CommonAbstractions/Title.fs b/src/Plotly.NET/CommonAbstractions/Title.fs index aee71e189..d26184e68 100644 --- a/src/Plotly.NET/CommonAbstractions/Title.fs +++ b/src/Plotly.NET/CommonAbstractions/Title.fs @@ -87,19 +87,18 @@ type Title() = // For colorbar titles [] ?Side: StyleParam.Side ) = - (fun (title: Title) -> - - Text |> DynObj.setValueOpt title "text" - Font |> DynObj.setValueOpt title "font" - AutoMargin |> DynObj.setValueOpt title "automargin" - Pad |> DynObj.setValueOpt title "pad" - X |> DynObj.setValueOpt title "x" - XAnchor |> DynObj.setValueOptBy title "xanchor" StyleParam.XAnchorPosition.convert - XRef |> DynObj.setValueOpt title "xref" - Y |> DynObj.setValueOpt title "y" - YAnchor |> DynObj.setValueOptBy title "yanchor" StyleParam.YAnchorPosition.convert - YRef |> DynObj.setValueOpt title "yref" - Standoff |> DynObj.setValueOpt title "standoff" - Side |> DynObj.setValueOptBy title "side" StyleParam.Side.convert - - title) + (fun (title: Title) -> + title + |> DynObj.withOptionalProperty "text" Text + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "automargin" AutoMargin + |> DynObj.withOptionalProperty "pad" Pad + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.XAnchorPosition.convert + |> DynObj.withOptionalProperty "xref" XRef + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.YAnchorPosition.convert + |> DynObj.withOptionalProperty "yref" YRef + |> DynObj.withOptionalProperty "standoff" Standoff + |> DynObj.withOptionalPropertyBy "side" Side StyleParam.Side.convert + ) diff --git a/src/Plotly.NET/Config/Config.fs b/src/Plotly.NET/Config/Config.fs index 6df593e88..c6c85d149 100644 --- a/src/Plotly.NET/Config/Config.fs +++ b/src/Plotly.NET/Config/Config.fs @@ -261,58 +261,47 @@ type Config() = [] ?Locales: obj ) = fun (config: Config) -> - - StaticPlot |> DynObj.setValueOpt config "staticPlot" - TypesetMath |> DynObj.setValueOpt config "typesetMath" - PlotlyServerUrl |> DynObj.setValueOpt config "plotlyServerUrl" - Editable |> DynObj.setValueOpt config "editable" - Edits |> DynObj.setValueOpt config "edits" - EditSelection |> DynObj.setValueOpt config "editSelection" - Autosizable |> DynObj.setValueOpt config "autosizable" - Responsive |> DynObj.setValueOpt config "responsive" - FillFrame |> DynObj.setValueOpt config "fillFrame" - FrameMargins |> DynObj.setValueOpt config "frameMargins" - ScrollZoom |> DynObj.setValueOptBy config "scrollZoom" StyleParam.ScrollZoom.convert - DoubleClick |> DynObj.setValueOptBy config "doubleClick" StyleParam.DoubleClick.convert - DoubleClickDelay |> DynObj.setValueOpt config "doubleClickDelay" - ShowAxisDragHandles |> DynObj.setValueOpt config "showAxisDragHandles" - ShowAxisRangeEntryBoxes |> DynObj.setValueOpt config "showAxisRangeEntryBoxes" - ShowTips |> DynObj.setValueOpt config "showTips" - ShowLink |> DynObj.setValueOpt config "showLink" - LinkText |> DynObj.setValueOpt config "linkText" - SendData |> DynObj.setValueOpt config "sendData" - ShowSources |> DynObj.setValueOpt config "showSources" - DisplayModeBar |> DynObj.setValueOpt config "displayModeBar" - ShowSendToCloud |> DynObj.setValueOpt config "showSendToCloud" - ShowEditInChartStudio |> DynObj.setValueOpt config "showEditInChartStudio" - - ModeBarButtonsToRemove - |> DynObj.setValueOptBy config "modeBarButtonsToRemove" (fun x -> - x |> Seq.map StyleParam.ModeBarButton.toString) - - ModeBarButtonsToAdd - |> DynObj.setValueOptBy config "modeBarButtonsToAdd" (fun x -> - x |> Seq.map StyleParam.ModeBarButton.toString) - - ModeBarButtons - |> DynObj.setValueOptBy config "modeBarButtons" (fun x -> - x |> Seq.map (Seq.map StyleParam.ModeBarButton.toString)) - - ToImageButtonOptions |> DynObj.setValueOpt config "toImageButtonOptions" - Displaylogo |> DynObj.setValueOpt config "displaylogo" - Watermark |> DynObj.setValueOpt config "watermark" - plotGlPixelRatio |> DynObj.setValueOpt config "plotGlPixelRatio" - SetBackground |> DynObj.setValueOpt config "setBackground" - TopojsonURL |> DynObj.setValueOpt config "topojsonURL" - MapboxAccessToken |> DynObj.setValueOpt config "mapboxAccessToken" - Logging |> DynObj.setValueOpt config "logging" - NotifyOnLogging |> DynObj.setValueOpt config "notifyOnLogging" - QueueLength |> DynObj.setValueOpt config "queueLength" - GlobalTransforms |> DynObj.setValueOpt config "globalTransforms" - Locale |> DynObj.setValueOpt config "locale" - Locales |> DynObj.setValueOpt config "locales" - + config + |> DynObj.withOptionalProperty "staticPlot" StaticPlot + |> DynObj.withOptionalProperty "typesetMath" TypesetMath + |> DynObj.withOptionalProperty "plotlyServerUrl" PlotlyServerUrl + |> DynObj.withOptionalProperty "editable" Editable + |> DynObj.withOptionalProperty "edits" Edits + |> DynObj.withOptionalProperty "editSelection" EditSelection + |> DynObj.withOptionalProperty "autosizable" Autosizable + |> DynObj.withOptionalProperty "responsive" Responsive + |> DynObj.withOptionalProperty "fillFrame" FillFrame + |> DynObj.withOptionalProperty "frameMargins" FrameMargins + |> DynObj.withOptionalPropertyBy "scrollZoom" ScrollZoom StyleParam.ScrollZoom.convert + |> DynObj.withOptionalPropertyBy "doubleClick" DoubleClick StyleParam.DoubleClick.convert + |> DynObj.withOptionalProperty "doubleClickDelay" DoubleClickDelay + |> DynObj.withOptionalProperty "showAxisDragHandles" ShowAxisDragHandles + |> DynObj.withOptionalProperty "showAxisRangeEntryBoxes"ShowAxisRangeEntryBoxes + |> DynObj.withOptionalProperty "showTips" ShowTips + |> DynObj.withOptionalProperty "showLink" ShowLink + |> DynObj.withOptionalProperty "linkText" LinkText + |> DynObj.withOptionalProperty "sendData" SendData + |> DynObj.withOptionalProperty "showSources" ShowSources + |> DynObj.withOptionalProperty "displayModeBar" DisplayModeBar + |> DynObj.withOptionalProperty "showSendToCloud" ShowSendToCloud + |> DynObj.withOptionalProperty "showEditInChartStudio" ShowEditInChartStudio + |> DynObj.withOptionalPropertyBy "modeBarButtonsToRemove" ModeBarButtonsToRemove (fun x -> x |> Seq.map StyleParam.ModeBarButton.toString) + |> DynObj.withOptionalPropertyBy "modeBarButtonsToAdd" ModeBarButtonsToAdd (fun x -> x |> Seq.map StyleParam.ModeBarButton.toString) + |> DynObj.withOptionalPropertyBy "modeBarButtons" ModeBarButtons (fun x -> x |> Seq.map (Seq.map StyleParam.ModeBarButton.toString)) + |> DynObj.withOptionalProperty "toImageButtonOptions" ToImageButtonOptions + |> DynObj.withOptionalProperty "displaylogo" Displaylogo + |> DynObj.withOptionalProperty "watermark" Watermark + |> DynObj.withOptionalProperty "plotGlPixelRatio" plotGlPixelRatio + |> DynObj.withOptionalProperty "setBackground" SetBackground + |> DynObj.withOptionalProperty "topojsonURL" TopojsonURL + |> DynObj.withOptionalProperty "mapboxAccessToken" MapboxAccessToken + |> DynObj.withOptionalProperty "logging" Logging + |> DynObj.withOptionalProperty "notifyOnLogging" NotifyOnLogging + |> DynObj.withOptionalProperty "queueLength" QueueLength + |> DynObj.withOptionalProperty "globalTransforms" GlobalTransforms + |> DynObj.withOptionalProperty "locale" Locale + |> DynObj.withOptionalProperty "locales" Locales /// /// Combines two Config objects. @@ -331,21 +320,21 @@ type Config() = let modeBarButtonsToRemove = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>("modeBarButtonsToRemove")) - (second.TryGetTypedValue>("modeBarButtonsToRemove")) + (first.TryGetTypedPropertyValue>("modeBarButtonsToRemove")) + (second.TryGetTypedPropertyValue>("modeBarButtonsToRemove")) let modeBarButtonsToAdd = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>("modeBarButtonsToAdd")) - (second.TryGetTypedValue>("modeBarButtonsToAdd")) + (first.TryGetTypedPropertyValue>("modeBarButtonsToAdd")) + (second.TryGetTypedPropertyValue>("modeBarButtonsToAdd")) let modeBarButtons = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>>("modeBarButtons")) - (second.TryGetTypedValue>>("modeBarButtons")) + (first.TryGetTypedPropertyValue>>("modeBarButtons")) + (second.TryGetTypedPropertyValue>>("modeBarButtons")) DynObj.combine first second - |> unbox + |> unbox |> Config.style ( ?ModeBarButtonsToRemove = (modeBarButtonsToRemove |> Option.map (Seq.map StyleParam.ModeBarButton.ofString)), ?ModeBarButtonsToAdd = (modeBarButtonsToAdd |> Option.map (Seq.map StyleParam.ModeBarButton.ofString)), diff --git a/src/Plotly.NET/Config/ObjectAbstractions/Edits.fs b/src/Plotly.NET/Config/ObjectAbstractions/Edits.fs index e2e6aea01..ba4eb9d64 100644 --- a/src/Plotly.NET/Config/ObjectAbstractions/Edits.fs +++ b/src/Plotly.NET/Config/ObjectAbstractions/Edits.fs @@ -78,15 +78,14 @@ type Edits() = [] ?TitleText: bool ) = fun (edits: Edits) -> - AnnotationPosition |> DynObj.setValueOpt edits "annotationPosition" - AnnotationTail |> DynObj.setValueOpt edits "annotationTail" - AnnotationText |> DynObj.setValueOpt edits "annotationText" - AxisTitleText |> DynObj.setValueOpt edits "axisTitleText" - ColorbarPosition |> DynObj.setValueOpt edits "colorbarPosition" - ColorbarTitleText |> DynObj.setValueOpt edits "colorbarTitleText" - LegendPosition |> DynObj.setValueOpt edits "legendPosition" - LegendText |> DynObj.setValueOpt edits "legendText" - ShapePosition |> DynObj.setValueOpt edits "shapePosition" - TitleText |> DynObj.setValueOpt edits "titleText" - edits + |> DynObj.withOptionalProperty "annotationPosition" AnnotationPosition + |> DynObj.withOptionalProperty "annotationTail" AnnotationTail + |> DynObj.withOptionalProperty "annotationText" AnnotationText + |> DynObj.withOptionalProperty "axisTitleText" AxisTitleText + |> DynObj.withOptionalProperty "colorbarPosition" ColorbarPosition + |> DynObj.withOptionalProperty "colorbarTitleText" ColorbarTitleText + |> DynObj.withOptionalProperty "legendPosition" LegendPosition + |> DynObj.withOptionalProperty "legendText" LegendText + |> DynObj.withOptionalProperty "shapePosition" ShapePosition + |> DynObj.withOptionalProperty "titleText" TitleText diff --git a/src/Plotly.NET/Config/ObjectAbstractions/ToImageButtonOptions.fs b/src/Plotly.NET/Config/ObjectAbstractions/ToImageButtonOptions.fs index f41d0926c..1e15ac826 100644 --- a/src/Plotly.NET/Config/ObjectAbstractions/ToImageButtonOptions.fs +++ b/src/Plotly.NET/Config/ObjectAbstractions/ToImageButtonOptions.fs @@ -35,9 +35,9 @@ type ToImageButtonOptions() = [] ?Scale ) = fun (btnConf: ToImageButtonOptions) -> - Format |> Option.map StyleParam.ImageFormat.toString |> DynObj.setValueOpt btnConf "format" - Filename |> DynObj.setValueOpt btnConf "filename" - Width |> DynObj.setValueOpt btnConf "width" - Height |> DynObj.setValueOpt btnConf "height" - Scale |> DynObj.setValueOpt btnConf "scale" btnConf + |> DynObj.withOptionalPropertyBy "format" Format StyleParam.ImageFormat.toString + |> DynObj.withOptionalProperty "filename" Filename + |> DynObj.withOptionalProperty "width" Width + |> DynObj.withOptionalProperty "height" Height + |> DynObj.withOptionalProperty "scale" Scale diff --git a/src/Plotly.NET/Defaults.fs b/src/Plotly.NET/Defaults.fs index 3ee2a18e7..7bd88a9ef 100644 --- a/src/Plotly.NET/Defaults.fs +++ b/src/Plotly.NET/Defaults.fs @@ -4,7 +4,6 @@ open Plotly.NET open Plotly.NET.LayoutObjects open DynamicObj -open DynamicObj.Operators open System.Runtime.InteropServices open Giraffe.ViewEngine diff --git a/src/Plotly.NET/DisplayOptions/DisplayOptions.fs b/src/Plotly.NET/DisplayOptions/DisplayOptions.fs index 34808e356..27bf82029 100644 --- a/src/Plotly.NET/DisplayOptions/DisplayOptions.fs +++ b/src/Plotly.NET/DisplayOptions/DisplayOptions.fs @@ -62,17 +62,15 @@ type DisplayOptions() = [] ?ChartDescription: XmlNode list, [] ?PlotlyJSReference: PlotlyJSReference ) = - (fun (displayOpts: DisplayOptions) -> - - DocumentTitle |> DynObj.setValueOpt displayOpts "DocumentTitle" - DocumentCharset |> DynObj.setValueOpt displayOpts "DocumentCharset" - DocumentDescription |> DynObj.setValueOpt displayOpts "DocumentDescription" - DocumentFavicon |> DynObj.setValueOpt displayOpts "DocumentFavicon" - AdditionalHeadTags |> DynObj.setValueOpt displayOpts "AdditionalHeadTags" - ChartDescription |> DynObj.setValueOpt displayOpts "ChartDescription" - PlotlyJSReference |> DynObj.setValueOpt displayOpts "PlotlyJSReference" - - displayOpts) + fun (displayOpts: DisplayOptions) -> + displayOpts + |> DynObj.withOptionalProperty "DocumentTitle" DocumentTitle + |> DynObj.withOptionalProperty "DocumentCharset" DocumentCharset + |> DynObj.withOptionalProperty "DocumentDescription" DocumentDescription + |> DynObj.withOptionalProperty "DocumentFavicon" DocumentFavicon + |> DynObj.withOptionalProperty "AdditionalHeadTags" AdditionalHeadTags + |> DynObj.withOptionalProperty "ChartDescription" ChartDescription + |> DynObj.withOptionalProperty "PlotlyJSReference" PlotlyJSReference /// /// Returns a DisplayOptions Object with the plotly cdn set to Globals.PLOTLYJS_VERSION @@ -100,16 +98,16 @@ type DisplayOptions() = let additionalHeadTags = InternalUtils.combineOptLists - (first.TryGetTypedValue("AdditionalHeadTags")) - (second.TryGetTypedValue("AdditionalHeadTags")) + (first.TryGetTypedPropertyValue("AdditionalHeadTags")) + (second.TryGetTypedPropertyValue("AdditionalHeadTags")) let description = InternalUtils.combineOptLists - (first.TryGetTypedValue("ChartDescription")) - (second.TryGetTypedValue("ChartDescription")) + (first.TryGetTypedPropertyValue("ChartDescription")) + (second.TryGetTypedPropertyValue("ChartDescription")) DynObj.combine first second - |> unbox + |> unbox |> DisplayOptions.style (?AdditionalHeadTags = additionalHeadTags, ?ChartDescription = description) /// @@ -117,16 +115,15 @@ type DisplayOptions() = /// /// The document title to set on the given DisplayOptions object static member setDocumentTitle(documentTitle: string) = - (fun (displayOpts: DisplayOptions) -> - documentTitle |> DynObj.setValue displayOpts "DocumentTitle" - displayOpts) + fun (displayOpts: DisplayOptions) -> + displayOpts |> DynObj.withProperty "DocumentTitle" documentTitle /// /// Returns Some document title from the given DisplayOptions object if it exists, None otherwise /// /// The DisplayOptions object to get the document title from static member tryGetDocumentTitle(displayOpts: DisplayOptions) = - displayOpts.TryGetTypedValue("DocumentTitle") + displayOpts.TryGetTypedPropertyValue("DocumentTitle") /// /// Returns the document title from the given DisplayOptions object if it exists, an empty string otherwise @@ -140,16 +137,16 @@ type DisplayOptions() = /// /// The document charset to set on the given DisplayOptions object static member setDocumentCharset(documentCharset: string) = - (fun (displayOpts: DisplayOptions) -> - documentCharset |> DynObj.setValue displayOpts "DocumentCharset" - displayOpts) + fun (displayOpts: DisplayOptions) -> + displayOpts |> DynObj.withProperty "DocumentCharset" documentCharset + /// /// Returns Some document charset from the given DisplayOptions object if it exists, None otherwise /// /// The DisplayOptions object to get the document charset from static member tryGetDocumentCharset(displayOpts: DisplayOptions) = - displayOpts.TryGetTypedValue("DocumentCharset") + displayOpts.TryGetTypedPropertyValue("DocumentCharset") /// /// Returns the document charset from the given DisplayOptions object if it exists, an empty string otherwise @@ -163,16 +160,16 @@ type DisplayOptions() = /// /// The document description to set on the given DisplayOptions object static member setDocumentDescription(documentDescription: string) = - (fun (displayOpts: DisplayOptions) -> - documentDescription |> DynObj.setValue displayOpts "DocumentDescription" - displayOpts) + fun (displayOpts: DisplayOptions) -> + displayOpts |> DynObj.withProperty "DocumentDescription" documentDescription + /// /// Returns Some document description from the given DisplayOptions object if it exists, None otherwise /// /// The DisplayOptions object to get the document description from static member tryGetDocumentDescription(displayOpts: DisplayOptions) = - displayOpts.TryGetTypedValue("DocumentDescription") + displayOpts.TryGetTypedPropertyValue("DocumentDescription") /// /// Returns the document description from the given DisplayOptions object if it exists, an empty string otherwise @@ -186,16 +183,15 @@ type DisplayOptions() = /// /// The document favicon to set on the given DisplayOptions object static member setDocumentFavicon(documentFavicon: XmlNode) = - (fun (displayOpts: DisplayOptions) -> - documentFavicon |> DynObj.setValue displayOpts "DocumentFavicon" - displayOpts) + fun (displayOpts: DisplayOptions) -> + displayOpts |> DynObj.withProperty "DocumentFavicon" documentFavicon /// /// Returns Some document favicon from the given DisplayOptions object if it exists, None otherwise /// /// static member tryGetDocumentFavicon(displayOpts: DisplayOptions) = - displayOpts.TryGetTypedValue("DocumentFavicon") + displayOpts.TryGetTypedPropertyValue("DocumentFavicon") /// /// Returns the document favicon from the given DisplayOptions object if it exists, an empty XML Node otherwise @@ -209,16 +205,16 @@ type DisplayOptions() = /// /// The additional head tags to set on the given DisplayOptions object static member setAdditionalHeadTags(additionalHeadTags: XmlNode list) = - (fun (displayOpts: DisplayOptions) -> - additionalHeadTags |> DynObj.setValue displayOpts "AdditionalHeadTags" - displayOpts) + fun (displayOpts: DisplayOptions) -> + displayOpts |> DynObj.withProperty "AdditionalHeadTags" additionalHeadTags + /// /// Returns Some additional head tags from the given DisplayOptions object if they exist, None otherwise /// /// The DisplayOptions object to get the additional head tags from static member tryGetAdditionalHeadTags(displayOpts: DisplayOptions) = - displayOpts.TryGetTypedValue("AdditionalHeadTags") + displayOpts.TryGetTypedPropertyValue("AdditionalHeadTags") /// /// Returns the additional head tags from the given DisplayOptions object if they exist, an empty list otherwise @@ -243,16 +239,16 @@ type DisplayOptions() = /// /// The chart chart description to set on the given DisplayOptions object static member setChartDescription(chartDescription: XmlNode list) = - (fun (displayOpts: DisplayOptions) -> - chartDescription |> DynObj.setValue displayOpts "ChartDescription" - displayOpts) + fun (displayOpts: DisplayOptions) -> + displayOpts |> DynObj.withProperty "ChartDescription" chartDescription + /// /// Returns Some chart description from the given DisplayOptions object if it exists, None otherwise /// /// The DisplayOptions object to get the chart description from static member tryGetChartDescription(displayOpts: DisplayOptions) = - displayOpts.TryGetTypedValue("ChartDescription") + displayOpts.TryGetTypedPropertyValue("ChartDescription") /// /// Returns the chart description from the given DisplayOptions object if it exists, an empty list otherwise @@ -275,16 +271,15 @@ type DisplayOptions() = /// /// The reference to a plotly.js source to set on the given DisplayOptions object static member setPlotlyReference(plotlyReference: PlotlyJSReference) = - (fun (displayOpts: DisplayOptions) -> - plotlyReference |> DynObj.setValue displayOpts "PlotlyJSReference" - displayOpts) + fun (displayOpts: DisplayOptions) -> + displayOpts |> DynObj.withProperty "PlotlyJSReference" plotlyReference /// /// Returns Some reference to a plotly.js source from the given DisplayOptions object if it exists, None otherwise /// /// The DisplayOptions object to get the reference to a plotly.js source from static member tryGetPlotlyReference(displayOpts: DisplayOptions) = - displayOpts.TryGetTypedValue("PlotlyJSReference") + displayOpts.TryGetTypedPropertyValue("PlotlyJSReference") /// /// Returns the reference to a plotly.js source from the given DisplayOptions object if it exists, NoReference otherwise diff --git a/src/Plotly.NET/Globals.fs b/src/Plotly.NET/Globals.fs index 86934d902..fbe2cac6e 100644 --- a/src/Plotly.NET/Globals.fs +++ b/src/Plotly.NET/Globals.fs @@ -52,11 +52,11 @@ let LOGO_BASE64 = """iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAA1VBMVEVHcEwQnv+gCXURnf+gCXURnf8Rnf+gCXURnf+gCXWgCXURnf+gCHURnf+gCXURnf+gCXURnf+gCXUwke5YVbykBXEijO+gCXURnf8Rnf8Rnf8Rnf8Rnf8Rnf+gCXWIIoygCXUohekRnf8Rnf8Qn/+gCXUQnf8SoP////8ijO+PG4agAnGQLY6gEnrP7f94yP8aof8YwP/DY6jJcrDuz+RlwP/owt0Urv8k/v4e4v9Nr9F1XaSxMoyx3/9rc7Ayq/98UZ3gr9L8+v05rv9Fv9rF5/+7T52h9OprAAAAJHRSTlMAINTUgPmA+gYGNbu7NR9PR/xP/hoh/o74f471R3x8uie60TS1lKLVAAABzUlEQVRYw83X2XKCMBQGYOyK3RdL9x0ChVCkVAHFfXn/RyphKSIBE85Mp8woV/8HOUByIgj/+mg2yb8o1s4/nZHTw2NNobmzf0HOp/d7Ys18Apzv1hHCvJICqIZA8hnAL0T5FYBXiPOrAJ+Q5HMAj5Dm8wC78JtfA1iFLK8oeYBNWM1vvQitltB4QxxCLn8gXD2/NoTjbXZhLX9ypH8c8giFvKJLiEMo5gnALlDyEcAq0PIxwCZQ8wnAItDzKbBZKObNBJDlMCFvEor5YQ8buDfUJdt3kevb1QLl+j2vb4y9OZZ8z0a251feA238uG8qZh/rkmurSLXdqjrQ62eQn5EWsaqS9Dweh3ewDOI7aHdG5ULJ8yM1WE67cQ0604FaJqx/v0leGc6x8aV94+gpWNqiTR3FrShcU68fHqYSA3J47Qwgwnsm3NxtBtR2NVA2BKcbxIC1mFUOoaSIZldzIuDyU+tkAPtjoAMcLwIV4HkVaQDXx0ABOD9HZxIYwcTRJWswQrOBxT8hpBMKIi+xWmdK4pvS4JMqfFqHLyzwpQ2+uMKXd3iDAW9x4E0WvM2DN5rwVhfebMPbffiGA77lgW+64Ns++MYTvvX9m+MHc8vmMWg2fMUAAAAASUVORK5CYII=""" /// -let internal JSON_CONFIG = +let JSON_CONFIG = JsonSerializerSettings(ReferenceLoopHandling = ReferenceLoopHandling.Serialize) /// the mathjax v2 tags to add to html docs for rendering latex -let internal MATHJAX_V2_TAGS = +let MATHJAX_V2_TAGS = [ script [ @@ -76,7 +76,7 @@ let internal MATHJAX_V2_TAGS = ] /// the mathjax v3 tags to add to html docs for rendering latex -let internal MATHJAX_V3_TAGS = +let MATHJAX_V3_TAGS = [ script [] diff --git a/src/Plotly.NET/InternalUtils.fs b/src/Plotly.NET/InternalUtils.fs index 5b84168e3..c55db149e 100644 --- a/src/Plotly.NET/InternalUtils.fs +++ b/src/Plotly.NET/InternalUtils.fs @@ -33,41 +33,67 @@ let getFullPlotlyJS () = [] module DynObj = - let setSingleOrMultiOpt (dyn: #DynamicObj) (propName: string) (single: 'A option, multi: seq<'A> option) = + let setOptionalSingleOrMultiProperty (propName: string) (single: 'A option, multi: seq<'A> option) (dyn: #DynamicObj) = if multi.IsSome then - multi |> DynObj.setValueOpt dyn propName + dyn |> DynObj.setOptionalProperty propName multi else - single |> DynObj.setValueOpt dyn propName + dyn |> DynObj.setOptionalProperty propName single - let setSingleOrMultiOptBy - (dyn: #DynamicObj) + let inline withOptionalSingleOrMultiProperty (propName: string) (single: 'A option, multi: seq<'A> option) (dyn: #DynamicObj) = + dyn |> setOptionalSingleOrMultiProperty propName (single,multi) + dyn + + let setOptionalSingleOrMultiPropertyBy (propName: string) - (f: 'A -> 'B) (single: 'A option, multi: seq<'A> option) + (f: 'A -> 'B) + (dyn: #DynamicObj) = if multi.IsSome then - multi |> DynObj.setValueOptBy dyn propName (Seq.map f) + dyn |> DynObj.setOptionalPropertyBy propName multi (Seq.map f) else - single |> DynObj.setValueOptBy dyn propName f + dyn |> DynObj.setOptionalPropertyBy propName single f + + let inline withOptionalSingleOrMultiPropertyBy + (propName: string) + (single: 'A option, multi: seq<'A> option) + (f: 'A -> 'B) + (dyn: #DynamicObj) + = + dyn |> setOptionalSingleOrMultiPropertyBy propName (single,multi) f + dyn - let setSingleOrAnyOpt (dyn: #DynamicObj) (propName: string) (single: 'A option, any: 'B option) = + let setOptionalSingleOrAnyProperty (propName: string) (single: 'A option, any: 'B option) (dyn: #DynamicObj) = if any.IsSome then - any |> DynObj.setValueOpt dyn propName + dyn |> DynObj.setOptionalProperty propName any else - single |> DynObj.setValueOpt dyn propName + dyn |> DynObj.setOptionalProperty propName single - let setSingleOrAnyOptBy - (dyn: #DynamicObj) + let inline withOptionalSingleOrAnyProperty (propName: string) (single: 'A option, any: 'B option) (dyn: #DynamicObj) = + dyn |> setOptionalSingleOrAnyProperty propName (single, any) + dyn + + let setOptionalSingleOrAnyPropertyBy (propName: string) + (single: 'A option, any: 'B option) (singleF: 'A -> 'C) (anyF: 'B -> 'D) - (single: 'A option, any: 'B option) + (dyn: #DynamicObj) = if any.IsSome then - any |> DynObj.setValueOptBy dyn propName anyF + dyn |> DynObj.setOptionalPropertyBy propName any (Seq.map anyF) else - single |> DynObj.setValueOptBy dyn propName singleF + dyn |> DynObj.setOptionalPropertyBy propName single singleF + let inline withOptionalSingleOrAnyPropertyBy + (propName: string) + (single: 'A option, any: 'B option) + (singleF: 'A -> 'C) + (anyF: 'B -> 'D) + (dyn: #DynamicObj) + = + dyn |> setOptionalSingleOrAnyPropertyBy propName (single, any) singleF anyF + dyn // Copied from FSharp.Care.Collections to remove dependencies [] diff --git a/src/Plotly.NET/Layout/Layout.fs b/src/Plotly.NET/Layout/Layout.fs index 2270be1f6..a0ad6ac93 100644 --- a/src/Plotly.NET/Layout/Layout.fs +++ b/src/Plotly.NET/Layout/Layout.fs @@ -397,83 +397,82 @@ type Layout() = [] ?UpdateMenus: seq ) = (fun (layout: Layout) -> - - Title |> DynObj.setValueOpt layout "title" - ShowLegend |> DynObj.setValueOpt layout "showlegend" - Margin |> DynObj.setValueOpt layout "margin" - AutoSize |> DynObj.setValueOpt layout "autosize" - Width |> DynObj.setValueOpt layout "width" - Height |> DynObj.setValueOpt layout "height" - Font |> DynObj.setValueOpt layout "font" - UniformText |> DynObj.setValueOpt layout "uniformtext" - Separators |> DynObj.setValueOpt layout "separators" - PaperBGColor |> DynObj.setValueOpt layout "paper_bgcolor" - PlotBGColor |> DynObj.setValueOpt layout "plot_bgcolor" - AutoTypeNumbers |> DynObj.setValueOptBy layout "autotypenumbers" StyleParam.AutoTypeNumbers.convert - Colorscale |> DynObj.setValueOpt layout "colorscale" - Colorway |> DynObj.setValueOpt layout "colorway" - ModeBar |> DynObj.setValueOpt layout "modebar" - HoverMode |> DynObj.setValueOptBy layout "hovermode" StyleParam.HoverMode.convert - ClickMode |> DynObj.setValueOptBy layout "clickmode" StyleParam.ClickMode.convert - DragMode |> DynObj.setValueOptBy layout "dragmode" StyleParam.DragMode.convert - SelectDirection |> DynObj.setValueOptBy layout "selectdirection" StyleParam.SelectDirection.convert - ActiveSelection |> DynObj.setValueOpt layout "activeselection" - NewSelection |> DynObj.setValueOpt layout "newselection" - HoverDistance |> DynObj.setValueOpt layout "hoverdistance" - SpikeDistance |> DynObj.setValueOpt layout "spikedistance" - Hoverlabel |> DynObj.setValueOpt layout "hoverlabel" - Transition |> DynObj.setValueOpt layout "transition" - DataRevision |> DynObj.setValueOpt layout "datarevision" - UIRevision |> DynObj.setValueOpt layout "uirevision" - EditRevision |> DynObj.setValueOpt layout "editrevision" - SelectRevision |> DynObj.setValueOpt layout "selectrevision" - Template |> DynObj.setValueOpt layout "template" - Meta |> DynObj.setValueOpt layout "meta" - Computed |> DynObj.setValueOpt layout "computed" - Grid |> DynObj.setValueOpt layout "grid" - Calendar |> DynObj.setValueOptBy layout "calendar" StyleParam.Calendar.convert - MinReducedHeight |> DynObj.setValueOpt layout "minreducedheight" - MinReducedWidth |> DynObj.setValueOpt layout "minreducedwidth" - NewShape |> DynObj.setValueOpt layout "newshape" - ActiveShape |> DynObj.setValueOpt layout "activeshape" - HideSources |> DynObj.setValueOpt layout "hidesources" - ScatterGap |> DynObj.setValueOpt layout "scattergap" - ScatterMode |> DynObj.setValueOptBy layout "scattermode" StyleParam.ScatterMode.convert - BarGap |> DynObj.setValueOpt layout "bargap" - BarGroupGap |> DynObj.setValueOpt layout "bargroupgap" - BarMode |> DynObj.setValueOptBy layout "barmode" StyleParam.BarMode.convert - BarNorm |> DynObj.setValueOptBy layout "barnorm" StyleParam.BarNorm.convert - ExtendPieColors |> DynObj.setValueOpt layout "extendpiecolors" - HiddenLabels |> DynObj.setValueOpt layout "hiddenlabels" - PieColorWay |> DynObj.setValueOpt layout "piecolorway" - BoxGap |> DynObj.setValueOpt layout "boxgap" - BoxGroupGap |> DynObj.setValueOpt layout "boxgroupgap" - BoxMode |> DynObj.setValueOptBy layout "boxmode" StyleParam.BoxMode.convert - ViolinGap |> DynObj.setValueOpt layout "violingap" - ViolinGroupGap |> DynObj.setValueOpt layout "violingroupgap" - ViolinMode |> DynObj.setValueOptBy layout "violinmode" StyleParam.ViolinMode.convert - WaterfallGap |> DynObj.setValueOpt layout "waterfallgap" - WaterfallGroupGap |> DynObj.setValueOpt layout "waterfallgroupgap" - WaterfallMode |> DynObj.setValueOptBy layout "waterfallmode" StyleParam.WaterfallMode.convert - FunnelGap |> DynObj.setValueOpt layout "funnelgap" - FunnelGroupGap |> DynObj.setValueOpt layout "funnelgroupgap" - FunnelMode |> DynObj.setValueOptBy layout "funnelmode" StyleParam.FunnelMode.convert - ExtendFunnelAreaColors |> DynObj.setValueOpt layout "extendfunnelareacolors" - FunnelAreaColorWay |> DynObj.setValueOpt layout "funnelareacolorway" - ExtendSunBurstColors |> DynObj.setValueOpt layout "extendsunburstcolors" - SunBurstColorWay |> DynObj.setValueOpt layout "sunburstcolorway" - ExtendTreeMapColors |> DynObj.setValueOpt layout "extendtreemapcolors" - TreeMapColorWay |> DynObj.setValueOpt layout "treemapcolorway" - ExtendIcicleColors |> DynObj.setValueOpt layout "extendiciclecolors" - IcicleColorWay |> DynObj.setValueOpt layout "iciclecolorway" - Annotations |> DynObj.setValueOpt layout "annotations" - Shapes |> DynObj.setValueOpt layout "shapes" - Selections |> DynObj.setValueOpt layout "selections" - Images |> DynObj.setValueOpt layout "images" - Sliders |> DynObj.setValueOpt layout "sliders" - UpdateMenus |> DynObj.setValueOpt layout "updatemenus" - - layout) + layout + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalProperty "margin" Margin + |> DynObj.withOptionalProperty "autosize" AutoSize + |> DynObj.withOptionalProperty "width" Width + |> DynObj.withOptionalProperty "height" Height + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "uniformtext" UniformText + |> DynObj.withOptionalProperty "separators" Separators + |> DynObj.withOptionalProperty "paper_bgcolor" PaperBGColor + |> DynObj.withOptionalProperty "plot_bgcolor" PlotBGColor + |> DynObj.withOptionalPropertyBy "autotypenumbers" AutoTypeNumbers StyleParam.AutoTypeNumbers.convert + |> DynObj.withOptionalProperty "colorscale" Colorscale + |> DynObj.withOptionalProperty "colorway" Colorway + |> DynObj.withOptionalProperty "modebar" ModeBar + |> DynObj.withOptionalPropertyBy "hovermode" HoverMode StyleParam.HoverMode.convert + |> DynObj.withOptionalPropertyBy "clickmode" ClickMode StyleParam.ClickMode.convert + |> DynObj.withOptionalPropertyBy "dragmode" DragMode StyleParam.DragMode.convert + |> DynObj.withOptionalPropertyBy "selectdirection" SelectDirection StyleParam.SelectDirection.convert + |> DynObj.withOptionalProperty "activeselection" ActiveSelection + |> DynObj.withOptionalProperty "newselection" NewSelection + |> DynObj.withOptionalProperty "hoverdistance" HoverDistance + |> DynObj.withOptionalProperty "spikedistance" SpikeDistance + |> DynObj.withOptionalProperty "hoverlabel" Hoverlabel + |> DynObj.withOptionalProperty "transition" Transition + |> DynObj.withOptionalProperty "datarevision" DataRevision + |> DynObj.withOptionalProperty "uirevision" UIRevision + |> DynObj.withOptionalProperty "editrevision" EditRevision + |> DynObj.withOptionalProperty "selectrevision" SelectRevision + |> DynObj.withOptionalProperty "template" Template + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "computed" Computed + |> DynObj.withOptionalProperty "grid" Grid + |> DynObj.withOptionalPropertyBy "calendar" Calendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "minreducedheight" MinReducedHeight + |> DynObj.withOptionalProperty "minreducedwidth" MinReducedWidth + |> DynObj.withOptionalProperty "newshape" NewShape + |> DynObj.withOptionalProperty "activeshape" ActiveShape + |> DynObj.withOptionalProperty "hidesources" HideSources + |> DynObj.withOptionalProperty "scattergap" ScatterGap + |> DynObj.withOptionalPropertyBy "scattermode" ScatterMode StyleParam.ScatterMode.convert + |> DynObj.withOptionalProperty "bargap" BarGap + |> DynObj.withOptionalProperty "bargroupgap" BarGroupGap + |> DynObj.withOptionalPropertyBy "barmode" BarMode StyleParam.BarMode.convert + |> DynObj.withOptionalPropertyBy "barnorm" BarNorm StyleParam.BarNorm.convert + |> DynObj.withOptionalProperty "extendpiecolors" ExtendPieColors + |> DynObj.withOptionalProperty "hiddenlabels" HiddenLabels + |> DynObj.withOptionalProperty "piecolorway" PieColorWay + |> DynObj.withOptionalProperty "boxgap" BoxGap + |> DynObj.withOptionalProperty "boxgroupgap" BoxGroupGap + |> DynObj.withOptionalPropertyBy "boxmode" BoxMode StyleParam.BoxMode.convert + |> DynObj.withOptionalProperty "violingap" ViolinGap + |> DynObj.withOptionalProperty "violingroupgap" ViolinGroupGap + |> DynObj.withOptionalPropertyBy "violinmode" ViolinMode StyleParam.ViolinMode.convert + |> DynObj.withOptionalProperty "waterfallgap" WaterfallGap + |> DynObj.withOptionalProperty "waterfallgroupgap" WaterfallGroupGap + |> DynObj.withOptionalPropertyBy "waterfallmode" WaterfallMode StyleParam.WaterfallMode.convert + |> DynObj.withOptionalProperty "funnelgap" FunnelGap + |> DynObj.withOptionalProperty "funnelgroupgap" FunnelGroupGap + |> DynObj.withOptionalPropertyBy "funnelmode" FunnelMode StyleParam.FunnelMode.convert + |> DynObj.withOptionalProperty "extendfunnelareacolors" ExtendFunnelAreaColors + |> DynObj.withOptionalProperty "funnelareacolorway" FunnelAreaColorWay + |> DynObj.withOptionalProperty "extendsunburstcolors" ExtendSunBurstColors + |> DynObj.withOptionalProperty "sunburstcolorway" SunBurstColorWay + |> DynObj.withOptionalProperty "extendtreemapcolors" ExtendTreeMapColors + |> DynObj.withOptionalProperty "treemapcolorway" TreeMapColorWay + |> DynObj.withOptionalProperty "extendiciclecolors" ExtendIcicleColors + |> DynObj.withOptionalProperty "iciclecolorway" IcicleColorWay + |> DynObj.withOptionalProperty "annotations" Annotations + |> DynObj.withOptionalProperty "shapes" Shapes + |> DynObj.withOptionalProperty "selections" Selections + |> DynObj.withOptionalProperty "images" Images + |> DynObj.withOptionalProperty "sliders" Sliders + |> DynObj.withOptionalProperty "updatemenus" UpdateMenus + ) /// /// Combines two Layout objects. @@ -492,41 +491,41 @@ type Layout() = let annotations = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>("annotations")) - (second.TryGetTypedValue>("annotations")) + (first.TryGetTypedPropertyValue>("annotations")) + (second.TryGetTypedPropertyValue>("annotations")) let shapes = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>("shapes")) - (second.TryGetTypedValue>("shapes")) + (first.TryGetTypedPropertyValue>("shapes")) + (second.TryGetTypedPropertyValue>("shapes")) let selections = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>("selections")) - (second.TryGetTypedValue>("selections")) + (first.TryGetTypedPropertyValue>("selections")) + (second.TryGetTypedPropertyValue>("selections")) let images = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>("images")) - (second.TryGetTypedValue>("images")) + (first.TryGetTypedPropertyValue>("images")) + (second.TryGetTypedPropertyValue>("images")) let sliders = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>("sliders")) - (second.TryGetTypedValue>("sliders")) + (first.TryGetTypedPropertyValue>("sliders")) + (second.TryGetTypedPropertyValue>("sliders")) let hiddenLabels = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>("hiddenlabels")) - (second.TryGetTypedValue>("hiddenlabels")) + (first.TryGetTypedPropertyValue>("hiddenlabels")) + (second.TryGetTypedPropertyValue>("hiddenlabels")) let updateMenus = InternalUtils.combineOptSeqs - (first.TryGetTypedValue>("updatemenus")) - (second.TryGetTypedValue>("updatemenus")) + (first.TryGetTypedPropertyValue>("updatemenus")) + (second.TryGetTypedPropertyValue>("updatemenus")) DynObj.combine first second - |> unbox + |> unbox |> Layout.style ( ?Annotations = annotations, ?Shapes = shapes, @@ -542,14 +541,14 @@ type Layout() = /// /// The name of the dynamic member to get the value of /// The layout to get the dynamic member value from - static member tryGetTypedMember<'T> (propName: string) (layout: Layout) = layout.TryGetTypedValue<'T>(propName) + static member tryGetTypedMember<'T> (propName: string) (layout: Layout) = layout.TryGetTypedPropertyValue<'T>(propName) /// /// Returns Some(LinearAxis) if there is an axis object set on the layout with the given id, and None otherwise. /// /// The target axis id static member tryGetLinearAxisById(id: StyleParam.SubPlotId) = - (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id)) + (fun (layout: Layout) -> layout.TryGetTypedPropertyValue(StyleParam.SubPlotId.toString id)) /// /// Combines the given axis object with the one already present on the layout. @@ -558,19 +557,15 @@ type Layout() = /// The updated axis object. static member updateLinearAxisById(id: StyleParam.SubPlotId, axis: LinearAxis) = (fun (layout: Layout) -> - match id with | StyleParam.SubPlotId.XAxis _ | StyleParam.SubPlotId.YAxis _ -> - let axis' = match Layout.tryGetLinearAxisById id layout with - | Some a -> (DynObj.combine a axis) :?> LinearAxis + | Some a -> DynObj.combine a axis |> unbox | None -> axis - - axis' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout + |> DynObj.withProperty (StyleParam.SubPlotId.toString id) axis' | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a linear axis on layout") @@ -590,9 +585,10 @@ type Layout() = /// The layout to get the x axes from static member getXAxes (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidXAxisId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some axis -> Some (kv.Key, axis) | None -> None else None @@ -604,9 +600,10 @@ type Layout() = /// The layout to get the y axes from static member getYAxes (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidYAxisId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some axis -> Some (kv.Key, axis) | None -> None else None @@ -623,9 +620,7 @@ type Layout() = match id with | StyleParam.SubPlotId.XAxis _ | StyleParam.SubPlotId.YAxis _ -> - axis |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout - + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) axis | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a linear axis on layout") @@ -635,7 +630,7 @@ type Layout() = /// /// The target scene id static member tryGetSceneById(id: StyleParam.SubPlotId) = - (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id)) + (fun (layout: Layout) -> layout.TryGetTypedPropertyValue(StyleParam.SubPlotId.toString id)) /// /// Combines the given scene object with the one already present on the layout. @@ -646,11 +641,11 @@ type Layout() = (fun (layout: Layout) -> let scene' = match Layout.tryGetSceneById id layout with - | Some a -> (DynObj.combine a scene) :?> Scene + | Some a -> DynObj.combine a scene | None -> scene - - scene' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout) + layout + |> DynObj.withProperty (StyleParam.SubPlotId.toString id) scene' + ) /// /// Returns the Scene object of the layout with the given id. @@ -668,9 +663,10 @@ type Layout() = /// The layout to get the scenes from static member getScenes (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidSceneId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some scene -> Some (kv.Key, scene) | None -> None else None @@ -683,15 +679,15 @@ type Layout() = /// The scene to add to the layout. static member setScene(id: StyleParam.SubPlotId, scene: Scene) = (fun (layout: Layout) -> - scene |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) scene + ) /// /// Returns Some(Geo) if there is a geo object set on the layout with the given id, and None otherwise. /// /// The target geo id static member tryGetGeoById(id: StyleParam.SubPlotId) = - (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id)) + (fun (layout: Layout) -> layout.TryGetTypedPropertyValue(StyleParam.SubPlotId.toString id)) /// /// Combines the given geo object with the one already present on the layout. @@ -702,11 +698,11 @@ type Layout() = (fun (layout: Layout) -> let geo' = match Layout.tryGetGeoById id layout with - | Some a -> (DynObj.combine a geo) :?> Geo + | Some a -> DynObj.combine a geo | None -> geo - geo' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout) + layout|> DynObj.withProperty (StyleParam.SubPlotId.toString id) geo' + ) /// /// Returns the Geo object of the layout with the given id. @@ -723,9 +719,10 @@ type Layout() = /// The layout to get the geos from static member getGeos (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidGeoId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some geo -> Some (kv.Key, geo) | None -> None else None @@ -738,17 +735,15 @@ type Layout() = /// The geo to add to the layout. static member setGeo(id: StyleParam.SubPlotId, geo: Geo) = (fun (layout: Layout) -> - - geo |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) geo + ) /// /// Returns Some(Mapbox) if there is amapbox object set on the layout with the given id, and None otherwise. /// /// The target mapbox id static member tryGetMapboxById(id: StyleParam.SubPlotId) = - (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id)) + (fun (layout: Layout) -> layout.TryGetTypedPropertyValue(StyleParam.SubPlotId.toString id)) /// /// Combines the given mapbox object with the one already present on the layout. @@ -759,11 +754,11 @@ type Layout() = (fun (layout: Layout) -> let mapbox' = match Layout.tryGetMapboxById id layout with - | Some a -> (DynObj.combine a mapbox) :?> Mapbox + | Some a -> DynObj.combine a mapbox | None -> mapbox - mapbox' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) mapbox' + ) /// /// Returns the Mapbox object of the layout with the given id. @@ -780,9 +775,10 @@ type Layout() = /// The layout to get the mapboxes from static member getMapboxes (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidMapboxId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some mapbox -> Some (kv.Key, mapbox) | None -> None else None @@ -795,17 +791,15 @@ type Layout() = /// The mapbox to add to the layout. static member setMapbox(id: StyleParam.SubPlotId, mapbox: Mapbox) = (fun (layout: Layout) -> - - mapbox |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) mapbox + ) /// /// Returns Some(Polar) if there is a polar object set on the layout with the given id, and None otherwise. /// /// he target polar id static member tryGetPolarById(id: StyleParam.SubPlotId) = - (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id)) + (fun (layout: Layout) -> layout.TryGetTypedPropertyValue(StyleParam.SubPlotId.toString id)) /// /// Combines the given polar object with the one already present on the layout. @@ -817,12 +811,11 @@ type Layout() = let polar' = match layout |> Layout.tryGetPolarById (id) with - | Some a -> (DynObj.combine a polar) :?> Polar + | Some a -> DynObj.combine a polar | None -> polar - polar' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) polar' + ) /// /// Returns the Polar object of the layout with the given id. @@ -839,9 +832,10 @@ type Layout() = /// The layout to get the polars from static member getPolars (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidPolarId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some polar -> Some (kv.Key, polar) | None -> None else None @@ -854,17 +848,15 @@ type Layout() = /// The polar to add to the layout. static member setPolar(id: StyleParam.SubPlotId, polar: Polar) = (fun (layout: Layout) -> - - polar |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) polar + ) /// /// Returns Some(smith) if there is a smith object set on the layout with the given id, and None otherwise. /// /// the target Smith id static member tryGetSmithById(id: StyleParam.SubPlotId) = - (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id)) + (fun (layout: Layout) -> layout.TryGetTypedPropertyValue(StyleParam.SubPlotId.toString id)) /// /// Combines the given Smith object with the one already present on the layout. @@ -875,13 +867,12 @@ type Layout() = (fun (layout: Layout) -> let smith' = - match layout |> Layout.tryGetPolarById (id) with - | Some a -> (DynObj.combine a smith) :?> Smith + match layout |> Layout.tryGetSmithById (id) with + | Some a -> DynObj.combine a smith | None -> smith - smith' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) smith' + ) /// /// Returns the Smith object of the layout with the given id. @@ -898,9 +889,10 @@ type Layout() = /// The layout to get the smiths from static member getSmiths (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidSmithId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some smith -> Some (kv.Key, smith) | None -> None else None @@ -913,17 +905,15 @@ type Layout() = /// The smith to add to the layout. static member setSmith(id: StyleParam.SubPlotId, smith: Smith) = (fun (layout: Layout) -> - - smith |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) smith + ) /// /// Returns Some(ColorAxis) if there is a ColorAxis object set on the layout with the given id, and None otherwise. /// /// The target ColorAxis id static member tryGetColorAxisById(id: StyleParam.SubPlotId) = - (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id)) + (fun (layout: Layout) -> layout.TryGetTypedPropertyValue(StyleParam.SubPlotId.toString id)) /// /// Combines the given colorAxis object with the one already present on the layout. @@ -935,12 +925,11 @@ type Layout() = let colorAxis' = match layout |> Layout.tryGetColorAxisById (id) with - | Some a -> (DynObj.combine a colorAxis) :?> ColorAxis + | Some a -> DynObj.combine a colorAxis | None -> colorAxis - colorAxis' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) colorAxis' + ) /// /// Returns the ColorAxis object of the layout with the given id. @@ -957,9 +946,10 @@ type Layout() = /// The layout to get the color axes from static member getColorAxes (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidColorAxisId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some colorAxis -> Some (kv.Key, colorAxis) | None -> None else None @@ -972,17 +962,15 @@ type Layout() = /// The ColorAxis to add to the layout. static member setColorAxis(id: StyleParam.SubPlotId, colorAxis: ColorAxis) = (fun (layout: Layout) -> - - colorAxis |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) colorAxis + ) /// /// Returns Some(Ternary) if there is a ColorAxis object set on the layout with the given id, and None otherwise. /// /// The target Ternary id static member tryGetTernaryById(id: StyleParam.SubPlotId) = - (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id)) + (fun (layout: Layout) -> layout.TryGetTypedPropertyValue(StyleParam.SubPlotId.toString id)) /// /// Combines the given ternary object with the one already present on the layout. @@ -994,12 +982,11 @@ type Layout() = let ternary' = match layout |> Layout.tryGetTernaryById (id) with - | Some a -> (DynObj.combine a ternary) :?> Ternary + | Some a -> DynObj.combine a ternary | None -> ternary - ternary' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) ternary' + ) /// /// Returns the Ternary object of the layout with the given id. @@ -1016,9 +1003,10 @@ type Layout() = /// The layout to get the ternaries from static member getTernaries (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidTernaryId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some ternary -> Some (kv.Key, ternary) | None -> None else None @@ -1031,10 +1019,8 @@ type Layout() = /// The Ternary to add to the layout. static member setTernary(id: StyleParam.SubPlotId, ternary: Ternary) = (fun (layout: Layout) -> - - ternary |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout) + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) ternary + ) /// /// Returns the LayoutGrid object of the given layout. @@ -1051,8 +1037,8 @@ type Layout() = /// The new LayoutGrid object static member setLayoutGrid(layoutGrid: LayoutGrid) = (fun (layout: Layout) -> - layout.SetValue("grid", layoutGrid) - layout) + layout |> DynObj.withProperty "grid" layoutGrid + ) /// /// Combines the given layoutGrid object with the one already present on the layout. @@ -1061,7 +1047,7 @@ type Layout() = static member updateLayoutGrid(layoutGrid: LayoutGrid) = (fun (layout: Layout) -> let combined = - (DynObj.combine (layout |> Layout.getLayoutGrid) layoutGrid) :?> LayoutGrid + DynObj.combine (layout |> Layout.getLayoutGrid) layoutGrid |> unbox layout |> Layout.setLayoutGrid combined) @@ -1070,7 +1056,7 @@ type Layout() = /// /// The target Legend id static member tryGetLegendById(id: StyleParam.SubPlotId) = - (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id)) + (fun (layout: Layout) -> layout.TryGetTypedPropertyValue(StyleParam.SubPlotId.toString id)) /// /// Returns a sequence of key-value pairs of the layout's dynamic members that are valid legends (if the key matches and object can be cast to the correct type). @@ -1078,9 +1064,10 @@ type Layout() = /// The layout to get the color axes from static member getLegends (layout: Layout) = layout.GetProperties(includeInstanceProperties = false) - |> Seq.choose (fun kv -> + |> Array.ofSeq + |> Array.choose (fun kv -> if StyleParam.SubPlotId.isValidLegendId kv.Key then - match layout.TryGetTypedValue(kv.Key) with + match layout.TryGetTypedPropertyValue(kv.Key) with | Some legend -> Some (kv.Key, legend) | None -> None else None @@ -1099,12 +1086,11 @@ type Layout() = let legend' = match Layout.tryGetLegendById id layout with - | Some l -> (DynObj.combine l legend) :?> Legend + | Some l -> DynObj.combine l legend | None -> legend - legend' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) legend' + | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a legend on layout") @@ -1128,8 +1114,7 @@ type Layout() = match id with | StyleParam.SubPlotId.Legend _ -> - legend |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout + layout |> DynObj.withProperty (StyleParam.SubPlotId.toString id) legend | _ -> failwith diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/3D/AspectRatio.fs b/src/Plotly.NET/Layout/ObjectAbstractions/3D/AspectRatio.fs index e6874be03..944c05037 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/3D/AspectRatio.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/3D/AspectRatio.fs @@ -26,8 +26,8 @@ type AspectRatio() = fun (aspectRatio: AspectRatio) -> - X |> DynObj.setValueOpt aspectRatio "x" - Y |> DynObj.setValueOpt aspectRatio "y" - Z |> DynObj.setValueOpt aspectRatio "z" - aspectRatio + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/3D/Camera.fs b/src/Plotly.NET/Layout/ObjectAbstractions/3D/Camera.fs index 2886dc85f..640dad78a 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/3D/Camera.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/3D/Camera.fs @@ -26,12 +26,11 @@ type CameraCenter() = ) = fun (cameraCenter: CameraCenter) -> - - X |> DynObj.setValueOpt cameraCenter "x" - Y |> DynObj.setValueOpt cameraCenter "y" - Z |> DynObj.setValueOpt cameraCenter "z" - + cameraCenter + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z type CameraEye() = inherit DynamicObj() @@ -53,11 +52,10 @@ type CameraEye() = fun (cameraEye: CameraEye) -> - X |> DynObj.setValueOpt cameraEye "x" - Y |> DynObj.setValueOpt cameraEye "y" - Z |> DynObj.setValueOpt cameraEye "z" - cameraEye + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z type CameraUp() = inherit DynamicObj() @@ -79,11 +77,11 @@ type CameraUp() = fun (cameraUp: CameraUp) -> - X |> DynObj.setValueOpt cameraUp "x" - Y |> DynObj.setValueOpt cameraUp "y" - Z |> DynObj.setValueOpt cameraUp "z" - cameraUp + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + type CameraProjection() = inherit DynamicObj() @@ -95,9 +93,9 @@ type CameraProjection() = fun (cameraProjection: CameraProjection) -> - ProjectionType |> DynObj.setValueOptBy cameraProjection "type" StyleParam.CameraProjectionType.convert + cameraProjection |> DynObj.withOptionalPropertyBy "type" ProjectionType StyleParam.CameraProjectionType.convert - cameraProjection + type Camera() = inherit DynamicObj() @@ -121,9 +119,9 @@ type Camera() = fun (camera: Camera) -> - Center |> DynObj.setValueOpt camera "center" - Eye |> DynObj.setValueOpt camera "eye" - Projection |> DynObj.setValueOpt camera "projection" - Up |> DynObj.setValueOpt camera "up" - camera + |> DynObj.withOptionalProperty "center" Center + |> DynObj.withOptionalProperty "eye" Eye + |> DynObj.withOptionalProperty "projection" Projection + |> DynObj.withOptionalProperty "up" Up + diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/3D/Scene.fs b/src/Plotly.NET/Layout/ObjectAbstractions/3D/Scene.fs index 4b419598a..d4b995baf 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/3D/Scene.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/3D/Scene.fs @@ -86,29 +86,28 @@ type Scene() = [] ?YAxis: LinearAxis, [] ?ZAxis: LinearAxis ) = - (fun (scene: Scene) -> - - Annotations |> DynObj.setValueOpt scene "annotations" - AspectMode |> DynObj.setValueOptBy scene "aspectmode" StyleParam.AspectMode.convert - AspectRatio |> DynObj.setValueOpt scene "aspectratio" - BGColor |> DynObj.setValueOpt scene "bgcolor" - Camera |> DynObj.setValueOpt scene "camera" - Domain |> DynObj.setValueOpt scene "domain" - DragMode |> DynObj.setValueOptBy scene "dragmode" StyleParam.DragMode.convert - HoverMode |> DynObj.setValueOptBy scene "hovermode" StyleParam.HoverMode.convert - UIRevision |> DynObj.setValueOpt scene "uirevision" - XAxis |> DynObj.setValueOpt scene "xaxis" - YAxis |> DynObj.setValueOpt scene "yaxis" - ZAxis |> DynObj.setValueOpt scene "zaxis" + fun (scene: Scene) -> - scene) + scene + |> DynObj.withOptionalProperty "annotations" Annotations + |> DynObj.withOptionalPropertyBy "aspectmode" AspectMode StyleParam.AspectMode.convert + |> DynObj.withOptionalProperty "aspectratio" AspectRatio + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "camera" Camera + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalPropertyBy "dragmode" DragMode StyleParam.DragMode.convert + |> DynObj.withOptionalPropertyBy "hovermode" HoverMode StyleParam.HoverMode.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision + |> DynObj.withOptionalProperty "xaxis" XAxis + |> DynObj.withOptionalProperty "yaxis" YAxis + |> DynObj.withOptionalProperty "zaxis" ZAxis /// /// Returns Some(dynamic member value) of the scene object's underlying DynamicObj when a dynamic member with the given name exists, and None otherwise. /// /// The name of the dynamic member to get the value of /// The scene to get the dynamic member value from - static member tryGetTypedMember<'T> (propName: string) (scene: Scene) = scene.TryGetTypedValue<'T>(propName) + static member tryGetTypedMember<'T> (propName: string) (scene: Scene) = scene.TryGetTypedPropertyValue<'T>(propName) /// /// Returns the x axis object of the given scene. @@ -125,7 +124,7 @@ type Scene() = /// The new x axis object static member setXAxis(xAxis: LinearAxis) = (fun (scene: Scene) -> - scene.SetValue("xaxis", xAxis) + scene.SetProperty("xaxis", xAxis) scene) /// @@ -143,7 +142,7 @@ type Scene() = /// The new y axis object static member setYAxis(yAxis: LinearAxis) = (fun (scene: Scene) -> - scene.SetValue("yaxis", yAxis) + scene.SetProperty("yaxis", yAxis) scene) /// @@ -161,5 +160,5 @@ type Scene() = /// The new z axis object static member setZAxis(zAxis: LinearAxis) = (fun (scene: Scene) -> - scene.SetValue("zaxis", zAxis) + scene.SetProperty("zaxis", zAxis) scene) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveSelection.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveSelection.fs index 0e8cc4e57..e07f9093a 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveSelection.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveSelection.fs @@ -22,7 +22,7 @@ type ActiveSelection() = ) = (fun (activeSelection: ActiveSelection) -> - FillColor |> DynObj.setValueOpt activeSelection "fillcolor" - Opacity |> DynObj.setValueOpt activeSelection "opacity" - - activeSelection) + activeSelection + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "opacity" Opacity + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveShape.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveShape.fs index b5ab2f896..4cfea8893 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveShape.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveShape.fs @@ -22,7 +22,7 @@ type ActiveShape() = ) = (fun (activeShape: ActiveShape) -> - FillColor |> DynObj.setValueOpt activeShape "fillcolor" - Opacity |> DynObj.setValueOpt activeShape "opacity" - - activeShape) + activeShape + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "opacity" Opacity + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Annotation.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Annotation.fs index c313350e3..3f70d102e 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Annotation.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Annotation.fs @@ -148,47 +148,47 @@ type Annotation() = ) = (fun (ann: Annotation) -> - X |> DynObj.setValueOpt ann "x" - Y |> DynObj.setValueOpt ann "y" - Align |> DynObj.setValueOptBy ann "align" StyleParam.AnnotationAlignment.convert - ArrowColor |> DynObj.setValueOpt ann "arrowcolor" - ArrowHead |> DynObj.setValueOptBy ann "arrowhead" StyleParam.ArrowHead.convert - ArrowSide |> DynObj.setValueOptBy ann "arrowside" StyleParam.ArrowSide.convert - ArrowSize |> DynObj.setValueOpt ann "arrowsize" - AX |> DynObj.setValueOpt ann "ax" - AXRef |> DynObj.setValueOpt ann "axref" - AY |> DynObj.setValueOpt ann "ay" - AYRef |> DynObj.setValueOpt ann "ayref" - BGColor |> DynObj.setValueOpt ann "bgcolor" - BorderColor |> DynObj.setValueOpt ann "bordercolor" - BorderPad |> DynObj.setValueOpt ann "borderpad" - BorderWidth |> DynObj.setValueOpt ann "borderwidth" - CaptureEvents |> DynObj.setValueOpt ann "captureevents" - ClickToShow |> DynObj.setValueOptBy ann "clicktoshow" StyleParam.ClickToShow.convert - Font |> DynObj.setValueOpt ann "font" - Height |> DynObj.setValueOpt ann "height" - HoverLabel |> DynObj.setValueOpt ann "hoverlabel" - HoverText |> DynObj.setValueOpt ann "hovertext" - Name |> DynObj.setValueOpt ann "name" - Opacity |> DynObj.setValueOpt ann "opacity" - ShowArrow |> DynObj.setValueOpt ann "showarrow" - StandOff |> DynObj.setValueOpt ann "standoff" - StartArrowHead |> DynObj.setValueOpt ann "startarrowhead" - StartArrowSize |> DynObj.setValueOpt ann "startarrowsize" - StartStandOff |> DynObj.setValueOpt ann "startstandoff" - TemplateItemName |> DynObj.setValueOpt ann "templateitemname" - Text |> DynObj.setValueOpt ann "text" - TextAngle |> DynObj.setValueOpt ann "textangle" - VAlign |> DynObj.setValueOptBy ann "valign" StyleParam.VerticalAlign.convert - Visible |> DynObj.setValueOpt ann "visible" - Width |> DynObj.setValueOpt ann "width" - XAnchor |> DynObj.setValueOptBy ann "xanchor" StyleParam.XAnchorPosition.convert - XClick |> DynObj.setValueOpt ann "xclick" - XRef |> DynObj.setValueOpt ann "xref" - XShift |> DynObj.setValueOpt ann "xshift" - YAnchor |> DynObj.setValueOptBy ann "yanchor" StyleParam.YAnchorPosition.convert - YClick |> DynObj.setValueOpt ann "yclick" - YRef |> DynObj.setValueOpt ann "yref" - YShift |> DynObj.setValueOpt ann "yshift" - - ann) + ann + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalPropertyBy "align" Align StyleParam.AnnotationAlignment.convert + |> DynObj.withOptionalProperty "arrowcolor" ArrowColor + |> DynObj.withOptionalPropertyBy "arrowhead" ArrowHead StyleParam.ArrowHead.convert + |> DynObj.withOptionalPropertyBy "arrowside" ArrowSide StyleParam.ArrowSide.convert + |> DynObj.withOptionalProperty "arrowsize" ArrowSize + |> DynObj.withOptionalProperty "ax" AX + |> DynObj.withOptionalProperty "axref" AXRef + |> DynObj.withOptionalProperty "ay" AY + |> DynObj.withOptionalProperty "ayref" AYRef + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "bordercolor" BorderColor + |> DynObj.withOptionalProperty "borderpad" BorderPad + |> DynObj.withOptionalProperty "borderwidth" BorderWidth + |> DynObj.withOptionalProperty "captureevents" CaptureEvents + |> DynObj.withOptionalPropertyBy "clicktoshow" ClickToShow StyleParam.ClickToShow.convert + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "height" Height + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "hovertext" HoverText + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "showarrow" ShowArrow + |> DynObj.withOptionalProperty "standoff" StandOff + |> DynObj.withOptionalProperty "startarrowhead" StartArrowHead + |> DynObj.withOptionalProperty "startarrowsize" StartArrowSize + |> DynObj.withOptionalProperty "startstandoff" StartStandOff + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + |> DynObj.withOptionalProperty "text" Text + |> DynObj.withOptionalProperty "textangle" TextAngle + |> DynObj.withOptionalPropertyBy "valign" VAlign StyleParam.VerticalAlign.convert + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "width" Width + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.XAnchorPosition.convert + |> DynObj.withOptionalProperty "xclick" XClick + |> DynObj.withOptionalProperty "xref" XRef + |> DynObj.withOptionalProperty "xshift" XShift + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.YAnchorPosition.convert + |> DynObj.withOptionalProperty "yclick" YClick + |> DynObj.withOptionalProperty "yref" YRef + |> DynObj.withOptionalProperty "yshift" YShift + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Button.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Button.fs index b0e04223c..2d2e03492 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Button.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Button.fs @@ -42,12 +42,12 @@ type Button() = ) = (fun (button: Button) -> - Visible |> DynObj.setValueOpt button "visible" - Step |> DynObj.setValueOptBy button "step" StyleParam.TimeStep.convert - StepMode |> DynObj.setValueOptBy button "stepmode" StyleParam.TimeStepMode.convert - Count |> DynObj.setValueOpt button "count" - Label |> DynObj.setValueOpt button "label" - Name |> DynObj.setValueOpt button "name" - TemplateItemName |> DynObj.setValueOpt button "templateitemname" - - button) + button + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalPropertyBy "step" Step StyleParam.TimeStep.convert + |> DynObj.withOptionalPropertyBy "stepmode" StepMode StyleParam.TimeStepMode.convert + |> DynObj.withOptionalProperty "count" Count + |> DynObj.withOptionalProperty "label" Label + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorAxis.fs index 97f13a654..807a82641 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorAxis.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorAxis.fs @@ -72,14 +72,14 @@ type ColorAxis() = ) = fun (ca: ColorAxis) -> - AutoColorScale |> DynObj.setValueOpt ca "autocolorscale" - CAuto |> DynObj.setValueOpt ca "cauto" - CMin |> DynObj.setValueOpt ca "cmin" - CMid |> DynObj.setValueOpt ca "cmid" - CMax |> DynObj.setValueOpt ca "cmax" - ColorBar |> DynObj.setValueOpt ca "colorbar" - ColorScale |> DynObj.setValueOptBy ca "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt ca "showscale" - ReverseScale |> DynObj.setValueOpt ca "reversescale" - ca + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalProperty "cauto" CAuto + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalProperty "cmid" CMid + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/DefaultColorScales.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/DefaultColorScales.fs index 797fbbc93..b1fee0e6a 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/DefaultColorScales.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/DefaultColorScales.fs @@ -29,8 +29,8 @@ type DefaultColorScales() = ) = (fun (defaultColorScales: DefaultColorScales) -> - Diverging |> DynObj.setValueOptBy defaultColorScales "diverging" StyleParam.Colorscale.convert - Sequential |> DynObj.setValueOptBy defaultColorScales "sequential" StyleParam.Colorscale.convert - SequentialMinus |> DynObj.setValueOptBy defaultColorScales "sequentialminus" StyleParam.Colorscale.convert - - defaultColorScales) + defaultColorScales + |> DynObj.withOptionalPropertyBy "diverging" Diverging StyleParam.Colorscale.convert + |> DynObj.withOptionalPropertyBy "sequential" Sequential StyleParam.Colorscale.convert + |> DynObj.withOptionalPropertyBy "sequentialminus" SequentialMinus StyleParam.Colorscale.convert + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Domain.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Domain.fs index 7c6560422..442604933 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Domain.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Domain.fs @@ -29,10 +29,10 @@ type Domain() = [] ?Column: int ) = (fun (dom: Domain) -> - X |> DynObj.setValueOptBy dom "x" StyleParam.Range.convert - Y |> DynObj.setValueOptBy dom "y" StyleParam.Range.convert - Row |> DynObj.setValueOpt dom "row" - Column |> DynObj.setValueOpt dom "column" - // out -> - dom) + dom + |> DynObj.withOptionalPropertyBy "x" X StyleParam.Range.convert + |> DynObj.withOptionalPropertyBy "y" Y StyleParam.Range.convert + |> DynObj.withOptionalProperty "row" Row + |> DynObj.withOptionalProperty "column" Column + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Hoverlabel.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Hoverlabel.fs index bd8782df4..65b7e52ef 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Hoverlabel.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Hoverlabel.fs @@ -57,11 +57,12 @@ type Hoverlabel() = [] ?Namelength: int ) = (fun (label: Hoverlabel) -> - BgColor |> DynObj.setValueOpt label "bgcolor" - BorderColor |> DynObj.setValueOpt label "bordercolor" - Font |> DynObj.setValueOpt label "font" - GroupTitleFont |> DynObj.setValueOpt label "grouptitlefont" - Align |> DynObj.setValueOptBy label "align" StyleParam.Align.convert - Namelength |> DynObj.setValueOpt label "namelength" - label) + label + |> DynObj.withOptionalProperty "bgcolor" BgColor + |> DynObj.withOptionalProperty "bordercolor" BorderColor + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "grouptitlefont" GroupTitleFont + |> DynObj.withOptionalPropertyBy "align" Align StyleParam.Align.convert + |> DynObj.withOptionalProperty "namelength" Namelength + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutGrid.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutGrid.fs index a6ceb2841..7105c6411 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutGrid.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutGrid.fs @@ -85,25 +85,22 @@ type LayoutGrid() = [] ?YSide: StyleParam.LayoutGridYSide ) = (fun (layoutGrid: LayoutGrid) -> - SubPlots - |> DynObj.setValueOptBy - layoutGrid - "subplots" - (Array.map ( + layoutGrid + |> DynObj.withOptionalPropertyBy "subplots" SubPlots ( + Array.map ( Array.map (fun (x, y) -> $"{StyleParam.LinearAxisId.toString x}{StyleParam.LinearAxisId.toString y}") - )) - - XAxes |> DynObj.setValueOptBy layoutGrid "xaxes" (Array.map StyleParam.LinearAxisId.toString) - YAxes |> DynObj.setValueOptBy layoutGrid "yaxes" (Array.map StyleParam.LinearAxisId.toString) - Rows |> DynObj.setValueOpt layoutGrid "rows" - Columns |> DynObj.setValueOpt layoutGrid "columns" - RowOrder |> DynObj.setValueOptBy layoutGrid "roworder" StyleParam.LayoutGridRowOrder.toString - Pattern |> DynObj.setValueOptBy layoutGrid "pattern" StyleParam.LayoutGridPattern.toString - XGap |> DynObj.setValueOpt layoutGrid "xgap" - YGap |> DynObj.setValueOpt layoutGrid "ygap" - Domain |> DynObj.setValueOpt layoutGrid "domain" - XSide |> DynObj.setValueOptBy layoutGrid "xside" StyleParam.LayoutGridXSide.toString - YSide |> DynObj.setValueOptBy layoutGrid "yside" StyleParam.LayoutGridYSide.toString - - layoutGrid) + ) + ) + |> DynObj.withOptionalPropertyBy "xaxes" XAxes (Array.map StyleParam.LinearAxisId.toString) + |> DynObj.withOptionalPropertyBy "yaxes" YAxes (Array.map StyleParam.LinearAxisId.toString) + |> DynObj.withOptionalProperty "rows" Rows + |> DynObj.withOptionalProperty "columns" Columns + |> DynObj.withOptionalPropertyBy "roworder" RowOrder StyleParam.LayoutGridRowOrder.toString + |> DynObj.withOptionalPropertyBy "pattern" Pattern StyleParam.LayoutGridPattern.toString + |> DynObj.withOptionalProperty "xgap" XGap + |> DynObj.withOptionalProperty "ygap" YGap + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalPropertyBy "xside" XSide StyleParam.LayoutGridXSide.toString + |> DynObj.withOptionalPropertyBy "yside" YSide StyleParam.LayoutGridYSide.toString + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutImage.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutImage.fs index b3cd0f92a..1e3d70e88 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutImage.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutImage.fs @@ -65,21 +65,20 @@ type LayoutImage() = [] ?YRef: string ) = (fun (layoutImage: LayoutImage) -> - - Layer |> DynObj.setValueOptBy layoutImage "layer" StyleParam.Layer.convert - Name |> DynObj.setValueOpt layoutImage "name" - Opacity |> DynObj.setValueOpt layoutImage "opacity" - SizeX |> DynObj.setValueOpt layoutImage "sizex" - SizeY |> DynObj.setValueOpt layoutImage "sizey" - Sizing |> DynObj.setValueOptBy layoutImage "sizing" StyleParam.LayoutImageSizing.convert - Source |> DynObj.setValueOpt layoutImage "source" - TemplateItemname |> DynObj.setValueOpt layoutImage "templateitemname" - Visible |> DynObj.setValueOpt layoutImage "visible" - X |> DynObj.setValueOpt layoutImage "x" - XAnchor |> DynObj.setValueOptBy layoutImage "xanchor" StyleParam.XAnchorPosition.convert - XRef |> DynObj.setValueOpt layoutImage "xref" - Y |> DynObj.setValueOpt layoutImage "y" - YAnchor |> DynObj.setValueOptBy layoutImage "yanchor" StyleParam.YAnchorPosition.convert - YRef |> DynObj.setValueOpt layoutImage "yref" - - layoutImage) + layoutImage + |> DynObj.withOptionalPropertyBy "layer" Layer StyleParam.Layer.convert + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "sizex" SizeX + |> DynObj.withOptionalProperty "sizey" SizeY + |> DynObj.withOptionalPropertyBy "sizing" Sizing StyleParam.LayoutImageSizing.convert + |> DynObj.withOptionalProperty "source" Source + |> DynObj.withOptionalProperty "templateitemname" TemplateItemname + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.XAnchorPosition.convert + |> DynObj.withOptionalProperty "xref" XRef + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.YAnchorPosition.convert + |> DynObj.withOptionalProperty "yref" YRef + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Legend.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Legend.fs index 032412219..4d833806d 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Legend.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Legend.fs @@ -151,32 +151,31 @@ type Legend() = [] ?YRef: string ) = (fun (legend: Legend) -> - BGColor |> DynObj.setValueOpt legend "bgcolor" - BorderColor |> DynObj.setValueOpt legend "bordercolor" - BorderWidth |> DynObj.setValueOpt legend "borderwidth" - EntryWidth |> DynObj.setValueOpt legend "entrywidth" - EntryWidthMode |> DynObj.setValueOptBy legend "entrywidthmode" StyleParam.EntryWidthMode.convert - Font |> DynObj.setValueOpt legend "font" - GroupClick |> DynObj.setValueOptBy legend "groupclick" StyleParam.TraceGroupClickOptions.convert - GroupTitleFont |> DynObj.setValueOpt legend "grouptitlefont" - ItemClick |> DynObj.setValueOptBy legend "itemclick" StyleParam.TraceItemClickOptions.convert - ItemDoubleClick |> DynObj.setValueOptBy legend "itemdoubleclick" StyleParam.TraceItemClickOptions.convert - ItemSizing |> DynObj.setValueOptBy legend "itemsizing" StyleParam.TraceItemSizing.convert - ItemWidth |> DynObj.setValueOpt legend "itemwidth" - Orientation |> DynObj.setValueOptBy legend "orientation" StyleParam.Orientation.convert - Title |> DynObj.setValueOpt legend "title" - TraceGroupGap |> DynObj.setValueOpt legend "tracegroupgap" - TraceOrder |> DynObj.setValueOptBy legend "traceorder" StyleParam.TraceOrder.convert - UIRevision |> DynObj.setValueOpt legend "uirevision" - VerticalAlign |> DynObj.setValueOptBy legend "valign" StyleParam.VerticalAlign.convert - Visible |> DynObj.setValueOpt legend "visible" - X |> DynObj.setValueOpt legend "x" - XAnchor |> DynObj.setValueOptBy legend "xanchor" StyleParam.XAnchorPosition.convert - XRef |> DynObj.setValueOpt legend "xref" - Y |> DynObj.setValueOpt legend "y" - YAnchor |> DynObj.setValueOptBy legend "yanchor" StyleParam.YAnchorPosition.convert - YRef |> DynObj.setValueOpt legend "yref" - - - - legend) + + legend + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "bordercolor" BorderColor + |> DynObj.withOptionalProperty "borderwidth" BorderWidth + |> DynObj.withOptionalProperty "entrywidth" EntryWidth + |> DynObj.withOptionalPropertyBy "entrywidthmode" EntryWidthMode StyleParam.EntryWidthMode.convert + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalPropertyBy "groupclick" GroupClick StyleParam.TraceGroupClickOptions.convert + |> DynObj.withOptionalProperty "grouptitlefont" GroupTitleFont + |> DynObj.withOptionalPropertyBy "itemclick" ItemClick StyleParam.TraceItemClickOptions.convert + |> DynObj.withOptionalPropertyBy "itemdoubleclick" ItemDoubleClick StyleParam.TraceItemClickOptions.convert + |> DynObj.withOptionalPropertyBy "itemsizing" ItemSizing StyleParam.TraceItemSizing.convert + |> DynObj.withOptionalProperty "itemwidth" ItemWidth + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalProperty "tracegroupgap" TraceGroupGap + |> DynObj.withOptionalPropertyBy "traceorder" TraceOrder StyleParam.TraceOrder.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision + |> DynObj.withOptionalPropertyBy "valign" VerticalAlign StyleParam.VerticalAlign.convert + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.XAnchorPosition.convert + |> DynObj.withOptionalProperty "xref" XRef + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.YAnchorPosition.convert + |> DynObj.withOptionalProperty "yref" YRef + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/LinearAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LinearAxis.fs index 303ef4035..22cc39332 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/LinearAxis.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LinearAxis.fs @@ -1007,110 +1007,109 @@ type LinearAxis() = ) = (fun (axis: LinearAxis) -> - Visible |> DynObj.setValueOpt axis "visible" - Color |> DynObj.setValueOpt axis "color" - Title |> DynObj.setValueOpt axis "title" - AxisType |> DynObj.setValueOptBy axis "type" StyleParam.AxisType.convert - AutoTypeNumbers |> DynObj.setValueOptBy axis "autotypenumbers" StyleParam.AutoTypeNumbers.convert - AutoRange |> DynObj.setValueOptBy axis "autorange" StyleParam.AutoRange.convert - AutoRangeOptions |> DynObj.setValueOpt axis "autorangeoptions" - AutoShift |> DynObj.setValueOpt axis "autoshift" - RangeMode |> DynObj.setValueOptBy axis "rangemode" StyleParam.RangeMode.convert - Range |> DynObj.setValueOptBy axis "range" StyleParam.Range.convert - FixedRange |> DynObj.setValueOpt axis "fixedrange" - ScaleAnchor |> DynObj.setValueOptBy axis "scaleanchor" StyleParam.ScaleAnchor.convert - ScaleRatio |> DynObj.setValueOpt axis "scaleratio" - Constrain |> DynObj.setValueOptBy axis "constrain" StyleParam.AxisConstraint.convert - ConstrainToward |> DynObj.setValueOptBy axis "constraintoward" StyleParam.AxisConstraintDirection.convert - Matches |> DynObj.setValueOptBy axis "matches" StyleParam.LinearAxisId.convert - MaxAllowed |> DynObj.setValueOpt axis "maxallowed" - MinAllowed |> DynObj.setValueOpt axis "minallowed" - Rangebreaks |> DynObj.setValueOpt axis "rangebreaks" - TickMode |> DynObj.setValueOptBy axis "tickmode" StyleParam.TickMode.convert - NTicks |> DynObj.setValueOpt axis "nticks" - Tick0 |> DynObj.setValueOpt axis "tick0" - DTick |> DynObj.setValueOpt axis "dtick" - TickVals |> DynObj.setValueOpt axis "tickvals" - TickText |> DynObj.setValueOpt axis "ticktext" - Ticks |> DynObj.setValueOptBy axis "ticks" StyleParam.TickOptions.convert - TicksOn |> DynObj.setValueOptBy axis "tickson" StyleParam.CategoryTickAnchor.convert - TickLabelMode |> DynObj.setValueOptBy axis "ticklabelmode" StyleParam.TickLabelMode.convert - TickLabelPosition |> DynObj.setValueOptBy axis "ticklabelposition" StyleParam.TickLabelPosition.convert - TickLabelStep |> DynObj.setValueOpt axis "ticklabelstep" - TickLabelOverflow |> DynObj.setValueOptBy axis "ticklabeloverflow" StyleParam.TickLabelOverflow.convert - Mirror |> DynObj.setValueOptBy axis "mirror" StyleParam.Mirror.convert - TickLen |> DynObj.setValueOpt axis "ticklen" - TickWidth |> DynObj.setValueOpt axis "tickwidth" - TickColor |> DynObj.setValueOpt axis "tickcolor" - ShowTickLabels |> DynObj.setValueOpt axis "showticklabels" - AutoMargin |> DynObj.setValueOptBy axis "automargin" StyleParam.TickAutoMargin.convert - ShowSpikes |> DynObj.setValueOpt axis "showspikes" - SpikeColor |> DynObj.setValueOpt axis "spikecolor" - SpikeThickness |> DynObj.setValueOpt axis "spikethickness" - SpikeDash |> DynObj.setValueOptBy axis "spikedash" StyleParam.DrawingStyle.convert - SpikeMode |> DynObj.setValueOptBy axis "spikemode" StyleParam.SpikeMode.convert - SpikeSnap |> DynObj.setValueOptBy axis "spikesnap" StyleParam.SpikeSnap.convert - TickFont |> DynObj.setValueOpt axis "tickfont" - TickAngle |> DynObj.setValueOpt axis "tickangle" - ShowTickPrefix |> DynObj.setValueOptBy axis "showtickprefix" StyleParam.ShowTickOption.convert - TickPrefix |> DynObj.setValueOpt axis "tickprefix" - ShowTickSuffix |> DynObj.setValueOptBy axis "showticksuffix" StyleParam.ShowTickOption.convert - TickSuffix |> DynObj.setValueOpt axis "ticksuffix" - ShowExponent |> DynObj.setValueOptBy axis "showexponent" StyleParam.ShowExponent.convert - ExponentFormat |> DynObj.setValueOptBy axis "exponentformat" StyleParam.ExponentFormat.convert - MinExponent |> DynObj.setValueOpt axis "minexponent" - Minor |> DynObj.setValueOpt axis "minor" - SeparateThousands |> DynObj.setValueOpt axis "separatethousands" - TickFormat |> DynObj.setValueOpt axis "tickformat" - TickFormatStops |> DynObj.setValueOpt axis "tickformatstops" - HoverFormat |> DynObj.setValueOpt axis "hoverformat" - InsideRange |> DynObj.setValueOptBy axis "insiderange" StyleParam.Range.convert - ShowLine |> DynObj.setValueOpt axis "showline" - LineColor |> DynObj.setValueOpt axis "linecolor" - LineWidth |> DynObj.setValueOpt axis "linewidth" - ShowGrid |> DynObj.setValueOpt axis "showgrid" - GridColor |> DynObj.setValueOpt axis "gridcolor" - GridDash |> DynObj.setValueOptBy axis "griddash" StyleParam.DrawingStyle.convert - GridWidth |> DynObj.setValueOpt axis "gridwidth" - ZeroLine |> DynObj.setValueOpt axis "zeroline" - ZeroLineColor |> DynObj.setValueOpt axis "zerolinecolor" - ZeroLineWidth |> DynObj.setValueOpt axis "zerolinewidth" - Shift |> DynObj.setValueOpt axis "shift" - ShowDividers |> DynObj.setValueOpt axis "showdividers" - DividerColor |> DynObj.setValueOpt axis "dividercolor" - DividerWidth |> DynObj.setValueOpt axis "dividerwidth" - Anchor |> DynObj.setValueOptBy axis "anchor" StyleParam.LinearAxisId.convert - Side |> DynObj.setValueOptBy axis "side" StyleParam.Side.convert - Overlaying |> DynObj.setValueOptBy axis "overlaying" StyleParam.LinearAxisId.convert - LabelAlias |> DynObj.setValueOpt axis "labelalias" - Layer |> DynObj.setValueOptBy axis "layer" StyleParam.Layer.convert - Domain |> DynObj.setValueOptBy axis "domain" StyleParam.Range.convert - Position |> DynObj.setValueOpt axis "position" - CategoryOrder |> DynObj.setValueOptBy axis "categoryorder" StyleParam.CategoryOrder.convert - CategoryArray |> DynObj.setValueOpt axis "categoryarray" - UIRevision |> DynObj.setValueOpt axis "uirevision" - RangeSlider |> DynObj.setValueOpt axis "rangeslider" - RangeSelector |> DynObj.setValueOpt axis "rangeselector" - Calendar |> DynObj.setValueOptBy axis "calendar" StyleParam.Calendar.convert - ArrayDTick |> DynObj.setValueOpt axis "arraydtick" - ArrayTick0 |> DynObj.setValueOpt axis "arraytick0" - CheaterType |> DynObj.setValueOptBy axis "cheatertype" StyleParam.CheaterType.convert - EndLine |> DynObj.setValueOpt axis "endline" - EndLineColor |> DynObj.setValueOpt axis "endlinecolor" - EndLineWidth |> DynObj.setValueOpt axis "endlinewidth" - LabelPadding |> DynObj.setValueOpt axis "labelpadding" - LabelPrefix |> DynObj.setValueOpt axis "labelprefix" - LabelSuffix |> DynObj.setValueOpt axis "labelsuffix" - MinorGridColor |> DynObj.setValueOpt axis "minorgridcolor" - MinorGridDash |> DynObj.setValueOptBy axis "minorgriddash" StyleParam.DrawingStyle.convert - MinorGridCount |> DynObj.setValueOpt axis "minorgridcount" - MinorGridWidth |> DynObj.setValueOpt axis "minorgridwidth" - Smoothing |> DynObj.setValueOpt axis "smoothing" - StartLine |> DynObj.setValueOpt axis "startline" - StartLineColor |> DynObj.setValueOpt axis "startlinecolor" - StartLineWidth |> DynObj.setValueOpt axis "startlinewidth" - BackgroundColor |> DynObj.setValueOpt axis "backgroundcolor" - ShowBackground |> DynObj.setValueOpt axis "showbackground" - - - axis) + axis + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalPropertyBy "type" AxisType StyleParam.AxisType.convert + |> DynObj.withOptionalPropertyBy "autotypenumbers" AutoTypeNumbers StyleParam.AutoTypeNumbers.convert + |> DynObj.withOptionalPropertyBy "autorange" AutoRange StyleParam.AutoRange.convert + |> DynObj.withOptionalProperty "autorangeoptions" AutoRangeOptions + |> DynObj.withOptionalProperty "autoshift" AutoShift + |> DynObj.withOptionalPropertyBy "rangemode" RangeMode StyleParam.RangeMode.convert + |> DynObj.withOptionalPropertyBy "range" Range StyleParam.Range.convert + |> DynObj.withOptionalProperty "fixedrange" FixedRange + |> DynObj.withOptionalPropertyBy "scaleanchor" ScaleAnchor StyleParam.ScaleAnchor.convert + |> DynObj.withOptionalProperty "scaleratio" ScaleRatio + |> DynObj.withOptionalPropertyBy "constrain" Constrain StyleParam.AxisConstraint.convert + |> DynObj.withOptionalPropertyBy "constraintoward" ConstrainToward StyleParam.AxisConstraintDirection.convert + |> DynObj.withOptionalPropertyBy "matches" Matches StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "maxallowed" MaxAllowed + |> DynObj.withOptionalProperty "minallowed" MinAllowed + |> DynObj.withOptionalProperty "rangebreaks" Rangebreaks + |> DynObj.withOptionalPropertyBy "tickmode" TickMode StyleParam.TickMode.convert + |> DynObj.withOptionalProperty "nticks" NTicks + |> DynObj.withOptionalProperty "tick0" Tick0 + |> DynObj.withOptionalProperty "dtick" DTick + |> DynObj.withOptionalProperty "tickvals" TickVals + |> DynObj.withOptionalProperty "ticktext" TickText + |> DynObj.withOptionalPropertyBy "ticks" Ticks StyleParam.TickOptions.convert + |> DynObj.withOptionalPropertyBy "tickson" TicksOn StyleParam.CategoryTickAnchor.convert + |> DynObj.withOptionalPropertyBy "ticklabelmode" TickLabelMode StyleParam.TickLabelMode.convert + |> DynObj.withOptionalPropertyBy "ticklabelposition" TickLabelPosition StyleParam.TickLabelPosition.convert + |> DynObj.withOptionalProperty "ticklabelstep" TickLabelStep + |> DynObj.withOptionalPropertyBy "ticklabeloverflow" TickLabelOverflow StyleParam.TickLabelOverflow.convert + |> DynObj.withOptionalPropertyBy "mirror" Mirror StyleParam.Mirror.convert + |> DynObj.withOptionalProperty "ticklen" TickLen + |> DynObj.withOptionalProperty "tickwidth" TickWidth + |> DynObj.withOptionalProperty "tickcolor" TickColor + |> DynObj.withOptionalProperty "showticklabels" ShowTickLabels + |> DynObj.withOptionalPropertyBy "automargin" AutoMargin StyleParam.TickAutoMargin.convert + |> DynObj.withOptionalProperty "showspikes" ShowSpikes + |> DynObj.withOptionalProperty "spikecolor" SpikeColor + |> DynObj.withOptionalProperty "spikethickness" SpikeThickness + |> DynObj.withOptionalPropertyBy "spikedash" SpikeDash StyleParam.DrawingStyle.convert + |> DynObj.withOptionalPropertyBy "spikemode" SpikeMode StyleParam.SpikeMode.convert + |> DynObj.withOptionalPropertyBy "spikesnap" SpikeSnap StyleParam.SpikeSnap.convert + |> DynObj.withOptionalProperty "tickfont" TickFont + |> DynObj.withOptionalProperty "tickangle" TickAngle + |> DynObj.withOptionalPropertyBy "showtickprefix" ShowTickPrefix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalProperty "tickprefix" TickPrefix + |> DynObj.withOptionalPropertyBy "showticksuffix" ShowTickSuffix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalProperty "ticksuffix" TickSuffix + |> DynObj.withOptionalPropertyBy "showexponent" ShowExponent StyleParam.ShowExponent.convert + |> DynObj.withOptionalPropertyBy "exponentformat" ExponentFormat StyleParam.ExponentFormat.convert + |> DynObj.withOptionalProperty "minexponent" MinExponent + |> DynObj.withOptionalProperty "minor" Minor + |> DynObj.withOptionalProperty "separatethousands" SeparateThousands + |> DynObj.withOptionalProperty "tickformat" TickFormat + |> DynObj.withOptionalProperty "tickformatstops" TickFormatStops + |> DynObj.withOptionalProperty "hoverformat" HoverFormat + |> DynObj.withOptionalPropertyBy "insiderange" InsideRange StyleParam.Range.convert + |> DynObj.withOptionalProperty "showline" ShowLine + |> DynObj.withOptionalProperty "linecolor" LineColor + |> DynObj.withOptionalProperty "linewidth" LineWidth + |> DynObj.withOptionalProperty "showgrid" ShowGrid + |> DynObj.withOptionalProperty "gridcolor" GridColor + |> DynObj.withOptionalPropertyBy "griddash" GridDash StyleParam.DrawingStyle.convert + |> DynObj.withOptionalProperty "gridwidth" GridWidth + |> DynObj.withOptionalProperty "zeroline" ZeroLine + |> DynObj.withOptionalProperty "zerolinecolor" ZeroLineColor + |> DynObj.withOptionalProperty "zerolinewidth" ZeroLineWidth + |> DynObj.withOptionalProperty "shift" Shift + |> DynObj.withOptionalProperty "showdividers" ShowDividers + |> DynObj.withOptionalProperty "dividercolor" DividerColor + |> DynObj.withOptionalProperty "dividerwidth" DividerWidth + |> DynObj.withOptionalPropertyBy "anchor" Anchor StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "side" Side StyleParam.Side.convert + |> DynObj.withOptionalPropertyBy "overlaying" Overlaying StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "labelalias" LabelAlias + |> DynObj.withOptionalPropertyBy "layer" Layer StyleParam.Layer.convert + |> DynObj.withOptionalPropertyBy "domain" Domain StyleParam.Range.convert + |> DynObj.withOptionalProperty "position" Position + |> DynObj.withOptionalPropertyBy "categoryorder" CategoryOrder StyleParam.CategoryOrder.convert + |> DynObj.withOptionalProperty "categoryarray" CategoryArray + |> DynObj.withOptionalProperty "uirevision" UIRevision + |> DynObj.withOptionalProperty "rangeslider" RangeSlider + |> DynObj.withOptionalProperty "rangeselector" RangeSelector + |> DynObj.withOptionalPropertyBy "calendar" Calendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "arraydtick" ArrayDTick + |> DynObj.withOptionalProperty "arraytick0" ArrayTick0 + |> DynObj.withOptionalPropertyBy "cheatertype" CheaterType StyleParam.CheaterType.convert + |> DynObj.withOptionalProperty "endline" EndLine + |> DynObj.withOptionalProperty "endlinecolor" EndLineColor + |> DynObj.withOptionalProperty "endlinewidth" EndLineWidth + |> DynObj.withOptionalProperty "labelpadding" LabelPadding + |> DynObj.withOptionalProperty "labelprefix" LabelPrefix + |> DynObj.withOptionalProperty "labelsuffix" LabelSuffix + |> DynObj.withOptionalProperty "minorgridcolor" MinorGridColor + |> DynObj.withOptionalPropertyBy "minorgriddash" MinorGridDash StyleParam.DrawingStyle.convert + |> DynObj.withOptionalProperty "minorgridcount" MinorGridCount + |> DynObj.withOptionalProperty "minorgridwidth" MinorGridWidth + |> DynObj.withOptionalProperty "smoothing" Smoothing + |> DynObj.withOptionalProperty "startline" StartLine + |> DynObj.withOptionalProperty "startlinecolor" StartLineColor + |> DynObj.withOptionalProperty "startlinewidth" StartLineWidth + |> DynObj.withOptionalProperty "backgroundcolor" BackgroundColor + |> DynObj.withOptionalProperty "showbackground" ShowBackground + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Margin.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Margin.fs index 7cb8e62d7..602c62ac2 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Margin.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Margin.fs @@ -39,12 +39,12 @@ type Margin() = [] ?Autoexpand ) = (fun (margin: Margin) -> - Left |> DynObj.setValueOpt margin "l" - Right |> DynObj.setValueOpt margin "r" - Top |> DynObj.setValueOpt margin "t" - Bottom |> DynObj.setValueOpt margin "b" - Pad |> DynObj.setValueOpt margin "pad" - Autoexpand |> DynObj.setValueOpt margin "autoexpand" - - margin) + margin + |> DynObj.withOptionalProperty "l" Left + |> DynObj.withOptionalProperty "r" Right + |> DynObj.withOptionalProperty "t" Top + |> DynObj.withOptionalProperty "b" Bottom + |> DynObj.withOptionalProperty "pad" Pad + |> DynObj.withOptionalProperty "autoexpand" Autoexpand + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Minor.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Minor.fs index 67e00580d..c3300345a 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Minor.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Minor.fs @@ -92,18 +92,18 @@ type Minor() = ) = (fun (minor: Minor) -> - DTick |> DynObj.setValueOpt minor "dtick" - GridColor |> DynObj.setValueOpt minor "gridcolor" - GridDash |> DynObj.setValueOptBy minor "griddash" StyleParam.DrawingStyle.convert - GridWidth |> DynObj.setValueOpt minor "gridwidth" - NTicks |> DynObj.setValueOpt minor "nticks" - ShowGrid |> DynObj.setValueOpt minor "showgrid" - Tick0 |> DynObj.setValueOpt minor "tick0" - TickColor |> DynObj.setValueOpt minor "tickcolor" - TickLen |> DynObj.setValueOpt minor "ticklen" - TickMode |> DynObj.setValueOptBy minor "tickmode" StyleParam.TickMode.convert - Ticks |> DynObj.setValueOptBy minor "ticks" StyleParam.TickOptions.convert - TickVals |> DynObj.setValueOpt minor "tickvals" - TickWidth |> DynObj.setValueOpt minor "tickwidth" - - minor) + minor + |> DynObj.withOptionalProperty "dtick" DTick + |> DynObj.withOptionalProperty "gridcolor" GridColor + |> DynObj.withOptionalPropertyBy "griddash" GridDash StyleParam.DrawingStyle.convert + |> DynObj.withOptionalProperty "gridwidth" GridWidth + |> DynObj.withOptionalProperty "nticks" NTicks + |> DynObj.withOptionalProperty "showgrid" ShowGrid + |> DynObj.withOptionalProperty "tick0" Tick0 + |> DynObj.withOptionalProperty "tickcolor" TickColor + |> DynObj.withOptionalProperty "ticklen" TickLen + |> DynObj.withOptionalPropertyBy "tickmode" TickMode StyleParam.TickMode.convert + |> DynObj.withOptionalPropertyBy "ticks" Ticks StyleParam.TickOptions.convert + |> DynObj.withOptionalProperty "tickvals" TickVals + |> DynObj.withOptionalProperty "tickwidth" TickWidth + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ModeBar.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ModeBar.fs index 31b63cd9e..9a92096a7 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ModeBar.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ModeBar.fs @@ -41,12 +41,12 @@ type ModeBar() = ) = (fun (modeBar: ModeBar) -> - ActiveColor |> DynObj.setValueOpt modeBar "activecolor" - Add |> DynObj.setValueOpt modeBar "add" - BGColor |> DynObj.setValueOpt modeBar "bgcolor" - Color |> DynObj.setValueOpt modeBar "color" - Orientation |> DynObj.setValueOptBy modeBar "orientation" StyleParam.Orientation.convert - Remove |> DynObj.setValueOpt modeBar "remove" - UIRevision |> DynObj.setValueOpt modeBar "uirevision " - - modeBar) + modeBar + |> DynObj.withOptionalProperty "activecolor" ActiveColor + |> DynObj.withOptionalProperty "add" Add + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "remove" Remove + |> DynObj.withOptionalProperty "uirevision " UIRevision + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/NewSelection.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/NewSelection.fs index ee91cb5ca..c3f1c19f7 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/NewSelection.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/NewSelection.fs @@ -44,7 +44,7 @@ type NewSelection() = let line = Line.init (?Color = LineColor, ?Dash = LineDash, ?Width = LineWidth) - line |> DynObj.setValue newSelection "line" - Mode |> DynObj.setValueOptBy newSelection "mode" StyleParam.NewSelectionMode.convert - - newSelection) + newSelection + |> DynObj.withProperty "line" line + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.NewSelectionMode.convert + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/NewShape.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/NewShape.fs index 9040dc40f..a3e955b6f 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/NewShape.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/NewShape.fs @@ -13,7 +13,7 @@ type NewShape() = /// /// The name of the dynamic member to get the value of /// The NewShape to get the dynamic member value from - static member tryGetTypedMember<'T> (propName: string) (newShape:NewShape) = newShape.TryGetTypedValue<'T>(propName) + static member tryGetTypedMember<'T> (propName: string) (newShape:NewShape) = newShape.TryGetTypedPropertyValue<'T>(propName) /// /// Returns the Legend anchor of the given NewShape. @@ -38,9 +38,7 @@ type NewShape() = let id = StyleParam.SubPlotId.Legend legendId - (fun (newShape: NewShape) -> - newShape.SetValue("legend", StyleParam.SubPlotId.convert id) - newShape) + (fun (newShape: NewShape) -> newShape |> DynObj.withProperty "legend" (StyleParam.SubPlotId.convert id)) /// /// Returns a new NewShape object with the given styling. @@ -130,19 +128,19 @@ type NewShape() = ) = (fun (newShape: NewShape) -> - DrawDirection |> DynObj.setValueOptBy newShape "drawdirection" StyleParam.DrawDirection.convert - FillColor |> DynObj.setValueOpt newShape "fillcolor" - FillRule |> DynObj.setValueOptBy newShape "fillrule" StyleParam.FillRule.convert - Layer |> DynObj.setValueOptBy newShape "layer" StyleParam.Layer.convert - ShowLegend |> DynObj.setValueOpt newShape "showlegend" - Legend |> DynObj.setValueOptBy newShape "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt newShape "legendrank" - LegendGroup |> DynObj.setValueOpt newShape "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt newShape "legendgrouptitle" - LegendWidth |> DynObj.setValueOpt newShape "legendwidth" - Line |> DynObj.setValueOpt newShape "line" - Name |> DynObj.setValueOpt newShape "name" - Opacity |> DynObj.setValueOpt newShape "opacity" - Visible |> DynObj.setValueOptBy newShape "visible" StyleParam.Visible.convert - - newShape) + newShape + |> DynObj.withOptionalPropertyBy "drawdirection" DrawDirection StyleParam.DrawDirection.convert + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalPropertyBy "fillrule" FillRule StyleParam.FillRule.convert + |> DynObj.withOptionalPropertyBy "layer" Layer StyleParam.Layer.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "legendwidth" LegendWidth + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSelector.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSelector.fs index 537f97dd5..1248609b8 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSelector.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSelector.fs @@ -55,16 +55,16 @@ type RangeSelector() = ) = (fun (rangeSelector: RangeSelector) -> - Visible |> DynObj.setValueOpt rangeSelector "visible" - Buttons |> DynObj.setValueOpt rangeSelector "buttons" - X |> DynObj.setValueOpt rangeSelector "x" - XAnchor |> DynObj.setValueOptBy rangeSelector "xanchor" StyleParam.XAnchorPosition.convert - Y |> DynObj.setValueOpt rangeSelector "y" - YAnchor |> DynObj.setValueOptBy rangeSelector "yanchor" StyleParam.YAnchorPosition.convert - Font |> DynObj.setValueOpt rangeSelector "font" - BGColor |> DynObj.setValueOpt rangeSelector "bgcolor" - ActiveColor |> DynObj.setValueOpt rangeSelector "activecolor" - BorderColor |> DynObj.setValueOpt rangeSelector "bordercolor" - BorderWidth |> DynObj.setValueOpt rangeSelector "borderwidth" - - rangeSelector) + rangeSelector + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "buttons" Buttons + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.XAnchorPosition.convert + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.YAnchorPosition.convert + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "activecolor" ActiveColor + |> DynObj.withOptionalProperty "bordercolor" BorderColor + |> DynObj.withOptionalProperty "borderwidth" BorderWidth + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSlider.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSlider.fs index e3e0f07ba..c4ac8f5d0 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSlider.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSlider.fs @@ -50,21 +50,19 @@ type RangeSlider() = [] ?YAxisRange: StyleParam.Range ) = fun (rangeslider: RangeSlider) -> - BgColor |> DynObj.setValueOpt rangeslider "bgcolor" - BorderColor |> DynObj.setValueOpt rangeslider "bordercolor" - BorderWidth |> DynObj.setValueOpt rangeslider "borderwidth" - AutoRange |> DynObj.setValueOpt rangeslider "autorange" - Range |> DynObj.setValueOptBy rangeslider "range" StyleParam.Range.convert - Thickness |> DynObj.setValueOpt rangeslider "thickness" - Visible |> DynObj.setValueOpt rangeslider "visible" let yAxis = - let tmp = DynamicObj() - YAxisRangeMode |> DynObj.setValueOptBy tmp "rangemode" StyleParam.RangesliderRangeMode.convert - YAxisRange |> DynObj.setValueOptBy tmp "range" StyleParam.Range.convert - tmp - - yAxis |> DynObj.setValue rangeslider "yaxis" - + DynamicObj() + |> DynObj.withOptionalPropertyBy "rangemode" YAxisRangeMode StyleParam.RangesliderRangeMode.convert + |> DynObj.withOptionalPropertyBy "range" YAxisRange StyleParam.Range.convert rangeslider + |> DynObj.withOptionalProperty "bgcolor" BgColor + |> DynObj.withOptionalProperty "bordercolor" BorderColor + |> DynObj.withOptionalProperty "borderwidth" BorderWidth + |> DynObj.withOptionalProperty "autorange" AutoRange + |> DynObj.withOptionalPropertyBy "range" Range StyleParam.Range.convert + |> DynObj.withOptionalProperty "thickness" Thickness + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withProperty "yaxis" yAxis + diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Rangebreak.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Rangebreak.fs index d068097ed..2ed6a2c04 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Rangebreak.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Rangebreak.fs @@ -60,12 +60,13 @@ type Rangebreak() = [] ?TemplateItemName: string ) = (fun (rangebreak: Rangebreak) -> - Enabled |> DynObj.setValueOpt rangebreak "enabled" - Bounds |> DynObj.setValueOptBy rangebreak "bounds" (fun (a, b) -> [| a; b |]) - Pattern |> DynObj.setValueOptBy rangebreak "pattern" StyleParam.RangebreakPattern.convert - Values |> DynObj.setValueOpt rangebreak "values" - DValue |> DynObj.setValueOpt rangebreak "dvalue" - Name |> DynObj.setValueOpt rangebreak "name" - TemplateItemName |> DynObj.setValueOpt rangebreak "templateitemname" - rangebreak) + rangebreak + |> DynObj.withOptionalProperty "enabled" Enabled + |> DynObj.withOptionalPropertyBy "bounds" Bounds (fun (a, b) -> [| a; b |]) + |> DynObj.withOptionalPropertyBy "pattern" Pattern StyleParam.RangebreakPattern.convert + |> DynObj.withOptionalProperty "values" Values + |> DynObj.withOptionalProperty "dvalue" DValue + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Selection.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Selection.fs index 898b0cce0..7965c9104 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Selection.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Selection.fs @@ -86,17 +86,17 @@ type Selection() = ) = (fun (selection: Selection) -> - Line |> DynObj.setValueOpt selection "line" - Name |> DynObj.setValueOpt selection "name" - Opacity |> DynObj.setValueOpt selection "opacity" - Path |> DynObj.setValueOpt selection "path" - TemplateItemName |> DynObj.setValueOpt selection "templateitemname" - SelectionType |> DynObj.setValueOptBy selection "type" StyleParam.SelectionType.convert - X0 |> DynObj.setValueOpt selection "x0" - X1 |> DynObj.setValueOpt selection "x1" - Xref |> DynObj.setValueOpt selection "xref" - Y0 |> DynObj.setValueOpt selection "y0" - Y1 |> DynObj.setValueOpt selection "y1" - Yref |> DynObj.setValueOpt selection "yref" - - selection) + selection + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "path" Path + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + |> DynObj.withOptionalPropertyBy "type" SelectionType StyleParam.SelectionType.convert + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "x1" X1 + |> DynObj.withOptionalProperty "xref" Xref + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "y1" Y1 + |> DynObj.withOptionalProperty "yref" Yref + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Shape.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Shape.fs index a86e20aee..3c346a4d0 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Shape.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Shape.fs @@ -14,7 +14,7 @@ type Shape() = /// /// The name of the dynamic member to get the value of /// The shape to get the dynamic member value from - static member tryGetTypedMember<'T> (propName: string) (shape:Shape) = shape.TryGetTypedValue<'T>(propName) + static member tryGetTypedMember<'T> (propName: string) (shape:Shape) = shape.TryGetTypedPropertyValue<'T>(propName) /// /// Returns the Legend anchor of the given shape. @@ -39,9 +39,7 @@ type Shape() = let id = StyleParam.SubPlotId.Legend legendId - (fun (shape: Shape) -> - shape.SetValue("legend", StyleParam.SubPlotId.convert id) - shape) + (fun (shape: Shape) -> shape |> DynObj.withProperty "legend" (StyleParam.SubPlotId.convert id)) /// /// Returns a new Shape object with the given styling. @@ -199,35 +197,34 @@ type Shape() = [] ?Yref: string, [] ?YSizeMode: StyleParam.ShapeSizeMode ) = - (fun (shape: Shape) -> + fun (shape: Shape) -> - Editable |> DynObj.setValueOpt shape "editable" - FillColor |> DynObj.setValueOpt shape "fillcolor" - FillRule |> DynObj.setValueOptBy shape "fillrule" StyleParam.FillRule.convert - Label |> DynObj.setValueOpt shape "label" - ShowLegend |> DynObj.setValueOpt shape "showlegend" - Legend |> DynObj.setValueOptBy shape "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt shape "legendrank" - LegendGroup |> DynObj.setValueOpt shape "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt shape "legendgrouptitle" - LegendWidth |> DynObj.setValueOpt shape "legendwidth" - Layer |> DynObj.setValueOptBy shape "layer" StyleParam.Layer.convert - Line |> DynObj.setValueOpt shape "line" - Name |> DynObj.setValueOpt shape "name" - Opacity |> DynObj.setValueOpt shape "opacity" - Path |> DynObj.setValueOpt shape "path" - TemplateItemName |> DynObj.setValueOpt shape "templateitemname" - ShapeType |> DynObj.setValueOptBy shape "type" StyleParam.ShapeType.convert - Visible |> DynObj.setValueOpt shape "visible" - X0 |> DynObj.setValueOpt shape "x0" - X1 |> DynObj.setValueOpt shape "x1" - XAnchor |> DynObj.setValueOptBy shape "xanchor" StyleParam.LinearAxisId.convert - Xref |> DynObj.setValueOpt shape "xref" - XSizeMode |> DynObj.setValueOptBy shape "xsizemode" StyleParam.ShapeSizeMode.convert - Y0 |> DynObj.setValueOpt shape "y0" - Y1 |> DynObj.setValueOpt shape "y1" - YAnchor |> DynObj.setValueOptBy shape "yanchor" StyleParam.LinearAxisId.convert - Yref |> DynObj.setValueOpt shape "yref" - YSizeMode |> DynObj.setValueOptBy shape "ysizemode" StyleParam.ShapeSizeMode.convert - - shape) + shape + |> DynObj.withOptionalProperty "editable" Editable + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalPropertyBy "fillrule" FillRule StyleParam.FillRule.convert + |> DynObj.withOptionalProperty "label" Label + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "legendwidth" LegendWidth + |> DynObj.withOptionalPropertyBy "layer" Layer StyleParam.Layer.convert + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "path" Path + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + |> DynObj.withOptionalPropertyBy "type" ShapeType StyleParam.ShapeType.convert + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "x1" X1 + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "xref" Xref + |> DynObj.withOptionalPropertyBy "xsizemode" XSizeMode StyleParam.ShapeSizeMode.convert + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "y1" Y1 + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "yref" Yref + |> DynObj.withOptionalPropertyBy "ysizemode" YSizeMode StyleParam.ShapeSizeMode.convert diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ShapeLabel.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ShapeLabel.fs index 241c86a60..04713fa47 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ShapeLabel.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ShapeLabel.fs @@ -72,14 +72,13 @@ type ShapeLabel() = (fun (shapeLabel: ShapeLabel) -> - Font |> DynObj.setValueOpt shapeLabel "font" - Padding |> DynObj.setValueOpt shapeLabel "padding" - Text |> DynObj.setValueOpt shapeLabel "text" - TextAngle |> DynObj.setValueOptBy shapeLabel "textangle" StyleParam.TextAngle.convert - TextPosition |> DynObj.setValueOptBy shapeLabel "textposition" StyleParam.TextPosition.convert - TextTemplate |> DynObj.setValueOpt shapeLabel "texttemplate" - XAnchor |> DynObj.setValueOptBy shapeLabel "xanchor" StyleParam.XAnchorPosition.convert - YAnchor |> DynObj.setValueOptBy shapeLabel "yanchor" StyleParam.YAnchorPosition.convert - shapeLabel + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "padding" Padding + |> DynObj.withOptionalProperty "text" Text + |> DynObj.withOptionalPropertyBy "textangle" TextAngle StyleParam.TextAngle.convert + |> DynObj.withOptionalPropertyBy "textposition" TextPosition StyleParam.TextPosition.convert + |> DynObj.withOptionalProperty "texttemplate" TextTemplate + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.XAnchorPosition.convert + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.YAnchorPosition.convert ) \ No newline at end of file diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/Slider.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/Slider.fs index 18c12e2db..746a6b7fb 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/Slider.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/Slider.fs @@ -141,28 +141,28 @@ type Slider() = ?YAnchor: StyleParam.YAnchorPosition ) = (fun (slider: Slider) -> - Active |> DynObj.setValueOpt slider "active" - ActiveBgColor |> DynObj.setValueOpt slider "activebgcolor" - BgColor |> DynObj.setValueOpt slider "bgcolor" - BorderColor |> DynObj.setValueOpt slider "bordercolor" - BorderWidth |> DynObj.setValueOpt slider "borderwidth" - CurrentValue |> DynObj.setValueOpt slider "currentvalue" - Font |> DynObj.setValueOpt slider "font" - Len |> DynObj.setValueOpt slider "len" - LenMode |> DynObj.setValueOptBy slider "lenmode" StyleParam.UnitMode.convert - MinorTickLen |> DynObj.setValueOpt slider "minorticklen" - Name |> DynObj.setValueOpt slider "name" - Padding |> DynObj.setValueOpt slider "pad" - Steps |> DynObj.setValueOpt slider "steps" - TemplateItemName |> DynObj.setValueOpt slider "templateitemname" - TickColor |> DynObj.setValueOpt slider "tickcolor" - TickLen |> DynObj.setValueOpt slider "ticklen" - TickWidth |> DynObj.setValueOpt slider "tickwidth" - Transition |> DynObj.setValueOpt slider "transition" - Visible |> DynObj.setValueOpt slider "visible" - X |> DynObj.setValueOpt slider "x" - XAnchor |> DynObj.setValueOptBy slider "xanchor" StyleParam.XAnchorPosition.convert - Y |> DynObj.setValueOpt slider "y" - YAnchor |> DynObj.setValueOptBy slider "yanchor" StyleParam.YAnchorPosition.convert - - slider) + slider + |> DynObj.withOptionalProperty "active" Active + |> DynObj.withOptionalProperty "activebgcolor" ActiveBgColor + |> DynObj.withOptionalProperty "bgcolor" BgColor + |> DynObj.withOptionalProperty "bordercolor" BorderColor + |> DynObj.withOptionalProperty "borderwidth" BorderWidth + |> DynObj.withOptionalProperty "currentvalue" CurrentValue + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "len" Len + |> DynObj.withOptionalPropertyBy "lenmode" LenMode StyleParam.UnitMode.convert + |> DynObj.withOptionalProperty "minorticklen" MinorTickLen + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "pad" Padding + |> DynObj.withOptionalProperty "steps" Steps + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + |> DynObj.withOptionalProperty "tickcolor" TickColor + |> DynObj.withOptionalProperty "ticklen" TickLen + |> DynObj.withOptionalProperty "tickwidth" TickWidth + |> DynObj.withOptionalProperty "transition" Transition + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.XAnchorPosition.convert + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.YAnchorPosition.convert + ) \ No newline at end of file diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/SliderCurrentValue.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/SliderCurrentValue.fs index 68d456a54..a457e9383 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/SliderCurrentValue.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/SliderCurrentValue.fs @@ -50,10 +50,12 @@ type SliderCurrentValue() = if autoValueIsProvided then printf "The value '%s' is not supported by CurrentValue" (StyleParam.XAnchorPosition.Auto |> string) - Font |> DynObj.setValueOpt currentValue "font" - Offset |> DynObj.setValueOpt currentValue "offset" - Prefix |> DynObj.setValueOpt currentValue "prefix" - Suffix |> DynObj.setValueOpt currentValue "suffix" - Visible |> DynObj.setValueOpt currentValue "visible" - XAnchor |> DynObj.setValueOptBy currentValue "xanchor" StyleParam.XAnchorPosition.convert - currentValue) + currentValue + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "offset" Offset + |> DynObj.withOptionalProperty "prefix" Prefix + |> DynObj.withOptionalProperty "suffix" Suffix + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.XAnchorPosition.convert + ) + diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/SliderStep.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/SliderStep.fs index ccea6afb6..7b48e4e61 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/SliderStep.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Slider/SliderStep.fs @@ -80,12 +80,13 @@ type SliderStep() = let argsAsDictionaries = Args |> Option.map (fun args -> args |> Seq.map (fun arg -> [ arg ] |> dict)) - argsAsDictionaries |> DynObj.setValueOpt step "args" - Execute |> DynObj.setValueOpt step "execute" - Label |> DynObj.setValueOpt step "label" - Method |> DynObj.setValueOptBy step "method" StyleParam.Method.convert - Name |> DynObj.setValueOpt step "name" - TemplateItemName |> DynObj.setValueOpt step "templateitemname" - Value |> DynObj.setValueOpt step "value" - Visible |> DynObj.setValueOpt step "visible" - step) + step + |> DynObj.withOptionalProperty "args" argsAsDictionaries + |> DynObj.withOptionalProperty "execute" Execute + |> DynObj.withOptionalProperty "label" Label + |> DynObj.withOptionalPropertyBy "method" Method StyleParam.Method.convert + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + |> DynObj.withOptionalProperty "value" Value + |> DynObj.withOptionalProperty "visible" Visible + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Transition.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Transition.fs index 11b2a9485..8c5c433f3 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Transition.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Transition.fs @@ -24,8 +24,9 @@ type Transition() = ) = (fun (transition: Transition) -> - Duration |> DynObj.setValueOpt transition "duration" - Easing |> DynObj.setValueOptBy transition "easing" StyleParam.TransitionEasing.convert - Ordering |> DynObj.setValueOptBy transition "ordering" StyleParam.TransitionOrdering.convert + transition + |> DynObj.withOptionalProperty "duration" Duration + |> DynObj.withOptionalPropertyBy "easing" Easing StyleParam.TransitionEasing.convert + |> DynObj.withOptionalPropertyBy "ordering" Ordering StyleParam.TransitionOrdering.convert - transition) + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/UniformText.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/UniformText.fs index f065418c0..1bd4a33c5 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/UniformText.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/UniformText.fs @@ -22,7 +22,7 @@ type UniformText() = ) = (fun (uniformText: UniformText) -> - MinSize |> DynObj.setValueOpt uniformText "minsize" - Mode |> DynObj.setValueOptBy uniformText "mode" StyleParam.UniformTextMode.convert - - uniformText) + uniformText + |> DynObj.withOptionalProperty "minsize" MinSize + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.UniformTextMode.convert + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/UpdateMenu.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/UpdateMenu.fs index f0607cf74..e00a28491 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Common/UpdateMenu.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/UpdateMenu.fs @@ -45,17 +45,16 @@ type UpdateMenuButton() = ) = (fun (updateMenuButton: UpdateMenuButton) -> - Args |> DynObj.setValueOpt updateMenuButton "args" - Args2 |> DynObj.setValueOpt updateMenuButton "args2" - Execute |> DynObj.setValueOpt updateMenuButton "execute" - Label |> DynObj.setValueOpt updateMenuButton "label" - Method |> DynObj.setValueOptBy updateMenuButton "method" StyleParam.UpdateMethod.convert - Name |> DynObj.setValueOpt updateMenuButton "name" - TemplateItemName |> DynObj.setValueOpt updateMenuButton "templateitemname" - Visible |> DynObj.setValueOpt updateMenuButton "visible" - - - updateMenuButton) + updateMenuButton + |> DynObj.withOptionalProperty "args" Args + |> DynObj.withOptionalProperty "args2" Args2 + |> DynObj.withOptionalProperty "execute" Execute + |> DynObj.withOptionalProperty "label" Label + |> DynObj.withOptionalPropertyBy "method" Method StyleParam.UpdateMethod.convert + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + |> DynObj.withOptionalProperty "visible" Visible + ) type UpdateMenu() = inherit DynamicObj() @@ -121,21 +120,21 @@ type UpdateMenu() = ) = (fun (updateMenu: UpdateMenu) -> - Active |> DynObj.setValueOpt updateMenu "active" - BGColor |> DynObj.setValueOpt updateMenu "bgcolor" - BorderColor |> DynObj.setValueOpt updateMenu "bordercolor" - Buttons |> DynObj.setValueOpt updateMenu "buttons" - Direction |> DynObj.setValueOptBy updateMenu "direction" StyleParam.UpdateMenuDirection.convert - Font |> DynObj.setValueOpt updateMenu "font" - Name |> DynObj.setValueOpt updateMenu "name" - Pad |> DynObj.setValueOpt updateMenu "pad" - ShowActive |> DynObj.setValueOpt updateMenu "showactive" - TemplateItemName |> DynObj.setValueOpt updateMenu "templateitemname" - Type |> DynObj.setValueOptBy updateMenu "type" StyleParam.UpdateMenuType.convert - Visible |> DynObj.setValueOpt updateMenu "visible" - X |> DynObj.setValueOpt updateMenu "x" - XAnchor |> DynObj.setValueOptBy updateMenu "xanchor" StyleParam.XAnchorPosition.convert - Y |> DynObj.setValueOpt updateMenu "y" - YAnchor |> DynObj.setValueOptBy updateMenu "yanchor" StyleParam.YAnchorPosition.convert - - updateMenu) + updateMenu + |> DynObj.withOptionalProperty "active" Active + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "bordercolor" BorderColor + |> DynObj.withOptionalProperty "buttons" Buttons + |> DynObj.withOptionalPropertyBy "direction" Direction StyleParam.UpdateMenuDirection.convert + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "pad" Pad + |> DynObj.withOptionalProperty "showactive" ShowActive + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + |> DynObj.withOptionalPropertyBy "type" Type StyleParam.UpdateMenuType.convert + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalPropertyBy "xanchor" XAnchor StyleParam.XAnchorPosition.convert + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalPropertyBy "yanchor" YAnchor StyleParam.YAnchorPosition.convert + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Map/Geo.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/Geo.fs index 61bd3fe87..997e90dc5 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Map/Geo.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/Geo.fs @@ -177,46 +177,45 @@ type Geo() = [] ?LatAxis: LinearAxis, [] ?LonAxis: LinearAxis ) = - (fun (geo: Geo) -> + fun (geo: Geo) -> - Domain |> DynObj.setValueOpt geo "domain" - FitBounds |> DynObj.setValueOptBy geo "fitbounds" StyleParam.GeoFitBounds.convert - Resolution |> DynObj.setValueOptBy geo "resolution" StyleParam.GeoResolution.convert - Scope |> DynObj.setValueOptBy geo "scope" StyleParam.GeoScope.convert - Projection |> DynObj.setValueOpt geo "projection" + let center = + Center + |> Option.map (fun (lon, lat) -> + DynamicObj() + |> DynObj.withProperty "lon" lon + |> DynObj.withProperty "lat" lat + ) - Center - |> Option.map (fun (lon, lat) -> - let t = DynamicObj() - t?lon <- lon - t?lat <- lat - t) - |> DynObj.setValueOpt geo "center" - - Visible |> DynObj.setValueOpt geo "visible" - ShowCoastLines |> DynObj.setValueOpt geo "showcoastline" - CoastLineColor |> DynObj.setValueOpt geo "coastlinecolor" - CoastLineWidth |> DynObj.setValueOpt geo "coastlinewidth" - ShowLand |> DynObj.setValueOpt geo "showland" - LandColor |> DynObj.setValueOpt geo "landcolor" - ShowOcean |> DynObj.setValueOpt geo "showocean" - OceanColor |> DynObj.setValueOpt geo "oceancolor" - ShowLakes |> DynObj.setValueOpt geo "showlakes" - LakeColor |> DynObj.setValueOpt geo "lakecolor" - ShowRivers |> DynObj.setValueOpt geo "showrivers" - RiverColor |> DynObj.setValueOpt geo "rivercolor" - RiverWidth |> DynObj.setValueOpt geo "riverwidth" - ShowCountries |> DynObj.setValueOpt geo "showcountries" - CountryColor |> DynObj.setValueOpt geo "countrycolor" - CountryWidth |> DynObj.setValueOpt geo "countrywidth" - ShowSubunits |> DynObj.setValueOpt geo "showsubunits" - SubunitColor |> DynObj.setValueOpt geo "subunitcolor" - SubunitWidth |> DynObj.setValueOpt geo "subunitwidth" - ShowFrame |> DynObj.setValueOpt geo "showframe" - FrameColor |> DynObj.setValueOpt geo "framecolor" - FrameWidth |> DynObj.setValueOpt geo "framewidth" - BgColor |> DynObj.setValueOpt geo "bgcolor" - LatAxis |> DynObj.setValueOpt geo "lataxis" - LonAxis |> DynObj.setValueOpt geo "lonaxis" - - geo) + geo + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalPropertyBy "fitbounds" FitBounds StyleParam.GeoFitBounds.convert + |> DynObj.withOptionalPropertyBy "resolution" Resolution StyleParam.GeoResolution.convert + |> DynObj.withOptionalPropertyBy "scope" Scope StyleParam.GeoScope.convert + |> DynObj.withOptionalProperty "projection" Projection + |> DynObj.withOptionalProperty "center" center + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "showcoastline" ShowCoastLines + |> DynObj.withOptionalProperty "coastlinecolor" CoastLineColor + |> DynObj.withOptionalProperty "coastlinewidth" CoastLineWidth + |> DynObj.withOptionalProperty "showland" ShowLand + |> DynObj.withOptionalProperty "landcolor" LandColor + |> DynObj.withOptionalProperty "showocean" ShowOcean + |> DynObj.withOptionalProperty "oceancolor" OceanColor + |> DynObj.withOptionalProperty "showlakes" ShowLakes + |> DynObj.withOptionalProperty "lakecolor" LakeColor + |> DynObj.withOptionalProperty "showrivers" ShowRivers + |> DynObj.withOptionalProperty "rivercolor" RiverColor + |> DynObj.withOptionalProperty "riverwidth" RiverWidth + |> DynObj.withOptionalProperty "showcountries" ShowCountries + |> DynObj.withOptionalProperty "countrycolor" CountryColor + |> DynObj.withOptionalProperty "countrywidth" CountryWidth + |> DynObj.withOptionalProperty "showsubunits" ShowSubunits + |> DynObj.withOptionalProperty "subunitcolor" SubunitColor + |> DynObj.withOptionalProperty "subunitwidth" SubunitWidth + |> DynObj.withOptionalProperty "showframe" ShowFrame + |> DynObj.withOptionalProperty "framecolor" FrameColor + |> DynObj.withOptionalProperty "framewidth" FrameWidth + |> DynObj.withOptionalProperty "bgcolor" BgColor + |> DynObj.withOptionalProperty "lataxis" LatAxis + |> DynObj.withOptionalProperty "lonaxis" LonAxis diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Map/GeoProjection.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/GeoProjection.fs index 1bb3163fd..64b946f5a 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Map/GeoProjection.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/GeoProjection.fs @@ -32,12 +32,12 @@ type GeoProjectionRotation() = [] ?Latitude: float, [] ?Roll: int ) = - (fun (rotation: GeoProjectionRotation) -> - Longitude |> DynObj.setValueOpt rotation "lon" - Latitude |> DynObj.setValueOpt rotation "lat" - Roll |> DynObj.setValueOpt rotation "roll" + fun (rotation: GeoProjectionRotation) -> - rotation) + rotation + |> DynObj.withOptionalProperty "lon" Longitude + |> DynObj.withOptionalProperty "lat" Latitude + |> DynObj.withOptionalProperty "roll" Roll /// Determines the map projection in geo traces. type GeoProjection() = @@ -75,13 +75,10 @@ type GeoProjection() = [] ?Parallels: (float * float), [] ?Scale: float ) = - (fun (projection: GeoProjection) -> + fun (projection: GeoProjection) -> - projectionType |> StyleParam.GeoProjectionType.convert |> DynObj.setValue projection "type" - - Parallels |> Option.map (fun (a, b) -> sprintf "[%f,%f]" a b) |> DynObj.setValueOpt projection "parallels" - - Rotation |> DynObj.setValueOpt projection "rotation" - Scale |> DynObj.setValueOpt projection "scale" - - projection) + projection + |> DynObj.withProperty "type" (StyleParam.GeoProjectionType.convert projectionType) + |> DynObj.withOptionalProperty "rotation" Rotation + |> DynObj.withOptionalPropertyBy "parallels" Parallels (fun (a, b) -> sprintf "[%f,%f]" a b) + |> DynObj.withOptionalProperty "scale" Scale diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Map/Mapbox.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/Mapbox.fs index d65351e0d..975d613c2 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Map/Mapbox.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/Mapbox.fs @@ -69,24 +69,23 @@ type Mapbox() = [] ?Pitch: float, [] ?Layers: seq ) = - (fun (mapBox: Mapbox) -> + fun (mapBox: Mapbox) -> - Domain |> DynObj.setValueOpt mapBox "domain" - AccessToken |> DynObj.setValueOpt mapBox "accesstoken" - Style |> DynObj.setValueOptBy mapBox "style" StyleParam.MapboxStyle.convert - Bounds |> DynObj.setValueOpt mapBox "bounds" + let center = + Center + |> Option.map (fun (lon, lat) -> + DynamicObj() + |> DynObj.withProperty "lon" lon + |> DynObj.withProperty "lat" lat + ) - Center - |> Option.map (fun (lon, lat) -> - let t = DynamicObj() - t?lon <- lon - t?lat <- lat - t) - |> DynObj.setValueOpt mapBox "center" - - Zoom |> DynObj.setValueOpt mapBox "zoom" - Bearing |> DynObj.setValueOpt mapBox "bearing" - Pitch |> DynObj.setValueOpt mapBox "pitch" - Layers |> DynObj.setValueOpt mapBox "layers" - - mapBox) + mapBox + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "accesstoken" AccessToken + |> DynObj.withOptionalPropertyBy "style" Style StyleParam.MapboxStyle.convert + |> DynObj.withOptionalProperty "bounds" Bounds + |> DynObj.withOptionalProperty "center" center + |> DynObj.withOptionalProperty "zoom" Zoom + |> DynObj.withOptionalProperty "bearing" Bearing + |> DynObj.withOptionalProperty "pitch" Pitch + |> DynObj.withOptionalProperty "layers" Layers diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxBounds.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxBounds.fs index 9de578b7a..383480478 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxBounds.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxBounds.fs @@ -40,11 +40,10 @@ type MapboxBounds() = [] ?South: float, [] ?West: float ) = - (fun (mapboxBounds: MapboxBounds) -> + fun (mapboxBounds: MapboxBounds) -> - East |> DynObj.setValueOpt mapboxBounds "east" - North |> DynObj.setValueOpt mapboxBounds "north" - South |> DynObj.setValueOpt mapboxBounds "south" - West |> DynObj.setValueOpt mapboxBounds "west" - - mapboxBounds) + mapboxBounds + |> DynObj.withOptionalProperty "east" East + |> DynObj.withOptionalProperty "north" North + |> DynObj.withOptionalProperty "south" South + |> DynObj.withOptionalProperty "west" West \ No newline at end of file diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxCluster.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxCluster.fs index d1ddccb7d..e390ec21a 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxCluster.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxCluster.fs @@ -67,13 +67,11 @@ type MapboxCluster() = [] ?MultiStep: seq ) = - (fun (mapboxCluster: MapboxCluster) -> - - Color |> DynObj.setValueOpt mapboxCluster "color" - Enabled |> DynObj.setValueOpt mapboxCluster "enabled" - MaxZoom |> DynObj.setValueOpt mapboxCluster "maxzoom" - Opacity |> DynObj.setValueOpt mapboxCluster "opacity" - (Size, MultiSize) |> DynObj.setSingleOrMultiOpt mapboxCluster "size" - (Step, MultiStep) |> DynObj.setSingleOrMultiOpt mapboxCluster "step" - - mapboxCluster) + fun (mapboxCluster: MapboxCluster) -> + mapboxCluster + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "enabled" Enabled + |> DynObj.withOptionalProperty "maxzoom" MaxZoom + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalSingleOrMultiProperty"size" (Size, MultiSize) + |> DynObj.withOptionalSingleOrMultiProperty"step" (Step, MultiStep) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayer.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayer.fs index 548a7172c..baf700109 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayer.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayer.fs @@ -75,38 +75,35 @@ type MapboxLayer() = [] ?Symbol: MapboxLayerSymbol, [] ?Name: string ) = - (fun (mapBoxLayer: MapboxLayer) -> + fun (mapBoxLayer: MapboxLayer) -> - Visible |> DynObj.setValueOpt mapBoxLayer "visible" - SourceType |> DynObj.setValueOptBy mapBoxLayer "sourcetype" StyleParam.MapboxLayerSourceType.convert - Source |> DynObj.setValueOpt mapBoxLayer "source" - SourceLayer |> DynObj.setValueOpt mapBoxLayer "sourcelayer" - SourceAttribution |> DynObj.setValueOpt mapBoxLayer "sourceattribution" - Type |> DynObj.setValueOptBy mapBoxLayer "type" StyleParam.MapboxLayerType.convert - Coordinates |> DynObj.setValueOpt mapBoxLayer "coordinates" - Below |> DynObj.setValueOpt mapBoxLayer "below" - Color |> DynObj.setValueOpt mapBoxLayer "color" - Opacity |> DynObj.setValueOpt mapBoxLayer "opacity" - MinZoom |> DynObj.setValueOpt mapBoxLayer "minzoom" - MaxZoom |> DynObj.setValueOpt mapBoxLayer "maxzoom" + let circle = + CircleRadius + |> Option.map (fun r -> + DynamicObj() |> DynObj.withProperty "radius" r + ) - CircleRadius - |> Option.map (fun r -> - let circle = DynamicObj() - circle?radius <- r - circle) - |> DynObj.setValueOpt mapBoxLayer "circle" + let fill = + FillOutlineColor + |> Option.map (fun c -> + DynamicObj() |> DynObj.withProperty "outlinecolor" c + ) - Line |> DynObj.setValueOpt mapBoxLayer "line" - - FillOutlineColor - |> Option.map (fun c -> - let fill = DynamicObj() - fill?outlinecolor <- c - fill) - |> DynObj.setValueOpt mapBoxLayer "fill" - - Symbol |> DynObj.setValueOpt mapBoxLayer "symbol" - Name |> DynObj.setValueOpt mapBoxLayer "name" - - mapBoxLayer) + mapBoxLayer + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalPropertyBy "sourcetype" SourceType StyleParam.MapboxLayerSourceType.convert + |> DynObj.withOptionalProperty "source" Source + |> DynObj.withOptionalProperty "sourcelayer" SourceLayer + |> DynObj.withOptionalProperty "sourceattribution" SourceAttribution + |> DynObj.withOptionalPropertyBy "type" Type StyleParam.MapboxLayerType.convert + |> DynObj.withOptionalProperty "coordinates" Coordinates + |> DynObj.withOptionalProperty "below" Below + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "minzoom" MinZoom + |> DynObj.withOptionalProperty "maxzoom" MaxZoom + |> DynObj.withOptionalProperty "circle" circle + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "fill" fill + |> DynObj.withOptionalProperty "symbol" Symbol + |> DynObj.withOptionalProperty "name" Name diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayerSymbol.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayerSymbol.fs index 2d2277c5b..658424fe0 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayerSymbol.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayerSymbol.fs @@ -42,17 +42,12 @@ type MapboxLayerSymbol() = [] ?TextFont: Font, [] ?TextPosition: StyleParam.TextPosition ) = - (fun (mapBoxLayerSymbol: MapboxLayerSymbol) -> - - Icon |> DynObj.setValueOpt mapBoxLayerSymbol "icon" - IconSize |> DynObj.setValueOpt mapBoxLayerSymbol "iconsize" - Text |> DynObj.setValueOpt mapBoxLayerSymbol "text" - - Placement - |> DynObj.setValueOptBy mapBoxLayerSymbol "placement" StyleParam.MapboxLayerSymbolPlacement.convert - - TextFont |> DynObj.setValueOpt mapBoxLayerSymbol "textfont" - TextPosition |> DynObj.setValueOptBy mapBoxLayerSymbol "textposition" StyleParam.TextPosition.convert - - - mapBoxLayerSymbol) + fun (mapBoxLayerSymbol: MapboxLayerSymbol) -> + + mapBoxLayerSymbol + |> DynObj.withOptionalProperty "icon" Icon + |> DynObj.withOptionalProperty "iconsize" IconSize + |> DynObj.withOptionalProperty "text" Text + |> DynObj.withOptionalPropertyBy "placement" Placement StyleParam.MapboxLayerSymbolPlacement.convert + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalPropertyBy "textposition" TextPosition StyleParam.TextPosition.convert diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Polar/AngularAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/AngularAxis.fs index 8d885cf98..b421523bc 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Polar/AngularAxis.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/AngularAxis.fs @@ -253,50 +253,49 @@ type AngularAxis() = ) = fun (angularAxis: AngularAxis) -> - Visible |> DynObj.setValueOpt angularAxis "visible" - AxisType |> DynObj.setValueOptBy angularAxis "type" StyleParam.AxisType.convert - AutoTypeNumbers |> DynObj.setValueOptBy angularAxis "autotypenumbers" StyleParam.AutoTypeNumbers.convert - CategoryOrder |> DynObj.setValueOptBy angularAxis "categoryorder" StyleParam.CategoryOrder.convert - CategoryArray |> DynObj.setValueOpt angularAxis "categoryarray" - ThetaUnit |> DynObj.setValueOpt angularAxis "thetaunit" - Period |> DynObj.setValueOpt angularAxis "period" - Direction |> DynObj.setValueOptBy angularAxis "direction" StyleParam.Direction.convert - Rotation |> DynObj.setValueOpt angularAxis "rotation" - HoverFormat |> DynObj.setValueOpt angularAxis "hoverformat" - UIRevision |> DynObj.setValueOpt angularAxis "uirevision" - Color |> DynObj.setValueOpt angularAxis "color" - ShowLine |> DynObj.setValueOpt angularAxis "showline" - LineColor |> DynObj.setValueOpt angularAxis "linecolor" - LineWidth |> DynObj.setValueOpt angularAxis "linewidth" - ShowGrid |> DynObj.setValueOpt angularAxis "showgrid" - GridColor |> DynObj.setValueOpt angularAxis "gridcolor" - GridDash |> DynObj.setValueOptBy angularAxis "griddash" StyleParam.DrawingStyle.convert - GridWidth |> DynObj.setValueOpt angularAxis "gridwidth" - TickMode |> DynObj.setValueOptBy angularAxis "tickmode" StyleParam.TickMode.convert - NTicks |> DynObj.setValueOpt angularAxis "nticks" - Tick0 |> DynObj.setValueOpt angularAxis "tick0" - DTick |> DynObj.setValueOpt angularAxis "dtick" - TickVals |> DynObj.setValueOpt angularAxis "tickvals" - TickText |> DynObj.setValueOpt angularAxis "ticktext" - Ticks |> DynObj.setValueOptBy angularAxis "ticks" StyleParam.TickOptions.convert - TickLen |> DynObj.setValueOpt angularAxis "ticklen" - TickWidth |> DynObj.setValueOpt angularAxis "tickwidth" - TickColor |> DynObj.setValueOpt angularAxis "tickcolor" - ShowTickLabels |> DynObj.setValueOpt angularAxis "showticklabels" - ShowTickPrefix |> DynObj.setValueOptBy angularAxis "showtickprefix" StyleParam.ShowTickOption.convert - TickPrefix |> DynObj.setValueOpt angularAxis "tickprefix" - ShowTickSuffix |> DynObj.setValueOptBy angularAxis "showticksuffix" StyleParam.ShowTickOption.convert - TickSuffix |> DynObj.setValueOpt angularAxis "ticksuffix" - ShowExponent |> DynObj.setValueOptBy angularAxis "showexponent" StyleParam.ShowExponent.convert - ExponentFormat |> DynObj.setValueOptBy angularAxis "exponentformat" StyleParam.ExponentFormat.convert - MinExponent |> DynObj.setValueOpt angularAxis "minexponent" - SeparateThousands |> DynObj.setValueOpt angularAxis "separatethousands" - TickFont |> DynObj.setValueOpt angularAxis "tickfont" - TickAngle |> DynObj.setValueOpt angularAxis "tickangle" - TickFormat |> DynObj.setValueOpt angularAxis "tickformat" - TickFormatStops |> DynObj.setValueOpt angularAxis "tickformatstops" - TickLabelStep |> DynObj.setValueOpt angularAxis "ticklabelstep" - LabelAlias |> DynObj.setValueOpt angularAxis "labelalias" - Layer |> DynObj.setValueOptBy angularAxis "layer" StyleParam.Layer.convert - angularAxis + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalPropertyBy "type" AxisType StyleParam.AxisType.convert + |> DynObj.withOptionalPropertyBy "autotypenumbers" AutoTypeNumbers StyleParam.AutoTypeNumbers.convert + |> DynObj.withOptionalPropertyBy "categoryorder" CategoryOrder StyleParam.CategoryOrder.convert + |> DynObj.withOptionalProperty "categoryarray" CategoryArray + |> DynObj.withOptionalProperty "thetaunit" ThetaUnit + |> DynObj.withOptionalProperty "period" Period + |> DynObj.withOptionalPropertyBy "direction" Direction StyleParam.Direction.convert + |> DynObj.withOptionalProperty "rotation" Rotation + |> DynObj.withOptionalProperty "hoverformat" HoverFormat + |> DynObj.withOptionalProperty "uirevision" UIRevision + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "showline" ShowLine + |> DynObj.withOptionalProperty "linecolor" LineColor + |> DynObj.withOptionalProperty "linewidth" LineWidth + |> DynObj.withOptionalProperty "showgrid" ShowGrid + |> DynObj.withOptionalProperty "gridcolor" GridColor + |> DynObj.withOptionalPropertyBy "griddash" GridDash StyleParam.DrawingStyle.convert + |> DynObj.withOptionalProperty "gridwidth" GridWidth + |> DynObj.withOptionalPropertyBy "tickmode" TickMode StyleParam.TickMode.convert + |> DynObj.withOptionalProperty "nticks" NTicks + |> DynObj.withOptionalProperty "tick0" Tick0 + |> DynObj.withOptionalProperty "dtick" DTick + |> DynObj.withOptionalProperty "tickvals" TickVals + |> DynObj.withOptionalProperty "ticktext" TickText + |> DynObj.withOptionalPropertyBy "ticks" Ticks StyleParam.TickOptions.convert + |> DynObj.withOptionalProperty "ticklen" TickLen + |> DynObj.withOptionalProperty "tickwidth" TickWidth + |> DynObj.withOptionalProperty "tickcolor" TickColor + |> DynObj.withOptionalProperty "showticklabels" ShowTickLabels + |> DynObj.withOptionalPropertyBy "showtickprefix" ShowTickPrefix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalProperty "tickprefix" TickPrefix + |> DynObj.withOptionalPropertyBy "showticksuffix" ShowTickSuffix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalProperty "ticksuffix" TickSuffix + |> DynObj.withOptionalPropertyBy "showexponent" ShowExponent StyleParam.ShowExponent.convert + |> DynObj.withOptionalPropertyBy "exponentformat" ExponentFormat StyleParam.ExponentFormat.convert + |> DynObj.withOptionalProperty "minexponent" MinExponent + |> DynObj.withOptionalProperty "separatethousands" SeparateThousands + |> DynObj.withOptionalProperty "tickfont" TickFont + |> DynObj.withOptionalProperty "tickangle" TickAngle + |> DynObj.withOptionalProperty "tickformat" TickFormat + |> DynObj.withOptionalProperty "tickformatstops" TickFormatStops + |> DynObj.withOptionalProperty "ticklabelstep" TickLabelStep + |> DynObj.withOptionalProperty "labelalias" LabelAlias + |> DynObj.withOptionalPropertyBy "layer" Layer StyleParam.Layer.convert diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Polar/Polar.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/Polar.fs index af2793048..36bf8b523 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Polar/Polar.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/Polar.fs @@ -69,27 +69,25 @@ type Polar() = [] ?BarMode: StyleParam.BarMode, [] ?BarGap: float ) = - (fun (polar: Polar) -> - - Domain |> DynObj.setValueOpt polar "domain" - Sector |> DynObj.setValueOptBy polar "sector" (fun (a, b) -> [| a; b |]) - Hole |> DynObj.setValueOpt polar "hole" - BGColor |> DynObj.setValueOpt polar "bgcolor" - RadialAxis |> DynObj.setValueOpt polar "radialaxis" - AngularAxis |> DynObj.setValueOpt polar "angularaxis" - GridShape |> DynObj.setValueOptBy polar "gridshape" StyleParam.PolarGridShape.convert - UIRevision |> DynObj.setValueOpt polar "uirevision" - BarMode |> DynObj.setValueOptBy polar "barmode" StyleParam.BarMode.convert - BarGap |> DynObj.setValueOpt polar "bargap" - - polar) + fun (polar: Polar) -> + polar + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalPropertyBy "sector" Sector (fun (a, b) -> [| a; b |]) + |> DynObj.withOptionalProperty "hole" Hole + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "radialaxis" RadialAxis + |> DynObj.withOptionalProperty "angularaxis" AngularAxis + |> DynObj.withOptionalPropertyBy "gridshape" GridShape StyleParam.PolarGridShape.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision + |> DynObj.withOptionalPropertyBy "barmode" BarMode StyleParam.BarMode.convert + |> DynObj.withOptionalProperty "bargap" BarGap /// /// Returns Some(dynamic member value) of the object's underlying DynamicObj when a dynamic member with the given name exists, and None otherwise. /// /// The name of the dynamic member to get the value of /// The object to get the dynamic member value from - static member tryGetTypedMember<'T> (propName: string) (polar: Polar) = polar.TryGetTypedValue<'T>(propName) + static member tryGetTypedMember<'T> (propName: string) (polar: Polar) = polar.TryGetTypedPropertyValue<'T>(propName) /// /// Returns the AngularAxis object of the given polar object. @@ -106,7 +104,7 @@ type Polar() = /// The new AngularAxis object static member setAngularAxis(angularAxis: AngularAxis) = (fun (polar: Polar) -> - polar.SetValue("angularaxis", angularAxis) + polar.SetProperty("angularaxis", angularAxis) polar) /// @@ -124,5 +122,5 @@ type Polar() = /// The new RadialAxis object static member setRadialAxis(radialAxis: RadialAxis) = (fun (polar: Polar) -> - polar.SetValue("radialaxis", radialAxis) + polar.SetProperty("radialaxis", radialAxis) polar) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Polar/RadialAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/RadialAxis.fs index c97b4274c..78e603ca2 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Polar/RadialAxis.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/RadialAxis.fs @@ -281,57 +281,55 @@ type RadialAxis() = [] ?Calendar: StyleParam.Calendar ) = fun (radialAxis: RadialAxis) -> - - Visible |> DynObj.setValueOpt radialAxis "visible" - AxisType |> DynObj.setValueOptBy radialAxis "type" StyleParam.AxisType.convert - AutoTypeNumbers |> DynObj.setValueOptBy radialAxis "autotypenumbers" StyleParam.AutoTypeNumbers.convert - AutoRange |> DynObj.setValueOptBy radialAxis "autorange" StyleParam.AutoRange.convert - AutoRangeOptions |> DynObj.setValueOpt radialAxis "autorangeoptions" - RangeMode |> DynObj.setValueOptBy radialAxis "rangemode" StyleParam.RangeMode.convert - Range |> DynObj.setValueOptBy radialAxis "range" StyleParam.Range.convert - CategoryOrder |> DynObj.setValueOptBy radialAxis "categoryorder" StyleParam.CategoryOrder.convert - CategoryArray |> DynObj.setValueOpt radialAxis "categoryarray" - Angle |> DynObj.setValueOpt radialAxis "angle" - Side |> DynObj.setValueOptBy radialAxis "side" StyleParam.Direction.convert - Title |> DynObj.setValueOpt radialAxis "title" - HoverFormat |> DynObj.setValueOpt radialAxis "hoverformat" - UIRevision |> DynObj.setValueOpt radialAxis "uirevision" - Color |> DynObj.setValueOpt radialAxis "color" - ShowLine |> DynObj.setValueOpt radialAxis "showline" - LineColor |> DynObj.setValueOpt radialAxis "linecolor" - LineWidth |> DynObj.setValueOpt radialAxis "linewidth" - MaxAllowed |> DynObj.setValueOpt radialAxis "maxallowed" - MinAllowed |> DynObj.setValueOpt radialAxis "minallowed" - ShowGrid |> DynObj.setValueOpt radialAxis "showgrid" - GridColor |> DynObj.setValueOpt radialAxis "gridcolor" - GridDash |> DynObj.setValueOptBy radialAxis "griddash" StyleParam.DrawingStyle.convert - GridWidth |> DynObj.setValueOpt radialAxis "gridwidth" - TickMode |> DynObj.setValueOptBy radialAxis "tickmode" StyleParam.TickMode.convert - NTicks |> DynObj.setValueOpt radialAxis "nticks" - Tick0 |> DynObj.setValueOpt radialAxis "tick0" - DTick |> DynObj.setValueOpt radialAxis "dtick" - TickVals |> DynObj.setValueOpt radialAxis "tickvals" - TickText |> DynObj.setValueOpt radialAxis "ticktext" - Ticks |> DynObj.setValueOptBy radialAxis "ticks" StyleParam.TickOptions.convert - TickLen |> DynObj.setValueOpt radialAxis "ticklen" - TickWidth |> DynObj.setValueOpt radialAxis "tickwidth" - TickColor |> DynObj.setValueOpt radialAxis "tickcolor" - ShowTickLabels |> DynObj.setValueOpt radialAxis "showticklabels" - ShowTickPrefix |> DynObj.setValueOptBy radialAxis "showtickprefix" StyleParam.ShowTickOption.convert - TickPrefix |> DynObj.setValueOpt radialAxis "tickprefix" - ShowTickSuffix |> DynObj.setValueOptBy radialAxis "showticksuffix" StyleParam.ShowTickOption.convert - TickSuffix |> DynObj.setValueOpt radialAxis "ticksuffix" - ShowExponent |> DynObj.setValueOptBy radialAxis "showexponent" StyleParam.ShowExponent.convert - ExponentFormat |> DynObj.setValueOptBy radialAxis "exponentformat" StyleParam.ExponentFormat.convert - MinExponent |> DynObj.setValueOpt radialAxis "minexponent" - SeparateThousands |> DynObj.setValueOpt radialAxis "separatethousands" - TickFont |> DynObj.setValueOpt radialAxis "tickfont" - TickAngle |> DynObj.setValueOpt radialAxis "tickangle" - TickFormat |> DynObj.setValueOpt radialAxis "tickformat" - TickFormatStops |> DynObj.setValueOpt radialAxis "tickformatstops" - LabelAlias |> DynObj.setValueOpt radialAxis "labelalias" - Layer |> DynObj.setValueOptBy radialAxis "layer" StyleParam.Layer.convert - TickLabelStep |> DynObj.setValueOpt radialAxis "ticklabelstep" - Calendar |> DynObj.setValueOptBy radialAxis "calendar" StyleParam.Calendar.convert - radialAxis + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalPropertyBy "type" AxisType StyleParam.AxisType.convert + |> DynObj.withOptionalPropertyBy "autotypenumbers" AutoTypeNumbers StyleParam.AutoTypeNumbers.convert + |> DynObj.withOptionalPropertyBy "autorange" AutoRange StyleParam.AutoRange.convert + |> DynObj.withOptionalProperty "autorangeoptions" AutoRangeOptions + |> DynObj.withOptionalPropertyBy "rangemode" RangeMode StyleParam.RangeMode.convert + |> DynObj.withOptionalPropertyBy "range" Range StyleParam.Range.convert + |> DynObj.withOptionalPropertyBy "categoryorder" CategoryOrder StyleParam.CategoryOrder.convert + |> DynObj.withOptionalProperty "categoryarray" CategoryArray + |> DynObj.withOptionalProperty "angle" Angle + |> DynObj.withOptionalPropertyBy "side" Side StyleParam.Direction.convert + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalProperty "hoverformat" HoverFormat + |> DynObj.withOptionalProperty "uirevision" UIRevision + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "showline" ShowLine + |> DynObj.withOptionalProperty "linecolor" LineColor + |> DynObj.withOptionalProperty "linewidth" LineWidth + |> DynObj.withOptionalProperty "maxallowed" MaxAllowed + |> DynObj.withOptionalProperty "minallowed" MinAllowed + |> DynObj.withOptionalProperty "showgrid" ShowGrid + |> DynObj.withOptionalProperty "gridcolor" GridColor + |> DynObj.withOptionalPropertyBy "griddash" GridDash StyleParam.DrawingStyle.convert + |> DynObj.withOptionalProperty "gridwidth" GridWidth + |> DynObj.withOptionalPropertyBy "tickmode" TickMode StyleParam.TickMode.convert + |> DynObj.withOptionalProperty "nticks" NTicks + |> DynObj.withOptionalProperty "tick0" Tick0 + |> DynObj.withOptionalProperty "dtick" DTick + |> DynObj.withOptionalProperty "tickvals" TickVals + |> DynObj.withOptionalProperty "ticktext" TickText + |> DynObj.withOptionalPropertyBy "ticks" Ticks StyleParam.TickOptions.convert + |> DynObj.withOptionalProperty "ticklen" TickLen + |> DynObj.withOptionalProperty "tickwidth" TickWidth + |> DynObj.withOptionalProperty "tickcolor" TickColor + |> DynObj.withOptionalProperty "showticklabels" ShowTickLabels + |> DynObj.withOptionalPropertyBy "showtickprefix" ShowTickPrefix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalProperty "tickprefix" TickPrefix + |> DynObj.withOptionalPropertyBy "showticksuffix" ShowTickSuffix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalProperty "ticksuffix" TickSuffix + |> DynObj.withOptionalPropertyBy "showexponent" ShowExponent StyleParam.ShowExponent.convert + |> DynObj.withOptionalPropertyBy "exponentformat" ExponentFormat StyleParam.ExponentFormat.convert + |> DynObj.withOptionalProperty "minexponent" MinExponent + |> DynObj.withOptionalProperty "separatethousands" SeparateThousands + |> DynObj.withOptionalProperty "tickfont" TickFont + |> DynObj.withOptionalProperty "tickangle" TickAngle + |> DynObj.withOptionalProperty "tickformat" TickFormat + |> DynObj.withOptionalProperty "tickformatstops" TickFormatStops + |> DynObj.withOptionalProperty "labelalias" LabelAlias + |> DynObj.withOptionalPropertyBy "layer" Layer StyleParam.Layer.convert + |> DynObj.withOptionalProperty "ticklabelstep" TickLabelStep + |> DynObj.withOptionalPropertyBy "calendar" Calendar StyleParam.Calendar.convert diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Smith/ImaginaryAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Smith/ImaginaryAxis.fs index 5cd120d72..828e438d8 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Smith/ImaginaryAxis.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Smith/ImaginaryAxis.fs @@ -149,29 +149,28 @@ type ImaginaryAxis() = ) = fun (imaginaryAxis: ImaginaryAxis) -> - Color |> DynObj.setValueOpt imaginaryAxis "color" - GridColor |> DynObj.setValueOpt imaginaryAxis "gridcolor" - GridDash |> DynObj.setValueOptBy imaginaryAxis "griddash" StyleParam.DrawingStyle.convert - GridWidth |> DynObj.setValueOpt imaginaryAxis "gridwidth" - HoverFormat |> DynObj.setValueOpt imaginaryAxis "hoverformat" - LabelAlias |> DynObj.setValueOpt imaginaryAxis "labelalias" - Layer |> DynObj.setValueOptBy imaginaryAxis "layer" StyleParam.Layer.convert - LineColor |> DynObj.setValueOpt imaginaryAxis "linecolor" - LineWidth |> DynObj.setValueOpt imaginaryAxis "linewidth" - ShowGrid |> DynObj.setValueOpt imaginaryAxis "showgrid" - ShowLine |> DynObj.setValueOpt imaginaryAxis "showline" - ShowTickLabels |> DynObj.setValueOpt imaginaryAxis "showticklabels" - ShowTickSuffix |> DynObj.setValueOptBy imaginaryAxis "showticksuffix" StyleParam.ShowTickOption.convert - ShowTickPrefix |> DynObj.setValueOptBy imaginaryAxis "showtickprefix" StyleParam.ShowTickOption.convert - TickColor |> DynObj.setValueOpt imaginaryAxis "tickcolor" - TickFont |> DynObj.setValueOpt imaginaryAxis "tickfont" - TickFormat |> DynObj.setValueOpt imaginaryAxis "tickformat" - TickLen |> DynObj.setValueOpt imaginaryAxis "ticklen" - TickPrefix |> DynObj.setValueOpt imaginaryAxis "tickprefix" - Ticks |> DynObj.setValueOptBy imaginaryAxis "ticks" StyleParam.TickLabelPosition.convert - TickSuffix |> DynObj.setValueOpt imaginaryAxis "ticksuffix" - TickVals |> DynObj.setValueOpt imaginaryAxis "tickvals" - TickWidth |> DynObj.setValueOpt imaginaryAxis "tickwidth" - Visible |> DynObj.setValueOpt imaginaryAxis "visible" - imaginaryAxis + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "gridcolor" GridColor + |> DynObj.withOptionalPropertyBy "griddash" GridDash StyleParam.DrawingStyle.convert + |> DynObj.withOptionalProperty "gridwidth" GridWidth + |> DynObj.withOptionalProperty "hoverformat" HoverFormat + |> DynObj.withOptionalProperty "labelalias" LabelAlias + |> DynObj.withOptionalPropertyBy "layer" Layer StyleParam.Layer.convert + |> DynObj.withOptionalProperty "linecolor" LineColor + |> DynObj.withOptionalProperty "linewidth" LineWidth + |> DynObj.withOptionalProperty "showgrid" ShowGrid + |> DynObj.withOptionalProperty "showline" ShowLine + |> DynObj.withOptionalProperty "showticklabels" ShowTickLabels + |> DynObj.withOptionalPropertyBy "showticksuffix" ShowTickSuffix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalPropertyBy "showtickprefix" ShowTickPrefix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalProperty "tickcolor" TickColor + |> DynObj.withOptionalProperty "tickfont" TickFont + |> DynObj.withOptionalProperty "tickformat" TickFormat + |> DynObj.withOptionalProperty "ticklen" TickLen + |> DynObj.withOptionalProperty "tickprefix" TickPrefix + |> DynObj.withOptionalPropertyBy "ticks" Ticks StyleParam.TickLabelPosition.convert + |> DynObj.withOptionalProperty "ticksuffix" TickSuffix + |> DynObj.withOptionalProperty "tickvals" TickVals + |> DynObj.withOptionalProperty "tickwidth" TickWidth + |> DynObj.withOptionalProperty "visible" Visible diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Smith/RealAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Smith/RealAxis.fs index c15fca2db..cbda84c34 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Smith/RealAxis.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Smith/RealAxis.fs @@ -158,31 +158,30 @@ type RealAxis() = ) = fun (realAxis: RealAxis) -> - Color |> DynObj.setValueOpt realAxis "color" - GridColor |> DynObj.setValueOpt realAxis "gridcolor" - GridDash |> DynObj.setValueOptBy realAxis "griddash" StyleParam.DrawingStyle.convert - GridWidth |> DynObj.setValueOpt realAxis "gridwidth" - HoverFormat |> DynObj.setValueOpt realAxis "hoverformat" - LabelAlias |> DynObj.setValueOpt realAxis "labelalias" - Layer |> DynObj.setValueOptBy realAxis "layer" StyleParam.Layer.convert - LineColor |> DynObj.setValueOpt realAxis "linecolor" - LineWidth |> DynObj.setValueOpt realAxis "linewidth" - ShowGrid |> DynObj.setValueOpt realAxis "showgrid" - ShowLine |> DynObj.setValueOpt realAxis "showline" - ShowTickLabels |> DynObj.setValueOpt realAxis "showticklabels" - ShowTickSuffix |> DynObj.setValueOptBy realAxis "showticksuffix" StyleParam.ShowTickOption.convert - ShowTickPrefix |> DynObj.setValueOptBy realAxis "showtickprefix" StyleParam.ShowTickOption.convert - Side |> DynObj.setValueOptBy realAxis "side" StyleParam.Side.convert - TickAngle |> DynObj.setValueOpt realAxis "tickangle" - TickColor |> DynObj.setValueOpt realAxis "tickcolor" - TickFont |> DynObj.setValueOpt realAxis "tickfont" - TickFormat |> DynObj.setValueOpt realAxis "tickformat" - TickLen |> DynObj.setValueOpt realAxis "ticklen" - TickPrefix |> DynObj.setValueOpt realAxis "tickprefix" - Ticks |> DynObj.setValueOptBy realAxis "ticks" StyleParam.TickLabelPosition.convert - TickSuffix |> DynObj.setValueOpt realAxis "ticksuffix" - TickVals |> DynObj.setValueOpt realAxis "tickvals" - TickWidth |> DynObj.setValueOpt realAxis "tickwidth" - Visible |> DynObj.setValueOpt realAxis "visible" - realAxis + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "gridcolor" GridColor + |> DynObj.withOptionalPropertyBy "griddash" GridDash StyleParam.DrawingStyle.convert + |> DynObj.withOptionalProperty "gridwidth" GridWidth + |> DynObj.withOptionalProperty "hoverformat" HoverFormat + |> DynObj.withOptionalProperty "labelalias" LabelAlias + |> DynObj.withOptionalPropertyBy "layer" Layer StyleParam.Layer.convert + |> DynObj.withOptionalProperty "linecolor" LineColor + |> DynObj.withOptionalProperty "linewidth" LineWidth + |> DynObj.withOptionalProperty "showgrid" ShowGrid + |> DynObj.withOptionalProperty "showline" ShowLine + |> DynObj.withOptionalProperty "showticklabels" ShowTickLabels + |> DynObj.withOptionalPropertyBy "showticksuffix" ShowTickSuffix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalPropertyBy "showtickprefix" ShowTickPrefix StyleParam.ShowTickOption.convert + |> DynObj.withOptionalPropertyBy "side" Side StyleParam.Side.convert + |> DynObj.withOptionalProperty "tickangle" TickAngle + |> DynObj.withOptionalProperty "tickcolor" TickColor + |> DynObj.withOptionalProperty "tickfont" TickFont + |> DynObj.withOptionalProperty "tickformat" TickFormat + |> DynObj.withOptionalProperty "ticklen" TickLen + |> DynObj.withOptionalProperty "tickprefix" TickPrefix + |> DynObj.withOptionalPropertyBy "ticks" Ticks StyleParam.TickLabelPosition.convert + |> DynObj.withOptionalProperty "ticksuffix" TickSuffix + |> DynObj.withOptionalProperty "tickvals" TickVals + |> DynObj.withOptionalProperty "tickwidth" TickWidth + |> DynObj.withOptionalProperty "visible" Visible diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Smith/Smith.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Smith/Smith.fs index 68d1effdf..98f1e061e 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Smith/Smith.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Smith/Smith.fs @@ -47,20 +47,18 @@ type Smith() = [] ?RealAxis: RealAxis ) = fun (smith: Smith) -> - - BGColor |> DynObj.setValueOpt smith "bgcolor" - Domain |> DynObj.setValueOpt smith "domain" - ImaginaryAxis |> DynObj.setValueOpt smith "imaginaryaxis" - RealAxis |> DynObj.setValueOpt smith "realaxis" - smith + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "imaginaryaxis" ImaginaryAxis + |> DynObj.withOptionalProperty "realaxis" RealAxis /// /// Returns Some(dynamic member value) of the object's underlying DynamicObj when a dynamic member with the given name exists, and None otherwise. /// /// The name of the dynamic member to get the value of /// The object to get the dynamic member value from - static member tryGetTypedMember<'T> (propName: string) (smith: Smith) = smith.TryGetTypedValue<'T>(propName) + static member tryGetTypedMember<'T> (propName: string) (smith: Smith) = smith.TryGetTypedPropertyValue<'T>(propName) /// /// Returns the ImaginaryAxis object of the given smith object. @@ -77,7 +75,7 @@ type Smith() = /// The new ImaginaryAxis object static member setImaginaryAxis(imaginaryAxis: ImaginaryAxis) = (fun (smith: Smith) -> - smith.SetValue("imaginaryaxis", imaginaryAxis) + smith.SetProperty("imaginaryaxis", imaginaryAxis) smith) /// @@ -95,5 +93,5 @@ type Smith() = /// The new RealAxis object static member setRealAxis(realAxis: RealAxis) = (fun (smith: Smith) -> - smith.SetValue("realaxis", realAxis) + smith.SetProperty("realaxis", realAxis) smith) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Ternary/Ternary.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Ternary/Ternary.fs index a682a02ba..6799c2144 100644 --- a/src/Plotly.NET/Layout/ObjectAbstractions/Ternary/Ternary.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Ternary/Ternary.fs @@ -54,16 +54,14 @@ type Ternary() = [] ?Sum: #IConvertible, [] ?BGColor: Color ) = - (fun (ternary: Ternary) -> - - AAxis |> DynObj.setValueOpt ternary "aaxis" - BAxis |> DynObj.setValueOpt ternary "baxis" - CAxis |> DynObj.setValueOpt ternary "caxis" - Domain |> DynObj.setValueOpt ternary "domain" - Sum |> DynObj.setValueOpt ternary "sum" - BGColor |> DynObj.setValueOpt ternary "bgcolor" - - ternary) + fun (ternary: Ternary) -> + ternary + |> DynObj.withOptionalProperty "aaxis" AAxis + |> DynObj.withOptionalProperty "baxis" BAxis + |> DynObj.withOptionalProperty "caxis" CAxis + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "sum" Sum + |> DynObj.withOptionalProperty "bgcolor" BGColor /// @@ -71,7 +69,7 @@ type Ternary() = /// /// The name of the dynamic member to get the value of /// The object to get the dynamic member value from - static member tryGetTypedMember<'T> (propName: string) (ternary: Ternary) = ternary.TryGetTypedValue<'T>(propName) + static member tryGetTypedMember<'T> (propName: string) (ternary: Ternary) = ternary.TryGetTypedPropertyValue<'T>(propName) /// /// Returns the a axis of the given ternary object. @@ -88,7 +86,7 @@ type Ternary() = /// The new a axis object static member setAAxis(aAxis: LinearAxis) = (fun (ternary: Ternary) -> - ternary.SetValue("aaxis", aAxis) + ternary.SetProperty("aaxis", aAxis) ternary) /// @@ -106,7 +104,7 @@ type Ternary() = /// The new b axis object static member setBAxis(bAxis: LinearAxis) = (fun (ternary: Ternary) -> - ternary.SetValue("baxis", bAxis) + ternary.SetProperty("baxis", bAxis) ternary) /// @@ -124,5 +122,5 @@ type Ternary() = /// The new c axis object static member setCAxis(cAxis: LinearAxis) = (fun (ternary: Ternary) -> - ternary.SetValue("caxis", cAxis) + ternary.SetProperty("caxis", cAxis) ternary) diff --git a/src/Plotly.NET/Plotly.NET.fsproj b/src/Plotly.NET/Plotly.NET.fsproj index 7214e6b4f..4431ce9e3 100644 --- a/src/Plotly.NET/Plotly.NET.fsproj +++ b/src/Plotly.NET/Plotly.NET.fsproj @@ -167,8 +167,8 @@ - - + + diff --git a/src/Plotly.NET/Templates/ChartTemplates.fs b/src/Plotly.NET/Templates/ChartTemplates.fs index f57d29d27..9ec2bd4ab 100644 --- a/src/Plotly.NET/Templates/ChartTemplates.fs +++ b/src/Plotly.NET/Templates/ChartTemplates.fs @@ -4,7 +4,6 @@ open Plotly.NET.LayoutObjects open Plotly.NET.TraceObjects open DynamicObj -open DynamicObj.Operators open System.Runtime.InteropServices module ChartTemplates = @@ -70,7 +69,7 @@ module ChartTemplates = Template.init (defaultLayout) - let dark = + let dark : Template = let initDarkAxisTemplate () = LinearAxis.init ( @@ -94,20 +93,18 @@ module ChartTemplates = Template.init (darkLayoutTemplate) - let darkMirrored = + let darkMirrored : Template = dark |> Template.mapLayoutTemplate (fun l -> - l.TryGetTypedValue("xaxis") - |> Option.map (LinearAxis.style (Mirror = StyleParam.Mirror.AllTicks)) - |> DynObj.setValueOpt l "xaxis" + let x = l.TryGetTypedPropertyValue("xaxis") + let y =l.TryGetTypedPropertyValue("yaxis") - l.TryGetTypedValue("yaxis") - |> Option.map (LinearAxis.style (Mirror = StyleParam.Mirror.AllTicks)) - |> DynObj.setValueOpt l "yaxis" + l + |> DynObj.withOptionalPropertyBy "xaxis" x (LinearAxis.style (Mirror = StyleParam.Mirror.AllTicks)) + |> DynObj.withOptionalPropertyBy "yaxis" y (LinearAxis.style (Mirror = StyleParam.Mirror.AllTicks)) + ) - l) - - let fslab = + let fslab : Template = let initFslabAxisTemplate () = LinearAxis.init ( @@ -132,7 +129,7 @@ module ChartTemplates = Template.init (fslabLayoutTemplate) |> Template.withColorWay ColorWays.fslab - let transparent = + let transparent : Template = let initTransparentAxisTemplate () = LinearAxis.init (ShowLine = true, ZeroLine = true) @@ -146,7 +143,7 @@ module ChartTemplates = Template.init (defaultLayout) - let transparentMirrored = + let transparentMirrored : Template = let initTransparentAxisTemplate () = LinearAxis.init ( ShowLine = true, @@ -166,7 +163,7 @@ module ChartTemplates = Template.init (defaultLayout) /// the default template, as used in the python lib by default. - let plotly = + let plotly : Template = // non-standard props, may change in the future let annotationdefaults = diff --git a/src/Plotly.NET/Templates/Template.fs b/src/Plotly.NET/Templates/Template.fs index 311222230..c1044995e 100644 --- a/src/Plotly.NET/Templates/Template.fs +++ b/src/Plotly.NET/Templates/Template.fs @@ -17,7 +17,7 @@ type Template() = layoutTemplate: Layout, [] ?TraceTemplates: seq<#Trace> ) = - (fun (template: Template) -> + fun (template: Template) -> let traceTemplates = TraceTemplates @@ -39,26 +39,26 @@ type Template() = let tmp = DynamicObj() traceTemplates - |> Option.iter (Seq.iter (fun (id, traceTemplate) -> traceTemplate |> DynObj.setValue tmp id)) + |> Option.iter (Seq.iter (fun (id, traceTemplate) -> tmp |> DynObj.setProperty id traceTemplate)) tmp - - layoutTemplate |> DynObj.setValue template "layout" - traceTemplates |> DynObj.setValue template "data" - - template) + template + |> DynObj.withProperty "layout" layoutTemplate + |> DynObj.withProperty "data" traceTemplates static member mapLayoutTemplate (styleF: Layout -> Layout) (template: Template) = - template.TryGetTypedValue("layout") |> Option.map (styleF) |> DynObj.setValueOpt template "layout" + let l = template.TryGetTypedPropertyValue("layout") template + |> DynObj.withOptionalPropertyBy "layout" l (styleF) static member mapTraceTemplates (styleF: #Trace[] -> #Trace[]) (template: Template) = - template.TryGetTypedValue<#Trace[]>("data") |> Option.map (styleF) |> DynObj.setValueOpt template "data" + let l = template.TryGetTypedPropertyValue<#Trace[]>("data") template + |> DynObj.withOptionalPropertyBy "data" l (styleF) static member withColorWay (colorway: Color) (template: Template) = template |> Template.mapLayoutTemplate (fun l -> - colorway |> DynObj.setValue l "colorway" - l) + l |> DynObj.withProperty "colorway" colorway + ) diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Bins.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Bins.fs index f3cf69f62..94326e188 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Bins.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Bins.fs @@ -28,9 +28,9 @@ type Bins() = [] ?Size: float ) = - (fun (bins: Bins) -> - Start |> DynObj.setValueOpt bins "start" - End |> DynObj.setValueOpt bins "end" - Size |> DynObj.setValueOpt bins "size" + fun (bins: Bins) -> - bins) + bins + |> DynObj.withOptionalProperty "start" Start + |> DynObj.withOptionalProperty "end" End + |> DynObj.withOptionalProperty "size" Size diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Box.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Box.fs index 2abb572e7..9b47399c6 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Box.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Box.fs @@ -38,7 +38,7 @@ type Box() = [] ?LineColor: Color, [] ?LineWidth: float ) = - (fun (box: Box) -> + fun (box: Box) -> let line = if LineColor.IsSome || LineWidth.IsSome then @@ -46,10 +46,8 @@ type Box() = else None - Visible |> DynObj.setValueOpt box "visible" - Width |> DynObj.setValueOpt box "width" - FillColor |> DynObj.setValueOpt box "fillcolor" - line |> DynObj.setValueOpt box "line" - - // out -> - box) + box + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "width" Width + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "line" line diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Caps.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Caps.fs index e19f41830..ce1c112f7 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Caps.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Caps.fs @@ -24,10 +24,9 @@ type CapFill() = fun (capFill: CapFill) -> - Fill |> DynObj.setValueOpt capFill "fill" - Show |> DynObj.setValueOpt capFill "show" - capFill + |> DynObj.withOptionalProperty "fill" Fill + |> DynObj.withOptionalProperty "show" Show type Caps() = @@ -50,8 +49,7 @@ type Caps() = ) = fun (caps: Caps) -> - X |> DynObj.setValueOpt caps "x" - Y |> DynObj.setValueOpt caps "y" - Z |> DynObj.setValueOpt caps "z" - caps + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Contours.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Contours.fs index defeb54c1..b33f3b7ce 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Contours.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Contours.fs @@ -27,11 +27,10 @@ type ContourProject() = fun (contourProject: ContourProject) -> - X |> DynObj.setValueOpt contourProject "x" - Y |> DynObj.setValueOpt contourProject "y" - Z |> DynObj.setValueOpt contourProject "z" - contourProject + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z /// Contour object inherits from dynamic object type Contour() = @@ -86,21 +85,19 @@ type Contour() = [] ?Width: float ) = - (fun (contour: Contour) -> - Color |> DynObj.setValueOpt contour "color" - End |> DynObj.setValueOpt contour "end" - Highlight |> DynObj.setValueOpt contour "highlight" - HighlightColor |> DynObj.setValueOpt contour "highlightcolor" - HighlightWidth |> DynObj.setValueOpt contour "highlightwidth" - Project |> DynObj.setValueOpt contour "project" - Show |> DynObj.setValueOpt contour "show" - Size |> DynObj.setValueOpt contour "size" - Start |> DynObj.setValueOpt contour "start" - UseColorMap |> DynObj.setValueOpt contour "usecolormap" - Width |> DynObj.setValueOpt contour "width" - - - contour) + fun (contour: Contour) -> + contour + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "end" End + |> DynObj.withOptionalProperty "highlight" Highlight + |> DynObj.withOptionalProperty "highlightcolor" HighlightColor + |> DynObj.withOptionalProperty "highlightwidth" HighlightWidth + |> DynObj.withOptionalProperty "project" Project + |> DynObj.withOptionalProperty "show" Show + |> DynObj.withOptionalProperty "size" Size + |> DynObj.withOptionalProperty "start" Start + |> DynObj.withOptionalProperty "usecolormap" UseColorMap + |> DynObj.withOptionalProperty "width" Width /// Contours type inherits from dynamic object type Contours() = @@ -167,24 +164,24 @@ type Contours() = [] ?Value: #IConvertible ) = - (fun (contours: Contours) -> - X |> DynObj.setValueOpt contours "x" - Y |> DynObj.setValueOpt contours "y" - Z |> DynObj.setValueOpt contours "z" - Coloring |> DynObj.setValueOptBy contours "coloring" StyleParam.ContourColoring.convert - End |> DynObj.setValueOpt contours "end" - LabelFont |> DynObj.setValueOpt contours "labelfont" - LabelFormat |> DynObj.setValueOpt contours "labelformat" - Operation |> DynObj.setValueOptBy contours "operation" StyleParam.ConstraintOperation.convert - ShowLabels |> DynObj.setValueOpt contours "showlabels" - ShowLines |> DynObj.setValueOpt contours "showlines" - Size |> DynObj.setValueOpt contours "size" - Start |> DynObj.setValueOpt contours "start" - Type |> DynObj.setValueOptBy contours "type" StyleParam.ContourType.convert - Value |> DynObj.setValueOpt contours "value" - - - contours) + fun (contours: Contours) -> + + contours + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalPropertyBy "coloring" Coloring StyleParam.ContourColoring.convert + |> DynObj.withOptionalProperty "end" End + |> DynObj.withOptionalProperty "labelfont" LabelFont + |> DynObj.withOptionalProperty "labelformat" LabelFormat + |> DynObj.withOptionalPropertyBy "operation" Operation StyleParam.ConstraintOperation.convert + |> DynObj.withOptionalProperty "showlabels" ShowLabels + |> DynObj.withOptionalProperty "showlines" ShowLines + |> DynObj.withOptionalProperty "size" Size + |> DynObj.withOptionalProperty "start" Start + |> DynObj.withOptionalPropertyBy "type" Type StyleParam.ContourType.convert + |> DynObj.withOptionalProperty "value" Value + // Initialized x-y-z-Contours with the same properties diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Cumulative.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Cumulative.fs index ddf762aca..a8f841679 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Cumulative.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Cumulative.fs @@ -38,9 +38,9 @@ type Cumulative() = [] ?Currentbin: StyleParam.Currentbin ) = - (fun (cumulative: Cumulative) -> - Enabled |> DynObj.setValueOpt cumulative "enabled" - Direction |> DynObj.setValueOptBy cumulative "direction" StyleParam.CumulativeDirection.convert - Currentbin |> DynObj.setValueOptBy cumulative "currentbin" StyleParam.Currentbin.convert + fun (cumulative: Cumulative) -> - cumulative) + cumulative + |> DynObj.withOptionalProperty "enabled" Enabled + |> DynObj.withOptionalPropertyBy "direction" Direction StyleParam.CumulativeDirection.convert + |> DynObj.withOptionalPropertyBy "currentbin" Currentbin StyleParam.Currentbin.convert diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Dimensions.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Dimensions.fs index b0ab62229..bdb06a8fb 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Dimensions.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Dimensions.fs @@ -83,24 +83,22 @@ type Dimension() = [] ?AxisMatches: bool, [] ?AxisType: StyleParam.AxisType ) = - (fun (dims: Dimension) -> + fun (dims: Dimension) -> let axis = LinearAxis.init (?AxisType = AxisType) + |> DynObj.withOptionalProperty "matches" AxisMatches - AxisMatches |> DynObj.setValueOpt axis "matches" - - Label |> DynObj.setValueOpt dims "label" - Name |> DynObj.setValueOpt dims "name" - TemplateItemName |> DynObj.setValueOpt dims "templateitemname" - Values |> DynObj.setValueOpt dims "values" - Visible |> DynObj.setValueOpt dims "visible" - ConstraintRange |> DynObj.setValueOptBy dims "constraintrange" StyleParam.Range.convert - MultiSelect |> DynObj.setValueOpt dims "multiselect" - Range |> DynObj.setValueOptBy dims "range" StyleParam.Range.convert - TickFormat |> DynObj.setValueOptBy dims "tickformat" StyleParam.TickMode.convert - TickText |> DynObj.setValueOpt dims "ticktext" - Tickvals |> DynObj.setValueOpt dims "tickvals" - axis |> DynObj.setValue dims "axis" - - dims) + dims + |> DynObj.withOptionalProperty "label" Label + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + |> DynObj.withOptionalProperty "values" Values + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalPropertyBy "constraintrange" ConstraintRange StyleParam.Range.convert + |> DynObj.withOptionalProperty "multiselect" MultiSelect + |> DynObj.withOptionalPropertyBy "range" Range StyleParam.Range.convert + |> DynObj.withOptionalPropertyBy "tickformat" TickFormat StyleParam.TickMode.convert + |> DynObj.withOptionalProperty "ticktext" TickText + |> DynObj.withOptionalProperty "tickvals" Tickvals + |> DynObj.withProperty "axis" axis diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Error.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Error.fs index faae15472..d9ee3e7f3 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Error.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Error.fs @@ -91,20 +91,19 @@ type Error() = [] ?Thickness: float, [] ?Width: float ) = - (fun (error: Error) -> - Visible |> DynObj.setValueOpt error "visible" - Type |> DynObj.setValueOptBy error "type" StyleParam.ErrorType.convert - Symmetric |> DynObj.setValueOpt error "symmetric" - Array |> DynObj.setValueOpt error "array" - Arrayminus |> DynObj.setValueOpt error "arrayminus" - Value |> DynObj.setValueOpt error "value" - Valueminus |> DynObj.setValueOpt error "valueminus" - Traceref |> DynObj.setValueOpt error "traceref" - Tracerefminus |> DynObj.setValueOpt error "tracerefminus" - Copy_ystyle |> DynObj.setValueOpt error "copy_ystyle" - Color |> DynObj.setValueOpt error "color" - Thickness |> DynObj.setValueOpt error "thickness" - Width |> DynObj.setValueOpt error "width" + fun (error: Error) -> - // out -> - error) + error + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalPropertyBy "type" Type StyleParam.ErrorType.convert + |> DynObj.withOptionalProperty "symmetric" Symmetric + |> DynObj.withOptionalProperty "array" Array + |> DynObj.withOptionalProperty "arrayminus" Arrayminus + |> DynObj.withOptionalProperty "value" Value + |> DynObj.withOptionalProperty "valueminus" Valueminus + |> DynObj.withOptionalProperty "traceref" Traceref + |> DynObj.withOptionalProperty "tracerefminus" Tracerefminus + |> DynObj.withOptionalProperty "copy_ystyle" Copy_ystyle + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "thickness" Thickness + |> DynObj.withOptionalProperty "width" Width diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/FinanceMarker.fs b/src/Plotly.NET/Traces/ObjectAbstractions/FinanceMarker.fs index c370fb26d..b8adfd151 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/FinanceMarker.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/FinanceMarker.fs @@ -32,14 +32,13 @@ type FinanceMarker() = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle ) = - (fun (financeMarker: FinanceMarker) -> + fun (financeMarker: FinanceMarker) -> let line = - financeMarker.TryGetTypedValue("line") + financeMarker.TryGetTypedPropertyValue("line") |> Option.defaultValue(Plotly.NET.Line.init()) |> Line.style (?Color = LineColor, ?Width = LineWidth, ?Dash = LineDash) - FillColor |> DynObj.setValueOpt financeMarker "fillcolor" - line |> DynObj.setValue financeMarker "line" - - financeMarker) + financeMarker + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withProperty "line" line diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/FunnelConnector.fs b/src/Plotly.NET/Traces/ObjectAbstractions/FunnelConnector.fs index f8201e470..06d1cb9ea 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/FunnelConnector.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/FunnelConnector.fs @@ -33,10 +33,9 @@ type FunnelConnector() = [] ?Line: Line, [] ?Visible: bool ) = - (fun (connector: FunnelConnector) -> + fun (connector: FunnelConnector) -> - FillColor |> DynObj.setValueOpt connector "fillcolor" - Line |> DynObj.setValueOpt connector "line" - Visible |> DynObj.setValueOpt connector "visible" - - connector) + connector + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "visible" Visible diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Gradient.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Gradient.fs index e6f4d4f93..38145faae 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Gradient.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Gradient.fs @@ -26,8 +26,6 @@ type Gradient() = fun (gradient: Gradient) -> - (Type, MultiTypes) |> DynObj.setSingleOrMultiOpt gradient "type" - - Color |> DynObj.setValueOpt gradient "color" - gradient + |> DynObj.withOptionalSingleOrMultiProperty "type" (Type, MultiTypes) + |> DynObj.setOptionalProperty "color" Color diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Icicle.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Icicle.fs index 872a53940..ec8967739 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Icicle.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Icicle.fs @@ -13,11 +13,9 @@ type IcicleRoot() = IcicleRoot() |> IcicleRoot.style (?Color = Color) static member style([] ?Color: Color) = - (fun (icicleRoot: IcicleRoot) -> - - Color |> DynObj.setValueOpt icicleRoot "color" - - icicleRoot) + fun (icicleRoot: IcicleRoot) -> + icicleRoot + |> DynObj.withOptionalProperty "color" Color type IcicleLeaf() = inherit DynamicObj() @@ -26,11 +24,9 @@ type IcicleLeaf() = IcicleLeaf() |> IcicleLeaf.style (?Opacity = Opacity) static member style([] ?Opacity: float) = - (fun (icicleLeaf: IcicleLeaf) -> - - Opacity |> DynObj.setValueOpt icicleLeaf "opacity" - - icicleLeaf) + fun (icicleLeaf: IcicleLeaf) -> + icicleLeaf + |> DynObj.withOptionalProperty "opacity" Opacity type IcicleTiling() = inherit DynamicObj() @@ -49,10 +45,9 @@ type IcicleTiling() = [] ?Orientation: StyleParam.Orientation, [] ?Pad: int ) = - (fun (icicleTiling: IcicleTiling) -> - - Flip |> DynObj.setValueOptBy icicleTiling "flip" StyleParam.TilingFlip.convert - Orientation |> DynObj.setValueOptBy icicleTiling "orientation" StyleParam.Orientation.convert - Pad |> DynObj.setValueOpt icicleTiling "pad" + fun (icicleTiling: IcicleTiling) -> - icicleTiling) + icicleTiling + |> DynObj.withOptionalPropertyBy "flip" Flip StyleParam.TilingFlip.convert + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "pad" Pad diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Indicator.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Indicator.fs index c91fb5ef7..42e389dbf 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Indicator.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Indicator.fs @@ -22,12 +22,11 @@ type IndicatorSymbol() = [] ?Color: Color, [] ?Symbol: string ) = - (fun (indicatorDirection: IndicatorSymbol) -> + fun (indicatorDirection: IndicatorSymbol) -> - Color |> DynObj.setValueOpt indicatorDirection "color" - Symbol |> DynObj.setValueOpt indicatorDirection "symbol" - - indicatorDirection) + indicatorDirection + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "symbol" Symbol type IndicatorDelta() = inherit DynamicObj() @@ -93,19 +92,18 @@ type IndicatorDelta() = [] ?Suffix: string, [] ?ValueFormat: string ) = - (fun (indicatorDelta: IndicatorDelta) -> - - Decreasing |> DynObj.setValueOpt indicatorDelta "decreasing" - Font |> DynObj.setValueOpt indicatorDelta "font" - Increasing |> DynObj.setValueOpt indicatorDelta "increasing" - Position |> DynObj.setValueOptBy indicatorDelta "position" StyleParam.IndicatorDeltaPosition.convert - Prefix |> DynObj.setValueOpt indicatorDelta "prefix" - Reference |> DynObj.setValueOpt indicatorDelta "reference" - Relative |> DynObj.setValueOpt indicatorDelta "relative" - Suffix |> DynObj.setValueOpt indicatorDelta "suffix" - ValueFormat |> DynObj.setValueOpt indicatorDelta "valueformat" - - indicatorDelta) + fun (indicatorDelta: IndicatorDelta) -> + + indicatorDelta + |> DynObj.withOptionalProperty "decreasing" Decreasing + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "increasing" Increasing + |> DynObj.withOptionalPropertyBy "position" Position StyleParam.IndicatorDeltaPosition.convert + |> DynObj.withOptionalProperty "prefix" Prefix + |> DynObj.withOptionalProperty "reference" Reference + |> DynObj.withOptionalProperty "relative" Relative + |> DynObj.withOptionalProperty "suffix" Suffix + |> DynObj.withOptionalProperty "valueformat" ValueFormat type IndicatorNumber() = inherit DynamicObj() @@ -127,14 +125,13 @@ type IndicatorNumber() = [] ?Suffix: string, [] ?ValueFormat: string ) = - (fun (indicatorNumber: IndicatorNumber) -> - - Font |> DynObj.setValueOpt indicatorNumber "font" - Prefix |> DynObj.setValueOpt indicatorNumber "prefix" - Suffix |> DynObj.setValueOpt indicatorNumber "suffix" - ValueFormat |> DynObj.setValueOpt indicatorNumber "valueformat" + fun (indicatorNumber: IndicatorNumber) -> - indicatorNumber) + indicatorNumber + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "prefix" Prefix + |> DynObj.withOptionalProperty "suffix" Suffix + |> DynObj.withOptionalProperty "valueformat" ValueFormat type IndicatorBar() = @@ -154,13 +151,12 @@ type IndicatorBar() = [] ?Line: Line, [] ?Thickness: float ) = - (fun (indicatorBar: IndicatorBar) -> - - Color |> DynObj.setValueOpt indicatorBar "color" - Line |> DynObj.setValueOpt indicatorBar "line" - Thickness |> DynObj.setValueOpt indicatorBar "thickness" - - indicatorBar) + fun (indicatorBar: IndicatorBar) -> + indicatorBar + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "thickness" Thickness + type IndicatorStep() = inherit DynamicObj() @@ -193,16 +189,15 @@ type IndicatorStep() = [] ?TemplateItemName: string, [] ?Thickness: float ) = - (fun (indicatorSteps: IndicatorStep) -> + fun (indicatorSteps: IndicatorStep) -> - Color |> DynObj.setValueOpt indicatorSteps "color" - Line |> DynObj.setValueOpt indicatorSteps "line" - Name |> DynObj.setValueOpt indicatorSteps "name" - Range |> DynObj.setValueOptBy indicatorSteps "range" StyleParam.Range.convert - TemplateItemName |> DynObj.setValueOpt indicatorSteps "templateitemname" - Thickness |> DynObj.setValueOpt indicatorSteps "thickness" - - indicatorSteps) + indicatorSteps + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "range" Range StyleParam.Range.convert + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName + |> DynObj.withOptionalProperty "thickness" Thickness type IndicatorThreshold() = @@ -222,13 +217,12 @@ type IndicatorThreshold() = [] ?Thickness: float, [] ?Value: #IConvertible ) = - (fun (indicatorThreshold: IndicatorThreshold) -> - - Line |> DynObj.setValueOpt indicatorThreshold "line" - Thickness |> DynObj.setValueOpt indicatorThreshold "thickness" - Value |> DynObj.setValueOpt indicatorThreshold "value" + fun (indicatorThreshold: IndicatorThreshold) -> - indicatorThreshold) + indicatorThreshold + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "thickness" Thickness + |> DynObj.withOptionalProperty "value" Value type IndicatorGauge() = @@ -268,15 +262,14 @@ type IndicatorGauge() = [] ?Steps: seq, [] ?Threshold: IndicatorThreshold ) = - (fun (indicatorGauge: IndicatorGauge) -> - - Axis |> DynObj.setValueOpt indicatorGauge "axis" - Bar |> DynObj.setValueOpt indicatorGauge "bar" - BGColor |> DynObj.setValueOpt indicatorGauge "bgcolor" - BorderColor |> DynObj.setValueOpt indicatorGauge "bordercolor" - BorderWidth |> DynObj.setValueOpt indicatorGauge "borderwidth" - Shape |> DynObj.setValueOptBy indicatorGauge "shape" StyleParam.IndicatorGaugeShape.convert - Steps |> DynObj.setValueOpt indicatorGauge "steps" - Threshold |> DynObj.setValueOpt indicatorGauge "threshold" - - indicatorGauge) + fun (indicatorGauge: IndicatorGauge) -> + + indicatorGauge + |> DynObj.withOptionalProperty "axis" Axis + |> DynObj.withOptionalProperty "bar" Bar + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "bordercolor" BorderColor + |> DynObj.withOptionalProperty "borderwidth" BorderWidth + |> DynObj.withOptionalPropertyBy "shape" Shape StyleParam.IndicatorGaugeShape.convert + |> DynObj.withOptionalProperty "steps" Steps + |> DynObj.withOptionalProperty "threshold" Threshold diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Lighting.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Lighting.fs index 6461431a4..7107d1979 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Lighting.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Lighting.fs @@ -63,15 +63,14 @@ type Lighting() = ) = fun (l: Lighting) -> - Ambient |> DynObj.setValueOpt l "ambient" - Diffuse |> DynObj.setValueOpt l "diffuse" - FaceNormalEpsilon |> DynObj.setValueOpt l "facenormalepsilon" - Fresnel |> DynObj.setValueOpt l "fresnel" - Roughness |> DynObj.setValueOpt l "roughness" - Specular |> DynObj.setValueOpt l "specular" - VertexNormalEpsilon |> DynObj.setValueOpt l "vertexnormalepsilon" - l + |> DynObj.withOptionalProperty "ambient" Ambient + |> DynObj.withOptionalProperty "diffuse" Diffuse + |> DynObj.withOptionalProperty "facenormalepsilon" FaceNormalEpsilon + |> DynObj.withOptionalProperty "fresnel" Fresnel + |> DynObj.withOptionalProperty "roughness" Roughness + |> DynObj.withOptionalProperty "specular" Specular + |> DynObj.withOptionalProperty "vertexnormalepsilon" VertexNormalEpsilon type LightPosition() = inherit DynamicObj() @@ -104,8 +103,7 @@ type LightPosition() = ) = fun (lp: LightPosition) -> - X |> DynObj.setValueOpt lp "x" - Y |> DynObj.setValueOpt lp "y" - Z |> DynObj.setValueOpt lp "z" - lp + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Marker.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Marker.fs index 83c57d8b6..9d3847d5d 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Marker.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Marker.fs @@ -198,34 +198,34 @@ type Marker() = ) = (fun (marker: Marker) -> - Angle |> DynObj.setValueOpt marker "angle" - AngleRef |> DynObj.setValueOptBy marker "angleref" StyleParam.AngleRef.convert - AutoColorScale |> DynObj.setValueOpt marker "autocolorscale" - CAuto |> DynObj.setValueOpt marker "cauto" - CMax |> DynObj.setValueOpt marker "cmax" - CMid |> DynObj.setValueOpt marker "cmid" - CMin |> DynObj.setValueOpt marker "cmin" - Color |> DynObj.setValueOpt marker "color" - Colors |> DynObj.setValueOpt marker "colors" - ColorAxis |> DynObj.setValueOptBy marker "coloraxis" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt marker "colorbar" - Colorscale |> DynObj.setValueOptBy marker "colorscale" StyleParam.Colorscale.convert - CornerRadius |> DynObj.setValueOpt marker "cornerradius" - Gradient |> DynObj.setValueOpt marker "gradient" - Outline |> DynObj.setValueOpt marker "line" - (Size, MultiSize) |> DynObj.setSingleOrMultiOpt marker "size" - (Opacity, MultiOpacity) |> DynObj.setSingleOrMultiOpt marker "opacity" - Pattern |> DynObj.setValueOpt marker "pattern" - (Symbol, MultiSymbol) |> DynObj.setSingleOrMultiOptBy marker "symbol" StyleParam.MarkerSymbol.convert - (Symbol3D, MultiSymbol3D) |> DynObj.setSingleOrMultiOptBy marker "symbol" StyleParam.MarkerSymbol3D.convert - OutlierColor |> DynObj.setValueOpt marker "outliercolor" - OutlierWidth |> DynObj.setValueOpt marker "outlierwidth" - MaxDisplayed |> DynObj.setValueOpt marker "maxdisplayed" - ReverseScale |> DynObj.setValueOpt marker "reversescale" - ShowScale |> DynObj.setValueOpt marker "showscale" - SizeMin |> DynObj.setValueOpt marker "sizemin" - SizeMode |> DynObj.setValueOpt marker "sizemode" - SizeRef |> DynObj.setValueOpt marker "sizeref" - (StandOff, MultiStandOff) |> DynObj.setSingleOrMultiOpt marker "standoff" - - marker) + marker + |> DynObj.withOptionalProperty "angle" Angle + |> DynObj.withOptionalPropertyBy "angleref" AngleRef StyleParam.AngleRef.convert + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalProperty "cauto" CAuto + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalProperty "cmid" CMid + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "colors" Colors + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalPropertyBy "colorscale" Colorscale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "cornerradius" CornerRadius + |> DynObj.withOptionalProperty "gradient" Gradient + |> DynObj.withOptionalProperty "line" Outline + |> DynObj.withOptionalSingleOrMultiProperty "size" (Size, MultiSize) + |> DynObj.withOptionalSingleOrMultiProperty "opacity" (Opacity, MultiOpacity) + |> DynObj.withOptionalProperty "pattern" Pattern + |> DynObj.withOptionalSingleOrMultiPropertyBy "symbol" (Symbol, MultiSymbol) StyleParam.MarkerSymbol.convert + |> DynObj.withOptionalSingleOrMultiPropertyBy "symbol" (Symbol3D, MultiSymbol3D) StyleParam.MarkerSymbol3D.convert + |> DynObj.withOptionalProperty "outliercolor" OutlierColor + |> DynObj.withOptionalProperty "outlierwidth" OutlierWidth + |> DynObj.withOptionalProperty "maxdisplayed" MaxDisplayed + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "sizemin" SizeMin + |> DynObj.withOptionalProperty "sizemode" SizeMode + |> DynObj.withOptionalProperty "sizeref" SizeRef + |> DynObj.withOptionalSingleOrMultiProperty "standoff" (StandOff, MultiStandOff) + ) diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/MeanLine.fs b/src/Plotly.NET/Traces/ObjectAbstractions/MeanLine.fs index 9e8e54534..84cf107ed 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/MeanLine.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/MeanLine.fs @@ -27,10 +27,9 @@ type MeanLine() = [] ?Color: Color, [] ?Width: float ) = - (fun (line: MeanLine) -> - Visible |> DynObj.setValueOpt line "visible" - Color |> DynObj.setValueOpt line "color" - Width |> DynObj.setValueOpt line "width" + fun (line: MeanLine) -> - // out -> - line) + line + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "width" Width diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Pathbar.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Pathbar.fs index 548cddc4b..9705fba47 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Pathbar.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Pathbar.fs @@ -61,11 +61,11 @@ type Pathbar() = [] ?Thickness: float, [] ?Textfont: Font ) = - (fun (pathbar: Pathbar) -> - Visible |> DynObj.setValueOpt pathbar "visible" - Side |> DynObj.setValueOptBy pathbar "side" StyleParam.Side.convert - EdgeShape |> DynObj.setValueOptBy pathbar "edgeshape" StyleParam.PathbarEdgeShape.convert - Thickness |> DynObj.setValueOpt pathbar "thickness" - Textfont |> DynObj.setValueOpt pathbar "textfont " + fun (pathbar: Pathbar) -> - pathbar) + pathbar + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalPropertyBy "side" Side StyleParam.Side.convert + |> DynObj.withOptionalPropertyBy "edgeshape" EdgeShape StyleParam.PathbarEdgeShape.convert + |> DynObj.withOptionalProperty "thickness" Thickness + |> DynObj.withOptionalProperty "textfont" Textfont diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Pattern.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Pattern.fs index 05701751d..18cc28513 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Pattern.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Pattern.fs @@ -72,13 +72,12 @@ type Pattern() = ) = fun (pattern: Pattern) -> - - BGColor |> DynObj.setValueOpt pattern "bgcolor" - FGColor |> DynObj.setValueOpt pattern "fgcolor" - FGOpacity |> DynObj.setValueOpt pattern "fgopacity" - FillMode |> DynObj.setValueOptBy pattern "fillmode" StyleParam.PatternFillMode.convert - (Shape, MultiShape) |> DynObj.setSingleOrMultiOptBy pattern "shape" StyleParam.PatternShape.convert - (Size, MultiSize) |> DynObj.setSingleOrMultiOpt pattern "size" - Solidity |> DynObj.setValueOpt pattern "solidity" - pattern + |> DynObj.withOptionalProperty "bgcolor" BGColor + |> DynObj.withOptionalProperty "fgcolor" FGColor + |> DynObj.withOptionalProperty "fgopacity" FGOpacity + |> DynObj.withOptionalPropertyBy "fillmode" FillMode StyleParam.PatternFillMode.convert + |> DynObj.withOptionalSingleOrMultiPropertyBy "shape" (Shape, MultiShape) StyleParam.PatternShape.convert + |> DynObj.withOptionalSingleOrMultiProperty "size" (Size, MultiSize) + |> DynObj.withOptionalProperty "solidity" Solidity + diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Projection.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Projection.fs index d6261cd7b..e705f18bd 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Projection.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Projection.fs @@ -27,11 +27,10 @@ type ProjectionDimension() = fun (projectionDimension: ProjectionDimension) -> - Opacity |> DynObj.setValueOpt projectionDimension "opacity" - Scale |> DynObj.setValueOpt projectionDimension "scale" - Show |> DynObj.setValueOpt projectionDimension "show" - projectionDimension + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "scale" Scale + |> DynObj.withOptionalProperty "show" Show type Projection() = inherit DynamicObj() @@ -53,8 +52,7 @@ type Projection() = fun (projection: Projection) -> - X |> DynObj.setValueOpt projection "x" - Y |> DynObj.setValueOpt projection "y" - Z |> DynObj.setValueOpt projection "z" - projection + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z \ No newline at end of file diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Sankey.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Sankey.fs index 17d13fa9c..bf3067ba1 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Sankey.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Sankey.fs @@ -60,22 +60,20 @@ type SankeyNodes() = [] ?X: seq<#IConvertible>, [] ?Y: seq<#IConvertible> ) = - (fun (sankeyNodes: SankeyNodes) -> - - Color |> DynObj.setValueOpt sankeyNodes "color" - CustomData |> DynObj.setValueOpt sankeyNodes "customdata" - Groups |> DynObj.setValueOpt sankeyNodes "hoverinfo" - HoverInfo |> DynObj.setValueOptBy sankeyNodes "color" StyleParam.HoverInfo.convert - HoverLabel |> DynObj.setValueOpt sankeyNodes "hoverlabel" - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt sankeyNodes "hovertemplate" - Label |> DynObj.setValueOpt sankeyNodes "label" - Line |> DynObj.setValueOpt sankeyNodes "line" - Pad |> DynObj.setValueOpt sankeyNodes "pad" - Thickness |> DynObj.setValueOpt sankeyNodes "thickness" - X |> DynObj.setValueOpt sankeyNodes "x" - Y |> DynObj.setValueOpt sankeyNodes "y" - - sankeyNodes) + fun (sankeyNodes: SankeyNodes) -> + sankeyNodes + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "groups" Groups + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "label" Label + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "pad" Pad + |> DynObj.withOptionalProperty "thickness" Thickness + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y type SankeyLinkColorscale() = inherit DynamicObj() @@ -110,17 +108,15 @@ type SankeyLinkColorscale() = [] ?Name: string, [] ?TemplateItemName: string ) = - (fun (sankeyLinkColorscale: SankeyLinkColorscale) -> + fun (sankeyLinkColorscale: SankeyLinkColorscale) -> - CMax |> DynObj.setValueOpt sankeyLinkColorscale "cmax" - CMin |> DynObj.setValueOpt sankeyLinkColorscale "cmin" - ColorScale |> DynObj.setValueOptBy sankeyLinkColorscale "colorscale" StyleParam.Colorscale.convert - Label |> DynObj.setValueOpt sankeyLinkColorscale "label" - Name |> DynObj.setValueOpt sankeyLinkColorscale "name" - TemplateItemName |> DynObj.setValueOpt sankeyLinkColorscale "templateitemname" - - - sankeyLinkColorscale) + sankeyLinkColorscale + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "label" Label + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "templateitemname" TemplateItemName type SankeyLinks() = inherit DynamicObj() @@ -176,21 +172,19 @@ type SankeyLinks() = [] ?Target: seq, [] ?Value: seq<#IConvertible> ) = - (fun (sankeyLinks: SankeyLinks) -> - - ArrowLen |> DynObj.setValueOpt sankeyLinks "arrowlen" - Color |> DynObj.setValueOpt sankeyLinks "color" - ColorScales |> DynObj.setValueOpt sankeyLinks "colorscales" - CustomData |> DynObj.setValueOpt sankeyLinks "customdata" - HoverInfo |> DynObj.setValueOptBy sankeyLinks "hoverinfo" StyleParam.HoverInfo.convert - HoverLabel |> DynObj.setValueOpt sankeyLinks "hoverlabel" - HoverTemplate |> DynObj.setValueOpt sankeyLinks "hovertemplate" - MultiHoverTemplate |> DynObj.setValueOpt sankeyLinks "multihovertemplate" - Label |> DynObj.setValueOpt sankeyLinks "label" - Line |> DynObj.setValueOpt sankeyLinks "line" - Source |> DynObj.setValueOpt sankeyLinks "source" - Target |> DynObj.setValueOpt sankeyLinks "target" - Value |> DynObj.setValueOpt sankeyLinks "value" - - - sankeyLinks) + fun (sankeyLinks: SankeyLinks) -> + + sankeyLinks + |> DynObj.withOptionalProperty "arrowlen" ArrowLen + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "colorscales" ColorScales + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "label" Label + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "source" Source + |> DynObj.withOptionalProperty "target" Target + |> DynObj.withOptionalProperty "value" Value + diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Slices.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Slices.fs index 60ec2a430..655f2314a 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Slices.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Slices.fs @@ -26,11 +26,10 @@ type SlicesFill() = fun (slicesFill: SlicesFill) -> - Fill |> DynObj.setValueOpt slicesFill "fill" - Locations |> DynObj.setValueOpt slicesFill "locations" - Show |> DynObj.setValueOpt slicesFill "show" - slicesFill + |> DynObj.withOptionalProperty "fill" Fill + |> DynObj.withOptionalProperty "locations" Locations + |> DynObj.withOptionalProperty "show" Show type Slices() = @@ -53,8 +52,7 @@ type Slices() = ) = fun (slices: Slices) -> - X |> DynObj.setValueOpt slices "x" - Y |> DynObj.setValueOpt slices "y" - Z |> DynObj.setValueOpt slices "z" - slices + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/SpaceFrame.fs b/src/Plotly.NET/Traces/ObjectAbstractions/SpaceFrame.fs index 98a726ff9..3dbc72d36 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/SpaceFrame.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/SpaceFrame.fs @@ -24,7 +24,6 @@ type Spaceframe() = fun (spaceframe: Spaceframe) -> - Fill |> DynObj.setValueOpt spaceframe "fill" - Show |> DynObj.setValueOpt spaceframe "show" - spaceframe + |> DynObj.withOptionalProperty "fill" Fill + |> DynObj.withOptionalProperty "show" Show diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/SplomDiagonal.fs b/src/Plotly.NET/Traces/ObjectAbstractions/SplomDiagonal.fs index 266305f00..9647f8d70 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/SplomDiagonal.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/SplomDiagonal.fs @@ -16,6 +16,5 @@ type SplomDiagonal() = fun (splomDiagonal: SplomDiagonal) -> - Visible |> DynObj.setValueOpt splomDiagonal "visible" - splomDiagonal + |> DynObj.withOptionalProperty "visible" Visible diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/StreamTubeStarts.fs b/src/Plotly.NET/Traces/ObjectAbstractions/StreamTubeStarts.fs index 716a9f8e9..e1d36286e 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/StreamTubeStarts.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/StreamTubeStarts.fs @@ -39,8 +39,7 @@ type StreamTubeStarts() = ) = fun (streamTubeStarts: StreamTubeStarts) -> - X |> DynObj.setValueOpt streamTubeStarts "x" - Y |> DynObj.setValueOpt streamTubeStarts "y" - Z |> DynObj.setValueOpt streamTubeStarts "z" - streamTubeStarts + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Sunburst.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Sunburst.fs index bac124273..762b41f6e 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Sunburst.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Sunburst.fs @@ -15,11 +15,9 @@ type SunburstRoot() = SunburstRoot() |> SunburstRoot.style (?Color = Color) static member style([] ?Color: Color) = - (fun (root: SunburstRoot) -> - - Color |> DynObj.setValueOpt root "color" - - root) + fun (root: SunburstRoot) -> + root + |> DynObj.withOptionalProperty "color" Color type SunburstLeaf() = inherit DynamicObj() @@ -29,8 +27,8 @@ type SunburstLeaf() = SunburstLeaf() |> SunburstLeaf.style (?Opacity = Opacity) static member style([] ?Opacity: float) = - (fun (leaf: SunburstLeaf) -> + fun (leaf: SunburstLeaf) -> - Opacity |> DynObj.setValueOpt leaf "opacity" + leaf + |> DynObj.withOptionalProperty "opacity" Opacity - leaf) diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Surface.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Surface.fs index 840adeee4..a099edeb3 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Surface.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Surface.fs @@ -28,9 +28,8 @@ type Surface() = fun (surface: Surface) -> - Count |> DynObj.setValueOpt surface "count" - Fill |> DynObj.setValueOpt surface "fill" - Pattern |> DynObj.setValueOptBy surface "pattern" StyleParam.SurfacePattern.convert - Show |> DynObj.setValueOpt surface "show" - surface + |> DynObj.withOptionalProperty "count" Count + |> DynObj.withOptionalProperty "fill" Fill + |> DynObj.withOptionalPropertyBy "pattern" Pattern StyleParam.SurfacePattern.convert + |> DynObj.withOptionalProperty "show" Show diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Table.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Table.fs index aa1e8605a..e91553225 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Table.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Table.fs @@ -14,10 +14,9 @@ type TableFill() = TableFill() |> TableFill.style (?Color = Color) static member style([] ?Color: Color) = - (fun (fill: TableFill) -> - Color |> DynObj.setValueOpt fill "color" - fill) - + fun (fill: TableFill) -> + fill + |> DynObj.withOptionalProperty "color" Color /// Cells type inherits from dynamic object type TableCells() = @@ -71,19 +70,17 @@ type TableCells() = [] ?MultiSuffix: seq, [] ?Values: seq<#seq<#IConvertible>> ) = - (fun (cells: TableCells) -> - - (Align, MultiAlign) |> DynObj.setSingleOrMultiOptBy cells "align" StyleParam.HorizontalAlign.convert - Fill |> DynObj.setValueOpt cells "fill" - Font |> DynObj.setValueOpt cells "font" - Format |> DynObj.setValueOpt cells "format" - Height |> DynObj.setValueOpt cells "height" - Line |> DynObj.setValueOpt cells "line" - (Prefix, MultiPrefix) |> DynObj.setSingleOrMultiOpt cells "prefix" - (Suffix, MultiSuffix) |> DynObj.setSingleOrMultiOpt cells "suffix" - Values |> DynObj.setValueOpt cells "values" - + fun (cells: TableCells) -> - cells) + cells + |> DynObj.withOptionalSingleOrMultiPropertyBy "align" (Align, MultiAlign) StyleParam.HorizontalAlign.convert + |> DynObj.withOptionalProperty "fill" Fill + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "format" Format + |> DynObj.withOptionalProperty "height" Height + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalSingleOrMultiProperty "prefix" (Prefix, MultiPrefix) + |> DynObj.withOptionalSingleOrMultiProperty "suffix" (Suffix, MultiSuffix) + |> DynObj.withOptionalProperty "values" Values type TableHeader = TableCells diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/TraceSelection.fs b/src/Plotly.NET/Traces/ObjectAbstractions/TraceSelection.fs index fa92b8aba..476dc2745 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/TraceSelection.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/TraceSelection.fs @@ -36,13 +36,12 @@ type MarkerSelectionStyle() = [] ?Color: Color, [] ?Size: int ) = - (fun (markerSelectionStyle: MarkerSelectionStyle) -> + fun (markerSelectionStyle: MarkerSelectionStyle) -> - Opacity |> DynObj.setValueOpt markerSelectionStyle "opacity" - Color |> DynObj.setValueOpt markerSelectionStyle "color" - Size |> DynObj.setValueOpt markerSelectionStyle "size" - - markerSelectionStyle) + markerSelectionStyle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalProperty "size" Size /// Controls the style of selected lines in supported traces type LineSelectionStyle() = @@ -70,12 +69,11 @@ type LineSelectionStyle() = [] ?Opacity: float, [] ?Color: Color ) = - (fun (lineSelectionStyle: LineSelectionStyle) -> - - Opacity |> DynObj.setValueOpt lineSelectionStyle "opacity" - Color |> DynObj.setValueOpt lineSelectionStyle "color" + fun (lineSelectionStyle: LineSelectionStyle) -> - lineSelectionStyle) + lineSelectionStyle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "color" Color /// Controls the style of selected text in supported traces type FontSelectionStyle() = @@ -93,11 +91,10 @@ type FontSelectionStyle() = /// /// Sets the color of the selected/unselected text static member style([] ?Color: Color) = - (fun (fontSelectionStyle: FontSelectionStyle) -> + fun (fontSelectionStyle: FontSelectionStyle) -> - Color |> DynObj.setValueOpt fontSelectionStyle "color" - - fontSelectionStyle) + fontSelectionStyle + |> DynObj.withOptionalProperty "color" Color /// /// Used to control selected/unselected trace item styles in supported traces. @@ -136,10 +133,9 @@ type TraceSelection() = [] ?LineSelectionStyle: LineSelectionStyle, [] ?FontSelectionStyle: FontSelectionStyle ) = - (fun (traceSelection: TraceSelection) -> - - MarkerSelectionStyle |> DynObj.setValueOpt traceSelection "marker" - LineSelectionStyle |> DynObj.setValueOpt traceSelection "line" - FontSelectionStyle |> DynObj.setValueOpt traceSelection "font" + fun (traceSelection: TraceSelection) -> - traceSelection) + traceSelection + |> DynObj.withOptionalProperty "marker" MarkerSelectionStyle + |> DynObj.withOptionalProperty "line" LineSelectionStyle + |> DynObj.withOptionalProperty "font" FontSelectionStyle diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/Treemap.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Treemap.fs index d9de061bb..63762984c 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/Treemap.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Treemap.fs @@ -15,11 +15,9 @@ type TreemapRoot() = TreemapRoot() |> TreemapRoot.style (?Color = Color) static member style([] ?Color: Color) = - (fun (root: TreemapRoot) -> - - Color |> DynObj.setValueOpt root "color" - - root) + fun (root: TreemapRoot) -> + root + |> DynObj.withProperty "color" Color type TreemapLeaf() = inherit DynamicObj() @@ -29,11 +27,10 @@ type TreemapLeaf() = TreemapLeaf() |> TreemapLeaf.style (?Opacity = Opacity) static member style([] ?Opacity: float) = - (fun (leaf: TreemapLeaf) -> - - Opacity |> DynObj.setValueOpt leaf "opacity" + fun (leaf: TreemapLeaf) -> - leaf) + leaf + |> DynObj.withOptionalProperty "opacity" Opacity type TreemapTiling() = @@ -57,10 +54,10 @@ type TreemapTiling() = [] ?Flip: StyleParam.TilingFlip, [] ?Pad: float ) = - (fun (tiling: TreemapTiling) -> - Packing |> DynObj.setValueOptBy tiling "packing" StyleParam.TreemapTilingPacking.convert - SquarifyRatio |> DynObj.setValueOpt tiling "squarifyRatio" - Flip |> DynObj.setValueOptBy tiling "flip" StyleParam.TilingFlip.convert - Pad |> DynObj.setValueOpt tiling "pad" + fun (tiling: TreemapTiling) -> - tiling) + tiling + |> DynObj.withOptionalPropertyBy "packing" Packing StyleParam.TreemapTilingPacking.convert + |> DynObj.withOptionalProperty "squarifyRatio" SquarifyRatio + |> DynObj.withOptionalPropertyBy "flip" Flip StyleParam.TilingFlip.convert + |> DynObj.withOptionalProperty "pad" Pad diff --git a/src/Plotly.NET/Traces/ObjectAbstractions/WaterfallConnector.fs b/src/Plotly.NET/Traces/ObjectAbstractions/WaterfallConnector.fs index 20c4be680..1ac0057c5 100644 --- a/src/Plotly.NET/Traces/ObjectAbstractions/WaterfallConnector.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/WaterfallConnector.fs @@ -34,10 +34,9 @@ type WaterfallConnector() = [] ?Visible: bool, [] ?ConnectorMode: StyleParam.ConnectorMode ) = - (fun (connector: WaterfallConnector) -> + fun (connector: WaterfallConnector) -> - Line |> DynObj.setValueOpt connector "line" - Visible |> DynObj.setValueOpt connector "visible" - ConnectorMode |> DynObj.setValueOptBy connector "mode" StyleParam.ConnectorMode.convert - - connector) + connector + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "visible" Visible + |> DynObj.withOptionalPropertyBy "mode" ConnectorMode StyleParam.ConnectorMode.convert diff --git a/src/Plotly.NET/Traces/Trace.fs b/src/Plotly.NET/Traces/Trace.fs index 4910c8f35..d9eb9e738 100644 --- a/src/Plotly.NET/Traces/Trace.fs +++ b/src/Plotly.NET/Traces/Trace.fs @@ -22,7 +22,7 @@ type Trace(traceTypeName: string) = /// /// The name of the dynamic member to get the value of /// The trace to get the dynamic member value from - static member tryGetTypedMember<'T> (propName: string) (trace: Trace) = trace.TryGetTypedValue<'T>(propName) + static member tryGetTypedMember<'T> (propName: string) (trace: Trace) = trace.TryGetTypedPropertyValue<'T>(propName) /// /// Returns the Marker object of the given trace. @@ -39,7 +39,7 @@ type Trace(traceTypeName: string) = /// The new marker object static member setMarker(marker: Marker) = (fun (trace: ('T :> Trace)) -> - trace.SetValue("marker", marker) + trace.SetProperty("marker", marker) trace) /// @@ -49,7 +49,7 @@ type Trace(traceTypeName: string) = static member updateMarker(marker: Marker) = (fun (trace: #Trace) -> let combined = - (DynObj.combine (trace |> Trace.getMarker) marker) :?> Marker + (DynObj.combine (trace |> Trace.getMarker) marker) |> unbox trace |> Trace.setMarker combined) @@ -68,7 +68,7 @@ type Trace(traceTypeName: string) = /// The new line object static member setLine(line: Line) = (fun (trace: #Trace) -> - trace.SetValue("line", line) + trace.SetProperty("line", line) trace) /// @@ -78,7 +78,7 @@ type Trace(traceTypeName: string) = static member updateLine(line: Line) = (fun (trace: #Trace) -> let combined = - (DynObj.combine (trace |> Trace.getLine) line) :?> Line + (DynObj.combine (trace |> Trace.getLine) line) |> unbox trace |> Trace.setLine combined) @@ -97,7 +97,7 @@ type Trace(traceTypeName: string) = /// The new error object static member setXError(error: Error) = (fun (trace: #Trace) -> - trace.SetValue("error_x", error) + trace.SetProperty("error_x", error) trace) /// @@ -107,7 +107,7 @@ type Trace(traceTypeName: string) = static member updateXError(error: Error) = (fun (trace: #Trace) -> let combined = - (DynObj.combine (trace |> Trace.getXError) error) :?> Error + (DynObj.combine (trace |> Trace.getXError) error) |> unbox trace |> Trace.setXError combined) @@ -126,7 +126,7 @@ type Trace(traceTypeName: string) = /// The new error object static member setYError(error: Error) = (fun (trace: #Trace) -> - trace.SetValue("error_y", error) + trace.SetProperty("error_y", error) trace) /// @@ -136,7 +136,7 @@ type Trace(traceTypeName: string) = static member updateYError(error: Error) = (fun (trace: #Trace) -> let combined = - (DynObj.combine (trace |> Trace.getYError) error) :?> Error + (DynObj.combine (trace |> Trace.getYError) error) |> unbox trace |> Trace.setYError combined) @@ -155,7 +155,7 @@ type Trace(traceTypeName: string) = /// The new error object static member setZError(error: Error) = (fun (trace: #Trace) -> - trace.SetValue("error_z", error) + trace.SetProperty("error_z", error) trace) /// @@ -165,7 +165,7 @@ type Trace(traceTypeName: string) = static member updateZError(error: Error) = (fun (trace: #Trace) -> let combined = - (DynObj.combine (trace |> Trace.getZError) error) :?> Error + (DynObj.combine (trace |> Trace.getZError) error) |> unbox trace |> Trace.setZError combined) @@ -193,7 +193,7 @@ type Trace(traceTypeName: string) = StyleParam.SubPlotId.ColorAxis colorAxisId (fun (trace: #Trace) -> - trace.SetValue("coloraxis", StyleParam.SubPlotId.convert id) + trace.SetProperty("coloraxis", StyleParam.SubPlotId.convert id) trace) /// @@ -220,7 +220,7 @@ type Trace(traceTypeName: string) = StyleParam.SubPlotId.Legend legendId (fun (trace: #Trace) -> - trace.SetValue("legend", StyleParam.SubPlotId.convert id) + trace.SetProperty("legend", StyleParam.SubPlotId.convert id) trace) /// @@ -238,7 +238,7 @@ type Trace(traceTypeName: string) = /// The new domain static member setDomain(domain: Domain) = (fun (trace: ('T :> Trace)) -> - trace.SetValue("domain", domain) + trace.SetProperty("domain", domain) trace) /// @@ -248,7 +248,7 @@ type Trace(traceTypeName: string) = static member updateDomain(domain: Domain) = (fun (trace: #Trace) -> let combined = - (DynObj.combine (trace |> Trace.getDomain) domain) :?> Domain + (DynObj.combine (trace |> Trace.getDomain) domain) |> unbox trace |> Trace.setDomain combined) @@ -267,7 +267,7 @@ type Trace(traceTypeName: string) = /// The new stackgroup static member setStackGroup(stackgroup: string) = (fun (trace: ('T :> Trace)) -> - trace.SetValue("stackgroup", stackgroup) + trace.SetProperty("stackgroup", stackgroup) trace) /// @@ -286,7 +286,7 @@ type Trace(traceTypeName: string) = static member setColorBar(colorBar: ColorBar) = (fun (trace: ('T :> Trace)) -> - trace.SetValue("colorbar", colorBar) + trace.SetProperty("colorbar", colorBar) trace) /// @@ -296,7 +296,7 @@ type Trace(traceTypeName: string) = static member updateColorBar(colorBar: ColorBar) = (fun (trace: #Trace) -> let combined = - (DynObj.combine (trace |> Trace.getColorBar) colorBar) :?> ColorBar + DynObj.combine (trace |> Trace.getColorBar) colorBar |> unbox trace |> Trace.setColorBar combined) @@ -327,16 +327,14 @@ type TraceStyle() = [] ?LegendGroup: string, [] ?LegendGroupTitle: Title ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - - trace) + fun (trace: #Trace) -> + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle /// /// Returns a function that applies the given styles to the trace's marker object. Overwrites attributes with the same name that are already set. @@ -704,13 +702,11 @@ type TraceStyle() = [] ?Selected: TraceSelection, [] ?Unselected: TraceSelection ) = - (fun (trace: ('T :> Trace)) -> - - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - - trace) + fun (trace: #Trace) -> + trace + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected /// /// Returns a function that applies the given styles to the trace's text items. @@ -742,20 +738,16 @@ type TraceStyle() = [] ?MultiHoverTemplate: seq, [] ?TextFont: Font ) = - (fun (trace: ('T :> Trace)) -> - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert + fun (trace: #Trace) -> + trace + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "textfont" TextFont - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - - TextFont |> DynObj.setValueOpt trace "textfont" - - trace) // /// Returns a function that applies the given styles to the trace's domain object. diff --git a/src/Plotly.NET/Traces/Trace2D.fs b/src/Plotly.NET/Traces/Trace2D.fs index a6f57446d..aa6e7dbfe 100644 --- a/src/Plotly.NET/Traces/Trace2D.fs +++ b/src/Plotly.NET/Traces/Trace2D.fs @@ -103,12 +103,10 @@ type Trace2DStyle() = [] ?X: StyleParam.LinearAxisId, [] ?Y: StyleParam.LinearAxisId ) = - (fun (trace: Trace2D) -> - - X |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.toString - Y |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.toString - - trace) + fun (trace: Trace2D) -> + trace + |> DynObj.withOptionalPropertyBy "xaxis" X StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" Y StyleParam.LinearAxisId.convert /// /// Create a function that applies the styles of a scatter plot to a Trace object @@ -246,71 +244,67 @@ type Trace2DStyle() = [] ?YCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - Ids |> DynObj.setValueOpt trace "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt trace "x" - X0 |> DynObj.setValueOpt trace "x0" - DX |> DynObj.setValueOpt trace "dx" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt trace "y" - Y0 |> DynObj.setValueOpt trace "y0" - DY |> DynObj.setValueOpt trace "dy" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" + fun (trace: ('T :> Trace)) -> + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.Mode.convert + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "dx" DX + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "dy" DY + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy"textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalPropertyBy "groupnorm" GroupNorm StyleParam.GroupNorm.convert + |> DynObj.withOptionalProperty "alignmentgroup" AlignmentGroup + |> DynObj.withOptionalProperty "offsetgroup" OffsetGroup + |> DynObj.withOptionalProperty "stackgroup" StackGroup + |> DynObj.withOptionalProperty "xperiod" XPeriod + |> DynObj.withOptionalPropertyBy "xperiodalignment" XPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "xperiod0" XPeriod0 + |> DynObj.withOptionalProperty "yperiod" YPeriod + |> DynObj.withOptionalPropertyBy "yperiodalignment" YPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "yperiod0" YPeriod0 + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "error_x" XError + |> DynObj.withOptionalProperty "error_y" YError + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "cliponaxis" ClipOnAxis + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalPropertyBy "fill" Fill StyleParam.Fill.convert + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "fillpattern" FillPattern + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "hoveron" HoverOn StyleParam.HoverOn.convert + |> DynObj.withOptionalPropertyBy "stackgaps" StackGaps StyleParam.StackGaps.convert + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - XHoverFormat |> DynObj.setValueOpt trace "xhoverformat" - YHoverFormat |> DynObj.setValueOpt trace "yhoverformat" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - XAxis |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.convert - Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert - GroupNorm |> DynObj.setValueOptBy trace "groupnorm" StyleParam.GroupNorm.convert - AlignmentGroup |> DynObj.setValueOpt trace "alignmentgroup" - OffsetGroup |> DynObj.setValueOpt trace "offsetgroup" - StackGroup |> DynObj.setValueOpt trace "stackgroup" - XPeriod |> DynObj.setValueOpt trace "xperiod" - XPeriodAlignment |> DynObj.setValueOptBy trace "xperiodalignment" StyleParam.PeriodAlignment.convert - XPeriod0 |> DynObj.setValueOpt trace "xperiod0" - YPeriod |> DynObj.setValueOpt trace "yperiod" - YPeriodAlignment |> DynObj.setValueOptBy trace "yperiodalignment" StyleParam.PeriodAlignment.convert - YPeriod0 |> DynObj.setValueOpt trace "yperiod0" - Marker |> DynObj.setValueOpt trace "marker" - Line |> DynObj.setValueOpt trace "line" - TextFont |> DynObj.setValueOpt trace "textfont" - XError |> DynObj.setValueOpt trace "error_x" - YError |> DynObj.setValueOpt trace "error_y" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - ClipOnAxis |> DynObj.setValueOpt trace "cliponaxis" - ConnectGaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - FillColor |> DynObj.setValueOpt trace "fillcolor" - FillPattern |> DynObj.setValueOpt trace "fillpattern" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - HoverOn |> DynObj.setValueOptBy trace "hoveron" StyleParam.HoverOn.convert - StackGaps |> DynObj.setValueOptBy trace "stackgaps" StyleParam.StackGaps.convert - XCalendar |> DynObj.setValueOptBy trace "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy trace "ycalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) /// /// Create a function that applies the styles of a bar plot to a Trace object @@ -448,71 +442,65 @@ type Trace2DStyle() = [] ?YCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (bar: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt bar "name" - Visible |> DynObj.setValueOptBy bar "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt bar "showlegend" - Legend |> DynObj.setValueOptBy bar "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt bar "legendrank" - LegendGroup |> DynObj.setValueOpt bar "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt bar "legendgrouptitle" - Opacity |> DynObj.setValueOpt bar "opacity" - Ids |> DynObj.setValueOpt bar "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt bar "x" - X0 |> DynObj.setValueOpt bar "x0" - DX |> DynObj.setValueOpt bar "dx" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt bar "y" - Y0 |> DynObj.setValueOpt bar "y0" - DY |> DynObj.setValueOpt bar "dy" - Base |> DynObj.setValueOpt bar "base" - (Width, MultiWidth) |> DynObj.setSingleOrMultiOpt bar "width" - (Offset, MultiOffset) |> DynObj.setSingleOrMultiOpt bar "offset" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt bar "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy bar "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt bar "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt bar "hovertext" - HoverInfo |> DynObj.setValueOptBy bar "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt bar "hovertemplate" - XHoverFormat |> DynObj.setValueOpt bar "xhoverformat" - YHoverFormat |> DynObj.setValueOpt bar "yhoverformat" - Meta |> DynObj.setValueOpt bar "meta" - CustomData |> DynObj.setValueOpt bar "customdata" - XAxis |> DynObj.setValueOptBy bar "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy bar "yaxis" StyleParam.LinearAxisId.convert - Orientation |> DynObj.setValueOptBy bar "orientation" StyleParam.Orientation.convert - AlignmentGroup |> DynObj.setValueOpt bar "alignmentgroup" - OffsetGroup |> DynObj.setValueOpt bar "offsetgroup" - XPeriod |> DynObj.setValueOpt bar "xperiod" - XPeriodAlignment |> DynObj.setValueOptBy bar "xperiodalignment" StyleParam.PeriodAlignment.convert - XPeriod0 |> DynObj.setValueOpt bar "xperiod0" - YPeriod |> DynObj.setValueOpt bar "yperiod" - YPeriodAlignment |> DynObj.setValueOptBy bar "yperiodalignment" StyleParam.PeriodAlignment.convert - YPeriod0 |> DynObj.setValueOpt bar "yperiod0" - Marker |> DynObj.setValueOpt bar "marker" - TextAngle |> DynObj.setValueOpt bar "textangle" - TextFont |> DynObj.setValueOpt bar "textfont" - XError |> DynObj.setValueOpt bar "error_x" - YError |> DynObj.setValueOpt bar "error_y" - SelectedPoints |> DynObj.setValueOpt bar "selectedpoints" - Selected |> DynObj.setValueOpt bar "selected" - Unselected |> DynObj.setValueOpt bar "unselected" - ClipOnAxis |> DynObj.setValueOpt bar "cliponaxis" - Constraintext |> DynObj.setValueOptBy bar "constraintext" StyleParam.ConstrainText.convert - HoverLabel |> DynObj.setValueOpt bar "hoverlabel" - InsideTextAnchor |> DynObj.setValueOptBy bar "insidetextanchor" StyleParam.InsideTextAnchor.convert - InsideTextFont |> DynObj.setValueOpt bar "insidetextfont" - OutsideTextFont |> DynObj.setValueOpt bar "outsidetextfont" - XCalendar |> DynObj.setValueOptBy bar "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy bar "ycalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt bar "uirevision" + fun (bar: ('T :> Trace)) -> bar - - ) + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "dx" DX + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "dy" DY + |> DynObj.withOptionalProperty "base" Base + |> DynObj.withOptionalSingleOrMultiProperty "width" (Width, MultiWidth) + |> DynObj.withOptionalSingleOrMultiProperty "offset" (Offset, MultiOffset) + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "alignmentgroup" AlignmentGroup + |> DynObj.withOptionalProperty "offsetgroup" OffsetGroup + |> DynObj.withOptionalProperty "xperiod" XPeriod + |> DynObj.withOptionalPropertyBy "xperiodalignment" XPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "xperiod0" XPeriod0 + |> DynObj.withOptionalProperty "yperiod" YPeriod + |> DynObj.withOptionalPropertyBy "yperiodalignment" YPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "yperiod0" YPeriod0 + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "textangle" TextAngle + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "error_x" XError + |> DynObj.withOptionalProperty "error_y" YError + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "cliponaxis" ClipOnAxis + |> DynObj.withOptionalPropertyBy "constraintext" Constraintext StyleParam.ConstrainText.convert + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "insidetextanchor" InsideTextAnchor StyleParam.InsideTextAnchor.convert + |> DynObj.withOptionalProperty "insidetextfont" InsideTextFont + |> DynObj.withOptionalProperty "outsidetextfont" OutsideTextFont + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a funnel plot to a Trace object @@ -636,66 +624,61 @@ type Trace2DStyle() = [] ?OutsideTextFont: Font, [] ?UIRevision: string ) = - (fun (funnel: #Trace) -> - - Name |> DynObj.setValueOpt funnel "name" - Visible |> DynObj.setValueOptBy funnel "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt funnel "showlegend" - Legend |> DynObj.setValueOptBy funnel "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt funnel "legendrank" - LegendGroup |> DynObj.setValueOpt funnel "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt funnel "legendgrouptitle" - Opacity |> DynObj.setValueOpt funnel "opacity" - Ids |> DynObj.setValueOpt funnel "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt funnel "x" - X0 |> DynObj.setValueOpt funnel "x0" - DX |> DynObj.setValueOpt funnel "dx" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt funnel "y" - Y0 |> DynObj.setValueOpt funnel "y0" - DY |> DynObj.setValueOpt funnel "dy" - Width |> DynObj.setValueOpt funnel "width" - Offset |> DynObj.setValueOpt funnel "offset" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt funnel "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy funnel "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt funnel "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt funnel "hovertext" - HoverInfo |> DynObj.setValueOptBy funnel "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt funnel "hovertemplate" - XHoverFormat |> DynObj.setValueOpt funnel "xhoverformat" - YHoverFormat |> DynObj.setValueOpt funnel "yhoverformat" - Meta |> DynObj.setValueOpt funnel "meta" - CustomData |> DynObj.setValueOpt funnel "customdata" - XAxis |> DynObj.setValueOptBy funnel "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy funnel "yaxis" StyleParam.LinearAxisId.convert - Orientation |> DynObj.setValueOptBy funnel "orientation" StyleParam.Orientation.convert - AlignmentGroup |> DynObj.setValueOpt funnel "alignmentgroup" - OffsetGroup |> DynObj.setValueOpt funnel "offsetgroup" - XPeriod |> DynObj.setValueOpt funnel "xperiod" - XPeriodAlignment |> DynObj.setValueOptBy funnel "xperiodalignment" StyleParam.PeriodAlignment.convert - XPeriod0 |> DynObj.setValueOpt funnel "xperiod0" - YPeriod |> DynObj.setValueOpt funnel "yperiod" - YPeriodAlignment |> DynObj.setValueOptBy funnel "yperiodalignment" StyleParam.PeriodAlignment.convert - YPeriod0 |> DynObj.setValueOpt funnel "yperiod0" - Marker |> DynObj.setValueOpt funnel "marker" - TextAngle |> DynObj.setValueOpt funnel "textangle" - TextFont |> DynObj.setValueOpt funnel "textfont" - TextInfo |> DynObj.setValueOptBy funnel "textinfo" StyleParam.TextInfo.convert - SelectedPoints |> DynObj.setValueOpt funnel "selectedpoints" - ClipOnAxis |> DynObj.setValueOpt funnel "cliponaxis" - Connector |> DynObj.setValueOpt funnel "connector" - Constraintext |> DynObj.setValueOptBy funnel "constraintext" StyleParam.ConstrainText.convert - HoverLabel |> DynObj.setValueOpt funnel "hoverlabel" - InsideTextAnchor |> DynObj.setValueOptBy funnel "insidetextanchor" StyleParam.InsideTextAnchor.convert - InsideTextFont |> DynObj.setValueOpt funnel "insidetextfont" - OutsideTextFont |> DynObj.setValueOpt funnel "outsidetextfont" - UIRevision |> DynObj.setValueOpt funnel "uirevision" - + fun (funnel: #Trace) -> + funnel + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "dx" DX + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "dy" DY + |> DynObj.withOptionalProperty "width" Width + |> DynObj.withOptionalProperty "offset" Offset + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "alignmentgroup" AlignmentGroup + |> DynObj.withOptionalProperty "offsetgroup" OffsetGroup + |> DynObj.withOptionalProperty "xperiod" XPeriod + |> DynObj.withOptionalPropertyBy "xperiodalignment" XPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "xperiod0" XPeriod0 + |> DynObj.withOptionalProperty "yperiod" YPeriod + |> DynObj.withOptionalPropertyBy "yperiodalignment" YPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "yperiod0" YPeriod0 + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "textangle" TextAngle + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalPropertyBy "textinfo" TextInfo StyleParam.TextInfo.convert + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "cliponaxis" ClipOnAxis + |> DynObj.withOptionalProperty "connector" Connector + |> DynObj.withOptionalPropertyBy "constraintext" Constraintext StyleParam.ConstrainText.convert + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "insidetextanchor" InsideTextAnchor StyleParam.InsideTextAnchor.convert + |> DynObj.withOptionalProperty "insidetextfont" InsideTextFont + |> DynObj.withOptionalProperty "outsidetextfont" OutsideTextFont + |> DynObj.withOptionalProperty "uirevision" UIRevision - ) /// /// Create a function that applies the styles of a waterfall plot to a Trace object @@ -831,69 +814,64 @@ type Trace2DStyle() = [] ?Totals: FinanceMarker, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt trace "x" - X0 |> DynObj.setValueOpt trace "x0" - DX |> DynObj.setValueOpt trace "dx" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt trace "y" - Y0 |> DynObj.setValueOpt trace "y0" - DY |> DynObj.setValueOpt trace "dy" - Base |> DynObj.setValueOpt trace "base" - (Width, MultiWidth) |> DynObj.setSingleOrMultiOpt trace "width" - Measure |> DynObj.setValueOptBy trace "measure" (Seq.map StyleParam.WaterfallMeasure.convert) - (Offset, MultiOffset) |> DynObj.setSingleOrMultiOpt trace "offset" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemTotalsplate" - XHoverFormat |> DynObj.setValueOpt trace "xhoverformat" - YHoverFormat |> DynObj.setValueOpt trace "yhoverformat" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - XAxis |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.convert - Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert - AlignmentGroup |> DynObj.setValueOpt trace "alignmentgroup" - OffsetGroup |> DynObj.setValueOpt trace "offsetgroup" - XPeriod |> DynObj.setValueOpt trace "xperiod" - XPeriodAlignment |> DynObj.setValueOptBy trace "xperiodalignment" StyleParam.PeriodAlignment.convert - XPeriod0 |> DynObj.setValueOpt trace "xperiod0" - YPeriod |> DynObj.setValueOpt trace "yperiod" - YPeriodAlignment |> DynObj.setValueOptBy trace "yperiodalignment" StyleParam.PeriodAlignment.convert - YPeriod0 |> DynObj.setValueOpt trace "yperiod0" - TextAngle |> DynObj.setValueOpt trace "textangle" - TextFont |> DynObj.setValueOpt trace "textfont" - TextInfo |> DynObj.setValueOpt trace "textinfo" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - ClipOnAxis |> DynObj.setValueOpt trace "cliponaxis" - Connector |> DynObj.setValueOpt trace "connector" - Constraintext |> DynObj.setValueOptBy trace "constraintext" StyleParam.ConstrainText.convert - Increasing |> DynObj.setValueOpt trace "increasing" - Decreasing |> DynObj.setValueOpt trace "decreasing" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - InsideTextAnchor |> DynObj.setValueOptBy trace "insidetextanchor" StyleParam.InsideTextAnchor.convert - InsideTextFont |> DynObj.setValueOpt trace "insidetextfont" - OutsideTextFont |> DynObj.setValueOpt trace "outsidetextfont" - Totals |> DynObj.setValueOpt trace "totals" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) - + fun (waterfall: ('T :> Trace)) -> + + waterfall + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "dx" DX + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "dy" DY + |> DynObj.withOptionalProperty "base" Base + |> DynObj.withOptionalSingleOrMultiProperty "width" (Width, MultiWidth) + |> DynObj.withOptionalPropertyBy "measure" Measure (Seq.map StyleParam.WaterfallMeasure.convert) + |> DynObj.withOptionalSingleOrMultiProperty "offset" (Offset, MultiOffset) + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemTotalsplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "alignmentgroup" AlignmentGroup + |> DynObj.withOptionalProperty "offsetgroup" OffsetGroup + |> DynObj.withOptionalProperty "xperiod" XPeriod + |> DynObj.withOptionalPropertyBy "xperiodalignment" XPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "xperiod0" XPeriod0 + |> DynObj.withOptionalProperty "yperiod" YPeriod + |> DynObj.withOptionalPropertyBy "yperiodalignment" YPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "yperiod0" YPeriod0 + |> DynObj.withOptionalProperty "textangle" TextAngle + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "textinfo" TextInfo + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "cliponaxis" ClipOnAxis + |> DynObj.withOptionalProperty "connector" Connector + |> DynObj.withOptionalPropertyBy "constraintext" Constraintext StyleParam.ConstrainText.convert + |> DynObj.withOptionalProperty "increasing" Increasing + |> DynObj.withOptionalProperty "decreasing" Decreasing + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "insidetextanchor" InsideTextAnchor StyleParam.InsideTextAnchor.convert + |> DynObj.withOptionalProperty "insidetextfont" InsideTextFont + |> DynObj.withOptionalProperty "outsidetextfont" OutsideTextFont + |> DynObj.withOptionalProperty "totals" Totals + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a histogram plot to a Trace object @@ -1021,64 +999,64 @@ type Trace2DStyle() = [] ?YCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (histogram: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt histogram "name" - Visible |> DynObj.setValueOptBy histogram "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt histogram "showlegend" - Legend |> DynObj.setValueOptBy histogram "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt histogram "legendrank" - LegendGroup |> DynObj.setValueOpt histogram "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt histogram "legendgrouptitle" - Opacity |> DynObj.setValueOpt histogram "opacity" - Ids |> DynObj.setValueOpt histogram "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt histogram "x" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt histogram "y" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt histogram "text" - TextPosition |> DynObj.setValueOptBy histogram "textposition" StyleParam.TextPosition.convert - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt histogram "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt histogram "hovertext" - HoverInfo |> DynObj.setValueOptBy histogram "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt histogram "hovertemplate" - XHoverFormat |> DynObj.setValueOpt histogram "xhoverformat" - YHoverFormat |> DynObj.setValueOpt histogram "yhoverformat" - Meta |> DynObj.setValueOpt histogram "meta" - CustomData |> DynObj.setValueOpt histogram "customdata" - XAxis |> DynObj.setValueOptBy histogram "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy histogram "yaxis" StyleParam.LinearAxisId.convert - Orientation |> DynObj.setValueOptBy histogram "orientation" StyleParam.Orientation.convert - HistFunc |> DynObj.setValueOptBy histogram "histfunc" StyleParam.HistFunc.convert - HistNorm |> DynObj.setValueOptBy histogram "histnorm" StyleParam.HistNorm.convert - AlignmentGroup |> DynObj.setValueOpt histogram "alignmentgroup" - OffsetGroup |> DynObj.setValueOpt histogram "offsetgroup" - NBinsX |> DynObj.setValueOpt histogram "nbinsx" - NBinsY |> DynObj.setValueOpt histogram "nbinsy" - AutoBinX |> DynObj.setValueOpt histogram "autobinx" - AutoBinY |> DynObj.setValueOpt histogram "autobiny" - BinGroup |> DynObj.setValueOpt histogram "bingroup" - XBins |> DynObj.setValueOpt histogram "xbins" - YBins |> DynObj.setValueOpt histogram "ybins" - Marker |> DynObj.setValueOpt histogram "marker" - TextAngle |> DynObj.setValueOpt histogram "textangle" - TextFont |> DynObj.setValueOpt histogram "textfont" - Line |> DynObj.setValueOpt histogram "line" - XError |> DynObj.setValueOpt histogram "error_x" - YError |> DynObj.setValueOpt histogram "error_y" - SelectedPoints |> DynObj.setValueOpt histogram "selectedpoints" - Selected |> DynObj.setValueOpt histogram "selected" - Unselected |> DynObj.setValueOpt histogram "unselected" - ClipOnAxis |> DynObj.setValueOpt histogram "cliponaxis" - Constraintext |> DynObj.setValueOptBy histogram "constraintext" StyleParam.ConstrainText.convert - Cumulative |> DynObj.setValueOpt histogram "cumulative" - HoverLabel |> DynObj.setValueOpt histogram "hoverlabel" - InsideTextAnchor |> DynObj.setValueOptBy histogram "insidetextanchor" StyleParam.InsideTextAnchor.convert - InsideTextFont |> DynObj.setValueOpt histogram "insidetextfont" - OutsideTextFont |> DynObj.setValueOpt histogram "outsidetextfont" - XCalendar |> DynObj.setValueOptBy histogram "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy histogram "ycalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt histogram "uirevision" + fun (histogram: ('T :> Trace)) -> + + histogram + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalPropertyBy "textposition" TextPosition StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalPropertyBy "histfunc" HistFunc StyleParam.HistFunc.convert + |> DynObj.withOptionalPropertyBy "histnorm" HistNorm StyleParam.HistNorm.convert + |> DynObj.withOptionalProperty "alignmentgroup" AlignmentGroup + |> DynObj.withOptionalProperty "offsetgroup" OffsetGroup + |> DynObj.withOptionalProperty "nbinsx" NBinsX + |> DynObj.withOptionalProperty "nbinsy" NBinsY + |> DynObj.withOptionalProperty "autobinx" AutoBinX + |> DynObj.withOptionalProperty "autobiny" AutoBinY + |> DynObj.withOptionalProperty "bingroup" BinGroup + |> DynObj.withOptionalProperty "xbins" XBins + |> DynObj.withOptionalProperty "ybins" YBins + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "textangle" TextAngle + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "error_x" XError + |> DynObj.withOptionalProperty "error_y" YError + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "cliponaxis" ClipOnAxis + |> DynObj.withOptionalPropertyBy "constraintext" Constraintext StyleParam.ConstrainText.convert + |> DynObj.withOptionalProperty "cumulative" Cumulative + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "insidetextanchor" InsideTextAnchor StyleParam.InsideTextAnchor.convert + |> DynObj.withOptionalProperty "insidetextfont" InsideTextFont + |> DynObj.withOptionalProperty "outsidetextfont" OutsideTextFont + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision - histogram) /// /// Create a function that applies the styles of a boxplot to a Trace object @@ -1228,77 +1206,75 @@ type Trace2DStyle() = [] ?YCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (boxPlot: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt boxPlot "name" - Visible |> DynObj.setValueOptBy boxPlot "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt boxPlot "showlegend" - Legend |> DynObj.setValueOptBy boxPlot "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt boxPlot "legendrank" - LegendGroup |> DynObj.setValueOpt boxPlot "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt boxPlot "legendgrouptitle" - LegendWidth |> DynObj.setValueOpt boxPlot "legendwidth" - Opacity |> DynObj.setValueOpt boxPlot "opacity" - Ids |> DynObj.setValueOpt boxPlot "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt boxPlot "x" - X0 |> DynObj.setValueOpt boxPlot "x0" - DX |> DynObj.setValueOpt boxPlot "dx" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt boxPlot "y" - Y0 |> DynObj.setValueOpt boxPlot "y0" - DY |> DynObj.setValueOpt boxPlot "dy" - Width |> DynObj.setValueOpt boxPlot "width" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt boxPlot "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt boxPlot "hovertext" - HoverInfo |> DynObj.setValueOptBy boxPlot "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt boxPlot "hovertemplate" - XHoverFormat |> DynObj.setValueOpt boxPlot "xhoverformat" - YHoverFormat |> DynObj.setValueOpt boxPlot "yhoverformat" - Meta |> DynObj.setValueOpt boxPlot "meta" - CustomData |> DynObj.setValueOpt boxPlot "customdata" - XAxis |> DynObj.setValueOptBy boxPlot "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy boxPlot "yaxis" StyleParam.LinearAxisId.convert - Orientation |> DynObj.setValueOptBy boxPlot "orientation" StyleParam.Orientation.convert - AlignmentGroup |> DynObj.setValueOpt boxPlot "alignmentgroup" - OffsetGroup |> DynObj.setValueOpt boxPlot "offsetgroup" - XPeriod |> DynObj.setValueOpt boxPlot "xperiod" - XPeriodAlignment |> DynObj.setValueOptBy boxPlot "xperiodalignment" StyleParam.PeriodAlignment.convert - XPeriod0 |> DynObj.setValueOpt boxPlot "xperiod0" - YPeriod |> DynObj.setValueOpt boxPlot "yperiod" - YPeriodAlignment |> DynObj.setValueOptBy boxPlot "yperiodalignment" StyleParam.PeriodAlignment.convert - YPeriod0 |> DynObj.setValueOpt boxPlot "yperiod0" - Marker |> DynObj.setValueOpt boxPlot "marker" - Line |> DynObj.setValueOpt boxPlot "line" - BoxMean |> DynObj.setValueOptBy boxPlot "boxmean" StyleParam.BoxMean.convert - BoxPoints |> DynObj.setValueOptBy boxPlot "boxpoints" StyleParam.BoxPoints.convert - Notched |> DynObj.setValueOpt boxPlot "notched" - NotchWidth |> DynObj.setValueOpt boxPlot "notchwidth" - WhiskerWidth |> DynObj.setValueOpt boxPlot "whiskerwidth" - ShowWhiskers |> DynObj.setValueOpt boxPlot "showwhiskers" - Q1 |> DynObj.setValueOpt boxPlot "q1" - Median |> DynObj.setValueOpt boxPlot "median" - Q3 |> DynObj.setValueOpt boxPlot "q3" - LowerFence |> DynObj.setValueOpt boxPlot "lowerfence" - UpperFence |> DynObj.setValueOpt boxPlot "upperfence" - NotchSpan |> DynObj.setValueOpt boxPlot "notchspan" - Mean |> DynObj.setValueOpt boxPlot "mean" - SD |> DynObj.setValueOpt boxPlot "sd" - SDMultiple |> DynObj.setValueOpt boxPlot "sdmultiple" - QuartileMethod |> DynObj.setValueOptBy boxPlot "quartilemethod" StyleParam.QuartileMethod.convert - SelectedPoints |> DynObj.setValueOpt boxPlot "selectedpoints" - Selected |> DynObj.setValueOpt boxPlot "selected" - Unselected |> DynObj.setValueOpt boxPlot "unselected" - FillColor |> DynObj.setValueOpt boxPlot "fillcolor" - HoverLabel |> DynObj.setValueOpt boxPlot "hoverlabel" - HoverOn |> DynObj.setValueOptBy boxPlot "hoveron" StyleParam.HoverOn.convert - PointPos |> DynObj.setValueOpt boxPlot "pointpos" - Jitter |> DynObj.setValueOpt boxPlot "jitter" - SizeMode |> DynObj.setValueOptBy boxPlot "sizemode" StyleParam.BoxSizeMode.convert - XCalendar |> DynObj.setValueOptBy boxPlot "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy boxPlot "ycalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt boxPlot "uirevision" - - // out -> - boxPlot) + fun (boxPlot: ('T :> Trace)) -> + + boxPlot + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "legendwidth" LegendWidth + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "dx" DX + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "dy" DY + |> DynObj.withOptionalProperty "width" Width + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "alignmentgroup" AlignmentGroup + |> DynObj.withOptionalProperty "offsetgroup" OffsetGroup + |> DynObj.withOptionalProperty "xperiod" XPeriod + |> DynObj.withOptionalPropertyBy "xperiodalignment" XPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "xperiod0" XPeriod0 + |> DynObj.withOptionalProperty "yperiod" YPeriod + |> DynObj.withOptionalPropertyBy "yperiodalignment" YPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "yperiod0" YPeriod0 + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalPropertyBy "boxmean" BoxMean StyleParam.BoxMean.convert + |> DynObj.withOptionalPropertyBy "boxpoints" BoxPoints StyleParam.BoxPoints.convert + |> DynObj.withOptionalProperty "notched" Notched + |> DynObj.withOptionalProperty "notchwidth" NotchWidth + |> DynObj.withOptionalProperty "whiskerwidth" WhiskerWidth + |> DynObj.withOptionalProperty "showwhiskers" ShowWhiskers + |> DynObj.withOptionalProperty "q1" Q1 + |> DynObj.withOptionalProperty "median" Median + |> DynObj.withOptionalProperty "q3" Q3 + |> DynObj.withOptionalProperty "lowerfence" LowerFence + |> DynObj.withOptionalProperty "upperfence" UpperFence + |> DynObj.withOptionalProperty "notchspan" NotchSpan + |> DynObj.withOptionalProperty "mean" Mean + |> DynObj.withOptionalProperty "sd" SD + |> DynObj.withOptionalProperty "sdmultiple" SDMultiple + |> DynObj.withOptionalPropertyBy "quartilemethod" QuartileMethod StyleParam.QuartileMethod.convert + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "hoveron" HoverOn StyleParam.HoverOn.convert + |> DynObj.withOptionalProperty "pointpos" PointPos + |> DynObj.withOptionalProperty "jitter" Jitter + |> DynObj.withOptionalPropertyBy "sizemode" SizeMode StyleParam.BoxSizeMode.convert + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// @@ -1415,59 +1391,58 @@ type Trace2DStyle() = [] ?SpanMode: StyleParam.SpanMode, [] ?UIRevision: string ) = - (fun (violin: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt violin "name" - Visible |> DynObj.setValueOptBy violin "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt violin "showlegend" - Legend |> DynObj.setValueOptBy violin "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt violin "legendrank" - LegendGroup |> DynObj.setValueOpt violin "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt violin "legendgrouptitle" - Opacity |> DynObj.setValueOpt violin "opacity" - Ids |> DynObj.setValueOpt violin "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt violin "x" - X0 |> DynObj.setValueOpt violin "x0" - DX |> DynObj.setValueOpt violin "dx" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt violin "y" - Y0 |> DynObj.setValueOpt violin "y0" - DY |> DynObj.setValueOpt violin "dy" - Width |> DynObj.setValueOpt violin "width" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt violin "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt violin "hovertext" - HoverInfo |> DynObj.setValueOptBy violin "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt violin "hovertemplate" - XHoverFormat |> DynObj.setValueOpt violin "xhoverformat" - YHoverFormat |> DynObj.setValueOpt violin "yhoverformat" - Meta |> DynObj.setValueOpt violin "meta" - CustomData |> DynObj.setValueOpt violin "customdata" - XAxis |> DynObj.setValueOptBy violin "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy violin "yaxis" StyleParam.LinearAxisId.convert - Orientation |> DynObj.setValueOptBy violin "orientation" StyleParam.Orientation.convert - AlignmentGroup |> DynObj.setValueOpt violin "alignmentgroup" - OffsetGroup |> DynObj.setValueOpt violin "offsetgroup" - Marker |> DynObj.setValueOpt violin "marker" - Line |> DynObj.setValueOpt violin "line" - Box |> DynObj.setValueOpt violin "box" - SelectedPoints |> DynObj.setValueOpt violin "selectedpoints" - Selected |> DynObj.setValueOpt violin "selected" - Unselected |> DynObj.setValueOpt violin "unselected" - BandWidth |> DynObj.setValueOpt violin "bandwidth" - FillColor |> DynObj.setValueOpt violin "fillcolor" - HoverLabel |> DynObj.setValueOpt violin "hoverlabel" - HoverOn |> DynObj.setValueOptBy violin "hoveron" StyleParam.HoverOn.convert - PointPos |> DynObj.setValueOpt violin "pointpos" - Jitter |> DynObj.setValueOpt violin "jitter" - MeanLine |> DynObj.setValueOpt violin "meanline" - Points |> DynObj.setValueOptBy violin "points" StyleParam.JitterPoints.convert - ScaleGroup |> DynObj.setValueOpt violin "scalegroup" - ScaleMode |> DynObj.setValueOptBy violin "scalemode" StyleParam.ScaleMode.convert - Side |> DynObj.setValueOptBy violin "side" StyleParam.ViolinSide.convert - Span |> DynObj.setValueOptBy violin "span" StyleParam.Range.convert - SpanMode |> DynObj.setValueOptBy violin "spanmode" StyleParam.SpanMode.convert - UIRevision |> DynObj.setValueOpt violin "uirevision" - - violin) + fun (violin: ('T :> Trace)) -> + + violin + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "dx" DX + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "dy" DY + |> DynObj.withOptionalProperty "width" Width + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "alignmentgroup" AlignmentGroup + |> DynObj.withOptionalProperty "offsetgroup" OffsetGroup + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "box" Box + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "bandwidth" BandWidth + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "hoveron" HoverOn StyleParam.HoverOn.convert + |> DynObj.withOptionalProperty "pointpos" PointPos + |> DynObj.withOptionalProperty "jitter" Jitter + |> DynObj.withOptionalProperty "meanline" MeanLine + |> DynObj.withOptionalPropertyBy "points" Points StyleParam.JitterPoints.convert + |> DynObj.withOptionalProperty "scalegroup" ScaleGroup + |> DynObj.withOptionalPropertyBy "scalemode" ScaleMode StyleParam.ScaleMode.convert + |> DynObj.withOptionalPropertyBy "side" Side StyleParam.ViolinSide.convert + |> DynObj.withOptionalPropertyBy "span" Span StyleParam.Range.convert + |> DynObj.withOptionalPropertyBy "spanmode" SpanMode StyleParam.SpanMode.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a 2d histogram plot to a Trace object @@ -1585,62 +1560,61 @@ type Trace2DStyle() = [] ?YCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (histogram2D: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt histogram2D "name" - Visible |> DynObj.setValueOptBy histogram2D "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt histogram2D "showlegend" - Legend |> DynObj.setValueOptBy histogram2D "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt histogram2D "legendrank" - LegendGroup |> DynObj.setValueOpt histogram2D "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt histogram2D "legendgrouptitle" - Opacity |> DynObj.setValueOpt histogram2D "opacity" - Ids |> DynObj.setValueOpt histogram2D "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt histogram2D "x" - XGap |> DynObj.setValueOpt histogram2D "xgap" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt histogram2D "y" - YGap |> DynObj.setValueOpt histogram2D "ygap" - Z |> DynObj.setValueOpt histogram2D "z" - TextTemplate |> DynObj.setValueOpt histogram2D "texttemplate" - HoverInfo |> DynObj.setValueOptBy histogram2D "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt histogram2D "hovertemplate" - XHoverFormat |> DynObj.setValueOpt histogram2D "xhoverformat" - YHoverFormat |> DynObj.setValueOpt histogram2D "yhoverformat" - Meta |> DynObj.setValueOpt histogram2D "meta" - CustomData |> DynObj.setValueOpt histogram2D "customdata" - XAxis |> DynObj.setValueOptBy histogram2D "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy histogram2D "yaxis" StyleParam.LinearAxisId.convert - ColorAxis |> DynObj.setValueOpt histogram2D "coloraxis" - HistFunc |> DynObj.setValueOptBy histogram2D "histfunc" StyleParam.HistFunc.convert - HistNorm |> DynObj.setValueOptBy histogram2D "histnorm" StyleParam.HistNorm.convert - NBinsX |> DynObj.setValueOpt histogram2D "nbinsx" - NBinsY |> DynObj.setValueOpt histogram2D "nbinsy" - AutoBinX |> DynObj.setValueOpt histogram2D "autobinx" - AutoBinY |> DynObj.setValueOpt histogram2D "autobiny" - BinGroup |> DynObj.setValueOpt histogram2D "bingroup" - XBinGroup |> DynObj.setValueOpt histogram2D "xbingroup" - XBins |> DynObj.setValueOpt histogram2D "xbins" - YBinGroup |> DynObj.setValueOpt histogram2D "ybingroup" - YBins |> DynObj.setValueOpt histogram2D "ybins" - Marker |> DynObj.setValueOpt histogram2D "marker" - TextFont |> DynObj.setValueOpt histogram2D "textfont" - ColorBar |> DynObj.setValueOpt histogram2D "colorbar" - AutoColorScale |> DynObj.setValueOpt histogram2D "autocolorscale" - ColorScale |> DynObj.setValueOptBy histogram2D "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt histogram2D "showscale" - ReverseScale |> DynObj.setValueOpt histogram2D "reversescale" - ZAuto |> DynObj.setValueOpt histogram2D "zauto" - ZHoverFormat |> DynObj.setValueOpt histogram2D "zhoverformat" - ZMin |> DynObj.setValueOpt histogram2D "zmin" - ZMid |> DynObj.setValueOpt histogram2D "zmid" - ZMax |> DynObj.setValueOpt histogram2D "zmax" - ZSmooth |> DynObj.setValueOptBy histogram2D "zsmooth" StyleParam.SmoothAlg.convert - HoverLabel |> DynObj.setValueOpt histogram2D "hoverlabel" - XCalendar |> DynObj.setValueOptBy histogram2D "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy histogram2D "ycalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt histogram2D "uirevision" - - histogram2D) + fun (histogram2D: ('T :> Trace)) -> + + histogram2D + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "xgap" XGap + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "ygap" YGap + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "texttemplate" TextTemplate + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "coloraxis" ColorAxis + |> DynObj.withOptionalPropertyBy "histfunc" HistFunc StyleParam.HistFunc.convert + |> DynObj.withOptionalPropertyBy "histnorm" HistNorm StyleParam.HistNorm.convert + |> DynObj.withOptionalProperty "nbinsx" NBinsX + |> DynObj.withOptionalProperty "nbinsy" NBinsY + |> DynObj.withOptionalProperty "autobinx" AutoBinX + |> DynObj.withOptionalProperty "autobiny" AutoBinY + |> DynObj.withOptionalProperty "bingroup" BinGroup + |> DynObj.withOptionalProperty "xbingroup" XBinGroup + |> DynObj.withOptionalProperty "xbins" XBins + |> DynObj.withOptionalProperty "ybingroup" YBinGroup + |> DynObj.withOptionalProperty "ybins" YBins + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "zauto" ZAuto + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "zmin" ZMin + |> DynObj.withOptionalProperty "zmid" ZMid + |> DynObj.withOptionalProperty "zmax" ZMax + |> DynObj.withOptionalPropertyBy "zsmooth" ZSmooth StyleParam.SmoothAlg.convert + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a 2d histogram contour plot to a Trace object @@ -1760,63 +1734,62 @@ type Trace2DStyle() = [] ?YCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (histogram2DContour: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt histogram2DContour "name" - Visible |> DynObj.setValueOptBy histogram2DContour "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt histogram2DContour "showlegend" - Legend |> DynObj.setValueOptBy histogram2DContour "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt histogram2DContour "legendrank" - LegendGroup |> DynObj.setValueOpt histogram2DContour "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt histogram2DContour "legendgrouptitle" - Opacity |> DynObj.setValueOpt histogram2DContour "opacity" - Ids |> DynObj.setValueOpt histogram2DContour "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt histogram2DContour "x" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt histogram2DContour "y" - Z |> DynObj.setValueOpt histogram2DContour "z" - TextTemplate |> DynObj.setValueOpt histogram2DContour "texttemplate" - HoverInfo |> DynObj.setValueOptBy histogram2DContour "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt histogram2DContour "hovertemplate" - XHoverFormat |> DynObj.setValueOpt histogram2DContour "xhoverformat" - YHoverFormat |> DynObj.setValueOpt histogram2DContour "yhoverformat" - Meta |> DynObj.setValueOpt histogram2DContour "meta" - CustomData |> DynObj.setValueOpt histogram2DContour "customdata" - XAxis |> DynObj.setValueOptBy histogram2DContour "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy histogram2DContour "yaxis" StyleParam.LinearAxisId.convert - ColorAxis |> DynObj.setValueOpt histogram2DContour "coloraxis" - HistFunc |> DynObj.setValueOptBy histogram2DContour "histfunc" StyleParam.HistFunc.convert - HistNorm |> DynObj.setValueOptBy histogram2DContour "histnorm" StyleParam.HistNorm.convert - NBinsX |> DynObj.setValueOpt histogram2DContour "nbinsx" - NBinsY |> DynObj.setValueOpt histogram2DContour "nbinsy" - AutoBinX |> DynObj.setValueOpt histogram2DContour "autobinx" - AutoBinY |> DynObj.setValueOpt histogram2DContour "autobiny" - BinGroup |> DynObj.setValueOpt histogram2DContour "bingroup" - XBinGroup |> DynObj.setValueOpt histogram2DContour "xbingroup" - XBins |> DynObj.setValueOpt histogram2DContour "xbins" - YBinGroup |> DynObj.setValueOpt histogram2DContour "ybingroup" - YBins |> DynObj.setValueOpt histogram2DContour "ybins" - Marker |> DynObj.setValueOpt histogram2DContour "marker" - Line |> DynObj.setValueOpt histogram2DContour "line" - TextFont |> DynObj.setValueOpt histogram2DContour "textfont" - ColorBar |> DynObj.setValueOpt histogram2DContour "colorbar" - AutoColorScale |> DynObj.setValueOpt histogram2DContour "autocolorscale" - ColorScale |> DynObj.setValueOptBy histogram2DContour "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt histogram2DContour "showscale" - ReverseScale |> DynObj.setValueOpt histogram2DContour "reversescale" - ZAuto |> DynObj.setValueOpt histogram2DContour "zauto" - ZHoverFormat |> DynObj.setValueOpt histogram2DContour "zhoverformat" - Zmin |> DynObj.setValueOpt histogram2DContour "zmin" - Zmid |> DynObj.setValueOpt histogram2DContour "zmid" - Zmax |> DynObj.setValueOpt histogram2DContour "zmax" - AutoContour |> DynObj.setValueOpt histogram2DContour "autocontour" - Contours |> DynObj.setValueOpt histogram2DContour "contours" - HoverLabel |> DynObj.setValueOpt histogram2DContour "hoverlabel" - NContours |> DynObj.setValueOpt histogram2DContour "ncontours" - XCalendar |> DynObj.setValueOptBy histogram2DContour "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy histogram2DContour "ycalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt histogram2DContour "uirevision" - - histogram2DContour) + fun (histogram2DContour: ('T :> Trace)) -> + + histogram2DContour + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "texttemplate" TextTemplate + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "coloraxis" ColorAxis + |> DynObj.withOptionalPropertyBy "histfunc" HistFunc StyleParam.HistFunc.convert + |> DynObj.withOptionalPropertyBy "histnorm" HistNorm StyleParam.HistNorm.convert + |> DynObj.withOptionalProperty "nbinsx" NBinsX + |> DynObj.withOptionalProperty "nbinsy" NBinsY + |> DynObj.withOptionalProperty "autobinx" AutoBinX + |> DynObj.withOptionalProperty "autobiny" AutoBinY + |> DynObj.withOptionalProperty "bingroup" BinGroup + |> DynObj.withOptionalProperty "xbingroup" XBinGroup + |> DynObj.withOptionalProperty "xbins" XBins + |> DynObj.withOptionalProperty "ybingroup" YBinGroup + |> DynObj.withOptionalProperty "ybins" YBins + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "zauto" ZAuto + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "zmin" Zmin + |> DynObj.withOptionalProperty "zmid" Zmid + |> DynObj.withOptionalProperty "zmax" Zmax + |> DynObj.withOptionalProperty "autocontour" AutoContour + |> DynObj.withOptionalProperty "contours" Contours + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "ncontours" NContours + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// @@ -1949,69 +1922,66 @@ type Trace2DStyle() = [] ?YCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (heatmap: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt heatmap "name" - Visible |> DynObj.setValueOptBy heatmap "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt heatmap "showlegend" - Legend |> DynObj.setValueOptBy heatmap "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt heatmap "legendrank" - LegendGroup |> DynObj.setValueOpt heatmap "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt heatmap "legendgrouptitle" - Opacity |> DynObj.setValueOpt heatmap "opacity" - Ids |> DynObj.setValueOpt heatmap "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt heatmap "x" - X0 |> DynObj.setValueOpt heatmap "x0" - DX |> DynObj.setValueOpt heatmap "dx" - XType |> DynObj.setValueOptBy heatmap "xtype" StyleParam.CoordinateType.convert - XGap |> DynObj.setValueOpt heatmap "xgap" - (Y, MultiY) |> DynObj.setSingleOrMultiOpt heatmap "y" - Y0 |> DynObj.setValueOpt heatmap "y0" - DY |> DynObj.setValueOpt heatmap "dy" - YType |> DynObj.setValueOptBy heatmap "ytype" StyleParam.CoordinateType.convert - YGap |> DynObj.setValueOpt heatmap "ygap" - Z |> DynObj.setValueOpt heatmap "z" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt heatmap "text" - TextTemplate |> DynObj.setValueOpt heatmap "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt heatmap "hovertext" - HoverInfo |> DynObj.setValueOptBy heatmap "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt heatmap "hovertemplate" - XHoverFormat |> DynObj.setValueOpt heatmap "xhoverformat" - YHoverFormat |> DynObj.setValueOpt heatmap "yhoverformat" - Meta |> DynObj.setValueOpt heatmap "meta" - CustomData |> DynObj.setValueOpt heatmap "customdata" - XAxis |> DynObj.setValueOptBy heatmap "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy heatmap "yaxis" StyleParam.LinearAxisId.convert - ColorAxis |> DynObj.setValueOptBy heatmap "coloraxis" StyleParam.SubPlotId.convert - XPeriod |> DynObj.setValueOpt heatmap "xperiod" - XPeriodAlignment |> DynObj.setValueOptBy heatmap "xperiodalignment" StyleParam.PeriodAlignment.convert - XPeriod0 |> DynObj.setValueOpt heatmap "xperiod0" - YPeriod |> DynObj.setValueOpt heatmap "yperiod" - YPeriodAlignment |> DynObj.setValueOptBy heatmap "yperiodalignment" StyleParam.PeriodAlignment.convert - YPeriod0 |> DynObj.setValueOpt heatmap "yperiod0" - TextFont |> DynObj.setValueOpt heatmap "textfont" - ColorBar |> DynObj.setValueOpt heatmap "colorbar" - AutoColorScale |> DynObj.setValueOpt heatmap "autocolorscale" - ColorScale |> DynObj.setValueOptBy heatmap "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt heatmap "showscale" - ReverseScale |> DynObj.setValueOpt heatmap "reversescale" - ZAuto |> DynObj.setValueOpt heatmap "zauto" - ZHoverFormat |> DynObj.setValueOpt heatmap "zhoverformat" - ZMax |> DynObj.setValueOpt heatmap "zmax" - ZMid |> DynObj.setValueOpt heatmap "zmid" - ZMin |> DynObj.setValueOpt heatmap "zmin" - ZSmooth |> DynObj.setValueOptBy heatmap "zsmooth" StyleParam.SmoothAlg.convert - ConnectGaps |> DynObj.setValueOpt heatmap "connectgaps" - HoverLabel |> DynObj.setValueOpt heatmap "hoverlabel" - HoverOnGaps |> DynObj.setValueOpt heatmap "hoverongaps" - Transpose |> DynObj.setValueOpt heatmap "transpose" - XCalendar |> DynObj.setValueOptBy heatmap "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy heatmap "ycalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt heatmap "uirevision" - - - // out -> - heatmap) + fun (heatmap: ('T :> Trace)) -> + + heatmap + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "dx" DX + |> DynObj.withOptionalPropertyBy "xtype" XType StyleParam.CoordinateType.convert + |> DynObj.withOptionalProperty "xgap" XGap + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "dy" DY + |> DynObj.withOptionalPropertyBy "ytype" YType StyleParam.CoordinateType.convert + |> DynObj.withOptionalProperty "ygap" YGap + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalProperty "texttemplate" TextTemplate + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "xperiod" XPeriod + |> DynObj.withOptionalPropertyBy "xperiodalignment" XPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "xperiod0" XPeriod0 + |> DynObj.withOptionalProperty "yperiod" YPeriod + |> DynObj.withOptionalPropertyBy "yperiodalignment" YPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "yperiod0" YPeriod0 + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "zauto" ZAuto + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "zmax" ZMax + |> DynObj.withOptionalProperty "zmid" ZMid + |> DynObj.withOptionalProperty "zmin" ZMin + |> DynObj.withOptionalPropertyBy "zsmooth" ZSmooth StyleParam.SmoothAlg.convert + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "hoverongaps" HoverOnGaps + |> DynObj.withOptionalProperty "transpose" Transpose + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a Image plot to a Trace object @@ -2083,40 +2053,38 @@ type Trace2DStyle() = [] ?HoverLabel: Hoverlabel, [] ?UIRevision: string ) = - (fun (image: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt image "name" - Visible |> DynObj.setValueOptBy image "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt image "showlegend" - Legend |> DynObj.setValueOptBy image "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt image "legendrank" - LegendGroup |> DynObj.setValueOpt image "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt image "legendgrouptitle" - Opacity |> DynObj.setValueOpt image "opacity" - Ids |> DynObj.setValueOpt image "ids" - X0 |> DynObj.setValueOpt image "x0" - DX |> DynObj.setValueOpt image "dx" - Y0 |> DynObj.setValueOpt image "y0" - DY |> DynObj.setValueOpt image "dy" - Z |> DynObj.setValueOpt image "z" - Source |> DynObj.setValueOpt image "source" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt image "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt image "hovertext" - HoverInfo |> DynObj.setValueOptBy image "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt image "hovertemplate" - Meta |> DynObj.setValueOpt image "meta" - CustomData |> DynObj.setValueOpt image "customdata" - XAxis |> DynObj.setValueOptBy image "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy image "yaxis" StyleParam.LinearAxisId.convert - ColorModel |> DynObj.setValueOptBy image "colormodel" StyleParam.ColorModel.convert - ZMax |> DynObj.setValueOptBy image "zmax" StyleParam.ColorComponentBound.convert - ZMin |> DynObj.setValueOptBy image "zmin" StyleParam.ColorComponentBound.convert - ZSmooth |> DynObj.setValueOptBy image "zsmooth" StyleParam.SmoothAlg.convert - HoverLabel |> DynObj.setValueOpt image "hoverlabel" - UIRevision |> DynObj.setValueOpt image "uirevision" - - // out -> - image) + fun (image: ('T :> Trace)) -> + + image + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "dx" DX + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "dy" DY + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "source" Source + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "colormodel" ColorModel StyleParam.ColorModel.convert + |> DynObj.withOptionalPropertyBy "zmax" ZMax StyleParam.ColorComponentBound.convert + |> DynObj.withOptionalPropertyBy "zmin" ZMin StyleParam.ColorComponentBound.convert + |> DynObj.withOptionalPropertyBy "zsmooth" ZSmooth StyleParam.SmoothAlg.convert + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a contour plot to a Trace object @@ -2252,71 +2220,68 @@ type Trace2DStyle() = [] ?YCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (contour: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt contour "name" - Visible |> DynObj.setValueOptBy contour "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt contour "showlegend" - Legend |> DynObj.setValueOptBy contour "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt contour "legendrank" - LegendGroup |> DynObj.setValueOpt contour "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt contour "legendgrouptitle" - Opacity |> DynObj.setValueOpt contour "opacity" - Ids |> DynObj.setValueOpt contour "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt contour "x" - X0 |> DynObj.setValueOpt contour "x0" - DX |> DynObj.setValueOpt contour "dx" - XType |> DynObj.setValueOptBy contour "xtype" StyleParam.CoordinateType.convert - (Y, MultiY) |> DynObj.setSingleOrMultiOpt contour "y" - Y0 |> DynObj.setValueOpt contour "y0" - DY |> DynObj.setValueOpt contour "dy" - YType |> DynObj.setValueOptBy contour "ytype" StyleParam.CoordinateType.convert - Z |> DynObj.setValueOpt contour "z" - TextTemplate |> DynObj.setValueOpt contour "texttemplate" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt contour "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt contour "hovertext" - HoverInfo |> DynObj.setValueOptBy contour "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt contour "hovertemplate" - XHoverFormat |> DynObj.setValueOpt contour "xhoverformat" - YHoverFormat |> DynObj.setValueOpt contour "yhoverformat" - Meta |> DynObj.setValueOpt contour "meta" - CustomData |> DynObj.setValueOpt contour "customdata" - XAxis |> DynObj.setValueOptBy contour "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy contour "yaxis" StyleParam.LinearAxisId.convert - ColorAxis |> DynObj.setValueOptBy contour "coloraxis" StyleParam.SubPlotId.convert - XPeriod |> DynObj.setValueOpt contour "xperiod" - XPeriodAlignment |> DynObj.setValueOptBy contour "xperiodalignment" StyleParam.PeriodAlignment.convert - XPeriod0 |> DynObj.setValueOpt contour "xperiod0" - YPeriod |> DynObj.setValueOpt contour "yperiod" - YPeriodAlignment |> DynObj.setValueOptBy contour "yperiodalignment" StyleParam.PeriodAlignment.convert - YPeriod0 |> DynObj.setValueOpt contour "yperiod0" - Line |> DynObj.setValueOpt contour "line" - TextFont |> DynObj.setValueOpt contour "textfont" - ColorBar |> DynObj.setValueOpt contour "colorbar" - AutoColorScale |> DynObj.setValueOpt contour "autocolorscale" - ColorScale |> DynObj.setValueOptBy contour "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt contour "showscale" - ReverseScale |> DynObj.setValueOpt contour "reversescale" - ZAuto |> DynObj.setValueOpt contour "zauto" - ZHoverFormat |> DynObj.setValueOpt contour "zhoverformat" - ZMax |> DynObj.setValueOpt contour "zmax" - ZMid |> DynObj.setValueOpt contour "zmid" - ZMin |> DynObj.setValueOpt contour "zmin" - AutoContour |> DynObj.setValueOpt contour "autocontour" - ConnectGaps |> DynObj.setValueOpt contour "connectgaps" - Contours |> DynObj.setValueOpt contour "contours" - FillColor |> DynObj.setValueOpt contour "fillcolor" - HoverLabel |> DynObj.setValueOpt contour "hoverlabel" - HoverOnGaps |> DynObj.setValueOpt contour "hoverongaps" - NContours |> DynObj.setValueOpt contour "ncontours" - Transpose |> DynObj.setValueOpt contour "transpose" - XCalendar |> DynObj.setValueOptBy contour "xcalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt contour "uirevision" - - - // out -> - contour) - + fun (contour: ('T :> Trace)) -> + + contour + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "x0" X0 + |> DynObj.withOptionalProperty "dx" DX + |> DynObj.withOptionalPropertyBy "xtype" XType StyleParam.CoordinateType.convert + |> DynObj.withOptionalSingleOrMultiProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "y0" Y0 + |> DynObj.withOptionalProperty "dy" DY + |> DynObj.withOptionalPropertyBy "ytype" YType StyleParam.CoordinateType.convert + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "texttemplate" TextTemplate + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "xperiod" XPeriod + |> DynObj.withOptionalPropertyBy "xperiodalignment" XPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "xperiod0" XPeriod0 + |> DynObj.withOptionalProperty "yperiod" YPeriod + |> DynObj.withOptionalPropertyBy "yperiodalignment" YPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "yperiod0" YPeriod0 + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "zauto" ZAuto + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "zmax" ZMax + |> DynObj.withOptionalProperty "zmid" ZMid + |> DynObj.withOptionalProperty "zmin" ZMin + |> DynObj.withOptionalProperty "autocontour" AutoContour + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalProperty "contours" Contours + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "hoverongaps" HoverOnGaps + |> DynObj.withOptionalProperty "ncontours" NContours + |> DynObj.withOptionalProperty "transpose" Transpose + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a OHLC plot to a Trace object @@ -2404,47 +2369,46 @@ type Trace2DStyle() = [] ?XCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (ohlc: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt ohlc "name" - Visible |> DynObj.setValueOptBy ohlc "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt ohlc "showlegend" - Legend |> DynObj.setValueOptBy ohlc "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt ohlc "legendrank" - LegendGroup |> DynObj.setValueOpt ohlc "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt ohlc "legendgrouptitle" - Opacity |> DynObj.setValueOpt ohlc "opacity" - Ids |> DynObj.setValueOpt ohlc "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt ohlc "x" - Close |> DynObj.setValueOpt ohlc "close" - Open |> DynObj.setValueOpt ohlc "open" - High |> DynObj.setValueOpt ohlc "high" - Low |> DynObj.setValueOpt ohlc "low" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt ohlc "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt ohlc "hovertext" - HoverInfo |> DynObj.setValueOptBy ohlc "hoverinfo" StyleParam.HoverInfo.convert - XHoverFormat |> DynObj.setValueOpt ohlc "xhoverformat" - YHoverFormat |> DynObj.setValueOpt ohlc "yhoverformat" - Meta |> DynObj.setValueOpt ohlc "meta" - CustomData |> DynObj.setValueOpt ohlc "customdata" - XAxis |> DynObj.setValueOptBy ohlc "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy ohlc "yaxis" StyleParam.LinearAxisId.convert - XPeriod |> DynObj.setValueOpt ohlc "xperiod" - XPeriodAlignment |> DynObj.setValueOptBy ohlc "xperiodalignment" StyleParam.PeriodAlignment.convert - XPeriod0 |> DynObj.setValueOpt ohlc "xperiod0" - YPeriod |> DynObj.setValueOpt ohlc "yperiod" - YPeriodAlignment |> DynObj.setValueOptBy ohlc "yperiodalignment" StyleParam.PeriodAlignment.convert - YPeriod0 |> DynObj.setValueOpt ohlc "yperiod0" - Line |> DynObj.setValueOpt ohlc "line" - Increasing |> DynObj.setValueOpt ohlc "increasing" - Decreasing |> DynObj.setValueOpt ohlc "decreasing" - HoverLabel |> DynObj.setValueOpt ohlc "hoverlabel" - TickWidth |> DynObj.setValueOpt ohlc "tickwidth" - XCalendar |> DynObj.setValueOptBy ohlc "xcalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt ohlc "uirevision" - - ohlc) - + fun (ohlc: ('T :> Trace)) -> + + ohlc + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "close" Close + |> DynObj.withOptionalProperty "open" Open + |> DynObj.withOptionalProperty "high" High + |> DynObj.withOptionalProperty "low" Low + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "xperiod" XPeriod + |> DynObj.withOptionalPropertyBy "xperiodalignment" XPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "xperiod0" XPeriod0 + |> DynObj.withOptionalProperty "yperiod" YPeriod + |> DynObj.withOptionalPropertyBy "yperiodalignment" YPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "yperiod0" YPeriod0 + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "increasing" Increasing + |> DynObj.withOptionalProperty "decreasing" Decreasing + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "tickwidth" TickWidth + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a candlestick plot to a Trace object @@ -2532,46 +2496,46 @@ type Trace2DStyle() = [] ?XCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - (X, MultiX) |> DynObj.setSingleOrMultiOpt trace "x" - Close |> DynObj.setValueOpt trace "close" - Open |> DynObj.setValueOpt trace "open" - High |> DynObj.setValueOpt trace "high" - Low |> DynObj.setValueOpt trace "low" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - XHoverFormat |> DynObj.setValueOpt trace "xhoverformat" - YHoverFormat |> DynObj.setValueOpt trace "yhoverformat" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - XAxis |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.convert - XPeriod |> DynObj.setValueOpt trace "xperiod" - XPeriodAlignment |> DynObj.setValueOptBy trace "xperiodalignment" StyleParam.PeriodAlignment.convert - XPeriod0 |> DynObj.setValueOpt trace "xperiod0" - YPeriod |> DynObj.setValueOpt trace "yperiod" - YPeriodAlignment |> DynObj.setValueOptBy trace "yperiodalignment" StyleParam.PeriodAlignment.convert - YPeriod0 |> DynObj.setValueOpt trace "yperiod0" - Line |> DynObj.setValueOpt trace "line" - WhiskerWidth |> DynObj.setValueOpt trace "whiskerwidth" - Increasing |> DynObj.setValueOpt trace "increasing" - Decreasing |> DynObj.setValueOpt trace "decreasing" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - XCalendar |> DynObj.setValueOptBy trace "xcalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + fun (trace: ('T :> Trace)) -> + + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "x" (X, MultiX) + |> DynObj.withOptionalProperty "close" Close + |> DynObj.withOptionalProperty "open" Open + |> DynObj.withOptionalProperty "high" High + |> DynObj.withOptionalProperty "low" Low + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "xperiod" XPeriod + |> DynObj.withOptionalPropertyBy "xperiodalignment" XPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "xperiod0" XPeriod0 + |> DynObj.withOptionalProperty "yperiod" YPeriod + |> DynObj.withOptionalPropertyBy "yperiodalignment" YPeriodAlignment StyleParam.PeriodAlignment.convert + |> DynObj.withOptionalProperty "yperiod0" YPeriod0 + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "whiskerwidth" WhiskerWidth + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "increasing" Increasing + |> DynObj.withOptionalProperty "decreasing" Decreasing + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a scatter plot matrix (SPLOM) to a Trace object @@ -2643,36 +2607,35 @@ type Trace2DStyle() = [] ?HoverLabel: Hoverlabel, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - Dimensions |> DynObj.setValueOpt trace "dimensions" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - XHoverFormat |> DynObj.setValueOpt trace "xhoverformat" - YHoverFormat |> DynObj.setValueOpt trace "yhoverformat" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Marker |> DynObj.setValueOpt trace "marker" - Diagonal |> DynObj.setValueOpt trace "diagonal" - XAxes |> DynObj.setValueOptBy trace "xaxis" (Seq.map StyleParam.LinearAxisId.convert) - YAxes |> DynObj.setValueOptBy trace "yaxis" (Seq.map StyleParam.LinearAxisId.convert) - ShowLowerHalf |> DynObj.setValueOpt trace "showlowerhalf" - ShowUpperHalf |> DynObj.setValueOpt trace "showupperhalf" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + fun (trace: ('T :> Trace)) -> + + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalProperty "dimensions" Dimensions + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "diagonal" Diagonal + |> DynObj.withOptionalPropertyBy "xaxis" XAxes (Seq.map StyleParam.LinearAxisId.convert) + |> DynObj.withOptionalPropertyBy "yaxis" YAxes (Seq.map StyleParam.LinearAxisId.convert) + |> DynObj.withOptionalProperty "showlowerhalf" ShowLowerHalf + |> DynObj.withOptionalProperty "showupperhalf" ShowUpperHalf + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "uirevision" UIRevision diff --git a/src/Plotly.NET/Traces/Trace3D.fs b/src/Plotly.NET/Traces/Trace3D.fs index 9baa6ae52..e87b07811 100644 --- a/src/Plotly.NET/Traces/Trace3D.fs +++ b/src/Plotly.NET/Traces/Trace3D.fs @@ -49,11 +49,9 @@ type Trace3DStyle() = // ######################## 3d-Charts static member SetScene([] ?SceneId: StyleParam.SubPlotId) = - (fun (trace: Trace3D) -> - - SceneId |> DynObj.setValueOptBy trace "scene" StyleParam.SubPlotId.toString - - trace) + fun (trace: Trace3D) -> + trace + |> DynObj.withOptionalPropertyBy "scene" SceneId StyleParam.SubPlotId.toString /// /// Create a function that applies the styles of a 3D scatter plot to a Trace object @@ -152,55 +150,49 @@ type Trace3DStyle() = [] ?UIRevision: string ) = - (fun (scatter: #Trace) -> - - Name |> DynObj.setValueOpt scatter "name" - Visible |> DynObj.setValueOptBy scatter "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt scatter "showlegend" - Legend |> DynObj.setValueOptBy scatter "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt scatter "legendrank" - LegendGroup |> DynObj.setValueOpt scatter "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt scatter "legendgrouptitle" - Mode |> DynObj.setValueOptBy scatter "mode" StyleParam.Mode.convert - Opacity |> DynObj.setValueOpt scatter "opacity" - Ids |> DynObj.setValueOpt scatter "ids" - X |> DynObj.setValueOpt scatter "x" - Y |> DynObj.setValueOpt scatter "y" - Z |> DynObj.setValueOpt scatter "z" - SurfaceColor |> DynObj.setValueOpt scatter "surfacecolor" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt scatter "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy scatter "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt scatter "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt scatter "hovertext" - HoverInfo |> DynObj.setValueOptBy scatter "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt scatter "hovertemplate" - XHoverFormat |> DynObj.setValueOpt scatter "xhoverformat" - YHoverFormat |> DynObj.setValueOpt scatter "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt scatter "zhoverformat" - Meta |> DynObj.setValueOpt scatter "meta" - CustomData |> DynObj.setValueOpt scatter "customdata" - Scene |> DynObj.setValueOptBy scatter "scene" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt scatter "marker" - Line |> DynObj.setValueOpt scatter "line" - TextFont |> DynObj.setValueOpt scatter "textfont" - XError |> DynObj.setValueOpt scatter "error_x" - YError |> DynObj.setValueOpt scatter "error_y" - ZError |> DynObj.setValueOpt scatter "error_z" - ConnectGaps |> DynObj.setValueOpt scatter "connectgaps" - Hoverlabel |> DynObj.setValueOpt scatter "hoverlabel" - Projection |> DynObj.setValueOpt scatter "projection" - Surfaceaxis |> DynObj.setValueOptBy scatter "surfaceaxis" StyleParam.SurfaceAxis.convert - XCalendar |> DynObj.setValueOptBy scatter "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy scatter "ycalendar" StyleParam.Calendar.convert - ZCalendar |> DynObj.setValueOptBy scatter "zcalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt scatter "uirevision" - - scatter) - + fun (scatter: #Trace) -> + scatter + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.Mode.convert + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "surfacecolor" SurfaceColor + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "scene" Scene StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "error_x" XError + |> DynObj.withOptionalProperty "error_y" YError + |> DynObj.withOptionalProperty "error_z" ZError + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalProperty "hoverlabel" Hoverlabel + |> DynObj.withOptionalProperty "projection" Projection + |> DynObj.withOptionalPropertyBy "surfaceaxis" Surfaceaxis StyleParam.SurfaceAxis.convert + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "zcalendar" ZCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a surface chart to the given trace @@ -302,55 +294,53 @@ type Trace3DStyle() = [] ?ZCalendar: StyleParam.Calendar, [] ?UIRevision: string ) = - (fun (surface: #Trace) -> - - Name |> DynObj.setValueOpt surface "name" - Visible |> DynObj.setValueOptBy surface "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt surface "showlegend" - Legend |> DynObj.setValueOptBy surface "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt surface "legendrank" - LegendGroup |> DynObj.setValueOpt surface "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt surface "legendgrouptitle" - Opacity |> DynObj.setValueOpt surface "opacity" - Ids |> DynObj.setValueOpt surface "ids" - X |> DynObj.setValueOpt surface "x" - Y |> DynObj.setValueOpt surface "y" - Z |> DynObj.setValueOpt surface "z" - SurfaceColor |> DynObj.setValueOpt surface "surfacecolor" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt surface "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt surface "hovertext" - HoverInfo |> DynObj.setValueOptBy surface "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt surface "hovertemplate" - XHoverFormat |> DynObj.setValueOpt surface "xhoverformat" - YHoverFormat |> DynObj.setValueOpt surface "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt surface "zhoverformat" - Meta |> DynObj.setValueOpt surface "meta" - CustomData |> DynObj.setValueOpt surface "customdata" - Scene |> DynObj.setValueOptBy surface "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy surface "coloraxis" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt surface "colorbar" - AutoColorScale |> DynObj.setValueOpt surface "autocolorscale" - ColorScale |> DynObj.setValueOptBy surface "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt surface "showscale" - ReverseScale |> DynObj.setValueOpt surface "reversescale" - CAuto |> DynObj.setValueOpt surface "cauto" - CMin |> DynObj.setValueOpt surface "cmin" - CMid |> DynObj.setValueOpt surface "cmid" - CMax |> DynObj.setValueOpt surface "cmax" - ConnectGaps |> DynObj.setValueOpt surface "connectgaps" - Contours |> DynObj.setValueOpt surface "contours" - HideSurface |> DynObj.setValueOpt surface "hidesurface" - Hoverlabel |> DynObj.setValueOpt surface "hoverlabel" - Lighting |> DynObj.setValueOpt surface "lighting" - LightPosition |> DynObj.setValueOpt surface "lightposition" - OpacityScale |> DynObj.setValueOpt surface "opacityscale" - XCalendar |> DynObj.setValueOptBy surface "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy surface "ycalendar" StyleParam.Calendar.convert - ZCalendar |> DynObj.setValueOptBy surface "zcalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt surface "uirevision" - - surface) + fun (surface: #Trace) -> + surface + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "surfacecolor" SurfaceColor + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "scene" Scene StyleParam.SubPlotId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "cauto" CAuto + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalProperty "cmid" CMid + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalProperty "contours" Contours + |> DynObj.withOptionalProperty "hidesurface" HideSurface + |> DynObj.withOptionalProperty "hoverlabel" Hoverlabel + |> DynObj.withOptionalProperty "lighting" Lighting + |> DynObj.withOptionalProperty "lightposition" LightPosition + |> DynObj.withOptionalProperty "opacityscale" OpacityScale + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "zcalendar" ZCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a mesh3d chart to the given trace @@ -469,59 +459,58 @@ type Trace3DStyle() = fun (mesh3d: #Trace) -> - Name |> DynObj.setValueOpt mesh3d "name" - Visible |> DynObj.setValueOptBy mesh3d "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt mesh3d "showlegend" - Legend |> DynObj.setValueOptBy mesh3d "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt mesh3d "legendrank" - LegendGroup |> DynObj.setValueOpt mesh3d "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt mesh3d "legendgrouptitle" - Opacity |> DynObj.setValueOpt mesh3d "opacity" - Ids |> DynObj.setValueOpt mesh3d "ids" - X |> DynObj.setValueOpt mesh3d "x" - Y |> DynObj.setValueOpt mesh3d "y" - Z |> DynObj.setValueOpt mesh3d "z" - I |> DynObj.setValueOpt mesh3d "i" - J |> DynObj.setValueOpt mesh3d "j" - K |> DynObj.setValueOpt mesh3d "k" - FaceColor |> DynObj.setValueOpt mesh3d "facecolor" - Intensity |> DynObj.setValueOpt mesh3d "intensity" - IntensityMode |> DynObj.setValueOptBy mesh3d "intensitymode" StyleParam.IntensityMode.convert - VertexColor |> DynObj.setValueOpt mesh3d "vertexcolor" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt mesh3d "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt mesh3d "hovertext" - HoverInfo |> DynObj.setValueOptBy mesh3d "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt mesh3d "hovertemplate" - XHoverFormat |> DynObj.setValueOpt mesh3d "xhoverformat" - YHoverFormat |> DynObj.setValueOpt mesh3d "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt mesh3d "zhoverformat" - Meta |> DynObj.setValueOpt mesh3d "meta" - CustomData |> DynObj.setValueOpt mesh3d "customdata" - Scene |> DynObj.setValueOptBy mesh3d "scene" StyleParam.SubPlotId.convert - Color |> DynObj.setValueOpt mesh3d "color" - ColorAxis |> DynObj.setValueOptBy mesh3d "coloraxis" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt mesh3d "colorbar" - AutoColorScale |> DynObj.setValueOpt mesh3d "autocolorscale" - ColorScale |> DynObj.setValueOptBy mesh3d "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt mesh3d "showscale" - ReverseScale |> DynObj.setValueOpt mesh3d "reversescale" - CAuto |> DynObj.setValueOpt mesh3d "cauto" - CMin |> DynObj.setValueOpt mesh3d "cmin" - CMid |> DynObj.setValueOpt mesh3d "cmid" - CMax |> DynObj.setValueOpt mesh3d "cmax" - AlphaHull |> DynObj.setValueOptBy mesh3d "alphahull" StyleParam.TriangulationAlgorithm.convert - Delaunayaxis |> DynObj.setValueOptBy mesh3d "delaunayaxis" StyleParam.Delaunayaxis.convert - Contour |> DynObj.setValueOpt mesh3d "contour" - FlatShading |> DynObj.setValueOpt mesh3d "flatshading" - Hoverlabel |> DynObj.setValueOpt mesh3d "hoverlabel" - Lighting |> DynObj.setValueOpt mesh3d "lighting" - LightPosition |> DynObj.setValueOpt mesh3d "lightposition" - XCalendar |> DynObj.setValueOptBy mesh3d "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy mesh3d "ycalendar" StyleParam.Calendar.convert - ZCalendar |> DynObj.setValueOptBy mesh3d "zcalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt mesh3d "uirevision" - mesh3d + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "i" I + |> DynObj.withOptionalProperty "j" J + |> DynObj.withOptionalProperty "k" K + |> DynObj.withOptionalProperty "facecolor" FaceColor + |> DynObj.withOptionalProperty "intensity" Intensity + |> DynObj.withOptionalPropertyBy "intensitymode" IntensityMode StyleParam.IntensityMode.convert + |> DynObj.withOptionalProperty "vertexcolor" VertexColor + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "scene" Scene StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "cauto" CAuto + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalProperty "cmid" CMid + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalPropertyBy "alphahull" AlphaHull StyleParam.TriangulationAlgorithm.convert + |> DynObj.withOptionalPropertyBy "delaunayaxis" Delaunayaxis StyleParam.Delaunayaxis.convert + |> DynObj.withOptionalProperty "contour" Contour + |> DynObj.withOptionalProperty "flatshading" FlatShading + |> DynObj.withOptionalProperty "hoverlabel" Hoverlabel + |> DynObj.withOptionalProperty "lighting" Lighting + |> DynObj.withOptionalProperty "lightposition" LightPosition + |> DynObj.withOptionalPropertyBy "xcalendar" XCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "ycalendar" YCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalPropertyBy "zcalendar" ZCalendar StyleParam.Calendar.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// @@ -626,54 +615,53 @@ type Trace3DStyle() = [] ?SizeRef: float, [] ?UIRevision: seq<#IConvertible> ) = - (fun (cone: #Trace) -> - Name |> DynObj.setValueOpt cone "name" - Visible |> DynObj.setValueOptBy cone "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt cone "showlegend" - Legend |> DynObj.setValueOptBy cone "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt cone "legendrank" - LegendGroup |> DynObj.setValueOpt cone "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt cone "legendgrouptitle" - Opacity |> DynObj.setValueOpt cone "opacity" - Ids |> DynObj.setValueOpt cone "ids" - X |> DynObj.setValueOpt cone "x" - Y |> DynObj.setValueOpt cone "y" - Z |> DynObj.setValueOpt cone "z" - U |> DynObj.setValueOpt cone "u" - V |> DynObj.setValueOpt cone "v" - W |> DynObj.setValueOpt cone "w" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt cone "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt cone "hovertext" - HoverInfo |> DynObj.setValueOptBy cone "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt cone "hovertemplate" - XHoverFormat |> DynObj.setValueOpt cone "xhoverformat" - YHoverFormat |> DynObj.setValueOpt cone "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt cone "zhoverformat" - UHoverFormat |> DynObj.setValueOpt cone "uhoverformat" - VHoverFormat |> DynObj.setValueOpt cone "vhoverformat" - WHoverFormat |> DynObj.setValueOpt cone "whoverformat" - Meta |> DynObj.setValueOpt cone "meta" - CustomData |> DynObj.setValueOpt cone "customdata" - Scene |> DynObj.setValueOptBy cone "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy cone "coloraxis" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt cone "colorbar" - AutoColorScale |> DynObj.setValueOpt cone "autocolorscale" - ColorScale |> DynObj.setValueOptBy cone "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt cone "showscale" - ReverseScale |> DynObj.setValueOpt cone "reversescale" - CAuto |> DynObj.setValueOpt cone "cauto" - CMin |> DynObj.setValueOpt cone "cmin" - CMid |> DynObj.setValueOpt cone "cmid" - CMax |> DynObj.setValueOpt cone "cmax" - Anchor |> DynObj.setValueOptBy cone "anchor" StyleParam.ConeAnchor.convert - HoverLabel |> DynObj.setValueOpt cone "hoverlabel" - Lighting |> DynObj.setValueOpt cone "lighting" - LightPosition |> DynObj.setValueOpt cone "lightposition" - SizeMode |> DynObj.setValueOptBy cone "sizemode" StyleParam.ConeSizeMode.convert - SizeRef |> DynObj.setValueOpt cone "sizeref" - UIRevision |> DynObj.setValueOpt cone "uirevision" - - cone) + fun (cone: #Trace) -> + cone + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "u" U + |> DynObj.withOptionalProperty "v" V + |> DynObj.withOptionalProperty "w" W + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "uhoverformat" UHoverFormat + |> DynObj.withOptionalProperty "vhoverformat" VHoverFormat + |> DynObj.withOptionalProperty "whoverformat" WHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "scene" Scene StyleParam.SubPlotId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "cauto" CAuto + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalProperty "cmid" CMid + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalPropertyBy "anchor" Anchor StyleParam.ConeAnchor.convert + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "lighting" Lighting + |> DynObj.withOptionalProperty "lightposition" LightPosition + |> DynObj.withOptionalPropertyBy "sizemode" SizeMode StyleParam.ConeSizeMode.convert + |> DynObj.withOptionalProperty "sizeref" SizeRef + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a streamtube chart to the given trace @@ -777,54 +765,53 @@ type Trace3DStyle() = [] ?Starts: StreamTubeStarts, [] ?UIRevision: seq<#IConvertible> ) = - (fun (streamTube: #Trace) -> - Name |> DynObj.setValueOpt streamTube "name" - Visible |> DynObj.setValueOptBy streamTube "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt streamTube "showlegend" - Legend |> DynObj.setValueOptBy streamTube "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt streamTube "legendrank" - LegendGroup |> DynObj.setValueOpt streamTube "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt streamTube "legendgrouptitle" - Opacity |> DynObj.setValueOpt streamTube "opacity" - Ids |> DynObj.setValueOpt streamTube "ids" - X |> DynObj.setValueOpt streamTube "x" - Y |> DynObj.setValueOpt streamTube "y" - Z |> DynObj.setValueOpt streamTube "z" - U |> DynObj.setValueOpt streamTube "u" - V |> DynObj.setValueOpt streamTube "v" - W |> DynObj.setValueOpt streamTube "w" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt streamTube "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt streamTube "hovertext" - HoverInfo |> DynObj.setValueOptBy streamTube "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt streamTube "hovertemplate" - XHoverFormat |> DynObj.setValueOpt streamTube "xhoverformat" - YHoverFormat |> DynObj.setValueOpt streamTube "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt streamTube "zhoverformat" - UHoverFormat |> DynObj.setValueOpt streamTube "uhoverformat" - VHoverFormat |> DynObj.setValueOpt streamTube "vhoverformat" - WHoverFormat |> DynObj.setValueOpt streamTube "whoverformat" - Meta |> DynObj.setValueOpt streamTube "meta" - CustomData |> DynObj.setValueOpt streamTube "customdata" - Scene |> DynObj.setValueOptBy streamTube "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy streamTube "coloraxis" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt streamTube "colorbar" - AutoColorScale |> DynObj.setValueOpt streamTube "autocolorscale" - ColorScale |> DynObj.setValueOptBy streamTube "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt streamTube "showscale" - ReverseScale |> DynObj.setValueOpt streamTube "reversescale" - CAuto |> DynObj.setValueOpt streamTube "cauto" - CMin |> DynObj.setValueOpt streamTube "cmin" - CMid |> DynObj.setValueOpt streamTube "cmid" - CMax |> DynObj.setValueOpt streamTube "cmax" - HoverLabel |> DynObj.setValueOpt streamTube "hoverlabel" - Lighting |> DynObj.setValueOpt streamTube "lighting" - LightPosition |> DynObj.setValueOpt streamTube "lightposition" - MaxDisplayed |> DynObj.setValueOpt streamTube "maxdisplayed" - SizeRef |> DynObj.setValueOpt streamTube "sizeref" - Starts |> DynObj.setValueOpt streamTube "starts" - UIRevision |> DynObj.setValueOpt streamTube "uirevision" - - streamTube) + fun (streamTube: #Trace) -> + streamTube + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "u" U + |> DynObj.withOptionalProperty "v" V + |> DynObj.withOptionalProperty "w" W + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "uhoverformat" UHoverFormat + |> DynObj.withOptionalProperty "vhoverformat" VHoverFormat + |> DynObj.withOptionalProperty "whoverformat" WHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "scene" Scene StyleParam.SubPlotId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "cauto" CAuto + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalProperty "cmid" CMid + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "lighting" Lighting + |> DynObj.withOptionalProperty "lightposition" LightPosition + |> DynObj.withOptionalProperty "maxdisplayed" MaxDisplayed + |> DynObj.withOptionalProperty "sizeref" SizeRef + |> DynObj.withOptionalProperty "starts" Starts + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a volume chart to the given trace @@ -934,55 +921,54 @@ type Trace3DStyle() = ) = fun (volume: #Trace) -> - Name |> DynObj.setValueOpt volume "name" - Visible |> DynObj.setValueOptBy volume "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt volume "showlegend" - Legend |> DynObj.setValueOptBy volume "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt volume "legendrank" - LegendGroup |> DynObj.setValueOpt volume "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt volume "legendgrouptitle" - Opacity |> DynObj.setValueOpt volume "opacity" - Ids |> DynObj.setValueOpt volume "ids" - X |> DynObj.setValueOpt volume "x" - Y |> DynObj.setValueOpt volume "y" - Z |> DynObj.setValueOpt volume "z" - Value |> DynObj.setValueOpt volume "value" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt volume "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt volume "hovertext" - HoverInfo |> DynObj.setValueOptBy volume "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt volume "hovertemplate" - XHoverFormat |> DynObj.setValueOpt volume "xhoverformat" - YHoverFormat |> DynObj.setValueOpt volume "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt volume "zhoverformat" - ValueHoverFormat |> DynObj.setValueOpt volume "valuehoverformat" - Meta |> DynObj.setValueOpt volume "meta" - CustomData |> DynObj.setValueOpt volume "customdata" - Scene |> DynObj.setValueOptBy volume "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy volume "coloraxis" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt volume "colorbar" - AutoColorScale |> DynObj.setValueOpt volume "autocolorscale" - ColorScale |> DynObj.setValueOptBy volume "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt volume "showscale" - ReverseScale |> DynObj.setValueOpt volume "reversescale" - CAuto |> DynObj.setValueOpt volume "cauto" - CMin |> DynObj.setValueOpt volume "cmin" - CMid |> DynObj.setValueOpt volume "cmid" - CMax |> DynObj.setValueOpt volume "cmax" - Caps |> DynObj.setValueOpt volume "caps" - Contour |> DynObj.setValueOpt volume "contour" - FlatShading |> DynObj.setValueOpt volume "flatshading" - HoverLabel |> DynObj.setValueOpt volume "hoverlabel" - IsoMax |> DynObj.setValueOpt volume "isomax" - IsoMin |> DynObj.setValueOpt volume "isomin" - Lighting |> DynObj.setValueOpt volume "lighting" - LightPosition |> DynObj.setValueOpt volume "lightposition" - OpacityScale |> DynObj.setValueOpt volume "opacityscale" - Slices |> DynObj.setValueOpt volume "slices" - SpaceFrame |> DynObj.setValueOpt volume "spaceframe" - Surface |> DynObj.setValueOpt volume "surface" - UIRevision |> DynObj.setValueOpt volume "uirevision" - volume + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "value" Value + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "valuehoverformat" ValueHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "scene" Scene StyleParam.SubPlotId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "cauto" CAuto + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalProperty "cmid" CMid + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalProperty "caps" Caps + |> DynObj.withOptionalProperty "contour" Contour + |> DynObj.withOptionalProperty "flatshading" FlatShading + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "isomax" IsoMax + |> DynObj.withOptionalProperty "isomin" IsoMin + |> DynObj.withOptionalProperty "lighting" Lighting + |> DynObj.withOptionalProperty "lightposition" LightPosition + |> DynObj.withOptionalProperty "opacityscale" OpacityScale + |> DynObj.withOptionalProperty "slices" Slices + |> DynObj.withOptionalProperty "spaceframe" SpaceFrame + |> DynObj.withOptionalProperty "surface" Surface + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a isosurface chart to the given trace @@ -1092,52 +1078,51 @@ type Trace3DStyle() = ) = fun (isoSurface: #Trace) -> - Name |> DynObj.setValueOpt isoSurface "name" - Visible |> DynObj.setValueOptBy isoSurface "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt isoSurface "showlegend" - Legend |> DynObj.setValueOptBy isoSurface "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt isoSurface "legendrank" - LegendGroup |> DynObj.setValueOpt isoSurface "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt isoSurface "legendgrouptitle" - Opacity |> DynObj.setValueOpt isoSurface "opacity" - Ids |> DynObj.setValueOpt isoSurface "ids" - X |> DynObj.setValueOpt isoSurface "x" - Y |> DynObj.setValueOpt isoSurface "y" - Z |> DynObj.setValueOpt isoSurface "z" - Value |> DynObj.setValueOpt isoSurface "value" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt isoSurface "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt isoSurface "hovertext" - HoverInfo |> DynObj.setValueOptBy isoSurface "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt isoSurface "hovertemplate" - XHoverFormat |> DynObj.setValueOpt isoSurface "xhoverformat" - YHoverFormat |> DynObj.setValueOpt isoSurface "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt isoSurface "zhoverformat" - ValueHoverFormat |> DynObj.setValueOpt isoSurface "valuehoverformat" - Meta |> DynObj.setValueOpt isoSurface "meta" - CustomData |> DynObj.setValueOpt isoSurface "customdata" - Scene |> DynObj.setValueOptBy isoSurface "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy isoSurface "coloraxis" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt isoSurface "colorbar" - AutoColorScale |> DynObj.setValueOpt isoSurface "autocolorscale" - ColorScale |> DynObj.setValueOptBy isoSurface "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt isoSurface "showscale" - ReverseScale |> DynObj.setValueOpt isoSurface "reversescale" - CAuto |> DynObj.setValueOpt isoSurface "cauto" - CMin |> DynObj.setValueOpt isoSurface "cmin" - CMid |> DynObj.setValueOpt isoSurface "cmid" - CMax |> DynObj.setValueOpt isoSurface "cmax" - Caps |> DynObj.setValueOpt isoSurface "caps" - Contour |> DynObj.setValueOpt isoSurface "contour" - FlatShading |> DynObj.setValueOpt isoSurface "flatshading" - HoverLabel |> DynObj.setValueOpt isoSurface "hoverlabel" - IsoMax |> DynObj.setValueOpt isoSurface "isomax" - IsoMin |> DynObj.setValueOpt isoSurface "isomin" - Lighting |> DynObj.setValueOpt isoSurface "lighting" - LightPosition |> DynObj.setValueOpt isoSurface "lightposition" - OpacityScale |> DynObj.setValueOpt isoSurface "opacityscale" - Slices |> DynObj.setValueOpt isoSurface "slices" - SpaceFrame |> DynObj.setValueOpt isoSurface "spaceframe" - Surface |> DynObj.setValueOpt isoSurface "surface" - UIRevision |> DynObj.setValueOpt isoSurface "uirevision" - isoSurface + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "x" X + |> DynObj.withOptionalProperty "y" Y + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "value" Value + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "xhoverformat" XHoverFormat + |> DynObj.withOptionalProperty "yhoverformat" YHoverFormat + |> DynObj.withOptionalProperty "zhoverformat" ZHoverFormat + |> DynObj.withOptionalProperty "valuehoverformat" ValueHoverFormat + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "scene" Scene StyleParam.SubPlotId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "cauto" CAuto + |> DynObj.withOptionalProperty "cmin" CMin + |> DynObj.withOptionalProperty "cmid" CMid + |> DynObj.withOptionalProperty "cmax" CMax + |> DynObj.withOptionalProperty "caps" Caps + |> DynObj.withOptionalProperty "contour" Contour + |> DynObj.withOptionalProperty "flatshading" FlatShading + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "isomax" IsoMax + |> DynObj.withOptionalProperty "isomin" IsoMin + |> DynObj.withOptionalProperty "lighting" Lighting + |> DynObj.withOptionalProperty "lightposition" LightPosition + |> DynObj.withOptionalProperty "opacityscale" OpacityScale + |> DynObj.withOptionalProperty "slices" Slices + |> DynObj.withOptionalProperty "spaceframe" SpaceFrame + |> DynObj.withOptionalProperty "surface" Surface + |> DynObj.withOptionalProperty "uirevision" UIRevision \ No newline at end of file diff --git a/src/Plotly.NET/Traces/TraceCarpet.fs b/src/Plotly.NET/Traces/TraceCarpet.fs index ff12dc962..f9b69cddf 100644 --- a/src/Plotly.NET/Traces/TraceCarpet.fs +++ b/src/Plotly.NET/Traces/TraceCarpet.fs @@ -29,20 +29,15 @@ type TraceCarpetStyle() = [] ?X: StyleParam.LinearAxisId, [] ?Y: StyleParam.LinearAxisId ) = - (fun (trace: TraceCarpet) -> + fun (trace: TraceCarpet) -> - X |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.toString - Y |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.toString - - trace) + trace + |> DynObj.withOptionalPropertyBy "xaxis" X StyleParam.LinearAxisId.toString + |> DynObj.withOptionalPropertyBy "yaxis" Y StyleParam.LinearAxisId.toString static member SetCarpet([] ?CarpetId: StyleParam.SubPlotId) = - (fun (trace: TraceCarpet) -> - - CarpetId |> DynObj.setValueOptBy trace "carpet" StyleParam.SubPlotId.toString - - trace) - + fun (trace: TraceCarpet) -> + trace |> DynObj.withOptionalPropertyBy "carpet" CarpetId StyleParam.SubPlotId.toString /// /// Create a function that applies the styles of a carpet to a Trace object @@ -112,36 +107,35 @@ type TraceCarpetStyle() = ) = fun (trace: #Trace) -> - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "opacity" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - (X, MultiX) |> DynObj.setSingleOrAnyOpt trace "x" - (Y, MultiY) |> DynObj.setSingleOrAnyOpt trace "y" - A |> DynObj.setValueOpt trace "a" - A0 |> DynObj.setValueOpt trace "a0" - DA |> DynObj.setValueOpt trace "da" - B |> DynObj.setValueOpt trace "b" - B0 |> DynObj.setValueOpt trace "b0" - DB |> DynObj.setValueOpt trace "db" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - AAxis |> DynObj.setValueOpt trace "aaxis" - BAxis |> DynObj.setValueOpt trace "baxis" - XAxis |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.convert - Color |> DynObj.setValueOpt trace "color" - Carpet |> DynObj.setValueOptBy trace "carpet" StyleParam.SubPlotId.convert - CheaterSlope |> DynObj.setValueOpt trace "cheaterslope" - Font |> DynObj.setValueOpt trace "font" - UIRevision |> DynObj.setValueOpt trace "uirevision" - trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "opacity" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalSingleOrAnyProperty "x" (X, MultiX) + |> DynObj.withOptionalSingleOrAnyProperty "y" (Y, MultiY) + |> DynObj.withOptionalProperty "a" A + |> DynObj.withOptionalProperty "a0" A0 + |> DynObj.withOptionalProperty "da" DA + |> DynObj.withOptionalProperty "b" B + |> DynObj.withOptionalProperty "b0" B0 + |> DynObj.withOptionalProperty "db" DB + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "aaxis" AAxis + |> DynObj.withOptionalProperty "baxis" BAxis + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "color" Color + |> DynObj.withOptionalPropertyBy "carpet" Carpet StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "cheaterslope" CheaterSlope + |> DynObj.withOptionalProperty "font" Font + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a scatter carpet plot to a Trace object @@ -230,47 +224,43 @@ type TraceCarpetStyle() = [] ?UIRevision: string ) = fun (trace: #Trace) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - Ids |> DynObj.setValueOpt trace "ids" - A |> DynObj.setValueOpt trace "a" - B |> DynObj.setValueOpt trace "b" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - XAxis |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.convert - Marker |> DynObj.setValueOpt trace "marker" - Line |> DynObj.setValueOpt trace "line" - TextFont |> DynObj.setValueOpt trace "textfont" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - Carpet |> DynObj.setValueOptBy trace "carpet" StyleParam.SubPlotId.convert - ConnectGaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - FillColor |> DynObj.setValueOpt trace "fillcolor" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - HoverOn |> DynObj.setValueOptBy trace "hoveron" StyleParam.HoverOn.convert - UIRevision |> DynObj.setValueOpt trace "uirevision" - + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.Mode.convert + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "a" A + |> DynObj.withOptionalProperty "b" B + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalPropertyBy "carpet" Carpet StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalPropertyBy "fill" Fill StyleParam.Fill.convert + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "hoveron" HoverOn StyleParam.HoverOn.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a carpet contour scatter plot to a Trace object @@ -368,47 +358,46 @@ type TraceCarpetStyle() = ) = fun (trace: #Trace) -> - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - Z |> DynObj.setValueOpt trace "z" - A |> DynObj.setValueOpt trace "a" - AType |> DynObj.setValueOptBy trace "atype" StyleParam.CoordinateType.convert - A0 |> DynObj.setValueOpt trace "a0" - DA |> DynObj.setValueOpt trace "da" - B |> DynObj.setValueOpt trace "b" - BType |> DynObj.setValueOptBy trace "btype" StyleParam.CoordinateType.convert - B0 |> DynObj.setValueOpt trace "b0" - DB |> DynObj.setValueOpt trace "db" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - XAxis |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.convert - YAxis |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.convert - ColorAxis |> DynObj.setValueOptBy trace "coloraxis" StyleParam.SubPlotId.convert - Line |> DynObj.setValueOpt trace "line" - ColorBar |> DynObj.setValueOpt trace "colorbar" - AutoColorScale |> DynObj.setValueOpt trace "autocolorscale" - ColorScale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt trace "showscale" - ReverseScale |> DynObj.setValueOpt trace "reversescale" - ZAuto |> DynObj.setValueOpt trace "zauto" - ZMax |> DynObj.setValueOpt trace "zmax" - ZMid |> DynObj.setValueOpt trace "zmid" - ZMin |> DynObj.setValueOpt trace "zmin" - AutoContour |> DynObj.setValueOpt trace "autocontour" - Carpet |> DynObj.setValueOptBy trace "carpet" StyleParam.SubPlotId.convert - Contours |> DynObj.setValueOpt trace "contours" - FillColor |> DynObj.setValueOpt trace "fillcolor" - NContours |> DynObj.setValueOpt trace "ncontours" - Transpose |> DynObj.setValueOpt trace "transpose" - UIRevision |> DynObj.setValueOpt trace "uirevision" - trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "a" A + |> DynObj.withOptionalPropertyBy "atype" AType StyleParam.CoordinateType.convert + |> DynObj.withOptionalProperty "a0" A0 + |> DynObj.withOptionalProperty "da" DA + |> DynObj.withOptionalProperty "b" B + |> DynObj.withOptionalPropertyBy "btype" BType StyleParam.CoordinateType.convert + |> DynObj.withOptionalProperty "b0" B0 + |> DynObj.withOptionalProperty "db" DB + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "xaxis" XAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "yaxis" YAxis StyleParam.LinearAxisId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "zauto" ZAuto + |> DynObj.withOptionalProperty "zmax" ZMax + |> DynObj.withOptionalProperty "zmid" ZMid + |> DynObj.withOptionalProperty "zmin" ZMin + |> DynObj.withOptionalProperty "autocontour" AutoContour + |> DynObj.withOptionalPropertyBy "carpet" Carpet StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "contours" Contours + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "ncontours" NContours + |> DynObj.withOptionalProperty "transpose" Transpose + |> DynObj.withOptionalProperty "uirevision" UIRevision diff --git a/src/Plotly.NET/Traces/TraceDomain.fs b/src/Plotly.NET/Traces/TraceDomain.fs index 2c69cb46f..74659635e 100644 --- a/src/Plotly.NET/Traces/TraceDomain.fs +++ b/src/Plotly.NET/Traces/TraceDomain.fs @@ -43,11 +43,8 @@ type TraceDomain(traceTypeName) = type TraceDomainStyle() = static member SetDomain([] ?Domain: Domain) = - (fun (trace: TraceDomain) -> - - Domain |> DynObj.setValueOpt trace "domain" - - trace) + fun (trace: TraceDomain) -> + trace |> DynObj.withOptionalProperty "domain" Domain /// /// Creates a function that applies the styles of a pie chart to a Trace object @@ -143,54 +140,46 @@ type TraceDomainStyle() = [] ?Sort: bool, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Title |> DynObj.setValueOpt trace "title" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - Values |> DynObj.setValueOpt trace "values" - Labels |> DynObj.setValueOpt trace "labels" - DLabel |> DynObj.setValueOpt trace "dlabel" - Label0 |> DynObj.setValueOpt trace "label0" - (Pull, MultiPull) |> DynObj.setSingleOrMultiOpt trace "pull" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Domain |> DynObj.setValueOpt trace "domain" - AutoMargin |> DynObj.setValueOpt trace "automargin" - Marker |> DynObj.setValueOpt trace "marker" - TextFont |> DynObj.setValueOpt trace "textfont" - TextInfo |> DynObj.setValueOptBy trace "textinfo" StyleParam.TextInfo.convert - Direction |> DynObj.setValueOptBy trace "direction" StyleParam.Direction.convert - Hole |> DynObj.setValueOpt trace "hole" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - InsideTextFont |> DynObj.setValueOpt trace "insidetextfont" - - InsideTextOrientation - |> DynObj.setValueOptBy trace "insidetextorientation" StyleParam.InsideTextOrientation.convert - - OutsideTextFont |> DynObj.setValueOpt trace "outsidetextfont" - Rotation |> DynObj.setValueOpt trace "rotation" - ScaleGroup |> DynObj.setValueOpt trace "scalegroup" - Sort |> DynObj.setValueOpt trace "sort" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + fun (trace: ('T :> Trace)) -> + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "values" Values + |> DynObj.withOptionalProperty "labels" Labels + |> DynObj.withOptionalProperty "dlabel" DLabel + |> DynObj.withOptionalProperty "label0" Label0 + |> DynObj.withOptionalSingleOrMultiProperty "pull" (Pull, MultiPull) + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "automargin" AutoMargin + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalPropertyBy "textinfo" TextInfo StyleParam.TextInfo.convert + |> DynObj.withOptionalPropertyBy "direction" Direction StyleParam.Direction.convert + |> DynObj.withOptionalProperty "hole" Hole + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "insidetextfont" InsideTextFont + |> DynObj.withOptionalPropertyBy "insidetextorientation" InsideTextOrientation StyleParam.InsideTextOrientation.convert + |> DynObj.withOptionalProperty "outsidetextfont" OutsideTextFont + |> DynObj.withOptionalProperty "rotation" Rotation + |> DynObj.withOptionalProperty "scalegroup" ScaleGroup + |> DynObj.withOptionalProperty "sort" Sort + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Creates a function that applies the styles of a funnel area chart to a Trace object @@ -272,45 +261,40 @@ type TraceDomainStyle() = [] ?ScaleGroup: string, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Title |> DynObj.setValueOpt trace "title" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - Values |> DynObj.setValueOpt trace "values" - Labels |> DynObj.setValueOpt trace "labels" - DLabel |> DynObj.setValueOpt trace "dlabel" - Label0 |> DynObj.setValueOpt trace "label0" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Domain |> DynObj.setValueOpt trace "domain" - Marker |> DynObj.setValueOpt trace "marker" - TextFont |> DynObj.setValueOpt trace "textfont" - TextInfo |> DynObj.setValueOptBy trace "textinfo" StyleParam.TextInfo.convert - AspectRatio |> DynObj.setValueOpt trace "aspectratio" - BaseRatio |> DynObj.setValueOpt trace "baseratio" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - InsideTextFont |> DynObj.setValueOpt trace "insidetextfont" - ScaleGroup |> DynObj.setValueOpt trace "scalegroup" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + fun (trace: ('T :> Trace)) -> + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "values" Values + |> DynObj.withOptionalProperty "labels" Labels + |> DynObj.withOptionalProperty "dlabel" DLabel + |> DynObj.withOptionalProperty "label0" Label0 + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalPropertyBy "textinfo" TextInfo StyleParam.TextInfo.convert + |> DynObj.withOptionalProperty "aspectratio" AspectRatio + |> DynObj.withOptionalProperty "baseratio" BaseRatio + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "insidetextfont" InsideTextFont + |> DynObj.withOptionalProperty "scalegroup" ScaleGroup + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Creates a function that applies the styles of a sunburst chart to a Trace object @@ -400,50 +384,46 @@ type TraceDomainStyle() = [] ?Sort: bool, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Title |> DynObj.setValueOpt trace "title" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - Parents |> DynObj.setValueOpt trace "parents" - Values |> DynObj.setValueOpt trace "values" - Labels |> DynObj.setValueOpt trace "labels" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Domain |> DynObj.setValueOpt trace "domain" - Marker |> DynObj.setValueOpt trace "marker" - TextFont |> DynObj.setValueOpt trace "textfont" - TextInfo |> DynObj.setValueOptBy trace "textinfo" StyleParam.TextInfo.convert - BranchValues |> DynObj.setValueOptBy trace "branchvalues" StyleParam.BranchValues.convert - Count |> DynObj.setValueOpt trace "count" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - InsideTextFont |> DynObj.setValueOpt trace "insidetextfont" - - InsideTextOrientation - |> DynObj.setValueOptBy trace "insidetextorientation" StyleParam.InsideTextOrientation.convert - - OutsideTextFont |> DynObj.setValueOpt trace "outsidetextfont" - Root |> DynObj.setValueOpt trace "root" - Leaf |> DynObj.setValueOpt trace "leaf" - Level |> DynObj.setValueOpt trace "level" - MaxDepth |> DynObj.setValueOpt trace "maxdepth" - Rotation |> DynObj.setValueOpt trace "rotation" - Sort |> DynObj.setValueOpt trace "sort" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + fun (trace: ('T :> Trace)) -> + + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "parents" Parents + |> DynObj.withOptionalProperty "values" Values + |> DynObj.withOptionalProperty "labels" Labels + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalPropertyBy "textinfo" TextInfo StyleParam.TextInfo.convert + |> DynObj.withOptionalPropertyBy "branchvalues" BranchValues StyleParam.BranchValues.convert + |> DynObj.withOptionalProperty "count" Count + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "insidetextfont" InsideTextFont + |> DynObj.withOptionalPropertyBy "insidetextorientation" InsideTextOrientation StyleParam.InsideTextOrientation.convert + |> DynObj.withOptionalProperty "outsidetextfont" OutsideTextFont + |> DynObj.withOptionalProperty "root" Root + |> DynObj.withOptionalProperty "leaf" Leaf + |> DynObj.withOptionalProperty "level" Level + |> DynObj.withOptionalProperty "maxdepth" MaxDepth + |> DynObj.withOptionalProperty "rotation" Rotation + |> DynObj.withOptionalProperty "sort" Sort + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Creates a function that applies the styles of a treemap chart to a Trace object @@ -533,49 +513,45 @@ type TraceDomainStyle() = [] ?MaxDepth: int, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> + fun (trace: ('T :> Trace)) -> - Name |> DynObj.setValueOpt trace "name" - Title |> DynObj.setValueOpt trace "title" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - Parents |> DynObj.setValueOpt trace "parents" - Values |> DynObj.setValueOpt trace "values" - Labels |> DynObj.setValueOpt trace "labels" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Domain |> DynObj.setValueOpt trace "domain" - Marker |> DynObj.setValueOpt trace "marker" - TextFont |> DynObj.setValueOpt trace "textfont" - TextInfo |> DynObj.setValueOptBy trace "textinfo" StyleParam.TextInfo.convert - BranchValues |> DynObj.setValueOptBy trace "branchvalues" StyleParam.BranchValues.convert - Count |> DynObj.setValueOpt trace "count" - Tiling |> DynObj.setValueOpt trace "tiling" - PathBar |> DynObj.setValueOpt trace "pathbar" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - InsideTextFont |> DynObj.setValueOpt trace "insidetextfont" - OutsideTextFont |> DynObj.setValueOpt trace "outsidetextfont" - Root |> DynObj.setValueOpt trace "root" - Level |> DynObj.setValueOpt trace "level" - MaxDepth |> DynObj.setValueOpt trace "maxdepth" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "parents" Parents + |> DynObj.withOptionalProperty "values" Values + |> DynObj.withOptionalProperty "labels" Labels + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalPropertyBy "textinfo" TextInfo StyleParam.TextInfo.convert + |> DynObj.withOptionalPropertyBy "branchvalues" BranchValues StyleParam.BranchValues.convert + |> DynObj.withOptionalProperty "count" Count + |> DynObj.withOptionalProperty "tiling" Tiling + |> DynObj.withOptionalProperty "pathbar" PathBar + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "insidetextfont" InsideTextFont + |> DynObj.withOptionalProperty "outsidetextfont" OutsideTextFont + |> DynObj.withOptionalProperty "root" Root + |> DynObj.withOptionalProperty "level" Level + |> DynObj.withOptionalProperty "maxdepth" MaxDepth + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Creates a function that applies the styles of a parallel coordinates plot to a Trace object @@ -621,29 +597,27 @@ type TraceDomainStyle() = [] ?TickFont: Font, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Ids |> DynObj.setValueOpt trace "ids" - Dimensions |> DynObj.setValueOpt trace "dimensions" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Domain |> DynObj.setValueOpt trace "domain" - Line |> DynObj.setValueOpt trace "line" - Unselected |> DynObj.setValueOpt trace "unselected" - LabelAngle |> DynObj.setValueOpt trace "labelangle" - LabelFont |> DynObj.setValueOpt trace "labelfont" - LabelSide |> DynObj.setValueOpt trace "labelside" - RangeFont |> DynObj.setValueOpt trace "rangefont" - TickFont |> DynObj.setValueOpt trace "tickfont " - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + fun (trace: ('T :> Trace)) -> + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "dimensions" Dimensions + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "labelangle" LabelAngle + |> DynObj.withOptionalProperty "labelfont" LabelFont + |> DynObj.withOptionalProperty "labelside" LabelSide + |> DynObj.withOptionalProperty "rangefont" RangeFont + |> DynObj.withOptionalProperty "tickfont " TickFont + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Creates a function that applies the styles of a parallel categories plot to a Trace object @@ -691,29 +665,28 @@ type TraceDomainStyle() = [] ?TickFont: Font, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Counts |> DynObj.setValueOpt trace "counts" - Dimensions |> DynObj.setValueOpt trace "dimensions" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - Domain |> DynObj.setValueOpt trace "domain" - Line |> DynObj.setValueOpt trace "line" - Arrangement |> DynObj.setValueOptBy trace "arrangement" StyleParam.CategoryArrangement.convert - BundleColors |> DynObj.setValueOpt trace "bundlecolors" - SortPaths |> DynObj.setValueOptBy trace "sortpaths" StyleParam.SortAlgorithm.convert - Hoveron |> DynObj.setValueOptBy trace "hoveron" StyleParam.HoverOn.convert - LabelFont |> DynObj.setValueOpt trace "labelfont" - TickFont |> DynObj.setValueOpt trace "tickfont " - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + fun (trace: ('T :> Trace)) -> + + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "counts" Counts + |> DynObj.withOptionalProperty "dimensions" Dimensions + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalPropertyBy "arrangement" Arrangement StyleParam.CategoryArrangement.convert + |> DynObj.withOptionalProperty "bundlecolors" BundleColors + |> DynObj.withOptionalPropertyBy "sortpaths" SortPaths StyleParam.SortAlgorithm.convert + |> DynObj.withOptionalPropertyBy "hoveron" Hoveron StyleParam.HoverOn.convert + |> DynObj.withOptionalProperty "labelfont" LabelFont + |> DynObj.withOptionalProperty "tickfont " TickFont + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Creates a function that applies the styles of a sankey chart to a Trace object @@ -763,31 +736,31 @@ type TraceDomainStyle() = [] ?ValueSuffix: string, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> + fun (trace: ('T :> Trace)) -> - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Ids |> DynObj.setValueOpt trace "ids" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Domain |> DynObj.setValueOpt trace "domain" - Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert - Node |> DynObj.setValueOpt trace "node" - Link |> DynObj.setValueOpt trace "link" - TextFont |> DynObj.setValueOpt trace "textfont" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Arrangement |> DynObj.setValueOptBy trace "arrangement" StyleParam.CategoryArrangement.convert - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - ValueFormat |> DynObj.setValueOpt trace "valueformat" - ValueSuffix |> DynObj.setValueOpt trace "valuesuffix" - UIRevision |> DynObj.setValueOpt trace "uirevision" + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalPropertyBy "orientation" Orientation StyleParam.Orientation.convert + |> DynObj.withOptionalProperty "node" Node + |> DynObj.withOptionalProperty "link" Link + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalPropertyBy "arrangement" Arrangement StyleParam.CategoryArrangement.convert + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "valueformat" ValueFormat + |> DynObj.withOptionalProperty "valuesuffix" ValueSuffix + |> DynObj.withOptionalProperty "uirevision" UIRevision - trace) /// /// Creates a function that applies the styles of a table to a Trace object @@ -829,26 +802,24 @@ type TraceDomainStyle() = [] ?HoverLabel: Hoverlabel, [] ?UIRevision: string ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Ids |> DynObj.setValueOpt trace "ids" - ColumnOrder |> DynObj.setValueOpt trace "columnorder" - (ColumnWidth, MultiColumnWidth) |> DynObj.setSingleOrMultiOpt trace "columnwidth" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Domain |> DynObj.setValueOpt trace "domain" - Cells |> DynObj.setValueOpt trace "cells" - Header |> DynObj.setValueOpt trace "header" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + fun (trace: ('T :> Trace)) -> + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "columnorder" ColumnOrder + |> DynObj.withOptionalSingleOrMultiProperty "columnwidth" (ColumnWidth, MultiColumnWidth) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "cells" Cells + |> DynObj.withOptionalProperty "header" Header + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Creates a function that applies the styles of an indicator to a Trace object @@ -891,26 +862,25 @@ type TraceDomainStyle() = [] ?UIRevision: string ) = fun (trace: #Trace) -> - - Name |> DynObj.setValueOpt trace "name" - Title |> DynObj.setValueOpt trace "title" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.IndicatorMode.convert - Ids |> DynObj.setValueOpt trace "ids" - Value |> DynObj.setValueOpt trace "value" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Domain |> DynObj.setValueOpt trace "domain" - Align |> DynObj.setValueOptBy trace "align" StyleParam.IndicatorAlignment.convert - Delta |> DynObj.setValueOpt trace "delta" - Number |> DynObj.setValueOpt trace "number" - Gauge |> DynObj.setValueOpt trace "gauge" - UIRevision |> DynObj.setValueOpt trace "uirevision" - + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalProperty "title" Title + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.IndicatorMode.convert + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "value" Value + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalPropertyBy "align" Align StyleParam.IndicatorAlignment.convert + |> DynObj.withOptionalProperty "delta" Delta + |> DynObj.withOptionalProperty "number" Number + |> DynObj.withOptionalProperty "gauge" Gauge + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Creates a function that applies the styles of an icicle chart to a Trace object @@ -1000,43 +970,39 @@ type TraceDomainStyle() = ) = fun (trace: #Trace) -> - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - Parents |> DynObj.setValueOpt trace "parents" - Values |> DynObj.setValueOpt trace "values" - Labels |> DynObj.setValueOpt trace "labels" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Domain |> DynObj.setValueOpt trace "domain" - Marker |> DynObj.setValueOpt trace "marker" - TextFont |> DynObj.setValueOpt trace "textfont" - TextInfo |> DynObj.setValueOptBy trace "textinfo" StyleParam.TextInfo.convert - BranchValues |> DynObj.setValueOptBy trace "branchvalues" StyleParam.BranchValues.convert - Count |> DynObj.setValueOptBy trace "count" StyleParam.IcicleCount.convert - Tiling |> DynObj.setValueOpt trace "tiling" - PathBar |> DynObj.setValueOpt trace "pathbar" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - InsideTextFont |> DynObj.setValueOpt trace "insidetextfont" - OutsideTextFont |> DynObj.setValueOpt trace "outsidetextfont" - Root |> DynObj.setValueOpt trace "root" - Leaf |> DynObj.setValueOpt trace "leaf" - Level |> DynObj.setValueOpt trace "level" - MaxDepth |> DynObj.setValueOpt trace "maxdepth" - Sort |> DynObj.setValueOpt trace "sort" - UIRevision |> DynObj.setValueOpt trace "uirevision" - trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "parents" Parents + |> DynObj.withOptionalProperty "values" Values + |> DynObj.withOptionalProperty "labels" Labels + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "domain" Domain + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalPropertyBy "textinfo" TextInfo StyleParam.TextInfo.convert + |> DynObj.withOptionalPropertyBy "branchvalues" BranchValues StyleParam.BranchValues.convert + |> DynObj.withOptionalPropertyBy "count" Count StyleParam.IcicleCount.convert + |> DynObj.withOptionalProperty "tiling" Tiling + |> DynObj.withOptionalProperty "pathbar" PathBar + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "insidetextfont" InsideTextFont + |> DynObj.withOptionalProperty "outsidetextfont" OutsideTextFont + |> DynObj.withOptionalProperty "root" Root + |> DynObj.withOptionalProperty "leaf" Leaf + |> DynObj.withOptionalProperty "level" Level + |> DynObj.withOptionalProperty "maxdepth" MaxDepth + |> DynObj.withOptionalProperty "sort" Sort + |> DynObj.withOptionalProperty "uirevision" UIRevision \ No newline at end of file diff --git a/src/Plotly.NET/Traces/TraceGeo.fs b/src/Plotly.NET/Traces/TraceGeo.fs index b25d308d0..478105431 100644 --- a/src/Plotly.NET/Traces/TraceGeo.fs +++ b/src/Plotly.NET/Traces/TraceGeo.fs @@ -39,11 +39,9 @@ type TraceGeo(traceTypeName) = type TraceGeoStyle() = static member SetGeo([] ?GeoId: StyleParam.SubPlotId) = - (fun (trace: TraceGeo) -> + fun (trace: TraceGeo) -> + trace |> DynObj.withOptionalPropertyBy "geo" GeoId StyleParam.SubPlotId.toString - GeoId |> DynObj.setValueOptBy trace "geo" StyleParam.SubPlotId.toString - - trace) /// /// Creates a function that applies the styles of a choropleth map to a Trace object @@ -129,46 +127,45 @@ type TraceGeoStyle() = [] ?LocationMode: StyleParam.LocationFormat, [] ?UIRevision: string ) = - (fun (trace: #Trace) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Ids |> DynObj.setValueOpt trace "ids" - Z |> DynObj.setValueOpt trace "z" - GeoJson |> DynObj.setValueOpt trace "geojson" - FeatureIdKey |> DynObj.setValueOpt trace "featureidkey" - Locations |> DynObj.setValueOpt trace "locations" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Geo |> DynObj.setValueOptBy trace "geo" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy trace "coloraxis" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt trace "marker" - ColorBar |> DynObj.setValueOpt trace "colorbar" - AutoColorScale |> DynObj.setValueOpt trace "autocolorscale" - ColorScale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt trace "showscale" - ReverseScale |> DynObj.setValueOpt trace "reversescale" - ZAuto |> DynObj.setValueOpt trace "zauto" - Zmin |> DynObj.setValueOpt trace "zmin" - Zmid |> DynObj.setValueOpt trace "zmid" - Zmax |> DynObj.setValueOpt trace "zmax" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - LocationMode |> DynObj.setValueOptBy trace "locationmode" StyleParam.LocationFormat.convert - UIRevision |> DynObj.setValueOpt trace "uirevision" + fun (trace: #Trace) -> - trace) + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "geojson" GeoJson + |> DynObj.withOptionalProperty "featureidkey" FeatureIdKey + |> DynObj.withOptionalProperty "locations" Locations + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "geo" Geo StyleParam.SubPlotId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "zauto" ZAuto + |> DynObj.withOptionalProperty "zmin" Zmin + |> DynObj.withOptionalProperty "zmid" Zmid + |> DynObj.withOptionalProperty "zmax" Zmax + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "locationmode" LocationMode StyleParam.LocationFormat.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Creates a function that applies the styles of a scattergeo plot to a Trace object @@ -258,48 +255,42 @@ type TraceGeoStyle() = [] ?LocationMode: StyleParam.LocationFormat, [] ?UIRevision: string ) = - (fun (trace: #Trace) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - Ids |> DynObj.setValueOpt trace "ids" - Lat |> DynObj.setValueOpt trace "lat" - GeoJson |> DynObj.setValueOpt trace "geojson" - FeatureIdKey |> DynObj.setValueOpt trace "featureidkey" - Locations |> DynObj.setValueOpt trace "locations" - Lon |> DynObj.setValueOpt trace "lon" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Geo |> DynObj.setValueOptBy trace "geo" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt trace "marker" - Line |> DynObj.setValueOpt trace "line" - TextFont |> DynObj.setValueOpt trace "textfont" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - ConnectGaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - FillColor |> DynObj.setValueOpt trace "fillcolor" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - LocationMode |> DynObj.setValueOptBy trace "locationmode" StyleParam.LocationFormat.convert - UIRevision |> DynObj.setValueOpt trace "uirevision" + fun (trace: #Trace) -> trace - - ) + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.Mode.convert + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "lat" Lat + |> DynObj.withOptionalProperty "geojson" GeoJson + |> DynObj.withOptionalProperty "featureidkey" FeatureIdKey + |> DynObj.withOptionalProperty "locations" Locations + |> DynObj.withOptionalProperty "lon" Lon + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "geo" Geo StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalPropertyBy "fill" Fill StyleParam.Fill.convert + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "locationmode" LocationMode StyleParam.LocationFormat.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision diff --git a/src/Plotly.NET/Traces/TraceMapbox.fs b/src/Plotly.NET/Traces/TraceMapbox.fs index 2ac9dcf50..d970f6307 100644 --- a/src/Plotly.NET/Traces/TraceMapbox.fs +++ b/src/Plotly.NET/Traces/TraceMapbox.fs @@ -45,11 +45,9 @@ type TraceMapbox(traceTypeName) = type TraceMapboxStyle() = static member SetMapbox([] ?MapboxId: StyleParam.SubPlotId) = - (fun (trace: TraceMapbox) -> + fun (trace: TraceMapbox) -> + trace |> DynObj.withOptionalPropertyBy "subplot" MapboxId StyleParam.SubPlotId.toString - MapboxId |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.toString - - trace) /// /// Create a function that applies the styles of a mapbox scatter plot to a Trace object @@ -135,46 +133,42 @@ type TraceMapboxStyle() = [] ?HoverLabel: Hoverlabel, [] ?UIRevision: string ) = - (fun (trace: #Trace) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - Ids |> DynObj.setValueOpt trace "ids" - Lat |> DynObj.setValueOpt trace "lat" - Lon |> DynObj.setValueOpt trace "lon" - Cluster |> DynObj.setValueOpt trace "cluster" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert + fun (trace: #Trace) -> - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - SubPlot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt trace "marker" - Line |> DynObj.setValueOpt trace "line" - TextFont |> DynObj.setValueOpt trace "textfont" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - Below |> DynObj.setValueOpt trace "below" - ConnectGaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - FillColor |> DynObj.setValueOpt trace "fillcolor" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.Mode.convert + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "lat" Lat + |> DynObj.withOptionalProperty "lon" Lon + |> DynObj.withOptionalProperty "cluster" Cluster + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "subplot" SubPlot StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "below" Below + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalPropertyBy "fill" Fill StyleParam.Fill.convert + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a choropleth mapbox plot to a Trace object @@ -260,46 +254,43 @@ type TraceMapboxStyle() = [] ?HoverLabel: Hoverlabel, [] ?UIRevision: string ) = - (fun (trace: #Trace) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Ids |> DynObj.setValueOpt trace "ids" - Z |> DynObj.setValueOpt trace "z" - GeoJson |> DynObj.setValueOpt trace "geojson" - FeatureIdKey |> DynObj.setValueOpt trace "featureidkey" - Locations |> DynObj.setValueOpt trace "locations" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - SubPlot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy trace "coloraxis" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt trace "marker" - ColorBar |> DynObj.setValueOpt trace "colorbar" - AutoColorScale |> DynObj.setValueOpt trace "autocolorscale" - ColorScale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt trace "showscale" - ReverseScale |> DynObj.setValueOpt trace "reversescale" - ZAuto |> DynObj.setValueOpt trace "zauto" - Zmin |> DynObj.setValueOpt trace "zmin" - Zmid |> DynObj.setValueOpt trace "zmid" - Zmax |> DynObj.setValueOpt trace "zmax" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - Below |> DynObj.setValueOpt trace "below" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - - trace) + fun (trace: #Trace) -> + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "geojson" GeoJson + |> DynObj.withOptionalProperty "featureidkey" FeatureIdKey + |> DynObj.withOptionalProperty "locations" Locations + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "subplot" SubPlot StyleParam.SubPlotId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "zauto" ZAuto + |> DynObj.withOptionalProperty "zmin" Zmin + |> DynObj.withOptionalProperty "zmid" Zmid + |> DynObj.withOptionalProperty "zmax" Zmax + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "below" Below + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a density mapbox plot to a Trace object @@ -381,42 +372,39 @@ type TraceMapboxStyle() = [] ?HoverLabel: Hoverlabel, [] ?UIRevision: string ) = - (fun (trace: #Trace) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - Z |> DynObj.setValueOpt trace "z" - Radius |> DynObj.setValueOpt trace "radius" - Lat |> DynObj.setValueOpt trace "lat" - Lon |> DynObj.setValueOpt trace "lon" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - SubPlot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy trace "coloraxis" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt trace "marker" - ColorBar |> DynObj.setValueOpt trace "colorbar" - AutoColorScale |> DynObj.setValueOpt trace "autocolorscale" - ColorScale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt trace "showscale" - ReverseScale |> DynObj.setValueOpt trace "reversescale" - ZAuto |> DynObj.setValueOpt trace "zauto" - Zmin |> DynObj.setValueOpt trace "zmin" - Zmid |> DynObj.setValueOpt trace "zmid" - Zmax |> DynObj.setValueOpt trace "zmax" - Below |> DynObj.setValueOpt trace "below" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - - trace) + fun (trace: #Trace) -> + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "z" Z + |> DynObj.withOptionalProperty "radius" Radius + |> DynObj.withOptionalProperty "lat" Lat + |> DynObj.withOptionalProperty "lon" Lon + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "subplot" SubPlot StyleParam.SubPlotId.convert + |> DynObj.withOptionalPropertyBy "coloraxis" ColorAxis StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "colorbar" ColorBar + |> DynObj.withOptionalProperty "autocolorscale" AutoColorScale + |> DynObj.withOptionalPropertyBy "colorscale" ColorScale StyleParam.Colorscale.convert + |> DynObj.withOptionalProperty "showscale" ShowScale + |> DynObj.withOptionalProperty "reversescale" ReverseScale + |> DynObj.withOptionalProperty "zauto" ZAuto + |> DynObj.withOptionalProperty "zmin" Zmin + |> DynObj.withOptionalProperty "zmid" Zmid + |> DynObj.withOptionalProperty "zmax" Zmax + |> DynObj.withOptionalProperty "below" Below + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "uirevision" UIRevision diff --git a/src/Plotly.NET/Traces/TracePolar.fs b/src/Plotly.NET/Traces/TracePolar.fs index 1a78f1e2a..b1f5b6502 100644 --- a/src/Plotly.NET/Traces/TracePolar.fs +++ b/src/Plotly.NET/Traces/TracePolar.fs @@ -34,11 +34,8 @@ type TracePolar(traceTypeName) = type TracePolarStyle() = static member SetPolar([] ?PolarId: StyleParam.SubPlotId) = - (fun (trace: TracePolar) -> - - PolarId |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.toString - - trace) + fun (trace: TracePolar) -> + trace |> DynObj.withOptionalPropertyBy "subplot" PolarId StyleParam.SubPlotId.toString /// /// Create a function that applies the styles of a polar scatter plot to a Trace object @@ -134,52 +131,48 @@ type TracePolarStyle() = [] ?HoverOn: string, [] ?UIRevision: seq<#IConvertible> ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - Ids |> DynObj.setValueOpt trace "ids" - R |> DynObj.setValueOpt trace "r" - R0 |> DynObj.setValueOpt trace "r0" - DR |> DynObj.setValueOpt trace "dr" - Theta |> DynObj.setValueOpt trace "theta" - Theta0 |> DynObj.setValueOpt trace "theta0" - DTheta |> DynObj.setValueOpt trace "dtheta" - ThetaUnit |> DynObj.setValueOptBy trace "thetaunit" StyleParam.AngularUnit.convert - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" + fun (trace: ('T :> Trace)) -> - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Subplot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt trace "marker" - Line |> DynObj.setValueOpt trace "line" - TextFont |> DynObj.setValueOpt trace "textfont" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - ClipOnAxis |> DynObj.setValueOpt trace "cliponaxis" - ConnectGaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - FillColor |> DynObj.setValueOpt trace "fillcolor" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - HoverOn |> DynObj.setValueOpt trace "hoveron" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace) + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.Mode.convert + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "r" R + |> DynObj.withOptionalProperty "r0" R0 + |> DynObj.withOptionalProperty "dr" DR + |> DynObj.withOptionalProperty "theta" Theta + |> DynObj.withOptionalProperty "theta0" Theta0 + |> DynObj.withOptionalProperty "dtheta" DTheta + |> DynObj.withOptionalPropertyBy "thetaunit" ThetaUnit StyleParam.AngularUnit.convert + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "subplot" Subplot StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "cliponaxis" ClipOnAxis + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalPropertyBy "fill" Fill StyleParam.Fill.convert + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "hoveron" HoverOn + |> DynObj.withOptionalProperty "uirevision" UIRevision /// /// Create a function that applies the styles of a polar bar plot to a Trace object @@ -261,39 +254,38 @@ type TracePolarStyle() = [] ?HoverLabel: Hoverlabel, [] ?UIRevision: seq<#IConvertible> ) = - (fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - Base |> DynObj.setValueOpt trace "base" - R |> DynObj.setValueOpt trace "r" - R0 |> DynObj.setValueOpt trace "r0" - DR |> DynObj.setValueOpt trace "dr" - Theta |> DynObj.setValueOpt trace "theta" - Theta0 |> DynObj.setValueOpt trace "theta0" - DTheta |> DynObj.setValueOpt trace "dtheta" - ThetaUnit |> DynObj.setValueOptBy trace "thetaunit" StyleParam.AngularUnit.convert - (Width, MultiWidth) |> DynObj.setSingleOrMultiOpt trace "width" - (Offset, MultiOffset) |> DynObj.setSingleOrMultiOpt trace "offset" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Subplot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt trace "marker" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - UIRevision |> DynObj.setValueOpt trace "uirevision" + fun (trace: ('T :> Trace)) -> - trace) + trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle" LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "base" Base + |> DynObj.withOptionalProperty "r" R + |> DynObj.withOptionalProperty "r0" R0 + |> DynObj.withOptionalProperty "dr" DR + |> DynObj.withOptionalProperty "theta" Theta + |> DynObj.withOptionalProperty "theta0" Theta0 + |> DynObj.withOptionalProperty "dtheta" DTheta + |> DynObj.withOptionalPropertyBy "thetaunit" ThetaUnit StyleParam.AngularUnit.convert + |> DynObj.withOptionalSingleOrMultiProperty "width" (Width, MultiWidth) + |> DynObj.withOptionalSingleOrMultiProperty "offset" (Offset, MultiOffset) + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "subplot" Subplot StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalProperty "uirevision" UIRevision diff --git a/src/Plotly.NET/Traces/TraceSmith.fs b/src/Plotly.NET/Traces/TraceSmith.fs index 5a1e452d9..6c1d53b89 100644 --- a/src/Plotly.NET/Traces/TraceSmith.fs +++ b/src/Plotly.NET/Traces/TraceSmith.fs @@ -17,11 +17,9 @@ type TraceSmith(traceTypeName) = type TraceSmithStyle() = static member SetSmith([] ?SmithId: StyleParam.SubPlotId) = - (fun (trace: TraceSmith) -> + fun (trace: TraceSmith) -> + trace |> DynObj.withOptionalPropertyBy "subplot" SmithId StyleParam.SubPlotId.toString - SmithId |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.toString - - trace) /// /// Create a function that applies the styles of a scatter smith plot to a Trace object @@ -108,43 +106,38 @@ type TraceSmithStyle() = [] ?UIRevision: string ) = fun (trace: ('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - Ids |> DynObj.setValueOpt trace "ids" - Imag |> DynObj.setValueOpt trace "imag" - Real |> DynObj.setValueOpt trace "real" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Subplot |> DynObj.setValueOpt trace "subplot" - Marker |> DynObj.setValueOpt trace "marker" - Line |> DynObj.setValueOpt trace "line" - TextFont |> DynObj.setValueOpt trace "textfont" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - ClipOnAxis |> DynObj.setValueOpt trace "cliponaxis" - ConnectGaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - FillColor |> DynObj.setValueOpt trace "fillcolor" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - HoverOn |> DynObj.setValueOptBy trace "hoveron" StyleParam.HoverOn.convert - UIRevision |> DynObj.setValueOpt trace "uirevision" - trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.Mode.convert + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "imag" Imag + |> DynObj.withOptionalProperty "real" Real + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalProperty "subplot" Subplot + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "cliponaxis" ClipOnAxis + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalPropertyBy "fill" Fill StyleParam.Fill.convert + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "hoveron" HoverOn StyleParam.HoverOn.convert + |> DynObj.withOptionalProperty "uirevision" UIRevision \ No newline at end of file diff --git a/src/Plotly.NET/Traces/TraceTernary.fs b/src/Plotly.NET/Traces/TraceTernary.fs index 793df9ea6..3d83b272a 100644 --- a/src/Plotly.NET/Traces/TraceTernary.fs +++ b/src/Plotly.NET/Traces/TraceTernary.fs @@ -17,11 +17,8 @@ type TraceTernary(traceTypeName) = type TraceTernaryStyle() = static member SetTernary([] ?TernaryId: StyleParam.SubPlotId) = - (fun (trace: TraceTernary) -> - - TernaryId |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.toString - - trace) + fun (trace: TraceTernary) -> + trace |> DynObj.withOptionalPropertyBy "subplot" TernaryId StyleParam.SubPlotId.toString /// /// Create a function that applies the styles of a ternary scatter plot to a Trace object @@ -113,44 +110,40 @@ type TraceTernaryStyle() = ) = fun (trace: #Trace) -> - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - Legend |> DynObj.setValueOptBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - Ids |> DynObj.setValueOpt trace "ids" - A |> DynObj.setValueOpt trace "a" - B |> DynObj.setValueOpt trace "b" - C |> DynObj.setValueOpt trace "c" - (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" - HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - SubPlot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt trace "marker" - Line |> DynObj.setValueOpt trace "line" - TextFont |> DynObj.setValueOpt trace "textfont" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - ClipOnAxis |> DynObj.setValueOpt trace "cliponaxis" - ConnectGaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - FillColor |> DynObj.setValueOpt trace "fillcolor" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - HoverOn |> DynObj.setValueOptBy trace "hoveron" StyleParam.HoverOn.convert - Sum |> DynObj.setValueOpt trace "sum" - UIRevision |> DynObj.setValueOpt trace "uirevision" - trace + |> DynObj.withOptionalProperty "name" Name + |> DynObj.withOptionalPropertyBy "visible" Visible StyleParam.Visible.convert + |> DynObj.withOptionalProperty "showlegend" ShowLegend + |> DynObj.withOptionalPropertyBy "legend" Legend StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "legendrank" LegendRank + |> DynObj.withOptionalProperty "legendgroup" LegendGroup + |> DynObj.withOptionalProperty "legendgrouptitle"LegendGroupTitle + |> DynObj.withOptionalProperty "opacity" Opacity + |> DynObj.withOptionalPropertyBy "mode" Mode StyleParam.Mode.convert + |> DynObj.withOptionalProperty "ids" Ids + |> DynObj.withOptionalProperty "a" A + |> DynObj.withOptionalProperty "b" B + |> DynObj.withOptionalProperty "c" C + |> DynObj.withOptionalSingleOrMultiProperty "text" (Text, MultiText) + |> DynObj.withOptionalSingleOrMultiPropertyBy "textposition" (TextPosition, MultiTextPosition) StyleParam.TextPosition.convert + |> DynObj.withOptionalSingleOrMultiProperty "texttemplate" (TextTemplate, MultiTextTemplate) + |> DynObj.withOptionalSingleOrMultiProperty "hovertext" (HoverText, MultiHoverText) + |> DynObj.withOptionalPropertyBy "hoverinfo" HoverInfo StyleParam.HoverInfo.convert + |> DynObj.withOptionalSingleOrMultiProperty "hovertemplate" (HoverTemplate, MultiHoverTemplate) + |> DynObj.withOptionalProperty "meta" Meta + |> DynObj.withOptionalProperty "customdata" CustomData + |> DynObj.withOptionalPropertyBy "subplot" SubPlot StyleParam.SubPlotId.convert + |> DynObj.withOptionalProperty "marker" Marker + |> DynObj.withOptionalProperty "line" Line + |> DynObj.withOptionalProperty "textfont" TextFont + |> DynObj.withOptionalProperty "selectedpoints" SelectedPoints + |> DynObj.withOptionalProperty "selected" Selected + |> DynObj.withOptionalProperty "unselected" Unselected + |> DynObj.withOptionalProperty "cliponaxis" ClipOnAxis + |> DynObj.withOptionalProperty "connectgaps" ConnectGaps + |> DynObj.withOptionalPropertyBy "fill" Fill StyleParam.Fill.convert + |> DynObj.withOptionalProperty "fillcolor" FillColor + |> DynObj.withOptionalProperty "hoverlabel" HoverLabel + |> DynObj.withOptionalPropertyBy "hoveron" HoverOn StyleParam.HoverOn.convert + |> DynObj.withOptionalProperty "sum" Sum + |> DynObj.withOptionalProperty "uirevision" UIRevision diff --git a/tests/Common/FSharpTestBase/TestUtils.fs b/tests/Common/FSharpTestBase/TestUtils.fs index fe10a58de..1b754de42 100644 --- a/tests/Common/FSharpTestBase/TestUtils.fs +++ b/tests/Common/FSharpTestBase/TestUtils.fs @@ -213,6 +213,18 @@ module JsonGen = let json = chart |> GenericChart.toFigureJson Expect.equal json expected $"JSON not equal to expected value." + let layoutJsonIs chart expected = + let json = + let layout = GenericChart.getLayout chart + JsonConvert.SerializeObject(layout, Globals.JSON_CONFIG) + Expect.equal json expected $"Layout JSON not equal to expected value." + + let tracesJsonIs (expectedJson: string) (chart: GenericChart) = + let json = + let traces = GenericChart.getTraces chart + JsonConvert.SerializeObject(traces, Globals.JSON_CONFIG) + Expect.equal json expectedJson $"Traces JSON not equal to expected value" + module Objects = let jsonFieldIsSetWith fieldName expected (object:#DynamicObj) = diff --git a/tests/ConsoleApps/FSharpConsole/FSharpConsole.fsproj b/tests/ConsoleApps/FSharpConsole/FSharpConsole.fsproj index 8ca3ea8e8..0e9fd6d5e 100644 --- a/tests/ConsoleApps/FSharpConsole/FSharpConsole.fsproj +++ b/tests/ConsoleApps/FSharpConsole/FSharpConsole.fsproj @@ -15,6 +15,7 @@ + diff --git a/tests/ConsoleApps/FSharpConsole/Program.fs b/tests/ConsoleApps/FSharpConsole/Program.fs index 09bf2e520..ef6f626db 100644 --- a/tests/ConsoleApps/FSharpConsole/Program.fs +++ b/tests/ConsoleApps/FSharpConsole/Program.fs @@ -11,22 +11,8 @@ open Newtonsoft.Json [] let main args = - let x = [1.; 2.; 3.; 4.; 5.; 6.; 7.; 8.; 9.; 10.; ] - let y = [2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.] - [ - Chart.Point(x = x, y = y, UseDefaults = false) - |> Chart.withYAxisStyle("This title must") - - Chart.Line(x = x, y = y, UseDefaults = false) - |> Chart.withYAxisStyle("be set on the",ZeroLine=false) - - Chart.Spline(x = x, y = y, UseDefaults = false) - |> Chart.withYAxisStyle("respective subplots",ZeroLine=false) - ] - |> Chart.SingleStack(Pattern = StyleParam.LayoutGridPattern.Coupled) - //move xAxis to bottom and increase spacing between plots by using the withLayoutGridStyle function - |> Chart.withLayoutGridStyle(XSide=StyleParam.LayoutGridXSide.Bottom,YGap= 0.1) - |> Chart.withTitle("Hi i am the new SingleStackChart") - |> Chart.withXAxisStyle("im the shared xAxis") + + ChartDomainTestCharts.Sankey.``Styled sankey chart`` + |> Chart.show 0 \ No newline at end of file diff --git a/tests/CoreTests/CSharpInteroperabilityTests/LayoutObjectTests.cs b/tests/CoreTests/CSharpInteroperabilityTests/LayoutObjectTests.cs index b2081b67b..650963b9d 100644 --- a/tests/CoreTests/CSharpInteroperabilityTests/LayoutObjectTests.cs +++ b/tests/CoreTests/CSharpInteroperabilityTests/LayoutObjectTests.cs @@ -14,8 +14,8 @@ public void OptionalArgumentsAndDynamicSettingAreEqual() var actual = LinearAxis.init(Color: Color.fromString("red"), AxisType: StyleParam.AxisType.Linear); var expected = new LinearAxis(); - expected.SetValue("color", Color.fromString("red")); - expected.SetValue("type", StyleParam.AxisType.Linear.Convert()); + expected.SetProperty("color", Color.fromString("red")); + expected.SetProperty("type", StyleParam.AxisType.Linear.Convert()); Assert.Equal(expected.GetProperties(true), actual.GetProperties(true)); } diff --git a/tests/CoreTests/CoreTests/ConfigObjects/Config.fs b/tests/CoreTests/CoreTests/ConfigObjects/Config.fs index 26a6a0bf4..8ed2176b3 100644 --- a/tests/CoreTests/CoreTests/ConfigObjects/Config.fs +++ b/tests/CoreTests/CoreTests/ConfigObjects/Config.fs @@ -122,20 +122,20 @@ let ``Config API tests`` = testList "ConfigObjects.Config API" [ testCase "combine ModeBarButtonsToRemove" (fun _ -> Expect.sequenceEqual - (combined.TryGetTypedValue>("modeBarButtonsToRemove")).Value - (expectedCombined.TryGetTypedValue>("modeBarButtonsToRemove")).Value + (combined.TryGetTypedPropertyValue>("modeBarButtonsToRemove")).Value + (expectedCombined.TryGetTypedPropertyValue>("modeBarButtonsToRemove")).Value "Config.combine did not return the correct object" ) testCase "combine ModeBarButtonsToAdd" (fun _ -> Expect.sequenceEqual - (combined.TryGetTypedValue>("modeBarButtonsToAdd")).Value - (expectedCombined.TryGetTypedValue>("modeBarButtonsToAdd")).Value + (combined.TryGetTypedPropertyValue>("modeBarButtonsToAdd")).Value + (expectedCombined.TryGetTypedPropertyValue>("modeBarButtonsToAdd")).Value "Config.combine did not return the correct object" ) testCase "combine ModeBarButtons" (fun _ -> Expect.sequenceEqual - (Seq.concat (combined.TryGetTypedValue>>("modeBarButtons")).Value) - (Seq.concat (expectedCombined.TryGetTypedValue>>("modeBarButtons")).Value) + (Seq.concat (combined.TryGetTypedPropertyValue>>("modeBarButtons")).Value) + (Seq.concat (expectedCombined.TryGetTypedPropertyValue>>("modeBarButtons")).Value) "Config.combine did not return the correct object" ) ] \ No newline at end of file diff --git a/tests/CoreTests/CoreTests/FeatureAdditions/Grid_SubPlotTitles.fs b/tests/CoreTests/CoreTests/FeatureAdditions/Grid_SubPlotTitles.fs index bcb68542f..59619a44b 100644 --- a/tests/CoreTests/CoreTests/FeatureAdditions/Grid_SubPlotTitles.fs +++ b/tests/CoreTests/CoreTests/FeatureAdditions/Grid_SubPlotTitles.fs @@ -5,6 +5,7 @@ open Plotly.NET open Plotly.NET.LayoutObjects open Plotly.NET.TraceObjects +open TestUtils open TestUtils.HtmlCodegen open Grid_SubPlotTitles_TestCharts @@ -14,8 +15,8 @@ module ``Add logic for positioning subplot titles in LayoutGrid #388`` = let ``Add subplot titles`` = testList "FeatureAddition.Add subplot titles in LayoutGrid" [ test "cartesian 2x2 grid data" { - """var data = [{"type":"scatter","mode":"markers","x":[1],"y":[2],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatter","mode":"markers","x":[1],"y":[2],"marker":{},"line":{},"xaxis":"x2","yaxis":"y2"},{"type":"scatter","mode":"markers","x":[1],"y":[2],"marker":{},"line":{},"xaxis":"x3","yaxis":"y3"},{"type":"scatter","mode":"markers","x":[1],"y":[2],"marker":{},"line":{},"xaxis":"x4","yaxis":"y4"}];""" - |> chartGeneratedContains ``Add logic for positioning subplot titles in LayoutGrid #388``.``cartesian 2x2 grid with subplot titles`` + ``Add logic for positioning subplot titles in LayoutGrid #388``.``cartesian 2x2 grid with subplot titles`` + |> JsonGen.tracesJsonIs """[{"type":"scatter","mode":"markers","x":[1],"y":[2],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatter","mode":"markers","x":[1],"y":[2],"marker":{},"line":{},"xaxis":"x2","yaxis":"y2"},{"type":"scatter","mode":"markers","x":[1],"y":[2],"marker":{},"line":{},"xaxis":"x3","yaxis":"y3"},{"type":"scatter","mode":"markers","x":[1],"y":[2],"marker":{},"line":{},"xaxis":"x4","yaxis":"y4"}]""" } test "cartesian 2x2 grid layout" { """var layout = {"xaxis":{},"yaxis":{},"xaxis2":{},"yaxis2":{},"xaxis3":{},"yaxis3":{},"xaxis4":{},"yaxis4":{},"annotations":[{"x":0.22222222222222224,"y":1.0,"showarrow":false,"text":"1,1","xanchor":"center","xref":"paper","yanchor":"bottom","yref":"paper"},{"x":0.7777777777777778,"y":1.0,"showarrow":false,"text":"1,2","xanchor":"center","xref":"paper","yanchor":"bottom","yref":"paper"},{"x":0.22222222222222224,"y":0.4117647058823529,"showarrow":false,"text":"2,1","xanchor":"center","xref":"paper","yanchor":"bottom","yref":"paper"},{"x":0.7777777777777778,"y":0.4117647058823529,"showarrow":false,"text":"2,2","xanchor":"center","xref":"paper","yanchor":"bottom","yref":"paper"}],"grid":{"rows":2,"columns":2,"roworder":"top to bottom","pattern":"independent"}};""" diff --git a/tests/CoreTests/CoreTests/HTMLCodegen/ChartDomain.fs b/tests/CoreTests/CoreTests/HTMLCodegen/ChartDomain.fs index 27a5ee801..61c1a03b7 100644 --- a/tests/CoreTests/CoreTests/HTMLCodegen/ChartDomain.fs +++ b/tests/CoreTests/CoreTests/HTMLCodegen/ChartDomain.fs @@ -6,6 +6,7 @@ open Plotly.NET.LayoutObjects open Plotly.NET.TraceObjects +open TestUtils open TestUtils.HtmlCodegen open ChartDomainTestCharts @@ -155,8 +156,8 @@ module Sankey = testList "HTMLCodegen.ChartDomain" [ testList "Sankey" [ testCase "Sankey data" ( fun () -> - """var data = [{"type":"sankey","node":{"label":["A1","A2","B1","B2","C1","C2","D1"],"line":{"color":"rgba(0, 0, 0, 1.0)","width":1.0}},"link":{"color":["rgba(130, 139, 251, 1.0)","rgba(130, 139, 251, 1.0)","rgba(242, 119, 98, 1.0)","rgba(51, 214, 171, 1.0)","rgba(188, 130, 251, 1.0)","rgba(188, 130, 251, 1.0)","rgba(255, 180, 123, 1.0)","rgba(71, 220, 245, 1.0)"],"line":{"color":"rgba(0, 0, 0, 1.0)","width":1.0},"source":[0,0,1,2,3,3,4,5],"target":[2,3,3,4,4,5,6,6],"value":[8,4,2,7,3,2,5,2]}}];""" - |> chartGeneratedContains Sankey.``Styled sankey chart`` + Sankey.``Styled sankey chart`` + |> JsonGen.tracesJsonIs """[{"type":"sankey","node":{"label":["A1","A2","B1","B2","C1","C2","D1"],"line":{"color":"rgba(0, 0, 0, 1.0)","width":1.0}},"link":{"color":["rgba(130, 139, 251, 1.0)","rgba(130, 139, 251, 1.0)","rgba(242, 119, 98, 1.0)","rgba(51, 214, 171, 1.0)","rgba(188, 130, 251, 1.0)","rgba(188, 130, 251, 1.0)","rgba(255, 180, 123, 1.0)","rgba(71, 220, 245, 1.0)"],"line":{"color":"rgba(0, 0, 0, 1.0)","width":1.0},"source":[0,0,1,2,3,3,4,5],"target":[2,3,3,4,4,5,6,6],"value":[8,4,2,7,3,2,5,2]}}]""" ) testCase "Sankey layout" ( fun () -> emptyLayout Sankey.``Styled sankey chart`` diff --git a/tests/CoreTests/CoreTests/LayoutObjects/Layout.fs b/tests/CoreTests/CoreTests/LayoutObjects/Layout.fs index 6d4cf0ba5..cf648f0dd 100644 --- a/tests/CoreTests/CoreTests/LayoutObjects/Layout.fs +++ b/tests/CoreTests/CoreTests/LayoutObjects/Layout.fs @@ -204,44 +204,44 @@ let ``Layout combine API tests`` = testList "LayoutObjects.Layout API" [ testCase "combine Annotations" (fun _ -> Expect.sequenceEqual - (combined.TryGetTypedValue>("annotations")).Value - (expectedCombined.TryGetTypedValue>("annotations")).Value + (combined.TryGetTypedPropertyValue>("annotations")).Value + (expectedCombined.TryGetTypedPropertyValue>("annotations")).Value "Layout.combine did not return the correct object" ) testCase "combine Shapes" (fun _ -> Expect.sequenceEqual - (combined.TryGetTypedValue>("shapes")).Value - (expectedCombined.TryGetTypedValue>("shapes")).Value + (combined.TryGetTypedPropertyValue>("shapes")).Value + (expectedCombined.TryGetTypedPropertyValue>("shapes")).Value "Layout.combine did not return the correct object" ) testCase "combine Selections" (fun _ -> Expect.sequenceEqual - (combined.TryGetTypedValue>("selections")).Value - (expectedCombined.TryGetTypedValue>("selections")).Value + (combined.TryGetTypedPropertyValue>("selections")).Value + (expectedCombined.TryGetTypedPropertyValue>("selections")).Value "Layout.combine did not return the correct object" ) testCase "combine Images" (fun _ -> Expect.sequenceEqual - (combined.TryGetTypedValue>("images")).Value - (expectedCombined.TryGetTypedValue>("images")).Value + (combined.TryGetTypedPropertyValue>("images")).Value + (expectedCombined.TryGetTypedPropertyValue>("images")).Value "Layout.combine did not return the correct object" ) testCase "combine Sliders" (fun _ -> Expect.sequenceEqual - (combined.TryGetTypedValue>("sliders")).Value - (expectedCombined.TryGetTypedValue>("sliders")).Value + (combined.TryGetTypedPropertyValue>("sliders")).Value + (expectedCombined.TryGetTypedPropertyValue>("sliders")).Value "Layout.combine did not return the correct object" ) testCase "combine HiddenLabels" (fun _ -> Expect.sequenceEqual - (combined.TryGetTypedValue>("hiddenlabels")).Value - (expectedCombined.TryGetTypedValue>("hiddenlabels")).Value + (combined.TryGetTypedPropertyValue>("hiddenlabels")).Value + (expectedCombined.TryGetTypedPropertyValue>("hiddenlabels")).Value "Layout.combine did not return the correct object" ) testCase "combine UpdateMenus" (fun _ -> Expect.sequenceEqual - (combined.TryGetTypedValue>("updatemenus")).Value - (expectedCombined.TryGetTypedValue>("updatemenus")).Value + (combined.TryGetTypedPropertyValue>("updatemenus")).Value + (expectedCombined.TryGetTypedPropertyValue>("updatemenus")).Value "Layout.combine did not return the correct object" ) ] diff --git a/tests/CoreTests/CoreTests/Traces/TraceStaticMembers.fs b/tests/CoreTests/CoreTests/Traces/TraceStaticMembers.fs index 2693b4c20..fbc0b9756 100644 --- a/tests/CoreTests/CoreTests/Traces/TraceStaticMembers.fs +++ b/tests/CoreTests/CoreTests/Traces/TraceStaticMembers.fs @@ -87,7 +87,7 @@ let ``TraceStyle tests`` = ) let colorAxisAnchor = StyleParam.SubPlotId.ColorAxis 69 - let colorAxisAnchorTrace = Trace2D.initScatter(Trace2DStyle.Heatmap(ColorAxis = colorAxisAnchor)) + let colorAxisAnchorTrace = Trace2D.initHeatmap(Trace2DStyle.Heatmap(ColorAxis = colorAxisAnchor)) testCase "getColorAxisAnchor" (fun _ -> Expect.equal diff --git a/tests/ExtensionLibsTests/CSharpTests/ExtensionMethodsTests.cs b/tests/ExtensionLibsTests/CSharpTests/ExtensionMethodsTests.cs index 89fbd3106..5167d6a05 100644 --- a/tests/ExtensionLibsTests/CSharpTests/ExtensionMethodsTests.cs +++ b/tests/ExtensionLibsTests/CSharpTests/ExtensionMethodsTests.cs @@ -18,7 +18,7 @@ public void CanUseCSharpExtensionMethod() .GetTraces() [0]; - Assert.Equal("Trace Name", DynamicObj.DynamicObj.GetValue(actual,"name")); + Assert.Equal("Trace Name", actual.GetPropertyValue("name")); } [Fact]