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
@event('init')
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
# fire('sample', {'previous': 0.0})

View File

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

View File

@@ -71,11 +71,11 @@ $(window).on("filter", function() {
tweets = JSON.parse(tweets);
tweets = filterTweets(tweets, filters.blockedWords, filters.searchedWords.concat(filters.sports), filters.sorted, 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(tweetCell(displayTweets[0]) != lastTweet){
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];
parent.prepend(tweetCell(tweet));
}

View File

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