- Timestamp:
- 03/23/16 22:51:27 (9 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/HeuristicLab.Analysis.Views-3.3.csproj
r12764 r13722 105 105 </PropertyGroup> 106 106 <ItemGroup> 107 <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 108 <SpecificVersion>False</SpecificVersion> 109 <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath> 110 <Private>False</Private> 111 </Reference> 107 112 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 108 113 <SpecificVersion>False</SpecificVersion> … … 309 314 <EmbeddedResource Include="HeatMapView.resx"> 310 315 <DependentUpon>HeatMapView.cs</DependentUpon> 316 </EmbeddedResource> 317 <EmbeddedResource Include="ScatterPlotDataRowVisualPropertiesControl.resx"> 318 <DependentUpon>ScatterPlotDataRowVisualPropertiesControl.cs</DependentUpon> 311 319 </EmbeddedResource> 312 320 </ItemGroup> -
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/Plugin.cs.frame
r13475 r13722 28 28 [Plugin("HeuristicLab.Analysis.Views", "3.3.13.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Analysis.Views-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")] 30 31 [PluginDependency("HeuristicLab.Analysis", "3.3")] 31 32 [PluginDependency("HeuristicLab.Collections", "3.3")] -
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotDataRowVisualPropertiesControl.Designer.cs
r12012 r13722 56 56 this.label9 = new System.Windows.Forms.Label(); 57 57 this.label7 = new System.Windows.Forms.Label(); 58 this.label4 = new System.Windows.Forms.Label(); 59 this.regressionLineCheckBox = new System.Windows.Forms.CheckBox(); 58 60 ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).BeginInit(); 59 61 this.SuspendLayout(); … … 171 173 this.label7.Text = "&Visible in Legend:"; 172 174 // 175 // label4 176 // 177 this.label4.AutoSize = true; 178 this.label4.Location = new System.Drawing.Point(3, 136); 179 this.label4.Name = "label4"; 180 this.label4.Size = new System.Drawing.Size(86, 13); 181 this.label4.TabIndex = 2; 182 this.label4.Text = "&Regression Line:"; 183 // 184 // regressionLineCheckBox 185 // 186 this.regressionLineCheckBox.AutoSize = true; 187 this.regressionLineCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 188 this.regressionLineCheckBox.Location = new System.Drawing.Point(99, 136); 189 this.regressionLineCheckBox.Name = "regressionLineCheckBox"; 190 this.regressionLineCheckBox.Size = new System.Drawing.Size(15, 14); 191 this.regressionLineCheckBox.TabIndex = 3; 192 this.regressionLineCheckBox.UseVisualStyleBackColor = true; 193 this.regressionLineCheckBox.CheckedChanged += new System.EventHandler(this.regressionLineCheckBox_CheckedChanged); 194 // 173 195 // ScatterPlotDataRowVisualPropertiesControl 174 196 // 175 197 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 176 198 this.Controls.Add(this.pointSizeNumericUpDown); 199 this.Controls.Add(this.regressionLineCheckBox); 177 200 this.Controls.Add(this.isVisibleInLegendCheckBox); 178 201 this.Controls.Add(this.label9); 179 202 this.Controls.Add(this.label3); 203 this.Controls.Add(this.label4); 180 204 this.Controls.Add(this.pointStyleComboBox); 181 205 this.Controls.Add(this.label7); … … 185 209 this.Controls.Add(this.colorButton); 186 210 this.Name = "ScatterPlotDataRowVisualPropertiesControl"; 187 this.Size = new System.Drawing.Size(342, 1 35);211 this.Size = new System.Drawing.Size(342, 157); 188 212 ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).EndInit(); 189 213 this.ResumeLayout(false); … … 205 229 private System.Windows.Forms.Label label9; 206 230 private System.Windows.Forms.Label label3; 231 private System.Windows.Forms.Label label4; 232 private System.Windows.Forms.CheckBox regressionLineCheckBox; 207 233 } 208 234 } -
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotDataRowVisualPropertiesControl.cs
r12012 r13722 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using HeuristicLab.MainForm; 22 23 using System; 23 24 using System.Drawing; 24 25 using System.Windows.Forms; 25 using HeuristicLab.MainForm;26 using HeuristicLab.MainForm.WindowsForms;27 26 28 27 namespace HeuristicLab.Analysis.Views { … … 57 56 pointSizeNumericUpDown.Value = 1; 58 57 displayNameTextBox.Text = String.Empty; 58 regressionLineCheckBox.Checked = false; 59 59 } else { 60 60 displayNameTextBox.Text = Content.DisplayName; … … 69 69 pointSizeNumericUpDown.Value = Content.PointSize; 70 70 isVisibleInLegendCheckBox.Checked = Content.IsVisibleInLegend; 71 regressionLineCheckBox.Checked = Content.ShowRegressionLine; 71 72 } 72 73 } … … 82 83 pointSizeNumericUpDown.Enabled = Content != null; 83 84 displayNameTextBox.Enabled = Content != null; 85 regressionLineCheckBox.Enabled = Content != null; 84 86 } 85 87 … … 121 123 } 122 124 } 125 126 private void regressionLineCheckBox_CheckedChanged(object sender, EventArgs e) { 127 if (!SuppressEvents && Content != null) { 128 Content.ShowRegressionLine = regressionLineCheckBox.Checked; 129 } 130 } 123 131 #endregion 124 132 } -
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.cs
r12679 r13722 20 20 #endregion 21 21 22 using HeuristicLab.Collections; 23 using HeuristicLab.Common; 24 using HeuristicLab.Core.Views; 25 using HeuristicLab.MainForm; 22 26 using System; 23 27 using System.Collections.Generic; … … 26 30 using System.Windows.Forms; 27 31 using System.Windows.Forms.DataVisualization.Charting; 28 using HeuristicLab.Collections;29 using HeuristicLab.Common;30 using HeuristicLab.Core.Views;31 using HeuristicLab.MainForm;32 32 33 33 namespace HeuristicLab.Analysis.Views { … … 141 141 DeregisterScatterPlotDataRowEvents(row); 142 142 Series series = chart.Series[row.Name]; 143 if (chart.Series.IsUniqueName(series.Name + ".lr")) 144 chart.Series.Remove(chart.Series[series.Name + ".lr"]); 143 145 chart.Series.Remove(series); 144 146 if (invisibleSeries.Contains(series)) … … 460 462 461 463 private void FillSeriesWithRowValues(Series series, ScatterPlotDataRow row) { 464 if (row.VisualProperties.ShowRegressionLine) { 465 var xs = row.Points.Select(p => p.X).ToArray(); 466 var xsMin = xs.Min(); 467 var xsMax = xs.Max(); 468 var ys = row.Points.Select(p => p.Y).ToArray(); 469 var corr = alglib.pearsoncorr2(xs, ys); 470 var slope = corr * ys.StandardDeviation() / xs.StandardDeviation(); 471 if (!double.IsNaN(slope) && !double.IsInfinity(slope)) { 472 var off = ys.Average() - slope * xs.Average(); 473 474 Series lrSeries; 475 if (chart.Series.IsUniqueName(series.Name + ".lr")) { 476 lrSeries = new Series(series.Name + ".lr") {IsVisibleInLegend = false, ChartType = SeriesChartType.FastLine}; 477 chart.Series.Add(lrSeries); 478 } else lrSeries = chart.Series[series.Name + ".lr"]; 479 lrSeries.Points.Clear(); 480 lrSeries.Points.AddXY(xsMin, slope * xsMin + off); 481 lrSeries.Points.AddXY(xsMax, slope * xsMax + off); 482 } 483 } else if (!chart.Series.IsUniqueName(series.Name + ".lr")) 484 chart.Series.Remove(chart.Series[series.Name + ".lr"]); 485 462 486 for (int i = 0; i < row.Points.Count; i++) { 463 487 var value = row.Points[i];
Note: See TracChangeset
for help on using the changeset viewer.