Spaces:
Running
Running
File size: 1,837 Bytes
1e7d16c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | // Main application script
document.addEventListener('DOMContentLoaded', function() {
// Initialize tooltips
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
// Sample data for demonstration
const sampleData = {
variables: [
{ name: 'ID', type: 'Numeric', missing: 0, unique: 12345 },
{ name: 'Age', type: 'Numeric', missing: 2, unique: 78 },
{ name: 'Gender', type: 'Character', missing: 1, unique: 2 }
]
};
// Function to update variable table
function updateVariableTable() {
const tableBody = document.querySelector('tbody');
if (tableBody) {
tableBody.innerHTML = sampleData.variables.map(variable => `
<tr>
<td class="px-6 py-4 whitespace-nowrap font-medium">${variable.name}</td>
<td class="px-6 py-4 whitespace-nowrap">${variable.type}</td>
<td class="px-6 py-4 whitespace-nowrap">${variable.missing}%</td>
<td class="px-6 py-4 whitespace-nowrap">${variable.unique}</td>
<td class="px-6 py-4 whitespace-nowrap">
<button class="text-primary-500 hover:text-primary-600 mr-3">
<i data-feather="eye"></i>
</button>
<button class="text-secondary-500 hover:text-secondary-600">
<i data-feather="bar-chart-2"></i>
</button>
</td>
</tr>
`).join('');
feather.replace();
}
}
updateVariableTable();
}); |