Skip to content

Commit

Permalink
Merge pull request flowhub#238 from kinimodmeyer/master
Browse files Browse the repository at this point in the history
adding get graph button to demo-simple.html
  • Loading branch information
Forrest Oliphant committed Jan 23, 2016
2 parents 2816117 + 5b6de0c commit 62a3a2e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions the-graph-editor/demo-simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<button id="addnode">add node</button>
<button id="addedge">add edge</button>
<button id="random">random graph</button>
<button id="get">get graph</button>
<button id="clear">clear</button>
</div>
<div id="loading" style="position:absolute; top:10px; left:10px; background-color:white; padding:10px; border-radius:5px;">
Expand Down Expand Up @@ -194,6 +195,13 @@
}, 500);
});

// Get graph button
document.getElementById("get").addEventListener("click", function () {
var graphJSON = JSON.stringify(editor.nofloGraph);
alert(graphJSON);
//you can use the var graphJSON to save the graph definition in a file/database
});

// Clear button
document.getElementById("clear").addEventListener("click", function () {
graph = {};
Expand Down

0 comments on commit 62a3a2e

Please sign in to comment.