Show code
maturity = (automation * 0.40) + (connectivity * 0.30) + (analytics * 0.20) + (intelligence * 0.10)
// Classification based on maturity score
classification = maturity < 25 ? "Industry 1.0/2.0 (Mechanization/Electrification)" :
maturity < 50 ? "Industry 3.0 (Computerization)" :
maturity < 75 ? "Transitioning to Industry 4.0" :
"Industry 4.0 (Full Digitalization)"
// IEEE color palette based on maturity
barColor = maturity < 25 ? "#E74C3C" : // Red - Early stages
maturity < 50 ? "#E67E22" : // Orange - Industry 3.0
maturity < 75 ? "#3498DB" : // Blue - Transitioning
"#16A085" // Teal - Industry 4.0
// Intelligent recommendations based on gap analysis
recommendations = analytics < 40 && intelligence < 40
? "Focus on Analytics foundation first (data infrastructure, dashboards, KPIs) before investing in AI/ML. Without good data collection and analysis, AI projects will fail."
: connectivity < 60
? "Improve Connectivity (OT/IT convergence, unified SCADA) to enable data collection for analytics. Strong connectivity is the prerequisite for higher-level capabilities."
: automation < 60
? "Strengthen Automation baseline before adding intelligence layers. Basic automation provides the stable foundation needed for smart manufacturing."
: maturity >= 75
? "Maintain and optimize existing capabilities. Focus on scaling AI/ML use cases across more production lines and processes."
: "Balanced investment across all dimensions - continue current transformation path. Your scores show steady progress without major gaps."
// Interactive visualization
html`<div style="padding: 20px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid ${barColor};">
<h4 style="color: #2C3E50; margin-top: 0;">Industry 4.0 Maturity Results</h4>
<div style="margin: 20px 0;">
<div style="display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px;">
<span style="font-weight: bold; color: #2C3E50;">Overall Maturity Score:</span>
<span style="font-size: 24px; font-weight: bold; color: ${barColor};">${maturity.toFixed(1)}%</span>
</div>
<div style="background: #e9ecef; height: 30px; border-radius: 4px; overflow: hidden;">
<div style="background: ${barColor}; height: 100%; width: ${maturity}%; transition: width 0.3s;"></div>
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 4px; margin: 15px 0;">
<strong style="color: #2C3E50;">Classification:</strong>
<div style="color: ${barColor}; font-weight: bold; font-size: 18px; margin-top: 5px;">
${classification}
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 4px; margin: 15px 0;">
<strong style="color: #2C3E50;">Dimension Breakdown:</strong>
<table style="width: 100%; margin-top: 10px; border-collapse: collapse;">
<tr style="border-bottom: 1px solid #e9ecef;">
<td style="padding: 8px; color: #2C3E50;">Automation</td>
<td style="padding: 8px; text-align: right; font-weight: bold;">${automation}%</td>
<td style="padding: 8px; color: #7F8C8D; font-size: 0.9em;">Weight: 40%</td>
<td style="padding: 8px; text-align: right; color: ${automation >= 60 ? '#16A085' : '#E67E22'};">
${(automation * 0.40).toFixed(1)} pts
</td>
</tr>
<tr style="border-bottom: 1px solid #e9ecef;">
<td style="padding: 8px; color: #2C3E50;">Connectivity</td>
<td style="padding: 8px; text-align: right; font-weight: bold;">${connectivity}%</td>
<td style="padding: 8px; color: #7F8C8D; font-size: 0.9em;">Weight: 30%</td>
<td style="padding: 8px; text-align: right; color: ${connectivity >= 60 ? '#16A085' : '#E67E22'};">
${(connectivity * 0.30).toFixed(1)} pts
</td>
</tr>
<tr style="border-bottom: 1px solid #e9ecef;">
<td style="padding: 8px; color: #2C3E50;">Analytics</td>
<td style="padding: 8px; text-align: right; font-weight: bold;">${analytics}%</td>
<td style="padding: 8px; color: #7F8C8D; font-size: 0.9em;">Weight: 20%</td>
<td style="padding: 8px; text-align: right; color: ${analytics >= 60 ? '#16A085' : '#E67E22'};">
${(analytics * 0.20).toFixed(1)} pts
</td>
</tr>
<tr>
<td style="padding: 8px; color: #2C3E50;">Intelligence</td>
<td style="padding: 8px; text-align: right; font-weight: bold;">${intelligence}%</td>
<td style="padding: 8px; color: #7F8C8D; font-size: 0.9em;">Weight: 10%</td>
<td style="padding: 8px; text-align: right; color: ${intelligence >= 60 ? '#16A085' : '#E67E22'};">
${(intelligence * 0.10).toFixed(1)} pts
</td>
</tr>
</table>
</div>
<div style="background: #fff3cd; padding: 15px; border-radius: 4px; border-left: 3px solid #E67E22;">
<strong style="color: #2C3E50;">💡 Strategic Recommendation:</strong>
<div style="margin-top: 8px; color: #2C3E50; line-height: 1.6;">
${recommendations}
</div>
</div>
</div>`