add circles
This commit is contained in:
parent
d88f6d9269
commit
2b2fada6d2
1 changed files with 4 additions and 5 deletions
9
index.js
9
index.js
|
@ -32,13 +32,15 @@ if (mode == 'cli') {
|
|||
let json = await fetch("https://nbg.dervland.net/api/followjson.php");
|
||||
json = await json.json();
|
||||
|
||||
let { ref } = req.query;
|
||||
|
||||
let data = {};
|
||||
|
||||
for (let entryI in json) {
|
||||
let entry = json[entryI];
|
||||
let user = data[entry.username] || {};
|
||||
let target = data[entry.target] || {};
|
||||
|
||||
|
||||
let f1 = user.following = user.following || [];
|
||||
let f2 = user.followers = user.followers || [];
|
||||
let f3 = target.following = target.following || [];
|
||||
|
@ -50,10 +52,7 @@ if (mode == 'cli') {
|
|||
data[entry.username] = user;
|
||||
data[entry.target] = target;
|
||||
}
|
||||
|
||||
console.log(data)
|
||||
|
||||
let calcedRank = rankCalc(data, matrixIterations, [], false, settings.isGpu);
|
||||
let calcedRank = rankCalc(data, matrixIterations, ref ? [ref] : [], false, settings.isGpu);
|
||||
let dat = Object.entries(calcedRank);
|
||||
dat = dat.sort((a, b) => b[1] - a[1]);
|
||||
console.log(`Graph is calculated with ${dat.length} entries`);
|
||||
|
|
Loading…
Reference in a new issue