Changeset 14021
- Timestamp:
- 07/07/16 19:31:49 (8 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.cs
r14014 r14021 142 142 if ((value.HasValue && fixedYAxisMin.HasValue && !value.Value.IsAlmost(fixedYAxisMin.Value)) || (value.HasValue != fixedYAxisMin.HasValue)) { 143 143 fixedYAxisMin = value; 144 // the check below prevents an exception when yMin >= yMax 145 if (yMin < yMax) 146 SetupAxis(chart.ChartAreas[0].AxisY, yMin, yMax, YAxisTicks, FixedYAxisMin, FixedYAxisMax); 144 SetupAxis(chart.ChartAreas[0].AxisY, yMin, yMax, YAxisTicks, FixedYAxisMin, FixedYAxisMax); 147 145 } 148 146 } … … 154 152 if ((value.HasValue && fixedYAxisMax.HasValue && !value.Value.IsAlmost(fixedYAxisMax.Value)) || (value.HasValue != fixedYAxisMax.HasValue)) { 155 153 fixedYAxisMax = value; 156 // the check below prevents an exception when yMin >= yMax 157 if (yMin < yMax) 158 SetupAxis(chart.ChartAreas[0].AxisY, yMin, yMax, YAxisTicks, FixedYAxisMin, FixedYAxisMax); 154 SetupAxis(chart.ChartAreas[0].AxisY, yMin, yMax, YAxisTicks, FixedYAxisMin, FixedYAxisMax); 159 155 } 160 156 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.Designer.cs
r14014 r14021 60 60 this.variableListView.UseCompatibleStateImageBehavior = false; 61 61 this.variableListView.View = System.Windows.Forms.View.List; 62 this.variableListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.variableListView_ItemChecked); 62 63 // 63 64 // gradientChartTableLayout … … 109 110 this.automaticYAxisCheckBox.Text = "Automatic"; 110 111 this.automaticYAxisCheckBox.UseVisualStyleBackColor = true; 112 this.automaticYAxisCheckBox.CheckedChanged += new System.EventHandler(this.automaticYAxisCheckBox_CheckedChanged); 111 113 // 112 114 // densityGroupBox -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.cs
r14014 r14021 64 64 65 65 limitView.Content = new DoubleLimit(0, 1); 66 densityComboBox.SelectedIndex = 0; // select None 66 limitView.Content.ValueChanged += limit_ValueChanged; 67 68 densityComboBox.SelectedIndex = 1; // select Training 67 69 68 70 columnsTextBox.Text = "4"; … … 81 83 protected override void RegisterContentEvents() { 82 84 base.RegisterContentEvents(); 83 variableListView.ItemChecked += variableListView_ItemChecked;84 limitView.Content.ValueChanged += limit_ValueChanged;85 automaticYAxisCheckBox.CheckedChanged += automaticYAxisCheckBox_CheckedChanged;86 85 Content.ModelChanged += solution_ModelChanged; 87 86 } 88 87 89 88 protected override void DeregisterContentEvents() { 90 variableListView.ItemChecked -= variableListView_ItemChecked;91 limitView.Content.ValueChanged -= limit_ValueChanged;92 automaticYAxisCheckBox.CheckedChanged -= automaticYAxisCheckBox_CheckedChanged;93 89 Content.ModelChanged -= solution_ModelChanged; 94 90 base.DeregisterContentEvents(); … … 149 145 150 146 // update variable list 147 variableListView.ItemChecked -= variableListView_ItemChecked; 151 148 variableListView.Items.Clear(); 152 149 foreach (var variable in allowedInputVariables) … … 155 152 foreach (var variable in Content.Model.VariablesUsedForPrediction) 156 153 variableListView.Items[variable].Checked = true; 154 variableListView.ItemChecked += variableListView_ItemChecked; 155 156 RecalculateAndRelayoutCharts(); 157 } 158 159 private async void RecalculateAndRelayoutCharts() { 160 foreach (var variable in VisibleVariables) { 161 var gradientChart = gradientCharts[variable]; 162 await gradientChart.RecalculateAsync(); 163 } 164 gradientChartTableLayout.SuspendLayout(); 165 SetupYAxis(); 166 ReOrderControls(); 167 SetStyles(); 168 gradientChartTableLayout.ResumeLayout(); 169 gradientChartTableLayout.Refresh(); 170 foreach (var variable in VisibleVariables) { 171 var densityChart = densityCharts[variable]; 172 UpdateDensityChart(densityChart, variable); 173 } 157 174 } 158 175 private GradientChart CreateGradientChart(string variableName, ModifiableDataset sharedFixedVariables) { … … 199 216 chart.FixedYAxisMin = axisMin; 200 217 chart.FixedYAxisMax = axisMax; 201 //chart.Update();202 218 } 203 219 } … … 213 229 tl.Controls.Add(chartsPanel, column, row); 214 230 215 if (column == 0) { 216 var chart = gradientCharts[v]; 217 chart.YAxisTitle = Content.ProblemData.TargetVariable; 218 } 219 231 var chart = gradientCharts[v]; 232 chart.YAxisTitle = column == 0 ? Content.ProblemData.TargetVariable : string.Empty; 220 233 column++; 221 234 … … 268 281 var variable = item.Text; 269 282 var gradientChart = gradientCharts[variable]; 270 var densityChart = densityCharts[variable];271 283 var chartsPanel = groupingPanels[variable]; 272 284 var tl = gradientChartTableLayout; … … 276 288 tl.Controls.Add(chartsPanel); 277 289 await gradientChart.RecalculateAsync(); 278 UpdateDensityChart(densityChart, variable);279 290 } else { 280 291 tl.Controls.Remove(chartsPanel); … … 287 298 } 288 299 tl.ResumeLayout(); 300 tl.Refresh(); 301 densityComboBox_SelectedIndexChanged(this, EventArgs.Empty); 289 302 } 290 303 … … 292 305 limitView.ReadOnly = automaticYAxisCheckBox.Checked; 293 306 SetupYAxis(); 307 gradientChartTableLayout.Refresh(); 308 densityComboBox_SelectedIndexChanged(this, EventArgs.Empty); // necessary to realign the density plots 294 309 } 295 310 … … 298 313 return; 299 314 SetupYAxis(); 315 gradientChartTableLayout.Refresh(); 316 densityComboBox_SelectedIndexChanged(this, EventArgs.Empty); // necessary to realign the density plots 300 317 } 301 318 302 319 private void densityComboBox_SelectedIndexChanged(object sender, EventArgs e) { 320 if (Content == null) 321 return; 322 303 323 int si = densityComboBox.SelectedIndex; 304 324 if (si == 0) { … … 369 389 ReOrderControls(); 370 390 SetStyles(); 371 tl.ResumeLayout(true); 372 } 373 } 374 375 private void solution_ModelChanged(object sender, EventArgs e) { 376 foreach (var chart in gradientCharts.Values) { 377 chart.RecalculateAsync(); 391 tl.ResumeLayout(); 392 tl.Refresh(); 393 densityComboBox_SelectedIndexChanged(this, EventArgs.Empty); 394 } 395 } 396 397 private async void solution_ModelChanged(object sender, EventArgs e) { 398 foreach (var variable in VisibleVariables) { 399 var gradientChart = gradientCharts[variable]; 400 var densityChart = densityCharts[variable]; 401 // recalculate and refresh 402 await gradientChart.RecalculateAsync(); 403 gradientChart.Refresh(); 404 UpdateDensityChart(densityChart, variable); 378 405 } 379 406 }
Note: See TracChangeset
for help on using the changeset viewer.