Changeset 11139
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 11007,11024,11095
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
r9929 r11139 122 122 Invoke(new EventHandler(Content_Reset), sender, e); 123 123 else { 124 this.categoricalMapping.Clear();125 124 UpdateDataPoints(); 126 125 UpdateAxisLabels(); … … 189 188 190 189 private void UpdateDataPoints() { 190 this.categoricalMapping.Clear(); 191 191 this.chart.Series.Clear(); 192 192 this.seriesCache.Clear(); … … 216 216 if (datapoint != null) { 217 217 IRun run = (IRun)datapoint.Tag; 218 string selectedAxis = (string)xAxisComboBox.SelectedItem;218 string selectedAxis = xAxisValue; 219 219 IItem value = null; 220 220 … … 325 325 } 326 326 } 327 private double GetCategoricalValue(int dimension, string value) {327 private double? GetCategoricalValue(int dimension, string value) { 328 328 if (!this.categoricalMapping.ContainsKey(dimension)) { 329 329 this.categoricalMapping[dimension] = new Dictionary<object, double>(); … … 336 336 } 337 337 } 338 if (!this.categoricalMapping[dimension].ContainsKey(value)) return null; 338 339 return this.categoricalMapping[dimension][value]; 339 340 } 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; 342 343 switch (axisDimension) { 343 344 case AxisDimension.Color: { … … 373 374 Axis yAxis = this.chart.ChartAreas[BoxPlotChartAreaName].AxisY; 374 375 int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count(); 375 SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount); 376 SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount); 377 if (xAxisComboBox.SelectedItem != null) 378 xAxis.Title = xAxisComboBox.SelectedItem.ToString(); 379 if (yAxisComboBox.SelectedItem != null) 380 yAxis.Title = yAxisComboBox.SelectedItem.ToString(); 376 //mkommend: combobox.SelectedIndex could not be used as this changes during hoovering over possible values 377 var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue); 378 var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue); 379 SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount); 380 SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount); 381 if (xAxisValue != null) 382 xAxis.Title = xAxisValue; 383 if (yAxisValue != null) 384 yAxis.Title = yAxisValue; 381 385 } 382 386 -
stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r9929 r11139 56 56 private bool suppressUpdates = false; 57 57 58 private RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true };58 private readonly RunCollectionContentConstraint visibilityConstraint = new RunCollectionContentConstraint() { Active = true }; 59 59 60 60 public RunCollectionBubbleChartView() { … … 153 153 if (suppressUpdates) return; 154 154 155 foreach (var run in Content) UpdateRun(run); 156 UpdateMarkerSizes(); 157 UpdateCursorInterval(); 158 chart.ChartAreas[0].RecalculateAxesScale(); 155 UpdateDataPoints(); 159 156 UpdateAxisLabels(); 160 157 } … … 190 187 protected override void OnContentChanged() { 191 188 base.OnContentChanged(); 192 this.categoricalMapping.Clear();193 189 UpdateComboBoxes(); 194 190 UpdateDataPoints(); 195 191 UpdateCaption(); 196 RebuildInverseIndex();197 192 } 198 193 … … 267 262 Invoke(new EventHandler(Content_Reset), sender, e); 268 263 else { 269 this.categoricalMapping.Clear();270 RebuildInverseIndex();271 264 UpdateDataPoints(); 272 265 UpdateAxisLabels(); … … 278 271 series.Points.Clear(); 279 272 runToDataPointMapping.Clear(); 273 categoricalMapping.Clear(); 280 274 selectedRuns.Clear(); 275 RebuildInverseIndex(); 281 276 282 277 chart.ChartAreas[0].AxisX.IsMarginVisible = xAxisValue != AxisDimension.Index.ToString(); … … 438 433 } 439 434 } 440 private double GetCategoricalValue(int dimension, string value) {435 private double? GetCategoricalValue(int dimension, string value) { 441 436 if (!this.categoricalMapping.ContainsKey(dimension)) { 442 437 this.categoricalMapping[dimension] = new Dictionary<object, double>(); … … 449 444 } 450 445 } 446 if (!this.categoricalMapping[dimension].ContainsKey(value)) return null; 451 447 return this.categoricalMapping[dimension][value]; 452 448 } … … 667 663 Axis yAxis = this.chart.ChartAreas[0].AxisY; 668 664 int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count(); 669 SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount); 670 SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount); 671 if (xAxisComboBox.SelectedItem != null) 672 xAxis.Title = xAxisComboBox.SelectedItem.ToString(); 673 if (yAxisComboBox.SelectedItem != null) 674 yAxis.Title = yAxisComboBox.SelectedItem.ToString(); 665 //mkommend: combobox.SelectedIndex could not be used as this changes during hovering over possible values 666 var xSAxisSelectedIndex = xAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(xAxisValue); 667 var ySAxisSelectedIndex = yAxisValue == null ? 0 : xAxisComboBox.Items.IndexOf(yAxisValue); 668 SetCustomAxisLabels(xAxis, xSAxisSelectedIndex - axisDimensionCount); 669 SetCustomAxisLabels(yAxis, ySAxisSelectedIndex - axisDimensionCount); 670 if (xAxisValue != null) 671 xAxis.Title = xAxisValue; 672 if(yAxisValue != null) 673 yAxis.Title = yAxisValue; 675 674 } 676 675 … … 723 722 } 724 723 private void hideRunsToolStripMenuItem_Click(object sender, EventArgs e) { 725 HideRuns(selectedRuns); 724 //ToList is necessary to prevent lazy evaluation 725 HideRuns(selectedRuns.ToList()); 726 726 //could not use ClearSelectedRuns as the runs are not visible anymore 727 727 selectedRuns.Clear(); 728 728 } 729 729 private void hideRunsButton_Click(object sender, EventArgs e) { 730 HideRuns(selectedRuns); 730 //ToList is necessary to prevent lazy evaluation 731 HideRuns(selectedRuns.ToList()); 731 732 //could not use ClearSelectedRuns as the runs are not visible anymore 732 733 selectedRuns.Clear();
Note: See TracChangeset
for help on using the changeset viewer.