Skip to content

Commit

Permalink
Merge pull request #478 from IDEMSInternational/master
Browse files Browse the repository at this point in the history
Updated my master
  • Loading branch information
conlooptechnologies authored Apr 8, 2024
2 parents 1b3fa0c + 2e1e0b2 commit 91a4c48
Show file tree
Hide file tree
Showing 87 changed files with 10,101 additions and 5,179 deletions.
66 changes: 66 additions & 0 deletions instat/UcrGeomListWithAes.vb
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ Public Class ucrGeomListWithParameters
SetReceiverColour()
End Sub

Private Sub AddRFunctionParameter(parentFunction As RFunction, paramName As String, paramValue As String)
Dim clsProductFunction As New RFunction
clsProductFunction.SetPackageName("ggmosaic")
clsProductFunction.SetRCommand("product")
clsProductFunction.AddParameter(paramName, paramValue, bIncludeArgumentName:=False)
parentFunction.AddParameter(paramName, clsRFunctionParameter:=clsProductFunction)
End Sub

Public Sub UpdateGlobalAndLocalAesFromInter()
Dim clsRelevantAesFunction As New RFunction 'Will be used in the partially mandatory aes filling method below.
Dim clsCurrentAesFunction As RFunction
Expand Down Expand Up @@ -342,6 +350,64 @@ Public Class ucrGeomListWithParameters
clsCurrentAesFunction = clsLocalAesFunction
End If

If clsGeomFunction.strRCommand = "geom_mosaic" Then
Dim xParameterIndex As Integer = clsLocalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "x")
Dim condsParameterIndex As Integer = clsLocalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "conds")

If xParameterIndex >= 0 Then
Dim strArgNameValue = clsLocalAesFunction.clsParameters(xParameterIndex).strArgumentValue
AddRFunctionParameter(clsCurrentAesFunction, "x", strArgNameValue)
End If

If condsParameterIndex >= 0 Then
Dim strArgNameValue = clsLocalAesFunction.clsParameters(condsParameterIndex).strArgumentValue
AddRFunctionParameter(clsCurrentAesFunction, "conds", strArgNameValue)
End If

Dim xParameterGlobalIndex As Integer = clsGlobalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "x")
Dim condsParameterGlobalIndex As Integer = clsGlobalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "conds")

If xParameterGlobalIndex >= 0 Then
Dim strArgNameValue = clsGlobalAesFunction.clsParameters(xParameterGlobalIndex).strArgumentValue
AddRFunctionParameter(clsCurrentAesFunction, "x", strArgNameValue)
End If

If condsParameterGlobalIndex >= 0 Then
Dim strArgNameValue = clsGlobalAesFunction.clsParameters(condsParameterGlobalIndex).strArgumentValue
AddRFunctionParameter(clsCurrentAesFunction, "conds", strArgNameValue)
End If
End If

If clsGeomFunction.strRCommand = "geom_mosaic_jitter" Then
Dim xParameterIndex As Integer = clsLocalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "x")
Dim condsParameterIndex As Integer = clsLocalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "conds")

If xParameterIndex >= 0 Then
Dim strArgNameValue = clsLocalAesFunction.clsParameters(xParameterIndex).strArgumentValue
AddRFunctionParameter(clsCurrentAesFunction, "x", strArgNameValue)
End If

If condsParameterIndex >= 0 Then
Dim strArgNameValue = clsLocalAesFunction.clsParameters(condsParameterIndex).strArgumentValue
AddRFunctionParameter(clsCurrentAesFunction, "conds", strArgNameValue)
End If
End If

If clsGeomFunction.strRCommand = "geom_mosaic_text" Then
Dim xParameterIndex As Integer = clsLocalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "x")
Dim condsParameterIndex As Integer = clsLocalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "conds")

If xParameterIndex >= 0 Then
Dim strArgNameValue = clsLocalAesFunction.clsParameters(xParameterIndex).strArgumentValue
AddRFunctionParameter(clsCurrentAesFunction, "x", strArgNameValue)
End If

If condsParameterIndex >= 0 Then
Dim strArgNameValue = clsLocalAesFunction.clsParameters(condsParameterIndex).strArgumentValue
AddRFunctionParameter(clsCurrentAesFunction, "conds", strArgNameValue)
End If
End If

'This is a temporary solution to issue which should be solved with geoms
'This adds "" aes for x or y when no variables are mapped to them for geoms which require it, either adding to the global or local aes.
If clsGeomFunction.strRCommand = "geom_boxplot" OrElse clsGeomFunction.strRCommand = "geom_dotplot" OrElse clsGeomFunction.strRCommand = "geom_violin" Then
Expand Down
Loading

0 comments on commit 91a4c48

Please sign in to comment.