Skip to content

Commit

Permalink
Merge pull request #457 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Upddating
  • Loading branch information
maxwellfundi authored May 31, 2019
2 parents 745879d + d2c56b4 commit 82d97de
Show file tree
Hide file tree
Showing 11 changed files with 389 additions and 343 deletions.
3 changes: 2 additions & 1 deletion instat/dlgBarAndPieChart.vb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Public Class dlgBarAndPieChart
dctPositionPairs.Add("Identity", Chr(34) & "identity" & Chr(34))
dctPositionPairs.Add("Jitter", Chr(34) & "jitter" & Chr(34))
dctPositionPairs.Add("Fill", Chr(34) & "fill" & Chr(34))
dctPositionPairs.Add("Stack in reverse", "position_stack(reverse = TRUE)")
ucrInputBarChartPosition.SetItems(dctPositionPairs)
ucrInputBarChartPosition.SetDropDownStyleAsNonEditable()
ucrInputBarChartPosition.SetRDefault(Chr(34) & "stack" & Chr(34))
Expand Down Expand Up @@ -282,4 +283,4 @@ Public Class dlgBarAndPieChart
Private Sub CoreControls_ContentsChanged() Handles ucrReceiverFirst.ControlContentsChanged, ucrSaveBar.ControlContentsChanged
TestOkEnabled()
End Sub
End Class
End Class
335 changes: 195 additions & 140 deletions instat/dlgClimaticStationMaps.Designer.vb

Large diffs are not rendered by default.

42 changes: 37 additions & 5 deletions instat/dlgClimaticStationMaps.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Imports instat.Translations
Public Class dlgClimaticStationMaps
Private bFirstLoad As Boolean = True
Private bReset As Boolean = True
Private clsGgplotFunction, clsGeomSfFunction, clsGeomPointFunction, clsSfAesFunction, clsGeomPointAesFunction, clsFacetFunction, clsScaleShapeFunction As RFunction
Private clsGgplotFunction, clsGeomSfFunction, clsGeomPointFunction, clsSfAesFunction, clsGeomPointAesFunction, clsFacetFunction, clsScaleShapeFunction, clsLabelRepelFunction As RFunction
Private clsGGplotOperator, clsFacetOp As New ROperator

Private clsLabsFunction As New RFunction
Expand All @@ -33,6 +33,7 @@ Public Class dlgClimaticStationMaps
Private clsLocalRaesFunction As New RFunction
Private bResetSubdialog As Boolean = True
Private bResetSFLayerSubdialog As Boolean = True
Private clsLabelRepelAesFunction As New RFunction

Private Sub dlgClimaticMaps_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
Expand Down Expand Up @@ -94,6 +95,11 @@ Public Class dlgClimaticStationMaps
ucrReceiverFacet.SetParameterIsString()
ucrReceiverFacet.bWithQuotes = False

ucrReceiverStation.SetParameter(New RParameter("label", 2))
ucrReceiverStation.Selector = ucrSelectorStation
ucrReceiverStation.SetParameterIsString()
ucrReceiverStation.bWithQuotes = False

ucrSaveMap.SetPrefix("Map")
ucrSaveMap.SetSaveTypeAsGraph()
ucrSaveMap.SetIsComboBox()
Expand All @@ -111,6 +117,8 @@ Public Class dlgClimaticStationMaps
clsGeomPointAesFunction = New RFunction
clsFacetFunction = New RFunction
clsScaleShapeFunction = New RFunction
clsLabelRepelFunction = New RFunction
clsLabelRepelAesFunction = New RFunction

clsGGplotOperator = New ROperator
clsXlimFunction = New RFunction
Expand All @@ -130,14 +138,14 @@ Public Class dlgClimaticStationMaps

clsGeomSfFunction.SetPackageName("ggplot2")
clsGeomSfFunction.SetRCommand("geom_sf")
clsGeomSfFunction.AddParameter("aes", clsRFunctionParameter:=clsSfAesFunction, bIncludeArgumentName:=False, iPosition:=1)
clsGeomSfFunction.AddParameter("mapping", clsRFunctionParameter:=clsSfAesFunction, iPosition:=1)

clsSfAesFunction.SetPackageName("ggplot2")
clsSfAesFunction.SetRCommand("aes")

clsGeomPointFunction.SetPackageName("ggplot2")
clsGeomPointFunction.SetRCommand("geom_point")
clsGeomPointFunction.AddParameter("aes", clsRFunctionParameter:=clsGeomPointAesFunction, bIncludeArgumentName:=False, iPosition:=1)
clsGeomPointFunction.AddParameter("mapping", clsRFunctionParameter:=clsGeomPointAesFunction,iPosition:=1)

clsGeomPointAesFunction.SetPackageName("ggplot2")
clsGeomPointAesFunction.SetRCommand("aes")
Expand All @@ -154,6 +162,14 @@ Public Class dlgClimaticStationMaps
clsFacetFunction.SetRCommand("facet_wrap")
clsFacetFunction.AddParameter("facet", clsROperatorParameter:=clsFacetOp, bIncludeArgumentName:=False)

clsLabelRepelFunction.SetPackageName("ggrepel")
clsLabelRepelFunction.SetRCommand("geom_label_repel")

clsLabelRepelAesFunction.SetPackageName("ggplot2")
clsLabelRepelAesFunction.SetRCommand("aes")
clsLabelRepelFunction.AddParameter("mapping", clsRFunctionParameter:=clsLabelRepelAesFunction,iPosition:=1)


clsGGplotOperator.SetOperation("+")
clsGGplotOperator.AddParameter("ggplot", clsRFunctionParameter:=clsGgplotFunction, bIncludeArgumentName:=False, iPosition:=0)
clsGGplotOperator.AddParameter("geom_sf", clsRFunctionParameter:=clsGeomSfFunction, bIncludeArgumentName:=False, iPosition:=1)
Expand Down Expand Up @@ -183,6 +199,10 @@ Public Class dlgClimaticStationMaps
End Sub

Private Sub SetRCodeForControls(bReset As Boolean)
ucrReceiverLongitude.AddAdditionalCodeParameterPair(clsLabelRepelAesFunction, ucrReceiverLongitude.GetParameter())
ucrReceiverLatitude.AddAdditionalCodeParameterPair(clsLabelRepelAesFunction, ucrReceiverLatitude.GetParameter())
ucrSelectorStation.AddAdditionalCodeParameterPair(clsLabelRepelFunction, ucrSelectorStation.GetParameter())

ucrSelectorOutline.SetRCode(clsGeomSfFunction, bReset)
ucrReceiverFill.SetRCode(clsSfAesFunction, bReset)
ucrSaveMap.SetRCode(clsGGplotOperator, bReset)
Expand All @@ -192,6 +212,8 @@ Public Class dlgClimaticStationMaps
ucrReceiverShape.SetRCode(clsGeomPointAesFunction, bReset)
ucrReceiverColor.SetRCode(clsGeomPointAesFunction, bReset)
ucrReceiverFacet.SetRCode(clsFacetOp, bReset)

ucrReceiverStation.SetRCode(clsLabelRepelAesFunction, bReset)
End Sub

Private Sub cmdSFOptions_Click(sender As Object, e As EventArgs) Handles cmdSFOptions.Click
Expand Down Expand Up @@ -220,6 +242,8 @@ Public Class dlgClimaticStationMaps
bOkEnabled = False
ElseIf ucrReceiverLongitude.IsEmpty AndAlso Not ucrReceiverLatitude.IsEmpty Then
bOkEnabled = False
ElseIf Not ucrReceiverStation.IsEmpty AndAlso ucrReceiverLongitude.IsEmpty AndAlso ucrReceiverLatitude.IsEmpty Then
bOkEnabled = False
Else
bOkEnabled = True
End If
Expand Down Expand Up @@ -247,7 +271,7 @@ Public Class dlgClimaticStationMaps
End If
End Sub

Private Sub ucrReceiverFill_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFill.ControlContentsChanged, ucrReceiverLongitude.ControlContentsChanged, ucrReceiverLatitude.ControlContentsChanged, ucrSaveMap.ControlContentsChanged
Private Sub ucrReceiverFill_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFill.ControlContentsChanged, ucrReceiverLongitude.ControlContentsChanged, ucrReceiverLatitude.ControlContentsChanged, ucrSaveMap.ControlContentsChanged, ucrReceiverStation.ControlContentsChanged
TestOkEnabled()
End Sub

Expand All @@ -258,4 +282,12 @@ Public Class dlgClimaticStationMaps
clsGGplotOperator.RemoveParameterByName("facets")
End If
End Sub
End Class

Private Sub ucrReceiverStation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlValueChanged
If Not ucrReceiverStation.IsEmpty Then
clsGGplotOperator.AddParameter("geom_label_repel", clsRFunctionParameter:=clsLabelRepelFunction, bIncludeArgumentName:=False, iPosition:=2)
Else
clsGGplotOperator.RemoveParameterByName("geom_label_repel")
End If
End Sub
End Class
182 changes: 49 additions & 133 deletions instat/dlgCorrelation.resx
Original file line number Diff line number Diff line change
Expand Up @@ -173,78 +173,6 @@
<data name="&gt;&gt;lblSecondColumn.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="&gt;&gt;rdoKendall.Name" xml:space="preserve">
<value>rdoKendall</value>
</data>
<data name="&gt;&gt;rdoKendall.Type" xml:space="preserve">
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;rdoKendall.Parent" xml:space="preserve">
<value>grpMethod</value>
</data>
<data name="&gt;&gt;rdoKendall.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;rdoPearson.Name" xml:space="preserve">
<value>rdoPearson</value>
</data>
<data name="&gt;&gt;rdoPearson.Type" xml:space="preserve">
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;rdoPearson.Parent" xml:space="preserve">
<value>grpMethod</value>
</data>
<data name="&gt;&gt;rdoPearson.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;rdoSpearman.Name" xml:space="preserve">
<value>rdoSpearman</value>
</data>
<data name="&gt;&gt;rdoSpearman.Type" xml:space="preserve">
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;rdoSpearman.Parent" xml:space="preserve">
<value>grpMethod</value>
</data>
<data name="&gt;&gt;rdoSpearman.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;ucrPnlMethod.Name" xml:space="preserve">
<value>ucrPnlMethod</value>
</data>
<data name="&gt;&gt;ucrPnlMethod.Type" xml:space="preserve">
<value>instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;ucrPnlMethod.Parent" xml:space="preserve">
<value>grpMethod</value>
</data>
<data name="&gt;&gt;ucrPnlMethod.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="grpMethod.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 232</value>
</data>
<data name="grpMethod.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 45</value>
</data>
<data name="grpMethod.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="grpMethod.Text" xml:space="preserve">
<value>Method</value>
</data>
<data name="&gt;&gt;grpMethod.Name" xml:space="preserve">
<value>grpMethod</value>
</data>
<data name="&gt;&gt;grpMethod.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;grpMethod.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;grpMethod.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="rdoKendall.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
Expand Down Expand Up @@ -347,6 +275,30 @@
<data name="&gt;&gt;ucrPnlMethod.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="grpMethod.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 232</value>
</data>
<data name="grpMethod.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 45</value>
</data>
<data name="grpMethod.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="grpMethod.Text" xml:space="preserve">
<value>Method</value>
</data>
<data name="&gt;&gt;grpMethod.Name" xml:space="preserve">
<value>grpMethod</value>
</data>
<data name="&gt;&gt;grpMethod.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;grpMethod.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;grpMethod.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="cmdOptions.Location" type="System.Drawing.Point, System.Drawing">
<value>286, 330</value>
</data>
Expand All @@ -371,66 +323,6 @@
<data name="&gt;&gt;cmdOptions.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="&gt;&gt;rdoCompleteRowsOnly.Name" xml:space="preserve">
<value>rdoCompleteRowsOnly</value>
</data>
<data name="&gt;&gt;rdoCompleteRowsOnly.Type" xml:space="preserve">
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;rdoCompleteRowsOnly.Parent" xml:space="preserve">
<value>grpMissing</value>
</data>
<data name="&gt;&gt;rdoCompleteRowsOnly.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;rdoPairwise.Name" xml:space="preserve">
<value>rdoPairwise</value>
</data>
<data name="&gt;&gt;rdoPairwise.Type" xml:space="preserve">
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;rdoPairwise.Parent" xml:space="preserve">
<value>grpMissing</value>
</data>
<data name="&gt;&gt;rdoPairwise.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;ucrPnlCompletePairwise.Name" xml:space="preserve">
<value>ucrPnlCompletePairwise</value>
</data>
<data name="&gt;&gt;ucrPnlCompletePairwise.Type" xml:space="preserve">
<value>instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;ucrPnlCompletePairwise.Parent" xml:space="preserve">
<value>grpMissing</value>
</data>
<data name="&gt;&gt;ucrPnlCompletePairwise.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="grpMissing.Location" type="System.Drawing.Point, System.Drawing">
<value>257, 232</value>
</data>
<data name="grpMissing.Size" type="System.Drawing.Size, System.Drawing">
<value>199, 45</value>
</data>
<data name="grpMissing.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="grpMissing.Text" xml:space="preserve">
<value>Missing</value>
</data>
<data name="&gt;&gt;grpMissing.Name" xml:space="preserve">
<value>grpMissing</value>
</data>
<data name="&gt;&gt;grpMissing.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;grpMissing.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;grpMissing.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="rdoCompleteRowsOnly.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
Expand Down Expand Up @@ -506,6 +398,30 @@
<data name="&gt;&gt;ucrPnlCompletePairwise.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="grpMissing.Location" type="System.Drawing.Point, System.Drawing">
<value>257, 232</value>
</data>
<data name="grpMissing.Size" type="System.Drawing.Size, System.Drawing">
<value>199, 45</value>
</data>
<data name="grpMissing.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="grpMissing.Text" xml:space="preserve">
<value>Missing</value>
</data>
<data name="&gt;&gt;grpMissing.Name" xml:space="preserve">
<value>grpMissing</value>
</data>
<data name="&gt;&gt;grpMissing.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;grpMissing.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;grpMissing.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="lblConfInterval.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
Expand Down Expand Up @@ -667,7 +583,7 @@
<value>86, 6</value>
</data>
<data name="ucrPnlColumns.Size" type="System.Drawing.Size, System.Drawing">
<value>335, 36</value>
<value>284, 36</value>
</data>
<data name="ucrPnlColumns.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
Expand Down
Loading

0 comments on commit 82d97de

Please sign in to comment.