Skip to content

Real-time dashboard for monitoring global news, markets, and geopolitical events

TypeScript

Add hotspots to map

Reggiee3f9abaae4ca
diff --git a/index.html b/index.html
index 71d748d..14e1dc3 100644
--- a/index.html
+++ b/index.html
@@ -92,7 +92,7 @@
<svg id="mapSvg" style="width:100%;height:100%;"></svg>
</div>
<script>
- // Inline map render - no modules
+ // Inline map render with hotspots
(async function() {
const svg = d3.select('#mapSvg');
const width = 800, height = 500;
@@ -105,11 +105,30 @@
const path = d3.geoPath().projection(projection);
+ // Hotspots data
+ const hotspots = [
+ { name: 'DC', lat: 38.9, lon: -77.0 },
+ { name: 'Moscow', lat: 55.75, lon: 37.6 },
+ { name: 'Beijing', lat: 39.9, lon: 116.4 },
+ { name: 'Kyiv', lat: 50.45, lon: 30.5 },
+ { name: 'Taipei', lat: 25.03, lon: 121.5 },
+ { name: 'Tehran', lat: 35.7, lon: 51.4 },
+ { name: 'Tel Aviv', lat: 32.07, lon: 34.78 },
+ { name: 'London', lat: 51.5, lon: -0.12 },
+ { name: 'Brussels', lat: 50.85, lon: 4.35 },
+ { name: 'Pyongyang', lat: 39.03, lon: 125.75 },
+ { name: 'Riyadh', lat: 24.7, lon: 46.7 },
+ { name: 'Delhi', lat: 28.6, lon: 77.2 },
+ { name: 'Singapore', lat: 1.35, lon: 103.82 },
+ { name: 'Tokyo', lat: 35.68, lon: 139.76 }
+ ];
+
try {
const response = await fetch('https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json');
const world = await response.json();
const countries = topojson.feature(world, world.objects.countries);
+ // Draw countries
svg.selectAll('path')
.data(countries.features)
.enter()
@@ -118,6 +137,22 @@
.attr('fill', '#0f3028')
.attr('stroke', '#1a5040')
.attr('stroke-width', 0.5);
+
+ // Draw hotspots
+ hotspots.forEach(h => {
+ const [x, y] = projection([h.lon, h.lat]);
+ if (x && y) {
+ // Pulsing circle
+ svg.append('circle')
+ .attr('cx', x).attr('cy', y).attr('r', 4)
+ .attr('fill', '#00ff88').attr('opacity', 0.8);
+ // Label
+ svg.append('text')
+ .attr('x', x + 6).attr('y', y + 3)
+ .attr('fill', '#00ff88').attr('font-size', '8px')
+ .text(h.name);
+ }
+ });
} catch(e) {
console.error('Map error:', e);
}