Skip to content

Commit f330ebf

Browse files
authored
Deploy v1.2.3
Develop 1.2.3
2 parents 0f5a876 + cf2134f commit f330ebf

14 files changed

Lines changed: 2943 additions & 2078 deletions

File tree

index.html

Lines changed: 66 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h1>Pixels Visualiser</h1>
5656
<button class="pill active" data-range="99999">All time</button>
5757
</div>
5858

59-
<div class="no-data-error" style="display: none;">No data available for the selected range</div>
59+
<div class="no-data-error">No data available for the selected range</div>
6060

6161
<div id="stats-content">
6262
<div class="stats-grid" id="statsContainer">
@@ -119,8 +119,7 @@ <h2>😊 Average score per tag</h2>
119119
<h2>🔁 Weekdays average scores</h2>
120120
<div class="options">
121121
<div class="option-item">
122-
<label for="firstDayOfWeekSelect"
123-
title="Which day do you want the week to start on">First day of the week</label>
122+
<label for="firstDayOfWeekSelect" title="Which day do you want the week to start on">First day of the week</label>
124123
<select id="firstDayOfWeekSelect" class="select">
125124
<option value="1">Monday</option>
126125
<option value="2">Tuesday</option>
@@ -155,26 +154,71 @@ <h2>📝 Most frequent words</h2>
155154

156155
<div class="options">
157156
<div class="option-item">
158-
<label for="wordsPercentageCheckbox"
159-
title="Show percentage of appearance among all Pixels instead of raw values">Show percentages</label>
160-
<input type="checkbox" id="wordsPercentageCheckbox" class="checkbox">
157+
<button class="button open-settings" id="openWordsSettingsDialog">
158+
<img src="assets/settings_icon.svg" alt="Settings" class="icon-settings">
159+
</button>
161160
</div>
162161

163-
<div class="option-item">
164-
<label for="wordsOrderCheckbox" title="Order the words bellow by decreasing score">Order by score</label>
165-
<input type="checkbox" id="wordsOrderCheckbox" class="checkbox">
166-
</div>
162+
<dialog id="dialogWordsSettings" class="div-dialog-settings">
163+
<div class="dialog-settings">
164+
165+
<h3>Words settings</h3>
166+
167+
<div class="dialog-settings-group">
168+
<label for="wordsPercentageCheckbox" title="Show percentage of appearance among all Pixels instead of raw values">Show percentages</label>
169+
<input type="checkbox" id="wordsPercentageCheckbox" class="checkbox">
170+
171+
<label for="wordsOrderCheckbox" title="Order the words bellow by decreasing score">Order by score</label>
172+
<input type="checkbox" id="wordsOrderCheckbox" class="checkbox">
173+
174+
<label for="minCountInput" title="Minimum number of time this words appears in your Pixels">Minimum count</label>
175+
<input type="number" id="minCountInput" class="input-nb" min="1" value="10">
176+
177+
<label for="excludeStopwordsCheckbox" title="Choose which words you want to exclude from the word list">Customise stopwords</label>
178+
<button class="button" id="openStopwordsSettingsDialog">Stopwords</button>
179+
</div>
180+
181+
<div class="dialog-buttons">
182+
<button type="submit" class="button button-tertiary" id="saveWordsSettingsDialog">Save</button>
183+
</div>
184+
</div>
185+
</dialog>
186+
187+
<dialog id="dialogStopwordsSettings" class="div-dialog-settings">
188+
<div class="dialog-settings">
189+
190+
<h3>Stopwords settings</h3>
191+
192+
<div class="dialog-settings-group">
193+
194+
<label for="stopwordsLanguageSelect" title="Which language do you want the stopwords to be in?">Stopwords language</label>
195+
<select id="stopwordsLanguageSelect" class="select">
196+
<option value="no">Don't use</option>
197+
<option value="en">English</option>
198+
<option value="fr">French</option>
199+
<option value="es">Spanish</option>
200+
<option value="ge">German</option>
201+
<option value="it">Italian</option>
202+
</select>
203+
204+
<label for="defaultStopwordsTextarea" title="Words that are excluded for this language, you can delete some">Default stopwords</label>
205+
<textarea id="defaultStopwordsTextarea" class="textarea long" rows="4" placeholder="One word per line"></textarea>
206+
207+
<label for="customStopwordsTextarea" title="Choose personnal words you want to exclude">Custom stopwords</label>
208+
<textarea id="customStopwordsTextarea" class="textarea" rows="4" placeholder="Enter one word per line"></textarea>
209+
</div>
210+
211+
<div class="dialog-buttons">
212+
<button type="submit" class="button button-tertiary" id="saveStopwordsSettingsDialog">Save</button>
213+
</div>
214+
</div>
215+
</dialog>
167216

168217
<div class="option-item">
169218
<label for="maxWordsInput" title="Number of words to display">Number of words</label>
170219
<input type="number" id="maxWordsInput" class="input-nb" min="1" value="20">
171220
</div>
172221

173-
<div class="option-item">
174-
<label for="minCountInput" title="Minimum number of time this words appears in your Pixels">Minimum count</label>
175-
<input type="number" id="minCountInput" class="input-nb" min="1" value="10">
176-
</div>
177-
178222
<div class="option-item">
179223
<label for="minScoreSlider" title="Only count words appearing in a Pixel with a score above the defined threshold">Min score: <span id="minScoreValue">1</span></label>
180224
<input type="range" id="minScoreSlider" class="range-slider" min="10" max="50" value="10">
@@ -208,11 +252,11 @@ <h2>📝 Most frequent words</h2>
208252
</div>
209253

210254
<div class="chart-container" id="pixelGridExportContainer">
211-
<h2>🖼️ Export Pixel Grid</h2>
255+
<h2>🖼️ Export Pixels image</h2>
212256

213257
<div class="options grid-options">
214258
<div class="option-item">
215-
<button class="button" id="openSettingsDialog">
259+
<button class="button open-settings" id="openImageSettingsDialog">
216260
<img src="assets/settings_icon.svg" alt="Settings" class="icon-settings">
217261
</button>
218262
</div>
@@ -236,7 +280,7 @@ <h2>🖼️ Export Pixel Grid</h2>
236280
</select>
237281
</div>
238282

239-
<dialog id="dialogSettings">
283+
<dialog id="dialogSettings" class="div-dialog-settings">
240284
<div class="dialog-settings">
241285

242286
<h3>Image settings</h3>
@@ -298,7 +342,7 @@ <h3>Image settings</h3>
298342
</div>
299343

300344
<div class="chart-container">
301-
<h2>📅 Search Pixel by Date</h2>
345+
<h2>📅 Search Pixels by date</h2>
302346

303347
<div class="options">
304348
<div class="option-item">
@@ -323,8 +367,8 @@ <h2>📅 Search Pixel by Date</h2>
323367
<img src="assets/pixels_memories_logo.png" alt="Pixels Memories">
324368
</a>
325369
</div>
326-
<div class="version">Version: v1.2.2</div>
327-
<div class="version">Last update: 2025-06-23</div>
370+
<div class="version">Version: v1.2.3</div>
371+
<div class="version">Last update: 2025-06-27</div>
328372
</footer>
329373

330374
<!-- Charts.js -->
@@ -336,11 +380,11 @@ <h2>📅 Search Pixel by Date</h2>
336380
<script src="https://cdnjs.cloudflare.com/ajax/libs/wordcloud2.js/1.1.2/wordcloud2.min.js"></script>
337381

338382
<script src="scripts/utils.js"></script>
383+
<script src="scripts/stopwords.js"></script>
339384
<script src="scripts/main.js"></script>
340385
<script src="scripts/card.js"></script>
341386
<script src="scripts/graphs.js"></script>
342387
<script src="scripts/statistics.js"></script>
343-
<script src="scripts/stopwords.js"></script>
344388
<script src="scripts/png.js"></script>
345389
<script src="scripts/storage.js"></script>
346390
</body>

scripts/main.js

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ const rolling_slider_text_value = document.querySelector("#rollingValue");
1414
const tag_grid_charts = document.querySelector(".grid-charts");
1515
const show_average_checkbox = document.querySelector("#showAverageCheckbox");
1616
const show_years_checkbox = document.querySelector("#showYearsCheckbox");
17+
const nb_tags_inputs = document.querySelectorAll(".input-max-tag");
1718
const tag_frequency_checkbox = document.querySelector("#tagFrequencyCheckbox");
1819

1920
const weekday_frequency_select = document.querySelector("#firstDayOfWeekSelect");
20-
2121
const season_colors_checkbox = document.querySelector("#seasonColorsCheckbox");
2222

2323
const word_freq_container = document.querySelector("#wordFrequency");
24-
const nb_tags_inputs = document.querySelectorAll(".input-max-tag");
2524
const words_percentage_checkbox = document.querySelector("#wordsPercentageCheckbox");
2625
const words_order_checkbox = document.querySelector("#wordsOrderCheckbox");
2726
const words_words_input = document.querySelector("#maxWordsInput");
@@ -30,6 +29,10 @@ const min_score_slider = document.querySelector("#minScoreSlider");
3029
const min_score_slider_text_value = document.querySelector("#minScoreValue");
3130
const words_search_input = document.querySelector("#searchInput");
3231

32+
const words_dialog_settings = document.querySelector("#dialogWordsSettings");
33+
const btn_open_words_dialog_settings = document.querySelector("#openWordsSettingsDialog");
34+
const btn_save_words_dialog_settings = document.querySelector("#saveWordsSettingsDialog");
35+
3336
const wordcloud_container = document.querySelector("#wordcloudContainer");
3437
const wordcloud_canvas = document.querySelector("#wordcloudCanvas");
3538
const wordcloud_size_input = document.querySelector("#wordcloudSize");
@@ -39,7 +42,7 @@ const btn_download_wordcloud = document.querySelector("#btnDownloadWordcloud");
3942

4043
const DEV_MODE = false;
4144
const DEV_FILE_PATH = "../data/pixels.json"
42-
const SCROLL_TO = 50;
45+
const SCROLL_TO = 2000;
4346
const isMobile = window.innerWidth <= 800;
4447
let initial_data = [];
4548
let current_data = [];
@@ -203,7 +206,7 @@ async function handle_file_upload(file) {
203206
}
204207
}
205208
catch (error) {
206-
console.error(`Error: ${error.message}`);
209+
console.error(`Error in handle file upload: ${error.message}`);
207210
}
208211
}
209212

@@ -233,6 +236,26 @@ async function auto_load_data(filePath) {
233236
}
234237

235238

239+
// Dialog words settings
240+
function open_words_dialog_settings() {
241+
words_dialog_settings.showModal();
242+
words_dialog_settings.addEventListener('click', handle_click_words_dialog);
243+
}
244+
245+
246+
function close_words_dialog_settings() {
247+
words_dialog_settings.close();
248+
words_dialog_settings.removeEventListener('click', handle_click_words_dialog);
249+
}
250+
251+
252+
function handle_click_words_dialog(e) {
253+
if (e.target === words_dialog_settings) {
254+
close_words_dialog_settings();
255+
}
256+
}
257+
258+
236259

237260

238261
document.addEventListener("DOMContentLoaded", () => {
@@ -373,6 +396,14 @@ document.addEventListener("DOMContentLoaded", () => {
373396
});
374397

375398
// Wordcloud
399+
btn_open_words_dialog_settings.addEventListener("click", () => {
400+
open_words_dialog_settings();
401+
});
402+
403+
btn_save_words_dialog_settings.addEventListener("click", () => {
404+
close_words_dialog_settings();
405+
});
406+
376407
wordcloud_size_input.addEventListener("input", (e) => {
377408
wordcloudSize = parseInt(e.target.value);
378409
update_wordcloud(nbMinCount);

scripts/png.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const dialog_settings = document.querySelector("#dialogSettings");
2-
const btn_open_dialog_settings = document.querySelector("#openSettingsDialog");
2+
const btn_open_dialog_settings = document.querySelector("#openImageSettingsDialog");
33
const btn_reset_dialog_settings = document.querySelector("#resetSettingsDialog");
44
const btn_cancel_dialog_settings = document.querySelector("#cancelSettingsDialog");
55
const btn_save_dialog_settings = document.querySelector("#saveSettingsDialog");
@@ -242,13 +242,6 @@ function open_dialog_settings() {
242242
}
243243

244244

245-
function handle_click_dialog(e) {
246-
if (e.target === dialog_settings) {
247-
close_dialog_settings();
248-
}
249-
};
250-
251-
252245
function close_dialog_settings() {
253246
set_image_settings(png_settings);
254247
dialog_settings.close();
@@ -264,6 +257,13 @@ function close_and_save_dialog_settings() {
264257
}
265258

266259

260+
function handle_click_dialog(e) {
261+
if (e.target === dialog_settings) {
262+
close_dialog_settings();
263+
}
264+
}
265+
266+
267267

268268

269269
btn_open_dialog_settings.addEventListener("click", () => {

scripts/statistics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function calculate_and_display_stats(data) {
7676
["Number of Pixels", `<p>${data.length}</p>`],
7777
["Average score", `<p>${average(allScores).toFixed(2)}</p>`],
7878
["Streaks", `<p>Best: ${streaks.bestStreak} | Latest: ${streaks.latestStreak}</p>`],
79-
["Score distribution", "<canvas id='scoresPieChart' class='pie-chart' width='100' height='100'></canvas>"],
79+
["Score distribution", "<canvas title='Update your colors in the \"Export Pixel image\" settings' id='scoresPieChart' class='pie-chart' width='100' height='100'></canvas>"],
8080
];
8181

8282
stats_container.innerHTML = stats.map(([title, value]) => `

0 commit comments

Comments
 (0)