diff --git a/components/observatory/observatory-map.tsx b/components/observatory/observatory-map.tsx index 487ee70f..19ef4339 100644 --- a/components/observatory/observatory-map.tsx +++ b/components/observatory/observatory-map.tsx @@ -47,15 +47,15 @@ export function ObservatoryMap({ ctx.clearRect(0, 0, canvas.width, canvas.height); // Draw world map background (simplified) - ctx.fillStyle = '#e0e0e0'; + ctx.fillStyle = '#f5f5f5'; ctx.fillRect(0, 0, canvas.width, canvas.height); // Draw grid lines for better visualization - ctx.strokeStyle = '#ffffff'; - ctx.lineWidth = 0.5; + ctx.strokeStyle = '#e5e5e5'; + ctx.lineWidth = 1; // Horizontal grid lines - for (let y = 0; y < canvas.height; y += 30) { + for (let y = 0; y < canvas.height; y += 40) { ctx.beginPath(); ctx.moveTo(0, y); ctx.lineTo(canvas.width, y); @@ -63,7 +63,7 @@ export function ObservatoryMap({ } // Vertical grid lines - for (let x = 0; x < canvas.width; x += 30) { + for (let x = 0; x < canvas.width; x += 40) { ctx.beginPath(); ctx.moveTo(x, 0); ctx.lineTo(x, canvas.height); @@ -73,26 +73,30 @@ export function ObservatoryMap({ // Draw country markers (in random positions) countries.forEach((country, index) => { // Generate random positions (in a real app, we would use actual coordinates) - const x = (index * 50 + 100) % (canvas.width - 50); - const y = 50 + Math.floor(index / 5) * 50; + const x = (index * 60 + 100) % (canvas.width - 80); + const y = 60 + Math.floor(index / 4) * 70; // Draw marker ctx.beginPath(); - ctx.arc(x, y, country.count > 5 ? 10 : (country.count > 2 ? 7 : 5), 0, Math.PI * 2); + ctx.arc(x, y, country.count > 5 ? 8 : (country.count > 2 ? 6 : 4), 0, Math.PI * 2); // Highlight selected country if (selectedCountry === country.name) { ctx.fillStyle = '#3b82f6'; + ctx.strokeStyle = '#2563eb'; } else { - ctx.fillStyle = '#ef4444'; + ctx.fillStyle = '#f87171'; + ctx.strokeStyle = '#ef4444'; } ctx.fill(); + ctx.lineWidth = 1; + ctx.stroke(); // Draw country name - ctx.fillStyle = '#000000'; - ctx.font = '12px Arial'; - ctx.fillText(country.name, x + 12, y + 4); + ctx.fillStyle = '#374151'; + ctx.font = '12px Inter, system-ui, sans-serif'; + ctx.fillText(country.name, x + 14, y + 4); // Store coordinates for click detection country.x = x; @@ -130,14 +134,14 @@ export function ObservatoryMap({ }, [countries, selectedCountry, onCountrySelect]); return ( -
+
{countries.length === 0 && (
-

No countries detected in the news

+

No countries detected in the news

)}
diff --git a/components/observatory/observatory-view.tsx b/components/observatory/observatory-view.tsx index ebe3d8be..3c668890 100644 --- a/components/observatory/observatory-view.tsx +++ b/components/observatory/observatory-view.tsx @@ -56,7 +56,8 @@ export function ObservatoryView() { // In a real app, we would use NLP or a more sophisticated technique const countries = [ 'France', 'USA', 'Canada', 'UK', 'Germany', 'Japan', 'China', - 'India', 'Brazil', 'Australia', 'Russia', 'Italy', 'Spain' + 'India', 'Brazil', 'Australia', 'Russia', 'Italy', 'Spain', + 'Sudan', 'New York', 'United Nations' ]; const result: Record = {}; @@ -115,118 +116,112 @@ export function ObservatoryView() { const countries = Object.keys(countriesMap); return ( -
-
- - -
- - - News Observatory - - -
-
-
+
+ {/* Header */} +
+

+ + News Observatory +

+ +
-
- {/* News Feed Section */} -
- - - - {selectedCountry ? `News about ${selectedCountry}` : 'Latest News'} - - ({filteredNews.length} articles) - - - - -
- {filteredNews.length === 0 ? ( -

No news available

- ) : ( - filteredNews.map(item => ( + {/* Main Content */} +
+ {/* News Feed Section - Narrower */} +
+ + + + {selectedCountry ? `News about ${selectedCountry}` : 'Latest News'} + + ({filteredNews.length} articles) + + + + +
+ {filteredNews.length === 0 ? ( +

No news available

+ ) : ( +
+ {filteredNews.map(item => (
window.open(item.url, '_blank')} > -
-
- {item.displayDate} - {item.source} -
-

- {item.title} -

-

- {item.description} -

+
+ {item.displayDate} + {item.source}
+

+ {item.title} +

+

+ {item.description} +

- )) - )} -
- - -
+ ))} +
+ )} +
+ + +
- {/* Map Section */} -
- - - - World Map - - - - {/* Map Placeholder */} -
- ({ - name, - count: items.length - }))} - onCountrySelect={handleCountrySelect} - selectedCountry={selectedCountry} - /> -
+ {/* Map Section - Wider */} +
+ + + + World Map + + + + {/* Map Container */} +
+ ({ + name, + count: items.length + }))} + onCountrySelect={handleCountrySelect} + selectedCountry={selectedCountry} + /> +
- {/* Countries List */} -
-

Mentioned Countries:

- {countries.length === 0 ? ( -

No countries detected

- ) : ( -
- {countries.map(country => ( - - ))} -
- )} -
-
-
-
+ {/* Countries List */} +
+

Mentioned Countries:

+ {countries.length === 0 ? ( +

No countries detected

+ ) : ( +
+ {countries.map(country => ( + + ))} +
+ )} +
+
+