mrmo3088's picture
Now create a second animated visualization for the following data with a focus on the 'Stage' & 'Posted Locations' Column:
8ef859b verified
Raw History Blame Contribute Delete
13.8 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Recruitment Stages Visualization</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
<style>
.chart-container {
position: relative;
height: 70vh;
width: 100%;
}
.stage-card {
transition: all 0.3s ease;
}
.stage-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
</style>
</head>
<body class="bg-gray-50">
<div id="vanta-bg" class="fixed inset-0 -z-10"></div>
<div class="container mx-auto px-4 py-12 relative">
<header class="text-center mb-16" data-aos="fade-down">
<h1 class="text-4xl font-bold text-gray-800 mb-4">Recruitment Pipeline Analysis</h1>
<p class="text-xl text-gray-600 max-w-2xl mx-auto">Visualizing candidate progression through different stages</p>
<div class="mt-6">
<a href="locations.html" class="inline-flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors">
<i data-feather="map" class="mr-2"></i>
View Location Analysis
</a>
</div>
</header>
<section class="mb-20">
<div class="bg-white rounded-xl shadow-lg p-6" data-aos="fade-up">
<h2 class="text-2xl font-semibold text-gray-800 mb-6">Stage Distribution Overview</h2>
<div class="chart-container">
<canvas id="stageChart"></canvas>
</div>
</div>
</section>
<section class="mb-20">
<h2 class="text-2xl font-semibold text-gray-800 mb-6 text-center" data-aos="fade-up">Detailed Stage Breakdown</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Stage Card 1 -->
<div class="stage-card bg-white rounded-lg shadow-md p-6" data-aos="flip-left">
<div class="flex items-center mb-4">
<div class="w-3 h-3 bg-red-500 rounded-full mr-2"></div>
<h3 class="text-lg font-semibold text-gray-800">Not Qualified</h3>
</div>
<p class="text-gray-600 mb-4">12 candidates</p>
<div class="bg-gray-100 rounded-full h-2 w-full">
<div class="bg-red-500 h-2 rounded-full" style="width: 25%"></div>
</div>
</div>
<!-- Stage Card 2 -->
<div class="stage-card bg-white rounded-lg shadow-md p-6" data-aos="flip-left" data-aos-delay="100">
<div class="flex items-center mb-4">
<div class="w-3 h-3 bg-blue-500 rounded-full mr-2"></div>
<h3 class="text-lg font-semibold text-gray-800">Unable to Contact</h3>
</div>
<p class="text-gray-600 mb-4">8 candidates</p>
<div class="bg-gray-100 rounded-full h-2 w-full">
<div class="bg-blue-500 h-2 rounded-full" style="width: 16.7%"></div>
</div>
</div>
<!-- Stage Card 3 -->
<div class="stage-card bg-white rounded-lg shadow-md p-6" data-aos="flip-left" data-aos-delay="200">
<div class="flex items-center mb-4">
<div class="w-3 h-3 bg-green-500 rounded-full mr-2"></div>
<h3 class="text-lg font-semibold text-gray-800">Do Not Consider</h3>
</div>
<p class="text-gray-600 mb-4">5 candidates</p>
<div class="bg-gray-100 rounded-full h-2 w-full">
<div class="bg-green-500 h-2 rounded-full" style="width: 10.4%"></div>
</div>
</div>
<!-- Stage Card 4 -->
<div class="stage-card bg-white rounded-lg shadow-md p-6" data-aos="flip-left" data-aos-delay="300">
<div class="flex items-center mb-4">
<div class="w-3 h-3 bg-yellow-500 rounded-full mr-2"></div>
<h3 class="text-lg font-semibold text-gray-800">Never Answered</h3>
</div>
<p class="text-gray-600 mb-4">5 candidates</p>
<div class="bg-gray-100 rounded-full h-2 w-full">
<div class="bg-yellow-500 h-2 rounded-full" style="width: 10.4%"></div>
</div>
</div>
<!-- Stage Card 5 -->
<div class="stage-card bg-white rounded-lg shadow-md p-6" data-aos="flip-left" data-aos-delay="400">
<div class="flex items-center mb-4">
<div class="w-3 h-3 bg-purple-500 rounded-full mr-2"></div>
<h3 class="text-lg font-semibold text-gray-800">Withdrew Application</h3>
</div>
<p class="text-gray-600 mb-4">3 candidates</p>
<div class="bg-gray-100 rounded-full h-2 w-full">
<div class="bg-purple-500 h-2 rounded-full" style="width: 6.3%"></div>
</div>
</div>
<!-- Stage Card 6 -->
<div class="stage-card bg-white rounded-lg shadow-md p-6" data-aos="flip-left" data-aos-delay="500">
<div class="flex items-center mb-4">
<div class="w-3 h-3 bg-pink-500 rounded-full mr-2"></div>
<h3 class="text-lg font-semibold text-gray-800">Available Case(s) Incompatible</h3>
</div>
<p class="text-gray-600 mb-4">3 candidates</p>
<div class="bg-gray-100 rounded-full h-2 w-full">
<div class="bg-pink-500 h-2 rounded-full" style="width: 6.3%"></div>
</div>
</div>
</div>
</section>
<section class="mb-20">
<div class="bg-white rounded-xl shadow-lg p-6" data-aos="fade-up">
<h2 class="text-2xl font-semibold text-gray-800 mb-6">Stage Timeline</h2>
<div class="chart-container">
<canvas id="timelineChart"></canvas>
</div>
</div>
</section>
<section class="bg-white rounded-xl shadow-lg p-6 mb-20" data-aos="fade-up">
<h2 class="text-2xl font-semibold text-gray-800 mb-6">Stage Conversion Funnel</h2>
<div class="flex justify-center">
<div class="w-full md:w-3/4">
<div class="flex flex-col items-center">
<!-- Funnel stages -->
<div class="funnel-stage w-full md:w-3/4 bg-blue-50 py-4 px-6 mb-2 rounded-t-lg text-center">
<p class="font-medium">All Candidates</p>
<p class="text-gray-600">48</p>
</div>
<div class="funnel-stage w-5/6 md:w-2/3 bg-blue-100 py-4 px-6 mb-2 text-center">
<p class="font-medium">Initial Contact</p>
<p class="text-gray-600">36</p>
</div>
<div class="funnel-stage w-2/3 md:w-1/2 bg-blue-200 py-4 px-6 mb-2 text-center">
<p class="font-medium">Qualified</p>
<p class="text-gray-600">24</p>
</div>
<div class="funnel-stage w-1/2 md:w-1/3 bg-blue-300 py-4 px-6 mb-2 rounded-b-lg text-center">
<p class="font-medium">Hired</p>
<p class="text-gray-600">12</p>
</div>
</div>
</div>
</div>
</section>
</div>
<script>
// Vanta.js background
VANTA.GLOBE({
el: "#vanta-bg",
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: 0x3b82f6,
backgroundColor: 0xf8fafc,
size: 0.8
});
// Initialize AOS
AOS.init({
duration: 800,
easing: 'ease-in-out',
once: true
});
// Initialize feather icons
feather.replace();
// Chart data
const stageData = {
labels: ['Not Qualified', 'Unable to Contact', 'Do Not Consider', 'Never Answered', 'Withdrew Application', 'Available Case(s) Incompatible', 'Other'],
datasets: [{
data: [12, 8, 5, 5, 3, 3, 12],
backgroundColor: [
'rgba(239, 68, 68, 0.7)',
'rgba(59, 130, 246, 0.7)',
'rgba(16, 185, 129, 0.7)',
'rgba(234, 179, 8, 0.7)',
'rgba(168, 85, 247, 0.7)',
'rgba(236, 72, 153, 0.7)',
'rgba(156, 163, 175, 0.7)'
],
borderColor: [
'rgba(239, 68, 68, 1)',
'rgba(59, 130, 246, 1)',
'rgba(16, 185, 129, 1)',
'rgba(234, 179, 8, 1)',
'rgba(168, 85, 247, 1)',
'rgba(236, 72, 153, 1)',
'rgba(156, 163, 175, 1)'
],
borderWidth: 1
}]
};
const timelineData = {
labels: ['Sep 3', 'Sep 5', 'Sep 7', 'Sep 9', 'Sep 11', 'Sep 13', 'Sep 15'],
datasets: [
{
label: 'Not Qualified',
data: [1, 3, 2, 3, 2, 0, 1],
backgroundColor: 'rgba(239, 68, 68, 0.5)',
borderColor: 'rgba(239, 68, 68, 1)',
borderWidth: 1
},
{
label: 'Unable to Contact',
data: [0, 1, 1, 2, 2, 1, 1],
backgroundColor: 'rgba(59, 130, 246, 0.5)',
borderColor: 'rgba(59, 130, 246, 1)',
borderWidth: 1
},
{
label: 'Do Not Consider',
data: [0, 1, 0, 1, 1, 1, 1],
backgroundColor: 'rgba(16, 185, 129, 0.5)',
borderColor: 'rgba(16, 185, 129, 1)',
borderWidth: 1
}
]
};
// Initialize charts
document.addEventListener('DOMContentLoaded', function() {
// Stage distribution chart
const stageCtx = document.getElementById('stageChart').getContext('2d');
new Chart(stageCtx, {
type: 'doughnut',
data: stageData,
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right',
},
tooltip: {
callbacks: {
label: function(context) {
const label = context.label || '';
const value = context.raw || 0;
const percentage = Math.round((value / 48) * 100);
return `${label}: ${value} (${percentage}%)`;
}
}
}
},
animation: {
animateScale: true,
animateRotate: true
}
}
});
// Timeline chart
const timelineCtx = document.getElementById('timelineChart').getContext('2d');
new Chart(timelineCtx, {
type: 'bar',
data: timelineData,
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
x: {
stacked: true,
},
y: {
stacked: true,
beginAtZero: true
}
},
plugins: {
tooltip: {
mode: 'index',
intersect: false
},
legend: {
position: 'top',
}
},
animation: {
duration: 1000
}
}
});
});
</script>
</body>
</html>