Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/20/16 15:28:14 (8 years ago)
Author:
pfleck
Message:

#2709

  • Added Check Inputs/All/None buttons instead of showing disabled buttons of the ItemCollectionView.
  • Removed the PreprocessingCheckedItemListView. A standard ListView is used instead.
  • Fixed slow updating when simultaneously (un-)checking multiple variables in the chart views. (currently only works by using the new buttons)
Location:
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingChartContent.cs

    r14467 r14511  
    3636    private ICheckedItemList<StringValue> variableItemList = null;
    3737    public ICheckedItemList<StringValue> VariableItemList {
    38       get { return this.variableItemList; }
    39       set { this.variableItemList = value; }
     38      get {
     39        if (variableItemList == null)
     40          variableItemList = CreateVariableItemList();
     41        return this.variableItemList;
     42      }
     43      //set { this.variableItemList = value; }
    4044    }
    4145
     
    6569
    6670
    67     public ICheckedItemList<StringValue> CreateVariableItemList(IList<string> checkedItems = null) {
    68       if (checkedItems == null) checkedItems = new string[0];
     71    public ICheckedItemList<StringValue> CreateVariableItemList() {
    6972      ICheckedItemList<StringValue> itemList = new CheckedItemList<StringValue>();
    7073      foreach (string name in PreprocessingData.GetDoubleVariableNames()) {
    7174        var n = new StringValue(name);
    72         itemList.Add(n, checkedItems.Contains(name));
     75        bool isInputTarget = PreprocessingData.InputVariables.Contains(name) || PreprocessingData.TargetVariable == name;
     76        itemList.Add(n, isInputTarget);
    7377      }
    7478      return new ReadOnlyCheckedItemList<StringValue>(itemList);
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/ScatterPlotContent.cs

    r14495 r14511  
    4242      ScatterPlot scatterPlot = new ScatterPlot();
    4343
    44       IList<double> xValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameX)).Where(x => !double.IsNaN(x) && !double.IsInfinity(x)).ToList();
    45       IList<double> yValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameY)).Where(x => !double.IsNaN(x) && !double.IsInfinity(x)).ToList();
     44      IList<double> xValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameX));
     45      IList<double> yValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameY));
    4646
    47       if (xValues.Any()) {
     47      var points = xValues.Zip(yValues, (x, y) => new Point2D<double>(x, y)).ToList();
     48      var validPoints = points.Where(p => !double.IsNaN(p.X) && !double.IsNaN(p.Y) && !double.IsInfinity(p.X) && !double.IsInfinity(p.Y)).ToList();
     49      if (validPoints.Any()) {
    4850        try {
    4951          double axisMin, axisMax, axisInterval;
    50           ChartUtil.CalculateOptimalAxisInterval(xValues.Min(), xValues.Max(), out axisMin, out axisMax, out axisInterval);
     52          ChartUtil.CalculateOptimalAxisInterval(validPoints.Min(p => p.X), validPoints.Max(p => p.X), out axisMin, out axisMax, out axisInterval);
    5153          scatterPlot.VisualProperties.XAxisMinimumAuto = false;
    5254          scatterPlot.VisualProperties.XAxisMaximumAuto = false;
     
    5456          scatterPlot.VisualProperties.XAxisMaximumFixedValue = axisMax;
    5557        } catch (ArgumentOutOfRangeException) { } // error during CalculateOptimalAxisInterval
    56       }
    57       if (yValues.Any()) {
    5858        try {
    5959          double axisMin, axisMax, axisInterval;
    60           ChartUtil.CalculateOptimalAxisInterval(yValues.Min(), yValues.Max(), out axisMin, out axisMax, out axisInterval);
     60          ChartUtil.CalculateOptimalAxisInterval(validPoints.Min(p => p.Y), validPoints.Max(p => p.Y), out axisMin, out axisMax, out axisInterval);
    6161          scatterPlot.VisualProperties.YAxisMinimumAuto = false;
    6262          scatterPlot.VisualProperties.YAxisMaximumAuto = false;
     
    6767
    6868      if (variableNameGroup == null || variableNameGroup == "-") {
    69         List<Point2D<double>> points = new List<Point2D<double>>();
    70 
    71         for (int i = 0; i < xValues.Count; i++) {
    72           Point2D<double> point = new Point2D<double>(xValues[i], yValues[i]);
    73           points.Add(point);
    74         }
    75 
    76         ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY, "", points);
     69        ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY, "", validPoints);
    7770        scdr.VisualProperties.IsVisibleInLegend = false;
    7871        scatterPlot.Rows.Add(scdr);
    79 
    8072      } else {
    8173        var groupValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameGroup));
    82         var data = xValues.Zip(yValues, (x, y) => new { x, y }).Zip(groupValues, (v, c) => new { v.x, v.y, c }).ToList();
     74        var data = points.Zip(groupValues, (p, g) => new { p, g });
    8375        foreach (var groupValue in groupValues.Distinct()) {
    84           var values = data.Where(x => x.c == groupValue);
    85           var row = new ScatterPlotDataRow(
    86             variableNameGroup + " (" + groupValue + ")",
    87             "",
    88             values.Select(v => new Point2D<double>(v.x, v.y))) {
     76          var values = data.Where(x => x.g == groupValue).Select(v => v.p);
     77          var row = new ScatterPlotDataRow(string.Format("{0} ({1})", variableNameGroup, groupValue), "", values) {
    8978            VisualProperties = { PointSize = 6 }
    9079          };
Note: See TracChangeset for help on using the changeset viewer.