diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-05-21 21:39:21 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-05-21 21:39:21 +0200 |
commit | 56633d3b46a4e00a45a67cc9394b22208bf7a34a (patch) | |
tree | baa768489085ea9b52b89f127e2edc2e07b62104 /js/preprocess.js | |
parent | 4294ddb0811bb1af2812a75778af1bab7dfde511 (diff) | |
download | d3viz-56633d3b46a4e00a45a67cc9394b22208bf7a34a.tar.gz |
Rename group to userid to reflect actual data
Diffstat (limited to 'js/preprocess.js')
-rw-r--r-- | js/preprocess.js | 8 |
1 files changed, 4 insertions, 4 deletions
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); |