Skip to content

Commit

Permalink
Merge pull request #184 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
updating master
  • Loading branch information
Vitalis95 authored Nov 1, 2023
2 parents 7332c83 + 1fe0b27 commit 8398670
Show file tree
Hide file tree
Showing 15 changed files with 1,114 additions and 149 deletions.
35 changes: 32 additions & 3 deletions instat/clsGgplotDefaults.vb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ Public Class GgplotDefaults
End Get
End Property

Public Shared ReadOnly Property clsXScaleDiscreteFunction As RFunction
Get
Dim clsXlabScalesTempFunc As New RFunction

clsXlabScalesTempFunc.SetPackageName("ggplot2")

clsXlabScalesTempFunc.SetRCommand("scale_x_discrete")
Return clsXlabScalesTempFunc
End Get
End Property

Public Shared ReadOnly Property clsYScalecontinuousFunction As RFunction
Get
Dim clsYlabScalesTempFunc As New RFunction
Expand All @@ -115,6 +126,17 @@ Public Class GgplotDefaults
End Get
End Property

Public Shared ReadOnly Property clsYScaleDiscreteFunction As RFunction
Get
Dim clsYlabScalesTempFunc As New RFunction

clsYlabScalesTempFunc.SetPackageName("ggplot2")
clsYlabScalesTempFunc.SetRCommand("scale_y_discrete")

Return clsYlabScalesTempFunc
End Get
End Property

Public Shared ReadOnly Property clsXScaleDateFunction As RFunction
Get
Dim clsXScaleDateFunctionTemp As New RFunction
Expand Down Expand Up @@ -222,7 +244,6 @@ Public Class GgplotDefaults
dctTemp.Add("caption", clsElementText.Clone())
dctTemp.Add("tag", clsElementText.Clone())
dctTemp.Add("colour", clsElementText.Clone())

'dctTemp.Add("aspect.ratio", clsElementText.Clone())
dctTemp.Add("axis.title", clsElementText.Clone())
dctTemp.Add("axis.title.x", clsElementText.Clone())
Expand Down Expand Up @@ -275,7 +296,6 @@ Public Class GgplotDefaults
dctTemp.Add("plot.title", clsElementText.Clone())
dctTemp.Add("plot.subtitle", clsElementText.Clone())
dctTemp.Add("plot.caption", clsElementText.Clone())
dctTemp.Add("plot.tag", clsElementText.Clone())
dctTemp.Add("plot.margin", clsUnit.Clone())
dctTemp.Add("strip.background", clsElementRect.Clone())
' dctTemp.Add("strip.placement", clsElementLine.Clone())
Expand Down Expand Up @@ -427,6 +447,14 @@ Public Class GgplotDefaults
End Get
End Property

Public Shared ReadOnly Property dctDropUnusedLevels As Dictionary(Of String, String)
Get
Dim dctTempDropUnusedLevels As New Dictionary(Of String, String)
dctTempDropUnusedLevels.Add("TRUE", Chr(34) & "TRUE" & Chr(34))
dctTempDropUnusedLevels.Add("FALSE", Chr(34) & "FALSE" & Chr(34))
Return dctTempDropUnusedLevels
End Get
End Property

Public Shared ReadOnly Property dctXPosition As Dictionary(Of String, String)
Get
Expand Down Expand Up @@ -466,4 +494,5 @@ Public Class GgplotDefaults
Return dctDateStartMonths
End Get
End Property
End Class
End Class

6 changes: 5 additions & 1 deletion instat/dlgBarAndPieChart.vb
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,13 @@ Public Class dlgBarAndPieChart
End Sub

Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click, toolStripMenuItemPlotOptions.Click
Dim clsTempGlobalAesFunction As New RFunction
If rdoValue.Checked OrElse rdoFrequency.Checked Then
clsTempGlobalAesFunction = If(ucrChkPolarCoordinates.Checked, clsPieAesFunction, clsBarAesFunction)
End If
sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction,
clsNewXLabsTitleFunction:=clsXlabFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction,
clsNewThemeFunction:=clsThemeFuction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsTextAesFunction, ucrNewBaseSelector:=ucrBarChartSelector,
clsNewThemeFunction:=clsThemeFuction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsTempGlobalAesFunction, ucrNewBaseSelector:=ucrBarChartSelector,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewAnnotateFunction:=clsAnnotateFunction,
clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction,
strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog)
Expand Down
27 changes: 15 additions & 12 deletions instat/dlgGeneralForGraphics.vb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Public Class dlgGeneralForGraphics
Private clsScaleFillViridisFunction As New RFunction
Private clsScaleColourViridisFunction As New RFunction
Private clsAnnotateFunction As New RFunction
Private clsYScaleDiscreteFunction As New RFunction
Private clsXScaleDiscreteFunction As New RFunction
Private clsDummyFunction As New RFunction
Private strPackageName As String

Expand Down Expand Up @@ -161,6 +163,7 @@ Public Class dlgGeneralForGraphics
ucrReceiverY.SetMeAsReceiver()
bDataFrameSet = False
bResetOptionsSubdialog = True
bResetSubdialog = True

clsDummyFunction.AddParameter("group", "false", iPosition:=0)
clsDummyFunction.AddParameter("group", "false", iPosition:=1)
Expand Down Expand Up @@ -251,8 +254,8 @@ Public Class dlgGeneralForGraphics
clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, ucrNewBaseSelector:=sdgLayerOptions.ucrGeomWithAes.ucrGeomWithAesSelector, clsNewAnnotateFunction:=clsAnnotateFunction,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetSubdialog)
sdgPlots.ShowDialog()
bResetOptionsSubdialog = False
sdgPlots.EnableLayersTab()
bResetSubdialog = False
End Sub

Private Sub ucrAdditionalLayers_NumberOfLayersChanged() Handles ucrAdditionalLayers.NumberOfLayersChanged
Expand All @@ -265,49 +268,49 @@ Public Class dlgGeneralForGraphics
sdgPlots.DisableLayersTab()
sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction,
clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewLabsFunction:=clsLabsFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabsFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewGlobalAesFunction:=clsGlobalAesFunction,
clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, ucrNewBaseSelector:=sdgLayerOptions.ucrGeomWithAes.ucrGeomWithAesSelector, clsNewAnnotateFunction:=clsAnnotateFunction,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetSubdialog)
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetOptionsSubdialog)
sdgPlots.tbpPlotsOptions.SelectedIndex = 0
sdgPlots.ShowDialog()
bResetOptionsSubdialog = False
sdgPlots.EnableLayersTab()
bResetOptionsSubdialog = False
End Sub

Private Sub cmdTheme_Click(sender As Object, e As EventArgs) Handles cmdTheme.Click
sdgPlots.DisableLayersTab()
sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction,
clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewLabsFunction:=clsLabsFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabsFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewGlobalAesFunction:=clsGlobalAesFunction,
clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, ucrNewBaseSelector:=sdgLayerOptions.ucrGeomWithAes.ucrGeomWithAesSelector, clsNewAnnotateFunction:=clsAnnotateFunction,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetSubdialog)
sdgPlots.tbpPlotsOptions.SelectedIndex = 5
sdgPlots.ShowDialog()
sdgPlots.tbpPlotsOptions.SelectedIndex = 0
bResetOptionsSubdialog = False
sdgPlots.EnableLayersTab()
bResetSubdialog = False
End Sub

Private Sub cmdTitles_Click(sender As Object, e As EventArgs) Handles cmdTitles.Click
sdgPlots.DisableLayersTab()
sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction,
clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewLabsFunction:=clsLabsFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabsFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewGlobalAesFunction:=clsGlobalAesFunction,
clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, ucrNewBaseSelector:=sdgLayerOptions.ucrGeomWithAes.ucrGeomWithAesSelector, clsNewAnnotateFunction:=clsAnnotateFunction,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetSubdialog)
sdgPlots.tbpPlotsOptions.SelectedIndex = 2
sdgPlots.ShowDialog()
bResetOptionsSubdialog = False
sdgPlots.EnableLayersTab()
bResetSubdialog = False
End Sub

Private Sub cmdXAxis_Click(sender As Object, e As EventArgs) Handles cmdXAxis.Click
sdgPlots.DisableLayersTab()
sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction,
clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewLabsFunction:=clsLabsFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabsFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewGlobalAesFunction:=clsGlobalAesFunction,
clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, ucrNewBaseSelector:=sdgLayerOptions.ucrGeomWithAes.ucrGeomWithAesSelector, clsNewAnnotateFunction:=clsAnnotateFunction,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetSubdialog)
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetOptionsSubdialog)
sdgPlots.tbpPlotsOptions.SelectedIndex = 3
sdgPlots.ShowDialog()
bResetOptionsSubdialog = False
Expand All @@ -318,9 +321,9 @@ Public Class dlgGeneralForGraphics
sdgPlots.DisableLayersTab()
sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction,
clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, clsNewLabsFunction:=clsLabsFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabsFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction,
clsNewFacetFunction:=clsFacetsFunction, clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewGlobalAesFunction:=clsGlobalAesFunction,
clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, ucrNewBaseSelector:=sdgLayerOptions.ucrGeomWithAes.ucrGeomWithAesSelector, clsNewAnnotateFunction:=clsAnnotateFunction,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetSubdialog)
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, bReset:=bResetOptionsSubdialog)
sdgPlots.tbpPlotsOptions.SelectedIndex = 4
sdgPlots.ShowDialog()
bResetOptionsSubdialog = False
Expand Down
5 changes: 3 additions & 2 deletions instat/dlgLinePlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,8 @@ Public Class dlgLinePlot
sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction,
clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction,
clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, ucrNewBaseSelector:=ucrLinePlotSelector,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewAnnotateFunction:=clsAnnotateFunction,
clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction,
clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewAnnotateFunction:=clsAnnotateFunction,
clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction,
strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog)
sdgPlots.ShowDialog()
bResetSubdialog = False
Expand Down Expand Up @@ -876,4 +876,5 @@ Public Class dlgLinePlot
Private Sub RibbonOptionsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RibbonOptionsToolStripMenuItem.Click
openSdgLayerOptions(clsGeomRibbonFunction)
End Sub

End Class
17 changes: 1 addition & 16 deletions instat/frmMain.Designer.vb

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

4 changes: 0 additions & 4 deletions instat/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -2461,10 +2461,6 @@ Public Class frmMain
dlgPasteNewColumns.ShowDialog()
End Sub

Private Sub mnuEditScript_Click(sender As Object, e As EventArgs) Handles mnuEditScript.Click
dlgScript.ShowDialog()
End Sub

Private Sub mnuPrepareDataFrameSelectColumns_Click(sender As Object, e As EventArgs) Handles mnuPrepareDataFrameSelectColumns.Click
dlgSelect.ShowDialog()
End Sub
Expand Down
Loading

0 comments on commit 8398670

Please sign in to comment.