Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to DynamicObj v4 #472

Merged
merged 18 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
port tracesmith to dynobj v4
  • Loading branch information
kMutagene committed Oct 15, 2024
commit 0e9fbbcf003cebe9f2302d65329678399a2fb073
79 changes: 36 additions & 43 deletions src/Plotly.NET/Traces/TraceSmith.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ type TraceSmith(traceTypeName) =
type TraceSmithStyle() =

static member SetSmith([<Optional; DefaultParameterValue(null)>] ?SmithId: StyleParam.SubPlotId) =
(fun (trace: TraceSmith) ->
fun (trace: TraceSmith) ->
trace |> DynObj.setOptionalPropertyBy "subplot" SmithId StyleParam.SubPlotId.toString

SmithId |> DynObj.setOptionalPropertyBy trace "subplot" StyleParam.SubPlotId.toString

trace)

/// <summary>
/// Create a function that applies the styles of a scatter smith plot to a Trace object
Expand Down Expand Up @@ -108,43 +106,38 @@ type TraceSmithStyle() =
[<Optional; DefaultParameterValue(null)>] ?UIRevision: string
) =
fun (trace: ('T :> 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"
Imag |> DynObj.setOptionalProperty trace "imag"
Real |> DynObj.setOptionalProperty trace "real"
(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.setOptionalProperty trace "subplot"
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
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 "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