mirror of
https://github.com/arnaucube/goBlockchainDataAnalysis.git
synced 2026-02-07 11:46:38 +01:00
Sankey data generated in backend, not yet showed correctly in frontend
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"name": "goBlockchainDataAnalysis",
|
||||
"description": "goBlockchainDataAnalysis",
|
||||
"version": "0.0.0",
|
||||
"homepage": "https://github.com/arnaucode/goBlockchainDataAnalysis",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"angular": "^1.6.2",
|
||||
"angular-route": "^1.6.1",
|
||||
"angular-chart.js": "^1.1.1",
|
||||
"vis": "^4.18.1",
|
||||
"mui": "^0.9.20",
|
||||
"angular-bootstrap-material": "abm#^0.1.4",
|
||||
"angular-bootstrap": "^2.5.0",
|
||||
"angular-messages": "^1.6.5",
|
||||
"components-font-awesome": "^4.7.0"
|
||||
}
|
||||
"name": "goBlockchainDataAnalysis",
|
||||
"description": "goBlockchainDataAnalysis",
|
||||
"version": "0.0.0",
|
||||
"homepage": "https://github.com/arnaucode/goBlockchainDataAnalysis",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"angular": "^1.6.2",
|
||||
"angular-route": "^1.6.1",
|
||||
"angular-chart.js": "^1.1.1",
|
||||
"vis": "^4.18.1",
|
||||
"angular-bootstrap-material": "abm#^0.1.4",
|
||||
"angular-bootstrap": "^2.5.0",
|
||||
"angular-messages": "^1.6.5",
|
||||
"components-font-awesome": "^4.7.0",
|
||||
"sankeyjs": "^1.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,10 @@
|
||||
<script src="bower_components/chart.js/dist/Chart.min.js"></script>
|
||||
<script src="bower_components/angular-chart.js/dist/angular-chart.min.js"></script>
|
||||
|
||||
<!-- d3js -->
|
||||
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8" type="text/javascript"></script>
|
||||
<script src="bower_components/sankeyjs/dist/d3.sankey.js" charset="utf-8" type="text/javascript"></script>
|
||||
<script src="bower_components/sankeyjs/dist/d3.sankey.directive.js" charset="utf-8" type="text/javascript"></script>
|
||||
|
||||
<!-- visjs -->
|
||||
<script type="text/javascript" src="bower_components/vis/dist/vis.min.js"></script>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<div class="panel-heading c_blueGrey300">
|
||||
<h3 class="panel-title">Network</h3>
|
||||
<h3 class="panel-title">Address history Network Map</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div id="mynetwork" style="height:800px;"></div>
|
||||
|
||||
@@ -1,11 +1,28 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-2">
|
||||
<div class="panel-heading c_blueGrey300">
|
||||
<h3 class="panel-title">All addresses</h3>
|
||||
</div>
|
||||
<div class="panel-body" style="max-height: 500px;overflow-y: scroll;">
|
||||
<div class="form-group label-floating">
|
||||
<input ng-model="filterAddress" abmFormControl class="form-control" placeholder="Filter" type="text">
|
||||
</div>
|
||||
<div ng-click="getAddressSankey(node)" class="list-group-item" ng-repeat="node in addresses | filter: filterAddress">
|
||||
<div class="row-content">
|
||||
<p class="list-group-item-text">{{node.id}}</p>
|
||||
|
||||
<!--<p class="list-group-item-text">Maecenas sed diam eget risus varius blandit.</p>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="panel-heading c_blueGrey300">
|
||||
<h3 class="panel-title">Sankey</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<ng-sankey id="sankeyChart" options="options" data="data"></ng-sankey>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('app.sankey', ['ngRoute'])
|
||||
angular.module('app.sankey', ['ngRoute', 'ngSankey'])
|
||||
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
$routeProvider.when('/sankey', {
|
||||
@@ -10,6 +10,43 @@ angular.module('app.sankey', ['ngRoute'])
|
||||
}])
|
||||
|
||||
.controller('SankeyCtrl', function($scope, $http, $routeParams) {
|
||||
|
||||
|
||||
$scope.options = {
|
||||
chart: '#sankeyChart',
|
||||
width: 960,
|
||||
height: 500,
|
||||
margin: {top: 1, right: 1, bottom: 6, left: 1},
|
||||
node: {width: 15, padding :10, showValue: false},
|
||||
value: {format: ',.0f', unit : ''},
|
||||
dynamicLinkColor: true,
|
||||
trafficInLinks: true
|
||||
};
|
||||
$scope.data={
|
||||
nodes: [],
|
||||
links: []
|
||||
};
|
||||
|
||||
$http.get(urlapi + 'alladdresses')
|
||||
.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');
|
||||
});
|
||||
$scope.getAddressSankey = function(address) {
|
||||
console.log(address);
|
||||
$http.get(urlapi + 'address/sankey/' + address.id)
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
$scope.data.nodes = data.data.nodes;
|
||||
$scope.data.links = data.data.links;
|
||||
console.log($scope.data);
|
||||
let chart = new d3.sankeyChart(data.data, $scope.options);
|
||||
//$scope.data = data.data;
|
||||
}, function(data, status, headers, config) {
|
||||
console.log('data error');
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user