Skip to content

Commit

Permalink
Merge pull request #225 from IDEMSInternational/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
Vitalis95 authored Mar 7, 2024
2 parents 242dea5 + f1fcc08 commit 8e35943
Show file tree
Hide file tree
Showing 10 changed files with 2,451 additions and 2,126 deletions.
31 changes: 2 additions & 29 deletions instat/dlgBarAndPieChart.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 23 additions & 30 deletions instat/dlgBarAndPieChart.vb
Original file line number Diff line number Diff line change
Expand Up @@ -295,22 +295,6 @@ Public Class dlgBarAndPieChart
ucrInputPlace.SetLinkedDisplayControl(lblPlace)
ucrReceiverLabel.SetLinkedDisplayControl(lblLabel)

ucrInputLollipopColour.SetParameter(New RParameter("point.colour", 0))
dctLollipopColours.Add("SteelBlue", Chr(34) & "steelBlue" & Chr(34))
dctLollipopColours.Add("Black", Chr(34) & "black" & Chr(34))
dctLollipopColours.Add("White", Chr(34) & "white" & Chr(34))
dctLollipopColours.Add("Blue", Chr(34) & "blue" & Chr(34))
dctLollipopColours.Add("Red", Chr(34) & "red" & Chr(34))
dctLollipopColours.Add("Yellow", Chr(34) & "yellow" & Chr(34))
dctLollipopColours.Add("Purple", Chr(34) & "purple" & Chr(34))
dctLollipopColours.Add("Green", Chr(34) & "green" & Chr(34))
dctLollipopColours.Add("Orange", Chr(34) & "orange" & Chr(34))
dctLollipopColours.Add("Grey", Chr(34) & "grey" & Chr(34))
dctLollipopColours.Add("Brown", Chr(34) & "brown" & Chr(34))
dctLollipopColours.Add("Pink", Chr(34) & "pink" & Chr(34))
ucrInputLollipopColour.SetItems(dctLollipopColours)
ucrInputLollipopColour.bAllowNonConditionValues = True

ucrNudLollipopSize.SetParameter(New RParameter("point.size", 1))
ucrNudLollipopSize.DecimalPlaces = 0
ucrNudLollipopSize.Increment = 1
Expand All @@ -320,9 +304,8 @@ Public Class dlgBarAndPieChart
ucrChkLollipop.SetText("Lollipop")
ucrChkLollipop.AddParameterPresentCondition(True, "geom_lollipop")
ucrChkLollipop.AddParameterPresentCondition(False, "geom_lollipop", False)
ucrChkLollipop.AddToLinkedControls({ucrNudLollipopSize, ucrInputLollipopColour}, {True}, bNewLinkedHideIfParameterMissing:=True)
ucrChkLollipop.AddToLinkedControls({ucrNudLollipopSize}, {True}, bNewLinkedHideIfParameterMissing:=True)
ucrNudLollipopSize.SetLinkedDisplayControl(lblLollipopSize)
ucrInputLollipopColour.SetLinkedDisplayControl(lblLollipopColour)

ucrInputAddReorder.SetItems({strAscending, strDescending, strReverse, strNone})
ucrInputAddReorder.SetDropDownStyleAsNonEditable()
Expand Down Expand Up @@ -506,7 +489,6 @@ Public Class dlgBarAndPieChart

clsGeomLollipopFunction.SetPackageName("ggalt")
clsGeomLollipopFunction.SetRCommand("geom_lollipop")
clsGeomLollipopFunction.AddParameter("point.colour", "steelblue", iPosition:=0)
clsGeomLollipopFunction.AddParameter("point.size", "1", iPosition:=1)

clsGeomLollipopAesFunction.SetPackageName("ggplot2")
Expand Down Expand Up @@ -662,8 +644,6 @@ Public Class dlgBarAndPieChart
End Sub

Private Sub SetRCodeForControls(bReset As Boolean)
ucrBarChartSelector.AddAdditionalCodeParameterPair(clsSubsetFunction1, ucrBarChartSelector.GetParameter(), iAdditionalPairNo:=1)
ucrBarChartSelector.AddAdditionalCodeParameterPair(clsSubsetFunction2, ucrBarChartSelector.GetParameter(), iAdditionalPairNo:=2)
ucrReceiverByFactor.AddAdditionalCodeParameterPair(clsIsEqualToOperator1, New RParameter("left", 0), iAdditionalPairNo:=1)
ucrReceiverByFactor.AddAdditionalCodeParameterPair(clsIsEqualToOperator2, New RParameter("left", 0), iAdditionalPairNo:=2)
ucrReceiverByFactor.AddAdditionalCodeParameterPair(clsLevelsFunction, New RParameter("x", 0), iAdditionalPairNo:=3)
Expand All @@ -683,7 +663,6 @@ Public Class dlgBarAndPieChart
ucrInputLabelPosition.SetRCode(clsGeomTextFunction, bReset)
ucrInputLabelSize.SetRCode(clsGeomTextFunction, bReset)
ucrNudLollipopSize.SetRCode(clsGeomLollipopFunction, bReset)
ucrInputLollipopColour.SetRCode(clsGeomLollipopFunction, bReset)
ucrChkLollipop.SetRCode(clsBaseOperator, bReset)
ucrReceiverArea.SetRCode(clsAsNumericFunction, bReset)
ucrReceiverFill.SetRCode(clsGeomTreemapAesFunction, bReset)
Expand Down Expand Up @@ -949,21 +928,26 @@ Public Class dlgBarAndPieChart
clsReorderFunction.AddParameter("X", ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=1)
clsBarAesFunction.AddParameter("x", clsRFunctionParameter:=clsReorderFunction, iPosition:=0)
clsPieAesFunction.AddParameter("x", clsRFunctionParameter:=clsReorderFunction, iPosition:=0)
clsGeomLollipopAesFunction.AddParameter("x", clsRFunctionParameter:=clsReorderFunction, iPosition:=0)
Case strDescending
clsReorderFunction.AddParameter("X", "-" & ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=1)
clsBarAesFunction.AddParameter("x", clsRFunctionParameter:=clsReorderFunction, iPosition:=0)
clsPieAesFunction.AddParameter("x", clsRFunctionParameter:=clsReorderFunction, iPosition:=0)
clsGeomLollipopAesFunction.AddParameter("x", clsRFunctionParameter:=clsReorderFunction, iPosition:=0)
Case strReverse
clsForecatsReverse.AddParameter("f", ucrReceiverX.GetVariableNames(False), iPosition:=0)
clsBarAesFunction.AddParameter("x", clsRFunctionParameter:=clsForecatsReverse, iPosition:=0)
clsPieAesFunction.AddParameter("x", clsRFunctionParameter:=clsForecatsReverse, iPosition:=0)
clsGeomLollipopAesFunction.AddParameter("x", clsRFunctionParameter:=clsForecatsReverse, iPosition:=0)
Case strNone
clsBarAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=0)
clsPieAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=0)
clsGeomLollipopAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=0)
End Select
Else
clsBarAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=1)
clsPieAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=0)
clsGeomLollipopAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=1)
End If
If ucrChkPolarCoordinates.Checked Then
If rdoPie.Checked OrElse rdoDonut.Checked Then
Expand Down Expand Up @@ -991,17 +975,21 @@ Public Class dlgBarAndPieChart
clsReorderFunctionValue.AddParameter("X", ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=1)
clsBarAesFunction.AddParameter("fill", clsRFunctionParameter:=clsReorderFunctionValue, iPosition:=2)
clsPieAesFunction.AddParameter("fill", clsRFunctionParameter:=clsReorderFunctionValue, iPosition:=2)
clsGeomLollipopAesFunction.AddParameter("colour", clsRFunctionParameter:=clsReorderFunctionValue, iPosition:=2)
Case strDescending
clsReorderFunctionValue.AddParameter("X", "-" & ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=1)
clsBarAesFunction.AddParameter("fill", clsRFunctionParameter:=clsReorderFunctionValue, iPosition:=2)
clsPieAesFunction.AddParameter("fill", clsRFunctionParameter:=clsReorderFunctionValue, iPosition:=2)
clsGeomLollipopAesFunction.AddParameter("colour", clsRFunctionParameter:=clsReorderFunctionValue, iPosition:=2)
Case strReverse
clsForecatsReverseValue.AddParameter("f", ucrReceiverByFactor.GetVariableNames(False), iPosition:=0)
clsBarAesFunction.AddParameter("fill", clsRFunctionParameter:=clsForecatsReverseValue, iPosition:=2)
clsPieAesFunction.AddParameter("fill", clsRFunctionParameter:=clsForecatsReverseValue, iPosition:=2)
clsGeomLollipopAesFunction.AddParameter("colour", clsRFunctionParameter:=clsForecatsReverseValue, iPosition:=2)
Case strNone
clsBarAesFunction.AddParameter("fill", ucrReceiverByFactor.GetVariableNames(False), iPosition:=1)
clsPieAesFunction.AddParameter("fill", ucrReceiverByFactor.GetVariableNames(False), iPosition:=2)
clsGeomLollipopAesFunction.AddParameter("colour", ucrReceiverByFactor.GetVariableNames(False), iPosition:=1)
End Select
End If
End If
Expand All @@ -1018,7 +1006,10 @@ Public Class dlgBarAndPieChart
clsRggplotFunction.RemoveParameterByName("aes")
clsGeomLollipopAesFunction.RemoveParameterByName("x")
clsGeomLollipopAesFunction.RemoveParameterByName("y")
clsGeomLollipopAesFunction.RemoveParameterByName("fill")
clsGeomLollipopAesFunction.RemoveParameterByName("colour")
clsRgeomBarFunction1.RemoveParameterByName("stat")
clsRgeomBarFunction2.RemoveParameterByName("stat")
clsRgeomBarFunction.RemoveParameterByName("stat")
If rdoValue.Checked Then
clsBarAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=0)
clsBarAesFunction.AddParameter("y", ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=1)
Expand All @@ -1033,7 +1024,7 @@ Public Class dlgBarAndPieChart
End If
clsGeomLollipopAesFunction.AddParameter("x", ucrReceiverX.GetVariableNames(False), iPosition:=0)
clsGeomLollipopAesFunction.AddParameter("y", ucrVariablesAsFactorForBarChart.GetVariableNames(False), iPosition:=1)
clsGeomLollipopAesFunction.AddParameter("fill", ucrReceiverByFactor.GetVariableNames(False), iPosition:=2)
clsGeomLollipopAesFunction.AddParameter("colour", ucrReceiverByFactor.GetVariableNames(False), iPosition:=2)
clsRgeomBarFunction1.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=2)
clsRgeomBarFunction2.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=1)
clsRgeomBarFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34), iPosition:=1)
Expand All @@ -1044,6 +1035,7 @@ Public Class dlgBarAndPieChart
If ucrReceiverX.IsEmpty Then
clsBarAesFunction.AddParameter("x", Chr(34) & Chr(34), iPosition:=0)
clsPieAesFunction.AddParameter("x", Chr(34) & Chr(34), iPosition:=0)
clsGeomLollipopAesFunction.AddParameter("x", Chr(34) & Chr(34), iPosition:=0)
End If
If ucrVariablesAsFactorForBarChart.IsEmpty Then
clsBarAesFunction.AddParameter("y", Chr(34) & Chr(34), iPosition:=1)
Expand All @@ -1053,6 +1045,7 @@ Public Class dlgBarAndPieChart
clsBarAesFunction.AddParameter("fill", Chr(34) & Chr(34), iPosition:=2)
clsPieAesFunction.AddParameter("fill", Chr(34) & Chr(34), iPosition:=2)
clsRgeomBarFunction.RemoveParameterByName("position")
clsGeomLollipopAesFunction.AddParameter("colour", Chr(34) & Chr(34), iPosition:=2)
End If
If ucrChkLollipop.Checked Then
clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsGeomLollipopAesFunction, iPosition:=1)
Expand Down Expand Up @@ -1080,12 +1073,10 @@ Public Class dlgBarAndPieChart
clsBarAesFunction.AddParameter("fill", ucrReceiverByFactor.GetVariableNames(False), iPosition:=1)
clsPieAesFunction.AddParameter("fill", ucrReceiverByFactor.GetVariableNames(False), iPosition:=1)
End If
clsRgeomBarFunction1.AddParameter("stat", Chr(34) & "count" & Chr(34), iPosition:=2)
clsRgeomBarFunction.AddParameter("stat", Chr(34) & "count" & Chr(34), iPosition:=1)
clsRgeomBarFunction2.RemoveParameterByName("stat")
End If
clsRgeomBarFunction.AddParameter("stat", Chr(34) & "count" & Chr(34), iPosition:=1)
clsBaseOperator.AddParameter("geom_bar", clsRFunctionParameter:=clsRgeomBarFunction, iPosition:=2)
clsBaseOperator.RemoveParameterByName("geom_treemap")
clsBaseOperator.RemoveParameterByName("geom_text_wordcloud")
ElseIf rdoTreeMap.Checked Then
Expand Down Expand Up @@ -1309,8 +1300,10 @@ Public Class dlgBarAndPieChart
ucrChkPolarCoordinates.Enabled = False
ucrChkPolarCoordinates.Checked = Not ucrChkBacktoback.Checked
clsBaseOperator.RemoveParameterByName("geom_bar")
clsSubsetFunction1.AddParameter("subset", clsROperatorParameter:=clsIsEqualToOperator1, iPosition:=1, bIncludeArgumentName:=False)
clsSubsetFunction2.AddParameter("subset", clsROperatorParameter:=clsIsEqualToOperator2, iPosition:=1, bIncludeArgumentName:=False)
clsSubsetFunction1.AddParameter("data", ucrBarChartSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=1, bIncludeArgumentName:=False)
clsSubsetFunction1.AddParameter("subset", clsROperatorParameter:=clsIsEqualToOperator1, iPosition:=2, bIncludeArgumentName:=False)
clsSubsetFunction2.AddParameter("data", ucrBarChartSelector.ucrAvailableDataFrames.cboAvailableDataFrames.Text, iPosition:=1, bIncludeArgumentName:=False)
clsSubsetFunction2.AddParameter("subset", clsROperatorParameter:=clsIsEqualToOperator2, iPosition:=2, bIncludeArgumentName:=False)
clsBaseOperator.AddParameter("geom_bar2", clsRFunctionParameter:=clsRgeomBarFunction2, iPosition:=1)
clsBaseOperator.AddParameter("geom_bar1", clsRFunctionParameter:=clsRgeomBarFunction1, iPosition:=2)
clsBaseOperator.AddParameter("scale_y_symmetric", clsRFunctionParameter:=clsScaleYSymmetricFunction, iPosition:=3)
Expand All @@ -1320,8 +1313,8 @@ Public Class dlgBarAndPieChart
clsRgeomBarFunction2.AddParameter("aes", clsRFunctionParameter:=clsAesFunction1, iPosition:=1)
clsRgeomBarFunction1.AddParameter("aes", clsRFunctionParameter:=clsAesFunction2, iPosition:=1)
Else
clsAesFunction1.AddParameter("y", "..count..*(-1)", iPosition:=0)
clsRgeomBarFunction1.AddParameter("aes", clsRFunctionParameter:=clsAesFunction1, iPosition:=1)
clsAesFunction1.AddParameter("y", "after_stat(count) * (-1)", iPosition:=0)
clsRgeomBarFunction1.AddParameter("aes", clsRFunctionParameter:=clsAesFunction1, iPosition:=1, bIncludeArgumentName:=False)
End If
End If
End If
Expand Down
Loading

0 comments on commit 8e35943

Please sign in to comment.