Beispiel #1
0
        private void orderVis_Click(object sender, EventArgs e)
        {
            List <List <string> > clusterList = new List <List <string> >();
            List <int[]>          colorMap    = new List <int[]>();

            int[] tab = new int[4];
            tab[0] = 0; tab[1] = 65; tab[2] = 150; tab[3] = 235;

            for (int i = 0; i < tab.Length; i++)
            {
                for (int j = 0; j < tab.Length; j++)
                {
                    for (int n = 0; n < tab.Length; n++)
                    {
                        int[] aux = new int[3];
                        aux[0] = tab[i];
                        aux[1] = tab[j];
                        aux[2] = tab[n];

                        colorMap.Add(aux);
                    }
                }
            }
            int                 counter      = 0;
            List <Color>        clusterColor = new List <Color>();
            List <HClusterNode> hk           = new List <HClusterNode>(listNodes.Keys);
            VisOrder            visFrame     = null;

            if (hk.Count < colorMap.Count)
            {
                for (int i = 0; i < hk.Count; i++)
                {
                    clusterList.Add(hk[i].setStruct);
                    if (listNodes.Count < colorMap.Count)
                    {
                        Color r = Color.FromArgb(colorMap[counter][0], colorMap[counter][1], colorMap[counter][2]);
                        listNodes[hk[i]] = r;
                        clusterColor.Add(r);
                    }
                    counter += colorMap.Count / (hk.Count + 10);
                }
                visFrame = new VisOrder(clusterList, null, clusterColor);
            }
            else
            {
                for (int i = 0; i < hk.Count; i++)
                {
                    clusterList.Add(hk[i].setStruct);
                }
                visFrame = new VisOrder(clusterList, null, null);
            }
            visFrame.Show();
            this.Invalidate();
            this.Refresh();
        }
Beispiel #2
0
        private void orderVis_Click(object sender, EventArgs e)
        {
            List<List<string>> clusterList=new List<List<string>>();
            List<int[]> colorMap = new List<int[]>();
            int[] tab = new int[4];
            tab[0] = 0; tab[1] = 65; tab[2] = 150; tab[3] = 235;

            for (int i = 0; i < tab.Length; i++)
                for (int j = 0; j < tab.Length; j++)
                    for (int n = 0; n < tab.Length; n++)
                    {
                        int[] aux = new int[3];
                        aux[0] = tab[i];
                        aux[1] = tab[j];
                        aux[2] = tab[n];

                        colorMap.Add(aux);
                    }
            int counter=0;
            List<Color> clusterColor = new List<Color>();
            List<HClusterNode> hk=new List<HClusterNode>(listNodes.Keys);
             VisOrder visFrame =null;
             if (hk.Count < colorMap.Count)
             {
                 for (int i = 0; i < hk.Count; i++)
                 {
                     clusterList.Add(hk[i].setStruct);
                     if (listNodes.Count < colorMap.Count)
                     {
                         Color r = Color.FromArgb(colorMap[counter][0], colorMap[counter][1], colorMap[counter][2]);
                         listNodes[hk[i]] = r;
                         clusterColor.Add(r);
                     }
                     counter += colorMap.Count / (hk.Count+10);
                 }
                 visFrame = new VisOrder(clusterList, null, clusterColor);
             }
             else
             {
                 for (int i = 0; i < hk.Count; i++)
                     clusterList.Add(hk[i].setStruct);
                 visFrame = new VisOrder(clusterList, null, null);
             }
            visFrame.Show();
            this.Invalidate();
            this.Refresh();
        }
Beispiel #3
0
        public void SClusters(string item, string measureName, string option)
        {
            Dictionary <string, string> dic = ClusterOutput.ReadLabelsFile(output.GetLabelFile());

            if (output.clusters != null)
            {
                switch (option)
                {
                case "Order Visual":
                    if (active == null || !(active is VisOrder))
                    {
                        VisOrder visOrder;
                        visOrder           = new VisOrder(output.clusters, item, null);
                        visOrder.closeForm = Closing;
                        active             = visOrder;
                        visOrder.Show();
                    }
                    return;

                case "Text List":
                default:
                    if (active == null || !(active is ListVisual))
                    {
                        ListVisual visBaker;
                        visBaker           = new ListVisual(output.clusters, item, dic);
                        visBaker.closeForm = Closing;
                        active             = visBaker;
                        visBaker.Show();
                    }
                    return;
                }
            }
            if (output.hNode != null)
            {
                // win = new visHierar(output.hNode,item,measureName);
                if (option == null)
                {
                    return;
                }
                switch (option)
                {
                case "Dendrogram":
                default:
                    if (active == null || !(active is visHierar))
                    {
                        visHierar winH;
                        winH           = new visHierar(output.hNode, item, measureName, dic);
                        winH.closeForm = Closing;
                        active         = winH;
                        winH.Show();
                    }
                    return;

                case "Sunburst chart":
                    if (active == null || !(active is VisHierarCircle))
                    {
                        VisHierarCircle winC;
                        winC           = new VisHierarCircle(output.hNode, item, measureName);
                        winC.closeForm = Closing;
                        active         = winC;
                        winC.Show();
                    }
                    return;
                }
            }
            if (output.juryLike != null || output.hNNRes != null)
            {
                if (active == null || !(active is FormText))
                {
                    FormText showRes;
                    if (output.juryLike != null)
                    {
                        showRes = new FormText(output.juryLike, item);
                    }
                    else
                    {
                        showRes = new FormText(output.hNNRes, item);
                    }
                    showRes.closeForm = Closing;
                    active            = showRes;
                    showRes.Show();
                }
                return;
            }
            if (output.nodes != null)
            {
                HeatMap heatRes = new HeatMap(output.nodes[1], output.nodes[0], null, output.measure, output.name);
                active = heatRes;
                heatRes.Show();
            }
        }
        public void SClusters(string item,string measureName,string option)
        {
            if (output.clusters != null)
            {
                switch(option)
                {
                    case "Order Visual":
                        if (active == null || !(active is VisOrder))
                        {
                            VisOrder visOrder;
                            visOrder = new VisOrder(output.clusters, item, null);
                            visOrder.closeForm = Closing;
                            active = visOrder;
                            visOrder.Show();
                        }
                        return;
                    case "Text List":
                        if (active == null || !(active is ListVisual))
                        {

                            ListVisual visBaker;
                            visBaker = new ListVisual(output.clusters, item);
                            visBaker.closeForm = Closing;
                            active = visBaker;
                            visBaker.Show();
                        }
                        return;
            }
             
            }
            if (output.hNode != null)
            {
               // win = new visHierar(output.hNode,item,measureName);
                if (option == null)
                    return;
                switch (option)
                {
                    case "Dendrogram":
                        if (active == null || !(active is visHierar))
                        {
                            visHierar winH;
                            winH = new visHierar(output.hNode, item, measureName);
                            winH.closeForm = Closing;
                            active = winH;
                            winH.Show();
                        }
                        return;                        
                    case "Circle Visual":
                        if (active == null || !(active is VisHierarCircle))
                        {

                            VisHierarCircle winC;
                            winC = new VisHierarCircle(output.hNode, item, measureName);
                            winC.closeForm = Closing;
                            active = winC;
                            winC.Show();
                        }
                        return;                        
                }


            }
            if (output.juryLike != null)
            {
                if (active == null || !(active is FormText))
                {

                    FormText showRes;
                    showRes = new FormText(output.juryLike, item);
                    showRes.closeForm = Closing;
                    active = showRes;
                    showRes.Show();
                }
                return;
            }

        }