From 56633d3b46a4e00a45a67cc9394b22208bf7a34a Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 21 May 2014 21:39:21 +0200 Subject: Rename group to userid to reflect actual data --- js/preprocess.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js/preprocess.js') diff --git a/js/preprocess.js b/js/preprocess.js index d65c7db..65d27c3 100644 --- a/js/preprocess.js +++ b/js/preprocess.js @@ -11,7 +11,7 @@ function filterEdges(data, ratelimit_max) { var users = {}; //data.nodes.length = 10000; data.nodes.forEach(function (user, i) { - users[user.group] = user; + users[user.userid] = user; }); var ratelimit_count = 0; @@ -70,12 +70,12 @@ function preprocess(data, options) { var hasRelated = {}; data.nodes = data.nodes.filter(function (d) { /* Uncomment if it seems to be useful. - if (!(d.group in hasRelations) && d.tweetCount >= 100) { + if (!(d.userid in hasRelations) && d.tweetCount >= 100) { console.log('Keeping lonely user with', d.tweetCount, 'tweets'); return true; } */ - return d.group in hasRelations; + return d.userid in hasRelations; }); console.log('Nodes count (after dropping loners):', data.nodes.length); } @@ -83,7 +83,7 @@ function preprocess(data, options) { // prepare data for force layout: map user IDs to indices var userIds_indices = {}; data.nodes.forEach(function (user, i) { - userIds_indices[user.group] = i; + userIds_indices[user.userid] = i; }); console.log('UserID to index map:', userIds_indices); -- cgit v1.2.1