Free cookie consent management tool by TermsFeed Policy Generator

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).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.