diff --git a/html/admin/index.html b/html/admin/index.html index 981623bb86..ca9ea74b69 100644 --- a/html/admin/index.html +++ b/html/admin/index.html @@ -86,7 +86,6 @@ - diff --git a/html/admin/js/templates/graphView.ejs b/html/admin/js/templates/graphView.ejs index d974e2ef40..9b732c1ae3 100644 --- a/html/admin/js/templates/graphView.ejs +++ b/html/admin/js/templates/graphView.ejs @@ -57,6 +57,14 @@ console.log(ds, es);
+
+ +
+ +
+
+ +
diff --git a/html/admin/js/views/graphView.js b/html/admin/js/views/graphView.js index 2456650b27..67fd3a1696 100644 --- a/html/admin/js/views/graphView.js +++ b/html/admin/js/views/graphView.js @@ -20,13 +20,16 @@ window.graphView = Backbone.View.extend({ ncol, aaconfig, undirected, + randomStart, label, - config; + config, + ui; ecol = $("#edgeCollection").val(); ncol = $("#nodeCollection").val(); undirected = !!$("#undirected").attr("checked"); label = $("#nodeLabel").val(); + randomStart = !!$("#randomStart").attr("checked"); aaconfig = { type: "arango", @@ -44,7 +47,26 @@ window.graphView = Backbone.View.extend({ } $("#background").remove(); - var ui = new GraphViewerUI($("#content")[0], aaconfig, 940, 680, config); + if (randomStart) { + $.ajax({ + cache: false, + type: 'PUT', + url: '/_api/simple/any', + data: JSON.stringify({ + collection: ncol + }), + contentType: "application/json", + success: function(data) { + ui = new GraphViewerUI($("#content")[0], aaconfig, 940, 680, config, data.document._id); + } + }); + } else { + ui = new GraphViewerUI($("#content")[0], aaconfig, 940, 680, config); + } + + + + },