Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/12/14 11:32:32 (10 years ago)
Author:
mkommend
Message:

#2121: Fixed a bug in the bubble chart and boxplot view regarding filtered runs.

Location:
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs

    r10767 r11007  
    122122        Invoke(new EventHandler(Content_Reset), sender, e);
    123123      else {
    124         this.categoricalMapping.Clear();
    125124        UpdateDataPoints();
    126125        UpdateAxisLabels();
     
    189188
    190189    private void UpdateDataPoints() {
     190      this.categoricalMapping.Clear();
    191191      this.chart.Series.Clear();
    192192      this.seriesCache.Clear();
     
    325325      }
    326326    }
    327     private double GetCategoricalValue(int dimension, string value) {
     327    private double? GetCategoricalValue(int dimension, string value) {
    328328      if (!this.categoricalMapping.ContainsKey(dimension)) {
    329329        this.categoricalMapping[dimension] = new Dictionary<object, double>();
     
    336336        }
    337337      }
     338      if (!this.categoricalMapping[dimension].ContainsKey(value)) return null;
    338339      return this.categoricalMapping[dimension][value];
    339340    }
    340     private double GetValue(IRun run, AxisDimension axisDimension) {
    341       double value = double.NaN;
     341    private double? GetValue(IRun run, AxisDimension axisDimension) {
     342      double? value = double.NaN;
    342343      switch (axisDimension) {
    343344        case AxisDimension.Color: {
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs

    r9910 r11007  
    5656    private bool suppressUpdates = false;
    5757
    58     private RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };
     58    private readonly RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };
    5959
    6060    public RunCollectionBubbleChartView() {
     
    153153        if (suppressUpdates) return;
    154154
    155         foreach (var run in Content) UpdateRun(run);
    156         UpdateMarkerSizes();
    157         UpdateCursorInterval();
    158         chart.ChartAreas[0].RecalculateAxesScale();
     155        UpdateDataPoints();
    159156        UpdateAxisLabels();
    160157      }
     
    190187    protected override void OnContentChanged() {
    191188      base.OnContentChanged();
    192       this.categoricalMapping.Clear();
    193189      UpdateComboBoxes();
    194190      UpdateDataPoints();
    195191      UpdateCaption();
    196       RebuildInverseIndex();
    197192    }
    198193
     
    267262        Invoke(new EventHandler(Content_Reset), sender, e);
    268263      else {
    269         this.categoricalMapping.Clear();
    270         RebuildInverseIndex();
    271264        UpdateDataPoints();
    272265        UpdateAxisLabels();
     
    278271      series.Points.Clear();
    279272      runToDataPointMapping.Clear();
     273      categoricalMapping.Clear();
    280274      selectedRuns.Clear();
     275      RebuildInverseIndex();
    281276
    282277      chart.ChartAreas[0].AxisX.IsMarginVisible = xAxisValue != AxisDimension.Index.ToString();
     
    438433      }
    439434    }
    440     private double GetCategoricalValue(int dimension, string value) {
     435    private double? GetCategoricalValue(int dimension, string value) {
    441436      if (!this.categoricalMapping.ContainsKey(dimension)) {
    442437        this.categoricalMapping[dimension] = new Dictionary<object, double>();
     
    449444        }
    450445      }
     446      if (!this.categoricalMapping[dimension].ContainsKey(value)) return null;
    451447      return this.categoricalMapping[dimension][value];
    452448    }
     
    723719    }
    724720    private void hideRunsToolStripMenuItem_Click(object sender, EventArgs e) {
    725       HideRuns(selectedRuns);
     721      //ToList is necessary to prevent lazy evaluation
     722      HideRuns(selectedRuns.ToList());
    726723      //could not use ClearSelectedRuns as the runs are not visible anymore
    727724      selectedRuns.Clear();
    728725    }
    729726    private void hideRunsButton_Click(object sender, EventArgs e) {
    730       HideRuns(selectedRuns);
     727      //ToList is necessary to prevent lazy evaluation
     728      HideRuns(selectedRuns.ToList());
    731729      //could not use ClearSelectedRuns as the runs are not visible anymore
    732730      selectedRuns.Clear();
Note: See TracChangeset for help on using the changeset viewer.