public SplamModel(List <DataSeries> datas) { Series = new List <DataSeries>(datas); var colors = ColorConv.pickIsoCols(74.0f, Series.Count, .5f, (float)Math.PI); for (int i = 0; i < Series.Count; i++) { Series[i].Color = colors[i]; } SplatList = new List <SplatterModel>(); Iindex = new List <int>(); Jindex = new List <int>(); numDim = datas.First().ColumnNames.Count; dimNames = datas.First().ColumnNames; for (int i = 0; i < numDim - 1; i++) { for (int j = i + 1; j < numDim; j++) { var spm = new SplatterModel(Series, i, j, false); SplatList.Add(spm); Iindex.Add(i); Jindex.Add(j); } } }
public SplatterModel(List <DataSeries> datas, string dim0N, string dim1N, bool calcColors) { Groups = new Dictionary <string, ISeriesProjection>(); Series = new Dictionary <string, SeriesProjection>(); dim0Name = dim0N; dim1Name = dim1N; xmax = float.MinValue; xmin = float.MaxValue; ymax = float.MinValue; ymin = float.MaxValue; showAllPoints = true; for (int i = 0; i < datas.Count; i++) { SeriesProjection sp = new SeriesProjection(); sp.Init(datas[i], dim0Name, dim1Name); Series[datas[i].Name] = sp; xmax = Math.Max(xmax, sp.Xmax); xmin = Math.Min(xmin, sp.Xmin); ymax = Math.Max(ymax, sp.Ymax); ymin = Math.Min(ymin, sp.Ymin); } SeriesMemberships = new BindingList <SeriesMembership>(); int j = 0; foreach (var series in Series.Values) { SeriesMemberships.Add(new SeriesMembership(series, j)); j++; } NumberOfGroups = Math.Min(Series.Count, 8); if (NumberOfGroups == Series.Count && !calcColors) { GroupColors = Series.Values.Select(s => s.Color).ToList(); } else { GroupColors = ColorConv.pickIsoCols(74.0f, NumberOfGroups, .5f, (float)Math.PI); } SetGroupMembers(); SeriesMemberships.ListChanged += new ListChangedEventHandler(SeriesMemberships_ListChanged); }
public OneVsAllModel(List <List <DataSeries> > splats, string dim0, string dim1) { SplatList = new List <SplatterModel>(); Groups = new List <DataSeries>(); Others = new List <DataSeries>(); OthersName = splats[0][1].Name; var colors = ColorConv.pickIsoCols(74.0f, splats.Count, .5f, (float)Math.PI); OtherColor = Color.Beige; int i = 0; foreach (var datas in splats) { Groups.Add(datas[0]); Others.Add(datas[1]); datas[0].Color = colors[i]; datas[1].Color = OtherColor; var sm = new SplatterModel(datas, dim0, dim1, false); SplatList.Add(sm); i++; } }