mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
581ffee899
|
@ -13,7 +13,7 @@
|
|||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ staticBase }}/images/apple-touch-icon-precomposed-152.png">
|
||||
<link rel="shortcut icon" href="{{ staticBase }}/images/favicon.ico" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="https://www.arangodb.org/wp-content/themes/triagens/images/favicon.ico" type="image/x-icon">
|
||||
{% block head %}{% endblock %}
|
||||
{{ htmlSnippet("head:end")|default("") }}
|
||||
</head>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"bitwise": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"forin": true,
|
||||
"freeze": true,
|
||||
"immed": true,
|
||||
"laxbreak": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nonbsp": true,
|
||||
"nonew": true,
|
||||
"strict": true,
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"indent": 2,
|
||||
"maxlen": 120
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 140, sloppy: true, vars: true, white: true, plusplus: true, evil: true */
|
||||
/*global require, exports, module, SYS_CLUSTER_TEST, ArangoServerState, ArangoClusterComm, ArangoClusterInfo,
|
||||
UPGRADE_ARGS: true */
|
||||
/*jshint strict: false, unused: false */
|
||||
/*global require, SYS_CLUSTER_TEST, UPGRADE_ARGS: true,
|
||||
ArangoServerState, ArangoClusterComm, ArangoClusterInfo */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief cluster actions
|
||||
|
@ -34,8 +34,6 @@
|
|||
var actions = require("org/arangodb/actions");
|
||||
var cluster = require("org/arangodb/cluster");
|
||||
var internal = require("internal");
|
||||
var console = require("console");
|
||||
var fs = require("fs");
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 150, sloppy: true, vars: true, white: true, plusplus: true, stupid: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -162,7 +162,7 @@ function parseBodyForCreateCollection (req, res) {
|
|||
if (body.hasOwnProperty("distributeShardsLike") && cluster.isCoordinator()) {
|
||||
r.parameter.distributeShardsLike = body.distributeShardsLike || "";
|
||||
}
|
||||
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -28,7 +28,6 @@
|
|||
/// @author Copyright 2014, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var arangodb = require("org/arangodb");
|
||||
var actions = require("org/arangodb/actions");
|
||||
var configuration = require("org/arangodb/configuration");
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require, CURSOR, DELETE_CURSOR */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 150, sloppy: true, vars: true, white: true, plusplus: true, stupid: true */
|
||||
/*jshint strict: false */
|
||||
/*global require, ArangoAgency */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, evil: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require, module */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -155,7 +155,7 @@ actions.defineHttp({
|
|||
|
||||
callback: easyPostCallback({
|
||||
body: true,
|
||||
callback: function (body) {
|
||||
callback: function () {
|
||||
foxxManager.scanAppDirectory();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, stupid: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, evil: true */
|
||||
/*global require, exports, module, ArangoServerState */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief open actions
|
||||
|
@ -31,7 +31,6 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var actions = require("org/arangodb/actions");
|
||||
var console = require("console");
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, continue: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, white: true, plusplus: true, stupid: true */
|
||||
/*jshint strict: false */
|
||||
/*global require, CREATE_CURSOR */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
/*jslint indent: 2,
|
||||
nomen: true,
|
||||
maxlen: 100,
|
||||
sloppy: true,
|
||||
vars: true,
|
||||
white: true,
|
||||
plusplus: true,
|
||||
stupid: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, evil: true */
|
||||
/*global require, exports, module, ArangoServerState */
|
||||
/*jshint strict: false */
|
||||
/*global require, ArangoServerState */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief administration actions
|
||||
|
@ -179,8 +179,7 @@ actions.defineHttp({
|
|||
return;
|
||||
}
|
||||
|
||||
/*jslint node: true, stupid: true */
|
||||
internal.wal.flush(req.parameters.waitForSync === "true",
|
||||
internal.wal.flush(req.parameters.waitForSync === "true",
|
||||
req.parameters.waitForCollector === "true");
|
||||
actions.resultOk(req, res, actions.HTTP_OK);
|
||||
}
|
||||
|
@ -1014,6 +1013,7 @@ actions.defineHttp({
|
|||
prefix : false,
|
||||
|
||||
callback : function (req, res) {
|
||||
/*jshint evil: true */
|
||||
var body = req.requestBody;
|
||||
var result;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 180, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require, TRANSACTION */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -168,7 +168,14 @@ var actions = require("org/arangodb/actions");
|
|||
/// collections: {
|
||||
/// write : [ "products", "materials" ]
|
||||
/// },
|
||||
/// action: "function () { var db = require('internal').db; db.products.save({}); db.materials.save({}); return 'worked!'; }"
|
||||
/// action: (
|
||||
/// "function () {" +
|
||||
/// "var db = require('internal').db;" +
|
||||
/// "db.products.save({});" +
|
||||
/// "db.materials.save({});" +
|
||||
/// "return 'worked!';" +
|
||||
/// "}"
|
||||
/// )
|
||||
/// };
|
||||
///
|
||||
/// var response = logCurlRequest('POST', url, body);
|
||||
|
@ -190,7 +197,13 @@ var actions = require("org/arangodb/actions");
|
|||
/// collections: {
|
||||
/// write : "products"
|
||||
/// },
|
||||
/// action : "function () { var db = require('internal').db; db.products.save({ _key: 'abc'}); db.products.save({ _key: 'abc'}); }"
|
||||
/// action : (
|
||||
/// "function () {" +
|
||||
/// "var db = require('internal').db;" +
|
||||
/// "db.products.save({ _key: 'abc'});" +
|
||||
/// "db.products.save({ _key: 'abc'});" +
|
||||
/// "}"
|
||||
/// )
|
||||
/// };
|
||||
///
|
||||
/// var response = logCurlRequest('POST', url, body);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, evil: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -537,6 +537,7 @@ function notFound (req, res, code, message) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function post_api_traversal(req, res) {
|
||||
/*jshint evil: true */
|
||||
var json = actions.getJsonBody(req, res);
|
||||
|
||||
if (json === undefined) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint strict: false */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true, unparam: true */
|
||||
/*global require, applicationContext*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -427,7 +426,7 @@ controller.get("/query/result/download/:query", function(req, res) {
|
|||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
}
|
||||
|
||||
var decodeFunction = function (input) {
|
||||
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true, unparam: true */
|
||||
/*global require, applicationContext*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -154,7 +153,7 @@
|
|||
// only make these functions available in dispatcher mode!
|
||||
controller.post("/plan", startUp);
|
||||
controller.put("/plan", startUp);
|
||||
|
||||
|
||||
controller.put("/plan/credentials", function(req, res) {
|
||||
var body = req.body(),
|
||||
u = body.user,
|
||||
|
@ -202,7 +201,7 @@
|
|||
|
||||
controller.get("/upgrade", function(req, res) {
|
||||
//uname pswd
|
||||
|
||||
|
||||
var k = getStarter();
|
||||
var u = plans.getCredentials();
|
||||
var r = k.upgrade(u.name, u.passwd);
|
||||
|
@ -214,7 +213,7 @@
|
|||
plans.replaceRunInfo(r.runInfo);
|
||||
res.json("ok");
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
controller.get("/cleanup", function(req, res) {
|
||||
|
@ -259,7 +258,7 @@
|
|||
*
|
||||
* Returns a string containing the cluster type
|
||||
* Possible anwers:
|
||||
* - testSetup
|
||||
* - testSetup
|
||||
* - symmetricalSetup
|
||||
* - asymmetricalSetup
|
||||
*
|
||||
|
@ -308,7 +307,7 @@
|
|||
list = coords.getList(),
|
||||
diffList = diff.Coordinators(),
|
||||
didBeat = beats.didBeat();
|
||||
|
||||
|
||||
_.each(list, function(v, k) {
|
||||
v.name = k;
|
||||
resList.push(v);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
|
||||
/*global window, Backbone, console */
|
||||
(function() {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*global require, exports, Backbone, window */
|
||||
window.ClusterStatisticsCollection = Backbone.Collection.extend({
|
||||
model: window.Statistics,
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
"use strict";
|
||||
window.ClusterCollections = window.AutomaticRetryCollection.extend({
|
||||
model: window.ClusterCollection,
|
||||
|
||||
|
||||
updateUrl: function() {
|
||||
this.url = window.App.getNewRoute(this.dbname + "/Collections");
|
||||
},
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
|
||||
/*global window, Backbone, console */
|
||||
(function() {
|
||||
"use strict";
|
||||
window.ClusterCoordinators = window.AutomaticRetryCollection.extend({
|
||||
model: window.ClusterCoordinator,
|
||||
|
||||
|
||||
url: "/_admin/aardvark/cluster/Coordinators",
|
||||
|
||||
updateUrl: function() {
|
||||
|
@ -19,13 +18,13 @@
|
|||
switch (s) {
|
||||
case "ok":
|
||||
return "success";
|
||||
case "warning":
|
||||
case "warning":
|
||||
return "warning";
|
||||
case "critical":
|
||||
return "danger";
|
||||
case "missing":
|
||||
return "inactive";
|
||||
default:
|
||||
default:
|
||||
return "danger";
|
||||
}
|
||||
},
|
||||
|
@ -115,7 +114,7 @@
|
|||
res.status = to;
|
||||
};
|
||||
this.each(function(m) {
|
||||
res.plan++;
|
||||
res.plan++;
|
||||
switch (m.get("status")) {
|
||||
case "ok":
|
||||
res.having++;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
|
||||
|
@ -7,7 +6,7 @@
|
|||
window.ClusterDatabases = window.AutomaticRetryCollection.extend({
|
||||
|
||||
model: window.ClusterDatabase,
|
||||
|
||||
|
||||
url: "/_admin/aardvark/cluster/Databases",
|
||||
|
||||
updateUrl: function() {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
|
||||
/*global window, Backbone, _, console */
|
||||
(function() {
|
||||
|
||||
|
@ -7,7 +6,7 @@
|
|||
window.ClusterServers = window.AutomaticRetryCollection.extend({
|
||||
|
||||
model: window.ClusterServer,
|
||||
|
||||
|
||||
url: "/_admin/aardvark/cluster/DBServers",
|
||||
|
||||
updateUrl: function() {
|
||||
|
@ -22,17 +21,17 @@
|
|||
switch (s) {
|
||||
case "ok":
|
||||
return "success";
|
||||
case "warning":
|
||||
case "warning":
|
||||
return "warning";
|
||||
case "critical":
|
||||
return "danger";
|
||||
case "missing":
|
||||
return "inactive";
|
||||
default:
|
||||
default:
|
||||
return "danger";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getStatuses: function(cb) {
|
||||
if(!this.checkRetries()) {
|
||||
return;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
|
||||
|
@ -7,7 +6,7 @@
|
|||
window.ClusterShards = window.AutomaticRetryCollection.extend({
|
||||
|
||||
model: window.ClusterShard,
|
||||
|
||||
|
||||
updateUrl: function() {
|
||||
this.url = window.App.getNewRoute(
|
||||
this.dbname + "/" + this.colname + "/Shards"
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
"use strict";
|
||||
|
@ -26,6 +25,6 @@
|
|||
url: this.get("url")
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}());
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
"use strict";
|
||||
|
@ -25,6 +24,6 @@
|
|||
this.url = window.getNewRoute("Databases");
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
});
|
||||
}());
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global window, Backbone, $, _*/
|
||||
(function() {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
"use strict";
|
||||
|
@ -26,7 +25,7 @@
|
|||
status: this.get("status")
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}());
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global window, Backbone, $, _*/
|
||||
(function() {
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
|
||||
/*global window, $, Backbone, document, arangoCollectionModel,arangoHelper,
|
||||
arangoDatabase, btoa, _*/
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, */
|
||||
/*global window, $, Backbone, document */
|
||||
/*global window, $, Backbone, document */
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
|
||||
/*global window, $, Backbone, templateEngine, plannerTemplateEngine, alert */
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
|
||||
window.ClusterDownView = Backbone.View.extend({
|
||||
|
||||
el: "#content",
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
|
||||
/*global window, $, Backbone, templateEngine, plannerTemplateEngine, alert, _ */
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
|
||||
window.ClusterUnreachableView = Backbone.View.extend({
|
||||
|
||||
el: "#content",
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global require, exports, Backbone, EJS, $, flush, window, arangoHelper, nv, d3, localStorage*/
|
||||
/*global document, Dygraph, _,templateEngine */
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
|
||||
/*global templateEngine, window, $, Backbone, plannerTemplateEngine, alert */
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
|
||||
window.LoginModalView = Backbone.View.extend({
|
||||
|
||||
template: templateEngine.createTemplate("loginModal.ejs"),
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
|
||||
/*global Backbone, $, _, window, templateEngine */
|
||||
(function() {
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
|
||||
/*global window, btoa, $, Backbone, templateEngine, alert, _ */
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
|
||||
window.PlanSymmetricView = Backbone.View.extend({
|
||||
el: "#content",
|
||||
template: templateEngine.createTemplate("symmetricPlan.ejs"),
|
||||
|
@ -36,8 +35,7 @@
|
|||
var data = {dispatchers: []};
|
||||
var foundCoordinator = false;
|
||||
var foundDBServer = false;
|
||||
/*jslint unparam: true*/
|
||||
data.useSSLonDBservers = !!$(".useSSLonDBservers").prop('checked');
|
||||
data.useSSLonDBservers = !!$(".useSSLonDBservers").prop('checked');
|
||||
data.useSSLonCoordinators = !!$(".useSSLonCoordinators").prop('checked');
|
||||
$(".dispatcher").each(function(i, dispatcher) {
|
||||
var host = $(".host", dispatcher).val();
|
||||
|
@ -64,8 +62,7 @@
|
|||
|
||||
data.dispatchers.push(hostObject);
|
||||
});
|
||||
/*jslint unparam: false*/
|
||||
if (!self.isSymmetric) {
|
||||
if (!self.isSymmetric) {
|
||||
if (!foundDBServer) {
|
||||
alert("Please provide at least one database server");
|
||||
return;
|
||||
|
@ -87,8 +84,7 @@
|
|||
$('.modal-backdrop.fade.in').addClass('waitModalBackdrop');
|
||||
$('#waitModalMessage').html('Please be patient while your cluster is being launched');
|
||||
delete window.App.clusterPlan._coord;
|
||||
/*jslint unparam: true*/
|
||||
window.App.clusterPlan.save(
|
||||
window.App.clusterPlan.save(
|
||||
data,
|
||||
{
|
||||
success : function() {
|
||||
|
@ -104,8 +100,7 @@
|
|||
}
|
||||
}
|
||||
);
|
||||
/*jslint unparam: false*/
|
||||
},
|
||||
},
|
||||
|
||||
addEntry: function() {
|
||||
//disable launch button
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
|
||||
/*global window, $, Backbone, templateEngine, alert */
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
|
||||
window.PlanTestView = Backbone.View.extend({
|
||||
|
||||
el: "#content",
|
||||
|
@ -87,7 +86,7 @@
|
|||
param.dbs = 3;
|
||||
param.coords = 2;
|
||||
param.hostname = window.location.hostname;
|
||||
param.port = window.location.port;
|
||||
param.port = window.location.port;
|
||||
}
|
||||
$(this.el).html(this.template.render(param));
|
||||
$(this.el).append(this.modal.render({}));
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true, continue: true */
|
||||
/*global window, $, Backbone, templateEngine, alert, _, d3, Dygraph, document */
|
||||
|
||||
(function() {
|
||||
|
@ -366,7 +365,7 @@
|
|||
var cbCounter = statCollect.size();
|
||||
|
||||
this.data = [];
|
||||
|
||||
|
||||
var successCB = function(m) {
|
||||
cbCounter--;
|
||||
var time = m.get("time");
|
||||
|
@ -421,8 +420,7 @@
|
|||
.data(pie(dataset))
|
||||
.enter().append("g")
|
||||
.attr("class", "slice");
|
||||
/*jslint unparam: true*/
|
||||
slices.append("path")
|
||||
slices.append("path")
|
||||
.attr("d", arc)
|
||||
.style("fill", function (item, i) {
|
||||
return color[i % color.length];
|
||||
|
@ -430,8 +428,7 @@
|
|||
.style("stroke", function (item, i) {
|
||||
return color[i % color.length];
|
||||
});
|
||||
/*jslint unparam: false*/
|
||||
slices.append("text")
|
||||
slices.append("text")
|
||||
.attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; })
|
||||
// .attr("dy", "0.35em")
|
||||
.style("text-anchor", "middle")
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
|
||||
/*global window, $, Backbone, templateEngine, _, alert */
|
||||
|
||||
(function() {
|
||||
|
@ -53,7 +52,7 @@
|
|||
shardIcon = $(shardIcon);
|
||||
shardIcon.toggleClass("fa");
|
||||
shardIcon.toggleClass("fa-th");
|
||||
item.append(shardIcon);
|
||||
item.append(shardIcon);
|
||||
});
|
||||
*/
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global Backbone, templateEngine, $, window*/
|
||||
(function () {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*jshint unused: false */
|
||||
/*global window, $, document */
|
||||
|
||||
(function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
|
||||
/*jshint unused: false */
|
||||
/*global EJS, window, _, $*/
|
||||
(function() {
|
||||
"use strict";
|
||||
|
@ -14,5 +14,5 @@
|
|||
};
|
||||
return exports;
|
||||
};
|
||||
window.templateEngine = new TemplateEngine();
|
||||
window.templateEngine = new TemplateEngine();
|
||||
}());
|
||||
|
|
|
@ -1,10 +1,3 @@
|
|||
/*jslint indent: 2,
|
||||
nomen: true,
|
||||
maxlen: 240,
|
||||
sloppy: true,
|
||||
vars: true,
|
||||
white: true,
|
||||
plusplus: true */
|
||||
/*global require */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -15,246 +8,246 @@
|
|||
var internal = require("internal");
|
||||
|
||||
internal.errors = {
|
||||
"ERROR_NO_ERROR" : { "code" : 0, "message" : "no error" },
|
||||
"ERROR_FAILED" : { "code" : 1, "message" : "failed" },
|
||||
"ERROR_SYS_ERROR" : { "code" : 2, "message" : "system error" },
|
||||
"ERROR_OUT_OF_MEMORY" : { "code" : 3, "message" : "out of memory" },
|
||||
"ERROR_INTERNAL" : { "code" : 4, "message" : "internal error" },
|
||||
"ERROR_ILLEGAL_NUMBER" : { "code" : 5, "message" : "illegal number" },
|
||||
"ERROR_NUMERIC_OVERFLOW" : { "code" : 6, "message" : "numeric overflow" },
|
||||
"ERROR_ILLEGAL_OPTION" : { "code" : 7, "message" : "illegal option" },
|
||||
"ERROR_DEAD_PID" : { "code" : 8, "message" : "dead process identifier" },
|
||||
"ERROR_NOT_IMPLEMENTED" : { "code" : 9, "message" : "not implemented" },
|
||||
"ERROR_BAD_PARAMETER" : { "code" : 10, "message" : "bad parameter" },
|
||||
"ERROR_FORBIDDEN" : { "code" : 11, "message" : "forbidden" },
|
||||
"ERROR_OUT_OF_MEMORY_MMAP" : { "code" : 12, "message" : "out of memory in mmap" },
|
||||
"ERROR_CORRUPTED_CSV" : { "code" : 13, "message" : "csv is corrupt" },
|
||||
"ERROR_FILE_NOT_FOUND" : { "code" : 14, "message" : "file not found" },
|
||||
"ERROR_CANNOT_WRITE_FILE" : { "code" : 15, "message" : "cannot write file" },
|
||||
"ERROR_CANNOT_OVERWRITE_FILE" : { "code" : 16, "message" : "cannot overwrite file" },
|
||||
"ERROR_TYPE_ERROR" : { "code" : 17, "message" : "type error" },
|
||||
"ERROR_LOCK_TIMEOUT" : { "code" : 18, "message" : "lock timeout" },
|
||||
"ERROR_CANNOT_CREATE_DIRECTORY" : { "code" : 19, "message" : "cannot create directory" },
|
||||
"ERROR_CANNOT_CREATE_TEMP_FILE" : { "code" : 20, "message" : "cannot create temporary file" },
|
||||
"ERROR_REQUEST_CANCELED" : { "code" : 21, "message" : "canceled request" },
|
||||
"ERROR_DEBUG" : { "code" : 22, "message" : "intentional debug error" },
|
||||
"ERROR_AID_NOT_FOUND" : { "code" : 23, "message" : "internal error with attribute ID in shaper" },
|
||||
"ERROR_LEGEND_INCOMPLETE" : { "code" : 24, "message" : "internal error if a legend could not be created" },
|
||||
"ERROR_IP_ADDRESS_INVALID" : { "code" : 25, "message" : "IP address is invalid" },
|
||||
"ERROR_LEGEND_NOT_IN_WAL_FILE" : { "code" : 26, "message" : "internal error if a legend for a marker does not yet exist in the same WAL file" },
|
||||
"ERROR_HTTP_BAD_PARAMETER" : { "code" : 400, "message" : "bad parameter" },
|
||||
"ERROR_HTTP_UNAUTHORIZED" : { "code" : 401, "message" : "unauthorized" },
|
||||
"ERROR_HTTP_FORBIDDEN" : { "code" : 403, "message" : "forbidden" },
|
||||
"ERROR_HTTP_NOT_FOUND" : { "code" : 404, "message" : "not found" },
|
||||
"ERROR_HTTP_METHOD_NOT_ALLOWED" : { "code" : 405, "message" : "method not supported" },
|
||||
"ERROR_HTTP_PRECONDITION_FAILED" : { "code" : 412, "message" : "precondition failed" },
|
||||
"ERROR_HTTP_SERVER_ERROR" : { "code" : 500, "message" : "internal server error" },
|
||||
"ERROR_HTTP_CORRUPTED_JSON" : { "code" : 600, "message" : "invalid JSON object" },
|
||||
"ERROR_HTTP_SUPERFLUOUS_SUFFICES" : { "code" : 601, "message" : "superfluous URL suffices" },
|
||||
"ERROR_ARANGO_ILLEGAL_STATE" : { "code" : 1000, "message" : "illegal state" },
|
||||
"ERROR_ARANGO_SHAPER_FAILED" : { "code" : 1001, "message" : "could not shape document" },
|
||||
"ERROR_ARANGO_DATAFILE_SEALED" : { "code" : 1002, "message" : "datafile sealed" },
|
||||
"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE" : { "code" : 1003, "message" : "unknown type" },
|
||||
"ERROR_ARANGO_READ_ONLY" : { "code" : 1004, "message" : "read only" },
|
||||
"ERROR_ARANGO_DUPLICATE_IDENTIFIER" : { "code" : 1005, "message" : "duplicate identifier" },
|
||||
"ERROR_ARANGO_DATAFILE_UNREADABLE" : { "code" : 1006, "message" : "datafile unreadable" },
|
||||
"ERROR_ARANGO_DATAFILE_EMPTY" : { "code" : 1007, "message" : "datafile empty" },
|
||||
"ERROR_ARANGO_RECOVERY" : { "code" : 1008, "message" : "logfile recovery error" },
|
||||
"ERROR_ARANGO_CORRUPTED_DATAFILE" : { "code" : 1100, "message" : "corrupted datafile" },
|
||||
"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE" : { "code" : 1101, "message" : "illegal parameter file" },
|
||||
"ERROR_ARANGO_CORRUPTED_COLLECTION" : { "code" : 1102, "message" : "corrupted collection" },
|
||||
"ERROR_ARANGO_MMAP_FAILED" : { "code" : 1103, "message" : "mmap failed" },
|
||||
"ERROR_ARANGO_FILESYSTEM_FULL" : { "code" : 1104, "message" : "filesystem full" },
|
||||
"ERROR_ARANGO_NO_JOURNAL" : { "code" : 1105, "message" : "no journal" },
|
||||
"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS" : { "code" : 1106, "message" : "cannot create/rename datafile because it already exists" },
|
||||
"ERROR_ARANGO_DATADIR_LOCKED" : { "code" : 1107, "message" : "database directory is locked" },
|
||||
"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS" : { "code" : 1108, "message" : "cannot create/rename collection because directory already exists" },
|
||||
"ERROR_ARANGO_MSYNC_FAILED" : { "code" : 1109, "message" : "msync failed" },
|
||||
"ERROR_ARANGO_DATADIR_UNLOCKABLE" : { "code" : 1110, "message" : "cannot lock database directory" },
|
||||
"ERROR_ARANGO_SYNC_TIMEOUT" : { "code" : 1111, "message" : "sync timeout" },
|
||||
"ERROR_ARANGO_CONFLICT" : { "code" : 1200, "message" : "conflict" },
|
||||
"ERROR_ARANGO_DATADIR_INVALID" : { "code" : 1201, "message" : "invalid database directory" },
|
||||
"ERROR_ARANGO_DOCUMENT_NOT_FOUND" : { "code" : 1202, "message" : "document not found" },
|
||||
"ERROR_ARANGO_COLLECTION_NOT_FOUND" : { "code" : 1203, "message" : "collection not found" },
|
||||
"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING" : { "code" : 1204, "message" : "parameter 'collection' not found" },
|
||||
"ERROR_ARANGO_DOCUMENT_HANDLE_BAD" : { "code" : 1205, "message" : "illegal document handle" },
|
||||
"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL" : { "code" : 1206, "message" : "maximal size of journal too small" },
|
||||
"ERROR_ARANGO_DUPLICATE_NAME" : { "code" : 1207, "message" : "duplicate name" },
|
||||
"ERROR_ARANGO_ILLEGAL_NAME" : { "code" : 1208, "message" : "illegal name" },
|
||||
"ERROR_ARANGO_NO_INDEX" : { "code" : 1209, "message" : "no suitable index known" },
|
||||
"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED" : { "code" : 1210, "message" : "unique constraint violated" },
|
||||
"ERROR_ARANGO_GEO_INDEX_VIOLATED" : { "code" : 1211, "message" : "geo index violated" },
|
||||
"ERROR_ARANGO_INDEX_NOT_FOUND" : { "code" : 1212, "message" : "index not found" },
|
||||
"ERROR_ARANGO_CROSS_COLLECTION_REQUEST" : { "code" : 1213, "message" : "cross collection request not allowed" },
|
||||
"ERROR_ARANGO_INDEX_HANDLE_BAD" : { "code" : 1214, "message" : "illegal index handle" },
|
||||
"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED" : { "code" : 1215, "message" : "cap constraint already defined" },
|
||||
"ERROR_ARANGO_DOCUMENT_TOO_LARGE" : { "code" : 1216, "message" : "document too large" },
|
||||
"ERROR_ARANGO_COLLECTION_NOT_UNLOADED" : { "code" : 1217, "message" : "collection must be unloaded" },
|
||||
"ERROR_ARANGO_COLLECTION_TYPE_INVALID" : { "code" : 1218, "message" : "collection type invalid" },
|
||||
"ERROR_ARANGO_VALIDATION_FAILED" : { "code" : 1219, "message" : "validator failed" },
|
||||
"ERROR_ARANGO_PARSER_FAILED" : { "code" : 1220, "message" : "parser failed" },
|
||||
"ERROR_ARANGO_DOCUMENT_KEY_BAD" : { "code" : 1221, "message" : "illegal document key" },
|
||||
"ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED" : { "code" : 1222, "message" : "unexpected document key" },
|
||||
"ERROR_ARANGO_DATADIR_NOT_WRITABLE" : { "code" : 1224, "message" : "server database directory not writable" },
|
||||
"ERROR_ARANGO_OUT_OF_KEYS" : { "code" : 1225, "message" : "out of keys" },
|
||||
"ERROR_ARANGO_DOCUMENT_KEY_MISSING" : { "code" : 1226, "message" : "missing document key" },
|
||||
"ERROR_ARANGO_DOCUMENT_TYPE_INVALID" : { "code" : 1227, "message" : "invalid document type" },
|
||||
"ERROR_ARANGO_DATABASE_NOT_FOUND" : { "code" : 1228, "message" : "database not found" },
|
||||
"ERROR_ARANGO_DATABASE_NAME_INVALID" : { "code" : 1229, "message" : "database name invalid" },
|
||||
"ERROR_ARANGO_USE_SYSTEM_DATABASE" : { "code" : 1230, "message" : "operation only allowed in system database" },
|
||||
"ERROR_ARANGO_ENDPOINT_NOT_FOUND" : { "code" : 1231, "message" : "endpoint not found" },
|
||||
"ERROR_ARANGO_INVALID_KEY_GENERATOR" : { "code" : 1232, "message" : "invalid key generator" },
|
||||
"ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE" : { "code" : 1233, "message" : "edge attribute missing" },
|
||||
"ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING" : { "code" : 1234, "message" : "index insertion warning - attribute missing in document" },
|
||||
"ERROR_ARANGO_INDEX_CREATION_FAILED" : { "code" : 1235, "message" : "index creation failed" },
|
||||
"ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT" : { "code" : 1236, "message" : "write-throttling timeout" },
|
||||
"ERROR_ARANGO_DATAFILE_FULL" : { "code" : 1300, "message" : "datafile full" },
|
||||
"ERROR_ARANGO_EMPTY_DATADIR" : { "code" : 1301, "message" : "server database directory is empty" },
|
||||
"ERROR_REPLICATION_NO_RESPONSE" : { "code" : 1400, "message" : "no response" },
|
||||
"ERROR_REPLICATION_INVALID_RESPONSE" : { "code" : 1401, "message" : "invalid response" },
|
||||
"ERROR_REPLICATION_MASTER_ERROR" : { "code" : 1402, "message" : "master error" },
|
||||
"ERROR_REPLICATION_MASTER_INCOMPATIBLE" : { "code" : 1403, "message" : "master incompatible" },
|
||||
"ERROR_REPLICATION_MASTER_CHANGE" : { "code" : 1404, "message" : "master change" },
|
||||
"ERROR_REPLICATION_LOOP" : { "code" : 1405, "message" : "loop detected" },
|
||||
"ERROR_REPLICATION_UNEXPECTED_MARKER" : { "code" : 1406, "message" : "unexpected marker" },
|
||||
"ERROR_REPLICATION_INVALID_APPLIER_STATE" : { "code" : 1407, "message" : "invalid applier state" },
|
||||
"ERROR_REPLICATION_UNEXPECTED_TRANSACTION" : { "code" : 1408, "message" : "invalid transaction" },
|
||||
"ERROR_REPLICATION_INVALID_LOGGER_CONFIGURATION" : { "code" : 1409, "message" : "invalid replication logger configuration" },
|
||||
"ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION" : { "code" : 1410, "message" : "invalid replication applier configuration" },
|
||||
"ERROR_REPLICATION_RUNNING" : { "code" : 1411, "message" : "cannot change applier configuration while running" },
|
||||
"ERROR_REPLICATION_APPLIER_STOPPED" : { "code" : 1412, "message" : "replication stopped" },
|
||||
"ERROR_REPLICATION_NO_START_TICK" : { "code" : 1413, "message" : "no start tick" },
|
||||
"ERROR_CLUSTER_NO_AGENCY" : { "code" : 1450, "message" : "could not connect to agency" },
|
||||
"ERROR_CLUSTER_NO_COORDINATOR_HEADER" : { "code" : 1451, "message" : "missing coordinator header" },
|
||||
"ERROR_CLUSTER_COULD_NOT_LOCK_PLAN" : { "code" : 1452, "message" : "could not lock plan in agency" },
|
||||
"ERROR_CLUSTER_COLLECTION_ID_EXISTS" : { "code" : 1453, "message" : "collection ID already exists" },
|
||||
"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN" : { "code" : 1454, "message" : "could not create collection in plan" },
|
||||
"ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION" : { "code" : 1455, "message" : "could not read version in current in agency" },
|
||||
"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION" : { "code" : 1456, "message" : "could not create collection" },
|
||||
"ERROR_CLUSTER_TIMEOUT" : { "code" : 1457, "message" : "timeout in cluster operation" },
|
||||
"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN" : { "code" : 1458, "message" : "could not remove collection from plan" },
|
||||
"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT" : { "code" : 1459, "message" : "could not remove collection from current" },
|
||||
"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN" : { "code" : 1460, "message" : "could not create database in plan" },
|
||||
"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE" : { "code" : 1461, "message" : "could not create database" },
|
||||
"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN" : { "code" : 1462, "message" : "could not remove database from plan" },
|
||||
"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT" : { "code" : 1463, "message" : "could not remove database from current" },
|
||||
"ERROR_CLUSTER_SHARD_GONE" : { "code" : 1464, "message" : "no responsible shard found" },
|
||||
"ERROR_CLUSTER_CONNECTION_LOST" : { "code" : 1465, "message" : "cluster internal HTTP connection broken" },
|
||||
"ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY" : { "code" : 1466, "message" : "must not specify _key for this collection" },
|
||||
"ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS" : { "code" : 1467, "message" : "got contradicting answers from different shards" },
|
||||
"ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN" : { "code" : 1468, "message" : "not all sharding attributes given" },
|
||||
"ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES" : { "code" : 1469, "message" : "must not change the value of a shard key attribute" },
|
||||
"ERROR_CLUSTER_UNSUPPORTED" : { "code" : 1470, "message" : "unsupported operation or parameter" },
|
||||
"ERROR_CLUSTER_ONLY_ON_COORDINATOR" : { "code" : 1471, "message" : "this operation is only valid on a coordinator in a cluster" },
|
||||
"ERROR_CLUSTER_READING_PLAN_AGENCY" : { "code" : 1472, "message" : "error reading Plan in agency" },
|
||||
"ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION" : { "code" : 1473, "message" : "could not truncate collection" },
|
||||
"ERROR_QUERY_KILLED" : { "code" : 1500, "message" : "query killed" },
|
||||
"ERROR_QUERY_PARSE" : { "code" : 1501, "message" : "%s" },
|
||||
"ERROR_QUERY_EMPTY" : { "code" : 1502, "message" : "query is empty" },
|
||||
"ERROR_QUERY_SCRIPT" : { "code" : 1503, "message" : "runtime error '%s'" },
|
||||
"ERROR_QUERY_NUMBER_OUT_OF_RANGE" : { "code" : 1504, "message" : "number out of range" },
|
||||
"ERROR_QUERY_VARIABLE_NAME_INVALID" : { "code" : 1510, "message" : "variable name '%s' has an invalid format" },
|
||||
"ERROR_QUERY_VARIABLE_REDECLARED" : { "code" : 1511, "message" : "variable '%s' is assigned multiple times" },
|
||||
"ERROR_QUERY_VARIABLE_NAME_UNKNOWN" : { "code" : 1512, "message" : "unknown variable '%s'" },
|
||||
"ERROR_QUERY_COLLECTION_LOCK_FAILED" : { "code" : 1521, "message" : "unable to read-lock collection %s" },
|
||||
"ERROR_QUERY_TOO_MANY_COLLECTIONS" : { "code" : 1522, "message" : "too many collections" },
|
||||
"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED" : { "code" : 1530, "message" : "document attribute '%s' is assigned multiple times" },
|
||||
"ERROR_QUERY_FUNCTION_NAME_UNKNOWN" : { "code" : 1540, "message" : "usage of unknown function '%s()'" },
|
||||
"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH" : { "code" : 1541, "message" : "invalid number of arguments for function '%s()'" },
|
||||
"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH" : { "code" : 1542, "message" : "invalid argument type used in call to function '%s()'" },
|
||||
"ERROR_QUERY_INVALID_REGEX" : { "code" : 1543, "message" : "invalid regex argument value used in call to function '%s()'" },
|
||||
"ERROR_QUERY_BIND_PARAMETERS_INVALID" : { "code" : 1550, "message" : "invalid structure of bind parameters" },
|
||||
"ERROR_QUERY_BIND_PARAMETER_MISSING" : { "code" : 1551, "message" : "no value specified for declared bind parameter '%s'" },
|
||||
"ERROR_QUERY_BIND_PARAMETER_UNDECLARED" : { "code" : 1552, "message" : "bind parameter '%s' was not declared in the query" },
|
||||
"ERROR_QUERY_BIND_PARAMETER_TYPE" : { "code" : 1553, "message" : "bind parameter '%s' has an invalid value or type" },
|
||||
"ERROR_QUERY_INVALID_LOGICAL_VALUE" : { "code" : 1560, "message" : "invalid logical value" },
|
||||
"ERROR_QUERY_INVALID_ARITHMETIC_VALUE" : { "code" : 1561, "message" : "invalid arithmetic value" },
|
||||
"ERROR_QUERY_DIVISION_BY_ZERO" : { "code" : 1562, "message" : "division by zero" },
|
||||
"ERROR_QUERY_LIST_EXPECTED" : { "code" : 1563, "message" : "list expected" },
|
||||
"ERROR_QUERY_FAIL_CALLED" : { "code" : 1569, "message" : "FAIL(%s) called" },
|
||||
"ERROR_QUERY_GEO_INDEX_MISSING" : { "code" : 1570, "message" : "no suitable geo index found for geo restriction on '%s'" },
|
||||
"ERROR_QUERY_FULLTEXT_INDEX_MISSING" : { "code" : 1571, "message" : "no suitable fulltext index found for fulltext query on '%s'" },
|
||||
"ERROR_QUERY_INVALID_DATE_VALUE" : { "code" : 1572, "message" : "invalid date value" },
|
||||
"ERROR_QUERY_MULTI_MODIFY" : { "code" : 1573, "message" : "multi-modify query" },
|
||||
"ERROR_QUERY_MODIFY_IN_SUBQUERY" : { "code" : 1574, "message" : "modify operation in subquery" },
|
||||
"ERROR_QUERY_COMPILE_TIME_OPTIONS" : { "code" : 1575, "message" : "query options must be readable at query compile time" },
|
||||
"ERROR_QUERY_EXCEPTION_OPTIONS" : { "code" : 1576, "message" : "query options expected" },
|
||||
"ERROR_QUERY_FUNCTION_INVALID_NAME" : { "code" : 1580, "message" : "invalid user function name" },
|
||||
"ERROR_QUERY_FUNCTION_INVALID_CODE" : { "code" : 1581, "message" : "invalid user function code" },
|
||||
"ERROR_QUERY_FUNCTION_NOT_FOUND" : { "code" : 1582, "message" : "user function '%s()' not found" },
|
||||
"ERROR_CURSOR_NOT_FOUND" : { "code" : 1600, "message" : "cursor not found" },
|
||||
"ERROR_TRANSACTION_INTERNAL" : { "code" : 1650, "message" : "internal transaction error" },
|
||||
"ERROR_TRANSACTION_NESTED" : { "code" : 1651, "message" : "nested transactions detected" },
|
||||
"ERROR_TRANSACTION_UNREGISTERED_COLLECTION" : { "code" : 1652, "message" : "unregistered collection used in transaction" },
|
||||
"ERROR_TRANSACTION_DISALLOWED_OPERATION" : { "code" : 1653, "message" : "disallowed operation inside transaction" },
|
||||
"ERROR_TRANSACTION_ABORTED" : { "code" : 1654, "message" : "transaction aborted" },
|
||||
"ERROR_USER_INVALID_NAME" : { "code" : 1700, "message" : "invalid user name" },
|
||||
"ERROR_USER_INVALID_PASSWORD" : { "code" : 1701, "message" : "invalid password" },
|
||||
"ERROR_USER_DUPLICATE" : { "code" : 1702, "message" : "duplicate user" },
|
||||
"ERROR_USER_NOT_FOUND" : { "code" : 1703, "message" : "user not found" },
|
||||
"ERROR_USER_CHANGE_PASSWORD" : { "code" : 1704, "message" : "user must change his password" },
|
||||
"ERROR_APPLICATION_INVALID_NAME" : { "code" : 1750, "message" : "invalid application name" },
|
||||
"ERROR_APPLICATION_INVALID_MOUNT" : { "code" : 1751, "message" : "invalid mount" },
|
||||
"ERROR_APPLICATION_DOWNLOAD_FAILED" : { "code" : 1752, "message" : "application download failed" },
|
||||
"ERROR_APPLICATION_UPLOAD_FAILED" : { "code" : 1753, "message" : "application upload failed" },
|
||||
"ERROR_KEYVALUE_INVALID_KEY" : { "code" : 1800, "message" : "invalid key declaration" },
|
||||
"ERROR_KEYVALUE_KEY_EXISTS" : { "code" : 1801, "message" : "key already exists" },
|
||||
"ERROR_KEYVALUE_KEY_NOT_FOUND" : { "code" : 1802, "message" : "key not found" },
|
||||
"ERROR_KEYVALUE_KEY_NOT_UNIQUE" : { "code" : 1803, "message" : "key is not unique" },
|
||||
"ERROR_KEYVALUE_KEY_NOT_CHANGED" : { "code" : 1804, "message" : "key value not changed" },
|
||||
"ERROR_KEYVALUE_KEY_NOT_REMOVED" : { "code" : 1805, "message" : "key value not removed" },
|
||||
"ERROR_KEYVALUE_NO_VALUE" : { "code" : 1806, "message" : "missing value" },
|
||||
"ERROR_TASK_INVALID_ID" : { "code" : 1850, "message" : "invalid task id" },
|
||||
"ERROR_TASK_DUPLICATE_ID" : { "code" : 1851, "message" : "duplicate task id" },
|
||||
"ERROR_TASK_NOT_FOUND" : { "code" : 1852, "message" : "task not found" },
|
||||
"ERROR_GRAPH_INVALID_GRAPH" : { "code" : 1901, "message" : "invalid graph" },
|
||||
"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH" : { "code" : 1902, "message" : "could not create graph" },
|
||||
"ERROR_GRAPH_INVALID_VERTEX" : { "code" : 1903, "message" : "invalid vertex" },
|
||||
"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX" : { "code" : 1904, "message" : "could not create vertex" },
|
||||
"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX" : { "code" : 1905, "message" : "could not change vertex" },
|
||||
"ERROR_GRAPH_INVALID_EDGE" : { "code" : 1906, "message" : "invalid edge" },
|
||||
"ERROR_GRAPH_COULD_NOT_CREATE_EDGE" : { "code" : 1907, "message" : "could not create edge" },
|
||||
"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE" : { "code" : 1908, "message" : "could not change edge" },
|
||||
"ERROR_GRAPH_TOO_MANY_ITERATIONS" : { "code" : 1909, "message" : "too many iterations" },
|
||||
"ERROR_GRAPH_INVALID_FILTER_RESULT" : { "code" : 1910, "message" : "invalid filter result" },
|
||||
"ERROR_GRAPH_COLLECTION_MULTI_USE" : { "code" : 1920, "message" : "multi use of edge collection in edge def" },
|
||||
"ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS" : { "code" : 1921, "message" : "edge collection already used in edge def" },
|
||||
"ERROR_GRAPH_CREATE_MISSING_NAME" : { "code" : 1922, "message" : "missing graph name" },
|
||||
"ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION" : { "code" : 1923, "message" : "malformed edge def" },
|
||||
"ERROR_GRAPH_NOT_FOUND" : { "code" : 1924, "message" : "graph not found" },
|
||||
"ERROR_GRAPH_DUPLICATE" : { "code" : 1925, "message" : "graph already exists" },
|
||||
"ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST" : { "code" : 1926, "message" : "collection does not exist" },
|
||||
"ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX" : { "code" : 1927, "message" : "not a vertex collection" },
|
||||
"ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION" : { "code" : 1928, "message" : "not in orphan collection" },
|
||||
"ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF" : { "code" : 1929, "message" : "collection used in edge def" },
|
||||
"ERROR_GRAPH_EDGE_COLLECTION_NOT_USED" : { "code" : 1930, "message" : "edge collection not used in graph" },
|
||||
"ERROR_GRAPH_NO_AN_ARANGO_COLLECTION" : { "code" : 1931, "message" : " is not an ArangoCollection" },
|
||||
"ERROR_GRAPH_NO_GRAPH_COLLECTION" : { "code" : 1932, "message" : "collection _graphs does not exist" },
|
||||
"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING" : { "code" : 1933, "message" : "Invalid example type. Has to be String, Array or Object" },
|
||||
"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT" : { "code" : 1934, "message" : "Invalid example type. Has to be Array or Object" },
|
||||
"ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS" : { "code" : 1935, "message" : "Invalid number of arguments. Expected: " },
|
||||
"ERROR_GRAPH_INVALID_PARAMETER" : { "code" : 1936, "message" : "Invalid parameter type." },
|
||||
"ERROR_GRAPH_INVALID_ID" : { "code" : 1937, "message" : "Invalid id" },
|
||||
"ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS" : { "code" : 1938, "message" : "collection used in orphans" },
|
||||
"ERROR_SESSION_UNKNOWN" : { "code" : 1950, "message" : "unknown session" },
|
||||
"ERROR_SESSION_EXPIRED" : { "code" : 1951, "message" : "session expired" },
|
||||
"SIMPLE_CLIENT_UNKNOWN_ERROR" : { "code" : 2000, "message" : "unknown client error" },
|
||||
"SIMPLE_CLIENT_COULD_NOT_CONNECT" : { "code" : 2001, "message" : "could not connect to server" },
|
||||
"SIMPLE_CLIENT_COULD_NOT_WRITE" : { "code" : 2002, "message" : "could not write to server" },
|
||||
"SIMPLE_CLIENT_COULD_NOT_READ" : { "code" : 2003, "message" : "could not read from server" },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_UPDATE_ATTRIBUTE_MISSING" : { "code" : 3402, "message" : "bitarray index update warning - attribute missing in revised document" },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_REMOVE_ITEM_MISSING" : { "code" : 3411, "message" : "bitarray index remove failure - item missing in index" },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_INSERT_ITEM_UNSUPPORTED_VALUE" : { "code" : 3413, "message" : "bitarray index insert failure - document attribute value unsupported in index" },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_ATTRIBUTES" : { "code" : 3415, "message" : "bitarray index creation failure - one or more index attributes are duplicated." },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_VALUES" : { "code" : 3417, "message" : "bitarray index creation failure - one or more index attribute values are duplicated." },
|
||||
"RESULT_KEY_EXISTS" : { "code" : 10000, "message" : "element not inserted into structure, because key already exists" },
|
||||
"RESULT_ELEMENT_EXISTS" : { "code" : 10001, "message" : "element not inserted into structure, because it already exists" },
|
||||
"RESULT_KEY_NOT_FOUND" : { "code" : 10002, "message" : "key not found in structure" },
|
||||
"RESULT_ELEMENT_NOT_FOUND" : { "code" : 10003, "message" : "element not found in structure" },
|
||||
"ERROR_APP_ALREADY_EXISTS" : { "code" : 20000, "message" : "newest version of app already installed" },
|
||||
"ERROR_QUEUE_ALREADY_EXISTS" : { "code" : 21000, "message" : "named queue already exists" },
|
||||
"ERROR_DISPATCHER_IS_STOPPING" : { "code" : 21001, "message" : "dispatcher stopped" },
|
||||
"ERROR_QUEUE_UNKNOWN" : { "code" : 21002, "message" : "named queue does not exist" },
|
||||
"ERROR_NO_ERROR" : { "code" : 0, "message" : "no error" },
|
||||
"ERROR_FAILED" : { "code" : 1, "message" : "failed" },
|
||||
"ERROR_SYS_ERROR" : { "code" : 2, "message" : "system error" },
|
||||
"ERROR_OUT_OF_MEMORY" : { "code" : 3, "message" : "out of memory" },
|
||||
"ERROR_INTERNAL" : { "code" : 4, "message" : "internal error" },
|
||||
"ERROR_ILLEGAL_NUMBER" : { "code" : 5, "message" : "illegal number" },
|
||||
"ERROR_NUMERIC_OVERFLOW" : { "code" : 6, "message" : "numeric overflow" },
|
||||
"ERROR_ILLEGAL_OPTION" : { "code" : 7, "message" : "illegal option" },
|
||||
"ERROR_DEAD_PID" : { "code" : 8, "message" : "dead process identifier" },
|
||||
"ERROR_NOT_IMPLEMENTED" : { "code" : 9, "message" : "not implemented" },
|
||||
"ERROR_BAD_PARAMETER" : { "code" : 10, "message" : "bad parameter" },
|
||||
"ERROR_FORBIDDEN" : { "code" : 11, "message" : "forbidden" },
|
||||
"ERROR_OUT_OF_MEMORY_MMAP" : { "code" : 12, "message" : "out of memory in mmap" },
|
||||
"ERROR_CORRUPTED_CSV" : { "code" : 13, "message" : "csv is corrupt" },
|
||||
"ERROR_FILE_NOT_FOUND" : { "code" : 14, "message" : "file not found" },
|
||||
"ERROR_CANNOT_WRITE_FILE" : { "code" : 15, "message" : "cannot write file" },
|
||||
"ERROR_CANNOT_OVERWRITE_FILE" : { "code" : 16, "message" : "cannot overwrite file" },
|
||||
"ERROR_TYPE_ERROR" : { "code" : 17, "message" : "type error" },
|
||||
"ERROR_LOCK_TIMEOUT" : { "code" : 18, "message" : "lock timeout" },
|
||||
"ERROR_CANNOT_CREATE_DIRECTORY" : { "code" : 19, "message" : "cannot create directory" },
|
||||
"ERROR_CANNOT_CREATE_TEMP_FILE" : { "code" : 20, "message" : "cannot create temporary file" },
|
||||
"ERROR_REQUEST_CANCELED" : { "code" : 21, "message" : "canceled request" },
|
||||
"ERROR_DEBUG" : { "code" : 22, "message" : "intentional debug error" },
|
||||
"ERROR_AID_NOT_FOUND" : { "code" : 23, "message" : "internal error with attribute ID in shaper" },
|
||||
"ERROR_LEGEND_INCOMPLETE" : { "code" : 24, "message" : "internal error if a legend could not be created" },
|
||||
"ERROR_IP_ADDRESS_INVALID" : { "code" : 25, "message" : "IP address is invalid" },
|
||||
"ERROR_LEGEND_NOT_IN_WAL_FILE" : { "code" : 26, "message" : "internal error if a legend for a marker does not yet exist in the same WAL file" },
|
||||
"ERROR_HTTP_BAD_PARAMETER" : { "code" : 400, "message" : "bad parameter" },
|
||||
"ERROR_HTTP_UNAUTHORIZED" : { "code" : 401, "message" : "unauthorized" },
|
||||
"ERROR_HTTP_FORBIDDEN" : { "code" : 403, "message" : "forbidden" },
|
||||
"ERROR_HTTP_NOT_FOUND" : { "code" : 404, "message" : "not found" },
|
||||
"ERROR_HTTP_METHOD_NOT_ALLOWED" : { "code" : 405, "message" : "method not supported" },
|
||||
"ERROR_HTTP_PRECONDITION_FAILED" : { "code" : 412, "message" : "precondition failed" },
|
||||
"ERROR_HTTP_SERVER_ERROR" : { "code" : 500, "message" : "internal server error" },
|
||||
"ERROR_HTTP_CORRUPTED_JSON" : { "code" : 600, "message" : "invalid JSON object" },
|
||||
"ERROR_HTTP_SUPERFLUOUS_SUFFICES" : { "code" : 601, "message" : "superfluous URL suffices" },
|
||||
"ERROR_ARANGO_ILLEGAL_STATE" : { "code" : 1000, "message" : "illegal state" },
|
||||
"ERROR_ARANGO_SHAPER_FAILED" : { "code" : 1001, "message" : "could not shape document" },
|
||||
"ERROR_ARANGO_DATAFILE_SEALED" : { "code" : 1002, "message" : "datafile sealed" },
|
||||
"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE" : { "code" : 1003, "message" : "unknown type" },
|
||||
"ERROR_ARANGO_READ_ONLY" : { "code" : 1004, "message" : "read only" },
|
||||
"ERROR_ARANGO_DUPLICATE_IDENTIFIER" : { "code" : 1005, "message" : "duplicate identifier" },
|
||||
"ERROR_ARANGO_DATAFILE_UNREADABLE" : { "code" : 1006, "message" : "datafile unreadable" },
|
||||
"ERROR_ARANGO_DATAFILE_EMPTY" : { "code" : 1007, "message" : "datafile empty" },
|
||||
"ERROR_ARANGO_RECOVERY" : { "code" : 1008, "message" : "logfile recovery error" },
|
||||
"ERROR_ARANGO_CORRUPTED_DATAFILE" : { "code" : 1100, "message" : "corrupted datafile" },
|
||||
"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE" : { "code" : 1101, "message" : "illegal parameter file" },
|
||||
"ERROR_ARANGO_CORRUPTED_COLLECTION" : { "code" : 1102, "message" : "corrupted collection" },
|
||||
"ERROR_ARANGO_MMAP_FAILED" : { "code" : 1103, "message" : "mmap failed" },
|
||||
"ERROR_ARANGO_FILESYSTEM_FULL" : { "code" : 1104, "message" : "filesystem full" },
|
||||
"ERROR_ARANGO_NO_JOURNAL" : { "code" : 1105, "message" : "no journal" },
|
||||
"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS" : { "code" : 1106, "message" : "cannot create/rename datafile because it already exists" },
|
||||
"ERROR_ARANGO_DATADIR_LOCKED" : { "code" : 1107, "message" : "database directory is locked" },
|
||||
"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS" : { "code" : 1108, "message" : "cannot create/rename collection because directory already exists" },
|
||||
"ERROR_ARANGO_MSYNC_FAILED" : { "code" : 1109, "message" : "msync failed" },
|
||||
"ERROR_ARANGO_DATADIR_UNLOCKABLE" : { "code" : 1110, "message" : "cannot lock database directory" },
|
||||
"ERROR_ARANGO_SYNC_TIMEOUT" : { "code" : 1111, "message" : "sync timeout" },
|
||||
"ERROR_ARANGO_CONFLICT" : { "code" : 1200, "message" : "conflict" },
|
||||
"ERROR_ARANGO_DATADIR_INVALID" : { "code" : 1201, "message" : "invalid database directory" },
|
||||
"ERROR_ARANGO_DOCUMENT_NOT_FOUND" : { "code" : 1202, "message" : "document not found" },
|
||||
"ERROR_ARANGO_COLLECTION_NOT_FOUND" : { "code" : 1203, "message" : "collection not found" },
|
||||
"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING" : { "code" : 1204, "message" : "parameter 'collection' not found" },
|
||||
"ERROR_ARANGO_DOCUMENT_HANDLE_BAD" : { "code" : 1205, "message" : "illegal document handle" },
|
||||
"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL" : { "code" : 1206, "message" : "maximal size of journal too small" },
|
||||
"ERROR_ARANGO_DUPLICATE_NAME" : { "code" : 1207, "message" : "duplicate name" },
|
||||
"ERROR_ARANGO_ILLEGAL_NAME" : { "code" : 1208, "message" : "illegal name" },
|
||||
"ERROR_ARANGO_NO_INDEX" : { "code" : 1209, "message" : "no suitable index known" },
|
||||
"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED" : { "code" : 1210, "message" : "unique constraint violated" },
|
||||
"ERROR_ARANGO_GEO_INDEX_VIOLATED" : { "code" : 1211, "message" : "geo index violated" },
|
||||
"ERROR_ARANGO_INDEX_NOT_FOUND" : { "code" : 1212, "message" : "index not found" },
|
||||
"ERROR_ARANGO_CROSS_COLLECTION_REQUEST" : { "code" : 1213, "message" : "cross collection request not allowed" },
|
||||
"ERROR_ARANGO_INDEX_HANDLE_BAD" : { "code" : 1214, "message" : "illegal index handle" },
|
||||
"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED" : { "code" : 1215, "message" : "cap constraint already defined" },
|
||||
"ERROR_ARANGO_DOCUMENT_TOO_LARGE" : { "code" : 1216, "message" : "document too large" },
|
||||
"ERROR_ARANGO_COLLECTION_NOT_UNLOADED" : { "code" : 1217, "message" : "collection must be unloaded" },
|
||||
"ERROR_ARANGO_COLLECTION_TYPE_INVALID" : { "code" : 1218, "message" : "collection type invalid" },
|
||||
"ERROR_ARANGO_VALIDATION_FAILED" : { "code" : 1219, "message" : "validator failed" },
|
||||
"ERROR_ARANGO_PARSER_FAILED" : { "code" : 1220, "message" : "parser failed" },
|
||||
"ERROR_ARANGO_DOCUMENT_KEY_BAD" : { "code" : 1221, "message" : "illegal document key" },
|
||||
"ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED" : { "code" : 1222, "message" : "unexpected document key" },
|
||||
"ERROR_ARANGO_DATADIR_NOT_WRITABLE" : { "code" : 1224, "message" : "server database directory not writable" },
|
||||
"ERROR_ARANGO_OUT_OF_KEYS" : { "code" : 1225, "message" : "out of keys" },
|
||||
"ERROR_ARANGO_DOCUMENT_KEY_MISSING" : { "code" : 1226, "message" : "missing document key" },
|
||||
"ERROR_ARANGO_DOCUMENT_TYPE_INVALID" : { "code" : 1227, "message" : "invalid document type" },
|
||||
"ERROR_ARANGO_DATABASE_NOT_FOUND" : { "code" : 1228, "message" : "database not found" },
|
||||
"ERROR_ARANGO_DATABASE_NAME_INVALID" : { "code" : 1229, "message" : "database name invalid" },
|
||||
"ERROR_ARANGO_USE_SYSTEM_DATABASE" : { "code" : 1230, "message" : "operation only allowed in system database" },
|
||||
"ERROR_ARANGO_ENDPOINT_NOT_FOUND" : { "code" : 1231, "message" : "endpoint not found" },
|
||||
"ERROR_ARANGO_INVALID_KEY_GENERATOR" : { "code" : 1232, "message" : "invalid key generator" },
|
||||
"ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE" : { "code" : 1233, "message" : "edge attribute missing" },
|
||||
"ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING" : { "code" : 1234, "message" : "index insertion warning - attribute missing in document" },
|
||||
"ERROR_ARANGO_INDEX_CREATION_FAILED" : { "code" : 1235, "message" : "index creation failed" },
|
||||
"ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT" : { "code" : 1236, "message" : "write-throttling timeout" },
|
||||
"ERROR_ARANGO_DATAFILE_FULL" : { "code" : 1300, "message" : "datafile full" },
|
||||
"ERROR_ARANGO_EMPTY_DATADIR" : { "code" : 1301, "message" : "server database directory is empty" },
|
||||
"ERROR_REPLICATION_NO_RESPONSE" : { "code" : 1400, "message" : "no response" },
|
||||
"ERROR_REPLICATION_INVALID_RESPONSE" : { "code" : 1401, "message" : "invalid response" },
|
||||
"ERROR_REPLICATION_MASTER_ERROR" : { "code" : 1402, "message" : "master error" },
|
||||
"ERROR_REPLICATION_MASTER_INCOMPATIBLE" : { "code" : 1403, "message" : "master incompatible" },
|
||||
"ERROR_REPLICATION_MASTER_CHANGE" : { "code" : 1404, "message" : "master change" },
|
||||
"ERROR_REPLICATION_LOOP" : { "code" : 1405, "message" : "loop detected" },
|
||||
"ERROR_REPLICATION_UNEXPECTED_MARKER" : { "code" : 1406, "message" : "unexpected marker" },
|
||||
"ERROR_REPLICATION_INVALID_APPLIER_STATE" : { "code" : 1407, "message" : "invalid applier state" },
|
||||
"ERROR_REPLICATION_UNEXPECTED_TRANSACTION" : { "code" : 1408, "message" : "invalid transaction" },
|
||||
"ERROR_REPLICATION_INVALID_LOGGER_CONFIGURATION" : { "code" : 1409, "message" : "invalid replication logger configuration" },
|
||||
"ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION" : { "code" : 1410, "message" : "invalid replication applier configuration" },
|
||||
"ERROR_REPLICATION_RUNNING" : { "code" : 1411, "message" : "cannot change applier configuration while running" },
|
||||
"ERROR_REPLICATION_APPLIER_STOPPED" : { "code" : 1412, "message" : "replication stopped" },
|
||||
"ERROR_REPLICATION_NO_START_TICK" : { "code" : 1413, "message" : "no start tick" },
|
||||
"ERROR_CLUSTER_NO_AGENCY" : { "code" : 1450, "message" : "could not connect to agency" },
|
||||
"ERROR_CLUSTER_NO_COORDINATOR_HEADER" : { "code" : 1451, "message" : "missing coordinator header" },
|
||||
"ERROR_CLUSTER_COULD_NOT_LOCK_PLAN" : { "code" : 1452, "message" : "could not lock plan in agency" },
|
||||
"ERROR_CLUSTER_COLLECTION_ID_EXISTS" : { "code" : 1453, "message" : "collection ID already exists" },
|
||||
"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN" : { "code" : 1454, "message" : "could not create collection in plan" },
|
||||
"ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION" : { "code" : 1455, "message" : "could not read version in current in agency" },
|
||||
"ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION" : { "code" : 1456, "message" : "could not create collection" },
|
||||
"ERROR_CLUSTER_TIMEOUT" : { "code" : 1457, "message" : "timeout in cluster operation" },
|
||||
"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN" : { "code" : 1458, "message" : "could not remove collection from plan" },
|
||||
"ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT" : { "code" : 1459, "message" : "could not remove collection from current" },
|
||||
"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN" : { "code" : 1460, "message" : "could not create database in plan" },
|
||||
"ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE" : { "code" : 1461, "message" : "could not create database" },
|
||||
"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN" : { "code" : 1462, "message" : "could not remove database from plan" },
|
||||
"ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT" : { "code" : 1463, "message" : "could not remove database from current" },
|
||||
"ERROR_CLUSTER_SHARD_GONE" : { "code" : 1464, "message" : "no responsible shard found" },
|
||||
"ERROR_CLUSTER_CONNECTION_LOST" : { "code" : 1465, "message" : "cluster internal HTTP connection broken" },
|
||||
"ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY" : { "code" : 1466, "message" : "must not specify _key for this collection" },
|
||||
"ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS" : { "code" : 1467, "message" : "got contradicting answers from different shards" },
|
||||
"ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN" : { "code" : 1468, "message" : "not all sharding attributes given" },
|
||||
"ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES" : { "code" : 1469, "message" : "must not change the value of a shard key attribute" },
|
||||
"ERROR_CLUSTER_UNSUPPORTED" : { "code" : 1470, "message" : "unsupported operation or parameter" },
|
||||
"ERROR_CLUSTER_ONLY_ON_COORDINATOR" : { "code" : 1471, "message" : "this operation is only valid on a coordinator in a cluster" },
|
||||
"ERROR_CLUSTER_READING_PLAN_AGENCY" : { "code" : 1472, "message" : "error reading Plan in agency" },
|
||||
"ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION" : { "code" : 1473, "message" : "could not truncate collection" },
|
||||
"ERROR_QUERY_KILLED" : { "code" : 1500, "message" : "query killed" },
|
||||
"ERROR_QUERY_PARSE" : { "code" : 1501, "message" : "%s" },
|
||||
"ERROR_QUERY_EMPTY" : { "code" : 1502, "message" : "query is empty" },
|
||||
"ERROR_QUERY_SCRIPT" : { "code" : 1503, "message" : "runtime error '%s'" },
|
||||
"ERROR_QUERY_NUMBER_OUT_OF_RANGE" : { "code" : 1504, "message" : "number out of range" },
|
||||
"ERROR_QUERY_VARIABLE_NAME_INVALID" : { "code" : 1510, "message" : "variable name '%s' has an invalid format" },
|
||||
"ERROR_QUERY_VARIABLE_REDECLARED" : { "code" : 1511, "message" : "variable '%s' is assigned multiple times" },
|
||||
"ERROR_QUERY_VARIABLE_NAME_UNKNOWN" : { "code" : 1512, "message" : "unknown variable '%s'" },
|
||||
"ERROR_QUERY_COLLECTION_LOCK_FAILED" : { "code" : 1521, "message" : "unable to read-lock collection %s" },
|
||||
"ERROR_QUERY_TOO_MANY_COLLECTIONS" : { "code" : 1522, "message" : "too many collections" },
|
||||
"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED" : { "code" : 1530, "message" : "document attribute '%s' is assigned multiple times" },
|
||||
"ERROR_QUERY_FUNCTION_NAME_UNKNOWN" : { "code" : 1540, "message" : "usage of unknown function '%s()'" },
|
||||
"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH" : { "code" : 1541, "message" : "invalid number of arguments for function '%s()'" },
|
||||
"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH" : { "code" : 1542, "message" : "invalid argument type used in call to function '%s()'" },
|
||||
"ERROR_QUERY_INVALID_REGEX" : { "code" : 1543, "message" : "invalid regex argument value used in call to function '%s()'" },
|
||||
"ERROR_QUERY_BIND_PARAMETERS_INVALID" : { "code" : 1550, "message" : "invalid structure of bind parameters" },
|
||||
"ERROR_QUERY_BIND_PARAMETER_MISSING" : { "code" : 1551, "message" : "no value specified for declared bind parameter '%s'" },
|
||||
"ERROR_QUERY_BIND_PARAMETER_UNDECLARED" : { "code" : 1552, "message" : "bind parameter '%s' was not declared in the query" },
|
||||
"ERROR_QUERY_BIND_PARAMETER_TYPE" : { "code" : 1553, "message" : "bind parameter '%s' has an invalid value or type" },
|
||||
"ERROR_QUERY_INVALID_LOGICAL_VALUE" : { "code" : 1560, "message" : "invalid logical value" },
|
||||
"ERROR_QUERY_INVALID_ARITHMETIC_VALUE" : { "code" : 1561, "message" : "invalid arithmetic value" },
|
||||
"ERROR_QUERY_DIVISION_BY_ZERO" : { "code" : 1562, "message" : "division by zero" },
|
||||
"ERROR_QUERY_LIST_EXPECTED" : { "code" : 1563, "message" : "list expected" },
|
||||
"ERROR_QUERY_FAIL_CALLED" : { "code" : 1569, "message" : "FAIL(%s) called" },
|
||||
"ERROR_QUERY_GEO_INDEX_MISSING" : { "code" : 1570, "message" : "no suitable geo index found for geo restriction on '%s'" },
|
||||
"ERROR_QUERY_FULLTEXT_INDEX_MISSING" : { "code" : 1571, "message" : "no suitable fulltext index found for fulltext query on '%s'" },
|
||||
"ERROR_QUERY_INVALID_DATE_VALUE" : { "code" : 1572, "message" : "invalid date value" },
|
||||
"ERROR_QUERY_MULTI_MODIFY" : { "code" : 1573, "message" : "multi-modify query" },
|
||||
"ERROR_QUERY_MODIFY_IN_SUBQUERY" : { "code" : 1574, "message" : "modify operation in subquery" },
|
||||
"ERROR_QUERY_COMPILE_TIME_OPTIONS" : { "code" : 1575, "message" : "query options must be readable at query compile time" },
|
||||
"ERROR_QUERY_EXCEPTION_OPTIONS" : { "code" : 1576, "message" : "query options expected" },
|
||||
"ERROR_QUERY_FUNCTION_INVALID_NAME" : { "code" : 1580, "message" : "invalid user function name" },
|
||||
"ERROR_QUERY_FUNCTION_INVALID_CODE" : { "code" : 1581, "message" : "invalid user function code" },
|
||||
"ERROR_QUERY_FUNCTION_NOT_FOUND" : { "code" : 1582, "message" : "user function '%s()' not found" },
|
||||
"ERROR_CURSOR_NOT_FOUND" : { "code" : 1600, "message" : "cursor not found" },
|
||||
"ERROR_TRANSACTION_INTERNAL" : { "code" : 1650, "message" : "internal transaction error" },
|
||||
"ERROR_TRANSACTION_NESTED" : { "code" : 1651, "message" : "nested transactions detected" },
|
||||
"ERROR_TRANSACTION_UNREGISTERED_COLLECTION" : { "code" : 1652, "message" : "unregistered collection used in transaction" },
|
||||
"ERROR_TRANSACTION_DISALLOWED_OPERATION" : { "code" : 1653, "message" : "disallowed operation inside transaction" },
|
||||
"ERROR_TRANSACTION_ABORTED" : { "code" : 1654, "message" : "transaction aborted" },
|
||||
"ERROR_USER_INVALID_NAME" : { "code" : 1700, "message" : "invalid user name" },
|
||||
"ERROR_USER_INVALID_PASSWORD" : { "code" : 1701, "message" : "invalid password" },
|
||||
"ERROR_USER_DUPLICATE" : { "code" : 1702, "message" : "duplicate user" },
|
||||
"ERROR_USER_NOT_FOUND" : { "code" : 1703, "message" : "user not found" },
|
||||
"ERROR_USER_CHANGE_PASSWORD" : { "code" : 1704, "message" : "user must change his password" },
|
||||
"ERROR_APPLICATION_INVALID_NAME" : { "code" : 1750, "message" : "invalid application name" },
|
||||
"ERROR_APPLICATION_INVALID_MOUNT" : { "code" : 1751, "message" : "invalid mount" },
|
||||
"ERROR_APPLICATION_DOWNLOAD_FAILED" : { "code" : 1752, "message" : "application download failed" },
|
||||
"ERROR_APPLICATION_UPLOAD_FAILED" : { "code" : 1753, "message" : "application upload failed" },
|
||||
"ERROR_KEYVALUE_INVALID_KEY" : { "code" : 1800, "message" : "invalid key declaration" },
|
||||
"ERROR_KEYVALUE_KEY_EXISTS" : { "code" : 1801, "message" : "key already exists" },
|
||||
"ERROR_KEYVALUE_KEY_NOT_FOUND" : { "code" : 1802, "message" : "key not found" },
|
||||
"ERROR_KEYVALUE_KEY_NOT_UNIQUE" : { "code" : 1803, "message" : "key is not unique" },
|
||||
"ERROR_KEYVALUE_KEY_NOT_CHANGED" : { "code" : 1804, "message" : "key value not changed" },
|
||||
"ERROR_KEYVALUE_KEY_NOT_REMOVED" : { "code" : 1805, "message" : "key value not removed" },
|
||||
"ERROR_KEYVALUE_NO_VALUE" : { "code" : 1806, "message" : "missing value" },
|
||||
"ERROR_TASK_INVALID_ID" : { "code" : 1850, "message" : "invalid task id" },
|
||||
"ERROR_TASK_DUPLICATE_ID" : { "code" : 1851, "message" : "duplicate task id" },
|
||||
"ERROR_TASK_NOT_FOUND" : { "code" : 1852, "message" : "task not found" },
|
||||
"ERROR_GRAPH_INVALID_GRAPH" : { "code" : 1901, "message" : "invalid graph" },
|
||||
"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH" : { "code" : 1902, "message" : "could not create graph" },
|
||||
"ERROR_GRAPH_INVALID_VERTEX" : { "code" : 1903, "message" : "invalid vertex" },
|
||||
"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX" : { "code" : 1904, "message" : "could not create vertex" },
|
||||
"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX" : { "code" : 1905, "message" : "could not change vertex" },
|
||||
"ERROR_GRAPH_INVALID_EDGE" : { "code" : 1906, "message" : "invalid edge" },
|
||||
"ERROR_GRAPH_COULD_NOT_CREATE_EDGE" : { "code" : 1907, "message" : "could not create edge" },
|
||||
"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE" : { "code" : 1908, "message" : "could not change edge" },
|
||||
"ERROR_GRAPH_TOO_MANY_ITERATIONS" : { "code" : 1909, "message" : "too many iterations" },
|
||||
"ERROR_GRAPH_INVALID_FILTER_RESULT" : { "code" : 1910, "message" : "invalid filter result" },
|
||||
"ERROR_GRAPH_COLLECTION_MULTI_USE" : { "code" : 1920, "message" : "multi use of edge collection in edge def" },
|
||||
"ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS" : { "code" : 1921, "message" : "edge collection already used in edge def" },
|
||||
"ERROR_GRAPH_CREATE_MISSING_NAME" : { "code" : 1922, "message" : "missing graph name" },
|
||||
"ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION" : { "code" : 1923, "message" : "malformed edge def" },
|
||||
"ERROR_GRAPH_NOT_FOUND" : { "code" : 1924, "message" : "graph not found" },
|
||||
"ERROR_GRAPH_DUPLICATE" : { "code" : 1925, "message" : "graph already exists" },
|
||||
"ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST" : { "code" : 1926, "message" : "collection does not exist" },
|
||||
"ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX" : { "code" : 1927, "message" : "not a vertex collection" },
|
||||
"ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION" : { "code" : 1928, "message" : "not in orphan collection" },
|
||||
"ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF" : { "code" : 1929, "message" : "collection used in edge def" },
|
||||
"ERROR_GRAPH_EDGE_COLLECTION_NOT_USED" : { "code" : 1930, "message" : "edge collection not used in graph" },
|
||||
"ERROR_GRAPH_NO_AN_ARANGO_COLLECTION" : { "code" : 1931, "message" : " is not an ArangoCollection" },
|
||||
"ERROR_GRAPH_NO_GRAPH_COLLECTION" : { "code" : 1932, "message" : "collection _graphs does not exist" },
|
||||
"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING" : { "code" : 1933, "message" : "Invalid example type. Has to be String, Array or Object" },
|
||||
"ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT" : { "code" : 1934, "message" : "Invalid example type. Has to be Array or Object" },
|
||||
"ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS" : { "code" : 1935, "message" : "Invalid number of arguments. Expected: " },
|
||||
"ERROR_GRAPH_INVALID_PARAMETER" : { "code" : 1936, "message" : "Invalid parameter type." },
|
||||
"ERROR_GRAPH_INVALID_ID" : { "code" : 1937, "message" : "Invalid id" },
|
||||
"ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS" : { "code" : 1938, "message" : "collection used in orphans" },
|
||||
"ERROR_SESSION_UNKNOWN" : { "code" : 1950, "message" : "unknown session" },
|
||||
"ERROR_SESSION_EXPIRED" : { "code" : 1951, "message" : "session expired" },
|
||||
"SIMPLE_CLIENT_UNKNOWN_ERROR" : { "code" : 2000, "message" : "unknown client error" },
|
||||
"SIMPLE_CLIENT_COULD_NOT_CONNECT" : { "code" : 2001, "message" : "could not connect to server" },
|
||||
"SIMPLE_CLIENT_COULD_NOT_WRITE" : { "code" : 2002, "message" : "could not write to server" },
|
||||
"SIMPLE_CLIENT_COULD_NOT_READ" : { "code" : 2003, "message" : "could not read from server" },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_UPDATE_ATTRIBUTE_MISSING" : { "code" : 3402, "message" : "bitarray index update warning - attribute missing in revised document" },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_REMOVE_ITEM_MISSING" : { "code" : 3411, "message" : "bitarray index remove failure - item missing in index" },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_INSERT_ITEM_UNSUPPORTED_VALUE" : { "code" : 3413, "message" : "bitarray index insert failure - document attribute value unsupported in index" },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_ATTRIBUTES" : { "code" : 3415, "message" : "bitarray index creation failure - one or more index attributes are duplicated." },
|
||||
"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_VALUES" : { "code" : 3417, "message" : "bitarray index creation failure - one or more index attribute values are duplicated." },
|
||||
"RESULT_KEY_EXISTS" : { "code" : 10000, "message" : "element not inserted into structure, because key already exists" },
|
||||
"RESULT_ELEMENT_EXISTS" : { "code" : 10001, "message" : "element not inserted into structure, because it already exists" },
|
||||
"RESULT_KEY_NOT_FOUND" : { "code" : 10002, "message" : "key not found in structure" },
|
||||
"RESULT_ELEMENT_NOT_FOUND" : { "code" : 10003, "message" : "element not found in structure" },
|
||||
"ERROR_APP_ALREADY_EXISTS" : { "code" : 20000, "message" : "newest version of app already installed" },
|
||||
"ERROR_QUEUE_ALREADY_EXISTS" : { "code" : 21000, "message" : "named queue already exists" },
|
||||
"ERROR_DISPATCHER_IS_STOPPING" : { "code" : 21001, "message" : "dispatcher stopped" },
|
||||
"ERROR_QUEUE_UNKNOWN" : { "code" : 21002, "message" : "named queue does not exist" },
|
||||
"ERROR_QUEUE_FULL" : { "code" : 21003, "message" : "named queue is full" }
|
||||
};
|
||||
}());
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, sloppy: true, proto: true */
|
||||
/*global require, SYS_GETLINE, SYS_LOG, jqconsole */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -65,7 +64,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var log;
|
||||
|
||||
|
||||
try {
|
||||
// this will work when we are in arangod but not in the browser / web interface
|
||||
log = SYS_LOG;
|
||||
|
@ -102,7 +101,7 @@
|
|||
if (0 < args.length && typeof args[0] !== "string") {
|
||||
result.push("%s");
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < args.length; ++i) {
|
||||
var arg = args[i];
|
||||
|
||||
|
@ -390,7 +389,7 @@
|
|||
if (! time) {
|
||||
throw new Error('No such label: ' + label);
|
||||
}
|
||||
|
||||
|
||||
var duration = Date.now() - time;
|
||||
|
||||
delete timers[label];
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, proto: true */
|
||||
/*jslint sloppy: true, regexp: true */
|
||||
/*global require, module, Module, ArangoError, SleepAndRequeue,
|
||||
CONFIGURE_ENDPOINT, REMOVE_ENDPOINT, LIST_ENDPOINTS, STARTUP_PATH,
|
||||
SYS_BASE64DECODE, SYS_BASE64ENCODE, SYS_DEBUG_SEGFAULT,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, plusplus: true */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief monkey-patches to built-in prototypes
|
||||
///
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, white: true, plusplus: true, nonpropdel: true */
|
||||
/*global require, ArangoConnection, print, SYS_ARANGO, window */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -78,10 +77,10 @@
|
|||
if (value !== undefined) {
|
||||
return internal.arango.PUT("/_admin/wal/properties", JSON.stringify(value));
|
||||
}
|
||||
|
||||
|
||||
return internal.arango.GET("/_admin/wal/properties", "");
|
||||
}
|
||||
|
||||
|
||||
throw "not connected";
|
||||
}
|
||||
};
|
||||
|
@ -132,7 +131,7 @@
|
|||
internal.routingCache = function () {
|
||||
if (typeof internal.arango !== 'undefined') {
|
||||
return internal.arango.GET("/_admin/routing/routes", "");
|
||||
|
||||
|
||||
}
|
||||
|
||||
throw "not connected";
|
||||
|
@ -296,9 +295,9 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief sprintf wrapper
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
try {
|
||||
if (window) {
|
||||
if (window) {
|
||||
internal.sprintf = function (format) {
|
||||
var n = arguments.length;
|
||||
if (n === 0) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, nonpropdel: true, white: true, plusplus: true, evil: true */
|
||||
/*global require, console, IS_EXECUTE_SCRIPT, IS_EXECUTE_STRING, IS_CHECK_SCRIPT, IS_UNIT_TESTS, IS_JS_LINT */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global Backbone, window, $, _ */
|
||||
(function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true, stupid: true*/
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global require, exports, Backbone, window, arangoCollectionModel, $, arangoHelper, data, _ */
|
||||
(function() {
|
||||
"use strict";
|
||||
|
@ -23,7 +24,7 @@
|
|||
switch (status) {
|
||||
case 0:
|
||||
return 'corrupted';
|
||||
case 1:
|
||||
case 1:
|
||||
return 'new born collection';
|
||||
case 2:
|
||||
return 'unloaded';
|
||||
|
@ -91,7 +92,7 @@
|
|||
getFiltered : function (options) {
|
||||
var result = [ ];
|
||||
var searchPhrases = [ ];
|
||||
|
||||
|
||||
if (options.searchPhrase !== null) {
|
||||
var searchPhrase = options.searchPhrase.toLowerCase();
|
||||
// kick out whitespace
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global window, Backbone, $, window, _*/
|
||||
|
||||
(function() {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint strict: false, unused: false */
|
||||
/*global require, exports, Backbone, window, arangoDocument, arangoDocumentModel, $, arangoHelper */
|
||||
|
||||
window.arangoDocument = Backbone.Collection.extend({
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global require, exports, window, Backbone, arangoDocumentModel, _, arangoHelper, $*/
|
||||
(function() {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global window, $, _ */
|
||||
(function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true, stupid: true*/
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global require, exports, Backbone, activeUser, window, ArangoQuery, $, data, _, arangoHelper*/
|
||||
(function() {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint strict: false, unused: false */
|
||||
/*global window, Backbone, $, window */
|
||||
|
||||
window.ArangoReplication = Backbone.Collection.extend({
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global require, exports, Backbone, window */
|
||||
window.StatisticsCollection = Backbone.Collection.extend({
|
||||
model: window.Statistics,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint strict: false, unused: false */
|
||||
/*global require, exports, Backbone, window */
|
||||
window.StatisticsDescriptionCollection = Backbone.Collection.extend({
|
||||
model: window.StatisticsDescription,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint strict: false, unused: false */
|
||||
/*global window, Backbone, $,_, window */
|
||||
|
||||
window.ArangoUsers = Backbone.Collection.extend({
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global window, Backbone, alert, $ */
|
||||
(function() {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global window, Backbone */
|
||||
(function () {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
|
||||
/*jshint browser: true */
|
||||
/*jshint unused: false */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
"use strict";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, vars: true, white: true, plusplus: true, continue: true, regexp: true */
|
||||
/*global require, _, Dygraph, window, document */
|
||||
|
||||
(function () {
|
||||
|
@ -166,7 +165,7 @@
|
|||
div: "requestsChart"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getDashBoardFigures : function (all) {
|
||||
var result = [], self = this;
|
||||
Object.keys(this.figureDependedOptions).forEach(function (k) {
|
||||
|
@ -243,7 +242,7 @@
|
|||
interactionModel: null,
|
||||
showLabelsOnHighlight: true,
|
||||
highlightCircleSize: 2.5,
|
||||
legend: "always",
|
||||
legend: "always",
|
||||
labelsDiv: "div#detailLegend.dashboard-legend-inner"
|
||||
}
|
||||
);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, d3, _, console, alert*/
|
||||
/*global AbstractAdapter*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -30,18 +29,18 @@
|
|||
|
||||
function JSONAdapter(jsonPath, nodes, edges, viewer, width, height) {
|
||||
"use strict";
|
||||
|
||||
|
||||
var self = this,
|
||||
initialX = {},
|
||||
initialY = {},
|
||||
absAdapter = new AbstractAdapter(nodes, edges, this, viewer),
|
||||
findNode = function(n) {
|
||||
findNode = function(n) {
|
||||
var res = $.grep(nodes, function(e){
|
||||
return e._id === n._id;
|
||||
});
|
||||
if (res.length === 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (res.length === 1) {
|
||||
return res[0];
|
||||
}
|
||||
|
@ -62,29 +61,29 @@ function JSONAdapter(jsonPath, nodes, edges, viewer, width, height) {
|
|||
node._inboundCounter = 0;
|
||||
return node;
|
||||
},
|
||||
|
||||
|
||||
insertEdge = function(source, target) {
|
||||
edges.push({source: source, target: target});
|
||||
source._outboundCounter++;
|
||||
target._inboundCounter++;
|
||||
};
|
||||
|
||||
|
||||
initialX.range = width / 2;
|
||||
initialX.start = width / 4;
|
||||
initialX.getStart = function () {
|
||||
return this.start + Math.random() * this.range;
|
||||
};
|
||||
|
||||
|
||||
initialY.range = height / 2;
|
||||
initialY.start = height / 4;
|
||||
initialY.getStart = function () {
|
||||
return this.start + Math.random() * this.range;
|
||||
};
|
||||
|
||||
|
||||
self.loadNode = function(nodeId, callback) {
|
||||
self.loadNodeFromTreeById(nodeId, callback);
|
||||
};
|
||||
|
||||
|
||||
self.loadInitialNode = function(nodeId, callback) {
|
||||
var json = jsonPath + nodeId + ".json";
|
||||
absAdapter.cleanUp();
|
||||
|
@ -115,7 +114,7 @@ function JSONAdapter(jsonPath, nodes, edges, viewer, width, height) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.loadNodeFromTreeById = function(nodeId, callback) {
|
||||
var json = jsonPath + nodeId + ".json";
|
||||
d3.json(json, function(error, node) {
|
||||
|
@ -144,8 +143,8 @@ function JSONAdapter(jsonPath, nodes, edges, viewer, width, height) {
|
|||
callback(n);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
self.requestCentralityChildren = function(nodeId, callback) {
|
||||
var json = jsonPath + nodeId + ".json";
|
||||
d3.json(json, function(error, node) {
|
||||
|
@ -161,54 +160,54 @@ function JSONAdapter(jsonPath, nodes, edges, viewer, width, height) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.loadNodeFromTreeByAttributeValue = function(attribute, value, callback) {
|
||||
throw "Sorry this adapter is read-only";
|
||||
};
|
||||
|
||||
|
||||
self.loadInitialNodeByAttributeValue = function(attribute, value, callback) {
|
||||
throw "Sorry this adapter is read-only";
|
||||
};
|
||||
|
||||
|
||||
self.createEdge = function(edgeToCreate, callback){
|
||||
throw "Sorry this adapter is read-only";
|
||||
};
|
||||
|
||||
|
||||
self.deleteEdge = function(edgeToDelete, callback){
|
||||
throw "Sorry this adapter is read-only";
|
||||
};
|
||||
|
||||
|
||||
self.patchEdge = function(edgeToPatch, patchData, callback){
|
||||
throw "Sorry this adapter is read-only";
|
||||
};
|
||||
|
||||
|
||||
self.createNode = function(nodeToCreate, callback){
|
||||
throw "Sorry this adapter is read-only";
|
||||
};
|
||||
|
||||
|
||||
self.deleteNode = function(nodeToDelete, callback){
|
||||
throw "Sorry this adapter is read-only";
|
||||
};
|
||||
|
||||
|
||||
self.patchNode = function(nodeToPatch, patchData, callback){
|
||||
throw "Sorry this adapter is read-only";
|
||||
};
|
||||
|
||||
|
||||
self.setNodeLimit = function (limit, callback) {
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
self.setChildLimit = function (limit) {
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
self.expandCommunity = function (commNode, callback) {
|
||||
|
||||
|
||||
};
|
||||
|
||||
self.setWidth = function() {
|
||||
};
|
||||
|
||||
|
||||
self.explore = absAdapter.explore;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, _ */
|
||||
/*global console */
|
||||
/*global NodeReducer, ModularityJoiner, WebWorkerWrapper, CommunityNode*/
|
||||
|
@ -32,7 +31,7 @@
|
|||
|
||||
function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (nodes === undefined) {
|
||||
throw "The nodes have to be given.";
|
||||
}
|
||||
|
@ -46,7 +45,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
throw "A reference to the graph viewer has to be given.";
|
||||
}
|
||||
config = config || {};
|
||||
|
||||
|
||||
var self = this,
|
||||
isRunning = false,
|
||||
initialX = {},
|
||||
|
@ -71,7 +70,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
return this.start + Math.random() * this.range;
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
setHeight = function(h) {
|
||||
initialY.range = h / 2;
|
||||
initialY.start = h / 4;
|
||||
|
@ -79,7 +78,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
return this.start + Math.random() * this.range;
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
findNode = function(id) {
|
||||
var intId = joinedInCommunities[id] || id,
|
||||
res = $.grep(nodes, function(e){
|
||||
|
@ -87,26 +86,26 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
});
|
||||
if (res.length === 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (res.length === 1) {
|
||||
return res[0];
|
||||
}
|
||||
throw "Too many nodes with the same ID, should never happen";
|
||||
},
|
||||
|
||||
|
||||
findEdge = function(id) {
|
||||
var res = $.grep(edges, function(e){
|
||||
return e._id === id;
|
||||
});
|
||||
if (res.length === 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (res.length === 1) {
|
||||
return res[0];
|
||||
}
|
||||
throw "Too many edges with the same ID, should never happen";
|
||||
},
|
||||
|
||||
|
||||
insertNode = function(data, x, y) {
|
||||
var node = {
|
||||
_data: data,
|
||||
|
@ -124,7 +123,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
node._inboundCounter = 0;
|
||||
return node;
|
||||
},
|
||||
|
||||
|
||||
insertInitialNode = function(data) {
|
||||
var n = insertNode(data);
|
||||
n.x = initialX.start * 2;
|
||||
|
@ -132,7 +131,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
n.fixed = true;
|
||||
return n;
|
||||
},
|
||||
|
||||
|
||||
cleanUp = function() {
|
||||
nodes.length = 0;
|
||||
edges.length = 0;
|
||||
|
@ -140,7 +139,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
cachedCommunities = {};
|
||||
viewer.cleanUp();
|
||||
},
|
||||
|
||||
|
||||
insertEdge = function(data) {
|
||||
var source,
|
||||
target,
|
||||
|
@ -187,8 +186,8 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
if (informJoiner) {
|
||||
joiner.call("insertEdge", source._id, target._id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Archive
|
||||
if (cachedCommunities[source._id] !== undefined) {
|
||||
edgeToPush = {};
|
||||
|
@ -222,7 +221,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
*/
|
||||
return edge;
|
||||
},
|
||||
|
||||
|
||||
removeNode = function (node) {
|
||||
var i;
|
||||
for ( i = 0; i < nodes.length; i++ ) {
|
||||
|
@ -232,7 +231,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
removeEdgeWithIndex = function (index, notInformJoiner) {
|
||||
var e = edges[index],
|
||||
s = e.source._id,
|
||||
|
@ -242,7 +241,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
joiner.call("deleteEdge",s , t);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
removeEdge = function (edge, notInformJoiner) {
|
||||
var i;
|
||||
for ( i = 0; i < edges.length; i++ ) {
|
||||
|
@ -252,7 +251,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
removeEdgesForNode = function (node) {
|
||||
var i;
|
||||
for (i = 0; i < edges.length; i++ ) {
|
||||
|
@ -294,10 +293,10 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
edgeToPush.type = "s";
|
||||
edgeToPush._id = edges[i]._id;
|
||||
edgeToPush.source = s;
|
||||
|
||||
|
||||
if (!/^\*community/.test(t._id)) {
|
||||
joiner.call("deleteEdge", s._id, t._id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (t === nodes[j]) {
|
||||
if (edgeToPush.type !== undefined) {
|
||||
|
@ -315,7 +314,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
edgeToPush.target = t;
|
||||
if (!/^\*community/.test(s._id)) {
|
||||
joiner.call("deleteEdge", s._id, t._id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (edgeToPush.type !== undefined) {
|
||||
|
@ -336,15 +335,15 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
shouldRemove = commNode.insertOutboundEdge(edges[i]);
|
||||
if (!t._isCommunity) {
|
||||
joiner.call("deleteEdge", s._id, t._id);
|
||||
}
|
||||
s = edges[i].source;
|
||||
}
|
||||
s = edges[i].source;
|
||||
}
|
||||
if (t === nodes[j]) {
|
||||
shouldRemove = commNode.insertInboundEdge(edges[i]);
|
||||
if (!s._isCommunity) {
|
||||
joiner.call("deleteEdge", s._id, t._id);
|
||||
}
|
||||
t = edges[i].target;
|
||||
t = edges[i].target;
|
||||
}
|
||||
if (shouldRemove) {
|
||||
edges.splice(i, 1);
|
||||
|
@ -353,7 +352,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// Helper function to easily remove all outbound edges for one node
|
||||
removeOutboundEdgesFromNode = function ( node ) {
|
||||
if (node._outboundCounter > 0) {
|
||||
|
@ -395,7 +394,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
cachedCommunities[commId] = {};
|
||||
cachedCommunities[commId].nodes = nodesToRemove;
|
||||
cachedCommunities[commId].edges = [];
|
||||
|
||||
|
||||
combineCommunityEdges(nodesToRemove, commNode);
|
||||
_.each(nodesToRemove, function(n) {
|
||||
joinedInCommunities[n._id] = commId;
|
||||
|
@ -405,12 +404,12 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
isRunning = false;
|
||||
},
|
||||
*/
|
||||
|
||||
|
||||
collapseCommunity = function (community, reason) {
|
||||
if (!community || community.length === 0) {
|
||||
return;
|
||||
}
|
||||
var
|
||||
var
|
||||
nodesToRemove = _.map(community, function(id) {
|
||||
return findNode(id);
|
||||
}),
|
||||
|
@ -420,7 +419,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
commNode._reason = reason;
|
||||
}
|
||||
cachedCommunities[commId] = commNode;
|
||||
|
||||
|
||||
combineCommunityEdges(nodesToRemove, commNode);
|
||||
_.each(nodesToRemove, function(n) {
|
||||
joinedInCommunities[n._id] = commId;
|
||||
|
@ -429,7 +428,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
nodes.push(commNode);
|
||||
isRunning = false;
|
||||
},
|
||||
|
||||
|
||||
joinerCb = function (d) {
|
||||
var data = d.data;
|
||||
if (data.error) {
|
||||
|
@ -438,7 +437,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
return;
|
||||
}
|
||||
switch (data.cmd) {
|
||||
case "debug":
|
||||
case "debug":
|
||||
//console.log(data.result);
|
||||
break;
|
||||
case "getCommunity":
|
||||
|
@ -447,7 +446,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
default:
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
requestCollapse = function (focus) {
|
||||
if (isRunning) {
|
||||
return;
|
||||
|
@ -459,7 +458,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
joiner.call("getCommunity", limit);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
checkNodeLimit = function (focus) {
|
||||
var curRendered = nodes.length,
|
||||
commToColapse,
|
||||
|
@ -517,12 +516,12 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
joiner.call("insertEdge", e.edge.source._id, e.edge.target._id);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
delete cachedCommunities[commId];
|
||||
delete cachedCommunities[commId];
|
||||
},
|
||||
*/
|
||||
|
||||
|
||||
dissolveCommunity = function (commNode) {
|
||||
var dissolveInfo = commNode.getDissolveInfo(),
|
||||
nodesToAdd = dissolveInfo.nodes,
|
||||
|
@ -559,14 +558,14 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
edges.push(edge);
|
||||
joiner.call("insertEdge", edge.source._id, edge.target._id);
|
||||
});
|
||||
delete cachedCommunities[commNode._id];
|
||||
delete cachedCommunities[commNode._id];
|
||||
},
|
||||
|
||||
|
||||
expandCommunity = function(commNode) {
|
||||
commNode.expand();
|
||||
checkNodeLimit(commNode);
|
||||
},
|
||||
|
||||
|
||||
checkSizeOfInserted = function (inserted) {
|
||||
if (_.size(inserted) > childLimit) {
|
||||
var buckets = reducer.bucketNodes(_.values(inserted), childLimit);
|
||||
|
@ -580,7 +579,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
setNodeLimit = function (pLimit, callback) {
|
||||
limit = pLimit;
|
||||
checkNodeLimit();
|
||||
|
@ -588,13 +587,13 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
setChildLimit = function (pLimit) {
|
||||
childLimit = pLimit;
|
||||
},
|
||||
|
||||
|
||||
handleRemovedEdge,
|
||||
|
||||
|
||||
collapseNodeInCommunity = function(node, commNode) {
|
||||
node._expanded = false;
|
||||
var removedEdges = commNode.removeOutboundEdgesFromNode(node);
|
||||
|
@ -603,7 +602,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
removeEdge(e, true);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
collapseNode = function(node) {
|
||||
node._expanded = false;
|
||||
if (joinedInCommunities[node._id]) {
|
||||
|
@ -612,7 +611,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
var removedEdges = removeOutboundEdgesFromNode(node);
|
||||
_.each(removedEdges, handleRemovedEdge);
|
||||
},
|
||||
|
||||
|
||||
collapseExploreCommunity = function(commNode) {
|
||||
var disInfo = commNode.getDissolveInfo();
|
||||
removeNode(commNode);
|
||||
|
@ -625,7 +624,7 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
});
|
||||
delete cachedCommunities[commNode._id];
|
||||
},
|
||||
|
||||
|
||||
expandNode = function(n, startCallback) {
|
||||
if (n._isCommunity) {
|
||||
self.expandCommunity(n, startCallback);
|
||||
|
@ -634,16 +633,16 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
descendant.loadNode(n._id, startCallback);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
explore = function (node, startCallback) {
|
||||
if (!node._expanded) {
|
||||
expandNode(node, startCallback);
|
||||
} else {
|
||||
collapseNode(node);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
handleRemovedEdge = function (e) {
|
||||
var n = e.target, t;
|
||||
if (n._isCommunity) {
|
||||
|
@ -666,21 +665,21 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
removeNode(n);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
childLimit = Number.POSITIVE_INFINITY;
|
||||
|
||||
|
||||
if (config.prioList) {
|
||||
reducer = new NodeReducer(config.prioList);
|
||||
} else {
|
||||
reducer = new NodeReducer();
|
||||
}
|
||||
joiner = new WebWorkerWrapper(ModularityJoiner, joinerCb);
|
||||
|
||||
|
||||
initialX.getStart = function() {return 0;};
|
||||
initialY.getStart = function() {return 0;};
|
||||
|
||||
|
||||
this.cleanUp = cleanUp;
|
||||
|
||||
|
||||
this.setWidth = setWidth;
|
||||
this.setHeight = setHeight;
|
||||
this.insertNode = insertNode;
|
||||
|
@ -689,21 +688,21 @@ function AbstractAdapter(nodes, edges, descendant, viewer, config) {
|
|||
|
||||
this.removeNode = removeNode;
|
||||
this.removeEdge = removeEdge;
|
||||
this.removeEdgesForNode = removeEdgesForNode;
|
||||
|
||||
this.removeEdgesForNode = removeEdgesForNode;
|
||||
|
||||
this.expandCommunity = expandCommunity;
|
||||
|
||||
|
||||
this.setNodeLimit = setNodeLimit;
|
||||
this.setChildLimit = setChildLimit;
|
||||
|
||||
|
||||
this.checkSizeOfInserted = checkSizeOfInserted;
|
||||
this.checkNodeLimit = checkNodeLimit;
|
||||
|
||||
|
||||
this.explore = explore;
|
||||
|
||||
|
||||
this.changeTo = changeTo;
|
||||
|
||||
|
||||
this.getPrioList = reducer.getPrioList;
|
||||
|
||||
|
||||
this.dissolveCommunity = dissolveCommunity;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, d3, _, console, document*/
|
||||
/*global AbstractAdapter*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -113,7 +112,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
api.graph = api.base + "graph";
|
||||
api.collection = api.base + "collection/";
|
||||
api.document = api.base + "document/";
|
||||
api.any = api.base + "simple/any";
|
||||
api.any = api.base + "simple/any";
|
||||
if (config.graph) {
|
||||
getCollectionsFromGraph(config.graph);
|
||||
setGraphName(config.graph);
|
||||
|
@ -123,7 +122,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
setGraphName(undefined);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
sendQuery = function(query, bindVars, onSuccess) {
|
||||
if (query !== queries.getAllGraphs) {
|
||||
if (query !== queries.connectedEdges) {
|
||||
|
@ -159,7 +158,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
getNRandom = function(n, callback) {
|
||||
var list = [],
|
||||
i = 0,
|
||||
|
@ -182,7 +181,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseResultOfTraversal = function (result, callback) {
|
||||
if (result.length === 0) {
|
||||
if (callback) {
|
||||
|
@ -197,7 +196,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
n = absAdapter.insertNode(result[0].vertex),
|
||||
oldLength = nodes.length,
|
||||
com, buckets;
|
||||
|
||||
|
||||
_.each(result, function(visited) {
|
||||
var node = absAdapter.insertNode(visited.vertex),
|
||||
path = visited.path;
|
||||
|
@ -215,7 +214,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
_.each(path.edges, function(edge) {
|
||||
absAdapter.insertEdge(edge);
|
||||
});
|
||||
});
|
||||
});
|
||||
delete inserted[n._id];
|
||||
absAdapter.checkSizeOfInserted(inserted);
|
||||
absAdapter.checkNodeLimit(n);
|
||||
|
@ -279,15 +278,15 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
_.each(res, self.deleteEdge);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
if (config.prioList) {
|
||||
absConfig.prioList = config.prioList;
|
||||
}
|
||||
absAdapter = new AbstractAdapter(nodes, edges, this, viewer, absConfig);
|
||||
|
||||
|
||||
parseConfig(config);
|
||||
|
||||
|
||||
queries.getAllGraphs = "FOR g IN _graphs"
|
||||
+ " return g._key";
|
||||
queries.randomDocuments = "FOR u IN @@nodes"
|
||||
|
@ -347,9 +346,9 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
});
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
self.explore = absAdapter.explore;
|
||||
|
||||
|
||||
self.loadNode = function(nodeId, callback) {
|
||||
self.loadNodeFromTreeById(nodeId, callback);
|
||||
};
|
||||
|
@ -360,17 +359,17 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
var r = list[0];
|
||||
if (r._id) {
|
||||
self.loadInitialNode(r._id, callback);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.loadInitialNode = function(nodeId, callback) {
|
||||
absAdapter.cleanUp();
|
||||
self.loadNode(nodeId, insertInitialCallback(callback));
|
||||
};
|
||||
|
||||
|
||||
self.loadNodeFromTreeById = function(nodeId, callback) {
|
||||
sendQuery(queries.traversalById, {
|
||||
id: nodeId
|
||||
|
@ -378,20 +377,20 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
parseResultOfTraversal(res, callback);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.loadNodeFromTreeByAttributeValue = function(attribute, value, callback) {
|
||||
sendQuery(queries.traversalByAttribute(attribute), {
|
||||
value: value
|
||||
}, function(res) {
|
||||
parseResultOfTraversal(res, callback);
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
self.loadInitialNodeByAttributeValue = function(attribute, value, callback) {
|
||||
absAdapter.cleanUp();
|
||||
self.loadNodeFromTreeByAttributeValue(attribute, value, insertInitialCallback(callback));
|
||||
};
|
||||
|
||||
|
||||
self.requestCentralityChildren = function(nodeId, callback) {
|
||||
sendQuery(queries.childrenCentrality,{
|
||||
id: nodeId
|
||||
|
@ -399,8 +398,8 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
callback(res[0]);
|
||||
});
|
||||
};
|
||||
|
||||
self.createEdge = function (edgeToAdd, callback) {
|
||||
|
||||
self.createEdge = function (edgeToAdd, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
type: "POST",
|
||||
|
@ -421,7 +420,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.deleteEdge = function (edgeToRemove, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -440,9 +439,9 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
throw data.statusText;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
self.patchEdge = function (edgeToPatch, patchData, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -461,7 +460,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.createNode = function (nodeToAdd, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -485,7 +484,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.deleteNode = function (nodeToRemove, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -507,7 +506,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.patchNode = function (nodeToPatch, patchData, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -526,7 +525,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.changeToCollections = function (nodesCol, edgesCol, dir) {
|
||||
absAdapter.cleanUp();
|
||||
setNodeCollection(nodesCol);
|
||||
|
@ -541,7 +540,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
|
||||
setGraphName(undefined);
|
||||
};
|
||||
|
||||
|
||||
self.changeToGraph = function (name, dir) {
|
||||
absAdapter.cleanUp();
|
||||
getCollectionsFromGraph(name);
|
||||
|
@ -554,22 +553,22 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
setGraphName(name);
|
||||
};
|
||||
|
||||
|
||||
self.setNodeLimit = function (pLimit, callback) {
|
||||
absAdapter.setNodeLimit(pLimit, callback);
|
||||
};
|
||||
|
||||
|
||||
self.setChildLimit = function (pLimit) {
|
||||
absAdapter.setChildLimit(pLimit);
|
||||
};
|
||||
|
||||
|
||||
self.expandCommunity = function (commNode, callback) {
|
||||
absAdapter.expandCommunity(commNode);
|
||||
if (callback !== undefined) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.getCollections = function(callback) {
|
||||
if (callback && callback.length >= 2) {
|
||||
$.ajax({
|
||||
|
@ -600,17 +599,17 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.getGraphs = function(callback) {
|
||||
if (callback && callback.length >= 1) {
|
||||
if (callback && callback.length >= 1) {
|
||||
sendQuery(
|
||||
queries.getAllGraphs,
|
||||
{},
|
||||
{},
|
||||
callback
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.getAttributeExamples = function(callback) {
|
||||
if (callback && callback.length >= 1) {
|
||||
getNRandom(10, function(l) {
|
||||
|
@ -645,7 +644,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
|
|||
self.getGraphName = function () {
|
||||
return graphName;
|
||||
};
|
||||
|
||||
|
||||
self.setWidth = absAdapter.setWidth;
|
||||
self.changeTo = absAdapter.changeTo;
|
||||
self.getPrioList = absAdapter.getPrioList;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global _, $, d3*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Graph functionality
|
||||
|
@ -29,14 +28,14 @@
|
|||
|
||||
function ColourMapper() {
|
||||
"use strict";
|
||||
|
||||
|
||||
var mapping = {},
|
||||
reverseMapping = {},
|
||||
colours = [],
|
||||
listener,
|
||||
self = this,
|
||||
nextColour = 0;
|
||||
|
||||
|
||||
colours.push({back: "navy", front: "white"});
|
||||
colours.push({back: "green", front: "white"});
|
||||
colours.push({back: "gold", front: "black"});
|
||||
|
@ -57,7 +56,7 @@ function ColourMapper() {
|
|||
colours.push({back: "teal", front: "black"});
|
||||
colours.push({back: "peru", front: "black"});
|
||||
colours.push({back: "maroon", front: "white"});
|
||||
|
||||
|
||||
this.getColour = function(value) {
|
||||
if (mapping[value] === undefined) {
|
||||
mapping[value] = colours[nextColour];
|
||||
|
@ -103,13 +102,13 @@ function ColourMapper() {
|
|||
}
|
||||
return mapping[value].front;
|
||||
};
|
||||
|
||||
|
||||
this.getForegroundCommunityColour = function() {
|
||||
return "white";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.reset = function() {
|
||||
mapping = {};
|
||||
reverseMapping = {};
|
||||
|
@ -118,14 +117,14 @@ function ColourMapper() {
|
|||
listener(self.getList());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.getList = function() {
|
||||
return reverseMapping;
|
||||
};
|
||||
|
||||
|
||||
this.setChangeListener = function(callback) {
|
||||
listener = callback;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
this.reset();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global _, document, ForceLayouter, DomObserverFactory*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Graph functionality
|
||||
|
@ -31,20 +30,20 @@
|
|||
|
||||
function CommunityNode(parent, initial) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (_.isUndefined(parent)
|
||||
|| !_.isFunction(parent.dissolveCommunity)
|
||||
|| !_.isFunction(parent.checkNodeLimit)) {
|
||||
throw "A parent element has to be given.";
|
||||
}
|
||||
|
||||
|
||||
initial = initial || [];
|
||||
|
||||
|
||||
var
|
||||
|
||||
////////////////////////////////////
|
||||
// Private variables //
|
||||
////////////////////////////////////
|
||||
////////////////////////////////////
|
||||
self = this,
|
||||
bBox,
|
||||
bBoxBorder,
|
||||
|
@ -60,22 +59,22 @@ function CommunityNode(parent, initial) {
|
|||
layouter,
|
||||
////////////////////////////////////
|
||||
// Private functions //
|
||||
////////////////////////////////////
|
||||
|
||||
////////////////////////////////////
|
||||
|
||||
getDistance = function(def) {
|
||||
if (self._expanded) {
|
||||
return 2 * def * Math.sqrt(nodeArray.length);
|
||||
}
|
||||
return def;
|
||||
},
|
||||
|
||||
|
||||
getCharge = function(def) {
|
||||
if (self._expanded) {
|
||||
return 4 * def * Math.sqrt(nodeArray.length);
|
||||
}
|
||||
return def;
|
||||
},
|
||||
|
||||
|
||||
compPosi = function(p) {
|
||||
var d = self.position,
|
||||
x = p.x * d.z + d.x,
|
||||
|
@ -87,15 +86,15 @@ function CommunityNode(parent, initial) {
|
|||
z: z
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
getSourcePosition = function(e) {
|
||||
if (self._expanded) {
|
||||
return compPosi(e._source.position);
|
||||
}
|
||||
return self.position;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
getTargetPosition = function(e) {
|
||||
if (self._expanded) {
|
||||
return compPosi(e._target.position);
|
||||
|
@ -110,7 +109,7 @@ function CommunityNode(parent, initial) {
|
|||
.attr("height", boundingBox.height + 30);
|
||||
bBoxTitle.attr("width", boundingBox.width + 10);
|
||||
},
|
||||
|
||||
|
||||
getObserver = function() {
|
||||
if (!observer) {
|
||||
var factory = new DomObserverFactory();
|
||||
|
@ -125,7 +124,7 @@ function CommunityNode(parent, initial) {
|
|||
}
|
||||
return observer;
|
||||
},
|
||||
|
||||
|
||||
updateNodeArray = function() {
|
||||
layouter.stop();
|
||||
nodeArray.length = 0;
|
||||
|
@ -134,7 +133,7 @@ function CommunityNode(parent, initial) {
|
|||
});
|
||||
layouter.start();
|
||||
},
|
||||
|
||||
|
||||
updateEdgeArray = function() {
|
||||
layouter.stop();
|
||||
intEdgeArray.length = 0;
|
||||
|
@ -143,7 +142,7 @@ function CommunityNode(parent, initial) {
|
|||
});
|
||||
layouter.start();
|
||||
},
|
||||
|
||||
|
||||
toArray = function(obj) {
|
||||
var res = [];
|
||||
_.each(obj, function(v) {
|
||||
|
@ -151,19 +150,19 @@ function CommunityNode(parent, initial) {
|
|||
});
|
||||
return res;
|
||||
},
|
||||
|
||||
|
||||
hasNode = function(id) {
|
||||
return !!nodes[id];
|
||||
},
|
||||
|
||||
|
||||
getNodes = function() {
|
||||
return nodeArray;
|
||||
},
|
||||
|
||||
|
||||
getNode = function(id) {
|
||||
return nodes[id];
|
||||
},
|
||||
|
||||
|
||||
insertNode = function(n) {
|
||||
nodes[n._id] = n;
|
||||
updateNodeArray();
|
||||
|
@ -177,14 +176,14 @@ function CommunityNode(parent, initial) {
|
|||
});
|
||||
updateNodeArray();
|
||||
},
|
||||
|
||||
|
||||
removeNode = function(n) {
|
||||
var id = n._id || n;
|
||||
delete nodes[id];
|
||||
updateNodeArray();
|
||||
self._size--;
|
||||
},
|
||||
|
||||
|
||||
removeInboundEdge = function(e) {
|
||||
var id;
|
||||
if (!_.has(e, "_id")) {
|
||||
|
@ -206,7 +205,7 @@ function CommunityNode(parent, initial) {
|
|||
self._inboundCounter--;
|
||||
return;
|
||||
},
|
||||
|
||||
|
||||
removeOutboundEdge = function(e) {
|
||||
var id;
|
||||
if (!_.has(e, "_id")) {
|
||||
|
@ -229,7 +228,7 @@ function CommunityNode(parent, initial) {
|
|||
self._outboundCounter--;
|
||||
return;
|
||||
},
|
||||
|
||||
|
||||
removeOutboundEdgesFromNode = function(n) {
|
||||
var id = n._id || n,
|
||||
res = [];
|
||||
|
@ -240,7 +239,7 @@ function CommunityNode(parent, initial) {
|
|||
delete outReferences[id];
|
||||
return res;
|
||||
},
|
||||
|
||||
|
||||
insertInboundEdge = function(e) {
|
||||
e._target = e.target;
|
||||
e.target = self;
|
||||
|
@ -255,7 +254,7 @@ function CommunityNode(parent, initial) {
|
|||
self._inboundCounter++;
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
insertOutboundEdge = function(e) {
|
||||
var sId = e.source._id;
|
||||
e._source = e.source;
|
||||
|
@ -273,7 +272,7 @@ function CommunityNode(parent, initial) {
|
|||
outbound[e._id] = e;
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
getDissolveInfo = function() {
|
||||
return {
|
||||
nodes: nodeArray,
|
||||
|
@ -284,15 +283,15 @@ function CommunityNode(parent, initial) {
|
|||
}
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
expand = function() {
|
||||
this._expanded = true;
|
||||
},
|
||||
|
||||
|
||||
dissolve = function() {
|
||||
parent.dissolveCommunity(self);
|
||||
},
|
||||
|
||||
|
||||
collapse = function() {
|
||||
this._expanded = false;
|
||||
},
|
||||
|
@ -321,7 +320,7 @@ function CommunityNode(parent, initial) {
|
|||
.attr("fill", colourMapper.getCommunityColour())
|
||||
.text(self._size);
|
||||
},
|
||||
|
||||
|
||||
addCollapsedShape = function(g, shapeFunc, start, colourMapper) {
|
||||
var inner = g.append("g")
|
||||
.attr("stroke", colourMapper.getForegroundCommunityColour())
|
||||
|
@ -354,7 +353,7 @@ function CommunityNode(parent, initial) {
|
|||
interior.selectAll("* > *").remove();
|
||||
shapeQue(interior);
|
||||
},
|
||||
|
||||
|
||||
addBoundingBox = function(g, start) {
|
||||
bBox = g.append("g");
|
||||
bBoxBorder = bBox.append("rect")
|
||||
|
@ -406,12 +405,12 @@ function CommunityNode(parent, initial) {
|
|||
attributes:true
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
addDistortion = function(distFunc) {
|
||||
if (self._expanded) {
|
||||
var oldFocus = distFunc.focus(),
|
||||
newFocus = [
|
||||
oldFocus[0] - self.position.x,
|
||||
oldFocus[0] - self.position.x,
|
||||
oldFocus[1] - self.position.y
|
||||
];
|
||||
distFunc.focus(newFocus);
|
||||
|
@ -424,7 +423,7 @@ function CommunityNode(parent, initial) {
|
|||
distFunc.focus(oldFocus);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
shapeAll = function(g, shapeFunc, shapeQue, start, colourMapper) {
|
||||
// First unbind all click events that are proably still bound
|
||||
g.on("click", null);
|
||||
|
@ -435,7 +434,7 @@ function CommunityNode(parent, initial) {
|
|||
}
|
||||
addCollapsedShape(g, shapeFunc, start, colourMapper);
|
||||
},
|
||||
|
||||
|
||||
updateEdges = function(g, addPosition, addUpdate) {
|
||||
if (self._expanded) {
|
||||
var interior = g.selectAll(".link"),
|
||||
|
@ -444,7 +443,7 @@ function CommunityNode(parent, initial) {
|
|||
addUpdate(interior);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
shapeEdges = function(g, addQue) {
|
||||
var idFunction = function(d) {
|
||||
return d._id;
|
||||
|
@ -455,7 +454,7 @@ function CommunityNode(parent, initial) {
|
|||
interior = g
|
||||
.selectAll(".link")
|
||||
.data(intEdgeArray, idFunction);
|
||||
// Append the group and class to all new
|
||||
// Append the group and class to all new
|
||||
interior.enter()
|
||||
.append("g")
|
||||
.attr("class", "link") // link is CSS class that might be edited
|
||||
|
@ -468,15 +467,15 @@ function CommunityNode(parent, initial) {
|
|||
addQue(line, interior);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
collapseNode = function(n) {
|
||||
removeOutboundEdgesFromNode(n);
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// Setup //
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
layouter = new ForceLayouter({
|
||||
distance: 100,
|
||||
gravity: 0.1,
|
||||
|
@ -486,7 +485,7 @@ function CommunityNode(parent, initial) {
|
|||
nodes: nodeArray,
|
||||
links: intEdgeArray
|
||||
});
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// Values required for shaping //
|
||||
////////////////////////////////////
|
||||
|
@ -505,46 +504,46 @@ function CommunityNode(parent, initial) {
|
|||
// Easy check for the other classes,
|
||||
// no need for a regex on the _id any more.
|
||||
this._isCommunity = true;
|
||||
|
||||
|
||||
insertInitialNodes(initial);
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// Public functions //
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
this.hasNode = hasNode;
|
||||
this.getNodes = getNodes;
|
||||
this.getNode = getNode;
|
||||
this.getDistance = getDistance;
|
||||
this.getCharge = getCharge;
|
||||
|
||||
|
||||
|
||||
|
||||
this.insertNode = insertNode;
|
||||
this.insertInboundEdge = insertInboundEdge;
|
||||
this.insertOutboundEdge = insertOutboundEdge;
|
||||
|
||||
|
||||
this.removeNode = removeNode;
|
||||
this.removeInboundEdge = removeInboundEdge;
|
||||
this.removeOutboundEdge = removeOutboundEdge;
|
||||
this.removeOutboundEdgesFromNode = removeOutboundEdgesFromNode;
|
||||
|
||||
|
||||
|
||||
|
||||
this.collapseNode = collapseNode;
|
||||
|
||||
|
||||
this.dissolve = dissolve;
|
||||
this.getDissolveInfo = getDissolveInfo;
|
||||
|
||||
|
||||
this.collapse = collapse;
|
||||
this.expand = expand;
|
||||
|
||||
|
||||
this.shapeNodes = shapeAll;
|
||||
this.shapeInnerEdges = shapeEdges;
|
||||
this.updateInnerEdges = updateEdges;
|
||||
|
||||
|
||||
|
||||
|
||||
this.addDistortion = addDistortion;
|
||||
|
||||
this.getSourcePosition = getSourcePosition;
|
||||
|
||||
|
||||
this.getTargetPosition = getTargetPosition;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global window */
|
||||
|
||||
//////////////////////////////////
|
||||
|
@ -31,9 +30,9 @@
|
|||
|
||||
function DomObserverFactory() {
|
||||
"use strict";
|
||||
|
||||
|
||||
var Constructor = window.WebKitMutationObserver || window.MutationObserver;
|
||||
|
||||
|
||||
this.createObserver = function(callback) {
|
||||
if (!Constructor) {
|
||||
throw "Observer not supported";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global _, $, d3*/
|
||||
/*global ColourMapper, ContextMenu*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -45,7 +44,7 @@
|
|||
|
||||
function EdgeShaper(parent, config, idfunc) {
|
||||
"use strict";
|
||||
|
||||
|
||||
var self = this,
|
||||
edges = [],
|
||||
communityNodes = {},
|
||||
|
@ -93,7 +92,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
return d._id;
|
||||
},
|
||||
noop = function (line, g) {
|
||||
|
||||
|
||||
},
|
||||
colourMapper = new ColourMapper(),
|
||||
resetColourMap = function() {
|
||||
|
@ -104,7 +103,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
addShape = noop,
|
||||
addLabel = noop,
|
||||
addColor = noop,
|
||||
|
||||
|
||||
unbindEvents = function() {
|
||||
events = {
|
||||
click: noop,
|
||||
|
@ -117,12 +116,12 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
};
|
||||
addUpdate = noop;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
getCorner = function(s, t) {
|
||||
return Math.atan2(t.y - s.y, t.x - s.x) * 180 / Math.PI;
|
||||
},
|
||||
|
||||
|
||||
getDistance = function(s, t) {
|
||||
var res = Math.sqrt(
|
||||
(t.y - s.y)
|
||||
|
@ -141,15 +140,15 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
res -= Math.abs((res * t.z * 18) / (t.y - s.y));
|
||||
}
|
||||
}
|
||||
return res;
|
||||
return res;
|
||||
},
|
||||
|
||||
|
||||
addEvents = function (line, g) {
|
||||
_.each(events, function (func, type) {
|
||||
g.on(type, func);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
bindEvent = function (type, func) {
|
||||
if (type === "update") {
|
||||
addUpdate = func;
|
||||
|
@ -159,7 +158,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
events[type] = func;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
calculateNodePositions = function (e) {
|
||||
var sp, tp, s, t;
|
||||
s = e.source;
|
||||
|
@ -181,7 +180,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
t: tp
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
addPosition = function (line, g) {
|
||||
communityNodes = {};
|
||||
g.attr("transform", function(d) {
|
||||
|
@ -198,7 +197,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
return getDistance(p.s, p.t);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
addQue = function (line, g) {
|
||||
addShape(line, g);
|
||||
if (visibleLabels) {
|
||||
|
@ -208,7 +207,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
addEvents(line, g);
|
||||
addPosition(line, g);
|
||||
},
|
||||
|
||||
|
||||
shapeEdges = function (newEdges) {
|
||||
if (newEdges !== undefined) {
|
||||
edges = newEdges;
|
||||
|
@ -217,7 +216,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
g = self.parent
|
||||
.selectAll(".link")
|
||||
.data(edges, idFunction);
|
||||
// Append the group and class to all new
|
||||
// Append the group and class to all new
|
||||
g.enter()
|
||||
.append("g")
|
||||
.attr("class", "link") // link is CSS class that might be edited
|
||||
|
@ -230,10 +229,10 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
addQue(line, g);
|
||||
_.each(communityNodes, function(c) {
|
||||
c.shapeInnerEdges(d3.select(this), addQue);
|
||||
});
|
||||
});
|
||||
contextMenu.bindMenu($(".link"));
|
||||
},
|
||||
|
||||
|
||||
updateEdges = function () {
|
||||
var g = self.parent.selectAll(".link"),
|
||||
line = g.select("line");
|
||||
|
@ -243,7 +242,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
c.updateInnerEdges(d3.select(this), addPosition, addUpdate);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
parseShapeFlag = function (shape) {
|
||||
$("svg defs marker#arrow").remove();
|
||||
switch (shape.type) {
|
||||
|
@ -268,13 +267,13 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
.attr("markerWidth", "10")
|
||||
.attr("orient", "auto")
|
||||
.append("path")
|
||||
.attr("d", "M 0 0 L 10 5 L 0 10 z");
|
||||
.attr("d", "M 0 0 L 10 5 L 0 10 z");
|
||||
break;
|
||||
default:
|
||||
throw "Sorry given Shape not known!";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseLabelFlag = function (label) {
|
||||
if (_.isFunction(label)) {
|
||||
addLabel = function (line, g) {
|
||||
|
@ -286,7 +285,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
addLabel = function (line, g) {
|
||||
g.append("text") // Append a label for the edge
|
||||
.attr("text-anchor", "middle") // Define text-anchor
|
||||
.text(function(d) {
|
||||
.text(function(d) {
|
||||
// Which value should be used as label
|
||||
var chunks = splitLabel(findFirstValue(label, d._data));
|
||||
return chunks[0] || "";
|
||||
|
@ -303,7 +302,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
});
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
parseActionFlag = function (actions) {
|
||||
if (actions.reset !== undefined && actions.reset) {
|
||||
unbindEvents();
|
||||
|
@ -314,7 +313,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
parseColorFlag = function (color) {
|
||||
$("svg defs #gradientEdgeColor").remove();
|
||||
resetColourMap();
|
||||
|
@ -355,12 +354,12 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
return colourMapper.getColour(e._data[color.key]);
|
||||
});
|
||||
};
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
throw "Sorry given colour-scheme not known";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseConfig = function(config) {
|
||||
if (config.shape !== undefined) {
|
||||
parseShapeFlag(config.shape);
|
||||
|
@ -376,16 +375,16 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
parseColorFlag(config.color);
|
||||
}
|
||||
};
|
||||
|
||||
self.parent = parent;
|
||||
|
||||
|
||||
self.parent = parent;
|
||||
|
||||
unbindEvents();
|
||||
|
||||
|
||||
toplevelSVG = parent;
|
||||
while (toplevelSVG[0][0] && toplevelSVG[0][0].ownerSVGElement) {
|
||||
toplevelSVG = d3.select(toplevelSVG[0][0].ownerSVGElement);
|
||||
}
|
||||
|
||||
|
||||
if (config === undefined) {
|
||||
config = {
|
||||
color: {
|
||||
|
@ -394,7 +393,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (config.color === undefined) {
|
||||
config.color = {
|
||||
type: "single",
|
||||
|
@ -407,33 +406,33 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
if (_.isFunction(idfunc)) {
|
||||
idFunction = idfunc;
|
||||
}
|
||||
|
||||
|
||||
followEdgeG = toplevelSVG.append("g");
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
/// Public functions
|
||||
/////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
self.changeTo = function(config) {
|
||||
parseConfig(config);
|
||||
shapeEdges();
|
||||
updateEdges();
|
||||
};
|
||||
|
||||
|
||||
self.drawEdges = function (edges) {
|
||||
shapeEdges(edges);
|
||||
updateEdges();
|
||||
};
|
||||
|
||||
|
||||
self.updateEdges = function () {
|
||||
updateEdges();
|
||||
};
|
||||
|
||||
|
||||
self.reshapeEdges = function() {
|
||||
shapeEdges();
|
||||
};
|
||||
|
||||
|
||||
self.activateLabel = function(toogle) {
|
||||
if (toogle) {
|
||||
visibleLabels = true;
|
||||
|
@ -442,7 +441,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
}
|
||||
shapeEdges();
|
||||
};
|
||||
|
||||
|
||||
self.addAnEdgeFollowingTheCursor = function(x, y) {
|
||||
followEdge = followEdgeG.append("line");
|
||||
followEdge.attr("stroke", "black")
|
||||
|
@ -455,7 +454,7 @@ function EdgeShaper(parent, config, idfunc) {
|
|||
followEdge.attr("x2", x).attr("y2", y);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
self.removeCursorFollowingEdge = function() {
|
||||
if (followEdge.remove) {
|
||||
followEdge.remove();
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*global _, $, window, d3*/
|
||||
/*global EventLibrary*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -29,7 +28,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
function EventDispatcher(nodeShaper, edgeShaper, config) {
|
||||
"use strict";
|
||||
|
||||
|
||||
var eventlib,
|
||||
svgBase,
|
||||
svgTemp,
|
||||
|
@ -43,7 +42,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
var insert = new eventlib.InsertNode(config),
|
||||
patch = new eventlib.PatchNode(config),
|
||||
del = new eventlib.DeleteNode(config);
|
||||
|
||||
|
||||
self.events.CREATENODE = function(getNewData, callback, x, y) {
|
||||
var data;
|
||||
if (!_.isFunction(getNewData)) {
|
||||
|
@ -63,7 +62,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
patch(node, getNewData(), callback);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
self.events.DELETENODE = function(callback) {
|
||||
return function(node) {
|
||||
del(node, callback);
|
||||
|
@ -71,7 +70,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
};
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseEdgeEditorConfig = function(config) {
|
||||
if (config.shaper === undefined) {
|
||||
config.shaper = edgeShaper;
|
||||
|
@ -82,7 +81,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
del = new eventlib.DeleteEdge(config),
|
||||
edgeStart = null,
|
||||
didInsert = false;
|
||||
|
||||
|
||||
self.events.STARTCREATEEDGE = function(callback) {
|
||||
return function(node) {
|
||||
var e = d3.event || window.event;
|
||||
|
@ -95,7 +94,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
e.stopPropagation();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
self.events.CANCELCREATEEDGE = function(callback) {
|
||||
return function() {
|
||||
edgeStart = null;
|
||||
|
@ -104,7 +103,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
self.events.FINISHCREATEEDGE = function(callback) {
|
||||
return function(node) {
|
||||
if (edgeStart !== null && node !== edgeStart) {
|
||||
|
@ -113,7 +112,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
self.events.PATCHEDGE = function(edge, getNewData, callback) {
|
||||
if (!_.isFunction(getNewData)) {
|
||||
throw "Please give a function to extract the new node data";
|
||||
|
@ -122,7 +121,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
patch(edge, getNewData(), callback);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
self.events.DELETEEDGE = function(callback) {
|
||||
return function(edge) {
|
||||
del(edge, callback);
|
||||
|
@ -130,7 +129,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
};
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
bindSVGEvents = function() {
|
||||
svgObj = svgObj || $("svg");
|
||||
svgObj.unbind();
|
||||
|
@ -145,17 +144,17 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
if (nodeShaper === undefined) {
|
||||
throw "NodeShaper has to be given.";
|
||||
}
|
||||
|
||||
|
||||
if (edgeShaper === undefined) {
|
||||
throw "EdgeShaper has to be given.";
|
||||
}
|
||||
|
||||
|
||||
eventlib = new EventLibrary();
|
||||
|
||||
|
||||
svgBase = {
|
||||
click: [],
|
||||
dblclick: [],
|
||||
|
@ -166,9 +165,9 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
mouseover: []
|
||||
};
|
||||
svgTemp = {};
|
||||
|
||||
|
||||
self.events = {};
|
||||
|
||||
|
||||
if (config !== undefined) {
|
||||
if (config.expand !== undefined) {
|
||||
if (eventlib.checkExpandConfig(config.expand)) {
|
||||
|
@ -192,7 +191,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
}
|
||||
}
|
||||
Object.freeze(self.events);
|
||||
|
||||
|
||||
//Check for expand config
|
||||
self.bind = function (object, event, func) {
|
||||
if (func === undefined || !_.isFunction(func)) {
|
||||
|
@ -226,7 +225,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.rebind = function (object, actions) {
|
||||
actions = actions || {};
|
||||
actions.reset = true;
|
||||
|
@ -255,7 +254,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
|
|||
+ "\"nodes\", \"edges\" or \"svg\"";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.fixSVG = function(event, action) {
|
||||
if (svgBase[event] === undefined) {
|
||||
throw "Sorry unkown event";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
|
||||
/*global _*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -34,7 +33,7 @@
|
|||
// loadNode,
|
||||
// reshapeNodes
|
||||
// }
|
||||
//
|
||||
//
|
||||
// nodeEditor: {
|
||||
// nodes,
|
||||
// adapter,
|
||||
|
@ -51,9 +50,9 @@
|
|||
//
|
||||
function EventLibrary() {
|
||||
"use strict";
|
||||
|
||||
|
||||
var self = this;
|
||||
|
||||
|
||||
this.checkExpandConfig = function(config) {
|
||||
if (config.startCallback === undefined) {
|
||||
throw "A callback to the Start-method has to be defined";
|
||||
|
@ -66,10 +65,10 @@ function EventLibrary() {
|
|||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
this.Expand = function (config) {
|
||||
self.checkExpandConfig(config);
|
||||
var
|
||||
var
|
||||
startCallback = config.startCallback,
|
||||
explore = config.adapter.explore,
|
||||
reshapeNodes = config.reshapeNodes;
|
||||
|
@ -79,7 +78,7 @@ function EventLibrary() {
|
|||
startCallback();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.checkDragConfig = function (config) {
|
||||
if (config.layouter === undefined) {
|
||||
throw "A layouter has to be defined";
|
||||
|
@ -89,12 +88,12 @@ function EventLibrary() {
|
|||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
this.Drag = function (config) {
|
||||
self.checkDragConfig(config);
|
||||
return config.layouter.drag;
|
||||
};
|
||||
|
||||
|
||||
this.checkNodeEditorConfig = function (config) {
|
||||
if (config.adapter === undefined) {
|
||||
throw "An adapter has to be defined";
|
||||
|
@ -104,7 +103,7 @@ function EventLibrary() {
|
|||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
this.checkEdgeEditorConfig = function (config) {
|
||||
if (config.adapter === undefined) {
|
||||
throw "An adapter has to be defined";
|
||||
|
@ -114,12 +113,12 @@ function EventLibrary() {
|
|||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
this.InsertNode = function (config) {
|
||||
self.checkNodeEditorConfig(config);
|
||||
var adapter = config.adapter,
|
||||
nodeShaper = config.shaper;
|
||||
|
||||
|
||||
return function(data, callback, x, y) {
|
||||
var cb, d;
|
||||
if (_.isFunction(data) && !callback) {
|
||||
|
@ -135,12 +134,12 @@ function EventLibrary() {
|
|||
}, x, y);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.PatchNode = function (config) {
|
||||
self.checkNodeEditorConfig(config);
|
||||
var adapter = config.adapter,
|
||||
nodeShaper = config.shaper;
|
||||
|
||||
|
||||
return function(nodeToPatch, patchData, callback) {
|
||||
adapter.patchNode(nodeToPatch, patchData, function(patchedNode) {
|
||||
nodeShaper.reshapeNodes();
|
||||
|
@ -148,12 +147,12 @@ function EventLibrary() {
|
|||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.DeleteNode = function (config) {
|
||||
self.checkNodeEditorConfig(config);
|
||||
var adapter = config.adapter,
|
||||
nodeShaper = config.shaper;
|
||||
|
||||
|
||||
return function(nodeToDelete, callback) {
|
||||
adapter.deleteNode(nodeToDelete, function() {
|
||||
nodeShaper.reshapeNodes();
|
||||
|
@ -173,7 +172,7 @@ function EventLibrary() {
|
|||
callback();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.InsertEdge = function (config) {
|
||||
self.checkEdgeEditorConfig(config);
|
||||
var adapter = config.adapter,
|
||||
|
@ -185,7 +184,7 @@ function EventLibrary() {
|
|||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.PatchEdge = function (config) {
|
||||
self.checkEdgeEditorConfig(config);
|
||||
var adapter = config.adapter,
|
||||
|
@ -197,7 +196,7 @@ function EventLibrary() {
|
|||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.DeleteEdge = function (config) {
|
||||
self.checkEdgeEditorConfig(config);
|
||||
var adapter = config.adapter,
|
||||
|
@ -209,5 +208,5 @@ function EventLibrary() {
|
|||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global _, d3*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Graph functionality
|
||||
|
@ -33,11 +32,11 @@
|
|||
* {
|
||||
* nodes: nodes,
|
||||
* links: links,
|
||||
*
|
||||
*
|
||||
* (optional)
|
||||
* width: width,
|
||||
* height: height,
|
||||
* distance: distance,
|
||||
* distance: distance,
|
||||
* gravity: gravity,
|
||||
* onUpdate: callback
|
||||
* }
|
||||
|
@ -75,7 +74,7 @@ function ForceLayouter(config) {
|
|||
}
|
||||
return defaultCharge;
|
||||
},
|
||||
|
||||
|
||||
onUpdate = config.onUpdate || function () {},
|
||||
width = config.width || 880,
|
||||
height = config.height || 680,
|
||||
|
@ -90,7 +89,7 @@ function ForceLayouter(config) {
|
|||
defaultCharge = config.charge;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
if (config.nodes === undefined) {
|
||||
throw "No nodes defined";
|
||||
}
|
||||
|
@ -105,15 +104,15 @@ function ForceLayouter(config) {
|
|||
force.gravity(gravity); // Set gravity
|
||||
force.charge(charge); // Set charge
|
||||
force.on("tick", function(){}); // Bind tick function
|
||||
|
||||
|
||||
self.start = function() {
|
||||
force.start(); // Start Force computation
|
||||
};
|
||||
|
||||
|
||||
self.stop = function() {
|
||||
force.stop(); // Stop Force computation
|
||||
};
|
||||
|
||||
|
||||
self.drag = force.drag;
|
||||
|
||||
self.setCombinedUpdateFunction = function(nodeShaper, edgeShaper, additional) {
|
||||
|
@ -142,7 +141,7 @@ function ForceLayouter(config) {
|
|||
force.on("tick", onUpdate);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.changeTo = function(config) {
|
||||
parseConfig(config);
|
||||
};
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, d3, _, console, document*/
|
||||
/*global AbstractAdapter*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -30,7 +29,7 @@
|
|||
|
||||
function FoxxAdapter(nodes, edges, route, viewer, config) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (nodes === undefined) {
|
||||
throw "The nodes have to be given.";
|
||||
}
|
||||
|
@ -67,7 +66,7 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
fillRoutes = function () {
|
||||
routes.query = {
|
||||
get: function(id, cb) {
|
||||
|
@ -146,23 +145,23 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
}
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
sendGet = function (type, id, callback) {
|
||||
routes[type].get(id, callback);
|
||||
},
|
||||
|
||||
|
||||
sendPost = function (type, data, callback) {
|
||||
routes[type].post(data, callback);
|
||||
},
|
||||
|
||||
|
||||
sendDelete = function (type, id, callback) {
|
||||
routes[type].del(id, callback);
|
||||
},
|
||||
|
||||
|
||||
sendPut = function (type, id, data, callback) {
|
||||
routes[type].put(id, data, callback);
|
||||
},
|
||||
|
||||
|
||||
parseConfig = function(config) {
|
||||
/*
|
||||
if (config.host === undefined) {
|
||||
|
@ -201,17 +200,17 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
callback(first);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
if (config.prioList) {
|
||||
absConfig.prioList = config.prioList;
|
||||
}
|
||||
absAdapter = new AbstractAdapter(nodes, edges, this, viewer, absConfig);
|
||||
|
||||
|
||||
parseConfig(config);
|
||||
fillRoutes();
|
||||
|
||||
self.explore = absAdapter.explore;
|
||||
|
||||
|
||||
self.loadNode = function(nodeId, callback) {
|
||||
sendGet("query", nodeId, function(result) {
|
||||
parseResult(result, callback);
|
||||
|
@ -235,7 +234,7 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
});
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
self.createEdge = function (edgeToAdd, callback) {
|
||||
var toSend = _.clone(edgeToAdd);
|
||||
toSend._from = edgeToAdd.source._id;
|
||||
|
@ -252,7 +251,7 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.deleteEdge = function (edgeToRemove, callback) {
|
||||
sendDelete("edges", edgeToRemove._id, function() {
|
||||
absAdapter.removeEdge(edgeToRemove);
|
||||
|
@ -261,7 +260,7 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.patchEdge = function (edgeToPatch, patchData, callback) {
|
||||
sendPut("edges", edgeToPatch._id, patchData, function(data) {
|
||||
edgeToPatch._data = $.extend(edgeToPatch._data, patchData);
|
||||
|
@ -270,7 +269,7 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.createNode = function (nodeToAdd, callback) {
|
||||
sendPost("nodes", nodeToAdd, function(data) {
|
||||
absAdapter.insertNode(data);
|
||||
|
@ -279,7 +278,7 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.deleteNode = function (nodeToRemove, callback) {
|
||||
sendDelete("nodes", nodeToRemove._id, function() {
|
||||
absAdapter.removeEdgesForNode(nodeToRemove);
|
||||
|
@ -290,7 +289,7 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.patchNode = function (nodeToPatch, patchData, callback) {
|
||||
sendPut("nodes", nodeToPatch._id, patchData, function(data) {
|
||||
nodeToPatch._data = $.extend(nodeToPatch._data, patchData);
|
||||
|
@ -299,22 +298,22 @@ function FoxxAdapter(nodes, edges, route, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.setNodeLimit = function (pLimit, callback) {
|
||||
absAdapter.setNodeLimit(pLimit, callback);
|
||||
};
|
||||
|
||||
|
||||
self.setChildLimit = function (pLimit) {
|
||||
absAdapter.setChildLimit(pLimit);
|
||||
};
|
||||
|
||||
|
||||
self.expandCommunity = function (commNode, callback) {
|
||||
absAdapter.expandCommunity(commNode);
|
||||
if (callback !== undefined) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.setWidth = absAdapter.setWidth;
|
||||
self.changeTo = absAdapter.changeTo;
|
||||
self.getPrioList = absAdapter.getPrioList;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, d3, _, console, document*/
|
||||
/*global AbstractAdapter*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -89,7 +88,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
getCollectionsFromGraph(name);
|
||||
api.edges = api.graph + "/" + graphName + "/edge/";
|
||||
api.vertices = api.graph + "/" + graphName + "/vertex/";
|
||||
api.any = api.base + "simple/any";
|
||||
api.any = api.base + "simple/any";
|
||||
},
|
||||
|
||||
parseConfig = function(config) {
|
||||
|
@ -118,7 +117,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
setGraphName(config.graphName);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
sendQuery = function(query, bindVars, onSuccess) {
|
||||
if (query !== queries.getAllGraphs) {
|
||||
bindVars.graph = graphName;
|
||||
|
@ -153,7 +152,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
getNRandom = function(n, callback) {
|
||||
sendQuery(queries.randomVertices, {
|
||||
limit: n
|
||||
|
@ -161,7 +160,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
callback(res);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
parseResultOfTraversal = function (result, callback) {
|
||||
if (result.length === 0
|
||||
|| result[0].length === 0
|
||||
|
@ -177,7 +176,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
var inserted = {},
|
||||
n = absAdapter.insertNode(result[0].vertex),
|
||||
oldLength = nodes.length;
|
||||
|
||||
|
||||
_.each(result, function(visited) {
|
||||
var node = absAdapter.insertNode(visited.vertex),
|
||||
path = visited.path;
|
||||
|
@ -195,7 +194,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
_.each(path.edges, function(edge) {
|
||||
absAdapter.insertEdge(edge);
|
||||
});
|
||||
});
|
||||
});
|
||||
delete inserted[n._id];
|
||||
absAdapter.checkSizeOfInserted(inserted);
|
||||
absAdapter.checkNodeLimit(n);
|
||||
|
@ -214,14 +213,14 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (config.prioList) {
|
||||
absConfig.prioList = config.prioList;
|
||||
}
|
||||
absAdapter = new AbstractAdapter(nodes, edges, this, viewer, absConfig);
|
||||
|
||||
|
||||
parseConfig(config);
|
||||
|
||||
|
||||
queries.getAllGraphs = "FOR g IN _graphs"
|
||||
+ " return g._key";
|
||||
queries.traversal = "RETURN GRAPH_TRAVERSAL("
|
||||
|
@ -235,9 +234,9 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
queries.childrenCentrality = "RETURN LENGTH(GRAPH_EDGES(@graph, @id, {direction: any}))";
|
||||
queries.connectedEdges = "RETURN GRAPH_EDGES(@graph, @id)";
|
||||
queries.randomVertices = "FOR x IN GRAPH_VERTICES(@graph, {}) SORT RAND() LIMIT @limit RETURN x";
|
||||
|
||||
|
||||
self.explore = absAdapter.explore;
|
||||
|
||||
|
||||
self.loadNode = function(nodeId, callback) {
|
||||
self.loadNodeFromTreeById(nodeId, callback);
|
||||
};
|
||||
|
@ -245,18 +244,18 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
self.loadRandomNode = function(callback) {
|
||||
getNRandom(1, function(list) {
|
||||
if (list.length === 0) {
|
||||
callback({errorCode: 404});
|
||||
callback({errorCode: 404});
|
||||
return;
|
||||
}
|
||||
self.loadInitialNode(list[0]._id, callback);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.loadInitialNode = function(nodeId, callback) {
|
||||
absAdapter.cleanUp();
|
||||
self.loadNode(nodeId, insertInitialCallback(callback));
|
||||
};
|
||||
|
||||
|
||||
self.loadNodeFromTreeById = function(nodeId, callback) {
|
||||
sendQuery(queries.traversal, {
|
||||
example: nodeId
|
||||
|
@ -264,7 +263,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
parseResultOfTraversal(res, callback);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.loadNodeFromTreeByAttributeValue = function(attribute, value, callback) {
|
||||
var example = {};
|
||||
example[attribute] = value;
|
||||
|
@ -273,13 +272,13 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
}, function(res) {
|
||||
parseResultOfTraversal(res, callback);
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
self.loadInitialNodeByAttributeValue = function(attribute, value, callback) {
|
||||
absAdapter.cleanUp();
|
||||
self.loadNodeFromTreeByAttributeValue(attribute, value, insertInitialCallback(callback));
|
||||
};
|
||||
|
||||
|
||||
self.requestCentralityChildren = function(nodeId, callback) {
|
||||
sendQuery(queries.childrenCentrality,{
|
||||
id: nodeId
|
||||
|
@ -287,8 +286,8 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
callback(res[0]);
|
||||
});
|
||||
};
|
||||
|
||||
self.createEdge = function (info, callback) {
|
||||
|
||||
self.createEdge = function (info, callback) {
|
||||
var edgeToAdd = {};
|
||||
edgeToAdd._from = info.source._id;
|
||||
edgeToAdd._to = info.target._id;
|
||||
|
@ -314,7 +313,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.deleteEdge = function (edgeToRemove, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -333,9 +332,9 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
throw data.statusText;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
self.patchEdge = function (edgeToPatch, patchData, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -354,7 +353,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.createNode = function (nodeToAdd, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -378,7 +377,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.deleteNode = function (nodeToRemove, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -399,7 +398,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.patchNode = function (nodeToPatch, patchData, callback) {
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -418,7 +417,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
self.changeToGraph = function (name, dir) {
|
||||
absAdapter.cleanUp();
|
||||
setGraphName(name);
|
||||
|
@ -430,32 +429,32 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.setNodeLimit = function (pLimit, callback) {
|
||||
absAdapter.setNodeLimit(pLimit, callback);
|
||||
};
|
||||
|
||||
|
||||
self.setChildLimit = function (pLimit) {
|
||||
absAdapter.setChildLimit(pLimit);
|
||||
};
|
||||
|
||||
|
||||
self.expandCommunity = function (commNode, callback) {
|
||||
absAdapter.expandCommunity(commNode);
|
||||
if (callback !== undefined) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.getGraphs = function(callback) {
|
||||
if (callback && callback.length >= 1) {
|
||||
if (callback && callback.length >= 1) {
|
||||
sendQuery(
|
||||
queries.getAllGraphs,
|
||||
{},
|
||||
{},
|
||||
callback
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.getAttributeExamples = function(callback) {
|
||||
if (callback && callback.length >= 1) {
|
||||
getNRandom(10, function(l) {
|
||||
|
@ -513,7 +512,7 @@ function GharialAdapter(nodes, edges, viewer, config) {
|
|||
self.getGraphName = function () {
|
||||
return graphName;
|
||||
};
|
||||
|
||||
|
||||
self.setWidth = absAdapter.setWidth;
|
||||
self.changeTo = absAdapter.changeTo;
|
||||
self.getPrioList = absAdapter.getPrioList;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global _*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Graph functionality
|
||||
|
@ -29,8 +28,8 @@
|
|||
|
||||
function ModularityJoiner() {
|
||||
"use strict";
|
||||
|
||||
var
|
||||
|
||||
var
|
||||
// Copy of underscore.js. importScripts doesn't work
|
||||
breaker = {},
|
||||
nativeForEach = Array.prototype.forEach,
|
||||
|
@ -206,11 +205,11 @@ function ModularityJoiner() {
|
|||
heap = null,
|
||||
isRunning = false,
|
||||
comms = {},
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// Private functions //
|
||||
////////////////////////////////////
|
||||
|
||||
////////////////////////////////////
|
||||
|
||||
setHeapToMax = function(id) {
|
||||
var maxT,
|
||||
maxV = Number.NEGATIVE_INFINITY;
|
||||
|
@ -226,18 +225,18 @@ function ModularityJoiner() {
|
|||
}
|
||||
heap[id] = maxT;
|
||||
},
|
||||
|
||||
|
||||
setHeapToMaxInList = function(l, id) {
|
||||
setHeapToMax(id);
|
||||
},
|
||||
|
||||
|
||||
isSetDQVal = function(i, j) {
|
||||
if (i < j) {
|
||||
return dQ[i] && dQ[i][j];
|
||||
}
|
||||
return dQ[j] && dQ[j][i];
|
||||
},
|
||||
|
||||
|
||||
// This does not check if everything exists,
|
||||
// do it before!
|
||||
getDQVal = function(i, j) {
|
||||
|
@ -246,7 +245,7 @@ function ModularityJoiner() {
|
|||
}
|
||||
return dQ[j][i];
|
||||
},
|
||||
|
||||
|
||||
setDQVal = function(i, j, v) {
|
||||
if (i < j) {
|
||||
dQ[i] = dQ[i] || {};
|
||||
|
@ -256,7 +255,7 @@ function ModularityJoiner() {
|
|||
dQ[j] = dQ[j] || {};
|
||||
dQ[j][i] = v;
|
||||
},
|
||||
|
||||
|
||||
delDQVal = function(i, j) {
|
||||
if (i < j) {
|
||||
if (!dQ[i]) {
|
||||
|
@ -273,7 +272,7 @@ function ModularityJoiner() {
|
|||
}
|
||||
delDQVal(j, i);
|
||||
},
|
||||
|
||||
|
||||
updateHeap = function(i, j) {
|
||||
var hv, val;
|
||||
if (i < j) {
|
||||
|
@ -301,26 +300,26 @@ function ModularityJoiner() {
|
|||
}
|
||||
updateHeap(j, i);
|
||||
},
|
||||
|
||||
|
||||
updateDegrees = function(low, high) {
|
||||
a[low]._in += a[high]._in;
|
||||
a[low]._out += a[high]._out;
|
||||
delete a[high];
|
||||
},
|
||||
},
|
||||
|
||||
insertEdge = function(s, t) {
|
||||
matrix[s] = matrix[s] || {};
|
||||
matrix[s][t] = (matrix[s][t] || 0) + 1;
|
||||
backwardMatrix[t] = backwardMatrix[t] || {};
|
||||
backwardMatrix[t][s] = (backwardMatrix[t][s] || 0) + 1;
|
||||
degrees[s] = degrees[s] || {_in: 0, _out:0};
|
||||
degrees[s] = degrees[s] || {_in: 0, _out:0};
|
||||
degrees[t] = degrees[t] || {_in: 0, _out:0};
|
||||
degrees[s]._out++;
|
||||
degrees[t]._in++;
|
||||
m++;
|
||||
revM = Math.pow(m, -1);
|
||||
},
|
||||
|
||||
|
||||
deleteEdge = function(s, t) {
|
||||
if (matrix[s]) {
|
||||
matrix[s][t]--;
|
||||
|
@ -353,7 +352,7 @@ function ModularityJoiner() {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
makeInitialDegrees = function() {
|
||||
a = {};
|
||||
_.each(degrees, function (n, id) {
|
||||
|
@ -364,17 +363,17 @@ function ModularityJoiner() {
|
|||
});
|
||||
return a;
|
||||
},
|
||||
|
||||
|
||||
notConnectedPenalty = function(s, t) {
|
||||
return a[s]._out * a[t]._in + a[s]._in * a[t]._out;
|
||||
},
|
||||
|
||||
|
||||
neighbors = function(sID) {
|
||||
var outbound = _.keys(matrix[sID] || {}),
|
||||
inbound = _.keys(backwardMatrix[sID] || {});
|
||||
return _.union(outbound, inbound);
|
||||
},
|
||||
|
||||
|
||||
makeInitialDQ = function() {
|
||||
dQ = {};
|
||||
_.each(matrix, function(tars, s) {
|
||||
|
@ -391,15 +390,15 @@ function ModularityJoiner() {
|
|||
return;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
makeInitialHeap = function() {
|
||||
heap = {};
|
||||
_.each(dQ, setHeapToMaxInList);
|
||||
return heap;
|
||||
},
|
||||
|
||||
|
||||
// i < j && i != j != k
|
||||
updateDQAndHeapValue = function (i, j, k) {
|
||||
var val;
|
||||
|
@ -421,7 +420,7 @@ function ModularityJoiner() {
|
|||
return;
|
||||
}
|
||||
if (isSetDQVal(k, j)) {
|
||||
val = getDQVal(k, j);
|
||||
val = getDQVal(k, j);
|
||||
val -= notConnectedPenalty(k, i);
|
||||
if (val > 0) {
|
||||
setDQVal(k, i, val);
|
||||
|
@ -431,7 +430,7 @@ function ModularityJoiner() {
|
|||
updateHeap(k, j);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
updateDQAndHeap = function (low, high) {
|
||||
_.each(dQ, function (list, s) {
|
||||
if (s === low || s === high) {
|
||||
|
@ -452,27 +451,27 @@ function ModularityJoiner() {
|
|||
////////////////////////////////////
|
||||
// getters //
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
getAdjacencyMatrix = function() {
|
||||
return matrix;
|
||||
},
|
||||
|
||||
|
||||
getHeap = function() {
|
||||
return heap;
|
||||
},
|
||||
|
||||
|
||||
getDQ = function() {
|
||||
return dQ;
|
||||
},
|
||||
|
||||
|
||||
getDegrees = function() {
|
||||
return a;
|
||||
},
|
||||
|
||||
|
||||
getCommunities = function() {
|
||||
return comms;
|
||||
},
|
||||
|
||||
|
||||
getBest = function() {
|
||||
var bestL, bestS, bestV = Number.NEGATIVE_INFINITY;
|
||||
_.each(heap, function(lID, sID) {
|
||||
|
@ -491,7 +490,7 @@ function ModularityJoiner() {
|
|||
val: bestV
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
getBestCommunity = function (communities) {
|
||||
var bestQ = Number.NEGATIVE_INFINITY,
|
||||
bestC;
|
||||
|
@ -503,28 +502,28 @@ function ModularityJoiner() {
|
|||
});
|
||||
return bestC;
|
||||
},
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// setup //
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
setup = function() {
|
||||
makeInitialDegrees();
|
||||
makeInitialDQ();
|
||||
makeInitialHeap();
|
||||
comms = {};
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// computation //
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
joinCommunity = function(comm) {
|
||||
var s = comm.sID,
|
||||
l = comm.lID,
|
||||
q = comm.val;
|
||||
|
||||
|
||||
comms[s] = comms[s] || {nodes: [s], q: 0};
|
||||
if (comms[l]) {
|
||||
comms[s].nodes = comms[s].nodes.concat(comms[l].nodes);
|
||||
|
@ -537,11 +536,11 @@ function ModularityJoiner() {
|
|||
updateDQAndHeap(s, l);
|
||||
updateDegrees(s, l);
|
||||
},
|
||||
|
||||
|
||||
//////////////////////////////////////////////
|
||||
// Evaluate value of community by distance //
|
||||
//////////////////////////////////////////////
|
||||
|
||||
|
||||
floatDistStep = function(dist, depth, todo) {
|
||||
if (todo.length === 0) {
|
||||
return true;
|
||||
|
@ -556,7 +555,7 @@ function ModularityJoiner() {
|
|||
});
|
||||
return floatDistStep(dist, depth+1, nextTodo);
|
||||
},
|
||||
|
||||
|
||||
floatDist = function(sID) {
|
||||
var dist = {};
|
||||
_.each(matrix, function(u, n) {
|
||||
|
@ -568,17 +567,17 @@ function ModularityJoiner() {
|
|||
}
|
||||
throw "FAIL!";
|
||||
},
|
||||
|
||||
|
||||
minDist = function(dist) {
|
||||
return function(a) {
|
||||
return dist[a];
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// Get only the Best Community //
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
getCommunity = function(limit, focus) {
|
||||
var coms = {},
|
||||
res = [],
|
||||
|
@ -606,7 +605,7 @@ function ModularityJoiner() {
|
|||
delete coms[key];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
res = _.pluck(_.values(coms), "nodes");
|
||||
dist = floatDist(focus);
|
||||
res.sort(sortByDistance);
|
||||
|
@ -614,30 +613,30 @@ function ModularityJoiner() {
|
|||
}
|
||||
return getBestCommunity(coms);
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// Public functions //
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
this.insertEdge = insertEdge;
|
||||
|
||||
|
||||
this.deleteEdge = deleteEdge;
|
||||
|
||||
|
||||
this.getAdjacencyMatrix = getAdjacencyMatrix;
|
||||
|
||||
|
||||
this.getHeap = getHeap;
|
||||
|
||||
|
||||
this.getDQ = getDQ;
|
||||
|
||||
|
||||
this.getDegrees = getDegrees;
|
||||
|
||||
|
||||
this.getCommunities = getCommunities;
|
||||
|
||||
|
||||
this.getBest = getBest;
|
||||
|
||||
|
||||
this.setup = setup;
|
||||
|
||||
|
||||
this.joinCommunity = joinCommunity;
|
||||
|
||||
this.getCommunity = getCommunity;
|
||||
|
||||
this.getCommunity = getCommunity;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global _*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Graph functionality
|
||||
|
@ -29,23 +28,23 @@
|
|||
|
||||
function NodeReducer(prioList) {
|
||||
"use strict";
|
||||
|
||||
|
||||
prioList = prioList || [];
|
||||
|
||||
var
|
||||
|
||||
|
||||
var
|
||||
|
||||
////////////////////////////////////
|
||||
// Private functions //
|
||||
////////////////////////////////////
|
||||
|
||||
////////////////////////////////////
|
||||
|
||||
/////////////////////////////
|
||||
// Functions for Buckets //
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
addNode = function(bucket, node) {
|
||||
bucket.push(node);
|
||||
},
|
||||
|
||||
|
||||
getSimilarityValue = function(bucketContainer, node) {
|
||||
if (!bucketContainer.reason.example) {
|
||||
bucketContainer.reason.example = node;
|
||||
|
@ -69,15 +68,15 @@ function NodeReducer(prioList) {
|
|||
countMatch++;
|
||||
return countMatch / propCount;
|
||||
},
|
||||
|
||||
|
||||
getPrioList = function() {
|
||||
return prioList;
|
||||
},
|
||||
|
||||
|
||||
changePrioList = function (list) {
|
||||
prioList = list;
|
||||
},
|
||||
|
||||
|
||||
bucketByPrioList = function (toSort, numBuckets) {
|
||||
var res = {},
|
||||
resArray = [];
|
||||
|
@ -118,7 +117,7 @@ function NodeReducer(prioList) {
|
|||
},
|
||||
|
||||
bucketNodes = function(toSort, numBuckets) {
|
||||
|
||||
|
||||
var res = [],
|
||||
threshold = 0.5;
|
||||
if (toSort.length <= numBuckets) {
|
||||
|
@ -161,15 +160,15 @@ function NodeReducer(prioList) {
|
|||
});
|
||||
return res;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// Public functions //
|
||||
////////////////////////////////////
|
||||
|
||||
|
||||
this.bucketNodes = bucketNodes;
|
||||
|
||||
|
||||
this.changePrioList = changePrioList;
|
||||
|
||||
|
||||
this.getPrioList = getPrioList;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, _, d3*/
|
||||
/*global ColourMapper, ContextMenu*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -119,7 +118,7 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
return chunks;
|
||||
},
|
||||
noop = function (node) {
|
||||
|
||||
|
||||
},
|
||||
start = noop,
|
||||
defaultDistortion = function(n) {
|
||||
|
@ -169,7 +168,7 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
};
|
||||
addUpdate = noop;
|
||||
},
|
||||
|
||||
|
||||
addEvents = function (nodes) {
|
||||
_.each(events, function (func, type) {
|
||||
if (type === "drag") {
|
||||
|
@ -177,10 +176,10 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
} else {
|
||||
nodes.on(type, func);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
addQue = function (g) {
|
||||
var community = g.filter(function(n) {
|
||||
return n._isCommunity;
|
||||
|
@ -199,7 +198,7 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
addEvents(normal);
|
||||
addDistortion();
|
||||
},
|
||||
|
||||
|
||||
bindEvent = function (type, func) {
|
||||
if (type === "update") {
|
||||
addUpdate = func;
|
||||
|
@ -209,16 +208,16 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
events[type] = func;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
updateNodes = function () {
|
||||
var nodes = self.parent.selectAll(".node");
|
||||
addDistortion();
|
||||
nodes.attr("transform", function(d) {
|
||||
return "translate(" + d.position.x + "," + d.position.y + ")scale(" + d.position.z + ")";
|
||||
return "translate(" + d.position.x + "," + d.position.y + ")scale(" + d.position.z + ")";
|
||||
});
|
||||
addUpdate(nodes);
|
||||
},
|
||||
|
||||
|
||||
shapeNodes = function (newNodes) {
|
||||
if (newNodes !== undefined) {
|
||||
nodes = newNodes;
|
||||
|
@ -226,7 +225,7 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
var g = self.parent
|
||||
.selectAll(".node")
|
||||
.data(nodes, idFunction);
|
||||
// Append the group and class to all new
|
||||
// Append the group and class to all new
|
||||
g.enter()
|
||||
.append("g")
|
||||
.attr("class", function(d) {
|
||||
|
@ -338,7 +337,7 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
throw "Sorry given Shape not known!";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseLabelFlag = function (label) {
|
||||
if (_.isFunction(label)) {
|
||||
addLabel = function (node) {
|
||||
|
@ -382,7 +381,7 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
};
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseActionFlag = function (actions) {
|
||||
if (actions.reset !== undefined && actions.reset) {
|
||||
unbindEvents();
|
||||
|
@ -393,7 +392,7 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
parseColorFlag = function (color) {
|
||||
resetColourMap();
|
||||
switch (color.type) {
|
||||
|
@ -438,12 +437,12 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
}
|
||||
return colourMapper.getForegroundColour(findFirstValue(color.key, n._data));
|
||||
};
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
throw "Sorry given colour-scheme not known";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseDistortionFlag = function (dist) {
|
||||
if (dist === "reset") {
|
||||
distortion = defaultDistortion;
|
||||
|
@ -453,7 +452,7 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
throw "Sorry distortion cannot be parsed.";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseConfig = function(config) {
|
||||
if (config.shape !== undefined) {
|
||||
parseShapeFlag(config.shape);
|
||||
|
@ -473,61 +472,61 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
parseDistortionFlag(config.distortion);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.parent = parent;
|
||||
|
||||
|
||||
unbindEvents();
|
||||
|
||||
|
||||
if (flags === undefined) {
|
||||
flags = {};
|
||||
}
|
||||
|
||||
|
||||
if (flags.shape === undefined) {
|
||||
flags.shape = {
|
||||
type: NodeShaper.shapes.RECT
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (flags.color === undefined) {
|
||||
flags.color = {
|
||||
type: "single",
|
||||
fill: "#333333",
|
||||
stroke: "white"
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (flags.distortion === undefined) {
|
||||
flags.distortion = "reset";
|
||||
}
|
||||
|
||||
|
||||
parseConfig(flags);
|
||||
|
||||
if (_.isFunction(idfunc)) {
|
||||
idFunction = idfunc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
/// Public functions
|
||||
/////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
self.changeTo = function(config) {
|
||||
parseConfig(config);
|
||||
shapeNodes();
|
||||
};
|
||||
|
||||
|
||||
self.drawNodes = function (nodes) {
|
||||
shapeNodes(nodes);
|
||||
};
|
||||
|
||||
|
||||
self.updateNodes = function () {
|
||||
updateNodes();
|
||||
};
|
||||
|
||||
|
||||
self.reshapeNodes = function() {
|
||||
shapeNodes();
|
||||
};
|
||||
|
||||
|
||||
self.activateLabel = function(toogle) {
|
||||
if (toogle) {
|
||||
visibleLabels = true;
|
||||
|
@ -536,15 +535,15 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
}
|
||||
shapeNodes();
|
||||
};
|
||||
|
||||
|
||||
self.getColourMapping = function() {
|
||||
return colourMapper.getList();
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
self.setColourMappingListener = function(callback) {
|
||||
colourMapper.setChangeListener(callback);
|
||||
};
|
||||
|
||||
|
||||
self.setGVStartFunction = function(func) {
|
||||
start = func;
|
||||
};
|
||||
|
@ -552,7 +551,7 @@ function NodeShaper(parent, flags, idfunc) {
|
|||
self.getLabel = function() {
|
||||
return self.label || "";
|
||||
};
|
||||
|
||||
|
||||
self.getColor = function() {
|
||||
return self.color.key || "";
|
||||
};
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, d3, _, console, document, window*/
|
||||
/*global AbstractAdapter*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -30,7 +29,7 @@
|
|||
|
||||
function PreviewAdapter(nodes, edges, viewer, config) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (nodes === undefined) {
|
||||
throw "The nodes have to be given.";
|
||||
}
|
||||
|
@ -43,7 +42,7 @@ function PreviewAdapter(nodes, edges, viewer, config) {
|
|||
|
||||
var self = this,
|
||||
absAdapter = new AbstractAdapter(nodes, edges, this, viewer),
|
||||
|
||||
|
||||
parseConfig = function(config) {
|
||||
if (config.width !== undefined) {
|
||||
absAdapter.setWidth(config.width);
|
||||
|
@ -71,7 +70,7 @@ function PreviewAdapter(nodes, edges, viewer, config) {
|
|||
};
|
||||
|
||||
config = config || {};
|
||||
|
||||
|
||||
parseConfig(config);
|
||||
|
||||
self.loadInitialNode = function(nodeId, callback) {
|
||||
|
@ -137,63 +136,63 @@ function PreviewAdapter(nodes, edges, viewer, config) {
|
|||
_to: 3,
|
||||
label: "Edge 5"
|
||||
};
|
||||
|
||||
|
||||
ns.push(n1);
|
||||
ns.push(n2);
|
||||
ns.push(n3);
|
||||
ns.push(n4);
|
||||
ns.push(n5);
|
||||
|
||||
|
||||
es.push(e12);
|
||||
es.push(e13);
|
||||
es.push(e14);
|
||||
es.push(e15);
|
||||
es.push(e23);
|
||||
|
||||
|
||||
result.first = n1;
|
||||
result.nodes = ns;
|
||||
result.edges = es;
|
||||
|
||||
|
||||
parseResult(result, callback);
|
||||
};
|
||||
|
||||
self.explore = absAdapter.explore;
|
||||
|
||||
self.requestCentralityChildren = function(nodeId, callback) {};
|
||||
|
||||
|
||||
self.createEdge = function (edgeToAdd, callback) {
|
||||
window.alert("Server-side: createEdge was triggered.");
|
||||
};
|
||||
|
||||
|
||||
self.deleteEdge = function (edgeToRemove, callback) {
|
||||
window.alert("Server-side: deleteEdge was triggered.");
|
||||
};
|
||||
|
||||
|
||||
self.patchEdge = function (edgeToPatch, patchData, callback) {
|
||||
window.alert("Server-side: patchEdge was triggered.");
|
||||
};
|
||||
|
||||
|
||||
self.createNode = function (nodeToAdd, callback) {
|
||||
window.alert("Server-side: createNode was triggered.");
|
||||
};
|
||||
|
||||
|
||||
self.deleteNode = function (nodeToRemove, callback) {
|
||||
window.alert("Server-side: deleteNode was triggered.");
|
||||
window.alert("Server-side: onNodeDelete was triggered.");
|
||||
};
|
||||
|
||||
|
||||
self.patchNode = function (nodeToPatch, patchData, callback) {
|
||||
window.alert("Server-side: patchNode was triggered.");
|
||||
};
|
||||
|
||||
|
||||
self.setNodeLimit = function (pLimit, callback) {
|
||||
absAdapter.setNodeLimit(pLimit, callback);
|
||||
};
|
||||
|
||||
|
||||
self.setChildLimit = function (pLimit) {
|
||||
absAdapter.setChildLimit(pLimit);
|
||||
};
|
||||
|
||||
|
||||
self.setWidth = absAdapter.setWidth;
|
||||
|
||||
self.expandCommunity = function (commNode, callback) {
|
||||
|
@ -202,5 +201,5 @@ function PreviewAdapter(nodes, edges, viewer, config) {
|
|||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global window, _*/
|
||||
// These values are injected
|
||||
/*global w:true, Construct, self*/
|
||||
|
@ -32,11 +31,11 @@
|
|||
|
||||
function WebWorkerWrapper(Class, callback) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (Class === undefined) {
|
||||
throw "A class has to be given.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (callback === undefined) {
|
||||
throw "A callback has to be given.";
|
||||
}
|
||||
|
@ -91,12 +90,12 @@ function WebWorkerWrapper(Class, callback) {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
BlobObject = function(c) {
|
||||
var code = "var w, Construct = "
|
||||
+ c.toString()
|
||||
+ ";self.onmessage = "
|
||||
+ onmessage.toString();
|
||||
+ onmessage.toString();
|
||||
return new window.Blob(code.split());
|
||||
},
|
||||
worker,
|
||||
|
@ -111,7 +110,7 @@ function WebWorkerWrapper(Class, callback) {
|
|||
},
|
||||
worker;
|
||||
|
||||
try {
|
||||
try {
|
||||
worker = createInBlobContext();
|
||||
exports.call = function(cmd) {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, _, d3*/
|
||||
/*global ColourMapper*/
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -31,7 +30,7 @@
|
|||
|
||||
function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limitCallback) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (width === undefined || width < 0) {
|
||||
throw("A width has to be given.");
|
||||
}
|
||||
|
@ -59,8 +58,8 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
) {
|
||||
throw("The Edge shaper has to be given.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var self = this,
|
||||
fontSize,
|
||||
nodeRadius,
|
||||
|
@ -80,7 +79,7 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
slider,
|
||||
minZoom,
|
||||
limitCB = limitCallback || function() {},
|
||||
|
||||
|
||||
calcNodeLimit = function () {
|
||||
var div, reqSize;
|
||||
if (currentZoom >= labelToggle) {
|
||||
|
@ -94,14 +93,14 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
}
|
||||
return Math.floor(size / div);
|
||||
},
|
||||
|
||||
|
||||
calcDistortionValues = function () {
|
||||
currentDistortion = baseDist / currentZoom - 0.99999999; // Always > 0
|
||||
currentDistortionRadius = baseDRadius / currentZoom;
|
||||
fisheye.distortion(currentDistortion);
|
||||
fisheye.radius(currentDistortionRadius);
|
||||
},
|
||||
|
||||
|
||||
reactToZoom = function(scale, transX, transY, fromButton) {
|
||||
if (fromButton) {
|
||||
if (scale !== null) {
|
||||
|
@ -121,7 +120,7 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
nodeShaper.activateLabel(currentZoom >= labelToggle);
|
||||
edgeShaper.activateLabel(currentZoom >= labelToggle);
|
||||
calcDistortionValues();
|
||||
|
||||
|
||||
var transT = "translate(" + currentTranslation + ")",
|
||||
scaleT = " scale(" + currentZoom + ")";
|
||||
if (g._isCommunity) {
|
||||
|
@ -133,13 +132,13 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
slider.slider("option", "value", currentZoom);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getScaleDelta = function(nextScale) {
|
||||
var diff = lastD3Scale - nextScale;
|
||||
lastD3Scale = nextScale;
|
||||
return diff;
|
||||
},
|
||||
|
||||
|
||||
getTranslationDelta = function(nextTrans) {
|
||||
var tmp = [];
|
||||
tmp[0] = nextTrans[0] - lastD3Translation[0];
|
||||
|
@ -148,7 +147,7 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
lastD3Translation[1] = nextTrans[1];
|
||||
return tmp;
|
||||
},
|
||||
|
||||
|
||||
parseConfig = function (conf) {
|
||||
if (conf === undefined) {
|
||||
conf = {};
|
||||
|
@ -162,15 +161,15 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
minZoom = rMin/rMax;
|
||||
fontSize = fontMax;
|
||||
nodeRadius = rMax;
|
||||
|
||||
|
||||
labelToggle = fontMin / fontMax;
|
||||
currentZoom = 1;
|
||||
currentTranslation = [0, 0];
|
||||
lastD3Translation = [0, 0];
|
||||
calcDistortionValues();
|
||||
|
||||
|
||||
currentLimit = calcNodeLimit();
|
||||
|
||||
|
||||
zoom = d3.behavior.zoom()
|
||||
.scaleExtent([minZoom, 1])
|
||||
.on("zoom", function() {
|
||||
|
@ -209,10 +208,10 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
} else {
|
||||
translation = getTranslationDelta(d3.event.translate);
|
||||
}
|
||||
|
||||
|
||||
reactToZoom(scale, translation[0], translation[1]);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
mouseMoveHandle = function() {
|
||||
var focus = d3.mouse(this);
|
||||
|
@ -224,57 +223,57 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
nodeShaper.updateNodes();
|
||||
edgeShaper.updateEdges();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fisheye = d3.fisheye.circular();
|
||||
|
||||
|
||||
parseConfig(config);
|
||||
|
||||
|
||||
svg.call(zoom);
|
||||
|
||||
|
||||
nodeShaper.changeTo({
|
||||
distortion: fisheye
|
||||
});
|
||||
|
||||
|
||||
svg.on("mousemove", mouseMoveHandle);
|
||||
|
||||
|
||||
self.translation = function() {
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
self.scaleFactor = function() {
|
||||
return currentZoom;
|
||||
};
|
||||
|
||||
|
||||
self.scaledMouse = function() {
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
self.getDistortion = function() {
|
||||
return currentDistortion;
|
||||
};
|
||||
|
||||
|
||||
self.getDistortionRadius = function() {
|
||||
return currentDistortionRadius;
|
||||
};
|
||||
|
||||
|
||||
self.getNodeLimit = function() {
|
||||
return currentLimit;
|
||||
};
|
||||
|
||||
|
||||
self.getMinimalZoomFactor = function() {
|
||||
return minZoom;
|
||||
};
|
||||
|
||||
|
||||
self.registerSlider = function(s) {
|
||||
slider = s;
|
||||
};
|
||||
|
||||
|
||||
self.triggerScale = function(s) {
|
||||
reactToZoom(s, null, null, true);
|
||||
};
|
||||
|
||||
|
||||
self.triggerTranslation = function(x, y) {
|
||||
reactToZoom(null, x, y, true);
|
||||
};
|
||||
|
@ -282,5 +281,5 @@ function ZoomManager(width, height, svg, g, nodeShaper, edgeShaper, config, limi
|
|||
self.changeWidth = function(w) {
|
||||
size = width * height;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global _, $*/
|
||||
/*global ArangoAdapter, JSONAdapter, FoxxAdapter, PreviewAdapter, GharialAdapter*/
|
||||
/*global ForceLayouter, EdgeShaper, NodeShaper, ZoomManager */
|
||||
|
@ -31,23 +30,23 @@
|
|||
|
||||
function GraphViewer(svg, width, height, adapterConfig, config) {
|
||||
"use strict";
|
||||
|
||||
|
||||
// Make the html aware of xmlns:xlink
|
||||
$("html").attr("xmlns:xlink", "http://www.w3.org/1999/xlink");
|
||||
|
||||
|
||||
// Check if all required inputs are given
|
||||
if (svg === undefined || svg.append === undefined) {
|
||||
throw "SVG has to be given and has to be selected using d3.select";
|
||||
}
|
||||
|
||||
|
||||
if (width === undefined || width <= 0) {
|
||||
throw "A width greater 0 has to be given";
|
||||
}
|
||||
|
||||
|
||||
if (height === undefined || height <= 0) {
|
||||
throw "A height greater 0 has to be given";
|
||||
}
|
||||
|
||||
|
||||
if (adapterConfig === undefined || adapterConfig.type === undefined) {
|
||||
throw "An adapter configuration has to be given";
|
||||
}
|
||||
|
@ -94,11 +93,11 @@ function GraphViewer(svg, width, height, adapterConfig, config) {
|
|||
throw "Sorry unknown layout type.";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
nodeLimitCallBack = function(limit) {
|
||||
adapter.setNodeLimit(limit, self.start);
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
parseZoomConfig = function(config) {
|
||||
if (config) {
|
||||
zoomManager = new ZoomManager(width, height, svg,
|
||||
|
@ -106,7 +105,7 @@ function GraphViewer(svg, width, height, adapterConfig, config) {
|
|||
{}, nodeLimitCallBack);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parseConfig = function(config) {
|
||||
var esConf = config.edgeShaper || {},
|
||||
nsConf = config.nodeShaper || {},
|
||||
|
@ -123,7 +122,7 @@ function GraphViewer(svg, width, height, adapterConfig, config) {
|
|||
layouter.setCombinedUpdateFunction(nodeShaper, edgeShaper);
|
||||
parseZoomConfig(zConf);
|
||||
};
|
||||
|
||||
|
||||
switch (adapterConfig.type.toLowerCase()) {
|
||||
case "arango":
|
||||
adapterConfig.width = width;
|
||||
|
@ -180,19 +179,19 @@ function GraphViewer(svg, width, height, adapterConfig, config) {
|
|||
break;
|
||||
default:
|
||||
throw "Sorry unknown adapter type.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
graphContainer = svg.append("g");
|
||||
|
||||
|
||||
parseConfig(config || {});
|
||||
|
||||
|
||||
this.start = function() {
|
||||
layouter.stop();
|
||||
nodeShaper.drawNodes(nodes);
|
||||
edgeShaper.drawEdges(edges);
|
||||
layouter.start();
|
||||
};
|
||||
|
||||
|
||||
this.loadGraph = function(nodeId, callback) {
|
||||
// loadNode
|
||||
// loadInitialNode
|
||||
|
@ -222,7 +221,7 @@ function GraphViewer(svg, width, height, adapterConfig, config) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.loadGraphWithAttributeValue = function(attribute, value, callback) {
|
||||
adapter.loadInitialNodeByAttributeValue(attribute, value, function (node) {
|
||||
if (node.errorCode) {
|
||||
|
@ -241,7 +240,7 @@ function GraphViewer(svg, width, height, adapterConfig, config) {
|
|||
nodeShaper.resetColourMap();
|
||||
edgeShaper.resetColourMap();
|
||||
};
|
||||
|
||||
|
||||
this.changeWidth = function(w) {
|
||||
layouter.changeWidth(w);
|
||||
zoomManager.changeWidth(w);
|
||||
|
@ -266,7 +265,7 @@ function GraphViewer(svg, width, height, adapterConfig, config) {
|
|||
edgeEditor: {
|
||||
edges: edges,
|
||||
adapter: adapter
|
||||
}
|
||||
}
|
||||
};
|
||||
this.adapter = adapter;
|
||||
this.nodeShaper = nodeShaper;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, _, d3*/
|
||||
/*global document*/
|
||||
/*global modalDialogHelper, uiComponentsHelper*/
|
||||
|
@ -30,7 +29,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
function ArangoAdapterControls(list, adapter) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (list === undefined) {
|
||||
throw "A list element has to be given.";
|
||||
}
|
||||
|
@ -40,7 +39,7 @@ function ArangoAdapterControls(list, adapter) {
|
|||
this.addControlChangeCollections = function(callback) {
|
||||
var prefix = "control_adapter_collections",
|
||||
idprefix = prefix + "_";
|
||||
|
||||
|
||||
adapter.getCollections(function(nodeCols, edgeCols) {
|
||||
adapter.getGraphs(function(graphs) {
|
||||
uiComponentsHelper.createButton(list, "Collections", prefix, function() {
|
||||
|
@ -123,7 +122,7 @@ function ArangoAdapterControls(list, adapter) {
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.addControlChangePriority = function() {
|
||||
var prefix = "control_adapter_priority",
|
||||
idprefix = prefix + "_",
|
||||
|
@ -178,7 +177,7 @@ function ArangoAdapterControls(list, adapter) {
|
|||
});
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
this.addAll = function() {
|
||||
this.addControlChangeCollections();
|
||||
this.addControlChangePriority();
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, _, d3*/
|
||||
/*global document*/
|
||||
/*global EdgeShaper, modalDialogHelper, uiComponentsHelper*/
|
||||
|
@ -64,7 +63,7 @@ function ContextMenu(id) {
|
|||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
divFactory = function() {
|
||||
div = document.getElementById(id);
|
||||
if (div) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, _, d3*/
|
||||
/*global document*/
|
||||
/*global EdgeShaper, modalDialogHelper, uiComponentsHelper*/
|
||||
|
@ -30,7 +29,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
function EdgeShaperControls(list, shaper) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (list === undefined) {
|
||||
throw "A list element has to be given.";
|
||||
}
|
||||
|
@ -38,7 +37,7 @@ function EdgeShaperControls(list, shaper) {
|
|||
throw "The EdgeShaper has to be given.";
|
||||
}
|
||||
var self = this;
|
||||
|
||||
|
||||
this.addControlOpticShapeNone = function() {
|
||||
var prefix = "control_edge_none",
|
||||
idprefix = prefix + "_";
|
||||
|
@ -50,7 +49,7 @@ function EdgeShaperControls(list, shaper) {
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.addControlOpticShapeArrow = function() {
|
||||
var prefix = "control_edge_arrow",
|
||||
idprefix = prefix + "_";
|
||||
|
@ -62,9 +61,9 @@ function EdgeShaperControls(list, shaper) {
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.addControlOpticLabel = function() {
|
||||
var prefix = "control_edge_label",
|
||||
idprefix = prefix + "_";
|
||||
|
@ -84,7 +83,7 @@ function EdgeShaperControls(list, shaper) {
|
|||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.addControlOpticLabelList = function() {
|
||||
var prefix = "control_edge_label",
|
||||
idprefix = prefix + "_";
|
||||
|
@ -111,10 +110,10 @@ function EdgeShaperControls(list, shaper) {
|
|||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.addControlOpticSingleColour = function() {
|
||||
var prefix = "control_edge_singlecolour",
|
||||
idprefix = prefix + "_";
|
||||
|
@ -135,7 +134,7 @@ function EdgeShaperControls(list, shaper) {
|
|||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.addControlOpticAttributeColour = function() {
|
||||
var prefix = "control_edge_attributecolour",
|
||||
idprefix = prefix + "_";
|
||||
|
@ -156,7 +155,7 @@ function EdgeShaperControls(list, shaper) {
|
|||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.addControlOpticGradientColour = function() {
|
||||
var prefix = "control_edge_gradientcolour",
|
||||
idprefix = prefix + "_";
|
||||
|
@ -182,7 +181,7 @@ function EdgeShaperControls(list, shaper) {
|
|||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.addAllOptics = function () {
|
||||
self.addControlOpticShapeNone();
|
||||
self.addControlOpticShapeArrow();
|
||||
|
@ -191,14 +190,14 @@ function EdgeShaperControls(list, shaper) {
|
|||
self.addControlOpticAttributeColour();
|
||||
self.addControlOpticGradientColour();
|
||||
};
|
||||
|
||||
|
||||
this.addAllActions = function () {
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
this.addAll = function () {
|
||||
self.addAllOptics();
|
||||
self.addAllActions();
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, _, d3*/
|
||||
/*global document, window, prompt*/
|
||||
/*global modalDialogHelper, uiComponentsHelper */
|
||||
|
@ -32,7 +31,7 @@
|
|||
|
||||
function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcherConfig) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (list === undefined) {
|
||||
throw "A list element has to be given.";
|
||||
}
|
||||
|
@ -45,7 +44,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
if (start === undefined) {
|
||||
throw "The Start callback has to be given.";
|
||||
}
|
||||
|
||||
|
||||
var self = this,
|
||||
/*
|
||||
icons = {
|
||||
|
@ -93,8 +92,8 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
askForCollection = (!!adapter
|
||||
&& _.isFunction(adapter.useNodeCollection)
|
||||
&& _.isFunction(adapter.useEdgeCollection)),
|
||||
|
||||
|
||||
|
||||
|
||||
appendToList = function(button) {
|
||||
list.appendChild(button);
|
||||
},
|
||||
|
@ -173,7 +172,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
}
|
||||
);
|
||||
};
|
||||
callbacks.nodes.newNode = createCallback;
|
||||
callbacks.nodes.newNode = createCallback;
|
||||
},
|
||||
createViewCBs = function() {
|
||||
var prefix = "control_event_view",
|
||||
|
@ -336,7 +335,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.newNodeRebinds = function() {
|
||||
return {
|
||||
svg: {
|
||||
|
@ -344,7 +343,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.viewRebinds = function() {
|
||||
return {
|
||||
nodes: {
|
||||
|
@ -355,7 +354,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.connectNodesRebinds = function() {
|
||||
return {
|
||||
nodes: {
|
||||
|
@ -367,7 +366,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.editRebinds = function() {
|
||||
return {
|
||||
nodes: {
|
||||
|
@ -378,7 +377,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.expandRebinds = function() {
|
||||
return {
|
||||
nodes: {
|
||||
|
@ -386,7 +385,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.deleteRebinds = function() {
|
||||
return {
|
||||
nodes: {
|
||||
|
@ -397,18 +396,18 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.rebindAll = function(obj) {
|
||||
rebindNodes(obj.nodes);
|
||||
rebindEdges(obj.edges);
|
||||
rebindSVG(obj.svg);
|
||||
};
|
||||
|
||||
|
||||
/*******************************************
|
||||
* Inject controls into right-click menus
|
||||
*
|
||||
*******************************************/
|
||||
|
||||
|
||||
nodeShaper.addMenuEntry("View", callbacks.nodes.view);
|
||||
nodeShaper.addMenuEntry("Edit", callbacks.nodes.edit);
|
||||
nodeShaper.addMenuEntry("Spot", callbacks.nodes.spot);
|
||||
|
@ -423,8 +422,8 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
* Functions to add controls
|
||||
*
|
||||
*******************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
this.addControlNewNode = function() {
|
||||
var icon = icons.add,
|
||||
idprefix = "select_node_collection",
|
||||
|
@ -451,7 +450,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
};
|
||||
createIcon(icon, "new_node", callback);
|
||||
};
|
||||
|
||||
|
||||
this.addControlView = function() {
|
||||
var icon = icons.view,
|
||||
callback = function() {
|
||||
|
@ -459,7 +458,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
};
|
||||
createIcon(icon, "view", callback);
|
||||
};
|
||||
|
||||
|
||||
this.addControlDrag = function() {
|
||||
var icon = icons.drag,
|
||||
callback = function() {
|
||||
|
@ -467,7 +466,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
};
|
||||
createIcon(icon, "drag", callback);
|
||||
};
|
||||
|
||||
|
||||
this.addControlEdit = function() {
|
||||
var icon = icons.edit,
|
||||
callback = function() {
|
||||
|
@ -475,7 +474,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
};
|
||||
createIcon(icon, "edit", callback);
|
||||
};
|
||||
|
||||
|
||||
this.addControlExpand = function() {
|
||||
var icon = icons.expand,
|
||||
callback = function() {
|
||||
|
@ -483,7 +482,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
};
|
||||
createIcon(icon, "expand", callback);
|
||||
};
|
||||
|
||||
|
||||
this.addControlDelete = function() {
|
||||
var icon = icons.trash,
|
||||
callback = function() {
|
||||
|
@ -491,7 +490,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
};
|
||||
createIcon(icon, "delete", callback);
|
||||
};
|
||||
|
||||
|
||||
this.addControlConnect = function() {
|
||||
var icon = icons.edge,
|
||||
idprefix = "select_edge_collection",
|
||||
|
@ -518,7 +517,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
|||
};
|
||||
createIcon(icon, "connect", callback);
|
||||
};
|
||||
|
||||
|
||||
this.addAll = function () {
|
||||
self.addControlDrag();
|
||||
self.addControlView();
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global $, _, d3*/
|
||||
/*global document*/
|
||||
/*global modalDialogHelper, uiComponentsHelper*/
|
||||
|
@ -30,7 +29,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
function GharialAdapterControls(list, adapter) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (list === undefined) {
|
||||
throw "A list element has to be given.";
|
||||
}
|
||||
|
@ -40,7 +39,7 @@ function GharialAdapterControls(list, adapter) {
|
|||
this.addControlChangeGraph = function(callback) {
|
||||
var prefix = "control_adapter_graph",
|
||||
idprefix = prefix + "_";
|
||||
|
||||
|
||||
adapter.getGraphs(function(graphs) {
|
||||
uiComponentsHelper.createButton(list, "Graph", prefix, function() {
|
||||
modalDialogHelper.createModalDialog("Switch Graph",
|
||||
|
@ -79,7 +78,7 @@ function GharialAdapterControls(list, adapter) {
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.addControlChangePriority = function() {
|
||||
var prefix = "control_adapter_priority",
|
||||
idprefix = prefix + "_",
|
||||
|
@ -107,7 +106,7 @@ function GharialAdapterControls(list, adapter) {
|
|||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.addAll = function() {
|
||||
this.addControlChangeGraph();
|
||||
this.addControlChangePriority();
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global document, $, _ */
|
||||
/*global d3, window*/
|
||||
/*global GraphViewer, EventDispatcherControls, EventDispatcher, NodeShaper */
|
||||
|
@ -37,7 +36,7 @@
|
|||
|
||||
function GraphViewerPreview(container, viewerConfig) {
|
||||
"use strict";
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Internal variables and functions
|
||||
*******************************************************************************/
|
||||
|
@ -50,8 +49,8 @@ function GraphViewerPreview(container, viewerConfig) {
|
|||
adapterConfig,
|
||||
dispatcherUI,
|
||||
//mousePointerBox = document.createElement("div"),
|
||||
|
||||
|
||||
|
||||
|
||||
createSVG = function() {
|
||||
return d3.select(container)
|
||||
.append("svg")
|
||||
|
@ -61,7 +60,7 @@ function GraphViewerPreview(container, viewerConfig) {
|
|||
.attr("class", "graph-viewer")
|
||||
.attr("style", "width:" + width + "px;height:" + height + ";");
|
||||
},
|
||||
|
||||
|
||||
shouldCreateToolbox = function(config) {
|
||||
var counter = 0;
|
||||
_.each(config, function(v, k) {
|
||||
|
@ -73,7 +72,7 @@ function GraphViewerPreview(container, viewerConfig) {
|
|||
});
|
||||
return counter > 0;
|
||||
},
|
||||
|
||||
|
||||
addRebindsToList = function(list, rebinds) {
|
||||
_.each(rebinds, function(acts, obj) {
|
||||
list[obj] = list[obj] || {};
|
||||
|
@ -82,7 +81,7 @@ function GraphViewerPreview(container, viewerConfig) {
|
|||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
parseActions = function(config) {
|
||||
if (!config) {
|
||||
return;
|
||||
|
@ -104,9 +103,9 @@ function GraphViewerPreview(container, viewerConfig) {
|
|||
if (config.edit) {
|
||||
addRebindsToList(allActions, dispatcherUI.editRebinds());
|
||||
}
|
||||
dispatcherUI.rebindAll(allActions);
|
||||
dispatcherUI.rebindAll(allActions);
|
||||
},
|
||||
|
||||
|
||||
createToolbox = function(config) {
|
||||
var toolbox = document.createElement("div");
|
||||
dispatcherUI = new EventDispatcherControls(
|
||||
|
@ -145,7 +144,7 @@ function GraphViewerPreview(container, viewerConfig) {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
createDispatcherOnly = function(config) {
|
||||
var toolbox = document.createElement("div");
|
||||
dispatcherUI = new EventDispatcherControls(
|
||||
|
@ -157,7 +156,7 @@ function GraphViewerPreview(container, viewerConfig) {
|
|||
viewer.dispatcherConfig
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
changeConfigToPreviewGraph = function() {
|
||||
if (viewerConfig) {
|
||||
// Fix nodeShaper:
|
||||
|
@ -181,23 +180,23 @@ function GraphViewerPreview(container, viewerConfig) {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
createViewer = function() {
|
||||
changeConfigToPreviewGraph();
|
||||
return new GraphViewer(svg, width, height, adapterConfig, viewerConfig);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Execution start
|
||||
*******************************************************************************/
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
width = container.offsetWidth;
|
||||
height = container.offsetHeight;
|
||||
adapterConfig = {
|
||||
type: "preview"
|
||||
};
|
||||
|
||||
|
||||
viewerConfig = viewerConfig || {};
|
||||
createTB = shouldCreateToolbox(viewerConfig.toolbox);
|
||||
if (createTB) {
|
||||
|
@ -212,5 +211,5 @@ function GraphViewerPreview(container, viewerConfig) {
|
|||
}
|
||||
viewer.loadGraph("1");
|
||||
parseActions(viewerConfig.actions);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global document, $, _ */
|
||||
/*global EventDispatcherControls, NodeShaperControls, EdgeShaperControls */
|
||||
/*global LayouterControls, GharialAdapterControls*/
|
||||
|
@ -32,7 +31,7 @@
|
|||
|
||||
function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConfig, startNode) {
|
||||
"use strict";
|
||||
|
||||
|
||||
if (container === undefined) {
|
||||
throw "A parent element has to be given.";
|
||||
}
|
||||
|
@ -41,8 +40,8 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
}
|
||||
if (adapterConfig === undefined) {
|
||||
throw "An adapter configuration has to be given";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var graphViewer,
|
||||
width = (optWidth || container.offsetWidth - 81),
|
||||
height = optHeight || container.offsetHeight,
|
||||
|
@ -57,9 +56,9 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
searchAttrExampleList,
|
||||
//mousePointerBox = document.createElement("div"),
|
||||
svg,
|
||||
|
||||
|
||||
makeFilterDiv = function() {
|
||||
var
|
||||
var
|
||||
div = document.createElement("div"),
|
||||
innerDiv = document.createElement("div"),
|
||||
queryLine = document.createElement("div"),
|
||||
|
@ -73,7 +72,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
showSpinner = function() {
|
||||
$(background).css("cursor", "progress");
|
||||
},
|
||||
|
||||
|
||||
hideSpinner = function() {
|
||||
$(background).css("cursor", "");
|
||||
},
|
||||
|
@ -81,7 +80,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
alertError = function(msg) {
|
||||
window.alert(msg);
|
||||
},
|
||||
|
||||
|
||||
resultCB = function(res) {
|
||||
hideSpinner();
|
||||
if (res && res.errorCode && res.errorCode === 404) {
|
||||
|
@ -90,7 +89,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
}
|
||||
return;
|
||||
},
|
||||
|
||||
|
||||
searchFunction = function() {
|
||||
showSpinner();
|
||||
if (searchAttrField.value === ""
|
||||
|
@ -153,7 +152,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
searchAttrExampleToggle.onclick = function() {
|
||||
$(searchAttrExampleList).slideToggle(200);
|
||||
};
|
||||
|
@ -226,7 +225,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
spanFilter = document.createElement("span");
|
||||
spanFilter.className = "icon_arangodb_filter";
|
||||
$(spanFilter).attr("title", "Filter");
|
||||
|
||||
|
||||
ul.appendChild(liFilter);
|
||||
liFilter.appendChild(aFilter);
|
||||
aFilter.appendChild(spanFilter);
|
||||
|
@ -259,7 +258,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
.style("width", width + "px")
|
||||
.style("height", height + "px");
|
||||
},
|
||||
|
||||
|
||||
createZoomUIWidget = function() {
|
||||
var zoomUI = document.createElement("div"),
|
||||
zoomButtons = document.createElement("div"),
|
||||
|
@ -269,7 +268,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
btnBottom = document.createElement("button");
|
||||
zoomUI.className = "gv_zoom_widget";
|
||||
zoomButtons.className = "gv_zoom_buttons_bg";
|
||||
|
||||
|
||||
btnTop.className = "btn btn-icon btn-zoom btn-zoom-top gv-zoom-btn pan-top";
|
||||
btnLeft.className = "btn btn-icon btn-zoom btn-zoom-left gv-zoom-btn pan-left";
|
||||
btnRight.className = "btn btn-icon btn-zoom btn-zoom-right gv-zoom-btn pan-right";
|
||||
|
@ -286,19 +285,19 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
btnBottom.onclick = function() {
|
||||
graphViewer.zoomManager.triggerTranslation(0, 10);
|
||||
};
|
||||
|
||||
|
||||
zoomButtons.appendChild(btnTop);
|
||||
zoomButtons.appendChild(btnLeft);
|
||||
zoomButtons.appendChild(btnRight);
|
||||
zoomButtons.appendChild(btnBottom);
|
||||
|
||||
|
||||
slider = document.createElement("div");
|
||||
slider.id = "gv_zoom_slider";
|
||||
slider.className = "gv_zoom_slider";
|
||||
|
||||
|
||||
background.appendChild(zoomUI);
|
||||
background.insertBefore(zoomUI, svg[0][0]);
|
||||
|
||||
|
||||
zoomUI.appendChild(zoomButtons);
|
||||
zoomUI.appendChild(slider);
|
||||
$( "#gv_zoom_slider" ).slider({
|
||||
|
@ -313,7 +312,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
});
|
||||
graphViewer.zoomManager.registerSlider($("#gv_zoom_slider"));
|
||||
},
|
||||
|
||||
|
||||
createToolbox = function() {
|
||||
var toolbox = document.createElement("div"),
|
||||
dispatcherUI = new EventDispatcherControls(
|
||||
|
@ -330,7 +329,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
// Default selection
|
||||
$("#control_event_expand").click();
|
||||
},
|
||||
|
||||
|
||||
updateAttributeExamples = function() {
|
||||
searchAttrExampleList.innerHTML = "";
|
||||
var throbber = document.createElement("li"),
|
||||
|
@ -356,7 +355,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
createMenu = function() {
|
||||
var transparentHeader = document.createElement("div"),
|
||||
buttons = document.createElement("div"),
|
||||
|
@ -366,7 +365,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
"configuredropdown",
|
||||
"filterdropdown"
|
||||
);
|
||||
|
||||
|
||||
nodeShaperUI = new NodeShaperControls(
|
||||
configureLists.nodes,
|
||||
graphViewer.nodeShaper
|
||||
|
@ -379,29 +378,29 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
configureLists.col,
|
||||
graphViewer.adapter
|
||||
);
|
||||
|
||||
|
||||
menubar.id = "menubar";
|
||||
|
||||
transparentHeader.className = "headerBar";
|
||||
|
||||
|
||||
buttons.id = "modifiers";
|
||||
|
||||
title.appendChild(document.createTextNode("Graph Viewer"));
|
||||
title.className = "arangoHeader";
|
||||
|
||||
|
||||
/*
|
||||
nodeShaperDropDown.id = "nodeshapermenu";
|
||||
edgeShaperDropDown.id = "edgeshapermenu";
|
||||
layouterDropDown.id = "layoutermenu";
|
||||
adapterDropDown.id = "adaptermenu";
|
||||
*/
|
||||
|
||||
|
||||
menubar.appendChild(transparentHeader);
|
||||
menubar.appendChild(configureLists.configure);
|
||||
menubar.appendChild(configureLists.filter);
|
||||
transparentHeader.appendChild(buttons);
|
||||
transparentHeader.appendChild(title);
|
||||
|
||||
|
||||
adapterUI.addControlChangeGraph(function() {
|
||||
updateAttributeExamples();
|
||||
graphViewer.start();
|
||||
|
@ -410,13 +409,13 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
// nodeShaperUI.addControlOpticLabelAndColour(graphViewer.adapter);
|
||||
nodeShaperUI.addControlOpticLabelAndColourList(graphViewer.adapter);
|
||||
edgeShaperUI.addControlOpticLabelList();
|
||||
|
||||
|
||||
/*
|
||||
buttons.appendChild(nodeShaperDropDown);
|
||||
buttons.appendChild(edgeShaperDropDown);
|
||||
buttons.appendChild(layouterDropDown);
|
||||
buttons.appendChild(adapterDropDown);
|
||||
|
||||
|
||||
nodeShaperUI.addAll();
|
||||
edgeShaperUI.addAll();
|
||||
layouterUI.addAll();
|
||||
|
@ -424,7 +423,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
*/
|
||||
updateAttributeExamples();
|
||||
},
|
||||
|
||||
|
||||
createColourList = function() {
|
||||
colourList = nodeShaperUI.createColourMappingList();
|
||||
colourList.className = "gv-colour-list";
|
||||
|
@ -434,11 +433,11 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
|
|||
container.appendChild(background);
|
||||
background.className = "contentDiv gv-background ";
|
||||
background.id = "background";
|
||||
|
||||
|
||||
viewerConfig = viewerConfig || {};
|
||||
viewerConfig.zoom = true;
|
||||
|
||||
|
||||
|
||||
svg = createSVG();
|
||||
graphViewer = new GraphViewer(svg, width, height, adapterConfig, viewerConfig);
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue