Spaces:
Configuration error
Configuration error
DBA-UL commited on
Commit ·
b6cb528
1
Parent(s): 0bf4dfa
Correction README et ajout upload
Browse files
main.js
CHANGED
|
@@ -30,6 +30,14 @@ function loadCSVData() {
|
|
| 30 |
console.log("CSV Parsed:", results.data);
|
| 31 |
rawData = results.data;
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
if (rawData.length > 0) {
|
| 34 |
// Initialiser les dates min et max
|
| 35 |
const dates = rawData.map(d => d.Date).filter(d => d);
|
|
|
|
| 30 |
console.log("CSV Parsed:", results.data);
|
| 31 |
rawData = results.data;
|
| 32 |
|
| 33 |
+
// Vérifier si le CSV est valide (s'il contient bien la colonne 'Date')
|
| 34 |
+
// PapaParse peut parfois lire une page d'erreur 404 comme un CSV
|
| 35 |
+
if (rawData.length === 0 || !rawData[0] || !rawData[0].hasOwnProperty('Date')) {
|
| 36 |
+
console.warn("Le fichier CSV est introuvable ou invalide. Affichage de l'upload manuel.");
|
| 37 |
+
document.getElementById('upload-group').style.display = 'block';
|
| 38 |
+
return;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
if (rawData.length > 0) {
|
| 42 |
// Initialiser les dates min et max
|
| 43 |
const dates = rawData.map(d => d.Date).filter(d => d);
|