Skip to content

Commit e0da7a3

Browse files
committed
fix(dashboard): Simplify data loader UI
Remove confusing 'Load ../debtmap.json' and 'Reload' buttons. Users should use 'Load JSON File' to select their file. Status now shows 'No file loaded' initially and updates with the loaded filename.
1 parent cc56ed1 commit e0da7a3

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

viz-dev/dashboard.html

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,7 @@ <h1>Debtmap Dashboard</h1>
321321
<div class="data-loader">
322322
<button onclick="document.getElementById('file-input').click()">Load JSON File</button>
323323
<input type="file" id="file-input" accept=".json" onchange="loadFromFile(event)">
324-
<button class="secondary" onclick="loadDefaultJson()">Load ../debtmap.json</button>
325-
<button class="secondary" onclick="reloadData()">Reload</button>
326-
<span class="status" id="load-status">No data loaded</span>
324+
<span class="status" id="load-status">No file loaded</span>
327325
</div>
328326

329327
<!-- Summary Cards (shown after data load) -->
@@ -489,25 +487,6 @@ <h3>No Data Loaded</h3>
489487
reader.readAsText(file);
490488
}
491489

492-
async function loadDefaultJson() {
493-
updateStatus('Loading...', '');
494-
try {
495-
// Add cache-busting parameter to force fresh fetch
496-
const response = await fetch(`../debtmap.json?t=${Date.now()}`);
497-
if (!response.ok) throw new Error(`HTTP ${response.status}`);
498-
rawData = await response.json();
499-
processAndRender();
500-
updateStatus('Loaded: debtmap.json', 'loaded');
501-
} catch (err) {
502-
updateStatus(`Error: ${err.message}. Try using a local server.`, 'error');
503-
}
504-
}
505-
506-
function reloadData() {
507-
// Re-fetch the JSON file instead of just re-rendering cached data
508-
loadDefaultJson();
509-
}
510-
511490
function updateStatus(msg, className) {
512491
const status = document.getElementById('load-status');
513492
status.textContent = msg;

0 commit comments

Comments
 (0)