mirror of https://gitee.com/bigwinds/arangodb
added edge hover event
This commit is contained in:
parent
a614a71b4b
commit
b067f71df5
|
@ -101,8 +101,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
downloadSVG: function () {
|
downloadSVG: function () {
|
||||||
var size = parseInt($('#graph-container').width());
|
var size = parseInt($('#graph-container').width(), 10);
|
||||||
|
|
||||||
sigma.plugins.image(this.currentGraph, this.currentGraph.renderers[0], {
|
sigma.plugins.image(this.currentGraph, this.currentGraph.renderers[0], {
|
||||||
download: true,
|
download: true,
|
||||||
size: size,
|
size: size,
|
||||||
|
@ -1271,7 +1270,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
s.bind('overNode', function (e) {
|
var showAttributes = function (e, node) {
|
||||||
$('.nodeInfoDiv').remove();
|
$('.nodeInfoDiv').remove();
|
||||||
|
|
||||||
if (self.contextState.createEdge === false) {
|
if (self.contextState.createEdge === false) {
|
||||||
|
@ -1280,7 +1279,7 @@
|
||||||
if (!error) {
|
if (!error) {
|
||||||
var attributes = '';
|
var attributes = '';
|
||||||
_.each(data, function (value, key) {
|
_.each(data, function (value, key) {
|
||||||
if (key !== '_key' && key !== '_id' && key !== '_rev') {
|
if (key !== '_key' && key !== '_id' && key !== '_rev' && key !== '_from' && key !== '_to') {
|
||||||
attributes += ('<span class="nodeAttribute">' + key + '</span>');
|
attributes += ('<span class="nodeAttribute">' + key + '</span>');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1290,9 +1289,21 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.documentStore.getDocument(e.data.node.id.split('/')[0], e.data.node.id.split('/')[1], callback);
|
if (node) {
|
||||||
|
self.documentStore.getDocument(e.data.node.id.split('/')[0], e.data.node.id.split('/')[1], callback);
|
||||||
|
} else {
|
||||||
|
self.documentStore.getDocument(e.data.edge.id.split('/')[0], e.data.edge.id.split('/')[1], callback);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
s.bind('overNode', function (e) {
|
||||||
|
showAttributes(e, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
s.bind('overEdge', function (e) {
|
||||||
|
showAttributes(e, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
s.bind('outNode', function (e) {
|
s.bind('outNode', function (e) {
|
||||||
|
@ -1301,6 +1312,12 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
s.bind('outEdge', function (e) {
|
||||||
|
if (self.contextState.createEdge === false) {
|
||||||
|
$('.nodeInfoDiv').remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
s.bind('clickNode', function (e) {
|
s.bind('clickNode', function (e) {
|
||||||
if (self.contextState.createEdge === true) {
|
if (self.contextState.createEdge === true) {
|
||||||
// create the edge
|
// create the edge
|
||||||
|
|
Loading…
Reference in New Issue