# GeoMap Component Documentation ## Overview The GeoMap component is a Vue.js interactive world map visualization built with D3.js. It displays geographical data as dots on a world map, supporting both coordinate-based and country-based positioning with tooltips and interactive features. ## Features - Interactive world map with zoom and pan capabilities - Two data visualization modes: coordinate-based (lat/lng) and country-centroid based - Clickable dots with customizable tooltips - Country highlighting on hover and click - Pulse animations for high-severity alerts - Optional glow effects for critical alerts - Responsive design with automatic resize handling - Loading states and error handling ## Props ### Required Props - **`geomapDataArray`** (Array): Array of data objects to display on the map - **`getGeomapData`** (Function): Async function to fetch/load map data - **`tooltipFormatter`** (Function): Function to format tooltip content ### Optional Props - **`glowDots`** (Boolean): Enable glow effects for high-severity alerts (Critical, Emergency, Warning) ## Data Format ### Coordinate-based Data Format When your data contains `lat` and `lng` properties, the component will render dots at specific coordinates: ```javascript const coordinateBasedData = [ { lat: 40.7128, // Latitude (required) lng: -74.0060, // Longitude (required) severity: "Critical", // Severity level (optional) color: "#ff0000", // Dot color (optional, defaults to "#FF8F00") // ... any other custom properties for tooltip } ] ``` ### Country-centroid Data Format When your data contains `country_id` but no coordinates, dots will be placed at country centroids: ```javascript const countryBasedData = [ { country_id: 840, // Numeric country ID (required) severity: "Warning", // Severity level (optional) color: "#ffaa00", // Dot color (optional, defaults to "#ff0000") alerts_count: 15, // Number of alerts (optional) country_code: "us", // Country code for flags (optional) // ... any other custom properties for tooltip } ] ``` ## Severity Levels The component recognizes the following severity levels for special effects: - **Critical**: Gets glow effect (if enabled) and pulse animation - **Emergency**: Gets glow effect (if enabled) and pulse animation - **Warning**: Gets glow effect (if enabled) and pulse animation - **Error**: Gets pulse animation only - **Info**: Standard dot display ## Functions ### tooltipFormatter(dataItem, countryName?) Function to format tooltip content. Receives the data item and optionally the country name. **Parameters:** - `dataItem` (Object): The data object for the clicked dot - `countryName` (String, optional): Country name (only provided for country-centroid mode) **Returns:** String (HTML content for tooltip) **Example:** ```javascript const formatTooltip = (item, countryName) => { return `
Alerts: ${item.alerts_count || 1}
Severity: ${item.severity || 'Info'}