public Form1() { InitializeComponent(); SuspendLayout(); Controls.Add(viewer); viewer.Dock = DockStyle.Fill; viewer.LayoutAlgorithmSettingsButtonVisible = false; ResumeLayout(); var tree = new PhyloTree(); var edge = (PhyloEdge)tree.AddEdge("a", "b"); //edge.Length = 0.8; edge = (PhyloEdge)tree.AddEdge("a", "c"); //edge.Length = 0.2; tree.AddEdge("c", "d"); tree.AddEdge("c", "e"); tree.AddEdge("c", "f"); tree.AddEdge("e", "0"); tree.AddEdge("e", "1"); tree.AddEdge("e", "2"); tree.AddEdge("a", "zippy->do, dah"); viewer.Graph = tree; }
void button1_Click(object sender, EventArgs e) { var tree = new PhyloTree(); var edge = (PhyloEdge) tree.AddEdge("a", "b"); //edge.Length = 0.8; edge = (PhyloEdge) tree.AddEdge("a", "c"); //edge.Length = 0.2; tree.AddEdge("c", "d"); tree.AddEdge("c", "e"); tree.AddEdge("c", "f"); tree.AddEdge("e", "0"); tree.AddEdge("e", "1"); tree.AddEdge("e", "2"); tree.AddEdge("a", "zippy ->do dah"); viewer.Graph = tree; }
static void TestPhylo() { var f = new Form2(false); var tree = new PhyloTree(); var edge = (PhyloEdge) tree.AddEdge("a", "b"); edge.Length = 1.0; edge = (PhyloEdge) tree.AddEdge("a", "c"); edge.Length = 1.0000001; edge = (PhyloEdge) tree.AddEdge("c", "d"); edge.Length = 2; edge = (PhyloEdge) tree.AddEdge("c", "e"); edge.Length = 3; edge = (PhyloEdge) tree.AddEdge("b", "f"); edge.Length = 3.5; edge = (PhyloEdge) tree.AddEdge("f", "l"); edge.Length = 3.5; edge = (PhyloEdge) tree.AddEdge("b", "g"); edge.Length = 4; tree.FindNode("a").Label.Text = ""; tree.FindNode("b").Label.Text = ""; tree.FindNode("c").Label.Text = ""; tree.FindNode("d").Label.Text = ""; f.GViewer.Graph = tree; f.ShowDialog(); }