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

Fixing the coord_polar bugs in graphics dialog #5541

Merged
merged 15 commits into from
Oct 22, 2019
Merged
10 changes: 7 additions & 3 deletions instat/dlgBarAndPieChart.vb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Public Class dlgBarAndPieChart
Private bFirstLoad As Boolean = True
Private bResetSubdialog As Boolean = True
Private bResetBarLayerSubdialog As Boolean = True
Private clsCoordPolarFunction As New RFunction
Private clsCoordPolarStartOperator As New ROperator


Private Sub cmdOptions_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
Expand Down Expand Up @@ -161,10 +164,11 @@ Public Class dlgBarAndPieChart
clsYScalecontinuousFunction = GgplotDefaults.clsYScalecontinuousFunction.Clone
clsRFacetFunction = GgplotDefaults.clsFacetFunction.Clone()
clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone())
clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone()
clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone()
clsThemeFuction = GgplotDefaults.clsDefaultThemeFunction.Clone
dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions)
clsLocalRaesFunction = GgplotDefaults.clsAesFunction.Clone()

clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrBarChartSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph")
ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator)
End Sub
Expand Down Expand Up @@ -198,9 +202,9 @@ Public Class dlgBarAndPieChart

Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click
If rdoBarChart.Checked Then
sdgPlots.SetRCode(clsNewOperator:=clsBaseOperator, clsNewGlobalAesFunction:=clsBarAesFunction, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewThemeFunction:=clsThemeFuction, dctNewThemeFunctions:=dctThemeFunctions, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrBarChartSelector, bReset:=bResetSubdialog)
sdgPlots.SetRCode(clsNewOperator:=clsBaseOperator, clsNewGlobalAesFunction:=clsBarAesFunction, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewThemeFunction:=clsThemeFuction, dctNewThemeFunctions:=dctThemeFunctions, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrBarChartSelector, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetSubdialog)
Else
sdgPlots.SetRCode(clsNewOperator:=clsBaseOperator, clsNewGlobalAesFunction:=clsPieAesFunction, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewThemeFunction:=clsThemeFuction, dctNewThemeFunctions:=dctThemeFunctions, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrBarChartSelector, bReset:=bResetSubdialog)
sdgPlots.SetRCode(clsNewOperator:=clsBaseOperator, clsNewGlobalAesFunction:=clsPieAesFunction, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewThemeFunction:=clsThemeFuction, dctNewThemeFunctions:=dctThemeFunctions, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrBarChartSelector, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetSubdialog)
End If
sdgPlots.ShowDialog()
bResetSubdialog = False
Expand Down
10 changes: 8 additions & 2 deletions instat/dlgClimaticBoxPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Public Class dlgClimaticBoxPlot
Private bUpdatingParameters As Boolean = False
Private dctComboReceiver As New Dictionary(Of ucrInputComboBox, ucrReceiverSingle)

Private clsCoordPolarFunction As New RFunction
Private clsCoordPolarStartOperator As New ROperator

Private Sub dlgClimaticBoxPlot_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
InitialiseDialog()
Expand Down Expand Up @@ -266,7 +269,9 @@ Public Class dlgClimaticBoxPlot
clsLabsFunction = GgplotDefaults.clsDefaultLabs.Clone()
clsXScaleContinuousFunction = GgplotDefaults.clsXScalecontinuousFunction.Clone()
clsYScaleContinuousFunction = GgplotDefaults.clsYScalecontinuousFunction.Clone()
clsYlabFunction = GgplotDefaults.clsYlabTitleFunction.Clone
clsYlabFunction = GgplotDefaults.clsYlabTitleFunction.Clone()
clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone()
clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone()
clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction.Clone()
dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions)
clsLocalRaesFunction = GgplotDefaults.clsAesFunction.Clone()
Expand Down Expand Up @@ -315,7 +320,8 @@ Public Class dlgClimaticBoxPlot
End Sub

Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click
sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsFacetFunction, ucrNewBaseSelector:=ucrSelectorClimaticBoxPlot, bReset:=bResetSubdialog)
sdgPlots.SetRCode(clsBaseOperator, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator,
clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsFacetFunction, ucrNewBaseSelector:=ucrSelectorClimaticBoxPlot, bReset:=bResetSubdialog)
'this is a temporary fix because we have facets done on the main dialog
sdgPlots.tbpFacet.Enabled = False
sdgPlots.ShowDialog()
Expand Down
7 changes: 6 additions & 1 deletion instat/dlgClimaticStationMaps.vb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
Imports instat.Translations
Public Class dlgClimaticStationMaps
Private bFirstLoad As Boolean = True
Private clsCoordPolarFunction As New RFunction
Private clsCoordPolarStartOperator As New ROperator
Private bReset As Boolean = True
Private clsGgplotFunction, clsGeomSfFunction, clsGeomPointFunction, clsSfAesFunction, clsGeomPointAesFunction, clsFacetFunction, clsScaleShapeFunction, clsLabelRepelFunction As RFunction
Private clsGGplotOperator, clsFacetOp As New ROperator
Expand Down Expand Up @@ -182,6 +184,8 @@ Public Class dlgClimaticStationMaps
clsRFacetFunction = GgplotDefaults.clsFacetFunction.Clone()
clsYlabFunction = GgplotDefaults.clsYlabTitleFunction.Clone
clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction.Clone()
clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone()
clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone()
dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions)
clsLocalRaesFunction = GgplotDefaults.clsAesFunction.Clone()

Expand All @@ -193,7 +197,8 @@ Public Class dlgClimaticStationMaps
End Sub

Private Sub cmdPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdPlotOptions.Click
sdgPlots.SetRCode(clsGGplotOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsSfAesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrSelectorStation, bReset:=bResetSubdialog)
sdgPlots.SetRCode(clsGGplotOperator,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsSfAesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrSelectorStation, bReset:=bResetSubdialog)
sdgPlots.ShowDialog()
bResetSubdialog = False
End Sub
Expand Down
6 changes: 5 additions & 1 deletion instat/dlgCountryColouredMap.vb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Public Class dlgCountryColouredMap

Private bResetLayerSubdialog As Boolean = True
Private bResetMapOptions As Boolean = True
Private clsCoordPolarFunction As New RFunction
Private clsCoordPolarStartOperator As New ROperator

Private Sub dlgCountryColouredMap_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
Expand Down Expand Up @@ -177,6 +179,8 @@ Public Class dlgCountryColouredMap
clsYScaleContinuousFunction = GgplotDefaults.clsYScalecontinuousFunction.Clone()
clsRFacetFunction = GgplotDefaults.clsFacetFunction.Clone()
clsYlabFunction = GgplotDefaults.clsYlabTitleFunction.Clone
clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone()
clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone()
clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction.Clone()
dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions)
clsLocalRaesFunction = GgplotDefaults.clsAesFunction.Clone()
Expand Down Expand Up @@ -209,7 +213,7 @@ Public Class dlgCountryColouredMap
TestOKEnabled()
End Sub
Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdPlotOptions.Click
sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunc, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrSelectorCountryColouredMap, bReset:=bResetSubDialog)
sdgPlots.SetRCode(clsBaseOperator, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunc, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrSelectorCountryColouredMap, bReset:=bResetSubDialog)
bResetSubDialog = False
sdgPlots.ShowDialog()
End Sub
Expand Down
18 changes: 13 additions & 5 deletions instat/dlgCumulativeDistribution.vb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Public Class dlgCumulativeDistribution
Private clsBaseOperator As New ROperator
Private bFirstLoad As Boolean = True
Private clsLabsFunction As New RFunction
Private clsThemeFunction As New RFunction
Private clsXlabsFunction As New RFunction
Private clsYlabFunction As New RFunction
Private clsXScalecontinuousFunction As New RFunction
Expand All @@ -30,7 +31,12 @@ Public Class dlgCumulativeDistribution
Private bResetSubdialog As Boolean = True
Private dctThemeFunctions As New Dictionary(Of String, RFunction)
Private bReset As Boolean = True

Private clsCoordPolarFunction As New RFunction
Private clsCoordPolarStartOperator As New ROperator
'Parameter names for geoms
Private strFirstParameterName As String = "geomfunc"
Private strPointsParameterName As String = "geom_point"
Private strGeomParameterNames() As String = {strFirstParameterName, strPointsParameterName}
Private Sub dlgCumulativeDistribution_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
InitaliseDialog()
Expand Down Expand Up @@ -89,7 +95,7 @@ Public Class dlgCumulativeDistribution
clsGeomPointFunc.SetPackageName("ggplot2")
clsGeomPointFunc.SetRCommand("geom_point")
clsGeomPointFunc.AddParameter("stat", Chr(34) & "ecdf" & Chr(34))
clsGeomPointParam.SetArgumentName("geom_point")
clsGeomPointParam.SetArgumentName(strPointsParameterName)
clsGeomPointParam.SetArgument(clsGeomPointFunc)
ucrChkIncludePoints.SetText("Include Points")
ucrChkIncludePoints.SetParameter(clsGeomPointParam, bNewChangeParameterValue:=False, bNewAddRemoveParameter:=True)
Expand Down Expand Up @@ -118,7 +124,7 @@ Public Class dlgCumulativeDistribution

clsBaseOperator.SetOperation("+")
clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0)
clsBaseOperator.AddParameter("stat_ecdf", clsRFunctionParameter:=clsRgeomCumDistFunction, iPosition:=2)
clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsRgeomCumDistFunction, iPosition:=2)

clsRggplotFunction.SetPackageName("ggplot2")
clsRggplotFunction.SetRCommand("ggplot")
Expand All @@ -137,8 +143,10 @@ Public Class dlgCumulativeDistribution
clsYScalecontinuousFunction = GgplotDefaults.clsYScalecontinuousFunction.Clone
clsRFacetFunction = GgplotDefaults.clsFacetFunction.Clone()
clsYlabFunction = GgplotDefaults.clsYlabTitleFunction.Clone
clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone()
clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone()
clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction.Clone()
dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions)

clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrCumDistSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph")
ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator)
End Sub
Expand Down Expand Up @@ -167,7 +175,7 @@ Public Class dlgCumulativeDistribution
End Sub

Private Sub cmdPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdPlotOptions.Click
sdgPlots.SetRCode(clsBaseOperator, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrCumDistSelector, bReset:=bResetSubdialog)
sdgPlots.SetRCode(clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrCumDistSelector, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog)
sdgPlots.ShowDialog()
bResetSubdialog = False
End Sub
Expand Down
6 changes: 5 additions & 1 deletion instat/dlgDotPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Public Class dlgDotPlot
Private bEditAesFunction As Boolean
Private clsLocalRaesFunction As New RFunction
Private bResetDotLayerSubdialog As Boolean = True
Private clsCoordPolarFunction As New RFunction
Private clsCoordPolarStartOperator As New ROperator

Private Sub dlgDotPlot_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
Expand Down Expand Up @@ -155,6 +157,8 @@ Public Class dlgDotPlot
clsXScalecontinuousFunction = GgplotDefaults.clsXScalecontinuousFunction.Clone()
clsYScalecontinuousFunction = GgplotDefaults.clsYScalecontinuousFunction.Clone
clsRFacetFunction = GgplotDefaults.clsFacetFunction.Clone()
clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone()
clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone()
dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions)
clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction
clsLocalRaesFunction = GgplotDefaults.clsAesFunction.Clone()
Expand Down Expand Up @@ -206,7 +210,7 @@ Public Class dlgDotPlot
End Sub

Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click
sdgPlots.SetRCode(clsBaseOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, ucrNewBaseSelector:=ucrDotPlotSelector, bReset:=bResetSubdialog)
sdgPlots.SetRCode(clsBaseOperator, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewGlobalAesFunction:=clsRaesFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, ucrNewBaseSelector:=ucrDotPlotSelector, bReset:=bResetSubdialog)
sdgPlots.ShowDialog()
bResetSubdialog = False
End Sub
Expand Down
Loading