diff --git a/instat/clsGgplotDefaults.vb b/instat/clsGgplotDefaults.vb index 5b17b3f03b2..6845476ca84 100644 --- a/instat/clsGgplotDefaults.vb +++ b/instat/clsGgplotDefaults.vb @@ -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 @@ -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 @@ -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()) @@ -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()) @@ -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 @@ -466,4 +494,5 @@ Public Class GgplotDefaults Return dctDateStartMonths End Get End Property -End Class \ No newline at end of file +End Class + diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index d8162bacf49..75dc081567e 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -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) diff --git a/instat/dlgGeneralForGraphics.vb b/instat/dlgGeneralForGraphics.vb index 63a4428ba69..e34a0c309f0 100644 --- a/instat/dlgGeneralForGraphics.vb +++ b/instat/dlgGeneralForGraphics.vb @@ -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 @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index 1c685b8b2b6..009c05e0d8a 100644 --- a/instat/dlgLinePlot.vb +++ b/instat/dlgLinePlot.vb @@ -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 @@ -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 \ No newline at end of file diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 569780b40b2..c994302f7b8 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -364,8 +364,6 @@ Partial Class frmMain Me.mnuEditPasteNew = New System.Windows.Forms.ToolStripMenuItem() Me.mnuEditWordwrap = New System.Windows.Forms.ToolStripMenuItem() Me.mnuEditSelectAll = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripSeparator71 = New System.Windows.Forms.ToolStripSeparator() - Me.mnuEditScript = New System.Windows.Forms.ToolStripMenuItem() Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog() Me.stsStrip = New System.Windows.Forms.StatusStrip() Me.tstatus = New System.Windows.Forms.ToolStripStatusLabel() @@ -2840,7 +2838,7 @@ Partial Class frmMain ' 'mnuEdit ' - Me.mnuEdit.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuEditFind, Me.mnuEditCopy, Me.mnuEditPaste, Me.mnuEditPasteNew, Me.mnuEditWordwrap, Me.mnuEditSelectAll, Me.ToolStripSeparator71, Me.mnuEditScript}) + Me.mnuEdit.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuEditFind, Me.mnuEditCopy, Me.mnuEditPaste, Me.mnuEditPasteNew, Me.mnuEditWordwrap, Me.mnuEditSelectAll}) Me.mnuEdit.Name = "mnuEdit" Me.mnuEdit.Size = New System.Drawing.Size(58, 29) Me.mnuEdit.Tag = "Edit" @@ -2890,17 +2888,6 @@ Partial Class frmMain Me.mnuEditSelectAll.Tag = "Select_All" Me.mnuEditSelectAll.Text = "Select All " ' - 'ToolStripSeparator71 - ' - Me.ToolStripSeparator71.Name = "ToolStripSeparator71" - Me.ToolStripSeparator71.Size = New System.Drawing.Size(267, 6) - ' - 'mnuEditScript - ' - Me.mnuEditScript.Name = "mnuEditScript" - Me.mnuEditScript.Size = New System.Drawing.Size(270, 34) - Me.mnuEditScript.Text = "Script" - ' 'stsStrip ' Me.stsStrip.ImageScalingSize = New System.Drawing.Size(24, 24) @@ -5681,8 +5668,6 @@ Partial Class frmMain Friend WithEvents mnuLastGraph As ToolStripSplitButton Friend WithEvents mnuRViewer As ToolStripMenuItem Friend WithEvents mnuploty As ToolStripMenuItem - Friend WithEvents ToolStripSeparator71 As ToolStripSeparator - Friend WithEvents mnuEditScript As ToolStripMenuItem Friend WithEvents mnuPrepareDataFrameSelectColumns As ToolStripMenuItem Friend WithEvents mnuClimaticFileExportToClimsoft As ToolStripMenuItem Friend WithEvents mnuPrepareDataFrameDuplicateColumn As ToolStripMenuItem diff --git a/instat/frmMain.vb b/instat/frmMain.vb index b555cd7b9a5..065936033b6 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -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 diff --git a/instat/sdgPlots.vb b/instat/sdgPlots.vb index 37cffd2c873..5dd726c3388 100644 --- a/instat/sdgPlots.vb +++ b/instat/sdgPlots.vb @@ -32,9 +32,12 @@ Public Class sdgPlots Public clsXLabFunction As New RFunction Public clsXScalecontinuousFunction As New RFunction Public clsYScalecontinuousFunction As New RFunction + Public clsXScaleDiscreteFunction As New RFunction + Public clsYScaleDiscreteFunction As New RFunction Public clsXScaleDateFunction As New RFunction Public clsYScaleDateFunction As New RFunction Public clsYLabFunction As New RFunction + Public clsAttachFunction As New RFunction Public clsScaleColourViridisFunction As New RFunction Public clsScaleFillViridisFunction As New RFunction Private clsAnnotateFunction As New RFunction @@ -174,7 +177,6 @@ Public Class sdgPlots ucrChkLabeler.SetValuesCheckedAndUnchecked("label_both", "label_value") ucrChkLabeler.SetRDefault("label_value") - 'Not setting parameter to write because of complex conditions for adding/removing this parameter 'Conditions in place for reading function ucrPnlHorizonatalVertical.SetParameter(New RParameter("dir", 1)) @@ -202,6 +204,7 @@ Public Class sdgPlots ucrInputGraphTitle.SetParameter(New RParameter("title")) ucrInputGraphSubTitle.SetParameter(New RParameter("subtitle")) ucrInputGraphCaption.SetParameter(New RParameter("caption")) + ucrInputTag.SetParameter(New RParameter("tag")) ucrInputLegendTitle.SetParameter(New RParameter("colour")) @@ -640,8 +643,6 @@ Public Class sdgPlots ucrChkAddColour.AddParameterPresentCondition(True, "scale_colour", True) ucrChkAddColour.AddParameterPresentCondition(False, "scale_colour", False) - ttCaptionTitle.SetToolTip(ucrInputGraphCaption.txtInput, "Type \n where you would like a new-line") - grpFillScale.Visible = False grpColourScale.Visible = False End Sub @@ -650,7 +651,7 @@ Public Class sdgPlots clsNewXLabsTitleFunction As RFunction, clsNewYLabTitleFunction As RFunction, clsNewFacetFunction As RFunction, clsNewThemeFunction As RFunction, dctNewThemeFunctions As Dictionary(Of String, RFunction), ucrNewBaseSelector As ucrSelector, bReset As Boolean, Optional clsNewGlobalAesFunction As RFunction = Nothing, Optional clsNewXScaleDateFunction As RFunction = Nothing, Optional clsNewYScaleDateFunction As RFunction = Nothing, Optional clsNewScaleFillViridisFunction As RFunction = Nothing, Optional clsNewScaleColourViridisFunction As RFunction = Nothing, Optional strMainDialogGeomParameterNames() As String = Nothing, Optional clsNewAnnotateFunction As RFunction = Nothing, - Optional bNewEnableFill As Boolean = True, Optional bNewEnableColour As Boolean = True, Optional bNewEnableDiscrete As Boolean = True) + Optional bNewEnableFill As Boolean = True, Optional bNewChangeScales As Boolean = False, Optional bNewEnableColour As Boolean = True, Optional bNewEnableDiscrete As Boolean = True) Dim clsTempParam As RParameter bRCodeSet = False @@ -662,6 +663,11 @@ Public Class sdgPlots strDataFrame = ucrBaseSelector.strCurrentDataFrame ucrFacetSelector.SetDataframe(strDataFrame, False) End If + clsAttachFunction = New RFunction + clsAttachFunction.SetRCommand("attach") + clsAttachFunction.AddParameter("what", strDataFrame) + clsRsyntax.AddToAfterCodes(clsAttachFunction) + ucrFacetSelector.SetLinkedSelector(ucrBaseSelector) clsYScaleDateFunction = clsNewYScaleDateFunction clsXScaleDateFunction = clsNewXScaleDateFunction @@ -683,6 +689,7 @@ Public Class sdgPlots If Not IsNothing(clsCoordPolarStartOperator) Then clsCoordPolarFunc.AddParameter("start", clsROperatorParameter:=clsCoordPolarStartOperator, iPosition:=1) End If + dctThemeFunctions = dctNewThemeFunctions dctThemeFunctions.TryGetValue("axis.text.x", clsXElementText) dctThemeFunctions.TryGetValue("axis.title.x", clsXElementTitle) @@ -771,10 +778,11 @@ Public Class sdgPlots ucrInputXmax.SetRCode(clsAnnotateFunction, bReset, bCloneIfNeeded:=True) ucrInputYmax.SetRCode(clsAnnotateFunction, bReset, bCloneIfNeeded:=True) ucrInputAnnotationGeoms.SetRCode(clsAnnotateFunction, bReset, bCloneIfNeeded:=True) - 'axis controls - ucrXAxis.SetRCodeForControl(bIsXAxis:=True, strNewAxisType:=GetAxisType(True), clsNewXYlabTitleFunction:=clsXLabFunction, clsNewXYScaleContinuousFunction:=clsXScalecontinuousFunction, clsNewXYScaleDateFunction:=clsXScaleDateFunction, clsNewBaseOperator:=clsBaseOperator, bReset:=bReset, bCloneIfNeeded:=True) - ucrYAxis.SetRCodeForControl(bIsXAxis:=False, strNewAxisType:=GetAxisType(False), clsNewXYlabTitleFunction:=clsYLabFunction, clsNewXYScaleContinuousFunction:=clsYScalecontinuousFunction, clsNewBaseOperator:=clsBaseOperator, clsNewXYScaleDateFunction:=clsYScaleDateFunction, bReset:=bReset, bCloneIfNeeded:=True) + + 'axis controls + ucrXAxis.SetRCodeForControl(bIsXAxis:=True, strNewAxisType:=GetAxisType(True, bStrictDiscrete:=IsFactor(True, GetAesParameterArgValue("x"))), clsNewXYlabTitleFunction:=clsXLabFunction, clsNewXYScaleContinuousFunction:=clsXScalecontinuousFunction, clsNewXYScaleDateFunction:=clsXScaleDateFunction, clsNewBaseOperator:=clsBaseOperator, bReset:=bReset, bCloneIfNeeded:=True, strDataFrame:=strDataFrame, strNewVariable:=GetAesParameterArgValue("x")) + ucrYAxis.SetRCodeForControl(bIsXAxis:=False, strNewAxisType:=GetAxisType(False, bStrictDiscrete:=IsFactor(False, GetAesParameterArgValue("y"))), clsNewXYlabTitleFunction:=clsYLabFunction, clsNewXYScaleContinuousFunction:=clsYScalecontinuousFunction, clsNewBaseOperator:=clsBaseOperator, clsNewXYScaleDateFunction:=clsYScaleDateFunction, bReset:=bReset, bCloneIfNeeded:=True, strDataFrame:=strDataFrame, strNewVariable:=GetAesParameterArgValue("y")) 'Themes tab SetRcodeForCommonThemesControls(bReset) 'coordinates tab @@ -828,6 +836,43 @@ Public Class sdgPlots ucrChkFillDiscrete.Enabled = bNewEnableDiscrete End Sub + Private Function GetAesParameterArgValue(strAes As String) As String + Dim strVariable As String = "" + If clsGlobalAesFunction.ContainsParameter(strAes) Then + strVariable = clsGlobalAesFunction.GetParameter(strAes).strArgumentValue + End If + + Return strVariable + End Function + + Private Function IsFactor(bIsX As Boolean, strVariable As String) As Boolean + Dim strAes As String + strAes = If(bIsX, "x", "y") + + Dim bIsFactor As Boolean = False + If clsGlobalAesFunction.ContainsParameter(strAes) Then + + Dim strCurrDataType As String = "" + Dim clsGetDataType As New RFunction + Dim expColumnType As SymbolicExpression + + clsGetDataType.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_variables_metadata") + clsGetDataType.AddParameter("property", "data_type_label") + clsGetDataType.AddParameter("data_name", Chr(34) & strDataFrame & Chr(34)) + clsGetDataType.AddParameter("column", Chr(34) & strVariable & Chr(34)) + + expColumnType = frmMain.clsRLink.RunInternalScriptGetValue(clsGetDataType.ToScript(), bSilent:=True) + If expColumnType?.Type <> Internals.SymbolicExpressionType.Null Then + strCurrDataType = If(expColumnType.AsCharacter.Count > 1, Join(expColumnType.AsCharacter.ToArray, ","), expColumnType.AsCharacter(0)) + End If + + bIsFactor = If({"factor", "ordered,factor"}.Contains(strCurrDataType), True, False) + + End If + + Return bIsFactor + End Function + Private Sub SetFacetParameters() 'Depending on the settings on the dialog, this function sets the Facets command, stored within clsRFacetFunction. 'Then IncludeFacetsParameter() will add the facets command to the ggplot script as a parameter within RSyntax (unless no factor has been for fasceting, as R requires at least one facets argument). @@ -1034,8 +1079,7 @@ Public Class sdgPlots End If End Sub - Private Sub LabsControls_ControlValueChanged() Handles ucrInputGraphTitle.ControlValueChanged, ucrInputGraphSubTitle.ControlValueChanged, - ucrInputGraphCaption.ControlValueChanged, ucrInputLegendTitle.ControlValueChanged, ucrInputTag.ControlValueChanged + Private Sub LabsControls_ControlValueChanged() Handles ucrInputGraphTitle.ControlValueChanged, ucrInputGraphSubTitle.ControlValueChanged, ucrInputGraphCaption.ControlValueChanged AddRemoveLabs() End Sub @@ -1043,7 +1087,7 @@ Public Class sdgPlots SetFacetParameters() End Sub - Private Function GetAxisType(bIsX As Boolean) As String + Private Function GetAxisType(bIsX As Boolean, Optional bStrictDiscrete As Boolean = False) As String Dim strAes As String If bIsX Then @@ -1052,7 +1096,7 @@ Public Class sdgPlots strAes = "y" End If If clsGlobalAesFunction IsNot Nothing Then - If clsGlobalAesFunction.ContainsParameter(strAes) AndAlso clsGlobalAesFunction.GetParameter(strAes).strArgumentValue <> Chr(34) & Chr(34) Then + If clsGlobalAesFunction.ContainsParameter(strAes) AndAlso clsGlobalAesFunction.GetParameter(strAes).strArgumentValue <> Chr(34) AndAlso Not bStrictDiscrete Then 'Run R code to determine type 'Temp default to continuous Return "continuous" diff --git a/instat/static/InstatObject/R/install_packages.R b/instat/static/InstatObject/R/install_packages.R index f3af4aef9b6..8e89c42475f 100644 --- a/instat/static/InstatObject/R/install_packages.R +++ b/instat/static/InstatObject/R/install_packages.R @@ -168,6 +168,12 @@ pkgs <- #A 'ggplot2' extension that allows text to follow curved paths. "geomtextpath", "moderndive", + # Data Sets Useful for Modeling Examples + "modeldata", + # Data for an Introduction to Statistical Learning with Applications in R + "ISLR", + # Data and Code Behind the Stories and Interactives at 'FiveThirtyEight' + "fivethirtyeight", "collapse" ) pkgList <- pkgDep(pkgs, type="win.binary", repos = "https://cran.rstudio.com/", suggests = FALSE, includeBasePkgs = FALSE, Rversion = r_version) diff --git a/instat/translations/fr/fr_r_instat_menus.json b/instat/translations/fr/fr_r_instat_menus.json index 9e659619a23..076f5c84881 100644 --- a/instat/translations/fr/fr_r_instat_menus.json +++ b/instat/translations/fr/fr_r_instat_menus.json @@ -398,11 +398,11 @@ "Two Variable Frequencies by Sector (or other)...": "Deux fréquences variables par secteur (ou autre)...", "Two Variables": "Deux Variables", "Two Variables...": "Deux variables...", - "Unstack Daily Data...": "Désempiler les données quotidiennes...", - "Unstack...": "Désempiler...", + "Unstack Daily Data...": "Dépiler les données quotidiennes...", + "Unstack...": "Dépiler...", "Unused Levels...": "Niveaux non utilisés...", "Use Award Date (or other)...": "Utiliser la Date d’attribution (ou autre)...", - "Use Date...": "Date d'utilisation...", + "Use Date...": "Utiliser la Date...", "Use Graph...": "Utiliser le graphique...", "Use Model": "Utiliser le modèle", "Use Model Keyboard...": "Utiliser le tableau d'estimation du modèle...", @@ -444,8 +444,8 @@ "View/Delete Labels...": "Afficher/supprimer les étiquettes...", "Row Sumaries...": "Résumés de ligne...", "Permute/Sample Rows...": "Permuter/Échantillonner des lignes...", - "Stack (Pivot Longer)...": "Dépiler (Pivot plus Long)...", - "Unstack (Pivot Wider)...": "Dépiler (Pivot plus large)...", + "Stack (Pivot Longer)...": "Empiler (Pivoter en long)...", + "Unstack (Pivot Wider)...": "Dépiler (Pivoter vers largeur)...", "Merge (Join)...": "Fusionner (Joindre)...", "Append (Bind Rows)...": "Ajouter (Lier les lignes)...", "Random Split...": "Séparation aléatoire...", diff --git a/instat/translations/pt/pt_r_instat_not_menus.json b/instat/translations/pt/pt_r_instat_not_menus.json index fcfaf2ba521..f39216cd577 100644 --- a/instat/translations/pt/pt_r_instat_not_menus.json +++ b/instat/translations/pt/pt_r_instat_not_menus.json @@ -64,7 +64,7 @@ "10m v-component of wind": "10m componente v do vento", "125 is frugal because 125 = 5(cubed) and 5 and 3 are fewer digits (2) than 125 (3).": "125 é frugal porque 125 = 5 (cubo) e 5 e 3 são menos dígitos (2) do que 125 (3).", "13 is happy because 1(squared) + 3(squared) = 10, then 1(squared)+ 0(squared) = 1.": "13 é feliz porque 1(ao quadrado) + 3(ao quadrado) = 10, então 1(ao quadrado)+ 0(ao quadrado) = 1.", - "1st Factor:": "1° Fator", + "1st Factor:": "1° Fator:", "2 Digit": "2 Digit", "2 variables including generating a sequence of times": "2 variáveis, incluindo a geração de uma sequência de vezes", "2-digit years": "anos de dois dígitos", @@ -2712,7 +2712,7 @@ "Multiple columns": "Múltiplas colunas", "Multiply": "Multiplicar", "Multistate": "Multiestado", - "Multivariate": "Multivariada", + "Multivariate": "multivariada", "Multple Lines...": "Múltiplas Linhas...", "Muptiple Response": "Resposta Múltipla", "N": "N", diff --git a/instat/ucrAdditionalLayers.Designer.vb b/instat/ucrAdditionalLayers.Designer.vb index 640e05c704b..88b5190cd5e 100644 --- a/instat/ucrAdditionalLayers.Designer.vb +++ b/instat/ucrAdditionalLayers.Designer.vb @@ -19,7 +19,7 @@ Partial Class ucrAdditionalLayers Inherits System.Windows.Forms.UserControl 'UserControl overrides dispose to clean up the component list. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -36,23 +36,44 @@ Partial Class ucrAdditionalLayers 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. - _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() Me.lblLayers = New System.Windows.Forms.Label() Me.lstLayers = New System.Windows.Forms.ListView() Me.grpGeoms = New System.Windows.Forms.GroupBox() Me.cmdDelete = New System.Windows.Forms.Button() + Me.cmdAdd = New instat.ucrSplitButton() + Me.contextMenuStripAdd = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.toolStripMenuItemGeomBoxPlot = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomBar = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomCol = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomCount = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomDensity = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomJitter = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomPath = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomEncircle = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomDumbbell = New System.Windows.Forms.ToolStripMenuItem() Me.cmdEdit = New System.Windows.Forms.Button() - Me.cmdAdd = New System.Windows.Forms.Button() + Me.toolStripMenuItemGeomDensityRidges = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomLabel = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomLabelRepel = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomLine = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomPoint = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomRugSmooth = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomText = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItemGeomTextRepel = New System.Windows.Forms.ToolStripMenuItem() Me.grpGeoms.SuspendLayout() + Me.contextMenuStripAdd.SuspendLayout() Me.SuspendLayout() ' 'lblLayers ' Me.lblLayers.AutoSize = True - Me.lblLayers.Location = New System.Drawing.Point(4, 13) + Me.lblLayers.Location = New System.Drawing.Point(6, 20) + Me.lblLayers.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblLayers.Name = "lblLayers" - Me.lblLayers.Size = New System.Drawing.Size(41, 13) + Me.lblLayers.Size = New System.Drawing.Size(60, 20) Me.lblLayers.TabIndex = 5 Me.lblLayers.Text = "Layers:" ' @@ -60,9 +81,10 @@ Partial Class ucrAdditionalLayers ' Me.lstLayers.FullRowSelect = True Me.lstLayers.HideSelection = False - Me.lstLayers.Location = New System.Drawing.Point(3, 28) + Me.lstLayers.Location = New System.Drawing.Point(4, 42) + Me.lstLayers.Margin = New System.Windows.Forms.Padding(4) Me.lstLayers.Name = "lstLayers" - Me.lstLayers.Size = New System.Drawing.Size(125, 149) + Me.lstLayers.Size = New System.Drawing.Size(186, 222) Me.lstLayers.TabIndex = 4 Me.lstLayers.UseCompatibleStateImageBehavior = False Me.lstLayers.View = System.Windows.Forms.View.List @@ -70,53 +92,174 @@ Partial Class ucrAdditionalLayers 'grpGeoms ' Me.grpGeoms.Controls.Add(Me.cmdDelete) - Me.grpGeoms.Controls.Add(Me.cmdEdit) Me.grpGeoms.Controls.Add(Me.cmdAdd) - Me.grpGeoms.Location = New System.Drawing.Point(134, 53) + Me.grpGeoms.Controls.Add(Me.cmdEdit) + Me.grpGeoms.Location = New System.Drawing.Point(201, 80) + Me.grpGeoms.Margin = New System.Windows.Forms.Padding(4) Me.grpGeoms.Name = "grpGeoms" - Me.grpGeoms.Size = New System.Drawing.Size(106, 100) + Me.grpGeoms.Padding = New System.Windows.Forms.Padding(4) + Me.grpGeoms.Size = New System.Drawing.Size(159, 150) Me.grpGeoms.TabIndex = 9 Me.grpGeoms.TabStop = False Me.grpGeoms.Text = "Geoms:" ' 'cmdDelete ' - Me.cmdDelete.Location = New System.Drawing.Point(16, 72) + Me.cmdDelete.Location = New System.Drawing.Point(24, 108) + Me.cmdDelete.Margin = New System.Windows.Forms.Padding(4) Me.cmdDelete.Name = "cmdDelete" - Me.cmdDelete.Size = New System.Drawing.Size(75, 23) + Me.cmdDelete.Size = New System.Drawing.Size(112, 34) Me.cmdDelete.TabIndex = 9 Me.cmdDelete.Text = "Delete" Me.cmdDelete.UseVisualStyleBackColor = True ' + 'cmdAdd + ' + Me.cmdAdd.AutoSize = True + Me.cmdAdd.ContextMenuStrip = Me.contextMenuStripAdd + Me.cmdAdd.Location = New System.Drawing.Point(24, 22) + Me.cmdAdd.Margin = New System.Windows.Forms.Padding(4) + Me.cmdAdd.Name = "cmdAdd" + Me.cmdAdd.Size = New System.Drawing.Size(112, 34) + Me.cmdAdd.SplitMenuStrip = Me.contextMenuStripAdd + Me.cmdAdd.TabIndex = 11 + Me.cmdAdd.Tag = "Add" + Me.cmdAdd.Text = "Add" + Me.cmdAdd.UseVisualStyleBackColor = True + ' + 'contextMenuStripAdd + ' + Me.contextMenuStripAdd.ImageScalingSize = New System.Drawing.Size(24, 24) + Me.contextMenuStripAdd.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItemGeomBoxPlot, Me.toolStripMenuItemGeomBar, Me.toolStripMenuItemGeomCol, Me.toolStripMenuItemGeomCount, Me.toolStripMenuItemGeomDensity, Me.toolStripMenuItemGeomDensityRidges, Me.toolStripMenuItemGeomJitter, Me.toolStripMenuItemGeomPath, Me.toolStripMenuItemGeomEncircle, Me.toolStripMenuItemGeomDumbbell, Me.toolStripMenuItemGeomLabel, Me.toolStripMenuItemGeomLabelRepel, Me.toolStripMenuItemGeomLine, Me.toolStripMenuItemGeomPoint, Me.toolStripMenuItemGeomRugSmooth, Me.toolStripMenuItemGeomText, Me.toolStripMenuItemGeomTextRepel}) + Me.contextMenuStripAdd.Name = "contextMenuStripOk" + Me.contextMenuStripAdd.Size = New System.Drawing.Size(252, 581) + ' + 'toolStripMenuItemGeomBoxPlot + ' + Me.toolStripMenuItemGeomBoxPlot.Name = "toolStripMenuItemGeomBoxPlot" + Me.toolStripMenuItemGeomBoxPlot.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomBoxPlot.Text = "geom_boxplot" + ' + 'toolStripMenuItemGeomBar + ' + Me.toolStripMenuItemGeomBar.Name = "toolStripMenuItemGeomBar" + Me.toolStripMenuItemGeomBar.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomBar.Text = "geom_bar" + ' + 'toolStripMenuItemGeomCol + ' + Me.toolStripMenuItemGeomCol.Name = "toolStripMenuItemGeomCol" + Me.toolStripMenuItemGeomCol.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomCol.Text = "geom_col" + ' + 'toolStripMenuItemGeomCount + ' + Me.toolStripMenuItemGeomCount.Name = "toolStripMenuItemGeomCount" + Me.toolStripMenuItemGeomCount.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomCount.Text = "geom_count" + ' + 'toolStripMenuItemGeomDensity + ' + Me.toolStripMenuItemGeomDensity.Name = "toolStripMenuItemGeomDensity" + Me.toolStripMenuItemGeomDensity.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomDensity.Text = "geom_density" + ' + 'toolStripMenuItemGeomJitter + ' + Me.toolStripMenuItemGeomJitter.Name = "toolStripMenuItemGeomJitter" + Me.toolStripMenuItemGeomJitter.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomJitter.Text = "geom_jitter" + ' + 'toolStripMenuItemGeomPath + ' + Me.toolStripMenuItemGeomPath.Name = "toolStripMenuItemGeomPath" + Me.toolStripMenuItemGeomPath.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomPath.Text = "geom_path" + ' + 'toolStripMenuItemGeomEncircle + ' + Me.toolStripMenuItemGeomEncircle.Name = "toolStripMenuItemGeomEncircle" + Me.toolStripMenuItemGeomEncircle.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomEncircle.Text = "geom_encircle" + ' + 'toolStripMenuItemGeomDumbbell + ' + Me.toolStripMenuItemGeomDumbbell.Name = "toolStripMenuItemGeomDumbbell" + Me.toolStripMenuItemGeomDumbbell.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomDumbbell.Text = "geom_dumbbell" + ' 'cmdEdit ' - Me.cmdEdit.Location = New System.Drawing.Point(16, 43) + Me.cmdEdit.Location = New System.Drawing.Point(24, 64) + Me.cmdEdit.Margin = New System.Windows.Forms.Padding(4) Me.cmdEdit.Name = "cmdEdit" - Me.cmdEdit.Size = New System.Drawing.Size(75, 23) + Me.cmdEdit.Size = New System.Drawing.Size(112, 34) Me.cmdEdit.TabIndex = 10 Me.cmdEdit.Text = "Edit" Me.cmdEdit.UseVisualStyleBackColor = True ' - 'cmdAdd + 'toolStripMenuItemGeomDensityRidges ' - Me.cmdAdd.Location = New System.Drawing.Point(16, 14) - Me.cmdAdd.Name = "cmdAdd" - Me.cmdAdd.Size = New System.Drawing.Size(75, 23) - Me.cmdAdd.TabIndex = 11 - Me.cmdAdd.Text = "Add" - Me.cmdAdd.UseVisualStyleBackColor = True + Me.toolStripMenuItemGeomDensityRidges.Name = "toolStripMenuItemGeomDensityRidges" + Me.toolStripMenuItemGeomDensityRidges.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomDensityRidges.Text = "geom_density_ridges" + ' + 'toolStripMenuItemGeomLabel + ' + Me.toolStripMenuItemGeomLabel.Name = "toolStripMenuItemGeomLabel" + Me.toolStripMenuItemGeomLabel.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomLabel.Text = "geom_label" + ' + 'toolStripMenuItemGeomLabelRepel + ' + Me.toolStripMenuItemGeomLabelRepel.Name = "toolStripMenuItemGeomLabelRepel" + Me.toolStripMenuItemGeomLabelRepel.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomLabelRepel.Text = "geom_label_repel" + ' + 'toolStripMenuItemGeomLine + ' + Me.toolStripMenuItemGeomLine.Name = "toolStripMenuItemGeomLine" + Me.toolStripMenuItemGeomLine.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomLine.Text = "geom_line" + ' + 'toolStripMenuItemGeomPoint + ' + Me.toolStripMenuItemGeomPoint.Name = "toolStripMenuItemGeomPoint" + Me.toolStripMenuItemGeomPoint.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomPoint.Text = "geom_point" + ' + 'toolStripMenuItemGeomRugSmooth + ' + Me.toolStripMenuItemGeomRugSmooth.Name = "toolStripMenuItemGeomRugSmooth" + Me.toolStripMenuItemGeomRugSmooth.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomRugSmooth.Text = "geom_rug_smooth" + ' + 'toolStripMenuItemGeomText + ' + Me.toolStripMenuItemGeomText.Name = "toolStripMenuItemGeomText" + Me.toolStripMenuItemGeomText.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomText.Text = "geom_text" + ' + 'toolStripMenuItemGeomTextRepel + ' + Me.toolStripMenuItemGeomTextRepel.Name = "toolStripMenuItemGeomTextRepel" + Me.toolStripMenuItemGeomTextRepel.Size = New System.Drawing.Size(251, 32) + Me.toolStripMenuItemGeomTextRepel.Text = "geom_text_repel" ' 'ucrAdditionalLayers ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.Controls.Add(Me.grpGeoms) Me.Controls.Add(Me.lblLayers) Me.Controls.Add(Me.lstLayers) + Me.Margin = New System.Windows.Forms.Padding(4) Me.Name = "ucrAdditionalLayers" - Me.Size = New System.Drawing.Size(249, 180) + Me.Size = New System.Drawing.Size(374, 270) Me.grpGeoms.ResumeLayout(False) + Me.grpGeoms.PerformLayout() + Me.contextMenuStripAdd.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() @@ -126,5 +269,23 @@ Partial Class ucrAdditionalLayers Friend WithEvents grpGeoms As GroupBox Friend WithEvents cmdDelete As Button Friend WithEvents cmdEdit As Button - Friend WithEvents cmdAdd As Button + Friend WithEvents cmdAdd As ucrSplitButton + Friend WithEvents contextMenuStripAdd As ContextMenuStrip + Friend WithEvents toolStripMenuItemGeomBar As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomBoxPlot As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomCol As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomCount As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomDensity As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomJitter As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomPath As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomEncircle As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomDumbbell As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomDensityRidges As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomLabel As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomLabelRepel As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomLine As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomPoint As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomRugSmooth As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomText As ToolStripMenuItem + Friend WithEvents toolStripMenuItemGeomTextRepel As ToolStripMenuItem End Class diff --git a/instat/ucrAdditionalLayers.resx b/instat/ucrAdditionalLayers.resx index 29dcb1b3a35..b26c416b334 100644 --- a/instat/ucrAdditionalLayers.resx +++ b/instat/ucrAdditionalLayers.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/instat/ucrAdditionalLayers.vb b/instat/ucrAdditionalLayers.vb index 1f91bd1d1b6..77857eed708 100644 --- a/instat/ucrAdditionalLayers.vb +++ b/instat/ucrAdditionalLayers.vb @@ -90,30 +90,90 @@ Public Class ucrAdditionalLayers SetEditDeleteEnabled() End Sub - Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click - Dim clsNewLocalAesFunction As New RFunction - Dim clsNewGeomFunction As New RFunction - Dim clsNewGeomParameter As RParameter - - clsNewLocalAesFunction = GgplotDefaults.clsAesFunction.Clone() + Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click, toolStripMenuItemGeomBar.Click, toolStripMenuItemGeomBoxPlot.Click, toolStripMenuItemGeomCol.Click, toolStripMenuItemGeomCount.Click, + toolStripMenuItemGeomDensity.Click, toolStripMenuItemGeomEncircle.Click, toolStripMenuItemGeomJitter.Click, toolStripMenuItemGeomPath.Click, toolStripMenuItemGeomDumbbell.Click, toolStripMenuItemGeomLabel.Click, + toolStripMenuItemGeomLabelRepel.Click, toolStripMenuItemGeomLine.Click, toolStripMenuItemGeomPoint.Click, toolStripMenuItemGeomRugSmooth.Click, toolStripMenuItemGeomText.Click, toolStripMenuItemGeomTextRepel.Click, toolStripMenuItemGeomDensityRidges.Click - clsNewGeomFunction.SetPackageName("ggplot2") - clsNewGeomFunction.SetRCommand("geom_boxplot") + 'setup the geom function to use + Dim clsNewGeomFunction As New RFunction + Dim strGeomRCommand As String = "geom_boxplot" + Dim strPackage As String = "ggplot2" + Dim bShowLayerSubdialog As Boolean = False + + If sender Is toolStripMenuItemGeomBoxPlot Then + strGeomRCommand = "geom_boxplot" + ElseIf sender Is toolStripMenuItemGeomBar Then + strGeomRCommand = "geom_bar" + ElseIf sender Is toolStripMenuItemGeomCount Then + strGeomRCommand = "geom_count" + ElseIf sender Is toolStripMenuItemGeomCol Then + strGeomRCommand = "geom_col" + ElseIf sender Is toolStripMenuItemGeomDensity Then + strGeomRCommand = "geom_density" + ElseIf sender Is toolStripMenuItemGeomEncircle Then + strPackage = "ggalt" + strGeomRCommand = "geom_encircle" + ElseIf sender Is toolStripMenuItemGeomJitter Then + strGeomRCommand = "geom_jitter" + ElseIf sender Is toolStripMenuItemGeomPath Then + strGeomRCommand = "geom_path" + ElseIf sender Is toolStripMenuItemGeomDumbbell Then + strPackage = "ggalt" + strGeomRCommand = "geom_dumbbell" + ElseIf sender Is toolStripMenuItemGeomDensityRidges Then + strPackage = "ggridges" + strGeomRCommand = "geom_density_ridges" + ElseIf sender Is toolStripMenuItemGeomLabel Then + strGeomRCommand = "geom_label" + ElseIf sender Is toolStripMenuItemGeomLabelRepel Then + strPackage = "ggrepel" + strGeomRCommand = "geom_label_repel" + ElseIf sender Is toolStripMenuItemGeomLine Then + strGeomRCommand = "geom_line" + ElseIf sender Is toolStripMenuItemGeomPoint Then + strGeomRCommand = "geom_point" + ElseIf sender Is toolStripMenuItemGeomRugSmooth Then + strGeomRCommand = "geom_rug_smooth" + ElseIf sender Is toolStripMenuItemGeomText Then + strGeomRCommand = "geom_text" + ElseIf sender Is toolStripMenuItemGeomTextRepel Then + strPackage = "ggrepel" + strGeomRCommand = "geom_text_repel" + ElseIf sender Is cmdAdd Then + bShowLayerSubdialog = True + End If - sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsGgplotFunction, clsNewGeomFunc:=clsNewGeomFunction, clsNewGlobalAesFunc:=clsGlobalAesFunction, clsNewLocalAes:=clsNewLocalAesFunction, bFixGeom:=False, ucrNewBaseSelector:=Nothing, bApplyAesGlobally:=(bSetGlobalIsDefault AndAlso lstLayers.Items.Count = 0), iTabToDisplay:=0, strDataFrame:=strGlobalDataFrame) - ParentForm.SendToBack() - sdgLayerOptions.tbcLayers.SelectedIndex = 0 - sdgLayerOptions.ShowDialog() - strGlobalDataFrame = sdgLayerOptions.GetGlobalDataFrame() + clsNewGeomFunction.SetPackageName(strPackage) + clsNewGeomFunction.SetRCommand(strGeomRCommand) + + 'if no specific geom command selected then show the layer subdialog for geom command selection + If bShowLayerSubdialog Then + sdgLayerOptions.SetupLayer(clsNewGgPlot:=clsGgplotFunction, + clsNewGeomFunc:=clsNewGeomFunction, + clsNewGlobalAesFunc:=clsGlobalAesFunction, + clsNewLocalAes:=GgplotDefaults.clsAesFunction, + bFixGeom:=False, + ucrNewBaseSelector:=Nothing, + bApplyAesGlobally:=(bSetGlobalIsDefault AndAlso lstLayers.Items.Count = 0), + iTabToDisplay:=0, + strDataFrame:=strGlobalDataFrame) + ParentForm.SendToBack() + sdgLayerOptions.ShowDialog() + 'get the new options from the subdialog + 'todo. Should what should happen if a user clicks on Cancel in the sub dialog? + strGlobalDataFrame = sdgLayerOptions.GetGlobalDataFrame() + clsNewGeomFunction = sdgLayerOptions.clsGeomFunction.Clone() + End If - clsNewGeomFunction = sdgLayerOptions.clsGeomFunction.Clone() - iMaxParameterPosition = iMaxParameterPosition + 1 + 'incremnet the dialog parameter position to get unique argument name + iMaxParameterPosition += 1 - clsNewGeomParameter = New RParameter() - clsNewGeomParameter.SetArgumentName(clsNewGeomFunction.strRCommand & iMaxParameterPosition) - clsNewGeomParameter.SetArgument(clsNewGeomFunction) - clsNewGeomParameter.Position = iMaxParameterPosition + 'add the geom function as a new parameter of the dialog base operator + Dim clsNewGeomParameter As New RParameter(clsNewGeomFunction.strRCommand & iMaxParameterPosition, + clsNewGeomFunction, iNewPosition:=iMaxParameterPosition) clsBaseOperator.AddParameter(clsNewGeomParameter) + + 'add the parameter to the list of layers AddLayerToList(clsNewGeomParameter, clsNewGeomFunction.strRCommand, bLayerComplete:=sdgLayerOptions.TestForOKEnabled()) End Sub diff --git a/instat/ucrAxes.Designer.vb b/instat/ucrAxes.Designer.vb index 2c76ec33bbc..f89a9474b54 100644 --- a/instat/ucrAxes.Designer.vb +++ b/instat/ucrAxes.Designer.vb @@ -102,8 +102,8 @@ Partial Class ucrAxes Me.lblMinorBreaksFrom = New System.Windows.Forms.Label() Me.rdoMinorBreaksNone = New System.Windows.Forms.RadioButton() Me.grpSecondAxis = New System.Windows.Forms.GroupBox() + Me.ucrInputTrans = New instat.ucrInputComboBox() Me.ucrInputOffset = New instat.ucrInputComboBox() - Me.ucrChkOffset = New instat.ucrCheck() Me.rdoSecondAxisSpecifyTitle = New System.Windows.Forms.RadioButton() Me.rdoSecondAxisNoTitle = New System.Windows.Forms.RadioButton() Me.rdoSecondAxisTitleAuto = New System.Windows.Forms.RadioButton() @@ -112,13 +112,43 @@ Partial Class ucrAxes Me.ucrInputTextNameSAxis = New instat.ucrInputTextBox() Me.ucrInputSecondaryAxis = New instat.ucrInputComboBox() Me.ucrChkSecondaryAxis = New instat.ucrCheck() - Me.ucrInputTrans = New instat.ucrInputComboBox() + Me.ucrChkOffset = New instat.ucrCheck() + Me.grpScaleDiscrete = New System.Windows.Forms.GroupBox() + Me.ucrNudWrap = New instat.ucrNud() + Me.rdoAbbr = New System.Windows.Forms.RadioButton() + Me.rdoDodge = New System.Windows.Forms.RadioButton() + Me.rdoWrap = New System.Windows.Forms.RadioButton() + Me.ucrChkLongLabels = New instat.ucrCheck() + Me.lblTo = New System.Windows.Forms.Label() + Me.lblFrom = New System.Windows.Forms.Label() + Me.ucrNudTo = New instat.ucrNud() + Me.ucrNudFrom = New instat.ucrNud() + Me.ucrChkLimitsFrom = New instat.ucrCheck() + Me.ucrInputNaValueDiscrete = New instat.ucrInputTextBox() + Me.ucrInputExpandDiscrete = New instat.ucrInputTextBox() + Me.ucrInputPositionDiscrete = New instat.ucrInputComboBox() + Me.ucrChkExpandDiscrete = New instat.ucrCheck() + Me.ucrChkPositionDiscrete = New instat.ucrCheck() + Me.ucrChkNaValueDiscrete = New instat.ucrCheck() + Me.ucrInputDropUnusedLevels = New instat.ucrInputComboBox() + Me.ucrChkDropUnusedLevels = New instat.ucrCheck() + Me.ucrPnlLongLabels = New instat.UcrPanel() + Me.grpMajorBreaksDiscrete = New System.Windows.Forms.GroupBox() + Me.ucrChkBreakDiscret = New instat.ucrCheck() + Me.ucrInputBreaksDiscrete = New instat.ucrInputTextBox() + Me.ucrChkLimit = New instat.ucrCheck() + Me.ucrInputLimitDiscrete = New instat.ucrInputTextBox() + Me.ucrChkLabelsDiscrete = New instat.ucrCheck() + Me.ucrInputMajorBreaksLabelsDiscrete = New instat.ucrInputTextBox() + Me.UcrPanel1 = New instat.UcrPanel() Me.grpAxisTitle.SuspendLayout() Me.grpMajorBreaks.SuspendLayout() Me.grpScales.SuspendLayout() Me.grpScaleXDate.SuspendLayout() Me.grpMinorBreaks.SuspendLayout() Me.grpSecondAxis.SuspendLayout() + Me.grpScaleDiscrete.SuspendLayout() + Me.grpMajorBreaksDiscrete.SuspendLayout() Me.SuspendLayout() ' 'grpAxisTitle @@ -836,6 +866,17 @@ Partial Class ucrAxes Me.grpSecondAxis.TabStop = False Me.grpSecondAxis.Text = "Secondary Axis" ' + 'ucrInputTrans + ' + Me.ucrInputTrans.AddQuotesIfUnrecognised = True + Me.ucrInputTrans.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputTrans.GetSetSelectedIndex = -1 + Me.ucrInputTrans.IsReadOnly = False + Me.ucrInputTrans.Location = New System.Drawing.Point(170, 15) + Me.ucrInputTrans.Name = "ucrInputTrans" + Me.ucrInputTrans.Size = New System.Drawing.Size(78, 23) + Me.ucrInputTrans.TabIndex = 37 + ' 'ucrInputOffset ' Me.ucrInputOffset.AddQuotesIfUnrecognised = True @@ -847,15 +888,6 @@ Partial Class ucrAxes Me.ucrInputOffset.Size = New System.Drawing.Size(40, 23) Me.ucrInputOffset.TabIndex = 35 ' - 'ucrChkOffset - ' - Me.ucrChkOffset.AutoSize = True - Me.ucrChkOffset.Checked = False - Me.ucrChkOffset.Location = New System.Drawing.Point(267, 17) - Me.ucrChkOffset.Name = "ucrChkOffset" - Me.ucrChkOffset.Size = New System.Drawing.Size(93, 23) - Me.ucrChkOffset.TabIndex = 36 - ' 'rdoSecondAxisSpecifyTitle ' Me.rdoSecondAxisSpecifyTitle.AutoSize = True @@ -937,30 +969,338 @@ Partial Class ucrAxes Me.ucrChkSecondaryAxis.Size = New System.Drawing.Size(124, 23) Me.ucrChkSecondaryAxis.TabIndex = 24 ' - 'ucrInputTrans + 'ucrChkOffset ' - Me.ucrInputTrans.AddQuotesIfUnrecognised = True - Me.ucrInputTrans.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputTrans.GetSetSelectedIndex = -1 - Me.ucrInputTrans.IsReadOnly = False - Me.ucrInputTrans.Location = New System.Drawing.Point(170, 15) - Me.ucrInputTrans.Name = "ucrInputTrans" - Me.ucrInputTrans.Size = New System.Drawing.Size(78, 23) - Me.ucrInputTrans.TabIndex = 37 + Me.ucrChkOffset.AutoSize = True + Me.ucrChkOffset.Checked = False + Me.ucrChkOffset.Location = New System.Drawing.Point(267, 17) + Me.ucrChkOffset.Name = "ucrChkOffset" + Me.ucrChkOffset.Size = New System.Drawing.Size(93, 23) + Me.ucrChkOffset.TabIndex = 36 + ' + 'grpScaleDiscrete + ' + Me.grpScaleDiscrete.Controls.Add(Me.ucrNudWrap) + Me.grpScaleDiscrete.Controls.Add(Me.rdoAbbr) + Me.grpScaleDiscrete.Controls.Add(Me.rdoDodge) + Me.grpScaleDiscrete.Controls.Add(Me.rdoWrap) + Me.grpScaleDiscrete.Controls.Add(Me.ucrChkLongLabels) + Me.grpScaleDiscrete.Controls.Add(Me.lblTo) + Me.grpScaleDiscrete.Controls.Add(Me.lblFrom) + Me.grpScaleDiscrete.Controls.Add(Me.ucrNudTo) + Me.grpScaleDiscrete.Controls.Add(Me.ucrNudFrom) + Me.grpScaleDiscrete.Controls.Add(Me.ucrChkLimitsFrom) + Me.grpScaleDiscrete.Controls.Add(Me.ucrInputNaValueDiscrete) + Me.grpScaleDiscrete.Controls.Add(Me.ucrInputExpandDiscrete) + Me.grpScaleDiscrete.Controls.Add(Me.ucrInputPositionDiscrete) + Me.grpScaleDiscrete.Controls.Add(Me.ucrChkExpandDiscrete) + Me.grpScaleDiscrete.Controls.Add(Me.ucrChkPositionDiscrete) + Me.grpScaleDiscrete.Controls.Add(Me.ucrChkNaValueDiscrete) + Me.grpScaleDiscrete.Controls.Add(Me.ucrInputDropUnusedLevels) + Me.grpScaleDiscrete.Controls.Add(Me.ucrChkDropUnusedLevels) + Me.grpScaleDiscrete.Controls.Add(Me.ucrPnlLongLabels) + Me.grpScaleDiscrete.Location = New System.Drawing.Point(6, 90) + Me.grpScaleDiscrete.Name = "grpScaleDiscrete" + Me.grpScaleDiscrete.Size = New System.Drawing.Size(289, 228) + Me.grpScaleDiscrete.TabIndex = 37 + Me.grpScaleDiscrete.TabStop = False + Me.grpScaleDiscrete.Text = "Scales" + ' + 'ucrNudWrap + ' + Me.ucrNudWrap.AutoSize = True + Me.ucrNudWrap.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWrap.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudWrap.Location = New System.Drawing.Point(226, 186) + Me.ucrNudWrap.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudWrap.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudWrap.Name = "ucrNudWrap" + Me.ucrNudWrap.Size = New System.Drawing.Size(50, 20) + Me.ucrNudWrap.TabIndex = 39 + Me.ucrNudWrap.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'rdoAbbr + ' + Me.rdoAbbr.AutoSize = True + Me.rdoAbbr.Location = New System.Drawing.Point(15, 186) + Me.rdoAbbr.Name = "rdoAbbr" + Me.rdoAbbr.Size = New System.Drawing.Size(47, 17) + Me.rdoAbbr.TabIndex = 38 + Me.rdoAbbr.TabStop = True + Me.rdoAbbr.Text = "Abbr" + Me.rdoAbbr.UseVisualStyleBackColor = True + ' + 'rdoDodge + ' + Me.rdoDodge.AutoSize = True + Me.rdoDodge.Location = New System.Drawing.Point(85, 186) + Me.rdoDodge.Name = "rdoDodge" + Me.rdoDodge.Size = New System.Drawing.Size(57, 17) + Me.rdoDodge.TabIndex = 37 + Me.rdoDodge.TabStop = True + Me.rdoDodge.Text = "Dodge" + Me.rdoDodge.UseVisualStyleBackColor = True + ' + 'rdoWrap + ' + Me.rdoWrap.AutoSize = True + Me.rdoWrap.Location = New System.Drawing.Point(154, 186) + Me.rdoWrap.Name = "rdoWrap" + Me.rdoWrap.Size = New System.Drawing.Size(51, 17) + Me.rdoWrap.TabIndex = 36 + Me.rdoWrap.TabStop = True + Me.rdoWrap.Text = "Wrap" + Me.rdoWrap.UseVisualStyleBackColor = True + ' + 'ucrChkLongLabels + ' + Me.ucrChkLongLabels.AutoSize = True + Me.ucrChkLongLabels.Checked = False + Me.ucrChkLongLabels.Location = New System.Drawing.Point(6, 164) + Me.ucrChkLongLabels.Name = "ucrChkLongLabels" + Me.ucrChkLongLabels.Size = New System.Drawing.Size(202, 23) + Me.ucrChkLongLabels.TabIndex = 35 + ' + 'lblTo + ' + Me.lblTo.AutoSize = True + Me.lblTo.Location = New System.Drawing.Point(199, 22) + Me.lblTo.Name = "lblTo" + Me.lblTo.Size = New System.Drawing.Size(23, 13) + Me.lblTo.TabIndex = 34 + Me.lblTo.Text = "To:" + ' + 'lblFrom + ' + Me.lblFrom.AutoSize = True + Me.lblFrom.Location = New System.Drawing.Point(98, 24) + Me.lblFrom.Name = "lblFrom" + Me.lblFrom.Size = New System.Drawing.Size(33, 13) + Me.lblFrom.TabIndex = 33 + Me.lblFrom.Text = "From:" + ' + 'ucrNudTo + ' + Me.ucrNudTo.AutoSize = True + Me.ucrNudTo.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudTo.Location = New System.Drawing.Point(229, 19) + Me.ucrNudTo.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudTo.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudTo.Name = "ucrNudTo" + Me.ucrNudTo.Size = New System.Drawing.Size(50, 20) + Me.ucrNudTo.TabIndex = 32 + Me.ucrNudTo.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudFrom + ' + Me.ucrNudFrom.AutoSize = True + Me.ucrNudFrom.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudFrom.Location = New System.Drawing.Point(143, 19) + Me.ucrNudFrom.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudFrom.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFrom.Name = "ucrNudFrom" + Me.ucrNudFrom.Size = New System.Drawing.Size(50, 20) + Me.ucrNudFrom.TabIndex = 31 + Me.ucrNudFrom.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkLimitsFrom + ' + Me.ucrChkLimitsFrom.AutoSize = True + Me.ucrChkLimitsFrom.Checked = False + Me.ucrChkLimitsFrom.Location = New System.Drawing.Point(6, 22) + Me.ucrChkLimitsFrom.Name = "ucrChkLimitsFrom" + Me.ucrChkLimitsFrom.Size = New System.Drawing.Size(120, 23) + Me.ucrChkLimitsFrom.TabIndex = 30 + ' + 'ucrInputNaValueDiscrete + ' + Me.ucrInputNaValueDiscrete.AddQuotesIfUnrecognised = True + Me.ucrInputNaValueDiscrete.AutoSize = True + Me.ucrInputNaValueDiscrete.IsMultiline = False + Me.ucrInputNaValueDiscrete.IsReadOnly = False + Me.ucrInputNaValueDiscrete.Location = New System.Drawing.Point(191, 51) + Me.ucrInputNaValueDiscrete.Name = "ucrInputNaValueDiscrete" + Me.ucrInputNaValueDiscrete.Size = New System.Drawing.Size(78, 22) + Me.ucrInputNaValueDiscrete.TabIndex = 27 + ' + 'ucrInputExpandDiscrete + ' + Me.ucrInputExpandDiscrete.AddQuotesIfUnrecognised = True + Me.ucrInputExpandDiscrete.AutoSize = True + Me.ucrInputExpandDiscrete.IsMultiline = False + Me.ucrInputExpandDiscrete.IsReadOnly = False + Me.ucrInputExpandDiscrete.Location = New System.Drawing.Point(191, 136) + Me.ucrInputExpandDiscrete.Name = "ucrInputExpandDiscrete" + Me.ucrInputExpandDiscrete.Size = New System.Drawing.Size(78, 23) + Me.ucrInputExpandDiscrete.TabIndex = 27 + ' + 'ucrInputPositionDiscrete + ' + Me.ucrInputPositionDiscrete.AddQuotesIfUnrecognised = True + Me.ucrInputPositionDiscrete.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputPositionDiscrete.GetSetSelectedIndex = -1 + Me.ucrInputPositionDiscrete.IsReadOnly = False + Me.ucrInputPositionDiscrete.Location = New System.Drawing.Point(191, 79) + Me.ucrInputPositionDiscrete.Name = "ucrInputPositionDiscrete" + Me.ucrInputPositionDiscrete.Size = New System.Drawing.Size(78, 23) + Me.ucrInputPositionDiscrete.TabIndex = 26 + ' + 'ucrChkExpandDiscrete + ' + Me.ucrChkExpandDiscrete.AutoSize = True + Me.ucrChkExpandDiscrete.Checked = False + Me.ucrChkExpandDiscrete.Location = New System.Drawing.Point(6, 136) + Me.ucrChkExpandDiscrete.Name = "ucrChkExpandDiscrete" + Me.ucrChkExpandDiscrete.Size = New System.Drawing.Size(202, 23) + Me.ucrChkExpandDiscrete.TabIndex = 23 + ' + 'ucrChkPositionDiscrete + ' + Me.ucrChkPositionDiscrete.AutoSize = True + Me.ucrChkPositionDiscrete.Checked = False + Me.ucrChkPositionDiscrete.Location = New System.Drawing.Point(6, 79) + Me.ucrChkPositionDiscrete.Name = "ucrChkPositionDiscrete" + Me.ucrChkPositionDiscrete.Size = New System.Drawing.Size(202, 23) + Me.ucrChkPositionDiscrete.TabIndex = 23 + ' + 'ucrChkNaValueDiscrete + ' + Me.ucrChkNaValueDiscrete.AutoSize = True + Me.ucrChkNaValueDiscrete.Checked = False + Me.ucrChkNaValueDiscrete.Location = New System.Drawing.Point(6, 51) + Me.ucrChkNaValueDiscrete.Name = "ucrChkNaValueDiscrete" + Me.ucrChkNaValueDiscrete.Size = New System.Drawing.Size(202, 23) + Me.ucrChkNaValueDiscrete.TabIndex = 23 + ' + 'ucrInputDropUnusedLevels + ' + Me.ucrInputDropUnusedLevels.AddQuotesIfUnrecognised = True + Me.ucrInputDropUnusedLevels.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputDropUnusedLevels.GetSetSelectedIndex = -1 + Me.ucrInputDropUnusedLevels.IsReadOnly = False + Me.ucrInputDropUnusedLevels.Location = New System.Drawing.Point(191, 107) + Me.ucrInputDropUnusedLevels.Name = "ucrInputDropUnusedLevels" + Me.ucrInputDropUnusedLevels.Size = New System.Drawing.Size(78, 23) + Me.ucrInputDropUnusedLevels.TabIndex = 29 + ' + 'ucrChkDropUnusedLevels + ' + Me.ucrChkDropUnusedLevels.AutoSize = True + Me.ucrChkDropUnusedLevels.Checked = False + Me.ucrChkDropUnusedLevels.Location = New System.Drawing.Point(6, 108) + Me.ucrChkDropUnusedLevels.Name = "ucrChkDropUnusedLevels" + Me.ucrChkDropUnusedLevels.Size = New System.Drawing.Size(202, 23) + Me.ucrChkDropUnusedLevels.TabIndex = 28 + ' + 'ucrPnlLongLabels + ' + Me.ucrPnlLongLabels.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlLongLabels.Location = New System.Drawing.Point(9, 185) + Me.ucrPnlLongLabels.Name = "ucrPnlLongLabels" + Me.ucrPnlLongLabels.Size = New System.Drawing.Size(271, 23) + Me.ucrPnlLongLabels.TabIndex = 40 + ' + 'grpMajorBreaksDiscrete + ' + Me.grpMajorBreaksDiscrete.Controls.Add(Me.ucrChkBreakDiscret) + Me.grpMajorBreaksDiscrete.Controls.Add(Me.ucrInputBreaksDiscrete) + Me.grpMajorBreaksDiscrete.Controls.Add(Me.ucrChkLimit) + Me.grpMajorBreaksDiscrete.Controls.Add(Me.ucrInputLimitDiscrete) + Me.grpMajorBreaksDiscrete.Controls.Add(Me.ucrChkLabelsDiscrete) + Me.grpMajorBreaksDiscrete.Controls.Add(Me.ucrInputMajorBreaksLabelsDiscrete) + Me.grpMajorBreaksDiscrete.Controls.Add(Me.UcrPanel1) + Me.grpMajorBreaksDiscrete.Location = New System.Drawing.Point(314, 33) + Me.grpMajorBreaksDiscrete.Name = "grpMajorBreaksDiscrete" + Me.grpMajorBreaksDiscrete.Size = New System.Drawing.Size(309, 148) + Me.grpMajorBreaksDiscrete.TabIndex = 38 + Me.grpMajorBreaksDiscrete.TabStop = False + Me.grpMajorBreaksDiscrete.Text = "labels" + ' + 'ucrChkBreakDiscret + ' + Me.ucrChkBreakDiscret.AutoSize = True + Me.ucrChkBreakDiscret.Checked = False + Me.ucrChkBreakDiscret.Location = New System.Drawing.Point(5, 24) + Me.ucrChkBreakDiscret.Name = "ucrChkBreakDiscret" + Me.ucrChkBreakDiscret.Size = New System.Drawing.Size(87, 23) + Me.ucrChkBreakDiscret.TabIndex = 26 + ' + 'ucrInputBreaksDiscrete + ' + Me.ucrInputBreaksDiscrete.AddQuotesIfUnrecognised = True + Me.ucrInputBreaksDiscrete.AutoSize = True + Me.ucrInputBreaksDiscrete.IsMultiline = False + Me.ucrInputBreaksDiscrete.IsReadOnly = False + Me.ucrInputBreaksDiscrete.Location = New System.Drawing.Point(98, 23) + Me.ucrInputBreaksDiscrete.Name = "ucrInputBreaksDiscrete" + Me.ucrInputBreaksDiscrete.Size = New System.Drawing.Size(146, 21) + Me.ucrInputBreaksDiscrete.TabIndex = 25 + ' + 'ucrChkLimit + ' + Me.ucrChkLimit.AutoSize = True + Me.ucrChkLimit.Checked = False + Me.ucrChkLimit.Location = New System.Drawing.Point(4, 57) + Me.ucrChkLimit.Name = "ucrChkLimit" + Me.ucrChkLimit.Size = New System.Drawing.Size(87, 23) + Me.ucrChkLimit.TabIndex = 24 + ' + 'ucrInputLimitDiscrete + ' + Me.ucrInputLimitDiscrete.AddQuotesIfUnrecognised = True + Me.ucrInputLimitDiscrete.AutoSize = True + Me.ucrInputLimitDiscrete.IsMultiline = False + Me.ucrInputLimitDiscrete.IsReadOnly = False + Me.ucrInputLimitDiscrete.Location = New System.Drawing.Point(97, 56) + Me.ucrInputLimitDiscrete.Name = "ucrInputLimitDiscrete" + Me.ucrInputLimitDiscrete.Size = New System.Drawing.Size(146, 21) + Me.ucrInputLimitDiscrete.TabIndex = 23 + ' + 'ucrChkLabelsDiscrete + ' + Me.ucrChkLabelsDiscrete.AutoSize = True + Me.ucrChkLabelsDiscrete.Checked = False + Me.ucrChkLabelsDiscrete.Location = New System.Drawing.Point(5, 98) + Me.ucrChkLabelsDiscrete.Name = "ucrChkLabelsDiscrete" + Me.ucrChkLabelsDiscrete.Size = New System.Drawing.Size(87, 23) + Me.ucrChkLabelsDiscrete.TabIndex = 22 + ' + 'ucrInputMajorBreaksLabelsDiscrete + ' + Me.ucrInputMajorBreaksLabelsDiscrete.AddQuotesIfUnrecognised = True + Me.ucrInputMajorBreaksLabelsDiscrete.AutoSize = True + Me.ucrInputMajorBreaksLabelsDiscrete.IsMultiline = False + Me.ucrInputMajorBreaksLabelsDiscrete.IsReadOnly = False + Me.ucrInputMajorBreaksLabelsDiscrete.Location = New System.Drawing.Point(98, 97) + Me.ucrInputMajorBreaksLabelsDiscrete.Name = "ucrInputMajorBreaksLabelsDiscrete" + Me.ucrInputMajorBreaksLabelsDiscrete.Size = New System.Drawing.Size(146, 21) + Me.ucrInputMajorBreaksLabelsDiscrete.TabIndex = 4 + ' + 'UcrPanel1 + ' + Me.UcrPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.UcrPanel1.Location = New System.Drawing.Point(3, 19) + Me.UcrPanel1.Name = "UcrPanel1" + Me.UcrPanel1.Size = New System.Drawing.Size(335, 23) + Me.UcrPanel1.TabIndex = 18 ' 'ucrAxes ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi + Me.Controls.Add(Me.grpMajorBreaksDiscrete) Me.Controls.Add(Me.grpSecondAxis) - Me.Controls.Add(Me.grpScales) - Me.Controls.Add(Me.grpScaleXDate) Me.Controls.Add(Me.grpMinorBreaks) Me.Controls.Add(Me.ucrInputAxisType) Me.Controls.Add(Me.grpMajorBreaks) Me.Controls.Add(Me.grpAxisTitle) + Me.Controls.Add(Me.grpScaleDiscrete) + Me.Controls.Add(Me.grpScales) + Me.Controls.Add(Me.grpScaleXDate) Me.Name = "ucrAxes" - Me.Size = New System.Drawing.Size(670, 489) + Me.Size = New System.Drawing.Size(742, 504) Me.grpAxisTitle.ResumeLayout(False) Me.grpAxisTitle.PerformLayout() Me.grpMajorBreaks.ResumeLayout(False) @@ -973,6 +1313,10 @@ Partial Class ucrAxes Me.grpMinorBreaks.PerformLayout() Me.grpSecondAxis.ResumeLayout(False) Me.grpSecondAxis.PerformLayout() + Me.grpScaleDiscrete.ResumeLayout(False) + Me.grpScaleDiscrete.PerformLayout() + Me.grpMajorBreaksDiscrete.ResumeLayout(False) + Me.grpMajorBreaksDiscrete.PerformLayout() Me.ResumeLayout(False) End Sub @@ -1053,4 +1397,32 @@ Partial Class ucrAxes Friend WithEvents ucrChkOffset As ucrCheck Friend WithEvents ucrInputOffset As ucrInputComboBox Friend WithEvents ucrInputTrans As ucrInputComboBox + Friend WithEvents grpScaleDiscrete As GroupBox + Friend WithEvents lblTo As Label + Friend WithEvents lblFrom As Label + Friend WithEvents ucrNudTo As ucrNud + Friend WithEvents ucrNudFrom As ucrNud + Friend WithEvents ucrChkLimitsFrom As ucrCheck + Friend WithEvents ucrInputNaValueDiscrete As ucrInputTextBox + Friend WithEvents ucrInputExpandDiscrete As ucrInputTextBox + Friend WithEvents ucrInputPositionDiscrete As ucrInputComboBox + Friend WithEvents ucrChkExpandDiscrete As ucrCheck + Friend WithEvents ucrChkPositionDiscrete As ucrCheck + Friend WithEvents ucrChkNaValueDiscrete As ucrCheck + Friend WithEvents ucrInputDropUnusedLevels As ucrInputComboBox + Friend WithEvents ucrChkDropUnusedLevels As ucrCheck + Friend WithEvents grpMajorBreaksDiscrete As GroupBox + Friend WithEvents ucrChkBreakDiscret As ucrCheck + Friend WithEvents ucrInputBreaksDiscrete As ucrInputTextBox + Friend WithEvents ucrChkLimit As ucrCheck + Friend WithEvents ucrInputLimitDiscrete As ucrInputTextBox + Friend WithEvents ucrChkLabelsDiscrete As ucrCheck + Friend WithEvents ucrInputMajorBreaksLabelsDiscrete As ucrInputTextBox + Friend WithEvents UcrPanel1 As UcrPanel + Friend WithEvents ucrNudWrap As ucrNud + Friend WithEvents rdoAbbr As RadioButton + Friend WithEvents rdoDodge As RadioButton + Friend WithEvents rdoWrap As RadioButton + Friend WithEvents ucrChkLongLabels As ucrCheck + Friend WithEvents ucrPnlLongLabels As UcrPanel End Class diff --git a/instat/ucrAxes.vb b/instat/ucrAxes.vb index 6ee738d7e59..681ec4047d7 100644 --- a/instat/ucrAxes.vb +++ b/instat/ucrAxes.vb @@ -20,23 +20,37 @@ Public Class ucrAxes Public bIsX As Boolean Public clsXYlabTitleFunction As New RFunction Public clsXYScaleContinuousFunction As New RFunction + Public clsXYScaleDiscreteFunction As New RFunction + Public clsGlobalAesFunction As New RFunction Public clsXYScaleDateFunction As New RFunction Public clsLimitsFunction As New RFunction + Public clsLimitsFunctionDiscrete As New RFunction Public clsBaseOperator As New ROperator Public clsMajorBreaksSeqFunction As New RFunction Public clsMinorBreaksSeqFunction As New RFunction + Public clsMajorBreaksSeqDiscreteFunction As New RFunction + Public clsMinorBreaksSeqDiscreteFunction As New RFunction Public clsXYScaleDateBreakOperator As New ROperator Public clsXYScaleDateLimitFunction As New RFunction + Public clsConcatenateFunction As New RFunction + Public clsLeftBracketOperator As New ROperator + Public clsRightBracketOperator As New ROperator + Public clsSequenceOperator As New ROperator + Public clsLevelsFunction As New RFunction + Public clsXYSecondaryAxisFunction As New RFunction + Public clsGuideAxisFunction As New RFunction + Public clsLabelWrapFunction As New RFunction Public clsDummyFunction As New RFunction Public strAxis As String + Public strDataFrame As String + 'e.g. discrete, continuous Public strAxisType As String Public bFirstLoad As Boolean = True Private bControlsInitialised As Boolean = False Private bRCodeSet As Boolean = False - Public Sub InitialiseControl() Dim dctTickMarkers As New Dictionary(Of String, String) Dim dctDateFormat As New Dictionary(Of String, String) @@ -138,6 +152,36 @@ Public Class ucrAxes ucrInputMinorBreaksFrom.AddQuotesIfUnrecognised = False ucrInputMinorBreaksFrom.SetLinkedDisplayControl(lblMinorBreaksFrom) + ucrChkLabelsDiscrete.SetText("Labels") + ucrChkLabelsDiscrete.AddParameterPresentCondition(True, "label") + ucrChkLabelsDiscrete.AddParameterPresentCondition(False, "label", False) + ucrChkLabelsDiscrete.AddToLinkedControls(ucrInputMajorBreaksLabelsDiscrete, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="") + ucrInputMajorBreaksLabelsDiscrete.SetValidationTypeAsList() + + ucrChkLimit.SetText("Limits") + ucrChkLimit.AddParameterPresentCondition(True, "limit") + ucrChkLimit.AddParameterPresentCondition(False, "limit", False) + ucrChkLimit.AddToLinkedControls(ucrInputLimitDiscrete, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="") + ucrInputLimitDiscrete.SetValidationTypeAsList() + + ucrChkBreakDiscret.SetText("Breaks") + ucrChkBreakDiscret.AddParameterPresentCondition(True, "breaks") + ucrChkBreakDiscret.AddParameterPresentCondition(False, "breaks", False) + ucrChkBreakDiscret.AddToLinkedControls(ucrInputBreaksDiscrete, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="") + ucrInputBreaksDiscrete.SetValidationTypeAsList() + + ucrChkLimitsFrom.SetText("Limits") + ucrChkLimitsFrom.AddParameterPresentCondition(True, "from") + ucrChkLimitsFrom.AddParameterPresentCondition(False, "from", False) + ucrChkLimitsFrom.AddToLinkedControls(ucrNudFrom, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) + ucrChkLimitsFrom.AddToLinkedControls(ucrNudTo, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2) + + ucrNudFrom.SetMinMax(1, Integer.MaxValue) + ucrNudTo.SetMinMax(1, Integer.MaxValue) + + ucrNudFrom.SetLinkedDisplayControl(lblFrom) + ucrNudTo.SetLinkedDisplayControl(lblTo) + 'Scales section ucrPnlScales.AddRadioButton(rdoScalesAuto) ucrPnlScales.AddRadioButton(rdoScalesCustom) @@ -174,6 +218,16 @@ Public Class ucrAxes ucrChkNaValue.AddParameterPresentCondition(False, "na.value", False) ucrChkNaValue.AddToLinkedControls(ucrInputRelaceMissingvalues, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="") + ucrInputNaValueDiscrete.SetParameter(New RParameter("na.value")) + ucrInputNaValueDiscrete.SetValidationTypeAsNumeric() + ucrInputNaValueDiscrete.bAddRemoveParameter = False + ucrInputNaValueDiscrete.AddQuotesIfUnrecognised = False + + ucrChkNaValueDiscrete.SetText("Replace Missing Values") + ucrChkNaValueDiscrete.AddParameterPresentCondition(True, "na.value") + ucrChkNaValueDiscrete.AddParameterPresentCondition(False, "na.value", False) + ucrChkNaValueDiscrete.AddToLinkedControls(ucrInputNaValueDiscrete, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="") + ucrChkTransformation.SetText("Transformation") ucrInputTransformation.SetParameter(New RParameter("trans")) ucrChkTransformation.AddParameterPresentCondition(True, "trans") @@ -182,6 +236,14 @@ Public Class ucrAxes ucrInputTransformation.SetItems(New Dictionary(Of String, String)(GgplotDefaults.dctTransformations)) ucrInputTransformation.SetDropDownStyleAsNonEditable() + ucrChkDropUnusedLevels.SetText("Drop Unused Levels:") + ucrInputDropUnusedLevels.SetParameter(New RParameter("drop")) + ucrChkDropUnusedLevels.AddParameterPresentCondition(True, "drop") + ucrChkDropUnusedLevels.AddParameterPresentCondition(False, "drop", False) + ucrChkDropUnusedLevels.AddToLinkedControls(ucrInputDropUnusedLevels, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="TRUE") + ucrInputDropUnusedLevels.SetItems(New Dictionary(Of String, String)(GgplotDefaults.dctDropUnusedLevels)) + ucrInputDropUnusedLevels.SetDropDownStyleAsNonEditable() + ucrChkPosition.SetText("Position") ucrInputPosition.SetParameter(New RParameter("position")) ucrInputPosition.SetDropDownStyleAsNonEditable() @@ -189,12 +251,41 @@ Public Class ucrAxes ucrChkPosition.AddParameterPresentCondition(False, "position", False) ucrChkPosition.AddToLinkedControls(ucrInputPosition, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=Nothing) + ucrChkPositionDiscrete.SetText("Position") + ucrInputPositionDiscrete.SetParameter(New RParameter("position")) + ucrInputPositionDiscrete.SetDropDownStyleAsNonEditable() + ucrChkPositionDiscrete.AddParameterPresentCondition(True, "position") + ucrChkPositionDiscrete.AddParameterPresentCondition(False, "position", False) + ucrChkPositionDiscrete.AddToLinkedControls(ucrInputPositionDiscrete, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=Nothing) + ucrChkExpand.SetText("Expand") ucrChkExpand.AddParameterPresentCondition(True, "expand") ucrChkExpand.AddParameterPresentCondition(False, "expand", False) ucrChkExpand.AddToLinkedControls(ucrInputExpand, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="0.05,0") ucrInputExpand.SetValidationTypeAsNumericList() + ucrChkExpandDiscrete.SetText("Expand") + ucrChkExpandDiscrete.AddParameterPresentCondition(True, "expand") + ucrChkExpandDiscrete.AddParameterPresentCondition(False, "expand", False) + ucrChkExpandDiscrete.AddToLinkedControls(ucrInputExpandDiscrete, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="0.05,0") + ucrInputExpandDiscrete.SetValidationTypeAsNumericList() + + ucrChkLongLabels.SetText("Long Labels") + ucrChkLongLabels.AddParameterPresentCondition(True, "long") + ucrChkLongLabels.AddParameterPresentCondition(False, "long", False) + ucrChkLongLabels.AddToLinkedControls(ucrPnlLongLabels, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrPnlLongLabels.SetParameter(New RParameter("label", iNewPosition:=1)) + ucrPnlLongLabels.AddRadioButton(rdoAbbr) + ucrPnlLongLabels.AddRadioButton(rdoDodge) + ucrPnlLongLabels.AddRadioButton(rdoWrap) + ucrPnlLongLabels.AddParameterValuesCondition(rdoAbbr, "long_label", "abbr") + ucrPnlLongLabels.AddParameterValuesCondition(rdoDodge, "long_label", "dodge") + ucrPnlLongLabels.AddParameterValuesCondition(rdoWrap, "long_label", "wrap") + + ucrNudWrap.SetMinMax(1, Integer.MaxValue) + ucrPnlLongLabels.AddToLinkedControls(ucrNudWrap, {rdoWrap}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2) + 'secondary axis' ucrPnlSecondAxisTitle.SetParameter(New RParameter("name", iNewPosition:=1)) ucrPnlSecondAxisTitle.AddRadioButton(rdoSecondAxisTitleAuto) @@ -318,9 +409,17 @@ Public Class ucrAxes bControlsInitialised = True End Sub - Public Sub SetRCodeForControl(bIsXAxis As Boolean, Optional strNewAxisType As String = "continuous", Optional clsNewXYScaleContinuousFunction As RFunction = Nothing, Optional clsNewXYlabTitleFunction As RFunction = Nothing, Optional clsNewXYSecondaryAxisFunction As RFunction = Nothing, Optional clsNewXYScaleDateFunction As RFunction = Nothing, Optional clsNewBaseOperator As ROperator = Nothing, Optional bReset As Boolean = False, Optional bCloneIfNeeded As Boolean = False) + Public Sub SetRCodeForControl(bIsXAxis As Boolean, Optional strNewAxisType As String = "continuous", Optional clsNewXYScaleContinuousFunction As RFunction = Nothing, Optional clsNewXYScaleDiscreteFunction As RFunction = Nothing, Optional clsNewXYSecondaryAxisFunction As RFunction = Nothing, + Optional clsNewGlobalAesFunction As RFunction = Nothing, Optional strDataFrame As String = "", + Optional clsNewXYlabTitleFunction As RFunction = Nothing, Optional clsNewXYScaleDateFunction As RFunction = Nothing, Optional clsNewBaseOperator As ROperator = Nothing, Optional bReset As Boolean = False, Optional bCloneIfNeeded As Boolean = False, Optional strNewVariable As String = "") Dim clsTempBreaksParam As RParameter Dim clsTempMinorBreaksParam As RParameter + Dim strVariable As String = strNewVariable + + clsXYlabTitleFunction = clsNewXYlabTitleFunction + clsXYScaleDateFunction = clsNewXYScaleDateFunction + clsXYScaleContinuousFunction = clsNewXYScaleContinuousFunction + clsGlobalAesFunction = clsNewGlobalAesFunction bRCodeSet = False If Not bControlsInitialised Then @@ -338,6 +437,10 @@ Public Class ucrAxes strAxis = "y" End If + clsXYScaleDiscreteFunction = New RFunction + clsXYScaleDiscreteFunction.SetPackageName("ggplot2") + clsXYScaleDiscreteFunction.SetRCommand($"scale_{strAxis}_discrete") + If bIsX Then ucrInputPosition.SetItems(New Dictionary(Of String, String)(GgplotDefaults.dctXPosition)) ucrInputPosition.SetDefaultState("Bottom") @@ -347,6 +450,14 @@ Public Class ucrAxes End If ucrInputAxisType.SetName(strAxisType) + If bIsX Then + ucrInputPositionDiscrete.SetItems(New Dictionary(Of String, String)(GgplotDefaults.dctXPosition)) + ucrInputPositionDiscrete.SetDefaultState("Bottom") + Else + ucrInputPositionDiscrete.SetItems(New Dictionary(Of String, String)(GgplotDefaults.dctYPosition)) + ucrInputPositionDiscrete.SetDefaultState("Left") + End If + clsXYScaleDateLimitFunction = New RFunction clsXYScaleDateLimitFunction.SetRCommand("c") clsXYScaleDateLimitFunction.AddParameter("from", clsRFunctionParameter:=ucrDtpLowerLimit.ValueAsRDate(), iPosition:=0) @@ -359,13 +470,48 @@ Public Class ucrAxes clsDummyFunction = New RFunction clsDummyFunction.AddParameter("name", "auto", iPosition:=1) + clsDummyFunction.AddParameter("long_label", "abbr", iPosition:=2) clsXYSecondaryAxisFunction = New RFunction clsXYSecondaryAxisFunction.SetRCommand("sec_axis") - clsXYlabTitleFunction = clsNewXYlabTitleFunction - clsXYScaleDateFunction = clsNewXYScaleDateFunction - clsXYScaleContinuousFunction = clsNewXYScaleContinuousFunction + clsGuideAxisFunction = New RFunction + clsGuideAxisFunction.SetRCommand("guide_axis") + clsGuideAxisFunction.AddParameter("n.dodge", 2) + + clsLabelWrapFunction = New RFunction + clsLabelWrapFunction.SetPackageName("scales") + clsLabelWrapFunction.SetRCommand("label_wrap") + + Dim clsGetVariableFromDataFunction As New RFunction + clsGetVariableFromDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data") + clsGetVariableFromDataFunction.AddParameter("data_name", Chr(34) & strDataFrame & Chr(34), iPosition:=0) + clsGetVariableFromDataFunction.AddParameter("col_name", Chr(34) & strVariable & Chr(34), iPosition:=1) + clsGetVariableFromDataFunction.AddParameter("use_current_filter", "FALSE", iPosition:=2) + clsGetVariableFromDataFunction.SetAssignTo(strVariable) + + clsLevelsFunction.SetRCommand("levels") + + If Not String.IsNullOrEmpty(strVariable) Then + clsLevelsFunction.AddParameter("x", clsRFunctionParameter:=clsGetVariableFromDataFunction, bIncludeArgumentName:=False) + End If + + clsLeftBracketOperator.SetOperation("[") + clsLeftBracketOperator.AddParameter("left", clsRFunctionParameter:=clsLevelsFunction) + clsLeftBracketOperator.bBrackets = False + clsLeftBracketOperator.bSpaceAroundOperation = False + + clsRightBracketOperator.SetOperation("]") + clsRightBracketOperator.bSpaceAroundOperation = False + + clsSequenceOperator.SetOperation(":") + clsSequenceOperator.AddParameter("left", clsROperatorParameter:=clsLeftBracketOperator) + clsSequenceOperator.AddParameter("right", clsROperatorParameter:=clsRightBracketOperator) + clsSequenceOperator.bBrackets = False + + clsConcatenateFunction.SetRCommand("c") + clsConcatenateFunction.AddParameter("x", clsROperatorParameter:=clsSequenceOperator, bIncludeArgumentName:=False) + 'TODO these could be passed through as a dictionary of scale functions instead of searched If clsXYScaleContinuousFunction.ContainsParameter("limits") AndAlso clsXYScaleContinuousFunction.GetParameter("limits").clsArgumentCodeStructure IsNot Nothing Then @@ -441,6 +587,8 @@ Public Class ucrAxes ucrInputMajorBreaksCustom.SetRCode(clsXYScaleContinuousFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) ucrInputMajorBreaksLabels.SetRCode(clsXYScaleContinuousFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrInputMajorBreaksLabelsDiscrete.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + 'Scale_x_Date ucrChkDateLabels.SetRCode(clsXYScaleDateFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) ucrInputComboDateLabel.SetRCode(clsXYScaleDateFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) @@ -465,9 +613,37 @@ Public Class ucrAxes ucrInputMinorBreaksInStepsOf.SetRCode(clsMinorBreaksSeqFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) ucrChkLabels.SetRCode(clsXYScaleContinuousFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + + ucrNudFrom.SetRCode(clsLeftBracketOperator, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrNudTo.SetRCode(clsRightBracketOperator, bReset, bCloneIfNeeded:=bCloneIfNeeded) + + ucrNudWrap.SetRCode(clsLabelWrapFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + bRCodeSet = True + + If bReset Then + ucrChkLimitsFrom.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrInputPositionDiscrete.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrChkPositionDiscrete.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrInputLimitDiscrete.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrInputBreaksDiscrete.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrChkDropUnusedLevels.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrInputDropUnusedLevels.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrPnlLongLabels.SetRCode(clsDummyFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrChkLongLabels.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrChkExpand.SetRCode(clsXYScaleContinuousFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrChkExpandDiscrete.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrChkNaValueDiscrete.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrInputNaValueDiscrete.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrChkLabelsDiscrete.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrChkLimit.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + ucrChkBreakDiscret.SetRCode(clsXYScaleDiscreteFunction, bReset, bCloneIfNeeded:=bCloneIfNeeded) + End If SetLabel() AddRemoveContinuousXYScales() + AddRemoveDiscreteXYScales() + AddRemoveLimits() + AddRemoveLonglabels() End Sub Private Sub AddRemoveLabs() @@ -505,14 +681,28 @@ Public Class ucrAxes End If End Sub + Private Sub AddRemoveDiscreteXYScales() + Dim strScaleParam As String = $"scale_{strAxis}_discrete" + If clsXYScaleDiscreteFunction.clsParameters.Count > 0 Then + clsBaseOperator.AddParameter(strScaleParam, clsRFunctionParameter:=clsXYScaleDiscreteFunction) + Else + clsBaseOperator.RemoveParameterByName(strScaleParam) + End If + End Sub + Private Sub AddRemoveScaleFunctions() If strAxisType = "continuous" Then AddRemoveContinuousXYScales() + clsBaseOperator.AddParameter("scale" & "_" & strAxis & "_" & "continuous", clsRFunctionParameter:=clsXYScaleContinuousFunction) clsBaseOperator.RemoveParameterByName("scale" & "_" & strAxis & "_" & "date") + clsBaseOperator.RemoveParameterByName("scale" & "_" & strAxis & "_" & "discrete") ElseIf strAxisType = "date" Then clsBaseOperator.AddParameter("scale" & "_" & strAxis & "_" & "date", clsRFunctionParameter:=clsXYScaleDateFunction) + clsBaseOperator.RemoveParameterByName("scale" & "_" & strAxis & "_" & "discrete") clsBaseOperator.RemoveParameterByName("scale" & "_" & strAxis & "_" & "continuous") - Else + ElseIf strAxisType = "discrete" Then + AddRemoveDiscreteXYScales() + clsBaseOperator.AddParameter("scale" & "_" & strAxis & "_" & "discrete", clsRFunctionParameter:=clsXYScaleDiscreteFunction) clsBaseOperator.RemoveParameterByName("scale" & "_" & strAxis & "_" & "continuous") clsBaseOperator.RemoveParameterByName("scale" & "_" & strAxis & "_" & "date") End If @@ -522,33 +712,46 @@ Public Class ucrAxes SetAxisTypeControls() AddRemoveScaleFunctions() SecondaryAxis() + AddRemoveLimits() + AddRemoveLonglabels() End Sub Private Sub SetAxisTypeControls() - strAxisType = ucrInputAxisType.GetText() + Dim strAxisType As String = ucrInputAxisType.GetText() 'hide all axis type lanels grpMajorBreaks.Hide() - grpMinorBreaks.Hide() grpScales.Hide() + grpScaleDiscrete.Hide() grpScaleXDate.Hide() - grpSecondAxis.Hide() - - If strAxisType.ToLower = "continuous" Then - 'show continous panels - 'TODO put controls in panels so group boxes can be used for multiple cases - grpMajorBreaks.Show() - grpMinorBreaks.Show() - grpSecondAxis.Show() - grpScales.Show() - ElseIf strAxisType.ToLower = "discrete" Then - 'show discrete panels - ElseIf strAxisType.ToLower = "date" Then - 'show date panels - grpScaleXDate.Show() - grpMajorBreaks.Hide() - grpMinorBreaks.Hide() - grpScales.Hide() - End If + Select Case strAxisType + Case "continuous" + 'show continous panels + 'TODO put controls in panels so group boxes can be used for multiple cases + grpMajorBreaks.Show() + grpMinorBreaks.Show() + grpScales.Show() + grpScaleDiscrete.Hide() + grpMajorBreaksDiscrete.Hide() + grpSecondAxis.Show() + Case "discrete" + 'show discrete panels + grpSecondAxis.Hide() + grpScaleDiscrete.Show() + grpScaleXDate.Hide() + grpMajorBreaks.Hide() + grpMinorBreaks.Hide() + grpScales.Hide() + grpMajorBreaksDiscrete.Show() + Case "date" + 'show date panels + grpScaleXDate.Show() + grpMajorBreaks.Hide() + grpMinorBreaks.Hide() + grpScales.Hide() + grpScaleDiscrete.Hide() + grpMajorBreaksDiscrete.Hide() + grpSecondAxis.Show() + End Select End Sub Private Sub BreaksControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlMajorBreaks.ControlValueChanged, ucrInputMajorBreaksCustom.ControlValueChanged @@ -598,8 +801,13 @@ Public Class ucrAxes End If End Sub - Private Sub ScalesCheckboxes_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkExpand.ControlValueChanged, ucrChkPosition.ControlValueChanged, ucrChkTransformation.ControlValueChanged, ucrChkExpand.ControlValueChanged, ucrChkNaValue.ControlValueChanged + Private Sub ScalesCheckboxes_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkExpand.ControlValueChanged, ucrChkPosition.ControlValueChanged, ucrChkNaValue.ControlValueChanged, ucrChkTransformation.ControlValueChanged, + ucrChkLimitsFrom.ControlValueChanged, ucrChkLongLabels.ControlValueChanged, ucrChkDropUnusedLevels.ControlValueChanged AddRemoveContinuousXYScales() + AddRemoveDiscreteXYScales() + AddRemoveScaleFunctions() + AddRemoveLimits() + AddRemoveLonglabels() End Sub Private Sub LabelsControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLabels.ControlValueChanged, ucrInputMajorBreaksLabels.ControlValueChanged @@ -616,6 +824,36 @@ Public Class ucrAxes AddRemoveContinuousXYScales() End Sub + Private Sub SetLabelsDiscreteParameter() + If ucrChkLabelsDiscrete.Checked AndAlso Not ucrInputMajorBreaksLabelsDiscrete.IsEmpty Then + 'TODO add functionality to input control to do this automatically for a list + clsXYScaleDiscreteFunction.AddParameter("labels", ucrInputMajorBreaksLabelsDiscrete.clsRList.ToScript()) + Else + clsXYScaleDiscreteFunction.RemoveParameterByName("labels") + End If + AddRemoveDiscreteXYScales() + End Sub + + Private Sub SetBreaksDiscrete() + If ucrChkBreakDiscret.Checked AndAlso Not ucrInputBreaksDiscrete.IsEmpty() Then + 'TODO add functionality to input control to do this automatically for a list + clsXYScaleDiscreteFunction.AddParameter("breaks", ucrInputBreaksDiscrete.clsRList.ToScript()) + Else + clsXYScaleDiscreteFunction.RemoveParameterByName("breaks") + End If + AddRemoveDiscreteXYScales() + End Sub + + Private Sub SetLimitsDiscrete() + If ucrChkLimit.Checked AndAlso Not ucrInputLimitDiscrete.IsEmpty() Then + 'TODO add functionality to input control to do this automatically for a list + clsXYScaleDiscreteFunction.AddParameter("limit", ucrInputLimitDiscrete.clsRList.ToScript()) + Else + clsXYScaleDiscreteFunction.RemoveParameterByName("limit") + End If + AddRemoveDiscreteXYScales() + End Sub + Private Sub SecondaryAxis() If ucrChkSecondaryAxis.Checked Then If ucrChkOffset.Checked Then @@ -650,6 +888,49 @@ Public Class ucrAxes End If End Sub + Private Sub ExpandControl() + If strAxisType = "discrete" AndAlso ucrChkExpandDiscrete.Checked AndAlso Not ucrInputExpandDiscrete.IsEmpty Then + clsXYScaleDiscreteFunction.AddParameter("expand", clsRFunctionParameter:=ucrInputExpandDiscrete.clsRList) + Else + clsXYScaleDiscreteFunction.RemoveParameterByName("expand") + End If + End Sub + + Private Sub ucrChkExpandDiscrete_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkExpandDiscrete.ControlValueChanged + ExpandControl() + AddRemoveScaleFunctions() + AddRemoveDiscreteXYScales() + End Sub + + Private Sub ucrChkLabelsDiscrete_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLabelsDiscrete.ControlValueChanged, ucrInputMajorBreaksLabelsDiscrete.ControlValueChanged + SetLabelsDiscreteParameter() + End Sub + + Private Sub ucrChkLimit_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLimit.ControlValueChanged, ucrInputLimitDiscrete.ControlValueChanged + SetLimitsDiscrete() + End Sub + + Private Sub ucrChkBreakDiscret_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkBreakDiscret.ControlValueChanged, ucrInputBreaksDiscrete.ControlValueChanged + SetBreaksDiscrete() + End Sub + + Private Sub AddRemoveLimits() + If ucrChkLimitsFrom.Checked AndAlso Not ucrNudFrom.IsEmpty AndAlso Not ucrNudTo.IsEmpty Then + clsLeftBracketOperator.AddParameter("right", ucrNudFrom.GetText, bIncludeArgumentName:=False) + clsRightBracketOperator.AddParameter("left", ucrNudTo.GetText & "]", bIncludeArgumentName:=False) + clsXYScaleDiscreteFunction.AddParameter("limits", clsRFunctionParameter:=clsConcatenateFunction) + Else + clsLeftBracketOperator.RemoveParameterByName("right") + clsRightBracketOperator.RemoveParameterByName("left") + clsXYScaleDiscreteFunction.RemoveParameterByName("limits") + End If + AddRemoveDiscreteXYScales() + End Sub + + Private Sub ucrChkLimitsFrom_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLimitsFrom.ControlValueChanged, ucrNudFrom.ControlValueChanged, ucrNudTo.ControlValueChanged + AddRemoveLimits() + End Sub + Private Sub SetNameSecondaryAxis() clsXYSecondaryAxisFunction.RemoveParameterByName("name") If rdoSecondAxisNoTitle.Checked Then @@ -659,8 +940,28 @@ Public Class ucrAxes End If End Sub + Private Sub AddRemoveLonglabels() + If ucrChkLongLabels.Checked Then + If rdoAbbr.Checked Then + clsXYScaleDiscreteFunction.AddParameter("labels", "abbreviate") + ElseIf rdoDodge.Checked Then + clsXYScaleDiscreteFunction.AddParameter("labels", clsRFunctionParameter:=clsGuideAxisFunction) + ElseIf rdoWrap.Checked Then + clsLabelWrapFunction.AddParameter("wrap", ucrNudWrap.GetText, bIncludeArgumentName:=False) + clsXYScaleDiscreteFunction.AddParameter("labels", clsRFunctionParameter:=clsLabelWrapFunction) + End If + Else + clsXYScaleDiscreteFunction.RemoveParameterByName("labels") + End If + AddRemoveDiscreteXYScales() + End Sub Private Sub ucrChkSecondaryAxis_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSecondaryAxis.ControlValueChanged, ucrInputSecondaryAxis.ControlValueChanged, ucrPnlSecondAxisTitle.ControlValueChanged, ucrInputTextNameSAxis.ControlValueChanged, ucrInputTrans.ControlValueChanged, ucrChkOffset.ControlValueChanged, ucrInputOffset.ControlValueChanged SetNameSecondaryAxis() SecondaryAxis() End Sub + + Private Sub ucrPnlLongLabels_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlLongLabels.ControlValueChanged, ucrChkLongLabels.ControlValueChanged, ucrNudWrap.ControlValueChanged + AddRemoveLonglabels() + End Sub + End Class \ No newline at end of file