mirror of
https://github.com/arnaucube/goBlockchainDataAnalysis.git
synced 2026-02-07 03:36:44 +01:00
implemented generation of network map of address history, not finished
This commit is contained in:
@@ -13,16 +13,19 @@ angular.module('app.network', ['ngRoute'])
|
||||
$scope.data = [];
|
||||
$scope.nodes = [];
|
||||
$scope.edges = [];
|
||||
var nodes, edges, container;
|
||||
$scope.selectedNode = {};
|
||||
var nodes, edges, container, network;
|
||||
var options = {
|
||||
layout: {
|
||||
improvedLayout: false
|
||||
},
|
||||
interaction: {
|
||||
hover: true
|
||||
},
|
||||
physics: {
|
||||
stabilization: false,
|
||||
//enabled: false
|
||||
}
|
||||
/*,
|
||||
physics:{
|
||||
//stabilization: false,
|
||||
// enabled: false
|
||||
}*/
|
||||
};
|
||||
|
||||
|
||||
@@ -35,7 +38,28 @@ angular.module('app.network', ['ngRoute'])
|
||||
nodes: nodes,
|
||||
edges: edges
|
||||
};
|
||||
var network = new vis.Network(container, data, options);
|
||||
network = new vis.Network(container, data, options);
|
||||
network.on("click", function(params) {
|
||||
params.event = "[original event]";
|
||||
//$scope.selectedNode = JSON.stringify(params, null, 4);
|
||||
$scope.selectedNode = params;
|
||||
console.log($scope.selectedNode);
|
||||
console.log($scope.selectedNode.nodes);
|
||||
var options = {
|
||||
// position: {x:positionx,y:positiony}, // this is not relevant when focusing on nodes
|
||||
scale: 1,
|
||||
offset: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
animation: {
|
||||
duration: 500,
|
||||
easingFunction: "easeInOutQuad"
|
||||
}
|
||||
};
|
||||
network.focus($scope.selectedNode.nodes[0], options);
|
||||
//console.log('click event, getNodeAt returns: ' + this.getNodeAt(params.pointer.DOM));
|
||||
});
|
||||
};
|
||||
|
||||
$http.get(urlapi + 'map')
|
||||
@@ -50,4 +74,20 @@ angular.module('app.network', ['ngRoute'])
|
||||
console.log('data error');
|
||||
});
|
||||
|
||||
|
||||
$scope.focusNode = function(node) {
|
||||
var options = {
|
||||
// position: {x:positionx,y:positiony}, // this is not relevant when focusing on nodes
|
||||
scale: 1,
|
||||
offset: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
animation: {
|
||||
duration: 500,
|
||||
easingFunction: "easeInOutQuad"
|
||||
}
|
||||
};
|
||||
network.focus(node.id, options);
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user