mirror of https://gitee.com/bigwinds/arangodb
This commit is contained in:
parent
9f8c068579
commit
fcfd67a1f7
|
@ -375,8 +375,10 @@ authRouter.get('/graph/:name', function (req, res) {
|
|||
aqlQuery = config.query;
|
||||
} else {
|
||||
var limit = 0;
|
||||
if (config !== undefined && config.limit.length > 0 && config.limit !== '0') {
|
||||
limit = config.limit;
|
||||
if (config.limit !== undefined) {
|
||||
if (config.limit.length > 0 && config.limit !== '0') {
|
||||
limit = config.limit;
|
||||
}
|
||||
}
|
||||
|
||||
aqlQuery =
|
||||
|
@ -530,7 +532,7 @@ authRouter.get('/graph/:name', function (req, res) {
|
|||
nodeObj = {
|
||||
id: node._id,
|
||||
label: nodeLabel,
|
||||
size: nodeSize || 10,
|
||||
size: nodeSize || 3,
|
||||
color: config.nodeColor || '#2ecc71',
|
||||
x: Math.random(),
|
||||
y: Math.random()
|
||||
|
|
|
@ -1329,7 +1329,6 @@
|
|||
}
|
||||
|
||||
if (aqlMode) {
|
||||
console.log(true);
|
||||
settings.minNodeSize = 2;
|
||||
settings.maxNodeSize = 4;
|
||||
}
|
||||
|
@ -1583,8 +1582,14 @@
|
|||
// suggestion rendering time
|
||||
var duration = graph.nodes.length;
|
||||
|
||||
if (duration < 250) {
|
||||
duration = 250;
|
||||
if (aqlMode) {
|
||||
if (duration < 250) {
|
||||
duration = 250;
|
||||
}
|
||||
} else {
|
||||
if (duration <= 250) {
|
||||
duration = 500;
|
||||
}
|
||||
}
|
||||
|
||||
window.setTimeout(function () {
|
||||
|
@ -1651,20 +1656,13 @@
|
|||
if (self.graphConfig.nodeSizeByEdges === 'false') {
|
||||
// make nodes a bit bigger
|
||||
var maxNodeSize = s.settings('maxNodeSize');
|
||||
console.log(maxNodeSize);
|
||||
var factor = 1;
|
||||
var length = s.graph.nodes().length;
|
||||
|
||||
if (length < 100) {
|
||||
factor = 2.5;
|
||||
} else if (length < 1000) {
|
||||
factor = 0.7;
|
||||
}
|
||||
factor = 0.5;
|
||||
maxNodeSize = maxNodeSize * factor;
|
||||
s.settings('maxNodeSize', maxNodeSize);
|
||||
|
||||
s.refresh({
|
||||
});
|
||||
s.refresh({});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue