Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/08/19 15:29:57 (5 years ago)
Author:
pfleck
Message:

#2972 merged to trunk

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/HeuristicLab.Problems.DataAnalysis.Views

  • trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/FactorPartialDependencePlot.cs

    r15845 r16519  
    167167      // add an event such that whenever a value is changed in the shared dataset,
    168168      // this change is reflected in the internal dataset (where the value becomes a whole column)
    169       if (this.sharedFixedVariables != null)
     169      if (this.sharedFixedVariables != null) {
    170170        this.sharedFixedVariables.ItemChanged -= sharedFixedVariables_ItemChanged;
     171        this.sharedFixedVariables.Reset -= sharedFixedVariables_Reset;
     172      }
     173
    171174      this.sharedFixedVariables = sharedFixedVariables;
    172175      this.sharedFixedVariables.ItemChanged += sharedFixedVariables_ItemChanged;
     176      this.sharedFixedVariables.Reset += sharedFixedVariables_Reset;
    173177
    174178      RecalculateInternalDataset();
     
    218222        if (updateOnFinish)
    219223          Update();
    220       }
    221       catch (OperationCanceledException) { }
    222       catch (AggregateException ae) {
     224      } catch (OperationCanceledException) {
     225      } catch (AggregateException ae) {
    223226        if (!ae.InnerExceptions.Any(e => e is OperationCanceledException))
    224227          throw;
     
    495498    }
    496499
     500    private void sharedFixedVariables_Reset(object sender, EventArgs e) {
     501      var newValue = sharedFixedVariables.GetStringValue(FreeVariable, 0);
     502      UpdateSelectedValue(newValue);
     503
     504      int idx = variableValues.IndexOf(newValue);
     505      UpdateAllSeriesStyles(idx);
     506    }
     507
    497508    private async void chart_DragDrop(object sender, DragEventArgs e) {
    498509      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
  • trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/PartialDependencePlot.cs

    r15845 r16519  
    245245      // add an event such that whenever a value is changed in the shared dataset,
    246246      // this change is reflected in the internal dataset (where the value becomes a whole column)
    247       if (this.sharedFixedVariables != null)
     247      if (this.sharedFixedVariables != null) {
    248248        this.sharedFixedVariables.ItemChanged -= sharedFixedVariables_ItemChanged;
     249        this.sharedFixedVariables.Reset -= sharedFixedVariables_Reset;
     250      }
     251
    249252      this.sharedFixedVariables = sharedFixedVariables;
    250253      this.sharedFixedVariables.ItemChanged += sharedFixedVariables_ItemChanged;
     254      this.sharedFixedVariables.Reset += sharedFixedVariables_Reset;
    251255
    252256      RecalculateTrainingLimits(initializeAxisRanges);
     
    314318        if (updateOnFinish)
    315319          Update();
    316       }
    317       catch (OperationCanceledException) { }
    318       catch (AggregateException ae) {
     320      } catch (OperationCanceledException) {
     321      } catch (AggregateException ae) {
    319322        if (!ae.InnerExceptions.Any(e => e is OperationCanceledException))
    320323          throw;
     
    626629      var variableName = variables[columnIndex];
    627630      if (variableName == FreeVariable) return;
     631
    628632      if (internalDataset.VariableHasType<double>(variableName)) {
    629633        var v = sharedFixedVariables.GetDoubleValue(variableName, rowIndex);
     
    640644    }
    641645
     646    private void sharedFixedVariables_Reset(object sender, EventArgs e) {
     647      var newValue = sharedFixedVariables.GetDoubleValue(FreeVariable, 0);
     648      VerticalLineAnnotation.X = newValue;
     649      UpdateCursor(); // triggers update of InternalDataset
     650    }
     651
    642652    private void chart_AnnotationPositionChanging(object sender, AnnotationPositionChangingEventArgs e) {
    643653      var step = (trainingMax - trainingMin) / drawingSteps;
     
    658668    private void UpdateCursor() {
    659669      var x = VerticalLineAnnotation.X;
    660       sharedFixedVariables.SetVariableValue(x, FreeVariable, 0);
     670
     671      if (!sharedFixedVariables.GetDoubleValue(FreeVariable, 0).IsAlmost(x))
     672        sharedFixedVariables.SetVariableValue(x, FreeVariable, 0);
    661673
    662674      if (ShowCursor) {
Note: See TracChangeset for help on using the changeset viewer.