- Timestamp:
- 05/28/14 15:31:47 (10 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 8 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj
r10908 r10915 88 88 <DependentUpon>ComparisonFilterView.cs</DependentUpon> 89 89 </Compile> 90 <Compile Include="SingleScatterPlotView.cs"> 91 <SubType>UserControl</SubType> 92 </Compile> 93 <Compile Include="SingleScatterPlotView.Designer.cs"> 94 <DependentUpon>SingleScatterPlotView.cs</DependentUpon> 95 </Compile> 90 96 <Compile Include="DataCompletenessView.cs"> 91 97 <SubType>UserControl</SubType> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/MultiScatterPlotView.Designer.cs
r10882 r10915 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.scatterPlotView = new HeuristicLab.DataPreprocessing.Views.PreprocessingScatterPlotView(); 27 this.groupBox1 = new System.Windows.Forms.GroupBox(); 28 this.label2 = new System.Windows.Forms.Label(); 29 this.label1 = new System.Windows.Forms.Label(); 30 this.comboBoxYVariable = new System.Windows.Forms.ComboBox(); 31 this.comboBoxXVariable = new System.Windows.Forms.ComboBox(); 32 this.groupBox1.SuspendLayout(); 26 this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 33 27 this.SuspendLayout(); 34 28 // 35 // scatterPlotView29 // tableLayoutPanel 36 30 // 37 this. scatterPlotView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)31 this.tableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 38 32 | System.Windows.Forms.AnchorStyles.Left) 39 33 | System.Windows.Forms.AnchorStyles.Right))); 40 this.scatterPlotView.Caption = "ScatterPlot View"; 41 this.scatterPlotView.Content = null; 42 this.scatterPlotView.Location = new System.Drawing.Point(188, 0); 43 this.scatterPlotView.Name = "scatterPlotView"; 44 this.scatterPlotView.ReadOnly = false; 45 this.scatterPlotView.Size = new System.Drawing.Size(670, 512); 46 this.scatterPlotView.TabIndex = 0; 34 this.tableLayoutPanel.AutoScroll = true; 35 this.tableLayoutPanel.ColumnCount = 1; 36 this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); 37 this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 38 this.tableLayoutPanel.Location = new System.Drawing.Point(3, 3); 39 this.tableLayoutPanel.Name = "tableLayoutPanel"; 40 this.tableLayoutPanel.RowCount = 1; 41 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); 42 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 514F)); 43 this.tableLayoutPanel.Size = new System.Drawing.Size(860, 514); 44 this.tableLayoutPanel.TabIndex = 1; 47 45 // 48 // groupBox1 49 // 50 this.groupBox1.Controls.Add(this.label2); 51 this.groupBox1.Controls.Add(this.label1); 52 this.groupBox1.Controls.Add(this.comboBoxYVariable); 53 this.groupBox1.Controls.Add(this.comboBoxXVariable); 54 this.groupBox1.Location = new System.Drawing.Point(3, 3); 55 this.groupBox1.Name = "groupBox1"; 56 this.groupBox1.Size = new System.Drawing.Size(179, 157); 57 this.groupBox1.TabIndex = 1; 58 this.groupBox1.TabStop = false; 59 this.groupBox1.Text = "Options"; 60 // 61 // label2 62 // 63 this.label2.AutoSize = true; 64 this.label2.Location = new System.Drawing.Point(17, 80); 65 this.label2.Name = "label2"; 66 this.label2.Size = new System.Drawing.Size(55, 13); 67 this.label2.TabIndex = 3; 68 this.label2.Text = "Y Variable"; 69 // 70 // label1 71 // 72 this.label1.AutoSize = true; 73 this.label1.Location = new System.Drawing.Point(17, 25); 74 this.label1.Name = "label1"; 75 this.label1.Size = new System.Drawing.Size(55, 13); 76 this.label1.TabIndex = 2; 77 this.label1.Text = "X Variable"; 78 // 79 // comboBoxYVariable 80 // 81 this.comboBoxYVariable.FormattingEnabled = true; 82 this.comboBoxYVariable.Location = new System.Drawing.Point(20, 96); 83 this.comboBoxYVariable.Name = "comboBoxYVariable"; 84 this.comboBoxYVariable.Size = new System.Drawing.Size(121, 21); 85 this.comboBoxYVariable.TabIndex = 1; 86 this.comboBoxYVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged); 87 // 88 // comboBoxXVariable 89 // 90 this.comboBoxXVariable.FormattingEnabled = true; 91 this.comboBoxXVariable.Location = new System.Drawing.Point(20, 41); 92 this.comboBoxXVariable.Name = "comboBoxXVariable"; 93 this.comboBoxXVariable.Size = new System.Drawing.Size(121, 21); 94 this.comboBoxXVariable.TabIndex = 0; 95 this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged); 96 // 97 // PreprocessingScatterPlotView 46 // MultiScatterPlotView 98 47 // 99 48 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 100 49 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 101 this.Controls.Add(this.groupBox1); 102 this.Controls.Add(this.scatterPlotView); 103 this.Name = "PreprocessingScatterPlotView"; 50 this.Controls.Add(this.tableLayoutPanel); 51 this.Name = "MultiScatterPlotView"; 104 52 this.Size = new System.Drawing.Size(863, 517); 105 this.groupBox1.ResumeLayout(false);106 this.groupBox1.PerformLayout();107 53 this.ResumeLayout(false); 108 54 … … 111 57 #endregion 112 58 113 private HeuristicLab.DataPreprocessing.Views.PreprocessingScatterPlotView scatterPlotView; 114 private System.Windows.Forms.GroupBox groupBox1; 115 private System.Windows.Forms.Label label2; 116 private System.Windows.Forms.Label label1; 117 private System.Windows.Forms.ComboBox comboBoxYVariable; 118 private System.Windows.Forms.ComboBox comboBoxXVariable; 59 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; 60 119 61 } 120 62 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/MultiScatterPlotView.cs
r10882 r10915 3 3 using System.ComponentModel; 4 4 using System.Drawing; 5 using System.Data;6 5 using System.Linq; 7 6 using System.Text; … … 18 17 namespace HeuristicLab.DataPreprocessing.Views { 19 18 20 [View(" Scatter Plot View")]21 [Content(typeof(ScatterPlotContent), false)]19 [View("Multi Scatter Plot View")] 20 [Content(typeof(ScatterPlotContent), true)] 22 21 public partial class MultiScatterPlotView : ItemView { 23 22 24 23 private IChartLogic logic; 24 private List<string> variables; 25 25 26 26 public MultiScatterPlotView() { … … 35 35 public void InitData() { 36 36 37 IEnumerable<string> variables = logic.GetVariableNames(); 38 comboBoxXVariable.Items.Clear(); 39 comboBoxYVariable.Items.Clear(); 40 41 comboBoxXVariable.Items.AddRange(variables.ToArray()); 42 comboBoxYVariable.Items.AddRange(variables.ToArray()); 43 44 if (variables.Count() >= 2) { 45 comboBoxXVariable.SelectedIndex = 0; 46 comboBoxYVariable.SelectedIndex = 1; 47 UpdateScatterPlot(); 48 49 } 37 variables = new List<string>(logic.GetVariableNames()); 50 38 51 39 } … … 56 44 logic = Content.ChartLogic; 57 45 InitData(); 46 GenerateMultiLayout(); 58 47 } 59 48 } 60 49 61 private void comboBox_SelectedIndexChanged(object sender, EventArgs e) { 62 UpdateScatterPlot(); 50 private void GenerateMultiLayout() 51 { 52 tableLayoutPanel.Controls.Clear(); 53 //Clear out the existing row and column styles 54 tableLayoutPanel.ColumnStyles.Clear(); 55 tableLayoutPanel.RowStyles.Clear(); 56 57 //Set row and column count 58 tableLayoutPanel.ColumnCount = variables.Count+1; 59 tableLayoutPanel.RowCount = variables.Count+1; 60 61 int headerSize = 50; 62 int maxAutoSizeElements = 6; 63 int fixedElementSize = 200; 64 65 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, headerSize)); 66 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, headerSize)); 67 // set column and row layout 68 for (int x = 0; x < variables.Count; x++) 69 { 70 // auto size 71 if (variables.Count <= maxAutoSizeElements) { 72 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, (tableLayoutPanel.Width - headerSize) / variables.Count)); 73 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, (tableLayoutPanel.Height - headerSize) / variables.Count)); 74 } 75 // fixed size 76 else { 77 tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, fixedElementSize)); 78 tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, fixedElementSize)); 79 } 80 } 81 82 // set variable header elements 83 for (int i = 1; i < variables.Count +1; i++) 84 { 85 Button b1 = new Button(); 86 b1.Text = variables[i-1]; 87 b1.Dock = DockStyle.Fill; 88 tableLayoutPanel.Controls.Add(b1,0,i); 89 Button b2 = new Button(); 90 b2.Text = variables[i - 1]; 91 b2.Dock = DockStyle.Fill; 92 tableLayoutPanel.Controls.Add(b2, i, 0); 93 } 94 95 //set scatter plots and histograms 96 for (int x = 1; x < variables.Count + 1; x++) 97 { 98 99 for (int y = 1; y < variables.Count + 1; y++) 100 { 101 // use historgram if x variable equals y variable 102 if (x == y) { 103 PreprocessingDataTable dataTable = new PreprocessingDataTable(); 104 DataRow dataRow = logic.CreateDataRow(variables[x - 1], DataRowVisualProperties.DataRowChartType.Histogram); 105 dataTable.Rows.Add(dataRow); 106 PreprocessingDataTableView pcv = new PreprocessingDataTableView(); 107 pcv.DoubleClick += tableLayoutElementDoubleClick; 108 pcv.Content = dataTable; 109 tableLayoutPanel.Controls.Add(pcv, y, x); 110 } 111 //scatter plot 112 else { 113 ScatterPlot scatterPlot = logic.CreateScatterPlot(variables[x - 1], variables[y-1]); 114 PreprocessingScatterPlotView pspv = new PreprocessingScatterPlotView(); 115 pspv.DoubleClick += tableLayoutElementDoubleClick; 116 pspv.Content = scatterPlot; 117 pspv.Dock = DockStyle.Fill; 118 tableLayoutPanel.Controls.Add(pspv, y, x); 119 } 120 } 121 } 63 122 } 64 123 65 private void UpdateScatterPlot() { 66 if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null) { 67 ScatterPlot scatterPlot = logic.CreateScatterPlot("ScatterPlot", (string)comboBoxXVariable.SelectedItem, (string)comboBoxYVariable.SelectedItem); 68 scatterPlotView.Content = scatterPlot; 69 } 124 private void tableLayoutElementDoubleClick(object sender, EventArgs e) { 125 126 //histogram clicked 127 if(sender.GetType() == typeof(PreprocessingDataTableView)) 128 { 129 PreprocessingDataTableView pcv = (PreprocessingDataTableView)sender; 130 //ScatterPlotContent spc = new ScatterPlotContent( 131 132 } 133 // scatter plot clicked 134 else if (sender.GetType() == typeof(PreprocessingScatterPlotView)) { 135 PreprocessingScatterPlotView pspv = (PreprocessingScatterPlotView)sender; 136 MainFormManager.MainForm.ShowContent(this.Content, typeof(SingleScatterPlotView)); 137 } 138 139 70 140 } 141 71 142 72 143 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingScatterPlotView.Designer.cs
r10882 r10915 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 48 49 System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); … … 55 56 // chart 56 57 // 57 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 58 | System.Windows.Forms.AnchorStyles.Left)59 58 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 59 | System.Windows.Forms.AnchorStyles.Left) 60 | System.Windows.Forms.AnchorStyles.Right))); 60 61 this.chart.BorderlineColor = System.Drawing.Color.Black; 61 62 this.chart.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid; … … 71 72 legend1.Name = "Default"; 72 73 this.chart.Legends.Add(legend1); 73 this.chart.Location = new System.Drawing.Point(0, 26);74 this.chart.Location = new System.Drawing.Point(0, 3); 74 75 this.chart.Name = "chart"; 75 76 series1.ChartArea = "Default"; … … 77 78 series1.Name = "Default"; 78 79 this.chart.Series.Add(series1); 79 this.chart.Size = new System.Drawing.Size(359, 2 48);80 this.chart.Size = new System.Drawing.Size(359, 271); 80 81 this.chart.TabIndex = 3; 81 82 this.chart.Text = "chart"; … … 83 84 title1.Name = "Default"; 84 85 title1.Text = "Title"; 86 title1.Visible = false; 85 87 this.chart.Titles.Add(title1); 86 88 this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend); … … 88 90 this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove); 89 91 // 90 // ScatterPlotView92 // PreprocessingScatterPlotView 91 93 // 92 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);93 94 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 94 95 this.Controls.Add(this.chart); 95 this.Name = " ScatterPlotView";96 this.Name = "PreprocessingScatterPlotView"; 96 97 this.Size = new System.Drawing.Size(359, 274); 97 this.Controls.SetChildIndex(this.chart, 0);98 98 ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit(); 99 99 this.ResumeLayout(false); 100 this.PerformLayout();101 100 102 101 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingScatterPlotView.cs
r10882 r10915 96 96 base.OnContentChanged(); 97 97 invisibleSeries.Clear(); 98 chart.Titles[0].Text = string.Empty;99 98 chart.ChartAreas[0].AxisX.Title = string.Empty; 100 99 chart.ChartAreas[0].AxisY.Title = string.Empty; 101 100 chart.Series.Clear(); 102 101 if (Content != null) { 103 chart.Titles[0].Text = Content.Name;104 102 AddScatterPlotDataRows(Content.Rows); 105 103 ConfigureChartArea(chart.ChartAreas[0]); … … 178 176 179 177 private void ConfigureChartArea(ChartArea area) { 180 if (Content.VisualProperties.TitleFont != null) chart.Titles[0].Font = Content.VisualProperties.TitleFont;181 if (!Content.VisualProperties.TitleColor.IsEmpty) chart.Titles[0].ForeColor = Content.VisualProperties.TitleColor;182 chart.Titles[0].Text = Content.VisualProperties.Title;183 178 184 179 if (Content.VisualProperties.AxisTitleFont != null) area.AxisX.TitleFont = Content.VisualProperties.AxisTitleFont; -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/SingleScatterPlotView.Designer.cs
r10897 r10915 1 1 namespace HeuristicLab.DataPreprocessing.Views { 2 partial class MultiScatterPlotView {2 partial class SingleScatterPlotView { 3 3 /// <summary> 4 4 /// Required designer variable. … … 40 40 this.scatterPlotView.Caption = "ScatterPlot View"; 41 41 this.scatterPlotView.Content = null; 42 this.scatterPlotView.Location = new System.Drawing.Point(1 88, 0);42 this.scatterPlotView.Location = new System.Drawing.Point(169, 3); 43 43 this.scatterPlotView.Name = "scatterPlotView"; 44 44 this.scatterPlotView.ReadOnly = false; 45 this.scatterPlotView.Size = new System.Drawing.Size(6 70, 512);45 this.scatterPlotView.Size = new System.Drawing.Size(689, 509); 46 46 this.scatterPlotView.TabIndex = 0; 47 47 // … … 54 54 this.groupBox1.Location = new System.Drawing.Point(3, 3); 55 55 this.groupBox1.Name = "groupBox1"; 56 this.groupBox1.Size = new System.Drawing.Size(1 79, 157);56 this.groupBox1.Size = new System.Drawing.Size(160, 140); 57 57 this.groupBox1.TabIndex = 1; 58 58 this.groupBox1.TabStop = false; … … 95 95 this.comboBoxXVariable.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged); 96 96 // 97 // PreprocessingScatterPlotView97 // SingleScatterPlotView 98 98 // 99 99 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); … … 101 101 this.Controls.Add(this.groupBox1); 102 102 this.Controls.Add(this.scatterPlotView); 103 this.Name = " PreprocessingScatterPlotView";103 this.Name = "SingleScatterPlotView"; 104 104 this.Size = new System.Drawing.Size(863, 517); 105 105 this.groupBox1.ResumeLayout(false); -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/SingleScatterPlotView.cs
r10897 r10915 18 18 namespace HeuristicLab.DataPreprocessing.Views { 19 19 20 [View("S catter Plot View")]20 [View("Single Scatter Plot View")] 21 21 [Content(typeof(ScatterPlotContent), false)] 22 public partial class MultiScatterPlotView : ItemView {22 public partial class SingleScatterPlotView : ItemView { 23 23 24 24 private IChartLogic logic; 25 25 26 public MultiScatterPlotView() {26 public SingleScatterPlotView() { 27 27 InitializeComponent(); 28 28 } … … 65 65 private void UpdateScatterPlot() { 66 66 if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null) { 67 ScatterPlot scatterPlot = logic.CreateScatterPlot( "ScatterPlot",(string)comboBoxXVariable.SelectedItem, (string)comboBoxYVariable.SelectedItem);67 ScatterPlot scatterPlot = logic.CreateScatterPlot((string)comboBoxXVariable.SelectedItem, (string)comboBoxYVariable.SelectedItem); 68 68 scatterPlotView.Content = scatterPlot; 69 69 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs
r10908 r10915 160 160 } 161 161 162 public ScatterPlot CreateScatterPlot(string name, stringvariableNameX, string variableNameY) {163 ScatterPlot scatterPlot = new ScatterPlot( name, "");162 public ScatterPlot CreateScatterPlot(string variableNameX, string variableNameY) { 163 ScatterPlot scatterPlot = new ScatterPlot(); 164 164 165 165 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ScatterPlotContent.cs
r10882 r10915 29 29 public class ScatterPlotContent : PreprocessingChartContent { 30 30 31 public string SelectedXVariable { get; set; } 32 33 public string SelectedYVariable { get; set; } 34 31 35 public ScatterPlotContent(IChartLogic chartlogic) 32 36 : base(chartlogic) { -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IChartLogic.cs
r10908 r10915 45 45 DataRow CreateDataRowRange(string variableName, int start, int end, DataRowVisualProperties.DataRowChartType chartType); 46 46 47 ScatterPlot CreateScatterPlot(string name,stringvariableNameX,string variableNameY);47 ScatterPlot CreateScatterPlot(string variableNameX,string variableNameY); 48 48 49 49 string GetVariableNameByIndex(int index);
Note: See TracChangeset
for help on using the changeset viewer.