Changeset 14994 for branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs
- Timestamp:
- 05/17/17 14:37:40 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs
r14470 r14994 20 20 #endregion 21 21 22 using System.Windows.Forms; 23 using HeuristicLab.DataPreprocessing; 22 using System; 23 using System.Linq; 24 using HeuristicLab.Data.Views; 24 25 using HeuristicLab.MainForm; 25 26 using HeuristicLab.MainForm.WindowsForms; 26 27 27 namespace HeuristicLab. Problems.DataAnalysis.Views {28 namespace HeuristicLab.DataPreprocessing.Views { 28 29 [View("Preprocessing Feature Correlation View")] 29 30 [Content(typeof(CorrelationMatrixContent), true)] … … 35 36 } 36 37 37 FeatureCorrelationView correlationView;38 39 38 public PreprocessingFeatureCorrelationView() { 40 39 InitializeComponent(); 41 correlationView = new FeatureCorrelationView();42 correlationView.Dock = DockStyle.Fill;43 this.Controls.Add(correlationView);44 40 } 45 46 41 47 42 protected override void RegisterContentEvents() { … … 61 56 protected override void OnContentChanged() { 62 57 base.OnContentChanged(); 63 if (Content == null) { 64 correlationView.Content = null; 58 correlationView.Content = Content != null ? Content.ProblemData : null; 59 } 60 61 #region Check Variables 62 private void checkAllButton_Click(object sender, System.EventArgs e) { 63 SetVisibility(x => true); 64 } 65 private void checkInputsTargetButton_Click(object sender, System.EventArgs e) { 66 var ppd = Content.PreprocessingData; 67 SetVisibility(x => ppd.InputVariables.Contains(x) || ppd.TargetVariable == x); 68 } 69 private void uncheckAllButton_Click(object sender, System.EventArgs e) { 70 SetVisibility(x => false); 71 } 72 private void SetVisibility(Func<string, bool> check) { 73 var dataView = (EnhancedStringConvertibleMatrixView)correlationView.Controls.Find("DataView", searchAllChildren: true).Single(); 74 var ppd = Content.PreprocessingData; 75 var visibilities = ppd.VariableNames.Where((v, i) => ppd.VariableHasType<double>(i)).Select(check).ToList(); 76 if (dataView.Content.Rows != dataView.Content.Columns || dataView.Content.Rows != visibilities.Count) 65 77 return; 66 }67 78 68 correlationView.Content = Content.ProblemData; 79 dataView.ColumnVisibility = visibilities; 80 dataView.RowVisibility = visibilities; 81 dataView.UpdateColumnHeaders(); 82 dataView.UpdateRowHeaders(); 69 83 } 84 #endregion 70 85 } 71 86 }
Note: See TracChangeset
for help on using the changeset viewer.