Commit 8d4ef90a authored by Luc Didry's avatar Luc Didry

Fix #1 Add drawing progress bar

This commit is dedicated to Maïa Dereva, who is supporting me in Ğ1.
Many thanks :-)
parent c107d208
Pipeline #30600 passed with stages
in 24 minutes and 9 seconds
......@@ -135,10 +135,29 @@ $ua->get('http://duniter.fiat-tux.fr:10901/wot/members' => sub {
width: 98vw;
height: 98vh;
}
#w3-border {
border: 1px solid #ccc !important;
width: 100%;
}
#w3-progress-bar {
color: #000 !important;
background-color: green !important;
height: 24px;
width: 0%;
}
#w3-progress-text {
text-align: center;
margin-top: -24px;
height: 24px;
}
</style>
<script src="vis.js"></script>
</head>
<body>
<div id="w3-border">
<div id="w3-progress-bar"></div>
<div id="w3-progress-text">0%</div>
</div>
<div id="mynetwork"></div>
<script>
var n = $data_nodes;
......@@ -147,6 +166,8 @@ $ua->get('http://duniter.fiat-tux.fr:10901/wot/members' => sub {
var nodes = new vis.DataSet([]);
var edges = new vis.DataSet([]);
var container = document.getElementById('mynetwork');
var progr = 0;
var total = e.length;
var data = {
nodes: nodes,
edges: edges
......@@ -165,6 +186,11 @@ $ua->get('http://duniter.fiat-tux.fr:10901/wot/members' => sub {
var network = new vis.Network(container, data, options);
console.info('Number of edges: '+e.length);
function addEdge(ed) {
progr++;
var w = progr/total;
document.getElementById('w3-progress-bar').style.width = w+'%';
var w2 = Math.round(100000 * progr/total) / 100000;
document.getElementById('w3-progress-text').textContent = w2+'%';
setTimeout(function() {
var edg = ed.shift();
console.info('Adding edge');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment