From 744fb3c99dced81d5dd7cd54446322142b0c06ca Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 4 Nov 2024 09:40:36 +0100 Subject: [PATCH 1/5] Bug Fixes in Parallel Coordinate Plot --- instat/dlgParallelCoordinatePlot.vb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/instat/dlgParallelCoordinatePlot.vb b/instat/dlgParallelCoordinatePlot.vb index b3cd4519c9b..ecd4be35eef 100644 --- a/instat/dlgParallelCoordinatePlot.vb +++ b/instat/dlgParallelCoordinatePlot.vb @@ -173,11 +173,14 @@ Public Class dlgParallelCoordinatePlot ucrSaveGraph.Reset() bResetSubdialog = True + clsMatchFunction.SetRCommand("match") + clsMatchFunction.SetAssignTo("column_numbers") + clsGGParCoordFunc.SetPackageName("GGally") clsGGParCoordFunc.SetRCommand("ggparcoord") - clsGGParCoordFunc.AddParameter("columns", "column_numbers", iPosition:=1) + clsGGParCoordFunc.AddParameter("columns", clsRFunctionParameter:=clsMatchFunction, iPosition:=1) clsGGParCoordFunc.AddParameter("missing", Chr(34) & "exclude" & Chr(34), iPosition:=6) - clsGGParCoordFunc.AddParameter("order", clsRFunctionParameter:=clsMatchFunction, iPosition:=7) + clsGGParCoordFunc.AddParameter("order", Chr(34) & "anyClass" & Chr(34), iPosition:=7) clsGGParCoordFunc.AddParameter("centerObsID", "1", iPosition:=8) clsBaseOperator.SetOperation("+") @@ -199,8 +202,7 @@ Public Class dlgParallelCoordinatePlot clsGroupByFunction.SetPackageName("dplyr") clsGroupByFunction.SetRCommand("group_by") - clsMatchFunction.SetRCommand("match") - clsMatchFunction.SetAssignTo("column_numbers") + clsNamesFunction.SetRCommand("names") From 32a1d279a79345823fe9708491ae658b5e01a6f8 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Mon, 25 Nov 2024 17:29:21 +0300 Subject: [PATCH 2/5] changes to the code --- instat/dlgLinePlot.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index 81389c9c753..bbaa250744c 100644 --- a/instat/dlgLinePlot.vb +++ b/instat/dlgLinePlot.vb @@ -536,7 +536,6 @@ Public Class dlgLinePlot clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") - clsGeomLineFunction.AddParameter("colour", Chr(34) & "blue" & Chr(34)) clsGeomLineFunction.AddParameter("size", "0.8") clsAesLinerangeFunction.SetRCommand("aes") From 6cdce0e87460a2bdf96d27cf821fc11930b6a9ee Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Fri, 29 Nov 2024 14:46:02 +0300 Subject: [PATCH 3/5] changes --- instat/clsInstatOptions.vb | 17 +++++++++++++++++ instat/clsInstatOptionsDefaults.vb | 1 + instat/dlgOptions.Designer.vb | 29 +++++++++++++++++++++++++++++ instat/dlgOptions.vb | 7 +++++-- 4 files changed, 52 insertions(+), 2 deletions(-) diff --git a/instat/clsInstatOptions.vb b/instat/clsInstatOptions.vb index 548562707c6..4ef7f357b38 100644 --- a/instat/clsInstatOptions.vb +++ b/instat/clsInstatOptions.vb @@ -30,6 +30,7 @@ Imports RDotNet Public bIncludeRDefaultParameters As Nullable(Of Boolean) Public iPreviewRows As Nullable(Of Integer) Public iMaxRows As Nullable(Of Integer) + Public iMaxWidth As Nullable(Of Integer) Public iMaxCols As Nullable(Of Integer) Public iUndoColLimit As Nullable(Of Integer) Public iUndoRowLimit As Nullable(Of Integer) @@ -78,6 +79,7 @@ Imports RDotNet clrEditor = clsInstatOptionsDefaults.DEFAULTclrEditor iPreviewRows = clsInstatOptionsDefaults.DEFAULTiPreviewRows iMaxRows = clsInstatOptionsDefaults.DEFAULTiMaxRows + iMaxWidth = clsInstatOptionsDefaults.DEFAULTiMaxWidth iMaxCols = clsInstatOptionsDefaults.DEFAULTiMaxCols iUndoColLimit = clsInstatOptionsDefaults.DEFAULTiUndoColLimit iUndoRowLimit = clsInstatOptionsDefaults.DEFAULTiUndoRowLimit @@ -145,6 +147,12 @@ Imports RDotNet SetMaxRows(clsInstatOptionsDefaults.DEFAULTiMaxRows) End If + If iMaxWidth.HasValue Then + SetMaxWidth(iMaxWidth) + Else + SetMaxWidth(clsInstatOptionsDefaults.DEFAULTiMaxWidth) + End If + If iMaxCols.HasValue Then SetMaxCols(iMaxCols) Else @@ -348,6 +356,11 @@ Imports RDotNet clsOptionsFunction.AddParameter("dplyr.summarise.inform", "FALSE") End If + strROption = GetROption("width") + If strROption Is Nothing OrElse strROption <> iMaxWidth.ToString Then + clsOptionsFunction.AddParameter("width", iMaxWidth) + End If + 'add "R.commands.displayed.in.the.output.window" as options parameter of its been changed If frmMain.mnuShowRCommand.Checked Then clsOptionsFunction.AddParameter("R.commands.displayed.in.the.output.window", "TRUE") @@ -394,6 +407,10 @@ Imports RDotNet frmMain.UpdateAllGrids() End Sub + Public Sub SetMaxWidth(iNewMaxWidth As Integer) + iMaxWidth = iNewMaxWidth + 'frmMain.UpdateAllGrids() + End Sub Public Sub SetMaxCols(iCols As Integer) iMaxCols = iCols frmMain.UpdateAllGrids() diff --git a/instat/clsInstatOptionsDefaults.vb b/instat/clsInstatOptionsDefaults.vb index 8a4ee9b62cd..a4ab65e6ad7 100644 --- a/instat/clsInstatOptionsDefaults.vb +++ b/instat/clsInstatOptionsDefaults.vb @@ -57,5 +57,6 @@ Public Class clsInstatOptionsDefaults Public Shared ReadOnly DEFAULTstrClimsoftPort As String = "3308" Public Shared ReadOnly DEFAULTstrClimsoftUsername As String = "root" Public Shared ReadOnly DEFAULTiMaxOutputsHeight As Integer = 500 + Public Shared ReadOnly DEFAULTiMaxWidth As Integer = 80 Public Shared ReadOnly DEFAULTbRemindLaterOption As Boolean = False End Class diff --git a/instat/dlgOptions.Designer.vb b/instat/dlgOptions.Designer.vb index 53fdd6c58d4..54a9edc1099 100644 --- a/instat/dlgOptions.Designer.vb +++ b/instat/dlgOptions.Designer.vb @@ -135,6 +135,8 @@ Partial Class dlgOptions Me.ucrInputDatabaseName = New instat.ucrInputTextBox() Me.tbpWebsite = New System.Windows.Forms.TabPage() Me.ucrChkReminder = New instat.ucrCheck() + Me.ucrNudWidth = New instat.ucrNud() + Me.lblWidth = New System.Windows.Forms.Label() CType(Me.spltControls, System.ComponentModel.ISupportInitialize).BeginInit() Me.spltControls.Panel1.SuspendLayout() Me.spltControls.Panel2.SuspendLayout() @@ -440,6 +442,8 @@ Partial Class dlgOptions ' 'tbpOutputWindow ' + Me.tbpOutputWindow.Controls.Add(Me.lblWidth) + Me.tbpOutputWindow.Controls.Add(Me.ucrNudWidth) Me.tbpOutputWindow.Controls.Add(Me.ucrNudMaxOutputsHeight) Me.tbpOutputWindow.Controls.Add(Me.ucrChkMaxOutputsHeight) Me.tbpOutputWindow.Controls.Add(Me.ucrChkShowRCommandsinOutputWindow) @@ -1260,6 +1264,29 @@ Partial Class dlgOptions Me.ucrChkReminder.Size = New System.Drawing.Size(620, 51) Me.ucrChkReminder.TabIndex = 2 ' + 'ucrNudWidth + ' + Me.ucrNudWidth.AutoSize = True + Me.ucrNudWidth.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudWidth.Location = New System.Drawing.Point(759, 277) + Me.ucrNudWidth.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrNudWidth.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudWidth.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWidth.Name = "ucrNudWidth" + Me.ucrNudWidth.Size = New System.Drawing.Size(75, 30) + Me.ucrNudWidth.TabIndex = 30 + Me.ucrNudWidth.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'lblWidth + ' + Me.lblWidth.AutoSize = True + Me.lblWidth.Location = New System.Drawing.Point(543, 281) + Me.lblWidth.Name = "lblWidth" + Me.lblWidth.Size = New System.Drawing.Size(127, 20) + Me.lblWidth.TabIndex = 31 + Me.lblWidth.Text = "Width to Display:" + ' 'dlgOptions ' Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) @@ -1410,4 +1437,6 @@ Partial Class dlgOptions Friend WithEvents ucrNudRowUndoLimit As ucrNud Friend WithEvents Label4 As Label Friend WithEvents ucrChkTurnOffUndo As ucrCheck + Friend WithEvents lblWidth As Label + Friend WithEvents ucrNudWidth As ucrNud End Class diff --git a/instat/dlgOptions.vb b/instat/dlgOptions.vb index f1c25588dca..7e049aa79d0 100644 --- a/instat/dlgOptions.vb +++ b/instat/dlgOptions.vb @@ -75,6 +75,7 @@ Public Class dlgOptions SetView() ucrNudDigits.SetMinMax(0, 22) + ucrNudWidth.SetMinMax(0, Integer.MaxValue) ucrChkIncludeCommentsbyDefault.SetText("Include Comments by Default") ucrChkViewStructuredMenu.SetText("Show Structured Menu") ucrChkViewClimaticMenu.SetText("Show Climatic Menu") @@ -130,6 +131,7 @@ Public Class dlgOptions ucrChkViewClimaticMenu.Checked = frmMain.clsInstatOptions.bShowClimaticMenu ucrChkShowRCommandsinOutputWindow.Checked = frmMain.clsInstatOptions.bCommandsinOutput ucrNudDigits.Value = frmMain.clsInstatOptions.iDigits + ucrNudWidth.Value = frmMain.clsInstatOptions.iMaxWidth ucrChkShowSignifStars.Checked = frmMain.clsInstatOptions.bShowSignifStars ucrChkShowDataonGrid.Checked = frmMain.clsInstatOptions.bChangeDataFrame ucrChkShowWaitDialog.Checked = frmMain.clsInstatOptions.bShowWaitDialog @@ -197,6 +199,7 @@ Public Class dlgOptions frmMain.clsInstatOptions.SetShowClimaticMenu(ucrChkViewClimaticMenu.Checked) frmMain.clsInstatOptions.SetCommandInOutpt(ucrChkShowRCommandsinOutputWindow.Checked) frmMain.clsInstatOptions.SetDigits(ucrNudDigits.Value) + frmMain.clsInstatOptions.SetMaxWidth(ucrNudWidth.Value) frmMain.clsInstatOptions.SetSignifStars(ucrChkShowSignifStars.Checked) frmMain.clsInstatOptions.SetChangeDataFrame(ucrChkShowDataonGrid.Checked) frmMain.clsInstatOptions.SetShowWaitDialog(ucrChkShowWaitDialog.Checked) @@ -375,7 +378,7 @@ Public Class dlgOptions End Sub - Private Sub AllControls_ControlValueChanged() Handles ucrNudMaxCols.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrNudWaitSeconds.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged + Private Sub AllControls_ControlValueChanged() Handles ucrNudMaxCols.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudWidth.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrNudWaitSeconds.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged ApplyEnabled(True) End Sub @@ -443,7 +446,7 @@ Public Class dlgOptions ApplyEnabled(True) End Sub - Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudWaitSeconds.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudMaxCols.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged + Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudWaitSeconds.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudWidth.ControlValueChanged, ucrNudMaxCols.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged, ucrNudColUndoLimit.ControlValueChanged, ucrNudRowUndoLimit.ControlValueChanged, ucrChkTurnOffUndo.ControlValueChanged End Sub From 98e8c12847509fc4286932d6444493f9ca62abdb Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Mon, 2 Dec 2024 10:23:47 +0300 Subject: [PATCH 4/5] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 2 +- instat/dlgDescribeTwoVariable.vb | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index 5eb45c48ae7..63a73b2d763 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -574,7 +574,7 @@ Partial Class dlgDescribeTwoVariable Me.ucrReceiverSkimrGroupByFactor.Selector = Nothing Me.ucrReceiverSkimrGroupByFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverSkimrGroupByFactor.strNcFilePath = "" - Me.ucrReceiverSkimrGroupByFactor.TabIndex = 2 + Me.ucrReceiverSkimrGroupByFactor.TabIndex = 8 Me.ucrReceiverSkimrGroupByFactor.ucrSelector = Nothing ' 'ucrChkDisplayMargins diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 0da50e2892b..acf4564b564 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -539,7 +539,6 @@ Public Class dlgDescribeTwoVariable ucrSaveTable.AddAdditionalRCode(clsGroupByPipeOperator4, iAdditionalPairNo:=2) ucrChkOmitMissing.SetRCode(clsSummaryTableFunction, bReset) - ucrReceiverFirstVars.SetRCode(clsDummyFunction, bReset) ucrReceiverSecondTwoVariableFactor.SetRCode(clsDummyFunction, bReset) ucrSelectorDescribeTwoVar.SetRCode(clsRCorrelationFunction, bReset) ucrReceiverSkimrGroupByFactor.SetRCode(clsGroupByFunction, bReset) @@ -558,6 +557,9 @@ Public Class dlgDescribeTwoVariable ucrReceiverThreeVariableThirdVariable.SetRCode(clsSummaryTableCombineFactorsFunction, bReset) ucrChkDisplayMargins.SetRCode(clsCombineFrequencyParametersFunction, bReset) ucrSaveTable.SetRCode(clsGroupByPipeOperator, bReset) + If bReset Then + ucrReceiverFirstVars.SetRCode(clsDummyFunction, bReset) + End If bRcodeSet = True FillListView() @@ -1436,8 +1438,11 @@ Public Class dlgDescribeTwoVariable Else ucrReceiverFirstVars.SetMeAsReceiver() End If + ElseIf rdoSkim.Checked Then + ucrReceiverFirstVars.SetMeAsReceiver() Else ucrReceiverFirstVars.SetMeAsReceiver() + End If If rdoORow.Checked OrElse rdoOCell.Checked Then If ucrChkDisplayMargins.Checked Then From 739ad1b0ef997550d1a0f5eae0405215331a0c4b Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:03:22 +0100 Subject: [PATCH 5/5] Fixes bug with the order=anyclass parameter when a factor is not selected --- instat/dlgParallelCoordinatePlot.vb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/instat/dlgParallelCoordinatePlot.vb b/instat/dlgParallelCoordinatePlot.vb index ecd4be35eef..56c726e2b89 100644 --- a/instat/dlgParallelCoordinatePlot.vb +++ b/instat/dlgParallelCoordinatePlot.vb @@ -180,7 +180,7 @@ Public Class dlgParallelCoordinatePlot clsGGParCoordFunc.SetRCommand("ggparcoord") clsGGParCoordFunc.AddParameter("columns", clsRFunctionParameter:=clsMatchFunction, iPosition:=1) clsGGParCoordFunc.AddParameter("missing", Chr(34) & "exclude" & Chr(34), iPosition:=6) - clsGGParCoordFunc.AddParameter("order", Chr(34) & "anyClass" & Chr(34), iPosition:=7) + 'clsGGParCoordFunc.AddParameter("order", Chr(34) & "anyClass" & Chr(34), iPosition:=7) clsGGParCoordFunc.AddParameter("centerObsID", "1", iPosition:=8) clsBaseOperator.SetOperation("+") @@ -444,4 +444,11 @@ Public Class dlgParallelCoordinatePlot TestOkEnabled() End Sub + Private Sub ucrReceiverFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFactor.ControlValueChanged + If Not ucrReceiverFactor.IsEmpty Then + clsGGParCoordFunc.AddParameter("order", Chr(34) & "anyClass" & Chr(34), iPosition:=7) + Else + clsGGParCoordFunc.RemoveParameterByName("order") + End If + End Sub End Class \ No newline at end of file