Skip to content

Commit

Permalink
Merge pull request IDEMSInternational#8987 from Vitalis95/multivariate
Browse files Browse the repository at this point in the history
Improved the R code in parallel coordinates plot dialog
  • Loading branch information
N-thony authored Jun 1, 2024
2 parents f5fc35a + b50169b commit 5fca7f3
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions instat/dlgParallelCoordinatePlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Public Class dlgParallelCoordinatePlot
Private clsScaleFillViridisFunction As New RFunction
Private clsScaleColourViridisFunction As New RFunction
Private clsAnnotateFunction As New RFunction
Private clsMatchFunction As New RFunction
Private clsNamesFunction As New RFunction

Private clsFacetFunction As New RFunction
Private clsFacetVariablesOperator As New ROperator
Expand Down Expand Up @@ -159,6 +161,8 @@ Public Class dlgParallelCoordinatePlot
clsFacetColOp = New ROperator
clsPipeOperator = New ROperator
clsGroupByFunction = New RFunction
clsNamesFunction = New RFunction
clsMatchFunction = New RFunction

ucrInputStation.SetName(strFacetWrap)
ucrInputStation.bUpdateRCodeFromControl = True
Expand All @@ -171,9 +175,10 @@ Public Class dlgParallelCoordinatePlot

clsGGParCoordFunc.SetPackageName("GGally")
clsGGParCoordFunc.SetRCommand("ggparcoord")

clsGGParCoordFunc.AddParameter("columns", "column_numbers", iPosition:=1)
clsGGParCoordFunc.AddParameter("missing", Chr(34) & "exclude" & Chr(34), iPosition:=6)
clsGGParCoordFunc.AddParameter("order", Chr(34) & "skewness" & Chr(34), iPosition:=7)
clsGGParCoordFunc.AddParameter("order", clsRFunctionParameter:=clsMatchFunction, iPosition:=7)
clsGGParCoordFunc.AddParameter("centerObsID", "1", iPosition:=8)

clsBaseOperator.SetOperation("+")
clsBaseOperator.AddParameter("ggparcord", clsRFunctionParameter:=clsGGParCoordFunc, iPosition:=0)
Expand All @@ -194,6 +199,11 @@ Public Class dlgParallelCoordinatePlot
clsGroupByFunction.SetPackageName("dplyr")
clsGroupByFunction.SetRCommand("group_by")

clsMatchFunction.SetRCommand("match")
clsMatchFunction.SetAssignTo("column_numbers")

clsNamesFunction.SetRCommand("names")

clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone())
clsXLabsFunction = GgplotDefaults.clsXlabTitleFunction.Clone()
clsLabsFunction = GgplotDefaults.clsDefaultLabs.Clone()
Expand All @@ -217,6 +227,8 @@ Public Class dlgParallelCoordinatePlot
End Sub

Private Sub SetRCodeForControls(bReset As Boolean)
ucrReceiverXVariables.AddAdditionalCodeParameterPair(clsMatchFunction, New RParameter("var", 1, bNewIncludeArgumentName:=False), iAdditionalPairNo:=1)

ucrSelectorParallelCoordinatePlot.SetRCode(clsGGParCoordFunc, bReset)
ucrReceiverFactor.SetRCode(clsGGParCoordFunc, bReset)
ucrChkBoxplots.SetRCode(clsGGParCoordFunc, bReset)
Expand All @@ -226,9 +238,6 @@ Public Class dlgParallelCoordinatePlot
ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True)
ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True)
ucrSaveGraph.SetRCode(clsBaseOperator, bReset)
If bReset Then
ucrReceiverXVariables.SetRCode(clsGGParCoordFunc, bReset)
End If
End Sub

Private Sub TestOkEnabled()
Expand Down Expand Up @@ -425,9 +434,12 @@ Public Class dlgParallelCoordinatePlot
Private Sub ucrSelectorParallelCoordinatePlot_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorParallelCoordinatePlot.ControlValueChanged
AutoFacetStation()
SetPipeAssignTo()
clsNamesFunction.AddParameter("names", ucrSelectorParallelCoordinatePlot.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=0, bIncludeArgumentName:=False)
clsMatchFunction.AddParameter("data", clsRFunctionParameter:=clsNamesFunction, iPosition:=1, bIncludeArgumentName:=False)
End Sub

Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverXVariables.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged, ucrNudTransparency.ControlContentsChanged
TestOkEnabled()
End Sub

End Class

0 comments on commit 5fca7f3

Please sign in to comment.