@extends('layouts.admin') @section('title', 'Heatmap') @section('header', 'Department × Category Heatmap') @section('subheader', 'Compare engagement scores across departments and dimensions') @section('content') @include('company.partials.survey-selector') @include('company.partials.low-volume-warning')
| Department | @foreach($heatmapData['categories'] as $cat){{ $cat['icon'] }} {{ Str::limit($cat['name'], 10) }} | @endforeach
|---|---|
| {{ $row['department'] }} | @foreach($heatmapData['categories'] as $cat) @php $score = $row[$cat['slug']] ?? null; if ($score !== null) { if ($score >= 75) { $bgColor = 'bg-green-500'; $textColor = 'text-white'; } elseif ($score >= 65) { $bgColor = 'bg-lime-400'; $textColor = 'text-gray-800'; } elseif ($score >= 55) { $bgColor = 'bg-yellow-400'; $textColor = 'text-gray-800'; } elseif ($score >= 45) { $bgColor = 'bg-orange-400'; $textColor = 'text-white'; } else { $bgColor = 'bg-red-500'; $textColor = 'text-white'; } } else { $bgColor = 'bg-gray-100'; $textColor = 'text-gray-400'; } @endphp
{{ $score !== null ? round($score).'%' : '-' }}
|
@endforeach
No areas scoring 70% or above
@endifNo areas scoring below 60%
@endif
Department breakdown requires at least 5 responses per department to protect anonymity.
@if(isset($analytics))
Total responses: {{ $analytics->total_responses }}
@endif
Either no department data was collected, or all departments have fewer than 5 responses.