Changeset 13846 for branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Timestamp:
- 05/12/16 15:11:30 (9 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.Designer.cs
r13824 r13846 91 91 | System.Windows.Forms.AnchorStyles.Left) 92 92 | System.Windows.Forms.AnchorStyles.Right))); 93 this.chart.BorderlineColor = System.Drawing.Color.Transparent;94 93 chartArea1.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False; 95 94 chartArea1.AxisX.IsMarginVisible = false; … … 98 97 chartArea1.AxisY.MajorTickMark.Enabled = false; 99 98 chartArea1.AxisY.Minimum = 0D; 100 chartArea1.BackColor = System.Drawing.Color. Transparent;101 chartArea1.BorderColor = System.Drawing.Color. Transparent;99 chartArea1.BackColor = System.Drawing.Color.White; 100 chartArea1.BorderColor = System.Drawing.Color.White; 102 101 chartArea1.Name = "ChartArea1"; 103 102 chartArea1.Position.Auto = false; -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.cs
r13824 r13846 141 141 LimitsChanged(this, EventArgs.Empty); 142 142 } 143 144 143 #region Hepers 145 144 … … 166 165 167 166 #endregion 168 169 170 167 } 171 168 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.cs
r13845 r13846 526 526 private double oldCurserPosition = double.NaN; 527 527 private void chart_AnnotationPositionChanging(object sender, AnnotationPositionChangingEventArgs e) { 528 if (oldCurserPosition.IsAlmost(e.NewLocationX))529 return;530 oldCurserPosition = e.NewLocationX;531 532 528 var step = (trainingMax - trainingMin) / drawingSteps; 533 e.NewLocationX= step * (long)Math.Round(e.NewLocationX / step);529 double newLocation = step * (long)Math.Round(e.NewLocationX / step); 534 530 var axisX = chart.ChartAreas[0].AxisX; 535 if (e.NewLocationX > axisX.Maximum) 536 e.NewLocationX = axisX.Maximum; 537 if (e.NewLocationX < axisX.Minimum) 538 e.NewLocationX = axisX.Minimum; 531 if (newLocation > axisX.Maximum) 532 newLocation = axisX.Maximum; 533 if (newLocation < axisX.Minimum) 534 newLocation = axisX.Minimum; 535 536 e.NewLocationX = newLocation; 539 537 540 538 var annotation = VerticalLineAnnotation; … … 545 543 chart.Update(); 546 544 547 OnVariableValueChanged(this, EventArgs.Empty); 545 if (!oldCurserPosition.IsAlmost(e.NewLocationX)) 546 OnVariableValueChanged(this, EventArgs.Empty); 547 oldCurserPosition = e.NewLocationX; 548 548 } 549 549 -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs
r13842 r13846 26 26 using HeuristicLab.Collections; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.MainForm.WindowsForms; 28 29 using HeuristicLab.Problems.DataAnalysis; 29 30 using HeuristicLab.Problems.DataAnalysis.Views; … … 76 77 trackbars.Clear(); 77 78 79 tableLayoutPanel.SuspendRepaint(); 80 tableLayoutPanel.SuspendLayout(); 81 78 82 tableLayoutPanel.RowCount = 0; 79 83 tableLayoutPanel.Controls.Clear(); 80 84 81 if (Content == null) return; 85 if (Content == null) { 86 tableLayoutPanel.ResumeLayout(false); 87 tableLayoutPanel.ResumeRepaint(false); 88 return; 89 } 82 90 83 91 variableNames.AddRange(Content.ProblemData.AllowedInputVariables); … … 99 107 } 100 108 109 tableLayoutPanel.ResumeLayout(true); 110 tableLayoutPanel.ResumeRepaint(true); 111 101 112 trackbars.First().Checked = true; 102 113 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionTargetResponseGradientView.Designer.cs
r13817 r13846 27 27 this.panel1 = new System.Windows.Forms.Panel(); 28 28 this.gradientChartTableLayout = new System.Windows.Forms.TableLayoutPanel(); 29 this.yAxisConfigGroupBox = new System.Windows.Forms.GroupBox(); 30 this.limitView = new HeuristicLab.Problems.DataAnalysis.Views.DoubleLimitView(); 31 this.automaticYAxisCheckBox = new System.Windows.Forms.CheckBox(); 29 32 this.panel1.SuspendLayout(); 33 this.yAxisConfigGroupBox.SuspendLayout(); 30 34 this.SuspendLayout(); 31 35 // … … 69 73 this.gradientChartTableLayout.RowCount = 1; 70 74 this.gradientChartTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 693F)); 71 this.gradientChartTableLayout.Size = new System.Drawing.Size(8 48, 693);75 this.gradientChartTableLayout.Size = new System.Drawing.Size(828, 693); 72 76 this.gradientChartTableLayout.TabIndex = 2; 77 // 78 // yAxisConfigGroupBox 79 // 80 this.yAxisConfigGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 81 this.yAxisConfigGroupBox.Controls.Add(this.limitView); 82 this.yAxisConfigGroupBox.Controls.Add(this.automaticYAxisCheckBox); 83 this.yAxisConfigGroupBox.Location = new System.Drawing.Point(4, 342); 84 this.yAxisConfigGroupBox.Name = "yAxisConfigGroupBox"; 85 this.yAxisConfigGroupBox.Size = new System.Drawing.Size(152, 98); 86 this.yAxisConfigGroupBox.TabIndex = 2; 87 this.yAxisConfigGroupBox.TabStop = false; 88 this.yAxisConfigGroupBox.Text = "Y-Axis"; 89 // 90 // limitView 91 // 92 this.limitView.Caption = "DoubleLimit View"; 93 this.limitView.Content = null; 94 this.limitView.Location = new System.Drawing.Point(6, 20); 95 this.limitView.Name = "limitView"; 96 this.limitView.ReadOnly = false; 97 this.limitView.Size = new System.Drawing.Size(140, 47); 98 this.limitView.TabIndex = 1; 99 // 100 // automaticYAxisCheckBox 101 // 102 this.automaticYAxisCheckBox.AutoSize = true; 103 this.automaticYAxisCheckBox.Location = new System.Drawing.Point(6, 72); 104 this.automaticYAxisCheckBox.Name = "automaticYAxisCheckBox"; 105 this.automaticYAxisCheckBox.Size = new System.Drawing.Size(73, 17); 106 this.automaticYAxisCheckBox.TabIndex = 0; 107 this.automaticYAxisCheckBox.Text = "Automatic"; 108 this.automaticYAxisCheckBox.UseVisualStyleBackColor = true; 73 109 // 74 110 // RegressionSolutionTargetResponseGradientView … … 76 112 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 77 113 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 114 this.Controls.Add(this.yAxisConfigGroupBox); 78 115 this.Controls.Add(this.panel1); 79 116 this.Controls.Add(this.variableListView); … … 82 119 this.panel1.ResumeLayout(false); 83 120 this.panel1.PerformLayout(); 121 this.yAxisConfigGroupBox.ResumeLayout(false); 122 this.yAxisConfigGroupBox.PerformLayout(); 84 123 this.ResumeLayout(false); 85 124 … … 91 130 private System.Windows.Forms.Panel panel1; 92 131 private System.Windows.Forms.TableLayoutPanel gradientChartTableLayout; 132 private System.Windows.Forms.GroupBox yAxisConfigGroupBox; 133 private System.Windows.Forms.CheckBox automaticYAxisCheckBox; 134 private DoubleLimitView limitView; 93 135 } 94 136 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionTargetResponseGradientView.cs
r13845 r13846 43 43 InitializeComponent(); 44 44 charts = new Dictionary<string, GradientChart>(); 45 46 limitView.Content = new DoubleLimit(0, 1); 45 47 } 46 48 … … 53 55 base.RegisterContentEvents(); 54 56 variableListView.ItemChecked += variableListView_ItemChecked; 57 limitView.Content.ValueChanged += limit_ValueChanged; 58 automaticYAxisCheckBox.CheckedChanged += automaticYAxisCheckBox_CheckedChanged; 55 59 } 56 60 57 61 protected override void DeregisterContentEvents() { 58 62 variableListView.ItemChecked -= variableListView_ItemChecked; 63 limitView.Content.ValueChanged -= limit_ValueChanged; 64 automaticYAxisCheckBox.CheckedChanged -= automaticYAxisCheckBox_CheckedChanged; 59 65 base.DeregisterContentEvents(); 60 66 } … … 64 70 if (Content == null) return; 65 71 var problemData = Content.ProblemData; 72 73 // Init Y-axis range 74 double min = double.MaxValue, max = double.MinValue; 75 var trainingTarget = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices); 76 foreach (var t in trainingTarget) { 77 if (t < min) min = t; 78 if (t > max) max = t; 79 } 80 double range = max - min; 81 const double scale = 1.0 / 3.0; 82 double axisMin, axisMax, axisInterval; 83 ChartUtil.CalculateAxisInterval(min - scale * range, max + scale * range, 5, out axisMin, out axisMax, out axisInterval); 84 automaticYAxisCheckBox.Checked = false; 85 limitView.ReadOnly = false; 86 limitView.Content.Lower = axisMin; 87 limitView.Content.Upper = axisMax; 88 66 89 // create dataset 67 90 var allowedInputVariables = Content.ProblemData.AllowedInputVariables; … … 87 110 88 111 if (recalculations.All(t => t.IsCompleted)) 89 S yncYAxis();112 SetupYAxis(); 90 113 }; 91 114 gradientChart.Configure(new[] { Content }, sharedFixedVariables, variableName, Points); … … 101 124 } 102 125 103 private void SyncYAxis() { 104 double min = double.MaxValue, max = double.MinValue; 105 foreach (var chart in VisibleCharts) { 106 if (chart.YMin < min) min = chart.YMin; 107 if (chart.YMax > max) max = chart.YMax; 108 } 109 double axisMin, axisMax, axisInterval; 110 ChartUtil.CalculateAxisInterval(min, max, 5, out axisMin, out axisMax, out axisInterval); 126 private void SetupYAxis() { 127 double axisMin, axisMax; 128 if (automaticYAxisCheckBox.Checked) { 129 double min = double.MaxValue, max = double.MinValue; 130 foreach (var chart in VisibleCharts) { 131 if (chart.YMin < min) min = chart.YMin; 132 if (chart.YMax > max) max = chart.YMax; 133 } 134 135 double axisInterval; 136 ChartUtil.CalculateAxisInterval(min, max, 5, out axisMin, out axisMax, out axisInterval); 137 } else { 138 axisMin = limitView.Content.Lower; 139 axisMax = limitView.Content.Upper; 140 } 111 141 112 142 foreach (var chart in VisibleCharts) { … … 146 176 tl.Controls.Remove(chart); 147 177 } 148 S yncYAxis();178 SetupYAxis(); 149 179 150 180 var count = tl.Controls.Count; … … 163 193 tl.ResumeLayout(); 164 194 } 195 196 private void automaticYAxisCheckBox_CheckedChanged(object sender, EventArgs e) { 197 limitView.ReadOnly = automaticYAxisCheckBox.Checked; 198 SetupYAxis(); 199 } 200 201 private void limit_ValueChanged(object sender, EventArgs e) { 202 if (automaticYAxisCheckBox.Checked) 203 return; 204 SetupYAxis(); 205 } 165 206 } 166 207 }
Note: See TracChangeset
for help on using the changeset viewer.