Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/21/14 15:28:27 (11 years ago)
Author:
aesterer
Message:

Added scatter plot view

Location:
branches/DataPreprocessing
Files:
2 added
5 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessingView.cs

    r10877 r10882  
    4949        var statisticsLogic = new StatisticsLogic(data, searchLogic);
    5050        var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic, dataGridLogic);
    51         var lineChartLogic = new ChartLogic(data);
    52         var histogramLogic = new ChartLogic(data);
     51        var chartLogic = new ChartLogic(data);
    5352        var filterLogic = new FilterLogic(data);
    5453        var dataCompletenessLogic = new ChartLogic(data);
     
    6059          new TransformationContent(data),
    6160          new ManipulationContent(manipulationLogic, searchLogic),
    62           new LineChartContent(lineChartLogic),
    63           new HistogramContent(histogramLogic)//,
     61          new LineChartContent(chartLogic),
     62          new HistogramContent(chartLogic),
     63          new ScatterPlotContent(chartLogic)
     64          //,
    6465          //new DataCompletenessChartContent(dataCompletenessLogic)
    6566        };
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj

    r10877 r10882  
    113113      <DependentUpon>FilterView.cs</DependentUpon>
    114114    </Compile>
     115    <Compile Include="MultiScatterPlotView.cs">
     116      <SubType>UserControl</SubType>
     117    </Compile>
     118    <Compile Include="MultiScatterPlotView.Designer.cs">
     119      <DependentUpon>MultiScatterPlotView.cs</DependentUpon>
     120    </Compile>
     121    <Compile Include="PreprocessingScatterPlotView.cs">
     122      <SubType>UserControl</SubType>
     123    </Compile>
     124    <Compile Include="PreprocessingScatterPlotView.Designer.cs">
     125      <DependentUpon>PreprocessingScatterPlotView.cs</DependentUpon>
     126    </Compile>
    115127    <Compile Include="SearchAndReplaceDialog.cs">
    116128      <SubType>Form</SubType>
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingScatterPlotView.Designer.cs

    r10877 r10882  
    2020#endregion
    2121
    22 namespace HeuristicLab.Analysis.Views {
    23   partial class ScatterPlotView {
     22namespace HeuristicLab.DataPreprocessing.Views {
     23  partial class PreprocessingScatterPlotView {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    5050      System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
    5151      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
    52       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5352      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
    5453      this.SuspendLayout();
    55       //
    56       // nameTextBox
    57       //
    58       this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    59       this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    60       this.nameTextBox.Location = new System.Drawing.Point(55, 0);
    61       this.nameTextBox.Size = new System.Drawing.Size(279, 20);
    62       //
    63       // infoLabel
    64       //
    65       this.infoLabel.Location = new System.Drawing.Point(340, 3);
    6654      //
    6755      // chart
     
    10795      this.Name = "ScatterPlotView";
    10896      this.Size = new System.Drawing.Size(359, 274);
    109       this.Controls.SetChildIndex(this.infoLabel, 0);
    11097      this.Controls.SetChildIndex(this.chart, 0);
    111       this.Controls.SetChildIndex(this.nameLabel, 0);
    112       this.Controls.SetChildIndex(this.nameTextBox, 0);
    113       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    11498      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
    11599      this.ResumeLayout(false);
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingScatterPlotView.cs

    r10877 r10882  
    2626using System.Windows.Forms;
    2727using System.Windows.Forms.DataVisualization.Charting;
     28using HeuristicLab.Analysis;
     29using HeuristicLab.Analysis.Views;
    2830using HeuristicLab.Collections;
    2931using HeuristicLab.Common;
     
    3133using HeuristicLab.MainForm;
    3234
    33 namespace HeuristicLab.Analysis.Views {
    34   [View("ScatterPlot View")]
    35   [Content(typeof(ScatterPlot), true)]
    36   public partial class ScatterPlotView : NamedItemView, IConfigureableView {
     35namespace HeuristicLab.DataPreprocessing.Views {
     36  [View("Preprocessing ScatterPlot View")]
     37  [Content(typeof(ScatterPlot), false)]
     38  public partial class PreprocessingScatterPlotView : ItemView, IConfigureableView {
    3739    protected List<Series> invisibleSeries;
    3840    protected Dictionary<IObservableList<Point2D<double>>, ScatterPlotDataRow> pointsRowsTable;
     
    4345    }
    4446
    45     public ScatterPlotView() {
     47    public PreprocessingScatterPlotView() {
    4648      InitializeComponent();
    4749      pointsRowsTable = new Dictionary<IObservableList<Point2D<double>>, ScatterPlotDataRow>();
     
    227229    #region Event Handlers
    228230    #region Content Event Handlers
    229     protected override void Content_NameChanged(object sender, EventArgs e) {
    230       if (InvokeRequired)
    231         Invoke(new EventHandler(Content_NameChanged), sender, e);
    232       else {
    233         chart.Titles[0].Text = Content.Name;
    234         base.Content_NameChanged(sender, e);
    235       }
    236     }
     231
    237232    private void Content_VisualPropertiesChanged(object sender, EventArgs e) {
    238233      if (InvokeRequired)
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj

    r10877 r10882  
    7272  </ItemGroup>
    7373  <ItemGroup>
     74    <Compile Include="Implementations\ScatterPlotContent.cs" />
    7475    <Compile Include="Implementations\DataCompletenessChartContent.cs" />
    7576    <Compile Include="Implementations\FilteredPreprocessingData.cs" />
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs

    r10867 r10882  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Data;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.DataPreprocessing {
     
    6061      row.VisualProperties.ChartType = chartType;
    6162      return row;
    62     }
    63 
    64     private void ReplaceNANwithZero(IList<double> values) {
    65       for (int i = 0; i < values.Count; i++) {
    66         if (Double.IsNaN(values[i]))
    67           values[i] = 0;
    68       }
    6963    }
    7064
     
    148142    }
    149143
     144    public ScatterPlot CreateScatterPlot(string name, string variableNameX, string variableNameY) {
     145      ScatterPlot scatterPlot = new ScatterPlot(name, "");
     146     
     147
     148      List<double> xValues = GetVariableValues(variableNameX);
     149      List<double> yValues = GetVariableValues(variableNameY);
     150
     151      List<Point2D<double>> points = new List<Point2D<double>>();
     152
     153      for( int i = 0; i < xValues.Count; i++)
     154      {
     155          Point2D<double> point = new Point2D<double>(xValues[i],yValues[i]);
     156          points.Add(point);
     157      }
     158
     159      ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY,"",points);
     160      scatterPlot.Rows.Add(scdr);
     161      return scatterPlot;
     162    }
     163
    150164    #endregion
    151165  }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ScatterPlotContent.cs

    r10867 r10882  
    2626namespace HeuristicLab.DataPreprocessing {
    2727
    28   [Item("LineChart", "Represents the line chart grid.")]
    29   public class LineChartContent : PreprocessingChartContent {
     28  [Item("ScatterPlot", "Represents a scatter plot.")]
     29  public class ScatterPlotContent : PreprocessingChartContent {
    3030
    31     public LineChartContent(IChartLogic chartlogic)
     31    public ScatterPlotContent(IChartLogic chartlogic)
    3232      : base(chartlogic) {
    3333    }
    3434
    35     public LineChartContent(LineChartContent content, Cloner cloner)
     35    public ScatterPlotContent(ScatterPlotContent content, Cloner cloner)
    3636      : base(content, cloner) {
    3737
     
    4343
    4444    public override IDeepCloneable Clone(Cloner cloner) {
    45       return new LineChartContent(this, cloner);
     45      return new ScatterPlotContent(this, cloner);
    4646    }
    4747
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IChartLogic.cs

    r10867 r10882  
    4545    DataRow CreateDataRowRange(string variableName, int start, int end, DataRowVisualProperties.DataRowChartType chartType);
    4646
     47    ScatterPlot CreateScatterPlot(string name,string variableNameX,string variableNameY);
     48
    4749    string GetVariableNameByIndex(int index);
    4850
Note: See TracChangeset for help on using the changeset viewer.