@@ -140,7 +140,7 @@ function fill_empty_dates(data) {
140140}
141141
142142
143- function filter_pixels ( numberOfDays ) {
143+ async function filter_pixels ( numberOfDays ) {
144144 const lastPixelDate = new Date ( current_data [ current_data . length - 1 ] . date ) ;
145145 current_data = initial_data . filter ( entry => {
146146 const entryDate = new Date ( entry . date ) ;
@@ -157,19 +157,25 @@ function filter_pixels(numberOfDays) {
157157 stats_content_container . style . display = "block" ;
158158
159159 fill_empty_dates ( current_data ) ;
160- compute_tag_stats ( current_data ) ;
161- compute_weekdays_stats ( current_data ) ;
162- compute_months_stats ( current_data ) ;
163- get_word_frequency ( current_data , wordcloudOrderCount , minScore , searchTerm ) ;
164160
165- calculate_and_display_stats ( current_data ) ;
166- create_mood_chart ( current_data , averagingValue , showAverage , showYears ) ;
167- create_tag_frequency_chart ( tagsPercentage , nbMaxTags ) ;
168- create_tag_score_chart ( nbMaxTags ) ;
169- create_weekday_chart ( png_settings . firstDayOfWeek ) ;
170- create_month_chart ( seasonColors ) ;
171- create_word_frequency_section ( current_data , nbMaxWords , nbMinCount , wordcloudPercentage , searchTerm ) ;
172- setup_calendar_frame ( ) ;
161+ await Promise . all ( [
162+ calculate_and_display_stats ( data ) ,
163+ compute_tag_stats ( current_data ) ,
164+ compute_weekdays_stats ( current_data ) ,
165+ compute_months_stats ( current_data ) ,
166+ get_word_frequency ( current_data , wordcloudOrderCount , minScore , searchTerm ) ,
167+
168+ // Graphics
169+ create_mood_chart ( current_data , averagingValue , showAverage , showYears ) ,
170+ create_tag_frequency_chart ( tagsPercentage , nbMaxTags ) ,
171+ create_tag_score_chart ( nbMaxTags ) ,
172+ create_weekday_chart ( png_settings . firstDayOfWeek ) ,
173+ create_month_chart ( seasonColors ) ,
174+ create_word_frequency_section ( current_data , nbMaxWords , nbMinCount , wordcloudPercentage , searchTerm ) ,
175+ setup_calendar_frame ( ) ,
176+ ] ) ;
177+
178+ sync_tag_charts_hover ( ) ;
173179 }
174180}
175181
@@ -204,20 +210,24 @@ async function handle_file_upload(file) {
204210 await load_settings ( ) ;
205211
206212 // Stats
207- calculate_and_display_stats ( data ) ;
208- compute_tag_stats ( current_data ) ;
209- compute_weekdays_stats ( current_data ) ;
210- compute_months_stats ( current_data ) ;
211- get_word_frequency ( current_data , wordcloudOrderCount , minScore , searchTerm ) ;
212-
213- // Graphics
214- create_mood_chart ( current_data , averagingValue , showAverage , showYears ) ;
215- create_tag_frequency_chart ( tagsPercentage , nbMaxTags ) ;
216- create_tag_score_chart ( nbMaxTags ) ;
217- create_weekday_chart ( png_settings . firstDayOfWeek ) ;
218- create_month_chart ( seasonColors ) ;
219- create_word_frequency_section ( current_data , nbMaxWords , nbMinCount , wordcloudPercentage , searchTerm ) ;
220- setup_calendar_frame ( ) ;
213+ await Promise . all ( [
214+ calculate_and_display_stats ( data ) ,
215+ compute_tag_stats ( current_data ) ,
216+ compute_weekdays_stats ( current_data ) ,
217+ compute_months_stats ( current_data ) ,
218+ get_word_frequency ( current_data , wordcloudOrderCount , minScore , searchTerm ) ,
219+
220+ // Graphics
221+ create_mood_chart ( current_data , averagingValue , showAverage , showYears ) ,
222+ create_tag_frequency_chart ( tagsPercentage , nbMaxTags ) ,
223+ create_tag_score_chart ( nbMaxTags ) ,
224+ create_weekday_chart ( png_settings . firstDayOfWeek ) ,
225+ create_month_chart ( seasonColors ) ,
226+ create_word_frequency_section ( current_data , nbMaxWords , nbMinCount , wordcloudPercentage , searchTerm ) ,
227+ setup_calendar_frame ( ) ,
228+ ] ) ;
229+
230+ sync_tag_charts_hover ( ) ;
221231
222232
223233 // DEBUGGING
@@ -361,18 +371,21 @@ document.addEventListener("DOMContentLoaded", () => {
361371 tag_frequency_checkbox . addEventListener ( "change" , ( e ) => {
362372 tagsPercentage = e . target . checked ;
363373 create_tag_frequency_chart ( tagsPercentage , nbMaxTags ) ;
374+ sync_tag_charts_hover ( ) ;
364375 } ) ;
365376
366377 input_nb_tags . addEventListener ( "input" , ( e ) => {
367378 nbMaxTags = parseInt ( e . target . value ) ;
368379 create_tag_frequency_chart ( tagsPercentage , nbMaxTags ) ;
369380 create_tag_score_chart ( nbMaxTags ) ;
381+ sync_tag_charts_hover ( ) ;
370382 } ) ;
371383
372384 select_tag_category . addEventListener ( "input" , ( e ) => {
373385 tagCategory = e . target . value ;
374386 create_tag_frequency_chart ( tagsPercentage , nbMaxTags ) ;
375387 create_tag_score_chart ( nbMaxTags ) ;
388+ sync_tag_charts_hover ( ) ;
376389 } ) ;
377390
378391
0 commit comments