Changeset 14525 for branches/DataPreprocessing Enhancements
- Timestamp:
- 12/22/16 16:36:59 (8 years ago)
- Location:
- branches/DataPreprocessing Enhancements
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs
r14185 r14525 70 70 List<KeyValuePair<int, SortOrder>> order = new List<KeyValuePair<int, SortOrder>>(base.sortedColumnIndices); 71 71 base.OnContentChanged(); 72 73 foreach (DataGridViewColumn column in DataGridView.Columns) { 74 var variable = column.HeaderText; 75 bool isInputTarget = Content.PreProcessingData.InputVariables.Contains(variable) 76 || Content.PreProcessingData.TargetVariable == variable; 77 column.Visible = isInputTarget; 78 } 72 79 73 80 DataGridView.RowHeadersWidth = 70; -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs
r14521 r14525 62 62 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 63 63 this.gradientPanel = new System.Windows.Forms.Panel(); 64 this.gradientPictureBox = new System.Windows.Forms.PictureBox(); 64 65 this.gradientMinimumLabel = new System.Windows.Forms.Label(); 65 66 this.gradientMaximumLabel = new System.Windows.Forms.Label(); 66 this.gradientPictureBox = new System.Windows.Forms.PictureBox();67 67 this.groupBox1.SuspendLayout(); 68 68 this.regressionGroupBox.SuspendLayout(); … … 146 146 this.comboBoxGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 147 147 | System.Windows.Forms.AnchorStyles.Right))); 148 this.comboBoxGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 148 this.comboBoxGroup.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; 149 this.comboBoxGroup.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; 149 150 this.comboBoxGroup.FormattingEnabled = true; 150 151 this.comboBoxGroup.Location = new System.Drawing.Point(51, 94); … … 159 160 this.comboBoxYVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 160 161 | System.Windows.Forms.AnchorStyles.Right))); 161 this.comboBoxYVariable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 162 this.comboBoxYVariable.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; 163 this.comboBoxYVariable.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; 162 164 this.comboBoxYVariable.FormattingEnabled = true; 163 165 this.comboBoxYVariable.Location = new System.Drawing.Point(51, 60); … … 172 174 this.comboBoxXVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 173 175 | System.Windows.Forms.AnchorStyles.Right))); 174 this.comboBoxXVariable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 176 this.comboBoxXVariable.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; 177 this.comboBoxXVariable.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; 175 178 this.comboBoxXVariable.FormattingEnabled = true; 176 179 this.comboBoxXVariable.Location = new System.Drawing.Point(51, 26); … … 282 285 this.gradientPanel.TabIndex = 1; 283 286 // 287 // gradientPictureBox 288 // 289 this.gradientPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 290 | System.Windows.Forms.AnchorStyles.Left))); 291 this.gradientPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 292 this.gradientPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("gradientPictureBox.Image"))); 293 this.gradientPictureBox.Location = new System.Drawing.Point(17, 29); 294 this.gradientPictureBox.Name = "gradientPictureBox"; 295 this.gradientPictureBox.Size = new System.Drawing.Size(35, 460); 296 this.gradientPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 297 this.gradientPictureBox.TabIndex = 19; 298 this.gradientPictureBox.TabStop = false; 299 // 284 300 // gradientMinimumLabel 285 301 // … … 303 319 this.gradientMaximumLabel.Text = "1.0"; 304 320 this.gradientMaximumLabel.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 305 //306 // gradientPictureBox307 //308 this.gradientPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)309 | System.Windows.Forms.AnchorStyles.Left)));310 this.gradientPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;311 this.gradientPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("GradientPictureBox.Image")));312 this.gradientPictureBox.Location = new System.Drawing.Point(17, 29);313 this.gradientPictureBox.Name = "gradientPictureBox";314 this.gradientPictureBox.Size = new System.Drawing.Size(35, 460);315 this.gradientPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;316 this.gradientPictureBox.TabIndex = 19;317 this.gradientPictureBox.TabStop = false;318 321 // 319 322 // ScatterPlotSingleView -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs
r14521 r14525 103 103 var groupVariable = (string)comboBoxGroup.SelectedItem; 104 104 105 bool groupingActive = useGradientCheckBox.Checked &&groupVariable != NoGroupItem;105 bool isGroupingActive = groupVariable != NoGroupItem; 106 106 double min = 0, max = 1; 107 if ( groupingActive) {107 if (isGroupingActive) { 108 108 var groupValues = Content.PreprocessingData.GetValues<double>(Content.PreprocessingData.GetColumnIndex(groupVariable)) 109 109 .Distinct().OrderBy(x => x).ToList(); 110 min = groupValues.First ();111 max = groupValues.Last ();110 min = groupValues.FirstOrDefault(x => !double.IsNaN(x)); 111 max = groupValues.LastOrDefault(x => !double.IsNaN(x)); 112 112 } 113 113 ScatterPlot scatterPlot = Content.CreateScatterPlot(xVariable, yVariable, groupVariable); … … 122 122 row.VisualProperties.PolynomialRegressionOrder = order; 123 123 row.VisualProperties.IsVisibleInLegend = !useGradientCheckBox.Checked; 124 if ( groupingActive)124 if (isGroupingActive && useGradientCheckBox.Checked) 125 125 row.VisualProperties.Color = GetColor(double.Parse(row.Name), min, max); 126 126 } … … 133 133 scatterPlotControl.Content = scatterPlot; 134 134 135 if ( groupingActive) {135 if (isGroupingActive) { 136 136 gradientMinimumLabel.Text = min.ToString("G5"); 137 137 gradientMaximumLabel.Text = max.ToString("G5"); … … 228 228 var groupValues = Content.PreprocessingData.GetValues<double>(Content.PreprocessingData.GetColumnIndex(groupVariable)) 229 229 .Distinct().OrderBy(x => x).ToList(); 230 double min = groupValues.First (), max = groupValues.Last();230 double min = groupValues.FirstOrDefault(x => !double.IsNaN(x)), max = groupValues.LastOrDefault(x => !double.IsNaN(x)); 231 231 foreach (var group in groupValues) { 232 232 ScatterPlotDataRow row; … … 249 249 private static Color GetColor(double value, double min, double max) { 250 250 if (double.IsNaN(value)) { 251 return Color. DarkGray;251 return Color.Black; 252 252 } 253 253 var colors = ColorGradient.Colors; -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/ScatterPlotContent.cs
r14521 r14525 73 73 var groupValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameGroup)); 74 74 var data = points.Zip(groupValues, (p, g) => new { p, g }) 75 .Where(x => !double.IsNaN(x.p.X) && !double.IsNaN(x.p.Y) && !double.Is NaN(x.g) && !double.IsInfinity(x.p.X) && !double.IsInfinity(x.p.Y) && !double.IsInfinity(x.g))75 .Where(x => !double.IsNaN(x.p.X) && !double.IsNaN(x.p.Y) && !double.IsInfinity(x.p.X) && !double.IsInfinity(x.p.Y)) 76 76 .ToList(); 77 77 78 78 foreach (var groupValue in groupValues.Distinct().OrderBy(g => g)) { 79 var values = data.Where(x => x.g == groupValue ).Select(v => v.p);79 var values = data.Where(x => x.g == groupValue || (double.IsNaN(x.g) && double.IsNaN(groupValue))).Select(v => v.p); 80 80 var row = new ScatterPlotDataRow(string.Format("{0} ({1})", variableNameGroup, groupValue), "", values) { 81 81 Name = groupValue.ToString("R"),
Note: See TracChangeset
for help on using the changeset viewer.