271 lines
7.7 KiB
HTML
271 lines
7.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Globe Viz 8: Global School Infrastructure Clustering</title>
|
|
<link href="https://api.mapbox.com/mapbox-gl-js/v3.0.1/mapbox-gl.css" rel="stylesheet">
|
|
<script src="https://api.mapbox.com/mapbox-gl-js/v3.0.1/mapbox-gl.js"></script>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background: #000;
|
|
}
|
|
|
|
#map {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 100%;
|
|
}
|
|
|
|
.overlay {
|
|
position: absolute;
|
|
background: rgba(0, 0, 0, 0.85);
|
|
color: #fff;
|
|
padding: 20px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
|
|
backdrop-filter: blur(10px);
|
|
}
|
|
|
|
#title {
|
|
top: 20px;
|
|
left: 20px;
|
|
max-width: 380px;
|
|
}
|
|
|
|
#title h1 {
|
|
margin: 0 0 10px 0;
|
|
font-size: 24px;
|
|
font-weight: 600;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
}
|
|
|
|
#title p {
|
|
margin: 5px 0;
|
|
font-size: 13px;
|
|
line-height: 1.5;
|
|
color: #ccc;
|
|
}
|
|
|
|
#legend {
|
|
bottom: 40px;
|
|
left: 20px;
|
|
min-width: 280px;
|
|
}
|
|
|
|
#legend h3 {
|
|
margin: 0 0 15px 0;
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
color: #fff;
|
|
border-bottom: 2px solid #667eea;
|
|
padding-bottom: 8px;
|
|
}
|
|
|
|
.legend-section {
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.legend-section h4 {
|
|
margin: 0 0 8px 0;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
color: #aaa;
|
|
}
|
|
|
|
.legend-item {
|
|
display: flex;
|
|
align-items: center;
|
|
margin: 6px 0;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.legend-circle {
|
|
width: 16px;
|
|
height: 16px;
|
|
border-radius: 50%;
|
|
margin-right: 10px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.legend-cluster-circle {
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 50%;
|
|
margin-right: 10px;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.mapboxgl-popup-content {
|
|
background: rgba(0, 0, 0, 0.9);
|
|
color: #fff;
|
|
border-radius: 8px;
|
|
padding: 15px;
|
|
max-width: 280px;
|
|
}
|
|
|
|
.mapboxgl-popup-content h3 {
|
|
margin: 0 0 10px 0;
|
|
font-size: 15px;
|
|
color: #667eea;
|
|
}
|
|
|
|
.mapboxgl-popup-content p {
|
|
margin: 4px 0;
|
|
font-size: 12px;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.mapboxgl-popup-content strong {
|
|
color: #aaa;
|
|
}
|
|
|
|
.mapboxgl-popup-close-button {
|
|
color: #fff;
|
|
font-size: 20px;
|
|
}
|
|
|
|
#stats {
|
|
top: 20px;
|
|
right: 20px;
|
|
min-width: 200px;
|
|
}
|
|
|
|
#stats h3 {
|
|
margin: 0 0 12px 0;
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
color: #fff;
|
|
}
|
|
|
|
.stat-item {
|
|
margin: 8px 0;
|
|
padding: 8px;
|
|
background: rgba(102, 126, 234, 0.15);
|
|
border-left: 3px solid #667eea;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.stat-label {
|
|
font-size: 11px;
|
|
color: #aaa;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.stat-value {
|
|
font-size: 20px;
|
|
font-weight: 600;
|
|
color: #fff;
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.interaction-hint {
|
|
margin-top: 15px;
|
|
padding: 10px;
|
|
background: rgba(102, 126, 234, 0.2);
|
|
border-radius: 4px;
|
|
font-size: 11px;
|
|
color: #ccc;
|
|
text-align: center;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="map"></div>
|
|
|
|
<div id="title" class="overlay">
|
|
<h1>Global School Infrastructure</h1>
|
|
<p><strong>Iteration 8:</strong> Advanced Clustering Visualization</p>
|
|
<p>Mapping 311 educational facilities worldwide with intelligent point clustering for performance optimization.</p>
|
|
<p><em>Web Research:</em> Mapbox Cluster API - learned step-based styling, cluster expansion zoom, and large dataset handling.</p>
|
|
</div>
|
|
|
|
<div id="stats" class="overlay">
|
|
<h3>Dataset Overview</h3>
|
|
<div class="stat-item">
|
|
<div class="stat-label">Total Schools</div>
|
|
<div class="stat-value">311</div>
|
|
</div>
|
|
<div class="stat-item">
|
|
<div class="stat-label">Countries</div>
|
|
<div class="stat-value">142</div>
|
|
</div>
|
|
<div class="stat-item">
|
|
<div class="stat-label">Avg Students</div>
|
|
<div class="stat-value">487</div>
|
|
</div>
|
|
<div class="interaction-hint">
|
|
Click clusters to zoom in and expand
|
|
</div>
|
|
</div>
|
|
|
|
<div id="legend" class="overlay">
|
|
<h3>Educational Infrastructure</h3>
|
|
|
|
<div class="legend-section">
|
|
<h4>Cluster Density</h4>
|
|
<div class="legend-item">
|
|
<div class="legend-cluster-circle" style="background: #51bbd6; color: #000;">12</div>
|
|
<span>Low Density (<50 schools)</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<div class="legend-cluster-circle" style="background: #f1f075; color: #000;">85</div>
|
|
<span>Medium Density (50-150 schools)</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<div class="legend-cluster-circle" style="background: #f28cb1; color: #000;">200</div>
|
|
<span>High Density (150+ schools)</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="legend-section">
|
|
<h4>Individual Schools</h4>
|
|
<div class="legend-item">
|
|
<div class="legend-circle" style="background: #667eea; border: 2px solid #fff;"></div>
|
|
<span>Primary Schools</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<div class="legend-circle" style="background: #764ba2; border: 2px solid #fff;"></div>
|
|
<span>Secondary Schools</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<div class="legend-circle" style="background: #f093fb; border: 2px solid #fff;"></div>
|
|
<span>Universities</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="legend-section">
|
|
<h4>Resource Level</h4>
|
|
<div class="legend-item">
|
|
<div class="legend-circle" style="background: #48bb78;"></div>
|
|
<span>Well Resourced (80%+)</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<div class="legend-circle" style="background: #ecc94b;"></div>
|
|
<span>Moderate (50-80%)</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<div class="legend-circle" style="background: #f56565;"></div>
|
|
<span>Under-resourced (<50%)</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="src/data/data.js"></script>
|
|
<script type="module" src="src/index.js"></script>
|
|
</body>
|
|
</html>
|