Created At: 2026-06-14T14:01:17Z
Completed At: 2026-06-14T14:01:17Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 4592
Total Bytes: 194080
Showing lines 4460 to 4580
The following code has been modified to include a line number before every line, in the format: <line_number>: <original_line>. Please note that any changes targeting the original code should remove the line number, colon, and leading space.
4460:             const minYear = Math.min(...years);
4461:             const maxYear = Math.max(...years);
4462:             if (indicator) {
4463:               indicator.innerText = `CSV Terdeteksi: ${rows.length} baris data (${minYear} - ${maxYear}).`;
4464:               indicator.style.color = '#16a34a';
4465:             }
4466:           } else {
4467:             alert('Gagal mendeteksi data valid di file CSV. Pastikan file memiliki kolom Tahun/Year.');
4468:             e.target.value = '';
4469:             if (hiddenInput) {
4470:               hiddenInput.value = '';
4471:               updateSettingsChartPreview();
4472:             }
4473:             if (indicator) indicator.innerText = '';
4474:           }
4475:         };
4476:         reader.readAsText(file);
4477:       }
4478:     });
4479: 
4480:     async function updateSettingsChartPreview() {
4481:       const lokasi = document.getElementById('futureSetLocationGraph')?.value.trim();
4482:       const variable = document.getElementById('futureSetVariableGraph')?.value.trim() || 'Precipitation';
4483:       const statistic = document.getElementById('futureSetStatisticGraph')?.value.trim() || 'Mean';
4484:       const startYear = document.getElementById('futureSetStartYearGraph')?.value.trim() || '1991';
4485:       const endYear = document.getElementById('futureSetEndYearGraph')?.value.trim() || '2100';
4486: 
4487:       const csvData = document.getElementById('futureSetCsvData')?.value.trim();
4488: 
4489:       if (csvData && csvData !== '') {
4490:         // If there is CSV data in the
<truncated 3241 bytes>
 ssp1 !== '' ? parseFloat(ssp1) : null,
4539:           graphSSP2Slope: ssp2 !== '' ? parseFloat(ssp2) : null,
4540:           graphSSP3Slope: ssp3 !== '' ? parseFloat(ssp3) : null,
4541:           graphSSP5Slope: ssp5 !== '' ? parseFloat(ssp5) : null,
4542:           csvData: null
4543:         };
4544: 
4545:         renderFutureClimateChart(varName, customParams, null, 'settingsFutureChartCanvas');
4546:       }
4547:     }
4548: 
4549:     // Listen for form changes to update settings chart preview in real-time
4550:     document.addEventListener('input', function(e) {
4551:       const settingsInputs = [
4552:         'futureSetVariableGraph',
4553:         'futureSetStatisticGraph',
4554:         'futureSetStartYearGraph',
4555:         'futureSetEndYearGraph',
4556:         'futureSetGraphBaseValue',
4557:         'futureSetGraphUncertainty',
4558:         'futureSetGraphSSP1Slope',
4559:         'futureSetGraphSSP2Slope',
4560:         'futureSetGraphSSP3Slope',
4561:         'futureSetGraphSSP5Slope'
4562:       ];
4563:       if (e.target && settingsInputs.includes(e.target.id)) {
4564:         updateSettingsChartPreview();
4565:       }
4566:     });
4567: 
4568:     // Jalankan pemuatan filter dan sinkronisasi auth saat halaman siap
4569:     window.addEventListener('DOMContentLoaded', async () => {
4570:       await loadFilters();
4571:       // Load initial settings data (which also triggers updateSettingsChartPreview)
4572:       await loadHistoricalSettingsData();
4573:       await loadFutureMapSettingsData();
4574:       await loadFutureGraphSettingsData();
4575:       // Render initial default main chart from filters
4576:       applyFutureMapFilter();
4577:       applyFutureTSFilter();
4578:       try {
4579:         const res = await fetch('?action=check_auth');
4580:         const authData = await res.json();
The above content does NOT show the entire file contents. If you need to view any lines of the file which were not shown to complete your task, call this tool again to view those lines.
