mirror of
https://github.com/arnaucube/goBlockchainDataAnalysis.git
synced 2026-02-07 03:36:44 +01:00
sankey in frontend works, added logs system, added getLastTx in backend and frontend
This commit is contained in:
@@ -3,10 +3,14 @@
|
||||
<div class="col-sm-4">
|
||||
<div class="panel">
|
||||
<div class="panel-heading c_blueGrey300">
|
||||
<h3 class="panel-title">Last blocks</h3>
|
||||
<h3 class="panel-title">Last addresses</h3>
|
||||
</div>
|
||||
<div class="panel-body" style="max-height: 500px;overflow-y: scroll;">
|
||||
|
||||
<div class="list-group-item" ng-repeat="node in addresses">
|
||||
<div class="row-content">
|
||||
<p class="list-group-item-text">{{node.id}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,5 +10,14 @@ angular.module('app.main', ['ngRoute'])
|
||||
}])
|
||||
|
||||
.controller('MainCtrl', function($scope, $http) {
|
||||
|
||||
$scope.addresses = [];
|
||||
$http.get(urlapi + 'lasttx')
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
|
||||
$scope.addresses = data.data;
|
||||
}, function(data, status, headers, config) {
|
||||
console.log('data error');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="panel-heading c_blueGrey300">
|
||||
<h3 class="panel-title">Sankey</h3>
|
||||
<h3 class="panel-title">Sankey - address {{selectedAddress}}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<!--<ng-sankey id="sankeyChart" options="options" data="data"></ng-sankey>
|
||||
|
||||
@@ -10,7 +10,7 @@ angular.module('app.sankey', ['ngRoute', 'ngSankey'])
|
||||
}])
|
||||
|
||||
.controller('SankeyCtrl', function($scope, $http, $routeParams) {
|
||||
|
||||
$scope.selectedAddress = "";
|
||||
$scope.options = {
|
||||
chart: '#sankeyChart',
|
||||
width: 960,
|
||||
@@ -36,6 +36,9 @@ angular.module('app.sankey', ['ngRoute', 'ngSankey'])
|
||||
});
|
||||
$scope.getAddressSankey = function(address) {
|
||||
console.log(address);
|
||||
$scope.selectedAddress = address.id;
|
||||
$scope.data.nodes = [];
|
||||
$scope.data.links = [];
|
||||
$http.get(urlapi + 'address/sankey/' + address.id)
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log('data success');
|
||||
@@ -43,6 +46,7 @@ angular.module('app.sankey', ['ngRoute', 'ngSankey'])
|
||||
$scope.data.nodes = data.data.nodes;
|
||||
$scope.data.links = data.data.links;
|
||||
console.log($scope.data);
|
||||
d3.selectAll("svg > *").remove();
|
||||
let chart = new d3.sankeyChart(data.data, $scope.options);
|
||||
//$scope.data = data.data;
|
||||
}, function(data, status, headers, config) {
|
||||
|
||||
Reference in New Issue
Block a user