From 5a2a0f36a63979937b26f279016f081c3f2a5f6b Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Tue, 7 Jun 2016 17:16:18 +0300 Subject: [PATCH 1/6] Changing AddItems to SetItems for the ucrInput as well as adding array of srings for parameters --- instat/clsGeom.vb | 4 +- instat/dlgSplitText.vb | 2 +- instat/ucrColors.vb | 2 +- instat/ucrFilter.vb | 2 +- instat/ucrGeom.vb | 860 +++++++++++++------------- instat/ucrInputConfidenceLimit.vb | 2 +- instat/ucrLayerParameters.Designer.vb | 24 +- instat/ucrLayerParameters.vb | 3 +- instat/ucrLayerParamsControls.vb | 7 +- 9 files changed, 482 insertions(+), 424 deletions(-) diff --git a/instat/clsGeom.vb b/instat/clsGeom.vb index 9f8b99ef364..a84b44e728d 100644 --- a/instat/clsGeom.vb +++ b/instat/clsGeom.vb @@ -34,12 +34,13 @@ Public Class Geoms clsAesParameters.Add(NewAesParameter) End Sub - Public Sub AddLayerParameter(strLayerParameterName As String, strLayerParameterDataType As String, strLayerParameterDefaultValue As String, Optional bIsDependent As Boolean = False, Optional strDependentParameter As String = "", Optional strDependantpParameterValue As String = "") + Public Sub AddLayerParameter(strLayerParameterName As String, strLayerParameterDataType As String, strLayerParameterDefaultValue As String, Optional bIsDependent As Boolean = False, Optional lstParameterStrings As String() = Nothing, Optional strDependentParameter As String = "", Optional strDependantpParameterValue As String = "") Dim NewLayerParameter As New LayerParameters NewLayerParameter.strLayerParameterName = strLayerParameterName NewLayerParameter.strLayerParameterDataType = strLayerParameterDataType NewLayerParameter.strParameterDefaultValue = strLayerParameterDefaultValue + NewLayerParameter.lstParameterStrings = lstParameterStrings 'NewLayerParameter.strDependentParameter = strDependentParameter 'NewLayerParameter.strDependantparameterValue = strDependantpParameterValue 'NewLayerParameter.bIsDependent = bIsDependent @@ -65,4 +66,5 @@ Public Class LayerParameters Public strDependentParameter As String Public strDependantparameterValue As String Public bIsDependent As Boolean + Public lstParameterStrings As String() End Class \ No newline at end of file diff --git a/instat/dlgSplitText.vb b/instat/dlgSplitText.vb index 3299e724a4e..e56d1a3d75d 100644 --- a/instat/dlgSplitText.vb +++ b/instat/dlgSplitText.vb @@ -43,7 +43,7 @@ Public Class dlgSplitText ucrInputColumnsIntoText.SetItemsTypeAsColumns() ucrInputColumnsIntoText.SetDefaultTypeAsColumn() ucrInputColumnsIntoText.SetDataFrameSelector(ucrSelectorSplitTextColumn.ucrAvailableDataFrames) - ucrInputPattern.AddItems({"Whitespace", ".", "-", "_"}) + ucrInputPattern.SetItems({"Whitespace", ".", "-", "_"}) ucrBase.iHelpTopicID = 344 End Sub diff --git a/instat/ucrColors.vb b/instat/ucrColors.vb index 380afcdb1d7..ffd8b811b91 100644 --- a/instat/ucrColors.vb +++ b/instat/ucrColors.vb @@ -16,7 +16,7 @@ Public Class ucrColors Private Sub ucrColors_Load(sender As Object, e As EventArgs) Handles Me.Load - Me.AddItems({"Pick Colour", "black", "white", "blue", "red", "yellow", "purple", "green", "orange", "grey", "brown", "pink", "NULL"}) + Me.SetItems({"Pick Colour", "black", "white", "blue", "red", "yellow", "purple", "green", "orange", "grey", "brown", "pink", "NULL"}) End Sub Private Sub ucrColors_NameChanged() Handles Me.NameChanged diff --git a/instat/ucrFilter.vb b/instat/ucrFilter.vb index e91a5cc0ba5..6d719863707 100644 --- a/instat/ucrFilter.vb +++ b/instat/ucrFilter.vb @@ -50,7 +50,7 @@ Public Class ucrFilter Private Sub InitialiseControl() ucrFilterPreview.txtInput.ReadOnly = True ucrFilterByReceiver.Selector = ucrSelectorForFitler - ucrFilterOperation.AddItems({"==", "<", "<=", ">", ">=", "!="}) + ucrFilterOperation.SetItems({"==", "<", "<=", ">", ">=", "!="}) ucrFactorLevels.SetAsMultipleSelector() ucrFactorLevels.SetReceiver(ucrFilterByReceiver) clsFilterView.bForceIncludeOperation = False diff --git a/instat/ucrGeom.vb b/instat/ucrGeom.vb index e6e6cc1608c..23bc80c8392 100644 --- a/instat/ucrGeom.vb +++ b/instat/ucrGeom.vb @@ -25,6 +25,7 @@ Public Class ucrGeom Public lstFunctionParameters As New List(Of RParameter) Private bFirstLoad As Boolean = True Public clsRaesFunction As New RFunction + Private Sub UcrGeoms_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseControl() @@ -50,7 +51,6 @@ Public Class ucrGeom Public Sub SetFuncSync(clsGeomFunc As RFunction) clsGeomFunction = clsGeomFunc End Sub - Public Sub AddParameter(strAesParameterName As String, strAesParameterValue As String) 'this adds parameters TODO pass appropriate parameters. Dim i As Integer @@ -111,51 +111,58 @@ Public Class ucrGeom Dim clsgeom_vline As New Geoms - clsgeom_abline.SetGeomName("geom_abline") - clsgeom_abline.AddAesParameter("x", bIsMandatory:=True) - clsgeom_abline.AddAesParameter("y", bIsMandatory:=True) - clsgeom_abline.AddAesParameter("alpha") - clsgeom_abline.AddAesParameter("colour") - clsgeom_abline.AddAesParameter("linetype") - clsgeom_abline.AddAesParameter("size") - 'aesthetics that control position of line include - 'geom_vline:xintercept - 'geom_hline:yintercept - 'geom_abline: slope and intercept - 'TO DO Discuss how to use these - lstAllGeoms.Add(clsgeom_abline) - - clsgeom_area.SetGeomName("geom_area") - 'mandatory aesthetics - clsgeom_area.AddAesParameter("x", bIsMandatory:=True) - clsgeom_area.AddAesParameter("ymax", bIsMandatory:=True) - clsgeom_area.AddAesParameter("ymin", bIsMandatory:=True) - 'Optional - clsgeom_area.AddAesParameter("alpha") - clsgeom_area.AddAesParameter("colour") - clsgeom_area.AddAesParameter("fill") - clsgeom_area.AddAesParameter("linetype") - clsgeom_area.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_area) + 'clsgeom_abline.SetGeomName("geom_abline") + 'clsgeom_abline.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_abline.AddAesParameter("y", bIsMandatory:=True) + 'clsgeom_abline.AddAesParameter("alpha") + 'clsgeom_abline.AddAesParameter("colour") + 'clsgeom_abline.AddAesParameter("linetype") + 'clsgeom_abline.AddAesParameter("size") + ''aesthetics that control position of line include + ''geom_vline:xintercept + ''geom_hline:yintercept + ''geom_abline: slope and intercept + ''TO DO Discuss how to use these + 'lstAllGeoms.Add(clsgeom_abline) + + 'clsgeom_area.SetGeomName("geom_area") + ''mandatory aesthetics + 'clsgeom_area.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_area.AddAesParameter("ymax", bIsMandatory:=True) + 'clsgeom_area.AddAesParameter("ymin", bIsMandatory:=True) + ''Optional + 'clsgeom_area.AddAesParameter("alpha") + 'clsgeom_area.AddAesParameter("colour") + 'clsgeom_area.AddAesParameter("fill") + 'clsgeom_area.AddAesParameter("linetype") + 'clsgeom_area.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_area) clsgeom_bar.SetGeomName("geom_bar") - clsgeom_bar.AddAesParameter("x", bIsMandatory:=True) + clsgeom_bar.AddAesParameter("x", strIncludedDataTypes:=({"factor"}), bIsMandatory:=True) 'Optional - clsgeom_bar.AddAesParameter("alpha") - clsgeom_bar.AddAesParameter("fill") - clsgeom_bar.AddAesParameter("colour") - clsgeom_bar.AddAesParameter("linetype") - clsgeom_bar.AddAesParameter("size") + 'we can map a continuous variable to y but we must include stat = “identity” inside the geom. + clsgeom_bar.AddAesParameter("y", strIncludedDataTypes:=({"numeric"})) + clsgeom_bar.AddAesParameter("alpha", strIncludedDataTypes:=({"factor"})) + clsgeom_bar.AddAesParameter("fill", strIncludedDataTypes:=({"factor"})) + clsgeom_bar.AddAesParameter("colour", strIncludedDataTypes:=({"factor"})) + clsgeom_bar.AddAesParameter("linetype", strIncludedDataTypes:=({"factor"})) ' won't visibly change anything unless you change the theme + clsgeom_bar.AddAesParameter("size", strIncludedDataTypes:=({"factor"})) ' won't visibly change anything unless you change the theme + + 'add layer parameters + clsgeom_bar.AddLayerParameter("stat", "list", "count", lstParameterStrings:={"count", "identity"}) + clsgeom_bar.AddLayerParameter("position", "list", "stack", lstParameterStrings:={"fill", "dodge"}) + clsgeom_bar.AddLayerParameter("width", "numeric", "90%") lstAllGeoms.Add(clsgeom_bar) - clsgeom_bin2d.SetGeomName("geom_bin2d") - 'mandatory - clsgeom_bin2d.AddAesParameter("x", bIsMandatory:=True) - clsgeom_bin2d.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_bin2d.AddAesParameter("fill") - lstAllGeoms.Add(clsgeom_bin2d) + 'clsgeom_bin2d.SetGeomName("geom_bin2d") + ''mandatory + 'clsgeom_bin2d.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_bin2d.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_bin2d.AddAesParameter("fill") + 'lstAllGeoms.Add(clsgeom_bin2d) clsgeom_boxplot.SetGeomName("geom_boxplot") @@ -178,127 +185,149 @@ Public Class ucrGeom clsgeom_boxplot.AddLayerParameter("outlier.stroke ", "numeric", "0.5") lstAllGeoms.Add(clsgeom_boxplot) - clsgeom_contour.SetGeomName("geom_contour") - 'Mandatory - clsgeom_contour.AddAesParameter("x", bIsMandatory:=True) - clsgeom_contour.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_contour.AddAesParameter("alpha") - clsgeom_contour.AddAesParameter("colour") - clsgeom_contour.AddAesParameter("linetype") - clsgeom_contour.AddAesParameter("size") - clsgeom_contour.AddAesParameter("weight") - lstAllGeoms.Add(clsgeom_contour) - - clsgeom_count.SetGeomName("geom_count") - 'mandatory - clsgeom_count.AddAesParameter("x", bIsMandatory:=True) - clsgeom_count.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_count.AddAesParameter("alpha") - clsgeom_count.AddAesParameter("colour") - clsgeom_count.AddAesParameter("fill") - clsgeom_count.AddAesParameter("shape") - clsgeom_count.AddAesParameter("size") - clsgeom_count.AddAesParameter("stroke") - lstAllGeoms.Add(clsgeom_count) - - clsgeom_crossbar.strGeomName = "geom_crossbar" - 'Mandatory - clsgeom_crossbar.AddAesParameter("x", bIsMandatory:=True) - clsgeom_crossbar.AddAesParameter("ymax", bIsMandatory:=True) - clsgeom_crossbar.AddAesParameter("ymin", bIsMandatory:=True) - 'Optional - clsgeom_crossbar.AddAesParameter("alpha") - clsgeom_crossbar.AddAesParameter("colour") - clsgeom_crossbar.AddAesParameter("linetype") - clsgeom_crossbar.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_crossbar) - - clsgeom_curve.strGeomName = "geom_curve" - 'Mandatory - clsgeom_curve.AddAesParameter("x", bIsMandatory:=True) - clsgeom_curve.AddAesParameter("xend", bIsMandatory:=True) - clsgeom_curve.AddAesParameter("y", bIsMandatory:=True) - clsgeom_curve.AddAesParameter("yend", bIsMandatory:=True) + 'clsgeom_contour.SetGeomName("geom_contour") + ''Mandatory + 'clsgeom_contour.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_contour.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_contour.AddAesParameter("alpha") + 'clsgeom_contour.AddAesParameter("colour") + 'clsgeom_contour.AddAesParameter("linetype") + 'clsgeom_contour.AddAesParameter("size") + 'clsgeom_contour.AddAesParameter("weight") + 'lstAllGeoms.Add(clsgeom_contour) + + 'clsgeom_count.SetGeomName("geom_count") + ''mandatory + 'clsgeom_count.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_count.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_count.AddAesParameter("alpha") + 'clsgeom_count.AddAesParameter("colour") + 'clsgeom_count.AddAesParameter("fill") + 'clsgeom_count.AddAesParameter("shape") + 'clsgeom_count.AddAesParameter("size") + 'clsgeom_count.AddAesParameter("stroke") + 'lstAllGeoms.Add(clsgeom_count) + + 'clsgeom_crossbar.strGeomName = "geom_crossbar" + ''Mandatory + 'clsgeom_crossbar.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_crossbar.AddAesParameter("ymax", bIsMandatory:=True) + 'clsgeom_crossbar.AddAesParameter("ymin", bIsMandatory:=True) ''Optional - clsgeom_curve.AddAesParameter("alpha") - clsgeom_curve.AddAesParameter("colour") - clsgeom_curve.AddAesParameter("linetype") - clsgeom_curve.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_curve) + 'clsgeom_crossbar.AddAesParameter("alpha") + 'clsgeom_crossbar.AddAesParameter("colour") + 'clsgeom_crossbar.AddAesParameter("linetype") + 'clsgeom_crossbar.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_crossbar) + + 'clsgeom_curve.strGeomName = "geom_curve" + ''Mandatory + 'clsgeom_curve.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_curve.AddAesParameter("xend", bIsMandatory:=True) + 'clsgeom_curve.AddAesParameter("y", bIsMandatory:=True) + 'clsgeom_curve.AddAesParameter("yend", bIsMandatory:=True) + '''Optional + 'clsgeom_curve.AddAesParameter("alpha") + 'clsgeom_curve.AddAesParameter("colour") + 'clsgeom_curve.AddAesParameter("linetype") + 'clsgeom_curve.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_curve) clsgeom_density.strGeomName = "geom_density" 'mandatory clsgeom_density.AddAesParameter("x", strIncludedDataTypes:={"numeric"}, bIsMandatory:=True) - clsgeom_density.AddAesParameter("y", bIsMandatory:=True) + 'we can map a continuous variable to y but we must include stat = “identity” inside the geom + clsgeom_density.AddAesParameter("y", strIncludedDataTypes:={"factor"}, bIsMandatory:=True) 'optional - clsgeom_density.AddAesParameter("alpha") - clsgeom_density.AddAesParameter("colour") + clsgeom_density.AddAesParameter("alpha", strIncludedDataTypes:={"factor"}) + clsgeom_density.AddAesParameter("colour", strIncludedDataTypes:={"factor"}) clsgeom_density.AddAesParameter("fill", strIncludedDataTypes:={"factor"}) - clsgeom_density.AddAesParameter("linetype") - clsgeom_density.AddAesParameter("size") - clsgeom_density.AddAesParameter("weight") + clsgeom_density.AddAesParameter("linetype", strIncludedDataTypes:={"factor"}) + clsgeom_density.AddAesParameter("size", strIncludedDataTypes:={"factor"}) + clsgeom_density.AddAesParameter("weight", strIncludedDataTypes:={"factor"}) + + 'adding layer parameters + clsgeom_density.AddLayerParameter("stat", "list", "density", lstParameterStrings:={"density", "identity"}) + clsgeom_density.AddLayerParameter("position", "list", "identity", lstParameterStrings:={"identity", "jitter", "stack", "fill", "dodge"}) 'others are “jitter”, “stack”, “fill” And “dodge” + clsgeom_density.AddLayerParameter("bw", "text", "nrd0", lstParameterStrings:={"nrd0", "nrd", "ucv", "bcv", "SJ"}) + clsgeom_density.AddLayerParameter("adjust", "numeric", "1") + clsgeom_density.AddLayerParameter("kernel", "text", "gaussian", lstParameterStrings:={"gaussian", "rectangular", "triangular", "epanechnikov", "biweight", "cosine", "optcosin"}) lstAllGeoms.Add(clsgeom_density) - clsgeom_density2d.strGeomName = "geom_density2d" - 'Mandatory - clsgeom_density2d.AddAesParameter("x", bIsMandatory:=True) - clsgeom_density2d.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_density2d.AddAesParameter("alpha") - clsgeom_density2d.AddAesParameter("colour") - clsgeom_density2d.AddAesParameter("linetype") - clsgeom_density2d.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_density2d) - - clsgeom_density_2d.strGeomName = "geom_density_2d" - 'Mandatory - clsgeom_density_2d.AddAesParameter("x", bIsMandatory:=True) - clsgeom_density_2d.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_density_2d.AddAesParameter("alpha") - clsgeom_density_2d.AddAesParameter("colour") - clsgeom_density_2d.AddAesParameter("linetype") - clsgeom_density_2d.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_density_2d) + 'clsgeom_density2d.strGeomName = "geom_density2d" + ''Mandatory + 'clsgeom_density2d.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_density2d.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_density2d.AddAesParameter("alpha") + 'clsgeom_density2d.AddAesParameter("colour") + 'clsgeom_density2d.AddAesParameter("linetype") + 'clsgeom_density2d.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_density2d) + + 'clsgeom_density_2d.strGeomName = "geom_density_2d" + ''Mandatory + 'clsgeom_density_2d.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_density_2d.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_density_2d.AddAesParameter("alpha") + 'clsgeom_density_2d.AddAesParameter("colour") + 'clsgeom_density_2d.AddAesParameter("linetype") + 'clsgeom_density_2d.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_density_2d) clsgeom_dotplot.strGeomName = "geom_dotplot" clsgeom_dotplot.AddAesParameter("x", strIncludedDataTypes:={"factor"}, bIsMandatory:=True) clsgeom_dotplot.AddAesParameter("y", strIncludedDataTypes:={"numeric"}, bIsMandatory:=True) 'Optional - clsgeom_dotplot.AddAesParameter("alpha") - clsgeom_dotplot.AddAesParameter("colour") + clsgeom_dotplot.AddAesParameter("alpha", strIncludedDataTypes:={"factor"}) + clsgeom_dotplot.AddAesParameter("colour", strIncludedDataTypes:={"factor"}) clsgeom_dotplot.AddAesParameter("fill", strIncludedDataTypes:={"factor"}) - lstAllGeoms.Add(clsgeom_dotplot) - - clsgeom_errorbar.strGeomName = "geom_errorbar" - 'Mandatory - clsgeom_errorbar.AddAesParameter("x", bIsMandatory:=True) - clsgeom_errorbar.AddAesParameter("ymax", bIsMandatory:=True) - clsgeom_errorbar.AddAesParameter("ymin", bIsMandatory:=True) - 'Optional - clsgeom_errorbar.AddAesParameter("alpha") - clsgeom_errorbar.AddAesParameter("volour") - clsgeom_errorbar.AddAesParameter("linetype") - clsgeom_errorbar.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_errorbar) + 'adding layer parameters + clsgeom_dotplot.AddLayerParameter("method", "list", "dotdensity", lstParameterStrings:={"dotdensity", "histodot"}) + clsgeom_dotplot.AddLayerParameter("binwidth", "numeric", "") + clsgeom_dotplot.AddLayerParameter("binaxis", "list", "x", lstParameterStrings:={"x", "y"}) + clsgeom_dotplot.AddLayerParameter("binpositions", "list", "bypositions", lstParameterStrings:={"bypositions", "all"}) + clsgeom_dotplot.AddLayerParameter("stackdir", "text", "up") + clsgeom_dotplot.AddLayerParameter("stackratio", "numeric", "1") + clsgeom_dotplot.AddLayerParameter("dotsize", "numeric", "1") + clsgeom_dotplot.AddLayerParameter("stackgroups", "Boolean", "False") + clsgeom_dotplot.AddLayerParameter("origin", "numeric", "") + clsgeom_dotplot.AddLayerParameter("right", "Boolean", "True") + clsgeom_dotplot.AddLayerParameter("width", "numeric", "0.9") + clsgeom_dotplot.AddLayerParameter("drop", "Boolean", "False") + lstAllGeoms.Add(clsgeom_dotplot) - clsgeom_errorbarh.strGeomName = "geom_errorbarh" - 'mandatory - clsgeom_errorbarh.AddAesParameter("x", bIsMandatory:=True) - clsgeom_errorbarh.AddAesParameter("xmax", bIsMandatory:=True) - clsgeom_errorbarh.AddAesParameter("xmin", bIsMandatory:=True) - clsgeom_errorbarh.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_errorbarh.AddAesParameter("alpha") - clsgeom_errorbarh.AddAesParameter("colour") - clsgeom_errorbarh.AddAesParameter("height") - clsgeom_errorbarh.AddAesParameter("linetype") - clsgeom_errorbarh.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_errorbarh) + 'clsgeom_errorbar.strGeomName = "geom_errorbar" + ''Mandatory + 'clsgeom_errorbar.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_errorbar.AddAesParameter("ymax", bIsMandatory:=True) + 'clsgeom_errorbar.AddAesParameter("ymin", bIsMandatory:=True) + ''Optional + 'clsgeom_errorbar.AddAesParameter("alpha") + 'clsgeom_errorbar.AddAesParameter("volour") + 'clsgeom_errorbar.AddAesParameter("linetype") + 'clsgeom_errorbar.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_errorbar) + + + 'clsgeom_errorbarh.strGeomName = "geom_errorbarh" + ''mandatory + 'clsgeom_errorbarh.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_errorbarh.AddAesParameter("xmax", bIsMandatory:=True) + 'clsgeom_errorbarh.AddAesParameter("xmin", bIsMandatory:=True) + 'clsgeom_errorbarh.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_errorbarh.AddAesParameter("alpha") + 'clsgeom_errorbarh.AddAesParameter("colour") + 'clsgeom_errorbarh.AddAesParameter("height") + 'clsgeom_errorbarh.AddAesParameter("linetype") + 'clsgeom_errorbarh.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_errorbarh) clsgeom_freqpoly.strGeomName = "geom_freqpoly" clsgeom_freqpoly.AddAesParameter("x", strIncludedDataTypes:={"numeric"}, bIsMandatory:=True) @@ -314,16 +343,16 @@ Public Class ucrGeom clsgeom_freqpoly.AddLayerParameter("position", "text", "identity") lstAllGeoms.Add(clsgeom_freqpoly) - clsgeom_hex.strGeomName = "geom_hex" - 'mandatory - clsgeom_hex.AddAesParameter("x", bIsMandatory:=True) - clsgeom_hex.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_hex.AddAesParameter("alpha") - clsgeom_hex.AddAesParameter("colour") - clsgeom_hex.AddAesParameter("fill") - clsgeom_hex.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_hex) + 'clsgeom_hex.strGeomName = "geom_hex" + ''mandatory + 'clsgeom_hex.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_hex.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_hex.AddAesParameter("alpha") + 'clsgeom_hex.AddAesParameter("colour") + 'clsgeom_hex.AddAesParameter("fill") + 'clsgeom_hex.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_hex) clsgeom_histogram.strGeomName = "geom_histogram" clsgeom_histogram.AddAesParameter("x", strIncludedDataTypes:={"numeric"}, bIsMandatory:=True) @@ -336,50 +365,50 @@ Public Class ucrGeom 'adding layer parameters clsgeom_histogram.AddLayerParameter("bin", "numeric", "30") clsgeom_histogram.AddLayerParameter("binwidth", "numeric", "0") - clsgeom_histogram.AddLayerParameter("closed", "boolean", "") + clsgeom_histogram.AddLayerParameter("closed", "Boolean", "") clsgeom_histogram.AddLayerParameter("Position", "text", "stack") lstAllGeoms.Add(clsgeom_histogram) - clsgeom_hline.strGeomName = "geom_hline" - clsgeom_hline.AddAesParameter("alpha") - clsgeom_hline.AddAesParameter("colour") - clsgeom_hline.AddAesParameter("linetype") - clsgeom_hline.AddAesParameter("size") - 'aesthetics that control position of line include - 'geom_vline:xintercept - 'geom_hline:yintercept - 'geom_abline: slope and intercept - 'TO DO Discuss how to use these - lstAllGeoms.Add(clsgeom_hline) - - clsgeom_jitter.strGeomName = "geom_jitter" - 'mandatory - clsgeom_jitter.AddAesParameter("x", bIsMandatory:=True) - clsgeom_jitter.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_jitter.AddAesParameter("alpha") - clsgeom_jitter.AddAesParameter("colour") - clsgeom_jitter.AddAesParameter("fill") - clsgeom_jitter.AddAesParameter("shape") - clsgeom_jitter.AddAesParameter("size") - clsgeom_jitter.AddAesParameter("stroke") - lstAllGeoms.Add(clsgeom_jitter) - - clsgeom_label.strGeomName = "geom_label" - 'mandatory - clsgeom_label.AddAesParameter("label", bIsMandatory:=True) - clsgeom_label.AddAesParameter("x", bIsMandatory:=True) - clsgeom_label.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_label.AddAesParameter("alpha") - clsgeom_label.AddAesParameter("colour") - clsgeom_label.AddAesParameter("family") - clsgeom_label.AddAesParameter("fontface") - clsgeom_label.AddAesParameter("hjust") - clsgeom_label.AddAesParameter("lineheight") - 'TO DO add size and vjust this might need additon of labels and receivers - lstAllGeoms.Add(clsgeom_label) + 'clsgeom_hline.strGeomName = "geom_hline" + 'clsgeom_hline.AddAesParameter("alpha") + 'clsgeom_hline.AddAesParameter("colour") + 'clsgeom_hline.AddAesParameter("linetype") + 'clsgeom_hline.AddAesParameter("size") + ''aesthetics that control position of line include + ''geom_vline:xintercept + ''geom_hline:yintercept + ''geom_abline: slope and intercept + ''TO DO Discuss how to use these + 'lstAllGeoms.Add(clsgeom_hline) + + 'clsgeom_jitter.strGeomName = "geom_jitter" + ''mandatory + 'clsgeom_jitter.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_jitter.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_jitter.AddAesParameter("alpha") + 'clsgeom_jitter.AddAesParameter("colour") + 'clsgeom_jitter.AddAesParameter("fill") + 'clsgeom_jitter.AddAesParameter("shape") + 'clsgeom_jitter.AddAesParameter("size") + 'clsgeom_jitter.AddAesParameter("stroke") + 'lstAllGeoms.Add(clsgeom_jitter) + + 'clsgeom_label.strGeomName = "geom_label" + ''mandatory + 'clsgeom_label.AddAesParameter("label", bIsMandatory:=True) + 'clsgeom_label.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_label.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_label.AddAesParameter("alpha") + 'clsgeom_label.AddAesParameter("colour") + 'clsgeom_label.AddAesParameter("family") + 'clsgeom_label.AddAesParameter("fontface") + 'clsgeom_label.AddAesParameter("hjust") + 'clsgeom_label.AddAesParameter("lineheight") + ''TO DO add size and vjust this might need additon of labels and receivers + 'lstAllGeoms.Add(clsgeom_label) clsgeom_line.strGeomName = "geom_line" @@ -387,238 +416,243 @@ Public Class ucrGeom clsgeom_line.AddAesParameter("x", strIncludedDataTypes:={"numeric"}, bIsMandatory:=True) clsgeom_line.AddAesParameter("y", strIncludedDataTypes:={"numeric"}, bIsMandatory:=True) 'optional - clsgeom_line.AddAesParameter("alpha") - clsgeom_line.AddAesParameter("colour") - clsgeom_line.AddAesParameter("linetype") - clsgeom_line.AddAesParameter("size") + clsgeom_line.AddAesParameter("alpha", strIncludedDataTypes:={"numeric", "factor"}) + clsgeom_line.AddAesParameter("colour", strIncludedDataTypes:={"numeric", "factor"}) + clsgeom_line.AddAesParameter("linetype", strIncludedDataTypes:={"factor"}) + clsgeom_line.AddAesParameter("size", strIncludedDataTypes:={"numeric, factor"}) + 'adding layer parameters + + clsgeom_line.AddLayerParameter("position", "text", "identity") 'others options are “jitter”, “dodge” And “stack” lstAllGeoms.Add(clsgeom_line) - clsgeom_linerange.strGeomName = "geom_linerange" - 'mandatory - clsgeom_linerange.AddAesParameter("x", bIsMandatory:=True) - clsgeom_linerange.AddAesParameter("ymax", bIsMandatory:=True) - clsgeom_linerange.AddAesParameter("ymin", bIsMandatory:=True) - 'optional - clsgeom_linerange.AddAesParameter("alpha") - clsgeom_linerange.AddAesParameter("colour") - clsgeom_linerange.AddAesParameter("linetype") - clsgeom_linerange.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_linerange) - - clsgeom_map.strGeomName = "geom_map" - 'mandatory - clsgeom_map.AddAesParameter("map_id", bIsMandatory:=True) - 'optional - clsgeom_map.AddAesParameter("alpha") - clsgeom_map.AddAesParameter("colour") - clsgeom_map.AddAesParameter("fill") - clsgeom_map.AddAesParameter("linetype") - clsgeom_map.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_map) - - clsgeom_path.strGeomName = "geom_path" - 'mandatory - clsgeom_path.AddAesParameter("x", bIsMandatory:=True) - clsgeom_path.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_path.AddAesParameter("alpha") - clsgeom_path.AddAesParameter("colour") - clsgeom_path.AddAesParameter("linetype") - clsgeom_path.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_path) + 'clsgeom_linerange.strGeomName = "geom_linerange" + ''mandatory + 'clsgeom_linerange.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_linerange.AddAesParameter("ymax", bIsMandatory:=True) + 'clsgeom_linerange.AddAesParameter("ymin", bIsMandatory:=True) + ''optional + 'clsgeom_linerange.AddAesParameter("alpha") + 'clsgeom_linerange.AddAesParameter("colour") + 'clsgeom_linerange.AddAesParameter("linetype") + 'clsgeom_linerange.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_linerange) + + 'clsgeom_map.strGeomName = "geom_map" + ''mandatory + 'clsgeom_map.AddAesParameter("map_id", bIsMandatory:=True) + ''optional + 'clsgeom_map.AddAesParameter("alpha") + 'clsgeom_map.AddAesParameter("colour") + 'clsgeom_map.AddAesParameter("fill") + 'clsgeom_map.AddAesParameter("linetype") + 'clsgeom_map.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_map) + + 'clsgeom_path.strGeomName = "geom_path" + ''mandatory + 'clsgeom_path.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_path.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_path.AddAesParameter("alpha") + 'clsgeom_path.AddAesParameter("colour") + 'clsgeom_path.AddAesParameter("linetype") + 'clsgeom_path.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_path) clsgeom_point.strGeomName = "geom_point" 'mandatory clsgeom_point.AddAesParameter("x", strIncludedDataTypes:={"numeric"}, bIsMandatory:=True) clsgeom_point.AddAesParameter("y", strIncludedDataTypes:={"factor"}, bIsMandatory:=True) 'optional - clsgeom_point.AddAesParameter("alpha") - clsgeom_point.AddAesParameter("colour") - clsgeom_point.AddAesParameter("fill") - clsgeom_point.AddAesParameter("shape") - clsgeom_point.AddAesParameter("size") + clsgeom_point.AddAesParameter("alpha", strIncludedDataTypes:={"factor", "numeric"}) + clsgeom_point.AddAesParameter("colour", strIncludedDataTypes:={"factor", "numeric"}) + clsgeom_point.AddAesParameter("fill", strIncludedDataTypes:={"factor"}) + clsgeom_point.AddAesParameter("shape", strIncludedDataTypes:={"factor"}) + clsgeom_point.AddAesParameter("size", strIncludedDataTypes:={"factor", "numeric"}) clsgeom_point.AddAesParameter("stroke") + 'adding layer parameters + clsgeom_point.AddLayerParameter("position", "text", "identity") 'other jitter lstAllGeoms.Add(clsgeom_point) - clsgeom_pointrange.strGeomName = "geom_pointrange" - clsgeom_pointrange.AddAesParameter("x", bIsMandatory:=True) - clsgeom_pointrange.AddAesParameter("ymax", bIsMandatory:=True) - clsgeom_pointrange.AddAesParameter("ymin", bIsMandatory:=True) - 'optional - clsgeom_pointrange.AddAesParameter("alpha") - clsgeom_pointrange.AddAesParameter("colour") - clsgeom_pointrange.AddAesParameter("linetype") - clsgeom_pointrange.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_pointrange) - - clsgeom_polygon.strGeomName = "geom_polygon" - clsgeom_polygon.AddAesParameter("x", bIsMandatory:=True) - clsgeom_polygon.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_polygon.AddAesParameter("alpha") - clsgeom_polygon.AddAesParameter("colour") - clsgeom_polygon.AddAesParameter("fill") - clsgeom_polygon.AddAesParameter("linetype") - clsgeom_polygon.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_polygon) - - clsgeom_qq.strGeomName = "geom_qq" - clsgeom_qq.AddAesParameter("sample", bIsMandatory:=True) - 'optional - clsgeom_qq.AddAesParameter("x") - clsgeom_qq.AddAesParameter("y") - lstAllGeoms.Add(clsgeom_qq) - - clsgeom_quantile.strGeomName = "geom_quantile" - clsgeom_quantile.AddAesParameter("x", bIsMandatory:=True) - clsgeom_quantile.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_quantile.AddAesParameter("alpha") - clsgeom_quantile.AddAesParameter("colour") - clsgeom_quantile.AddAesParameter("linetype") - clsgeom_quantile.AddAesParameter("size") - clsgeom_quantile.AddAesParameter("weight") - lstAllGeoms.Add(clsgeom_quantile) - - clsgeom_raster.strGeomName = "geom_raster" - 'mandatory - clsgeom_raster.AddAesParameter("x", bIsMandatory:=True) - clsgeom_raster.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_raster.AddAesParameter("alpha") - clsgeom_raster.AddAesParameter("colour") - clsgeom_raster.AddAesParameter("fill") - clsgeom_raster.AddAesParameter("linetype") - clsgeom_raster.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_raster) - - clsgeom_rect.strGeomName = "geom_rect" - 'mandatory - clsgeom_rect.AddAesParameter("x", bIsMandatory:=True) - clsgeom_rect.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_rect.AddAesParameter("alpha") - clsgeom_rect.AddAesParameter("colour") - clsgeom_rect.AddAesParameter("fill") - clsgeom_rect.AddAesParameter("linetype") - clsgeom_rect.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_rect) - - clsgeom_ribbon.strGeomName = "geom_ribbon" - clsgeom_ribbon.AddAesParameter("x", bIsMandatory:=True) - clsgeom_ribbon.AddAesParameter("ymax", bIsMandatory:=True) - clsgeom_ribbon.AddAesParameter("ymin", bIsMandatory:=True) - 'optional - clsgeom_ribbon.AddAesParameter("alpha") - clsgeom_ribbon.AddAesParameter("colour") - clsgeom_ribbon.AddAesParameter("linetype") - clsgeom_ribbon.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_ribbon) - - clsgeom_rug.strGeomName = "geom_rug" - clsgeom_rug.AddAesParameter("alpha") - clsgeom_rug.AddAesParameter("colour") - clsgeom_rug.AddAesParameter("linetype") - clsgeom_rug.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_rug) - - clsgeom_segment.strGeomName = "geom_segment" - 'mandatory - clsgeom_segment.AddAesParameter("x", bIsMandatory:=True) - clsgeom_segment.AddAesParameter("xend", bIsMandatory:=True) - clsgeom_segment.AddAesParameter("y", bIsMandatory:=True) - clsgeom_segment.AddAesParameter("yend", bIsMandatory:=True) - 'optional - clsgeom_segment.AddAesParameter("alpha") - clsgeom_segment.AddAesParameter("colour") - clsgeom_segment.AddAesParameter("linetype") - clsgeom_segment.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_segment) - - clsgeom_smooth.strGeomName = "geom_smooth" - 'mandatory - clsgeom_smooth.AddAesParameter("x", bIsMandatory:=True) - clsgeom_smooth.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_smooth.AddAesParameter("alpha") - clsgeom_smooth.AddAesParameter("colour") - clsgeom_smooth.AddAesParameter("fill") - clsgeom_smooth.AddAesParameter("linetype") - clsgeom_smooth.AddAesParameter("size") - clsgeom_smooth.AddAesParameter("weight") - lstAllGeoms.Add(clsgeom_smooth) - - clsgeom_spoke.strGeomName = "geom_spoke" - 'mandatory - clsgeom_spoke.AddAesParameter("angle", bIsMandatory:=True) - clsgeom_spoke.AddAesParameter("radius", bIsMandatory:=True) - clsgeom_spoke.AddAesParameter("x", bIsMandatory:=True) - clsgeom_spoke.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_spoke.AddAesParameter("alpha") - clsgeom_spoke.AddAesParameter("colour") - clsgeom_spoke.AddAesParameter("linetype") - clsgeom_spoke.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_spoke) - - clsgeom_step.strGeomName = "geom_step" - clsgeom_step.AddAesParameter("x", bIsMandatory:=True) - clsgeom_step.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_step.AddAesParameter("alpha") - clsgeom_step.AddAesParameter("colour") - clsgeom_step.AddAesParameter("linetype") - clsgeom_step.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_step) - - clsgeom_text.strGeomName = "geom_text" - 'mandatory - clsgeom_text.AddAesParameter("label", bIsMandatory:=True) - clsgeom_text.AddAesParameter("x", bIsMandatory:=True) - clsgeom_text.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_text.AddAesParameter("alpha") - clsgeom_text.AddAesParameter("colour") - clsgeom_text.AddAesParameter("family") - clsgeom_text.AddAesParameter("fontface") - clsgeom_text.AddAesParameter("hjust") - clsgeom_text.AddAesParameter("lineheight") - 'TO DO add size and vjust this might need additon of labels and receivers - lstAllGeoms.Add(clsgeom_text) - - clsgeom_tile.strGeomName = "geom_tile" - 'mandatory - clsgeom_tile.AddAesParameter("x", bIsMandatory:=True) - clsgeom_tile.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_tile.AddAesParameter("alpha") - clsgeom_tile.AddAesParameter("colour") - clsgeom_tile.AddAesParameter("fill") - clsgeom_tile.AddAesParameter("linetype") - clsgeom_tile.AddAesParameter("size") - lstAllGeoms.Add(clsgeom_tile) - - clsgeom_violin.strGeomName = "geom_violin" - 'mandatory - clsgeom_violin.AddAesParameter("x", bIsMandatory:=True) - clsgeom_violin.AddAesParameter("y", bIsMandatory:=True) - 'optional - clsgeom_violin.AddAesParameter("alpha") - clsgeom_violin.AddAesParameter("colour") - clsgeom_violin.AddAesParameter("fill") - clsgeom_violin.AddAesParameter("linetype") - clsgeom_violin.AddAesParameter("size") - clsgeom_violin.AddAesParameter("weight") - lstAllGeoms.Add(clsgeom_violin) - - clsgeom_vline.strGeomName = "geom_vline" - clsgeom_vline.AddAesParameter("alpha") - clsgeom_vline.AddAesParameter("colour") - clsgeom_vline.AddAesParameter("linetype") - clsgeom_vline.AddAesParameter("size") - 'TO DO include those that control position - lstAllGeoms.Add(clsgeom_vline) + 'clsgeom_pointrange.strGeomName = "geom_pointrange" + 'clsgeom_pointrange.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_pointrange.AddAesParameter("ymax", bIsMandatory:=True) + 'clsgeom_pointrange.AddAesParameter("ymin", bIsMandatory:=True) + ''optional + 'clsgeom_pointrange.AddAesParameter("alpha") + 'clsgeom_pointrange.AddAesParameter("colour") + 'clsgeom_pointrange.AddAesParameter("linetype") + 'clsgeom_pointrange.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_pointrange) + + 'clsgeom_polygon.strGeomName = "geom_polygon" + 'clsgeom_polygon.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_polygon.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_polygon.AddAesParameter("alpha") + 'clsgeom_polygon.AddAesParameter("colour") + 'clsgeom_polygon.AddAesParameter("fill") + 'clsgeom_polygon.AddAesParameter("linetype") + 'clsgeom_polygon.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_polygon) + + 'clsgeom_qq.strGeomName = "geom_qq" + 'clsgeom_qq.AddAesParameter("sample", bIsMandatory:=True) + ''optional + 'clsgeom_qq.AddAesParameter("x") + 'clsgeom_qq.AddAesParameter("y") + 'lstAllGeoms.Add(clsgeom_qq) + + 'clsgeom_quantile.strGeomName = "geom_quantile" + 'clsgeom_quantile.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_quantile.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_quantile.AddAesParameter("alpha") + 'clsgeom_quantile.AddAesParameter("colour") + 'clsgeom_quantile.AddAesParameter("linetype") + 'clsgeom_quantile.AddAesParameter("size") + 'clsgeom_quantile.AddAesParameter("weight") + 'lstAllGeoms.Add(clsgeom_quantile) + + 'clsgeom_raster.strGeomName = "geom_raster" + ''mandatory + 'clsgeom_raster.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_raster.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_raster.AddAesParameter("alpha") + 'clsgeom_raster.AddAesParameter("colour") + 'clsgeom_raster.AddAesParameter("fill") + 'clsgeom_raster.AddAesParameter("linetype") + 'clsgeom_raster.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_raster) + + 'clsgeom_rect.strGeomName = "geom_rect" + ''mandatory + 'clsgeom_rect.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_rect.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_rect.AddAesParameter("alpha") + 'clsgeom_rect.AddAesParameter("colour") + 'clsgeom_rect.AddAesParameter("fill") + 'clsgeom_rect.AddAesParameter("linetype") + 'clsgeom_rect.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_rect) + + 'clsgeom_ribbon.strGeomName = "geom_ribbon" + 'clsgeom_ribbon.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_ribbon.AddAesParameter("ymax", bIsMandatory:=True) + 'clsgeom_ribbon.AddAesParameter("ymin", bIsMandatory:=True) + ''optional + 'clsgeom_ribbon.AddAesParameter("alpha") + 'clsgeom_ribbon.AddAesParameter("colour") + 'clsgeom_ribbon.AddAesParameter("linetype") + 'clsgeom_ribbon.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_ribbon) + + 'clsgeom_rug.strGeomName = "geom_rug" + 'clsgeom_rug.AddAesParameter("alpha") + 'clsgeom_rug.AddAesParameter("colour") + 'clsgeom_rug.AddAesParameter("linetype") + 'clsgeom_rug.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_rug) + + 'clsgeom_segment.strGeomName = "geom_segment" + ''mandatory + 'clsgeom_segment.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_segment.AddAesParameter("xend", bIsMandatory:=True) + 'clsgeom_segment.AddAesParameter("y", bIsMandatory:=True) + 'clsgeom_segment.AddAesParameter("yend", bIsMandatory:=True) + ''optional + 'clsgeom_segment.AddAesParameter("alpha") + 'clsgeom_segment.AddAesParameter("colour") + 'clsgeom_segment.AddAesParameter("linetype") + 'clsgeom_segment.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_segment) + + 'clsgeom_smooth.strGeomName = "geom_smooth" + ''mandatory + 'clsgeom_smooth.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_smooth.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_smooth.AddAesParameter("alpha") + 'clsgeom_smooth.AddAesParameter("colour") + 'clsgeom_smooth.AddAesParameter("fill") + 'clsgeom_smooth.AddAesParameter("linetype") + 'clsgeom_smooth.AddAesParameter("size") + 'clsgeom_smooth.AddAesParameter("weight") + 'lstAllGeoms.Add(clsgeom_smooth) + + 'clsgeom_spoke.strGeomName = "geom_spoke" + ''mandatory + 'clsgeom_spoke.AddAesParameter("angle", bIsMandatory:=True) + 'clsgeom_spoke.AddAesParameter("radius", bIsMandatory:=True) + 'clsgeom_spoke.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_spoke.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_spoke.AddAesParameter("alpha") + 'clsgeom_spoke.AddAesParameter("colour") + 'clsgeom_spoke.AddAesParameter("linetype") + 'clsgeom_spoke.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_spoke) + + 'clsgeom_step.strGeomName = "geom_step" + 'clsgeom_step.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_step.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_step.AddAesParameter("alpha") + 'clsgeom_step.AddAesParameter("colour") + 'clsgeom_step.AddAesParameter("linetype") + 'clsgeom_step.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_step) + + 'clsgeom_text.strGeomName = "geom_text" + ''mandatory + 'clsgeom_text.AddAesParameter("label", bIsMandatory:=True) + 'clsgeom_text.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_text.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_text.AddAesParameter("alpha") + 'clsgeom_text.AddAesParameter("colour") + 'clsgeom_text.AddAesParameter("family") + 'clsgeom_text.AddAesParameter("fontface") + 'clsgeom_text.AddAesParameter("hjust") + 'clsgeom_text.AddAesParameter("lineheight") + ''TO DO add size and vjust this might need additon of labels and receivers + 'lstAllGeoms.Add(clsgeom_text) + + 'clsgeom_tile.strGeomName = "geom_tile" + ''mandatory + 'clsgeom_tile.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_tile.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_tile.AddAesParameter("alpha") + 'clsgeom_tile.AddAesParameter("colour") + 'clsgeom_tile.AddAesParameter("fill") + 'clsgeom_tile.AddAesParameter("linetype") + 'clsgeom_tile.AddAesParameter("size") + 'lstAllGeoms.Add(clsgeom_tile) + + 'clsgeom_violin.strGeomName = "geom_violin" + ''mandatory + 'clsgeom_violin.AddAesParameter("x", bIsMandatory:=True) + 'clsgeom_violin.AddAesParameter("y", bIsMandatory:=True) + ''optional + 'clsgeom_violin.AddAesParameter("alpha") + 'clsgeom_violin.AddAesParameter("colour") + 'clsgeom_violin.AddAesParameter("fill") + 'clsgeom_violin.AddAesParameter("linetype") + 'clsgeom_violin.AddAesParameter("size") + 'clsgeom_violin.AddAesParameter("weight") + 'lstAllGeoms.Add(clsgeom_violin) + + 'clsgeom_vline.strGeomName = "geom_vline" + 'clsgeom_vline.AddAesParameter("alpha") + 'clsgeom_vline.AddAesParameter("colour") + 'clsgeom_vline.AddAesParameter("linetype") + 'clsgeom_vline.AddAesParameter("size") + ''TO DO include those that control position + 'lstAllGeoms.Add(clsgeom_vline) End Sub Public Event GeomChanged(sender As Object, e As EventArgs) Private Sub cboGeomList_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboGeomList.SelectedIndexChanged diff --git a/instat/ucrInputConfidenceLimit.vb b/instat/ucrInputConfidenceLimit.vb index 4d40e3e91e1..1a4b8ca33f9 100644 --- a/instat/ucrInputConfidenceLimit.vb +++ b/instat/ucrInputConfidenceLimit.vb @@ -20,7 +20,7 @@ Public Class ucrInputConfidenceLimit End Sub Private Sub ucrInputConfidenceLimit_Load(sender As Object, e As EventArgs) Handles Me.Load - ucrConfidenceLimit.AddItems({99.9, 99, 95, 90, 85, 80}) + ucrConfidenceLimit.SetItems({99.9, 99, 95, 90, 85, 80}) ucrConfidenceLimit.SetValidationTypeAsNumeric(dcmMin:=0, bIncludeMin:=False, dcmMax:=100, bIncludeMax:=False) ucrConfidenceLimit.SetName(95) End Sub diff --git a/instat/ucrLayerParameters.Designer.vb b/instat/ucrLayerParameters.Designer.vb index cd1ca2c9897..81276f4706b 100644 --- a/instat/ucrLayerParameters.Designer.vb +++ b/instat/ucrLayerParameters.Designer.vb @@ -29,6 +29,8 @@ Partial Class ucrLayerParameters Me.UcrLayerParamsControls8 = New instat.ucrLayerParamsControls() Me.UcrLayerParamsControls9 = New instat.ucrLayerParamsControls() Me.UcrLayerParamsControls10 = New instat.ucrLayerParamsControls() + Me.UcrLayerParamsControls11 = New instat.ucrLayerParamsControls() + Me.UcrLayerParamsControls12 = New instat.ucrLayerParamsControls() Me.SuspendLayout() ' 'UcrLayerParamsControls1 @@ -101,10 +103,26 @@ Partial Class ucrLayerParameters Me.UcrLayerParamsControls10.Size = New System.Drawing.Size(203, 28) Me.UcrLayerParamsControls10.TabIndex = 7 ' + 'UcrLayerParamsControls11 + ' + Me.UcrLayerParamsControls11.Location = New System.Drawing.Point(6, 285) + Me.UcrLayerParamsControls11.Name = "UcrLayerParamsControls11" + Me.UcrLayerParamsControls11.Size = New System.Drawing.Size(203, 29) + Me.UcrLayerParamsControls11.TabIndex = 10 + ' + 'UcrLayerParamsControls12 + ' + Me.UcrLayerParamsControls12.Location = New System.Drawing.Point(6, 308) + Me.UcrLayerParamsControls12.Name = "UcrLayerParamsControls12" + Me.UcrLayerParamsControls12.Size = New System.Drawing.Size(203, 28) + Me.UcrLayerParamsControls12.TabIndex = 11 + ' 'ucrLayerParameters ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.Controls.Add(Me.UcrLayerParamsControls12) Me.Controls.Add(Me.UcrLayerParamsControls6) + Me.Controls.Add(Me.UcrLayerParamsControls11) Me.Controls.Add(Me.UcrLayerParamsControls7) Me.Controls.Add(Me.UcrLayerParamsControls8) Me.Controls.Add(Me.UcrLayerParamsControls9) @@ -115,7 +133,7 @@ Partial Class ucrLayerParameters Me.Controls.Add(Me.UcrLayerParamsControls2) Me.Controls.Add(Me.UcrLayerParamsControls1) Me.Name = "ucrLayerParameters" - Me.Size = New System.Drawing.Size(213, 291) + Me.Size = New System.Drawing.Size(212, 339) Me.Controls.SetChildIndex(Me.UcrLayerParamsControls1, 0) Me.Controls.SetChildIndex(Me.UcrLayerParamsControls2, 0) Me.Controls.SetChildIndex(Me.UcrLayerParamsControls3, 0) @@ -125,7 +143,9 @@ Partial Class ucrLayerParameters Me.Controls.SetChildIndex(Me.UcrLayerParamsControls9, 0) Me.Controls.SetChildIndex(Me.UcrLayerParamsControls8, 0) Me.Controls.SetChildIndex(Me.UcrLayerParamsControls7, 0) + Me.Controls.SetChildIndex(Me.UcrLayerParamsControls11, 0) Me.Controls.SetChildIndex(Me.UcrLayerParamsControls6, 0) + Me.Controls.SetChildIndex(Me.UcrLayerParamsControls12, 0) Me.ResumeLayout(False) Me.PerformLayout() @@ -141,4 +161,6 @@ Partial Class ucrLayerParameters Friend WithEvents UcrLayerParamsControls8 As ucrLayerParamsControls Friend WithEvents UcrLayerParamsControls9 As ucrLayerParamsControls Friend WithEvents UcrLayerParamsControls10 As ucrLayerParamsControls + Friend WithEvents UcrLayerParamsControls11 As ucrLayerParamsControls + Friend WithEvents UcrLayerParamsControls12 As ucrLayerParamsControls End Class diff --git a/instat/ucrLayerParameters.vb b/instat/ucrLayerParameters.vb index 0bce2ffbe39..2999d89bd3d 100644 --- a/instat/ucrLayerParameters.vb +++ b/instat/ucrLayerParameters.vb @@ -27,7 +27,7 @@ Public Class ucrLayerParameters End Sub Private Sub InitialiseControl() If lstLayerParameterControl.Count = 0 Then - lstLayerParameterControl.AddRange({UcrLayerParamsControls1, UcrLayerParamsControls2, UcrLayerParamsControls3, UcrLayerParamsControls4, UcrLayerParamsControls5, UcrLayerParamsControls6, UcrLayerParamsControls7, UcrLayerParamsControls8, UcrLayerParamsControls9, UcrLayerParamsControls10}) + lstLayerParameterControl.AddRange({UcrLayerParamsControls1, UcrLayerParamsControls2, UcrLayerParamsControls3, UcrLayerParamsControls4, UcrLayerParamsControls5, UcrLayerParamsControls6, UcrLayerParamsControls7, UcrLayerParamsControls8, UcrLayerParamsControls9, UcrLayerParamsControls10, UcrLayerParamsControls11, UcrLayerParamsControls12}) For i = 0 To (lstLayerParameterControl.Count - 1) lstLayerParameterControl(i).SetGeomFunction(clsGeomFunction) Next @@ -64,6 +64,5 @@ Public Class ucrLayerParameters Private Sub SetDefaults() End Sub - End Class diff --git a/instat/ucrLayerParamsControls.vb b/instat/ucrLayerParamsControls.vb index 564ca562492..37e3a339d5b 100644 --- a/instat/ucrLayerParamsControls.vb +++ b/instat/ucrLayerParamsControls.vb @@ -45,11 +45,12 @@ Public Class ucrLayerParamsControls ctrActive = nudParamValue ElseIf clsLayerParam.strLayerParameterDataType = "boolean" Then ctrActive = ucrcborParamValue - ucrcborParamValue.cboInput.Items.Clear() - ucrcborParamValue.cboInput.Items.Add("TRUE") - ucrcborParamValue.cboInput.Items.Add("FALSE") + ucrcborParamValue.SetItems({"TRUE", "FALSE"}) ElseIf clsLayerParam.strLayerParameterDataType = "colour" Then ctrActive = ucrColor + ElseIf clsLayerParam.strLayerParameterDataType = "list" Then + ctrActive = ucrcborParamValue + ucrcborParamValue.SetItems(clsLayerParam.lstParameterStrings) Else ctrActive = New Control 'this should never actually be used but is here to ensure the code is stable even if a developper uses an incorrect datatype End If From 3dd6b0b23f6e61bded7a31666ebbd72ba14122ca Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Tue, 7 Jun 2016 17:25:53 +0300 Subject: [PATCH 2/6] Adding a boolean for clearing combo boxbefore populating the list --- instat/ucrInputComboBox.vb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/instat/ucrInputComboBox.vb b/instat/ucrInputComboBox.vb index 2d66c4244f6..3024306b638 100644 --- a/instat/ucrInputComboBox.vb +++ b/instat/ucrInputComboBox.vb @@ -98,7 +98,10 @@ Public Class ucrInputComboBox Return cboInput.Text End Function - Public Sub AddItems(strItems As String()) + Public Sub SetItems(strItems As String(), Optional bClearExisting As Boolean = True) + If bClearExisting Then + cboInput.Items.Clear() + End If cboInput.Items.AddRange(strItems) End Sub @@ -123,8 +126,8 @@ Public Class ucrInputComboBox End Sub Private Sub ucrInputComboBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles Me.KeyPress - If bIsReadOnly Then - e.Handled = True - End If + 'If bIsReadOnly Then + ' e.Handled = True + 'End If End Sub End Class From 9de97583d2f82a2a7b7bcfa5b1ae7e171d32dcc0 Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Tue, 7 Jun 2016 17:26:52 +0300 Subject: [PATCH 3/6] Changing AdddItems to SetItems on the dlgCombiletextDialog --- instat/dlgCombineText.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgCombineText.vb b/instat/dlgCombineText.vb index 97fce2f032b..81dac8529dc 100644 --- a/instat/dlgCombineText.vb +++ b/instat/dlgCombineText.vb @@ -53,7 +53,7 @@ Public Class dlgCombineText ucrInputColumnInto.SetDataFrameSelector(ucrSelectorForCombineText.ucrAvailableDataFrames) ucrInputColumnInto.SetPrefix("Combine") iColumnsUsed = 0 - ucrInputSeparator.AddItems({"Space", "-", "_", "."}) + ucrInputSeparator.SetItems({"Space", "-", "_", "."}) ucrBase.iHelpTopicID = 345 End Sub From b6692d8ded9cd68e17371e19ebbaa476bb3e0785 Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Tue, 7 Jun 2016 17:52:44 +0300 Subject: [PATCH 4/6] Adding lstParameterStrings in layer parameters in geoms --- instat/ucrGeom.vb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/instat/ucrGeom.vb b/instat/ucrGeom.vb index 23bc80c8392..74ec3b5c218 100644 --- a/instat/ucrGeom.vb +++ b/instat/ucrGeom.vb @@ -291,7 +291,7 @@ Public Class ucrGeom clsgeom_dotplot.AddLayerParameter("binwidth", "numeric", "") clsgeom_dotplot.AddLayerParameter("binaxis", "list", "x", lstParameterStrings:={"x", "y"}) clsgeom_dotplot.AddLayerParameter("binpositions", "list", "bypositions", lstParameterStrings:={"bypositions", "all"}) - clsgeom_dotplot.AddLayerParameter("stackdir", "text", "up") + clsgeom_dotplot.AddLayerParameter("stackdir", "list", "up", lstParameterStrings:={"up", "down", "center", "centerwhole"}) clsgeom_dotplot.AddLayerParameter("stackratio", "numeric", "1") clsgeom_dotplot.AddLayerParameter("dotsize", "numeric", "1") clsgeom_dotplot.AddLayerParameter("stackgroups", "Boolean", "False") @@ -339,8 +339,8 @@ Public Class ucrGeom clsgeom_freqpoly.AddAesParameter("size", strIncludedDataTypes:={"factor"}) 'Add layer parameters - clsgeom_freqpoly.AddLayerParameter("stat", "text", "bin") - clsgeom_freqpoly.AddLayerParameter("position", "text", "identity") + clsgeom_freqpoly.AddLayerParameter("stat", "list", "bin", lstParameterStrings:={"bin", "identity"}) + clsgeom_freqpoly.AddLayerParameter("position", "list", "identity", lstParameterStrings:={"identity", "jitter", "stack", "dodge"}) lstAllGeoms.Add(clsgeom_freqpoly) 'clsgeom_hex.strGeomName = "geom_hex" @@ -365,8 +365,8 @@ Public Class ucrGeom 'adding layer parameters clsgeom_histogram.AddLayerParameter("bin", "numeric", "30") clsgeom_histogram.AddLayerParameter("binwidth", "numeric", "0") - clsgeom_histogram.AddLayerParameter("closed", "Boolean", "") - clsgeom_histogram.AddLayerParameter("Position", "text", "stack") + clsgeom_histogram.AddLayerParameter("closed", "list", "", lstParameterStrings:={"left", "right"}) + clsgeom_histogram.AddLayerParameter("Position", "list", "stack", lstParameterStrings:={"stack", "dodge"}) lstAllGeoms.Add(clsgeom_histogram) @@ -422,7 +422,7 @@ Public Class ucrGeom clsgeom_line.AddAesParameter("size", strIncludedDataTypes:={"numeric, factor"}) 'adding layer parameters - clsgeom_line.AddLayerParameter("position", "text", "identity") 'others options are “jitter”, “dodge” And “stack” + clsgeom_line.AddLayerParameter("position", "list", "identity", lstParameterStrings:={"identity", "jitter", "dodge", "stack"}) 'others options are “jitter”, “dodge” And “stack” lstAllGeoms.Add(clsgeom_line) From 6f2025297c1fd70e2d2e00fa01b0839d2ad6fc23 Mon Sep 17 00:00:00 2001 From: dannyparsons Date: Tue, 7 Jun 2016 20:11:18 +0100 Subject: [PATCH 5/6] improved speed of import dialog loading --- instat/dlgImportDataset.vb | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/instat/dlgImportDataset.vb b/instat/dlgImportDataset.vb index d2c3db877fa..7daa495cded 100644 --- a/instat/dlgImportDataset.vb +++ b/instat/dlgImportDataset.vb @@ -236,18 +236,22 @@ Public Class dlgImportDataset #Region "File Preview options" Public Sub RefreshFilePreview() Dim sReader As StreamReader - Try - sReader = New StreamReader(ucrInputFilePath.GetText()) - txtPreview.Text = "" - For i = 1 To intLines + nudSkip.Value + 1 - txtPreview.Text = txtPreview.Text & sReader.ReadLine() & vbCrLf - If sReader.Peek() = -1 Then - Exit For - End If - Next - Catch ex As Exception - txtPreview.Text = "Cannot show text preview of file:" & ucrInputFilePath.GetText() & ". The file may be in use by another program. Close the file and select it again from the dialog to refresh the preview." - End Try + If ucrInputFilePath.GetText() <> "" Then + Try + sReader = New StreamReader(ucrInputFilePath.GetText()) + txtPreview.Text = "" + For i = 1 To intLines + nudSkip.Value + 1 + txtPreview.Text = txtPreview.Text & sReader.ReadLine() & vbCrLf + If sReader.Peek() = -1 Then + Exit For + End If + Next + Catch ex As Exception + txtPreview.Text = "Cannot show text preview of file:" & ucrInputFilePath.GetText() & ". The file may be in use by another program. Close the file and select it again from the dialog to refresh the preview." + End Try + Else + txtPreview.Text = "" + End If End Sub Private Sub RefreshFrameView() @@ -265,7 +269,11 @@ Public Class dlgImportDataset clsReadCSV.AddParameter("nrows", intLines) End If lblCannotImport.Hide() - bValid = frmMain.clsRLink.RunInternalScript(ucrBase.clsRsyntax.GetScript(), strTempDataFrameName, bSilent:=True) + If ucrInputFilePath.GetText() = "" Then + bValid = False + Else + bValid = frmMain.clsRLink.RunInternalScript(ucrBase.clsRsyntax.GetScript(), strTempDataFrameName, bSilent:=True) + End If If bValid Then expTemp = frmMain.clsRLink.RunInternalScriptGetValue("convert_to_character_matrix(" & strTempDataFrameName & ")", bSilent:=True) dfTemp = Nothing From 28e0e36b6e2599c1ed0ebb06e3f4c625b0d532e5 Mon Sep 17 00:00:00 2001 From: maxwell fundi Date: Wed, 8 Jun 2016 09:33:43 +0300 Subject: [PATCH 6/6] Changing AddItems to SetItems on dlgImport --- instat/dlgImportDataset.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/instat/dlgImportDataset.vb b/instat/dlgImportDataset.vb index 7daa495cded..3baefe47ab6 100644 --- a/instat/dlgImportDataset.vb +++ b/instat/dlgImportDataset.vb @@ -93,10 +93,10 @@ Public Class dlgImportDataset 'csv options settings clsReadCSV.AddParameter("check.names", "TRUE") - ucrInputEncoding.AddItems({"unknown"}) - ucrInputSeparator.AddItems({"Automatic", ",", "Whitespace", ":", ";", "|", "^"}) - ucrInputHeaders.AddItems({"Automatic", "Yes", "No"}) - ucrInputDecimal.AddItems({"Automatic", ".", ","}) + ucrInputEncoding.SetItems({"unknown"}) + ucrInputSeparator.SetItems({"Automatic", ",", "Whitespace", ":", ";", "|", "^"}) + ucrInputHeaders.SetItems({"Automatic", "Yes", "No"}) + ucrInputDecimal.SetItems({"Automatic", ".", ","}) nudSkip.Maximum = Integer.MaxValue End Sub