Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14525


Ignore:
Timestamp:
12/22/16 16:36:59 (7 years ago)
Author:
pfleck
Message:

#2709

  • Added suggestion feature for singlescatterplotview.
  • Shows NaN groups in scatterplot (black if gradient is selected).
  • Only enables input variables in DataGridContentView per default.
  • Added missing resx file (gradient image).
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  
    7070      List<KeyValuePair<int, SortOrder>> order = new List<KeyValuePair<int, SortOrder>>(base.sortedColumnIndices);
    7171      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      }
    7279
    7380      DataGridView.RowHeadersWidth = 70;
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs

    r14521 r14525  
    6262      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
    6363      this.gradientPanel = new System.Windows.Forms.Panel();
     64      this.gradientPictureBox = new System.Windows.Forms.PictureBox();
    6465      this.gradientMinimumLabel = new System.Windows.Forms.Label();
    6566      this.gradientMaximumLabel = new System.Windows.Forms.Label();
    66       this.gradientPictureBox = new System.Windows.Forms.PictureBox();
    6767      this.groupBox1.SuspendLayout();
    6868      this.regressionGroupBox.SuspendLayout();
     
    146146      this.comboBoxGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    147147            | 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;
    149150      this.comboBoxGroup.FormattingEnabled = true;
    150151      this.comboBoxGroup.Location = new System.Drawing.Point(51, 94);
     
    159160      this.comboBoxYVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    160161            | 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;
    162164      this.comboBoxYVariable.FormattingEnabled = true;
    163165      this.comboBoxYVariable.Location = new System.Drawing.Point(51, 60);
     
    172174      this.comboBoxXVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    173175            | 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;
    175178      this.comboBoxXVariable.FormattingEnabled = true;
    176179      this.comboBoxXVariable.Location = new System.Drawing.Point(51, 26);
     
    282285      this.gradientPanel.TabIndex = 1;
    283286      //
     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      //
    284300      // gradientMinimumLabel
    285301      //
     
    303319      this.gradientMaximumLabel.Text = "1.0";
    304320      this.gradientMaximumLabel.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
    305       //
    306       // gradientPictureBox
    307       //
    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;
    318321      //
    319322      // ScatterPlotSingleView
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs

    r14521 r14525  
    103103        var groupVariable = (string)comboBoxGroup.SelectedItem;
    104104
    105         bool groupingActive = useGradientCheckBox.Checked && groupVariable != NoGroupItem;
     105        bool isGroupingActive = groupVariable != NoGroupItem;
    106106        double min = 0, max = 1;
    107         if (groupingActive) {
     107        if (isGroupingActive) {
    108108          var groupValues = Content.PreprocessingData.GetValues<double>(Content.PreprocessingData.GetColumnIndex(groupVariable))
    109109            .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));
    112112        }
    113113        ScatterPlot scatterPlot = Content.CreateScatterPlot(xVariable, yVariable, groupVariable);
     
    122122          row.VisualProperties.PolynomialRegressionOrder = order;
    123123          row.VisualProperties.IsVisibleInLegend = !useGradientCheckBox.Checked;
    124           if (groupingActive)
     124          if (isGroupingActive && useGradientCheckBox.Checked)
    125125            row.VisualProperties.Color = GetColor(double.Parse(row.Name), min, max);
    126126        }
     
    133133        scatterPlotControl.Content = scatterPlot;
    134134
    135         if (groupingActive) {
     135        if (isGroupingActive) {
    136136          gradientMinimumLabel.Text = min.ToString("G5");
    137137          gradientMaximumLabel.Text = max.ToString("G5");
     
    228228        var groupValues = Content.PreprocessingData.GetValues<double>(Content.PreprocessingData.GetColumnIndex(groupVariable))
    229229          .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));
    231231        foreach (var group in groupValues) {
    232232          ScatterPlotDataRow row;
     
    249249    private static Color GetColor(double value, double min, double max) {
    250250      if (double.IsNaN(value)) {
    251         return Color.DarkGray;
     251        return Color.Black;
    252252      }
    253253      var colors = ColorGradient.Colors;
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/ScatterPlotContent.cs

    r14521 r14525  
    7373        var groupValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameGroup));
    7474        var data = points.Zip(groupValues, (p, g) => new { p, g })
    75           .Where(x => !double.IsNaN(x.p.X) && !double.IsNaN(x.p.Y) && !double.IsNaN(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))
    7676          .ToList();
    7777
    7878        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);
    8080          var row = new ScatterPlotDataRow(string.Format("{0} ({1})", variableNameGroup, groupValue), "", values) {
    8181            Name = groupValue.ToString("R"),
Note: See TracChangeset for help on using the changeset viewer.