Constellation Dashboard

Constellation Dashboard

Project Constellation View

Selected Star Details

Click on a star in the graph to see its details here.

${star.description || 'No description provided.'}

`; }; // --- PDF DOWNLOAD --- window.downloadPDF = () => { const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(18); doc.text("Constellation Dashboard Report", 14, 22); doc.setFontSize(11); doc.setTextColor(100); doc.text(`Generated on: ${new Date().toLocaleDateString('en-US')}`, 14, 30); let yPos = 40; appData.constellations.forEach(con => { if (yPos > 250) { // Add new page if content is too long doc.addPage(); yPos = 20; } doc.setFontSize(14); doc.setFont(undefined, 'bold'); doc.text(con.name, 14, yPos); yPos += 7; if (con.stars.length > 0) { const tableColumn = ["Star Name", "Status", "Value (%)", "Description"]; const tableRows = []; con.stars.forEach(star => { const starData = [ star.name, star.status, star.value, star.description || "N/A" ]; tableRows.push(starData); }); doc.autoTable({ head: [tableColumn], body: tableRows, startY: yPos, theme: 'grid', headStyles: { fillColor: [59, 130, 246] }, // blue-500 styles: { cellPadding: 2, fontSize: 9 }, columnStyles: { 3: { cellWidth: 'auto' } } }); yPos = doc.lastAutoTable.finalY + 15; } else { doc.setFontSize(10); doc.setFont(undefined, 'normal'); doc.text("No stars in this constellation.", 14, yPos); yPos += 10; } }); doc.save('Constellation-Dashboard-Report.pdf'); }; // --- INITIALIZATION CALLS --- changeTab('dashboard'); // Set initial tab renderConfiguration(); renderDashboard(); // Re-render graph on window resize window.addEventListener('resize', renderDashboard); });
Scroll to Top