Skip to content

Commit

Permalink
port traceternary to dynobj v4
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Oct 15, 2024
1 parent 0e9fbbc commit b84581d
Showing 1 changed file with 38 additions and 45 deletions.
83 changes: 38 additions & 45 deletions src/Plotly.NET/Traces/TraceTernary.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ type TraceTernary(traceTypeName) =
type TraceTernaryStyle() =

static member SetTernary([<Optional; DefaultParameterValue(null)>] ?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

/// <summary>
/// Create a function that applies the styles of a ternary scatter plot to a Trace object
Expand Down Expand Up @@ -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

0 comments on commit b84581d

Please sign in to comment.