Changed time_factor to 0.5, changed the stored tweets to 1000, changed the displayed tweets to 100

This commit is contained in:
2022-11-04 13:40:06 +01:00
parent a5d809eacc
commit bdc587901b
5 changed files with 6 additions and 6 deletions

View File

Binary file not shown.

View File

@@ -13,7 +13,7 @@ root_content_path = 'dashboard_static'
# the action will be called with the context and the event # the action will be called with the context and the event
@event('init') @event('init')
def setup(ctx, e): def setup(ctx, e):
start_offline_tweets('sports1.txt', event_name="tweet", time_factor=0.1) start_offline_tweets('sports1.txt', event_name="tweet", time_factor=0.5)
ctx.count = 0 ctx.count = 0
# fire('sample', {'previous': 0.0}) # fire('sample', {'previous': 0.0})

View File

@@ -137,7 +137,7 @@
<script src="./lib/jquery.flot.pie.js"></script> <script src="./lib/jquery.flot.pie.js"></script>
<script> <script>
block("#latest").tweets({ block("#latest").tweets({
memory: 20 memory: 100
}); });
block('#pie').piechart(); block('#pie').piechart();
events.connect('pie', '#pie'); events.connect('pie', '#pie');

View File

@@ -71,11 +71,11 @@ $(window).on("filter", function() {
tweets = JSON.parse(tweets); tweets = JSON.parse(tweets);
tweets = filterTweets(tweets, filters.blockedWords, filters.searchedWords.concat(filters.sports), filters.sorted, filters.order); tweets = filterTweets(tweets, filters.blockedWords, filters.searchedWords.concat(filters.sports), filters.sorted, filters.order);
tweets = sortTweets(tweets, {"sortby":filters.sorted, "order":filters.order}); tweets = sortTweets(tweets, {"sortby":filters.sorted, "order":filters.order});
var displayTweets = tweets.reverse().slice(0, 20).reverse(); var displayTweets = tweets.reverse().slice(0, 100).reverse();
if(!paused) { if(!paused) {
if(tweetCell(displayTweets[0]) != lastTweet){ if(tweetCell(displayTweets[0]) != lastTweet){
parent.replaceChildren(); parent.replaceChildren();
for (i = 0; i < Math.min(19, displayTweets.length); i++){ for (i = 0; i < Math.min(100, displayTweets.length); i++){
tweet = displayTweets[i]; tweet = displayTweets[i];
parent.prepend(tweetCell(tweet)); parent.prepend(tweetCell(tweet));
} }

View File

@@ -68,7 +68,7 @@ var process_entities = function(message, entities) {
block.fn.tweets = function(config) { block.fn.tweets = function(config) {
var options = $.extend({ var options = $.extend({
memory: 20 memory: 100
}, config); }, config);
// store list for later // store list for later
@@ -81,7 +81,7 @@ block.fn.tweets = function(config) {
tweets = window.sessionStorage.getItem('tweets'); tweets = window.sessionStorage.getItem('tweets');
tweets = JSON.parse(tweets); tweets = JSON.parse(tweets);
tweets.push(tweet); tweets.push(tweet);
var localMemory = 100; var localMemory = 1000;
if(tweets.length >= localMemory) { if(tweets.length >= localMemory) {
tweets.shift(); tweets.shift();
} }