Skip to content

Commit

Permalink
Worked on different start indexes for data tables (#925)
Browse files Browse the repository at this point in the history
git-svn-id: https://src.heuristiclab.com/svn/core/trunk@4778 2abd9481-f8db-48e9-bd25-06bc13291c1b
  • Loading branch information
s-wagner committed Nov 12, 2010
1 parent 853bc0c commit 31b8059
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 38 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 29 additions & 38 deletions sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,18 @@ private void Values_ItemsAdded(object sender, CollectionItemsChangedEventArgs<In
if (row != null) {
Series rowSeries = chart.Series[row.Name];
if (!invisibleSeries.Contains(rowSeries)) {
foreach (IndexedItem<double> item in e.Items) {
var value = item.Value;
if (IsInvalidValue(item.Value)) {
DataPoint point = new DataPoint();
point.IsEmpty = true;
rowSeries.Points.Insert(item.Index, point);
} else {
rowSeries.Points.InsertY(item.Index, value);
}
}
rowSeries.Points.Clear();
FillSeriesWithRowValues(rowSeries, row);
//foreach (IndexedItem<double> item in e.Items) {
// var value = item.Value;
// DataPoint point = new DataPoint();
// point.XValue = row.VisualProperties.StartIndexZero ? item.Index : item.Index + 1;
// if (IsInvalidValue(item.Value))
// point.IsEmpty = true;
// else
// point.YValues = new double[] { value };
// rowSeries.Points.Add(point);
//}
UpdateYCursorInterval();
}
}
Expand All @@ -303,11 +305,13 @@ private void Values_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<
if (row != null) {
Series rowSeries = chart.Series[row.Name];
if (!invisibleSeries.Contains(rowSeries)) {
List<DataPoint> points = new List<DataPoint>();
foreach (IndexedItem<double> item in e.Items)
points.Add(rowSeries.Points[item.Index]);
foreach (DataPoint point in points)
rowSeries.Points.Remove(point);
rowSeries.Points.Clear();
FillSeriesWithRowValues(rowSeries, row);
//List<DataPoint> points = new List<DataPoint>();
//foreach (IndexedItem<double> item in e.Items)
// points.Add(rowSeries.Points[item.Index]);
//foreach (DataPoint point in points)
// rowSeries.Points.Remove(point);
UpdateYCursorInterval();
}
}
Expand Down Expand Up @@ -344,14 +348,8 @@ private void Values_ItemsMoved(object sender, CollectionItemsChangedEventArgs<In
if (row != null) {
Series rowSeries = chart.Series[row.Name];
if (!invisibleSeries.Contains(rowSeries)) {
foreach (IndexedItem<double> item in e.Items) {
if (IsInvalidValue(item.Value))
rowSeries.Points[item.Index].IsEmpty = true;
else {
rowSeries.Points[item.Index].YValues = new double[] { item.Value };
rowSeries.Points[item.Index].IsEmpty = false;
}
}
rowSeries.Points.Clear();
FillSeriesWithRowValues(rowSeries, row);
UpdateYCursorInterval();
}
}
Expand All @@ -368,16 +366,9 @@ private void Values_CollectionReset(object sender, CollectionItemsChangedEventAr
Series rowSeries = chart.Series[row.Name];
if (!invisibleSeries.Contains(rowSeries)) {
rowSeries.Points.Clear();
foreach (IndexedItem<double> item in e.Items) {
if (IsInvalidValue(item.Value))
rowSeries.Points[item.Index].IsEmpty = true;
else {
rowSeries.Points[item.Index].YValues = new double[] { item.Value };
rowSeries.Points[item.Index].IsEmpty = false;
}
}
FillSeriesWithRowValues(rowSeries, row);
UpdateYCursorInterval();
}
UpdateYCursorInterval();
}
}
}
Expand Down Expand Up @@ -412,13 +403,13 @@ private void ToggleSeriesVisible(Series series) {
private void FillSeriesWithRowValues(Series series, DataRow row) {
for (int i = 0; i < row.Values.Count; i++) {
var value = row.Values[i];
if (IsInvalidValue(value)) {
DataPoint point = new DataPoint();
DataPoint point = new DataPoint();
point.XValue = row.VisualProperties.StartIndexZero ? i : i + 1;
if (IsInvalidValue(value))
point.IsEmpty = true;
series.Points.Add(point);
} else {
series.Points.Add(value);
}
else
point.YValues = new double[] { value };
series.Points.Add(point);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public override IOperation Apply() {
results.Add(new Result("Alleles", allelesTable));

allelesTable.Rows.Add(new DataRow("Unique Alleles"));
allelesTable.Rows["Unique Alleles"].VisualProperties.StartIndexZero = true;

allelesTable.Rows.Add(new DataRow("Unique Alleles of Best Known Solution", null));
allelesTable.Rows["Unique Alleles of Best Known Solution"].VisualProperties.SecondYAxis = true;
Expand Down

0 comments on commit 31b8059

Please sign in to comment.