Improved load GraphML graphs.

This commit is contained in:
Unick Soft
2020-03-02 21:05:17 +02:00
parent fa79baf2ea
commit fe4f14970b
4 changed files with 50 additions and 10 deletions

View File

@@ -866,11 +866,11 @@ Graph.prototype.LoadFromXML = function (xmlText, additionalData)
$nodes = $xml.find( "node" );
var vertexs = [];
$nodes.each(function(){
var vertex = new BaseVertex();
vertex.LoadFromXML($(this));
vertexs.push(vertex);
vertexs.push(vertex);
});
this.vertices = vertexs;
@@ -1030,3 +1030,14 @@ Graph.prototype.isMulti = function ()
{
return this.isMultiGraph;
}
Graph.prototype.isNeedReposition = function ()
{
var res = false;
for (var i = 0; i < this.vertices.length; i++)
{
res = res || this.vertices[i].IsUndefinedPosition();
}
return res;
}