diff --git a/app.js b/app.js index 78fad3a..e91c7f6 100644 --- a/app.js +++ b/app.js @@ -622,10 +622,13 @@ async function loadAvailableMonths() { // Load TinyColor first await loadTinyColor(); - // For now, we only have one month - const months = ['2025-01']; + // Include all available months + const months = ['2025-01', '2025-02']; const select = document.getElementById('month-select'); + // Clear existing options + select.innerHTML = ''; + months.forEach(month => { const option = document.createElement('option'); option.value = month; @@ -633,10 +636,14 @@ async function loadAvailableMonths() { select.appendChild(option); }); - // Load the first month by default - const data = await parseCSV(`altcats-${months[0]}.csv`); + // Load the most recent month by default + const latestMonth = months[months.length - 1]; + const data = await parseCSV(`altcats-${latestMonth}.csv`); renderChart(data); + // Set the select value to match + select.value = latestMonth; + // Add event listener for month selection select.addEventListener('change', async (e) => { const month = e.target.value; @@ -785,7 +792,7 @@ function setupHoverEvents(sunburstData) { `; // Number of items to show in the details box - const MAX_DETAIL_ITEMS = 5; + const MAX_DETAIL_ITEMS = 10; let itemsToShow = []; // Check if the node has children (subcategories or microcategories) @@ -832,4 +839,4 @@ function setupHoverEvents(sunburstData) { // Reset to default view when a section is no longer emphasized showDefaultView(); }); -} \ No newline at end of file +} \ No newline at end of file