Changeset 14514 for branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4
- Timestamp:
- 12/21/16 11:26:54 (8 years ago)
- Location:
- branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj
r14511 r14514 297 297 <Compile Include="Utils\FindPreprocessingItemsIterator.cs" /> 298 298 <Compile Include="Utils\IFindPreprocessingItemsIterator.cs" /> 299 <Compile Include="Utils\VerticalLabel.cs"> 300 <SubType>Component</SubType> 301 </Compile> 299 302 <Compile Include="ViewShortcutListView.cs"> 300 303 <SubType>UserControl</SubType> -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.Designer.cs
r14511 r14514 47 47 this.components = new System.ComponentModel.Container(); 48 48 this.splitContainer = new System.Windows.Forms.SplitContainer(); 49 this. groupBox1= new System.Windows.Forms.GroupBox();49 this.variablesGroupBox = new System.Windows.Forms.GroupBox(); 50 50 this.uncheckAllButton = new System.Windows.Forms.Button(); 51 51 this.checkAllButton = new System.Windows.Forms.Button(); … … 57 57 this.splitContainer.Panel1.SuspendLayout(); 58 58 this.splitContainer.SuspendLayout(); 59 this. groupBox1.SuspendLayout();59 this.variablesGroupBox.SuspendLayout(); 60 60 this.SuspendLayout(); 61 61 // … … 69 69 // splitContainer.Panel1 70 70 // 71 this.splitContainer.Panel1.Controls.Add(this. groupBox1);71 this.splitContainer.Panel1.Controls.Add(this.variablesGroupBox); 72 72 this.splitContainer.Size = new System.Drawing.Size(654, 403); 73 73 this.splitContainer.SplitterDistance = 180; 74 74 this.splitContainer.TabIndex = 7; 75 75 // 76 // groupBox176 // variablesGroupBox 77 77 // 78 this. groupBox1.Controls.Add(this.uncheckAllButton);79 this. groupBox1.Controls.Add(this.checkAllButton);80 this. groupBox1.Controls.Add(this.checkInputsTargetButton);81 this. groupBox1.Controls.Add(this.variablesListView);82 this. groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;83 this. groupBox1.Location = new System.Drawing.Point(0, 0);84 this. groupBox1.Name = "groupBox1";85 this. groupBox1.Size = new System.Drawing.Size(180, 403);86 this. groupBox1.TabIndex = 7;87 this. groupBox1.TabStop = false;88 this. groupBox1.Text = "Variables";78 this.variablesGroupBox.Controls.Add(this.uncheckAllButton); 79 this.variablesGroupBox.Controls.Add(this.checkAllButton); 80 this.variablesGroupBox.Controls.Add(this.checkInputsTargetButton); 81 this.variablesGroupBox.Controls.Add(this.variablesListView); 82 this.variablesGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 83 this.variablesGroupBox.Location = new System.Drawing.Point(0, 0); 84 this.variablesGroupBox.Name = "variablesGroupBox"; 85 this.variablesGroupBox.Size = new System.Drawing.Size(180, 403); 86 this.variablesGroupBox.TabIndex = 7; 87 this.variablesGroupBox.TabStop = false; 88 this.variablesGroupBox.Text = "Variables"; 89 89 // 90 90 // uncheckAllButton … … 153 153 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 154 154 this.splitContainer.ResumeLayout(false); 155 this. groupBox1.ResumeLayout(false);155 this.variablesGroupBox.ResumeLayout(false); 156 156 this.ResumeLayout(false); 157 157 … … 161 161 protected System.Windows.Forms.SplitContainer splitContainer; 162 162 private System.Windows.Forms.ListView variablesListView; 163 private System.Windows.Forms.GroupBox groupBox1;163 private System.Windows.Forms.GroupBox variablesGroupBox; 164 164 private System.Windows.Forms.ToolTip toolTip; 165 165 private System.Windows.Forms.ColumnHeader columnHeader; -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.Designer.cs
r14511 r14514 57 57 this.heightTrackBar = new System.Windows.Forms.TrackBar(); 58 58 this.widthTrackBar = new System.Windows.Forms.TrackBar(); 59 this.regressionGroupBox = new System.Windows.Forms.GroupBox(); 60 this.regressionTypeComboBox = new System.Windows.Forms.ComboBox(); 61 this.polynomialRegressionOrderNumericUpDown = new System.Windows.Forms.NumericUpDown(); 62 this.orderLabel = new System.Windows.Forms.Label(); 63 this.label4 = new System.Windows.Forms.Label(); 59 64 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 60 65 this.splitContainer.Panel1.SuspendLayout(); … … 68 73 ((System.ComponentModel.ISupportInitialize)(this.heightTrackBar)).BeginInit(); 69 74 ((System.ComponentModel.ISupportInitialize)(this.widthTrackBar)).BeginInit(); 75 this.regressionGroupBox.SuspendLayout(); 76 ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).BeginInit(); 70 77 this.SuspendLayout(); 71 78 // … … 76 83 // 77 84 this.splitContainer.Panel1.Controls.Add(this.sizeGroupBox); 85 this.splitContainer.Panel1.Controls.Add(this.regressionGroupBox); 78 86 // 79 87 // splitContainer.Panel2 … … 187 195 this.sizeGroupBox.Controls.Add(this.widthTrackBar); 188 196 this.sizeGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom; 189 this.sizeGroupBox.Location = new System.Drawing.Point(0, 267);197 this.sizeGroupBox.Location = new System.Drawing.Point(0, 198); 190 198 this.sizeGroupBox.Name = "sizeGroupBox"; 191 this.sizeGroupBox.Size = new System.Drawing.Size(180, 13 6);199 this.sizeGroupBox.Size = new System.Drawing.Size(180, 130); 192 200 this.sizeGroupBox.TabIndex = 5; 193 201 this.sizeGroupBox.TabStop = false; … … 241 249 this.widthTrackBar.Value = 20; 242 250 this.widthTrackBar.ValueChanged += new System.EventHandler(this.widthTrackBar_ValueChanged); 251 // 252 // regressionGroupBox 253 // 254 this.regressionGroupBox.Controls.Add(this.regressionTypeComboBox); 255 this.regressionGroupBox.Controls.Add(this.polynomialRegressionOrderNumericUpDown); 256 this.regressionGroupBox.Controls.Add(this.orderLabel); 257 this.regressionGroupBox.Controls.Add(this.label4); 258 this.regressionGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom; 259 this.regressionGroupBox.Location = new System.Drawing.Point(0, 328); 260 this.regressionGroupBox.Name = "regressionGroupBox"; 261 this.regressionGroupBox.Size = new System.Drawing.Size(180, 75); 262 this.regressionGroupBox.TabIndex = 3; 263 this.regressionGroupBox.TabStop = false; 264 this.regressionGroupBox.Text = "Regression"; 265 // 266 // regressionTypeComboBox 267 // 268 this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 269 | System.Windows.Forms.AnchorStyles.Right))); 270 this.regressionTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 271 this.regressionTypeComboBox.FormattingEnabled = true; 272 this.regressionTypeComboBox.Location = new System.Drawing.Point(67, 19); 273 this.regressionTypeComboBox.Name = "regressionTypeComboBox"; 274 this.regressionTypeComboBox.Size = new System.Drawing.Size(107, 21); 275 this.regressionTypeComboBox.TabIndex = 14; 276 this.regressionTypeComboBox.SelectedValueChanged += new System.EventHandler(this.regressionTypeComboBox_SelectedValueChanged); 277 // 278 // polynomialRegressionOrderNumericUpDown 279 // 280 this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 281 | System.Windows.Forms.AnchorStyles.Right))); 282 this.polynomialRegressionOrderNumericUpDown.Location = new System.Drawing.Point(67, 45); 283 this.polynomialRegressionOrderNumericUpDown.Margin = new System.Windows.Forms.Padding(9, 3, 3, 3); 284 this.polynomialRegressionOrderNumericUpDown.Maximum = new decimal(new int[] { 285 6, 286 0, 287 0, 288 0}); 289 this.polynomialRegressionOrderNumericUpDown.Minimum = new decimal(new int[] { 290 2, 291 0, 292 0, 293 0}); 294 this.polynomialRegressionOrderNumericUpDown.Name = "polynomialRegressionOrderNumericUpDown"; 295 this.polynomialRegressionOrderNumericUpDown.Size = new System.Drawing.Size(107, 20); 296 this.polynomialRegressionOrderNumericUpDown.TabIndex = 15; 297 this.polynomialRegressionOrderNumericUpDown.Value = new decimal(new int[] { 298 2, 299 0, 300 0, 301 0}); 302 this.polynomialRegressionOrderNumericUpDown.ValueChanged += new System.EventHandler(this.polynomialRegressionOrderNumericUpDown_ValueChanged); 303 // 304 // orderLabel 305 // 306 this.orderLabel.AutoSize = true; 307 this.orderLabel.Location = new System.Drawing.Point(6, 47); 308 this.orderLabel.Name = "orderLabel"; 309 this.orderLabel.Size = new System.Drawing.Size(36, 13); 310 this.orderLabel.TabIndex = 16; 311 this.orderLabel.Text = "Order:"; 312 // 313 // label4 314 // 315 this.label4.AutoSize = true; 316 this.label4.Location = new System.Drawing.Point(6, 22); 317 this.label4.Name = "label4"; 318 this.label4.Size = new System.Drawing.Size(34, 13); 319 this.label4.TabIndex = 13; 320 this.label4.Text = "Type:"; 243 321 // 244 322 // ScatterPlotMultiView … … 262 340 ((System.ComponentModel.ISupportInitialize)(this.heightTrackBar)).EndInit(); 263 341 ((System.ComponentModel.ISupportInitialize)(this.widthTrackBar)).EndInit(); 342 this.regressionGroupBox.ResumeLayout(false); 343 this.regressionGroupBox.PerformLayout(); 344 ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).EndInit(); 264 345 this.ResumeLayout(false); 265 346 … … 280 361 private System.Windows.Forms.Label heightLabel; 281 362 private System.Windows.Forms.Label widthLabel; 363 private System.Windows.Forms.GroupBox regressionGroupBox; 364 private System.Windows.Forms.ComboBox regressionTypeComboBox; 365 private System.Windows.Forms.NumericUpDown polynomialRegressionOrderNumericUpDown; 366 private System.Windows.Forms.Label orderLabel; 367 private System.Windows.Forms.Label label4; 282 368 } 283 369 } -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
r14511 r14514 10 10 using HeuristicLab.MainForm; 11 11 using HeuristicLab.MainForm.WindowsForms; 12 using RegressionType = HeuristicLab.Analysis.ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType; 12 13 13 14 namespace HeuristicLab.DataPreprocessing.Views { … … 16 17 public partial class ScatterPlotMultiView : PreprocessingCheckedVariablesView { 17 18 private readonly IDictionary<string, Label> columnHeaderCache; 18 private readonly IDictionary<string, Label> rowHeaderCache;19 private readonly IDictionary<string, VerticalLabel> rowHeaderCache; 19 20 private readonly IDictionary<Tuple<string/*col*/, string/*row*/>, Control> bodyCache; 20 21 21 22 public ScatterPlotMultiView() { 22 23 InitializeComponent(); 24 25 regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType)); 26 regressionTypeComboBox.SelectedItem = RegressionType.None; 23 27 24 28 #region Initialize Scrollbars … … 41 45 42 46 columnHeaderCache = new Dictionary<string, Label>(); 43 rowHeaderCache = new Dictionary<string, Label>();47 rowHeaderCache = new Dictionary<string, VerticalLabel>(); 44 48 bodyCache = new Dictionary<Tuple<string, string>, Control>(); 45 49 … … 57 61 GenerateCharts(); 58 62 } 63 } 64 65 protected override void SetEnabledStateOfControls() { 66 base.SetEnabledStateOfControls(); 67 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 68 polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial; 59 69 } 60 70 … … 239 249 private Label GetRowHeader(string variable) { 240 250 if (!rowHeaderCache.ContainsKey(variable)) { 241 rowHeaderCache.Add(variable, new Label() {251 rowHeaderCache.Add(variable, new VerticalLabel() { 242 252 Text = variable, 243 253 TextAlign = ContentAlignment.MiddleCenter, 244 254 Name = variable, 245 255 Width = rowHeaderTableLayoutPanel.Width, 256 Height = columnHeaderScrollPanel.Width, 246 257 Dock = DockStyle.Fill, 247 258 Margin = new Padding(3) … … 269 280 } else { //scatter plot 270 281 var scatterPlot = Content.CreateScatterPlot(colVariable, rowVariable); 271 foreach (var row in scatterPlot.Rows) 282 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 283 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 284 foreach (var row in scatterPlot.Rows) { 272 285 row.VisualProperties.PointSize = 3; 286 row.VisualProperties.IsRegressionVisibleInLegend = false; 287 row.VisualProperties.RegressionType = regressionType; 288 row.VisualProperties.PolynomialRegressionOrder = order; 289 } 273 290 scatterPlot.VisualProperties.Title = string.Empty; 274 var scatterPlotControl = new /*Preprocessing*/ScatterPlotControl {291 var scatterPlotControl = new ScatterPlotControl { 275 292 Name = key.ToString(), 276 293 Content = scatterPlot, … … 279 296 //XAxisFormat = "G3" 280 297 }; 281 scatterPlotControl.DoubleClick += ScatterPlotDoubleClick; // ToDo: not working; double click is already handled by the chart298 //scatterPlotControl.DoubleClick += ScatterPlotDoubleClick; // ToDo: not working; double click is already handled by the chart 282 299 bodyCache.Add(key, scatterPlotControl); 283 300 } … … 348 365 c++; 349 366 } 367 UpdateRegressionLine(); 350 368 } 351 369 … … 444 462 } 445 463 #endregion 464 465 #region Regression Line 466 private void regressionTypeComboBox_SelectedValueChanged(object sender, EventArgs e) { 467 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 468 polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial; 469 UpdateRegressionLine(); 470 } 471 472 private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) { 473 UpdateRegressionLine(); 474 } 475 476 private void UpdateRegressionLine() { 477 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 478 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 479 480 foreach (var control in bodyCache.Values) { 481 var scatterPlotControl = control as ScatterPlotControl; 482 if (scatterPlotControl != null) { 483 foreach (var row in scatterPlotControl.Content.Rows) { 484 row.VisualProperties.IsRegressionVisibleInLegend = false; 485 row.VisualProperties.RegressionType = regressionType; 486 row.VisualProperties.PolynomialRegressionOrder = order; 487 } 488 } 489 } 490 } 491 #endregion 446 492 } 447 493 } 494 -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs
r14470 r14514 53 53 this.comboBoxYVariable = new System.Windows.Forms.ComboBox(); 54 54 this.comboBoxXVariable = new System.Windows.Forms.ComboBox(); 55 this.regressionGroupBox = new System.Windows.Forms.GroupBox(); 56 this.regressionTypeComboBox = new System.Windows.Forms.ComboBox(); 57 this.polynomialRegressionOrderNumericUpDown = new System.Windows.Forms.NumericUpDown(); 58 this.orderLabel = new System.Windows.Forms.Label(); 59 this.label4 = new System.Windows.Forms.Label(); 60 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 55 61 this.groupBox1.SuspendLayout(); 62 this.regressionGroupBox.SuspendLayout(); 63 ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).BeginInit(); 64 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 65 this.splitContainer1.Panel1.SuspendLayout(); 66 this.splitContainer1.Panel2.SuspendLayout(); 67 this.splitContainer1.SuspendLayout(); 56 68 this.SuspendLayout(); 57 69 // 58 70 // scatterPlotControl 59 71 // 60 this.scatterPlotControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)61 | System.Windows.Forms.AnchorStyles.Left)62 | System.Windows.Forms.AnchorStyles.Right)));63 72 this.scatterPlotControl.Content = null; 64 this.scatterPlotControl.Location = new System.Drawing.Point(169, 3); 73 this.scatterPlotControl.Dock = System.Windows.Forms.DockStyle.Fill; 74 this.scatterPlotControl.Location = new System.Drawing.Point(0, 0); 65 75 this.scatterPlotControl.Name = "scatterPlotControl"; 66 this.scatterPlotControl.Size = new System.Drawing.Size(68 9, 509);76 this.scatterPlotControl.Size = new System.Drawing.Size(687, 517); 67 77 this.scatterPlotControl.TabIndex = 0; 68 78 // … … 75 85 this.groupBox1.Controls.Add(this.comboBoxYVariable); 76 86 this.groupBox1.Controls.Add(this.comboBoxXVariable); 77 this.groupBox1.Location = new System.Drawing.Point(3, 3); 87 this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top; 88 this.groupBox1.Location = new System.Drawing.Point(0, 0); 78 89 this.groupBox1.Name = "groupBox1"; 79 this.groupBox1.Size = new System.Drawing.Size(1 60, 215);90 this.groupBox1.Size = new System.Drawing.Size(172, 137); 80 91 this.groupBox1.TabIndex = 1; 81 92 this.groupBox1.TabStop = false; 82 this.groupBox1.Text = " Options";93 this.groupBox1.Text = "Variables"; 83 94 // 84 95 // label3 85 96 // 86 97 this.label3.AutoSize = true; 87 this.label3.Location = new System.Drawing.Point( 17, 141);98 this.label3.Location = new System.Drawing.Point(6, 97); 88 99 this.label3.Name = "label3"; 89 this.label3.Size = new System.Drawing.Size(3 6, 13);100 this.label3.Size = new System.Drawing.Size(39, 13); 90 101 this.label3.TabIndex = 3; 91 this.label3.Text = "Group ";102 this.label3.Text = "Group:"; 92 103 // 93 104 // label2 94 105 // 95 106 this.label2.AutoSize = true; 96 this.label2.Location = new System.Drawing.Point( 17, 80);107 this.label2.Location = new System.Drawing.Point(6, 63); 97 108 this.label2.Name = "label2"; 98 this.label2.Size = new System.Drawing.Size( 55, 13);109 this.label2.Size = new System.Drawing.Size(17, 13); 99 110 this.label2.TabIndex = 3; 100 this.label2.Text = "Y Variable";111 this.label2.Text = "Y:"; 101 112 // 102 113 // label1 103 114 // 104 115 this.label1.AutoSize = true; 105 this.label1.Location = new System.Drawing.Point( 17, 25);116 this.label1.Location = new System.Drawing.Point(6, 29); 106 117 this.label1.Name = "label1"; 107 this.label1.Size = new System.Drawing.Size( 55, 13);118 this.label1.Size = new System.Drawing.Size(17, 13); 108 119 this.label1.TabIndex = 2; 109 this.label1.Text = "X Variable";120 this.label1.Text = "X:"; 110 121 // 111 122 // comboBoxGroup 112 123 // 124 this.comboBoxGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 125 | System.Windows.Forms.AnchorStyles.Right))); 113 126 this.comboBoxGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 114 127 this.comboBoxGroup.FormattingEnabled = true; 115 this.comboBoxGroup.Location = new System.Drawing.Point( 20, 164);128 this.comboBoxGroup.Location = new System.Drawing.Point(51, 94); 116 129 this.comboBoxGroup.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3); 117 130 this.comboBoxGroup.Name = "comboBoxGroup"; 118 this.comboBoxGroup.Size = new System.Drawing.Size(1 21, 21);131 this.comboBoxGroup.Size = new System.Drawing.Size(115, 21); 119 132 this.comboBoxGroup.TabIndex = 1; 120 133 this.comboBoxGroup.SelectedIndexChanged += new System.EventHandler(this.comboBoxGroup_SelectedIndexChanged); … … 122 135 // comboBoxYVariable 123 136 // 137 this.comboBoxYVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 138 | System.Windows.Forms.AnchorStyles.Right))); 124 139 this.comboBoxYVariable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 125 140 this.comboBoxYVariable.FormattingEnabled = true; 126 this.comboBoxYVariable.Location = new System.Drawing.Point( 20, 103);141 this.comboBoxYVariable.Location = new System.Drawing.Point(51, 60); 127 142 this.comboBoxYVariable.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3); 128 143 this.comboBoxYVariable.Name = "comboBoxYVariable"; 129 this.comboBoxYVariable.Size = new System.Drawing.Size(1 21, 21);144 this.comboBoxYVariable.Size = new System.Drawing.Size(115, 21); 130 145 this.comboBoxYVariable.TabIndex = 1; 131 146 this.comboBoxYVariable.SelectedIndexChanged += new System.EventHandler(this.comboBoxYVariable_SelectedIndexChanged); … … 133 148 // comboBoxXVariable 134 149 // 150 this.comboBoxXVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 151 | System.Windows.Forms.AnchorStyles.Right))); 135 152 this.comboBoxXVariable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 136 153 this.comboBoxXVariable.FormattingEnabled = true; 137 this.comboBoxXVariable.Location = new System.Drawing.Point( 20, 48);154 this.comboBoxXVariable.Location = new System.Drawing.Point(51, 26); 138 155 this.comboBoxXVariable.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3); 139 156 this.comboBoxXVariable.Name = "comboBoxXVariable"; 140 this.comboBoxXVariable.Size = new System.Drawing.Size(1 21, 21);157 this.comboBoxXVariable.Size = new System.Drawing.Size(115, 21); 141 158 this.comboBoxXVariable.TabIndex = 0; 142 159 this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBoxXVariable_SelectedIndexChanged); 143 160 // 161 // regressionGroupBox 162 // 163 this.regressionGroupBox.Controls.Add(this.regressionTypeComboBox); 164 this.regressionGroupBox.Controls.Add(this.polynomialRegressionOrderNumericUpDown); 165 this.regressionGroupBox.Controls.Add(this.orderLabel); 166 this.regressionGroupBox.Controls.Add(this.label4); 167 this.regressionGroupBox.Dock = System.Windows.Forms.DockStyle.Top; 168 this.regressionGroupBox.Location = new System.Drawing.Point(0, 137); 169 this.regressionGroupBox.Name = "regressionGroupBox"; 170 this.regressionGroupBox.Size = new System.Drawing.Size(172, 78); 171 this.regressionGroupBox.TabIndex = 4; 172 this.regressionGroupBox.TabStop = false; 173 this.regressionGroupBox.Text = "Regression"; 174 // 175 // regressionTypeComboBox 176 // 177 this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 178 | System.Windows.Forms.AnchorStyles.Right))); 179 this.regressionTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 180 this.regressionTypeComboBox.FormattingEnabled = true; 181 this.regressionTypeComboBox.Location = new System.Drawing.Point(51, 19); 182 this.regressionTypeComboBox.Name = "regressionTypeComboBox"; 183 this.regressionTypeComboBox.Size = new System.Drawing.Size(115, 21); 184 this.regressionTypeComboBox.TabIndex = 14; 185 this.regressionTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.regressionTypeComboBox_SelectedIndexChanged); 186 // 187 // polynomialRegressionOrderNumericUpDown 188 // 189 this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 190 | System.Windows.Forms.AnchorStyles.Right))); 191 this.polynomialRegressionOrderNumericUpDown.Location = new System.Drawing.Point(51, 47); 192 this.polynomialRegressionOrderNumericUpDown.Margin = new System.Windows.Forms.Padding(9, 3, 3, 3); 193 this.polynomialRegressionOrderNumericUpDown.Maximum = new decimal(new int[] { 194 6, 195 0, 196 0, 197 0}); 198 this.polynomialRegressionOrderNumericUpDown.Minimum = new decimal(new int[] { 199 2, 200 0, 201 0, 202 0}); 203 this.polynomialRegressionOrderNumericUpDown.Name = "polynomialRegressionOrderNumericUpDown"; 204 this.polynomialRegressionOrderNumericUpDown.Size = new System.Drawing.Size(115, 20); 205 this.polynomialRegressionOrderNumericUpDown.TabIndex = 15; 206 this.polynomialRegressionOrderNumericUpDown.Value = new decimal(new int[] { 207 2, 208 0, 209 0, 210 0}); 211 this.polynomialRegressionOrderNumericUpDown.ValueChanged += new System.EventHandler(this.polynomialRegressionOrderNumericUpDown_ValueChanged); 212 // 213 // orderLabel 214 // 215 this.orderLabel.AutoSize = true; 216 this.orderLabel.Location = new System.Drawing.Point(6, 49); 217 this.orderLabel.Name = "orderLabel"; 218 this.orderLabel.Size = new System.Drawing.Size(36, 13); 219 this.orderLabel.TabIndex = 16; 220 this.orderLabel.Text = "Order:"; 221 // 222 // label4 223 // 224 this.label4.AutoSize = true; 225 this.label4.Location = new System.Drawing.Point(6, 22); 226 this.label4.Name = "label4"; 227 this.label4.Size = new System.Drawing.Size(34, 13); 228 this.label4.TabIndex = 13; 229 this.label4.Text = "Type:"; 230 // 231 // splitContainer1 232 // 233 this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 234 this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; 235 this.splitContainer1.Location = new System.Drawing.Point(0, 0); 236 this.splitContainer1.Name = "splitContainer1"; 237 // 238 // splitContainer1.Panel1 239 // 240 this.splitContainer1.Panel1.Controls.Add(this.regressionGroupBox); 241 this.splitContainer1.Panel1.Controls.Add(this.groupBox1); 242 // 243 // splitContainer1.Panel2 244 // 245 this.splitContainer1.Panel2.Controls.Add(this.scatterPlotControl); 246 this.splitContainer1.Size = new System.Drawing.Size(863, 517); 247 this.splitContainer1.SplitterDistance = 172; 248 this.splitContainer1.TabIndex = 5; 249 // 144 250 // ScatterPlotSingleView 145 251 // 146 252 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 147 253 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 148 this.Controls.Add(this.groupBox1); 149 this.Controls.Add(this.scatterPlotControl); 254 this.Controls.Add(this.splitContainer1); 150 255 this.Name = "ScatterPlotSingleView"; 151 256 this.Size = new System.Drawing.Size(863, 517); 152 257 this.groupBox1.ResumeLayout(false); 153 258 this.groupBox1.PerformLayout(); 259 this.regressionGroupBox.ResumeLayout(false); 260 this.regressionGroupBox.PerformLayout(); 261 ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).EndInit(); 262 this.splitContainer1.Panel1.ResumeLayout(false); 263 this.splitContainer1.Panel2.ResumeLayout(false); 264 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 265 this.splitContainer1.ResumeLayout(false); 154 266 this.ResumeLayout(false); 155 267 … … 166 278 private System.Windows.Forms.ComboBox comboBoxGroup; 167 279 private System.Windows.Forms.Label label3; 280 private System.Windows.Forms.GroupBox regressionGroupBox; 281 private System.Windows.Forms.ComboBox regressionTypeComboBox; 282 private System.Windows.Forms.NumericUpDown polynomialRegressionOrderNumericUpDown; 283 private System.Windows.Forms.Label orderLabel; 284 private System.Windows.Forms.Label label4; 285 private System.Windows.Forms.SplitContainer splitContainer1; 168 286 } 169 287 } -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs
r14495 r14514 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using RegressionType = HeuristicLab.Analysis.ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType; 28 29 29 30 namespace HeuristicLab.DataPreprocessing.Views { … … 40 41 public ScatterPlotSingleView() { 41 42 InitializeComponent(); 43 44 regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType)); 45 regressionTypeComboBox.SelectedItem = RegressionType.None; 42 46 } 43 47 … … 88 92 var groupVariable = (string)comboBoxGroup.SelectedItem; 89 93 ScatterPlot scatterPlot = Content.CreateScatterPlot(xVariable, yVariable, groupVariable); 90 foreach (var row in scatterPlot.Rows) 94 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 95 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 96 foreach (var row in scatterPlot.Rows) { 91 97 row.VisualProperties.PointSize = 6; 98 row.VisualProperties.IsRegressionVisibleInLegend = false; 99 row.VisualProperties.RegressionType = regressionType; 100 row.VisualProperties.PolynomialRegressionOrder = order; 101 } 92 102 var vp = scatterPlot.VisualProperties; 93 103 vp.Title = string.Empty; … … 144 154 UpdateScatterPlot(); 145 155 } 156 157 #region Regression Line 158 private void regressionTypeComboBox_SelectedIndexChanged(object sender, EventArgs e) { 159 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 160 polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial; 161 UpdateRegressionLine(); 162 } 163 164 private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) { 165 UpdateRegressionLine(); 166 } 167 168 private void UpdateRegressionLine() { 169 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 170 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 171 172 foreach (var row in scatterPlotControl.Content.Rows) { 173 row.VisualProperties.IsRegressionVisibleInLegend = false; 174 row.VisualProperties.RegressionType = regressionType; 175 row.VisualProperties.PolynomialRegressionOrder = order; 176 } 177 } 178 #endregion 146 179 } 147 180 } 181
Note: See TracChangeset
for help on using the changeset viewer.