Subscription Service Dependency Analyzer

Step 1: List Your Current Subscription Services

Total Monthly Cost: $0.00

Step 2: Assess Dependency for Each Subscription

Step 3: Dependency Analysis & Action Plan

Review your subscriptions. Based on their dependency, consider actions like keeping, downgrading, finding alternatives, or cancelling.

Assess subscriptions in Tab 2 to see the analysis here.

Step 4: Overall Summary & Download Report

Complete previous tabs to view your summary.

Total Monthly Cost: $${dependencyAnalyzerData.totalMonthlyCost.toFixed(2)}

`; if (subsWithAssessment.length > 0) { summaryHTML += `

Summary of Assessed Subscriptions:

`; subsWithAssessment.forEach(sub => { summaryHTML += ` `; }); summaryHTML += `
SubscriptionCost ($/mo)DependencyYour Action Note
${sub.name} ${sub.cost.toFixed(2)} ${sub.assessment.dependencyLevel || 'N/A'} ${sub.assessment.actionNotes || 'No action noted'}
`; document.getElementById('downloadDependencyPdfButton').disabled = false; } else { summaryHTML += "

No subscriptions have been fully assessed yet. Complete assessments on Tab 2.

"; document.getElementById('downloadDependencyPdfButton').disabled = true; } container.innerHTML = summaryHTML; } // --- PDF Generation --- function downloadDependencyPdf() { if (dependencyAnalyzerData.subscriptions.length === 0) { alert("Please add and assess subscriptions first."); return; } if (typeof window.jspdf === 'undefined' || typeof window.jspdf.jsPDF === 'undefined') { alert('PDF generation library (jsPDF) is not loaded.'); return; } const jsPDFConstructor = window.jspdf.jsPDF; const doc = new jsPDFConstructor(); if (typeof doc.autoTable !== 'function') { alert('jsPDF AutoTable plugin not loaded.'); return; } displayOverallSDASummary(); // Ensure data is up-to-date for PDF const { subscriptions, totalMonthlyCost } = dependencyAnalyzerData; const primaryColor = '#007bff', textColor = '#212529', tableHeaderColor = '#e9ecef'; let yPos = 22; const pageHeight = doc.internal.pageSize.height; const margin = 20; function checkYPdf(increment = 10) { if (yPos + increment > pageHeight - margin) { doc.addPage(); yPos = margin; } } doc.setFontSize(18); doc.setTextColor(primaryColor); doc.text("Subscription Service Dependency Analysis", 14, yPos); yPos += 8; doc.setFontSize(10); doc.setTextColor(textColor); doc.text(`Report Date: ${new Date().toLocaleDateString()}`, 14, yPos); yPos += 7; doc.setFont(undefined, 'bold'); doc.text(`Total Monthly Subscription Cost: $${totalMonthlyCost.toFixed(2)}`, 14, yPos); yPos += 10; doc.setFont(undefined, 'normal'); subscriptions.forEach((sub, index) => { checkYPdf(40); // Estimate space for each sub entry doc.setFontSize(12); doc.setTextColor(primaryColor); doc.text(`Subscription: ${sub.name}`, 14, yPos); yPos += 6; doc.setFontSize(9); doc.setTextColor(textColor); let subInfoBody = [ ['Monthly Cost:', `$${sub.cost.toFixed(2)}`], ['Purpose/Use Case:', sub.purpose || 'N/A'], ['Usage Frequency:', sub.usageFrequency] ]; doc.autoTable({startY: yPos, body: subInfoBody, theme:'plain', styles:{fontSize:8, cellPadding:1}, columnStyles:{0:{fontStyle:'bold'}}}); yPos = doc.lastAutoTable.finalY + 3; if (sub.assessment && sub.assessment.criticality !== undefined) { checkYPdf(30); doc.setFont(undefined, 'bold'); doc.text("Dependency Assessment:", 16, yPos); yPos += 5; doc.setFont(undefined, 'normal'); let assessmentBody = [ ['Criticality (1-10):', `${sub.assessment.criticality}`], ['Key Tasks:', {content: sub.assessment.criticalTasks || 'N/A', styles: {cellWidth: 'wrap'}}], ['Free Alternatives:', `${sub.assessment.freeAlternativeExists} ${sub.assessment.freeAlternativesListed ? '('+sub.assessment.freeAlternativesListed+')' : ''}`], ['Ease of Switching (1-5):', `${sub.assessment.easeOfSwitching}`], ['Impact of Cancellation:', {content: sub.assessment.cancellationImpact || 'N/A', styles: {cellWidth: 'wrap'}}], ['Unused Paid Features:', {content: sub.assessment.unusedFeatures || 'None noted', styles: {cellWidth: 'wrap'}}], ['Overlaps With:', `${sub.assessment.overlapExists === 'Yes' ? (sub.assessment.overlapServices || 'Other(s)') : 'No'}`], [{content:'Calculated Dependency:', styles:{fontStyle:'bold'}}, {content: sub.assessment.dependencyLevel || 'N/A', styles:{fontStyle:'bold'}}], [{content:'Your Action Notes:', styles:{fontStyle:'bold'}}, {content: sub.assessment.actionNotes || 'None', styles: {cellWidth: 'wrap'}}] ]; doc.autoTable({startY: yPos, body: assessmentBody, theme:'plain', styles:{fontSize:8, cellPadding:1}, columnStyles:{0:{fontStyle:'bold'}}}); yPos = doc.lastAutoTable.finalY + 7; } else { doc.text(" No detailed assessment saved for this subscription.", 16, yPos); yPos +=7; } if (index < subscriptions.length -1) { // Add separator if not last checkYPdf(5); doc.setDrawColor(200,200,200); doc.line(14, yPos, 196, yPos); yPos +=5; // horizontal line } }); // Overall Summary Table (if multiple assessed subscriptions) const assessedSubsForPdf = subscriptions.filter(s => s.assessment && s.assessment.dependencyLevel); if (assessedSubsForPdf.length > 0) { checkYPdf(20 + assessedSubsForPdf.length * 7); doc.setFontSize(12); doc.setTextColor(primaryColor); doc.text("Consolidated Summary Table", 14, yPos); yPos += 6; const summaryHead = [['Subscription', 'Cost ($/mo)', 'Usage', 'Criticality', 'Dependency', 'Action Note']]; const summaryBodyPdf = assessedSubsForPdf.map(sub => [ sub.name, sub.cost.toFixed(2), sub.usageFrequency, sub.assessment.criticality, sub.assessment.dependencyLevel, sub.assessment.actionNotes || '' ]); doc.autoTable({ startY: yPos, head: summaryHead, body: summaryBodyPdf, theme: 'grid', headStyles: {fillColor: tableHeaderColor, textColor:textColor, fontStyle:'bold', fontSize:8.5}, styles:{fontSize:8, cellPadding:1.5} }); } doc.save("Subscription_Dependency_Analysis.pdf"); } updateSDANavButtons(); // Initial call
Scroll to Top