Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/28/12 15:47:26 (13 years ago)
Author:
spimming
Message:

#1680: merged changes from trunk into branch

Location:
branches/HeuristicLab.Hive.Azure
Files:
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure

  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/DataAnalysisProblemView.Designer.cs

    r7270 r7669  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
    4748      this.ImportButton = new System.Windows.Forms.Button();
    48       this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
     49      ((System.ComponentModel.ISupportInitialize)(this.problemInstanceSplitContainer)).BeginInit();
     50      this.problemInstanceSplitContainer.Panel1.SuspendLayout();
     51      this.problemInstanceSplitContainer.Panel2.SuspendLayout();
     52      this.problemInstanceSplitContainer.SuspendLayout();
    4953      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5054      this.SuspendLayout();
    5155      //
     56      // libraryInfoButton
     57      //
     58      this.libraryInfoButton.Location = new System.Drawing.Point(224, 1);
     59      //
     60      // problemInstanceSplitContainer
     61      //
     62      //
     63      // problemInstanceSplitContainer.Panel2
     64      //
     65      this.problemInstanceSplitContainer.Panel2.Controls.Add(this.ImportButton);
     66      //
    5267      // parameterCollectionView
    5368      //
    54       this.parameterCollectionView.Location = new System.Drawing.Point(3, 55);
    55       this.parameterCollectionView.Size = new System.Drawing.Size(490, 279);
    56       this.parameterCollectionView.TabIndex = 4;
     69      this.parameterCollectionView.Location = new System.Drawing.Point(6, 56);
     70      this.parameterCollectionView.Size = new System.Drawing.Size(501, 274);
    5771      //
    5872      // nameTextBox
     
    6074      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    6175      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    62       this.nameTextBox.Size = new System.Drawing.Size(409, 20);
    63       //
    64       // infoLabel
    65       //
    66       this.infoLabel.Location = new System.Drawing.Point(474, 3);
    67       //
    68       // ImportButton
    69       //
    70       this.ImportButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    71                   | System.Windows.Forms.AnchorStyles.Right)));
    72       this.ImportButton.Location = new System.Drawing.Point(0, 26);
    73       this.ImportButton.Name = "ImportButton";
    74       this.ImportButton.Size = new System.Drawing.Size(493, 23);
    75       this.ImportButton.TabIndex = 3;
    76       this.ImportButton.Text = "Import from CSV file";
    77       this.ImportButton.UseVisualStyleBackColor = true;
    78       this.ImportButton.Click += new System.EventHandler(this.ImportButton_Click);
    7976      //
    8077      // openFileDialog
     
    8380      this.openFileDialog.Title = "Import data...";
    8481      //
     82      // ImportButton
     83      //
     84      this.ImportButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     85                  | System.Windows.Forms.AnchorStyles.Right)));
     86      this.ImportButton.Location = new System.Drawing.Point(6, 27);
     87      this.ImportButton.Name = "ImportButton";
     88      this.ImportButton.Size = new System.Drawing.Size(501, 23);
     89      this.ImportButton.TabIndex = 14;
     90      this.ImportButton.Text = "Import from CSV file";
     91      this.ImportButton.UseVisualStyleBackColor = true;
     92      this.ImportButton.Click += new System.EventHandler(this.ImportButton_Click);
     93      //
    8594      // DataAnalysisProblemView
    8695      //
    8796      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    8897      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    89       this.Controls.Add(this.ImportButton);
    9098      this.Name = "DataAnalysisProblemView";
    91       this.Size = new System.Drawing.Size(493, 334);
    92       this.Controls.SetChildIndex(this.ImportButton, 0);
    93       this.Controls.SetChildIndex(this.infoLabel, 0);
    94       this.Controls.SetChildIndex(this.nameTextBox, 0);
    95       this.Controls.SetChildIndex(this.nameLabel, 0);
    96       this.Controls.SetChildIndex(this.parameterCollectionView, 0);
     99      this.problemInstanceSplitContainer.Panel1.ResumeLayout(false);
     100      this.problemInstanceSplitContainer.Panel1.PerformLayout();
     101      this.problemInstanceSplitContainer.Panel2.ResumeLayout(false);
     102      this.problemInstanceSplitContainer.Panel2.PerformLayout();
     103      ((System.ComponentModel.ISupportInitialize)(this.problemInstanceSplitContainer)).EndInit();
     104      this.problemInstanceSplitContainer.ResumeLayout(false);
    97105      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    98106      this.ResumeLayout(false);
    99       this.PerformLayout();
    100107
    101108    }
     
    103110    #endregion
    104111
     112    private System.Windows.Forms.OpenFileDialog openFileDialog;
    105113    private System.Windows.Forms.Button ImportButton;
    106     private System.Windows.Forms.OpenFileDialog openFileDialog;
    107114  }
    108115}
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r7215 r7669  
    141141      <DependentUpon>RegressionEnsembleSolutionModelView.cs</DependentUpon>
    142142    </Compile>
     143    <Compile Include="Regression\RegressionSolutionResidualHistogram.cs">
     144      <SubType>UserControl</SubType>
     145    </Compile>
     146    <Compile Include="Regression\RegressionSolutionResidualHistogram.Designer.cs">
     147      <DependentUpon>RegressionSolutionResidualHistogram.cs</DependentUpon>
     148    </Compile>
    143149    <Compile Include="Solution Views\ClassificationSolutionView.cs">
    144150      <SubType>UserControl</SubType>
     
    251257      <DependentUpon>RegressionSolutionScatterPlotView.cs</DependentUpon>
    252258    </Compile>
     259    <Compile Include="DataAnalysisProblemView.cs">
     260      <SubType>UserControl</SubType>
     261    </Compile>
     262    <Compile Include="DataAnalysisProblemView.Designer.cs">
     263      <DependentUpon>DataAnalysisProblemView.cs</DependentUpon>
     264    </Compile>
    253265    <None Include="HeuristicLab.snk" />
    254266    <None Include="Plugin.cs.frame" />
    255267    <None Include="Properties\AssemblyInfo.cs.frame" />
    256     <Compile Include="DataAnalysisProblemView.cs">
    257       <SubType>UserControl</SubType>
    258     </Compile>
    259     <Compile Include="DataAnalysisProblemView.Designer.cs">
    260       <DependentUpon>DataAnalysisProblemView.cs</DependentUpon>
    261     </Compile>
    262268    <Compile Include="Properties\AssemblyInfo.cs" />
    263269  </ItemGroup>
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/Plugin.cs.frame

    r7270 r7669  
    2828  [Plugin("HeuristicLab.Problems.DataAnalysis.Views", "Provides views for base classes for data analysis tasks.", "3.4.2.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis.Views-3.4.dll", PluginFileType.Assembly)]
    30   [PluginDependency("HeuristicLab.ALGLIB","3.1.0.0")]
    3130  [PluginDependency("HeuristicLab.Common", "3.3")]
    3231  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs

    r7270 r7669  
    2626using System.Windows.Forms.DataVisualization.Charting;
    2727using HeuristicLab.MainForm;
    28 using HeuristicLab.MainForm.WindowsForms;
    2928
    3029namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    6867        this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray(),
    6968          Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray());
    70 
     69        // training series
    7170        this.chart.Series.Add(ESTIMATEDVALUES_TRAINING_SERIES_NAME);
    7271        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].LegendText = ESTIMATEDVALUES_TRAINING_SERIES_NAME;
    7372        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].ChartType = SeriesChartType.FastLine;
     73        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.Color = this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Color;
    7474        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Points.DataBindXY(Content.ProblemData.TrainingIndizes.ToArray(), Content.EstimatedTrainingValues.ToArray());
     75        this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME]);
    7576        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Tag = Content;
    76         this.chart.DataManipulator.InsertEmptyPoints(1, IntervalType.Number, ESTIMATEDVALUES_TRAINING_SERIES_NAME);
    77         this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.BorderWidth = 0;
    78         this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.MarkerStyle = MarkerStyle.None;
    79 
    80 
     77        // test series
    8178        this.chart.Series.Add(ESTIMATEDVALUES_TEST_SERIES_NAME);
    8279        this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].LegendText = ESTIMATEDVALUES_TEST_SERIES_NAME;
    8380        this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    8481        this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Points.DataBindXY(Content.ProblemData.TestIndizes.ToArray(), Content.EstimatedTestValues.ToArray());
     82        this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME]);
    8583        this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Tag = Content;
    86 
    87 
     84        // series of remaining points
    8885        int[] allIndizes = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndizes).Except(Content.ProblemData.TestIndizes).ToArray();
    8986        var estimatedValues = Content.EstimatedValues.ToArray();
    9087        List<double> allEstimatedValues = allIndizes.Select(index => estimatedValues[index]).ToList();
    91 
    9288        this.chart.Series.Add(ESTIMATEDVALUES_ALL_SERIES_NAME);
    9389        this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].LegendText = ESTIMATEDVALUES_ALL_SERIES_NAME;
    9490        this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    9591        this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(allIndizes, allEstimatedValues);
     92        this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]);
    9693        this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Tag = Content;
    97         this.chart.DataManipulator.InsertEmptyPoints(1, IntervalType.Number, ESTIMATEDVALUES_ALL_SERIES_NAME);
    98         this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.BorderWidth = 0;
    99         this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.MarkerStyle = MarkerStyle.None;
    10094        this.ToggleSeriesData(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]);
    10195
    10296        UpdateCursorInterval();
    10397        this.UpdateStripLines();
     98      }
     99    }
     100
     101    private void InsertEmptyPoints(Series series) {
     102      int i = 0;
     103      while (i < series.Points.Count - 1) {
     104        if (series.Points[i].IsEmpty) {
     105          ++i;
     106          continue;
     107        }
     108
     109        var p1 = series.Points[i];
     110        var p2 = series.Points[i + 1];
     111        // check for consecutive indices
     112        if ((int)p2.XValue - (int)p1.XValue != 1) {
     113          // insert an empty point between p1 and p2 so that the line will be invisible (transparent)
     114          var p = new DataPoint((int)((p1.XValue + p2.XValue) / 2), 0.0) { IsEmpty = true };
     115          series.Points.Insert(i + 1, p);
     116        }
     117        ++i;
    104118      }
    105119    }
     
    204218      if (series.Points.Count > 0) {  //checks if series is shown
    205219        if (this.chart.Series.Any(s => s != series && s.Points.Count > 0)) {
    206           series.Points.Clear();
     220          ClearPointsQuick(series.Points);
    207221        }
    208222      } else if (Content != null) {
     
    227241        }
    228242        series.Points.DataBindXY(indizes, predictedValues);
    229         chart.DataManipulator.InsertEmptyPoints(1, IntervalType.Number, series.Name);
     243        this.InsertEmptyPoints(series);
    230244        chart.Legends[series.Legend].ForeColor = Color.Black;
    231245        UpdateCursorInterval();
    232246        chart.Refresh();
    233247      }
     248    }
     249
     250    // workaround as per http://stackoverflow.com/questions/5744930/datapointcollection-clear-performance
     251    private static void ClearPointsQuick(DataPointCollection points) {
     252      points.SuspendUpdates();
     253      while (points.Count > 0)
     254        points.RemoveAt(points.Count - 1);
     255      points.ResumeUpdates();
    234256    }
    235257
Note: See TracChangeset for help on using the changeset viewer.