Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/25/16 16:16:20 (7 years ago)
Author:
pfleck
Message:

#2698 Only input and target variables are pre-checked for linechart, histrogram and scatterplot.

Location:
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs

    r14384 r14418  
    6161        InitData();
    6262        GenerateChart();
     63
     64        foreach (var row in dataRows) {
     65          string variableName = row.Name;
     66          if (!IsVariableChecked(variableName)) {
     67            dataTableView.SetRowEnabled(variableName, false);
     68            dataTable.SelectedRows.Remove(variableName);
     69            dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName)));
     70          }
     71        }
    6372      }
    6473    }
     
    7180
    7281      //add data rows to data tables according to checked item list
    73       foreach (var checkedItem in Content.VariableItemList.CheckedItems) {
    74         string variableName = Content.VariableItemList[checkedItem.Index].Value;
     82      foreach (var row in dataRows) {
     83        string variableName = row.Name;
     84
     85        //add row to data table
     86        dataTable.Rows.Add(row);
     87
     88        //add row to data table per variable
    7589        PreprocessingDataTable d = new PreprocessingDataTable(variableName);
    76         DataRow row = GetDataRow(variableName);
    77 
    78         if (row != null) {
    79           //add row to data table
    80           dataTable.Rows.Add(row);
    81 
    82           //add row to data table per variable
    83           d.Rows.Add(row);
    84           dataTablePerVariable.Add(d);
    85         }
     90        d.Rows.Add(row);
     91        dataTablePerVariable.Add(d);
    8692      }
    8793
     
    95101        string variableName = item.Value.Value;
    96102
    97         // not checked -> remove
     103
    98104        if (!IsVariableChecked(variableName)) {
     105          // not checked -> remove
    99106          dataTableView.SetRowEnabled(variableName, false);
    100107          dataTable.SelectedRows.Remove(variableName);
    101108          dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName)));
    102109        } else {
     110          // checked -> add
    103111          DataRow row = GetDataRow(variableName);
    104112          DataRow selectedRow = GetSelectedDataRow(variableName);
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.cs

    r14384 r14418  
    5656
    5757      if (Content.VariableItemList == null) {
    58         Content.VariableItemList = Content.CreateVariableItemList();
     58        IList<string> inputs = Content.PreprocessingData.InputVariables;
     59        if (Content.PreprocessingData.TargetVariable != null)
     60          inputs = inputs.Union(new[] {Content.PreprocessingData.TargetVariable}).ToList();
     61        Content.VariableItemList = Content.CreateVariableItemList(inputs);
    5962      } else {
    6063        var checkedNames = Content.VariableItemList.CheckedItems.Select(x => x.Value.Value);
    61         Content.VariableItemList = Content.CreateVariableItemList(checkedNames);
     64        Content.VariableItemList = Content.CreateVariableItemList(checkedNames.ToList());
    6265      }
    6366      Content.VariableItemList.CheckedItemsChanged += CheckedItemsChanged;
Note: See TracChangeset for help on using the changeset viewer.