|
Hi,
I have been using NodeXLControl library in window application (c#).
We have very large dataset to be handle for drawing graph.
Following is the code we are using for drawing the graph
foreach (string Contact in Unique_Contacts)
{
IVertex verMainGraph = Overtices.Add();
verMainGraph.Name = Contact;
verMainGraph.SetValue(ReservedMetadataKeys.PerVertexLabel, Contact);
verMainGraph.SetValue(ReservedMetadataKeys.PerVertexToolTip, Contact);
verMainGraph.SetValue(ReservedMetadataKeys.Visibility, VisibilityKeyValue.Visible);
}
foreach (var Counts in CallCount)
{
IVertex EdgeVer1;
IVertex EdgeVer2;
nodeXLControl1.Graph.Vertices.Find(Counts.caller1.ToString(), out EdgeVer1);
nodeXLControl1.Graph.Vertices.Find(Counts.caller2.ToString(), out EdgeVer2);
IEdge edgeMainGraph = OEdges.Add(EdgeVer1, EdgeVer2);
edgeMainGraph.Name = Counts.count.ToString();
edgeMainGraph.SetValue(ReservedMetadataKeys.PerEdgeLabel, Counts.count.ToString());
edgeMainGraph.SetValue(ReservedMetadataKeys.PerEdgeLabelFontSize, 12F);
edgeMainGraph.SetValue(ReservedMetadataKeys.Visibility, VisibilityKeyValue.Visible);
edgeMainGraph.SetValue("MinDate", Counts.min);
edgeMainGraph.SetValue("MaxDate", Counts.max);
edgeMainGraph.SetValue("MinTime",Convert.ToDateTime("2012-01-01 " + Counts.minTime));
edgeMainGraph.SetValue("MaxTime", "2012-01-01 " + Counts.maxTime);
edgeMainGraph.SetValue("HideByDegree", "False");
}
Here we have following parameters
Total Vertices to be add = 87000 approx
Total Edges to be add = 75000 approx.
Now we are not drawing the graph at this level.
We are calling another function GetSubgraph which gives the subgraph vertices and edges to be drawn finally like this
public void GetSubGraph(string Vertex, string Level)
{
try
{
IVertex SubGraphVertex = null;
nodeXLControl1.Graph.Vertices.Find(Vertex, out SubGraphVertex);
SubGraphVertex.SetValue(ReservedMetadataKeys.PerVertexShape, VertexShape.SolidTaperedDiamond);
SubGraphVertex.SetValue(ReservedMetadataKeys.PerVertexRadius, 15F);
Dictionary<IVertex, int> SubGraphVertices = new Dictionary<IVertex, int>();
HashSet<IEdge> SubGraphEdges = new HashSet<IEdge>();
SubgraphCalculator.GetSubgraph(SubGraphVertex, Convert.ToDecimal(Level), true, out SubGraphVertices, out SubGraphEdges);
nodeXLControl1.Graph.Edges.Clear();
nodeXLControl1.Graph.Vertices.Clear();
IVertexCollection SubGraphvercol = nodeXLControl1.Graph.Vertices;
IEdgeCollection SubGraphedcol = nodeXLControl1.Graph.Edges;
foreach (KeyValuePair<IVertex, int> pair in SubGraphVertices)
{
SubGraphvercol.Add(pair.Key);
}
foreach (IEdge edge in SubGraphEdges)
{
SubGraphedcol.Add(edge);
}
nodeXLControl1.DrawGraph(true);
}
catch(Exception ex)
{
}
}
Here the parameters are
Total vertices that added are - 12000 approx
Total edges that added are - 15000 approx
After execution of NodeXLControl1.DrawGraph(true);
The process goes for endless execution.
My System configuration is
Intel Pentium Dual CPU
E2140 @ 1.60GHZ
4GB Of RAM
What could be the issue.
Does NodeXLControl does not handle such a large dataset ??
|