1
0
Fork 0
arangodb/html/admin/js/views/graphView.js

56 lines
1.0 KiB
JavaScript

window.graphView = Backbone.View.extend({
el: '#content',
template: new EJS({url: 'js/templates/graphView.ejs'}),
initialize: function () {
var self = this;
},
events: {
"click #createViewer" : "createViewer"
},
createViewer: function() {
var ecol,
ncol,
aaconfig,
undirected,
label,
config;
ecol = $("#edgeCollection").val();
ncol = $("#nodeCollection").val();
undirected = !!$("#undirected").attr("checked");
label = $("#nodeLabel").val();
aaconfig = {
type: "arango",
nodeCollection: ncol,
edgeCollection: ecol,
undirected: undirected
};
if (label !== undefined && label !== "") {
config = {
nodeShaper: {
label: label
}
}
}
$("#background").remove();
ui = new GraphViewerUI(document.getElementById("content"), aaconfig, 940, 680, config);
},
render: function() {
$(this.el).html(this.template.text);
return this;
}
});