Commit 8d0f1b0e authored by Chancellier Pierre-Jean's avatar Chancellier Pierre-Jean
Browse files

v.0.4.0 - fa2rs implementation

parent 6e1de3a4
......@@ -35,7 +35,22 @@ Exploration de la Toile de Confiance de Duniter utilisant la librairie javascrip
### I. Installer Python et les paquets nécessaires
sudo apt-get update && sudo apt-get install python3 python3-pip
sudo pip3 install plyvel networkx numpy
sudo pip3 install plyvel networkx numpy fa2rs
Si, au lancement du script wot_json.py, vous obtenez une erreur liée à GLIBC c'est que vous devez compiler le paquet pour votre machine et cela nécessire Rust.
# On installe Rust
sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo rustup install nightly
sudo rustup default nightly
# On récupère les sources
mkdir sources_fa2rs && cd sources_fa2rs
git clone https://framagit.org/ZettaScript/forceatlas2-rs forceatlas2
git clone https://framagit.org/ZettaScript/fa2rs-py
cd fa2rs-py
sh build_wheel.sh
sudo pip3 install --user --force-reinstall target/wheel/dist/fa2rs-0.1.0-py3-none-any.whl
### II. Récupérer les sources du projet
Rendez-vous dans le dossier HOME de votre utilisateur duniter (par ex : /var/lib/duniter/) et récupérez les sources :
......@@ -49,8 +64,8 @@ Rendez-vous dans le dossier HOME de votre utilisateur duniter (par ex : /var/lib
* Créez le fichier ***/etc/cron.d/wotmap*** sur votre serveur pour automatiser le lancement du script :
30 3 * * 0-5 duniter python3 /var/lib/duniter/wotmap/script/wot_json.py --ns >> /var/log/wotmap/wotmap.log 2>&1
30 3 * * 6 duniter python3 /var/lib/duniter/wotmap/script/wot_json.py -d --ns >> /var/log/wotmap/wotmap.log 2>&1
30 3 * * 0-5 duniter python3 /var/lib/duniter/wotmap/script/wot_json.py --ns --fa2rs >> /var/log/wotmap/wotmap.log 2>&1
30 3 * * 6 duniter python3 /var/lib/duniter/wotmap/script/wot_json.py -d --ns --fa2rs >> /var/log/wotmap/wotmap.log 2>&1
### IV. Paramétrage d'Apache
......
{"instance": {"custom": {"block": 370119, "currency": "g1"}, "version": "0.3.4", "software": "wotmap", "working": true, "maintainers": []}, "stats": {"total_edges": 24612, "total_nodes": 2824, "total_communities": 30, "crit_referent": 5, "total_members": 2824, "median_time": 1604365971, "centrality_extrema": {"c_information": [0.0002875808249263121, 0.0022201090432376162], "c_degree": [0.00035423308537017357, 0.03506907545164718], "c_load": [0.0, 0.059693668770354855], "c_betweenness": [0.0, 0.06409975639544824], "c_closeness": [0.19909725650610058, 0.3809202536769667], "c_harmonic": [583.0142857142847, 1164.3333333333385], "c_eigenvector": [0.00026499413746909915, 0.1665531170499599]}, "total_referents": 1698, "total_noreferents": 1126}}
\ No newline at end of file
{"stats": {"median_time": 1617667618, "total_edges": 26070, "total_nodes": 3003, "total_members": 3003, "total_communities": 30, "crit_referent": 5, "total_referents": 1835, "total_noreferents": 1168, "centrality_extrema": {}}, "instance": {"software": "wotmap", "version": "0.4.0", "working": true, "maintainers": [], "custom": {"currency": "g1", "block": 412938}}}
\ No newline at end of file
This diff is collapsed.
......@@ -18,7 +18,7 @@
<link rel="stylesheet" href="css/main.min.css">
</head>
<body id="body">
<!-- <div id="loader" class="w3-modal" style="display: block;">
<div id="loader" class="w3-modal" style="display: block;">
<div class="w3-modal-content w3-round-large w3-card-4 w3-animate-zoom w3-black">
<div class="w3-container">
<img src="img/G1.gif">
......@@ -28,7 +28,7 @@
</div>
</div>
</div>
</div> -->
</div>
<div id="myProgress">
<div class="w3-text-white">Chargement des avatars</div>
<div class="w3-light-grey w3-round">
......
This diff is collapsed.
......@@ -18,6 +18,8 @@ function displayGraph(s){
cam = s.camera,
cesium = 'https://demo.cesium.app' + '/#/app/wot/';
_.$('loader').style.display = "none";
// Browse all the nodes to retrieve the maxDegree and to sort the labels for autocompletion search
s.graph.nodes().forEach(function(node, i, a) {
var tabnode = [node.label, node.url];
......@@ -38,7 +40,7 @@ function displayGraph(s){
easing: 'cubicInOut',
scalingRatio: .1
});
// Bind the events for displaying the loader during the calculation of nodes position
fa.bind('start ', function(e) {
_.$('loader').style.display='block';
......
......@@ -10,7 +10,7 @@ $ sudo pip3 install plyvel networkx numpy
import sys, os, time, math, json, urllib.request, plyvel, subprocess, networkx, random
VERSION = "0.3.4"
VERSION = "0.4.0"
STEPMAX = 5
def getargv(arg, default=""):
......@@ -361,7 +361,7 @@ Default options:
log("Updating coords...")
if "--fa2rs" in sys.argv:
import fa2rs
layout = fa2rs.Layout.from_graph(graph.edges, len(graph.nodes), fa2rs.Settings(kr=0.002, kg=0.001, ka=0.01, dissuade_hubs=False, barnes_hut=None, strong_gravity=False, prevent_overlapping=False, jitter_tolerance=0.1))
layout = fa2rs.Layout.from_graph(graph.edges, len(graph.nodes), fa2rs.Settings(kr=0.02, kg=0, ka=0.01, dissuade_hubs=False, barnes_hut=None, strong_gravity=False, prevent_overlapping=False, jitter_tolerance=0.1))
for i in range(1000):
print("{} / 1000".format(i), end="\r")
layout.iteration()
......
Supports Markdown
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