diff options
Diffstat (limited to 'js/spam.js')
-rw-r--r-- | js/spam.js | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -232,7 +232,7 @@ function processData(data) { .attr('target', '_blank') .attr('href', 'https://twitter.com/' + d.name) .text(d.name); - userInfo.select('.userid').text(d.group); + userInfo.select('.userid').text(d.userid); userInfo.select('.tweet-count') .text(d.tweetCount); userInfo.select('.spam-status') @@ -347,7 +347,7 @@ function requestUsersCsv(filename) { .row(function (d) { return { name: d.name, - group: +d.userid, + userid: +d.userid, tweetCount: d.tweetcount, radius: Math.sqrt(d.tweetcount), isSpam: +d.isspam, @@ -392,23 +392,23 @@ function refreshSpam() { // store spam levels for the new user var map_userSpam = {}; rows.forEach(function (user) { - map_userSpam[user.group] = user.isSpam; + map_userSpam[user.userid] = user.isSpam; }); // update the spam levels in the dataset var nodes = force.nodes(); nodes.forEach(function (node) { - if (node.group in map_userSpam) { - node.isSpam = map_userSpam[node.group]; + if (node.userid in map_userSpam) { + node.isSpam = map_userSpam[node.userid]; } else { - console.log('New data is missing user', node.group); + console.log('New data is missing user', node.userid); } }); // change the appearance of displayed elements d3.select('#map').selectAll('.node') .data(nodes, function (d) { - return d.group; + return d.userid; }) .attr('class', getNodeClasses); }); |