Changeset 15036


Ignore:
Timestamp:
06/19/17 16:56:34 (2 months ago)
Author:
pfleck
Message:

#2709

  • Used title for showing variable name in the histogram instead of the legend. Legend is now used for grouping only.
  • Fixed Variables/Datarows in StatisticsView (were switched).
  • Improved the "Warning Dialog" for the MultiScatterPlot when too many variables might be shown.
    • Option for checking "None".
    • Show the dialog before the charts are calculated internally.
Location:
branches/DataPreprocessing Enhancements
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs

    r15021 r15036  
    1 #region License Information
    2 /* HeuristicLab
     1/* HeuristicLab
    32 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    43 *
     
    1817 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
    1918 */
    20 #endregion
    2119
    2220using System;
     
    3735  [View("Scatter Plot Multi View")]
    3836  [Content(typeof(MultiScatterPlotContent), true)]
    39   public partial class ScatterPlotMultiView : PreprocessingCheckedVariablesView {
     37  public sealed partial class ScatterPlotMultiView : PreprocessingCheckedVariablesView {
    4038    private readonly IDictionary<string, Label> columnHeaderCache = new Dictionary<string, Label>();
    4139    private readonly IDictionary<string, VerticalLabel> rowHeaderCache = new Dictionary<string, VerticalLabel>();
     
    9088          groupingComboBox.Items.Add(var);
    9189        }
     90        SuppressCheckedChangedUpdate = true;
    9291        groupingComboBox.SelectedItem = Content.GroupingVariable ?? string.Empty;
     92        SuppressCheckedChangedUpdate = false;
    9393
    9494        // uncheck variables that max 20 vars are selected initially
    95         var list = Content.VariableItemList;
    96         int numChecked = list.CheckedItems.Count();
     95        var variables = Content.VariableItemList;
     96        int numChecked = variables.CheckedItems.Count();
    9797        if (numChecked > 20) {
    98           string message = string.Format("Displaying {0} variables ({1} charts) can slown down HeuristicLab. " +
    99                                          "Should the number of initially checked variables be reduced to 20?",
     98          string message = string.Format("Display all {0} input variables ({1} charts)?" + Environment.NewLine +
     99                                         "Press No to reduce the number of checked variables to 20." + Environment.NewLine +
     100                                         "Press Cancel to uncheck all.",
    100101            numChecked, numChecked * numChecked);
    101           if (MessageBox.Show(this, message, "Reduce befor continue?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) {
     102          var dialogResult = MessageBox.Show(this, message, "Display All Input Variables?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
     103          if (dialogResult == DialogResult.No || dialogResult == DialogResult.Cancel) {
    102104            SuppressCheckedChangedUpdate = true;
    103             foreach (var var in list.CheckedItems.Reverse().Take(numChecked - 20)) {
    104               Content.VariableItemList.SetItemCheckedState(var.Value, false);
    105             }
     105            IEnumerable<StringValue> toUncheck = variables;
     106            if (dialogResult == DialogResult.No) // only show the first 20
     107              toUncheck = variables.CheckedItems.Reverse().Take(numChecked - 20).Select(x => x.Value);
     108            foreach (var var in toUncheck)
     109              Content.VariableItemList.SetItemCheckedState(var, false);
    106110            SuppressCheckedChangedUpdate = false;
    107111          }
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.cs

    r14996 r15036  
    8888    private void UpdateData(Dictionary<string, bool> oldVisibility = null) {
    8989      var logic = Content.StatisticsLogic;
    90       rowsTextBox.Text = logic.GetColumnCount().ToString();
    91       columnsTextBox.Text = logic.GetRowCount().ToString();
     90      rowsTextBox.Text = logic.GetRowCount().ToString();
     91      columnsTextBox.Text = logic.GetColumnCount().ToString();
    9292      numericColumnsTextBox.Text = logic.GetNumericColumnCount().ToString();
    9393      nominalColumnsTextBox5.Text = logic.GetNominalColumnCount().ToString();
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/HistogramContent.cs

    r14993 r15036  
    5555
    5656    public static DataTable CreateHistogram(IFilteredPreprocessingData preprocessingData, string variableName, string groupingVariableName, DataRowVisualProperties.DataRowHistogramAggregation aggregation, LegendOrder legendOrder = LegendOrder.Appearance) {
    57       var dataTable = new DataTable();
     57      var dataTable = new DataTable {
     58        VisualProperties = { Title = variableName }
     59      };
    5860
    5961      if (string.IsNullOrEmpty(groupingVariableName)) {
    6062        var row = PreprocessingChartContent.CreateDataRow(preprocessingData, variableName, DataRowVisualProperties.DataRowChartType.Histogram);
     63        row.VisualProperties.IsVisibleInLegend = false;
    6164        dataTable.Rows.Add(row);
    6265        return dataTable;
    6366      }
    64 
    65       dataTable.VisualProperties.Title = variableName;
    6667
    6768      int variableIndex = preprocessingData.GetColumnIndex(variableName);
     
    8889          VisualProperties = {
    8990              ChartType = DataRowVisualProperties.DataRowChartType.Histogram,
    90               Aggregation = aggregation
     91              Aggregation = aggregation,
     92              IsVisibleInLegend = !string.IsNullOrEmpty(groupingVariableName)
    9193            }
    9294        };
Note: See TracChangeset for help on using the changeset viewer.