From b84581dbf59601da3c45cf2cc0ae8eb10ac8c5c2 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Tue, 15 Oct 2024 13:56:09 +0200 Subject: [PATCH] port traceternary to dynobj v4 --- src/Plotly.NET/Traces/TraceTernary.fs | 83 ++++++++++++--------------- 1 file changed, 38 insertions(+), 45 deletions(-) diff --git a/src/Plotly.NET/Traces/TraceTernary.fs b/src/Plotly.NET/Traces/TraceTernary.fs index 3b799b75..3d83b272 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.setOptionalPropertyBy 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.setOptionalProperty trace "name" - Visible |> DynObj.setOptionalPropertyBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setOptionalProperty trace "showlegend" - Legend |> DynObj.setOptionalPropertyBy trace "legend" StyleParam.SubPlotId.convert - LegendRank |> DynObj.setOptionalProperty trace "legendrank" - LegendGroup |> DynObj.setOptionalProperty trace "legendgroup" - LegendGroupTitle |> DynObj.setOptionalProperty trace "legendgrouptitle" - Opacity |> DynObj.setOptionalProperty trace "opacity" - Mode |> DynObj.setOptionalPropertyBy trace "mode" StyleParam.Mode.convert - Ids |> DynObj.setOptionalProperty trace "ids" - A |> DynObj.setOptionalProperty trace "a" - B |> DynObj.setOptionalProperty trace "b" - C |> DynObj.setOptionalProperty trace "c" - (Text, MultiText) |> DynObj.setOptionalSingleOrMultiProperty trace "text" - - (TextPosition, MultiTextPosition) - |> DynObj.setOptionalSingleOrMultiPropertyBy trace "textposition" StyleParam.TextPosition.convert - - (TextTemplate, MultiTextTemplate) |> DynObj.setOptionalSingleOrMultiProperty trace "texttemplate" - (HoverText, MultiHoverText) |> DynObj.setOptionalSingleOrMultiProperty trace "hovertext" - HoverInfo |> DynObj.setOptionalPropertyBy trace "hoverinfo" StyleParam.HoverInfo.convert - (HoverTemplate, MultiHoverTemplate) |> DynObj.setOptionalSingleOrMultiProperty trace "hovertemplate" - Meta |> DynObj.setOptionalProperty trace "meta" - CustomData |> DynObj.setOptionalProperty trace "customdata" - SubPlot |> DynObj.setOptionalPropertyBy trace "subplot" StyleParam.SubPlotId.convert - Marker |> DynObj.setOptionalProperty trace "marker" - Line |> DynObj.setOptionalProperty trace "line" - TextFont |> DynObj.setOptionalProperty trace "textfont" - SelectedPoints |> DynObj.setOptionalProperty trace "selectedpoints" - Selected |> DynObj.setOptionalProperty trace "selected" - Unselected |> DynObj.setOptionalProperty trace "unselected" - ClipOnAxis |> DynObj.setOptionalProperty trace "cliponaxis" - ConnectGaps |> DynObj.setOptionalProperty trace "connectgaps" - Fill |> DynObj.setOptionalPropertyBy trace "fill" StyleParam.Fill.convert - FillColor |> DynObj.setOptionalProperty trace "fillcolor" - HoverLabel |> DynObj.setOptionalProperty trace "hoverlabel" - HoverOn |> DynObj.setOptionalPropertyBy trace "hoveron" StyleParam.HoverOn.convert - Sum |> DynObj.setOptionalProperty trace "sum" - UIRevision |> DynObj.setOptionalProperty 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