- Timestamp:
- 06/27/17 10:06:34 (7 years ago)
- Location:
- trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataRowVisualProperties.cs
r14582 r15068 52 52 } 53 53 #endregion 54 #region Histogram Aggregation55 public enum DataRowHistogramAggregation {56 Overlapping,57 SideBySide,58 Stacked59 }60 #endregion61 54 62 55 private DataRowChartType chartType; … … 130 123 } 131 124 } 132 private int bins; 133 public int Bins { 134 get { return bins; } 135 set { 136 if (bins != value) { 137 bins = value; 138 OnPropertyChanged("Bins"); 139 } 140 } 141 } 142 private bool exactBins; 143 public bool ExactBins { 144 get { return exactBins; } 145 set { 146 if (exactBins != value) { 147 exactBins = value; 148 OnPropertyChanged("ExactBins"); 149 } 150 } 151 } 152 private DataRowHistogramAggregation aggregation; 153 public DataRowHistogramAggregation Aggregation { 154 get { return aggregation; } 155 set { 156 if (aggregation != value) { 157 aggregation = value; 158 OnPropertyChanged("Aggregation"); 159 } 160 } 161 } 125 162 126 private double scaleFactor; 163 127 public double ScaleFactor { … … 232 196 set { lineWidth = value; } 233 197 } 234 [Storable(Name = "Bins")]235 private int StorableBins {236 get { return bins; }237 set { bins = value; }238 }239 [Storable(Name = "ExactBins")]240 private bool StorableExactBins {241 get { return exactBins; }242 set { exactBins = value; }243 }244 [Storable(Name = "Aggregation", DefaultValue = DataRowHistogramAggregation.Overlapping)]245 private DataRowHistogramAggregation StorableAggregation {246 get { return aggregation; }247 set { aggregation = value; }248 }249 198 [Storable(Name = "ScaleFactor")] 250 199 private double StorableScaleFactor { … … 262 211 set { displayName = value; } 263 212 } 213 #endregion 214 215 #region Histogram Properties - Backwards Compatability 216 internal enum DataRowHistogramAggregation { 217 Overlapping, 218 SideBySide, 219 Stacked 220 } 221 222 internal int? Bins { get; private set; } 223 internal bool? ExactBins { get; private set; } 224 internal DataRowHistogramAggregation? Aggregation { get; private set; } 225 226 [Storable(Name = "Bins", AllowOneWay = true)] 227 private int StorableBins { set { Bins = value; } } 228 [Storable(Name = "ExactBins", AllowOneWay = true)] 229 private bool StorableExactBins { set { ExactBins = value; } } 230 [Storable(Name = "Aggregation", AllowOneWay = true)] 231 private DataRowHistogramAggregation StorableAggregation { set { Aggregation = value; } } 264 232 #endregion 265 233 … … 275 243 this.startIndexZero = original.startIndexZero; 276 244 this.lineWidth = original.lineWidth; 277 this.bins = original.bins;278 this.exactBins = original.exactBins;279 this.aggregation = original.aggregation;280 245 this.scaleFactor = original.scaleFactor; 281 246 this.displayName = original.displayName; … … 290 255 startIndexZero = false; 291 256 lineWidth = 1; 292 bins = 10;293 exactBins = false;294 aggregation = DataRowHistogramAggregation.Overlapping;295 257 scaleFactor = 1.0; 296 258 displayName = String.Empty; … … 318 280 if (secondXAxis == default(bool) 319 281 && lineStyle == default(DataRowLineStyle) 320 && lineWidth == default(int) && bins == default(int) && exactBins == default(bool)321 282 && displayName == default(string)) { 322 283 secondXAxis = false; 323 284 lineStyle = DataRowLineStyle.Solid; 324 285 lineWidth = 1; 325 bins = 10;326 exactBins = false;327 286 displayName = String.Empty; 328 287 } -
trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataTable.cs
r14185 r15068 112 112 if (VisualProperties == null) VisualProperties = new DataTableVisualProperties(name); 113 113 if (VisualProperties.Title == null) VisualProperties.Title = name; 114 115 #region Backwards Compatability Histogram Visual Properties 116 var rowProperties = Rows.Select(r => r.VisualProperties).ToList(); 117 if (rowProperties.Any(r => r.Bins.HasValue)) 118 VisualProperties.HistogramBins = rowProperties.Where(r => r.Bins.HasValue).Max(r => r.Bins.Value); 119 if (rowProperties.Any(r => r.ExactBins.HasValue)) 120 VisualProperties.HistogramExactBins = rowProperties.Where(r => r.ExactBins.HasValue).Any(r => r.ExactBins.Value); 121 if (rowProperties.Any(r => r.Aggregation.HasValue)) { 122 var maxOccurrence = rowProperties 123 .Where(r => r.Aggregation.HasValue).Select(r => r.Aggregation.Value) 124 .GroupBy(x => x).OrderByDescending(x => x.Count()) 125 .First().Key; 126 VisualProperties.HistogramAggregation = (DataTableVisualProperties.DataTableHistogramAggregation)maxOccurrence; 127 } 128 #endregion 114 129 } 115 130 #endregion -
trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataTableVisualProperties.cs
r14185 r15068 20 20 #endregion 21 21 22 using System; 23 using System.ComponentModel; 24 using System.Drawing; 22 25 using HeuristicLab.Common; 23 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using System.ComponentModel;25 using System.Drawing;26 27 27 28 namespace HeuristicLab.Analysis { … … 31 32 [StorableClass] 32 33 public class DataTableVisualProperties : DeepCloneable, INotifyPropertyChanged { 34 35 #region Histogram Aggregation 36 public enum DataTableHistogramAggregation { 37 Overlapping, 38 SideBySide, 39 Stacked 40 } 41 #endregion 42 33 43 private Font titleFont; 34 44 public Font TitleFont { … … 352 362 secondYAxisLogScale = value; 353 363 OnPropertyChanged("SecondYAxisLogScale"); 364 } 365 } 366 367 private int histogramBins; 368 public int HistogramBins { 369 get { return histogramBins; } 370 set { 371 if (histogramBins != value) { 372 histogramBins = value; 373 OnPropertyChanged("HistogramBins"); 374 } 375 } 376 } 377 378 private bool histogramExactBins; 379 public bool HistogramExactBins { 380 get { return histogramExactBins; } 381 set { 382 if (histogramExactBins != value) { 383 histogramExactBins = value; 384 OnPropertyChanged("HistogramExactBins"); 385 } 386 } 387 } 388 389 private DataTableHistogramAggregation histogramAggregation; 390 public DataTableHistogramAggregation HistogramAggregation { 391 get { return histogramAggregation; } 392 set { 393 if (histogramAggregation != value) { 394 histogramAggregation = value; 395 OnPropertyChanged("HistogramAggregation"); 396 } 354 397 } 355 398 } … … 500 543 get { return secondYAxisLogScale; } 501 544 set { secondYAxisLogScale = value; } 545 } 546 [Storable(Name = "HistogramBins", DefaultValue = 10)] 547 private int StorableHistogramBins { 548 get { return histogramBins; } 549 set { histogramBins = value; } 550 } 551 [Storable(Name = "HistogramExactBins", DefaultValue = false)] 552 private bool StorableHistogramExactBins { 553 get { return histogramExactBins; } 554 set { histogramExactBins = value; } 555 } 556 [Storable(Name = "HistogramAggregation", DefaultValue = DataTableHistogramAggregation.Overlapping)] 557 private DataTableHistogramAggregation StorableHistogramAggregation { 558 get { return histogramAggregation; } 559 set { histogramAggregation = value; } 502 560 } 503 561 #endregion … … 536 594 this.yAxisLogScale = original.yAxisLogScale; 537 595 this.secondYAxisLogScale = original.secondYAxisLogScale; 596 this.histogramBins = original.histogramBins; 597 this.histogramExactBins = original.histogramExactBins; 598 this.histogramAggregation = original.histogramAggregation; 538 599 } 539 600 public DataTableVisualProperties() { … … 565 626 this.yAxisLogScale = false; 566 627 this.secondYAxisLogScale = false; 628 histogramBins = 10; 629 histogramExactBins = false; 630 histogramAggregation = DataTableHistogramAggregation.Overlapping; 567 631 } 568 632 public DataTableVisualProperties(string title)
Note: See TracChangeset
for help on using the changeset viewer.