Changeset 1424
- Timestamp:
- 03/25/09 19:00:02 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Charting/BubbleChart.cs
r1287 r1424 118 118 double maxSize = 1; 119 119 double minSize = 1; 120 try { 121 if (sizeDimension != null && results.OrdinalVariables.Contains(sizeDimension)) { 122 var sizes = records 123 .Select(x => Convert.ToDouble(x.Get(sizeDimension))) 124 .Where(size => !double.IsInfinity(size) && size != double.MaxValue && size != double.MinValue) 125 .OrderBy(r => r); 126 minSize = sizes.ElementAt((int)(sizes.Count() * 0.1)); 127 maxSize = sizes.ElementAt((int)(sizes.Count() * 0.9)); 128 } 129 } 130 catch (InvalidCastException) { 120 if (sizeDimension != null && results.OrdinalVariables.Contains(sizeDimension)) { 121 var sizes = records 122 .Select(x => Convert.ToDouble(x.Get(sizeDimension))) 123 .Where(size => !double.IsInfinity(size) && size != double.MaxValue && size != double.MinValue) 124 .OrderBy(r => r); 125 minSize = sizes.ElementAt((int)(sizes.Count() * 0.1)); 126 maxSize = sizes.ElementAt((int)(sizes.Count() * 0.9)); 127 } else { 131 128 minSize = 1; 132 129 maxSize = 1; … … 142 139 double x, y; 143 140 int size; 144 try{141 if (results.OrdinalVariables.Contains(xDimension)) { 145 142 x = Convert.ToDouble(r.Get(xDimension)) + (double)r.Get(X_JITTER) * xJitterFactor; 143 } else if (results.CategoricalVariables.Contains(xDimension)) { 144 x = results.IndexOfCategoricalValue(xDimension, r.Get(xDimension)) + (double)r.Get(X_JITTER) * xJitterFactor; 145 } else { 146 x = double.NaN; 147 } 148 if (results.OrdinalVariables.Contains(yDimension)) { 146 149 y = Convert.ToDouble(r.Get(yDimension)) + (double)r.Get(Y_JITTER) * yJitterFactor; 147 size = CalculateSize(Convert.ToDouble(r.Get(sizeDimension)), minSize, maxSize); 148 } 149 catch (InvalidCastException) { 150 x = double.NaN; 150 } else if (results.CategoricalVariables.Contains(yDimension)) { 151 y = results.IndexOfCategoricalValue(yDimension, r.Get(yDimension)) + (double)r.Get(Y_JITTER) * yJitterFactor; 152 } else { 151 153 y = double.NaN; 152 size = minBubbleSize; 153 } 154 } 155 size = CalculateSize(Convert.ToDouble(r.Get(sizeDimension)), minSize, maxSize); 156 154 157 if (double.IsInfinity(x) || x == double.MaxValue || x == double.MinValue) x = double.NaN; 155 158 if (double.IsInfinity(y) || y == double.MaxValue || y == double.MinValue) y = double.NaN; … … 221 224 } 222 225 223 224 226 public override void MouseDrag(Point start, Point end, MouseButtons button) { 225 227 if (button == MouseButtons.Left && Mode == ChartMode.Select) { … … 251 253 if (button == MouseButtons.Left) { 252 254 ResultsEntry r = GetResultsEntry(point); 253 if (r != null) r.ToggleSelected(); 254 results.FireChanged(); 255 if (r != null) { 256 r.ToggleSelected(); 257 results.FireChanged(); 258 } 255 259 } else { 256 260 base.MouseClick(point, button); -
trunk/sources/HeuristicLab.CEDMA.Core/Results.cs
r1417 r1424 137 137 .ToArray(); 138 138 } 139 140 public double IndexOfCategoricalValue(string variable, object value) { 141 return 1.0; // TODO 142 } 139 143 } 140 144 } -
trunk/sources/HeuristicLab.CEDMA.Core/ResultsEntry.cs
r1417 r1424 37 37 38 38 private bool selected = false; 39 public bool Selected { 39 public bool Selected { 40 40 get { return selected; } 41 set { selected = value; } 41 set { selected = value; } 42 42 } 43 43 44 44 private string uri; 45 public string Uri { 45 public string Uri { 46 46 get { return uri; } 47 47 set { uri = value; } … … 64 64 StringBuilder b = new StringBuilder(); 65 65 foreach (KeyValuePair<string, object> v in values) { 66 b.Append(v.Key).Append(" = ").Append(v.Value).AppendLine(); 66 string val = v.Value.ToString(); 67 if (val.Length > 40) val = val.Substring(0, 38) + "..."; 68 b.Append(v.Key).Append(" = ").Append(val).AppendLine(); 67 69 } 68 70 return b.ToString(); 69 71 } 70 71 //internal void OpenModel() {72 // resultList.OpenModel(this);73 //}74 75 //internal void OpenGeneratingAlgorithm() {76 // resultList.OpenAlgorithm(this);77 //}78 72 } 79 73 }
Note: See TracChangeset
for help on using the changeset viewer.