convert_to_graph() public method

public convert_to_graph ( DataTable node_table, DataTable edge_table ) : Graph
node_table System.Data.DataTable
edge_table System.Data.DataTable
return Smrf.NodeXL.Core.Graph
Ejemplo n.º 1
0
 public Graph get_network(String NetWorkID, int option)
 {
     String edgeCol = setting.edgeCol;
     String vertexCol = setting.vertexCol;
     String vertex_sql = String.Format("SELECT DISTINCT {0} FROM networkvis.allinone ", vertexCol);
     DataTable vertex_table = mysql_query(vertex_sql);
     vertex_table.Columns.Add("ID", typeof(int));
     vertex_table.Columns[vertexCol].ColumnName = "NodeName";
     int i = 0;
     foreach (DataRow row in vertex_table.Rows)
     {
         row["ID"] = i++;
     }
     DataTable edge_table = GraphEdgeGen.EdgeGen(this, vertex_table, vertexCol, edgeCol);
    // export_to_db(vertex_table, NetWorkID, "nodes");
    // export_to_db(edge_table, NetWorkID, "edges");
    // /*Use setting to generate sql and get DataTable*/
     DB_Converter conv = new DB_Converter();
     return conv.convert_to_graph(vertex_table,edge_table);
 }
Ejemplo n.º 2
0
 public Graph get_network(String ID)
 {
     String edge_sql = String.Format("SELECT * FROM networkvis.edges WHERE NetworkID = \"{0}\"", ID);
     String vertex_sql = String.Format("SELECT * FROM networkvis.nodes WHERE NetworkID = \"{0}\"", ID);
     
     DataTable edge_table = mysql_query(edge_sql);
     DataTable vertex_table = mysql_query(vertex_sql);
     DB_Converter conv = new DB_Converter();
     return conv.convert_to_graph(vertex_table, edge_table);
     /*Get Group information from group table*/
     /*Call DB_Converter to generate graph */
 }