mirror of https://gitee.com/bigwinds/arangodb
GraphViewer: It is now possible to start with a random node
This commit is contained in:
parent
3ab4c039bb
commit
3d349200d3
|
@ -86,7 +86,6 @@
|
|||
<script src="js/lib/nv.d3.js"></script>
|
||||
<script src="js/lib/d3.fisheye.js"></script>
|
||||
|
||||
|
||||
<script src="js/lib/ColVis.js"></script>
|
||||
<script src="js/lib/ejs_fulljslint.js"></script>
|
||||
<script src="js/lib/ejs_0.9_alpha_1_production.js"></script>
|
||||
|
|
|
@ -57,6 +57,14 @@ console.log(ds, es);
|
|||
<div id="advancedOptions" class="accordion-body collapse out">
|
||||
<div class="accordion-inner">
|
||||
|
||||
<div class="control-group">
|
||||
<label for="randomStart" class="control-label">Start with Random Node</label>
|
||||
<div class="controls">
|
||||
<input id="randomStart" type="checkbox" name="randomStart" class="input-xlarge">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<label for="nodeLabel" class="control-label">Node Label</label>
|
||||
<div class="controls">
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue