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 tracegeo to dynobj v4
  • Loading branch information
kMutagene committed Oct 15, 2024
commit 300eab31fdc76a3cc04edba06492a221115ab1a5
163 changes: 77 additions & 86 deletions src/Plotly.NET/Traces/TraceGeo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ type TraceGeo(traceTypeName) =
type TraceGeoStyle() =

static member SetGeo([<Optional; DefaultParameterValue(null)>] ?GeoId: StyleParam.SubPlotId) =
(fun (trace: TraceGeo) ->
fun (trace: TraceGeo) ->
trace |> DynObj.withOptionalPropertyBy "geo" GeoId StyleParam.SubPlotId.toString

GeoId |> DynObj.setOptionalPropertyBy trace "geo" StyleParam.SubPlotId.toString

trace)

/// <summary>
/// Creates a function that applies the styles of a choropleth map to a Trace object
Expand Down Expand Up @@ -129,46 +127,45 @@ type TraceGeoStyle() =
[<Optional; DefaultParameterValue(null)>] ?LocationMode: StyleParam.LocationFormat,
[<Optional; DefaultParameterValue(null)>] ?UIRevision: string
) =
(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"
Ids |> DynObj.setOptionalProperty trace "ids"
Z |> DynObj.setOptionalProperty trace "z"
GeoJson |> DynObj.setOptionalProperty trace "geojson"
FeatureIdKey |> DynObj.setOptionalProperty trace "featureidkey"
Locations |> DynObj.setOptionalProperty trace "locations"
(Text, MultiText) |> DynObj.setOptionalSingleOrMultiProperty trace "text"
(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"
Geo |> DynObj.setOptionalPropertyBy trace "geo" StyleParam.SubPlotId.convert
ColorAxis |> DynObj.setOptionalPropertyBy trace "coloraxis" StyleParam.SubPlotId.convert
Marker |> DynObj.setOptionalProperty trace "marker"
ColorBar |> DynObj.setOptionalProperty trace "colorbar"
AutoColorScale |> DynObj.setOptionalProperty trace "autocolorscale"
ColorScale |> DynObj.setOptionalPropertyBy trace "colorscale" StyleParam.Colorscale.convert
ShowScale |> DynObj.setOptionalProperty trace "showscale"
ReverseScale |> DynObj.setOptionalProperty trace "reversescale"
ZAuto |> DynObj.setOptionalProperty trace "zauto"
Zmin |> DynObj.setOptionalProperty trace "zmin"
Zmid |> DynObj.setOptionalProperty trace "zmid"
Zmax |> DynObj.setOptionalProperty trace "zmax"
SelectedPoints |> DynObj.setOptionalProperty trace "selectedpoints"
Selected |> DynObj.setOptionalProperty trace "selected"
Unselected |> DynObj.setOptionalProperty trace "unselected"
HoverLabel |> DynObj.setOptionalProperty trace "hoverlabel"
LocationMode |> DynObj.setOptionalPropertyBy trace "locationmode" StyleParam.LocationFormat.convert
UIRevision |> DynObj.setOptionalProperty 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

/// <summary>
/// Creates a function that applies the styles of a scattergeo plot to a Trace object
Expand Down Expand Up @@ -258,48 +255,42 @@ type TraceGeoStyle() =
[<Optional; DefaultParameterValue(null)>] ?LocationMode: StyleParam.LocationFormat,
[<Optional; DefaultParameterValue(null)>] ?UIRevision: string
) =
(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"
Lat |> DynObj.setOptionalProperty trace "lat"
GeoJson |> DynObj.setOptionalProperty trace "geojson"
FeatureIdKey |> DynObj.setOptionalProperty trace "featureidkey"
Locations |> DynObj.setOptionalProperty trace "locations"
Lon |> DynObj.setOptionalProperty trace "lon"
(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"
Geo |> DynObj.setOptionalPropertyBy trace "geo" 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"
ConnectGaps |> DynObj.setOptionalProperty trace "connectgaps"
Fill |> DynObj.setOptionalPropertyBy trace "fill" StyleParam.Fill.convert
FillColor |> DynObj.setOptionalProperty trace "fillcolor"
HoverLabel |> DynObj.setOptionalProperty trace "hoverlabel"
LocationMode |> DynObj.setOptionalPropertyBy trace "locationmode" StyleParam.LocationFormat.convert
UIRevision |> DynObj.setOptionalProperty 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