mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-02-16 10:40:57 +00:00
Added export/import graph
This commit is contained in:
@@ -857,6 +857,17 @@ Application.prototype.SaveFullGraphImageOnDisk = function (showDialogCallback)
|
||||
|
||||
|
||||
|
||||
Application.prototype.LoadGraphFromString = function (str)
|
||||
{
|
||||
var graph = new Graph();
|
||||
graph.LoadFromXML(str);
|
||||
this.SetDefaultTransformations();
|
||||
this.graph = graph;
|
||||
this.AutoAdjustViewport();
|
||||
this.updateMessage();
|
||||
this.redrawGraph();
|
||||
}
|
||||
|
||||
Application.prototype.LoadGraphFromDisk = function (graphName)
|
||||
{
|
||||
var app = this;
|
||||
@@ -867,13 +878,7 @@ Application.prototype.LoadGraphFromDisk = function (graphName)
|
||||
})
|
||||
.done(function( msg )
|
||||
{
|
||||
var graph = new Graph();
|
||||
graph.LoadFromXML(msg);
|
||||
app.SetDefaultTransformations();
|
||||
app.graph = graph;
|
||||
app.AutoAdjustViewport();
|
||||
app.updateMessage();
|
||||
app.redrawGraph();
|
||||
app.LoadGraphFromString(msg);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user