Back to Worldmonitor

Component Documentation — World Monitor

docs/Docs_To_Review/COMPONENTS.md

2.5.2342.6 KB
Original Source

Component Documentation — World Monitor

Auto-generated reference for all UI components in src/components/. Last updated: 2026-02-19


Table of Contents

  1. Overview
  2. Panel Base Class
  3. Map System
  4. Virtual Scrolling
  5. Search
  6. Domain Panels
  7. Modals & Widgets
  8. Variant Visibility Matrix
  9. Component Interaction Diagram

Overview

World Monitor's UI is built entirely with vanilla TypeScript — no React, Vue, or Angular. Every component is a plain ES class that owns its own DOM subtree and communicates through method calls, callbacks, and a handful of document/window-level custom events.

Design principles

PrincipleDetail
No frameworkComponents create and manage DOM imperatively.
Class-basedEach component is a standalone class (or, rarely, a set of exported functions).
Panel inheritanceMost dashboard tiles extend the shared Panel base class.
Variant-awareComponents check SITE_VARIANT (world / tech / finance) to show/hide themselves or swap data sources.
Theme-awareComponents listen for theme-changed events and adapt colours accordingly.
Desktop-awareTauri bridge detection via isDesktopRuntime() unlocks native features.

Component count

CategoryCount
Panel subclasses~35
Map components4 (DeckGLMap, MapComponent, MapContainer, MapPopup)
Virtual scrolling2 (VirtualList, WindowedList)
Search1 (SearchModal)
Modals & widgets~9
Total~51

All public exports are re-exported from src/components/index.ts (barrel file, 40+ symbols).


Panel Base Class

File: src/components/Panel.ts (420 lines)

Panel is the shared superclass for every dashboard tile. It owns the chrome — header, collapse/expand, resize handle, loading/error states, count badge, "NEW" badge, data-quality badge, and tooltip — so that subclasses only need to fill in panel-content.

Constructor

ts
interface PanelOptions {
  id: string;           // unique DOM id, also used as localStorage key
  title: string;        // human-readable header text
  showCount?: boolean;  // if true, renders a count badge in the header
  className?: string;   // extra CSS class on the root element
  trackActivity?: boolean; // enable activity tracking
  infoTooltip?: string; // markdown/HTML shown on hover of the ℹ icon
}

const panel = new Panel(options);

Lifecycle & Methods

Public

MethodSignatureDescription
getElement()(): HTMLElementReturns the root div.panel.
showLoading()(): voidReplaces content with a spinner.
showError()(msg: string): voidShows a red error banner inside content.
showConfigError()(): voidShows a config-missing message (desktop).
setCount()(n: number): voidUpdates the header count badge.
setErrorState()(isError: boolean): voidToggles .panel-error class.
setContent()(html: string | HTMLElement): voidReplaces panel-content innerHTML or child.
show()(): voidRemoves display:none.
hide()(): voidSets display:none.
toggle()(): voidToggles between show/hide.
setNewBadge()(): voidAdds the "NEW" pill next to the title.
clearNewBadge()(): voidRemoves the "NEW" pill.
getId()(): stringReturns the panel id.
resetHeight()(): voidClears any user-set height override.
destroy()(): voidRemoves element, cleans up listeners.

Protected

MethodSignatureDescription
setDataBadge(state, detail?)(state: 'live'|'cached'|'unavailable', detail?: string): voidShows a coloured dot in the header indicating data freshness.
clearDataBadge()(): voidHides the data badge.

DOM Structure

div.panel#${id}                       ← root
 ├─ div.panel-header
 │   ├─ div.panel-header-left
 │   │   ├─ span.panel-title          ← title text
 │   │   ├─ span.panel-info-wrapper   ← ℹ icon + tooltip
 │   │   └─ span.panel-new-badge      ← "NEW" pill (conditional)
 │   ├─ span.panel-data-badge         ← live/cached/unavailable dot
 │   └─ span.panel-count              ← count number (conditional)
 ├─ div.panel-content                 ← subclass fills this
 └─ div.panel-resize-handle           ← drag handle for vertical resize

CSS Classes

ClassApplied toMeaning
.panelrootBase panel styling.
.panel-collapsedrootContent hidden, header only.
.panel-errorrootRed border / error state.
.panel-resizingrootWhile user drags resize handle.
.panel-headerheader wrapperFlex row.
.panel-contentcontent areaOverflow auto, flex-grow 1.
.panel-resize-handleresize barCursor ns-resize.

Events

Event / ListenerTargetDirection
click (document)tooltip closeConsumed
mousemove / mouseupresize dragConsumed
touchstart / touchmove / touchendmobile resizeConsumed
dragstartblocked during resizeConsumed

Persistence

Panel span sizes (user-resized heights) are stored in localStorage['worldmonitor-panel-spans'] as a JSON map of { [id]: height }.

Services

  • escapeHtml from sanitize — XSS-safe title rendering.
  • isDesktopRuntime() / invokeTauri() — Tauri bridge for settings sync.
  • t() — i18n translation of UI strings.

Variant Logic

None — Panel is a pure base class and renders identically in all variants.


Map System

World Monitor ships two independent map renderers and an adapter that picks the right one at runtime.

DeckGLMap

File: src/components/DeckGLMap.ts (3 853 lines)

The primary, high-performance map used on desktop and WebGL-capable browsers.

Constructor

ts
interface DeckMapState {
  zoom: number;
  pan: [number, number];
  view: DeckMapView;
  layers: MapLayers;
  timeRange: TimeRange;
}

type DeckMapView =
  | 'global' | 'america' | 'mena' | 'eu'
  | 'asia'   | 'latam'   | 'africa' | 'oceania';

const map = new DeckGLMap(container, initialState);

Exported Types

TypeDescription
TimeRange{ start: number; end: number } epoch-ms window.
DeckMapView8 named camera presets.
CountryClickPayload{ iso: string; name: string; lngLat: [number, number] }
MapInteractionMode'flat' | '3d' — controlled by MAP_INTERACTION_MODE env.

Rendering Stack

Built on MapLibre GL JS (maplibregl.Map) with a deck.gl overlay (MapboxOverlay from @deck.gl/mapbox). The following deck.gl layer types are used:

  • GeoJsonLayer — country polygons, cables, pipelines, waterways
  • ScatterplotLayer — point events (earthquakes, fires, outages, bases)
  • PathLayer — flight tracks, vessel tracks
  • IconLayer — infrastructure icons, cluster markers
  • TextLayer — labels
  • ArcLayer — origin/destination arcs (trade, displacement)
  • HeatmapLayer — density surfaces (protests, fires)
  • Supercluster — client-side clustering of dense point data

Static Infrastructure Data

The map embeds or lazily loads over 20 static datasets:

DatasetConstant / Source
Intelligence hotspotsINTEL_HOTSPOTS
Conflict zonesCONFLICT_ZONES
Military basesMILITARY_BASES
Undersea cablesUNDERSEA_CABLES
Nuclear facilitiesNUCLEAR_FACILITIES
Gamma irradiatorsGAMMA_IRRADIATORS
PipelinesPIPELINES
Strategic waterwaysSTRATEGIC_WATERWAYS
Economic centersECONOMIC_CENTERS
AI data centersAI_DATA_CENTERS
Startup hubsSTARTUP_HUBS
AcceleratorsACCELERATORS
Tech HQsTECH_HQS
Cloud regionsCLOUD_REGIONS
PortsPORTS
SpaceportsSPACEPORTS
APT groupsAPT_GROUPS
Critical mineralsCRITICAL_MINERALS
Stock exchangesSTOCK_EXCHANGES
Financial centersFINANCIAL_CENTERS
Central banksCENTRAL_BANKS
Commodity hubsCOMMODITY_HUBS
Gulf investmentsGULF_INVESTMENTS

Services

ServicePurpose
hotspot-escalationEscalation scoring for hotspot markers.
country-instabilityCII heat overlay.
geo-convergenceConvergence ring rendering.
country-geometryGeoJSON boundaries.
MapPopupGenerates popup HTML for clicked features.

Variant & Theme Logic

  • SITE_VARIANT determines which static infrastructure layers are loaded (e.g. tech loads AI_DATA_CENTERS, STARTUP_HUBS, CLOUD_REGIONS; finance loads STOCK_EXCHANGES, FINANCIAL_CENTERS).
  • MAP_INTERACTION_MODE env var toggles flat (2-D pitch-locked) vs 3-D (free pitch/bearing).
  • Theme: basemap switches between CARTO Dark Matter and CARTO Positron via getOverlayColors() which provides a colour palette per theme.

MapComponent

File: src/components/Map.ts (3 500 lines)

Fallback D3 + SVG map used on mobile and devices without WebGL.

Constructor

ts
interface MapState {
  zoom: number;
  pan: [number, number];
  view: MapView;
  layers: MapLayers;
  timeRange: TimeRange;
}

const map = new MapComponent(container, initialState);

DOM Structure

div.map-wrapper#mapWrapper
 ├─ svg.map-svg#mapSvg            ← D3 projected countries & overlays
 ├─ canvas.map-cluster-canvas#mapClusterCanvas  ← Canvas 2-D for clusters
 └─ div#mapOverlays                ← Popup container

Key Data Overlays

OverlaySource
Hotspotshotspot-escalation
EarthquakesUSGS feed
Weather alertsweather service
OutagesCloudflare / service-status
AIS disruptionsAIS feed
Cable advisoriesUndersea cable advisories
ProtestsACLED
Military flightsOpenSky
Military vesselsAIS snapshot
Natural eventsEONET
FIRMS firesNASA FIRMS
Tech eventsTech events API
Tech activitiesGitHub trending, HackerNews
Geo activitiesGeo-convergence
NewsGeolocated news clusters

Events Consumed

EventSourceEffect
theme-changedwindowRe-renders all layers with new colour palette.

Variant Logic

Imports SITE_VARIANT and adjusts loaded data layers accordingly. Runs a health-check interval every 30 seconds.


MapContainer

File: src/components/MapContainer.ts (553 lines)

Adapter / façade that selects the appropriate map renderer at startup.

Constructor

ts
const mapContainer = new MapContainer(container, initialState);

Selection Logic

if (isMobileDevice() || !hasWebGLSupport())
  → MapComponent (D3/SVG)
else
  → DeckGLMap (WebGL/deck.gl)

The container element receives the CSS class deckgl-mode or svg-mode accordingly.

Delegated API

All calls are forwarded transparently to the underlying renderer:

MethodDescription
render()Full re-render.
setView(view)Switch named camera preset.
setZoom(z)Set zoom level.
setCenter(lng, lat)Pan to coordinates.
setTimeRange(range)Filter displayed events by time.
setLayers(layers)Toggle layer visibility.
getState()Return current map state.
setEarthquakes(data)Push earthquake data.
setWeatherAlerts(data)Push weather alerts.
setOutages(data)Push outage data.
(and many more domain-specific setters)

MapPopup

File: src/components/MapPopup.ts (2 400+ lines)

Not a class — a collection of builder functions that generate popup HTML for every feature type the map can display.

PopupType Union

Over 40 discriminated popup types grouped into categories:

CategoryTypes (examples)
Conflictconflict-event, protest, acled-event, hotspot, conflict-zone
Militarymilitary-base, military-flight, military-vessel, spaceport
Naturalearthquake, weather-alert, natural-event, firms-fire
Infrastructurecable, pipeline, nuclear, port, waterway, gamma-irradiator
Techdatacenter, tech-hq, cloud-region, startup-hub, accelerator, tech-event
Financestock-exchange, financial-center, central-bank, commodity-hub, gulf-investment
Intelligenceapt-group, critical-mineral, news-cluster, convergence

Each popup type has a dedicated data interface and a builder function that returns sanitized HTML.


Virtual Scrolling

File: src/components/VirtualList.ts

Two complementary strategies for rendering large lists without creating thousands of DOM nodes.

VirtualList

Fixed-height, DOM-recycling virtual scroller.

Constructor

ts
interface VirtualListOptions {
  itemHeight: number;          // px height per row
  overscan?: number;           // extra rows above/below viewport (default 3)
  container: HTMLElement;      // parent element
  renderItem: (index: number, el: HTMLElement) => void;
  onRecycle?: (el: HTMLElement) => void;
}

const vl = new VirtualList(options);

Methods

MethodSignatureDescription
setItemCount()(n: number): voidTotal number of items.
refresh()(): voidRe-render visible items from current scroll position.
scrollToIndex()(i: number): voidProgrammatic scroll.
getViewport()(): { start: number; end: number }Currently visible range.
destroy()(): voidCleanup.

DOM Structure

div.virtual-viewport
 └─ div.virtual-content           ← total height = itemHeight × itemCount
     ├─ (spacer top)
     ├─ div.virtual-item          ← pooled, reused via renderItem()
     ├─ div.virtual-item
     ├─ ...
     └─ (spacer bottom)

WindowedList<T>

Variable-height, chunk-based windowed scroller. Used by NewsPanel.

Constructor

ts
interface WindowedListOptions {
  container: HTMLElement;
  chunkSize?: number;       // items per chunk (default 10)
  bufferChunks?: number;    // chunks to keep rendered above/below viewport
}

const wl = new WindowedList<MyItem>(options, renderItem, onRendered?);

Methods

MethodDescription
setItems(items: T[])Replace item array, re-chunk, re-render.
refresh()Force re-render of visible chunks.
destroy()Cleanup, remove intersection observers.

DOM Structure

div.windowed-list
 ├─ div.windowed-chunk             ← IntersectionObserver placeholder
 ├─ div.windowed-chunk
 └─ ...

SearchModal

File: src/components/SearchModal.ts (377 lines)

Global search overlay accessible via Ctrl+K / Cmd+K.

Constructor

ts
const search = new SearchModal(container, {
  placeholder?: string,   // input placeholder text
  hint?: string,          // footer hint text
});

Methods

MethodSignatureDescription
registerSource(type, items)(type: SearchResultType, items: SearchItem[]): voidAdd or replace a searchable dataset.
setOnSelect(callback)(cb: (result: SearchResult) => void): voidSelection handler.
open()(): voidShow modal, focus input.
close()(): voidHide modal.
isOpen()(): booleanVisibility check.

Search Result Types

20+ discriminated types:

country | news | hotspot | market | prediction | conflict | base |
pipeline | cable | datacenter | earthquake | outage | nuclear |
techhq | exchange | financial-center | central-bank | commodity-hub |
gulf-investment | apt-group | critical-mineral | ...

Scoring

Match kindScore
Prefix match2
Substring match1

Results are further sorted by a priority tier:

news > prediction > market > earthquake > outage >
conflict > hotspot > country > infrastructure > tech

Persistence

Recent selections stored in localStorage['worldmonitor_recent_searches'] (most recent 10).

DOM Structure

div.search-overlay
 └─ div.search-modal
     ├─ div.search-header
     │   ├─ svg (search icon)
     │   ├─ input[type=text]
     │   └─ kbd (Esc)
     ├─ div.search-results           ← rendered matches
     └─ div.search-footer            ← hint text

Domain Panels

All domain panels extend Panel (§2) and fill .panel-content with domain-specific markup.

Intelligence & Analysis Panels

InsightsPanel

FieldDetail
Filesrc/components/InsightsPanel.ts
Panel IDinsights
PurposeAI-generated analytical insights aggregated from multiple ML pipelines.
Constructornew InsightsPanel() — no extra args.
Key methodssetMilitaryFlights(flights)
ServicesmlWorker, generateSummary, parallelAnalysis, signalAggregator, focalPointDetector, ingestNewsForCII, getTheaterPostureSummaries
VariantAll
NotesHidden on mobile via CSS media query.

CIIPanel (Country Instability Index)

FieldDetail
Filesrc/components/CIIPanel.ts (150 lines)
Panel IDcii
PurposeRanks countries by a composite instability score (U/C/S/I sub-scores).
Key methodssetShareStoryHandler(), refresh(forceLocal?), getScores()
DOM.cii-list.cii-country each with header (emoji flag, name, score, trend arrow, share button), colour bar, sub-score row (U/C/S/I).
ServicescalculateCII(), getCSSColor
Variantfull only

GdeltIntelPanel

FieldDetail
Filesrc/components/GdeltIntelPanel.ts
Panel IDgdelt-intel
PurposeMulti-topic intelligence digest from GDELT data.
Key methodsrefresh(), refreshAll()
ServicesgetIntelTopics, fetchTopicIntelligence
Variantfull only
NotesTab-based UI, per-topic 5-minute cache.

StrategicRiskPanel

FieldDetail
Filesrc/components/StrategicRiskPanel.ts
Panel IDstrategic-risk
PurposeComposite strategic risk overview with convergence detection.
Key methodsrefresh()
ServicescalculateStrategicRiskOverview, getRecentAlerts, detectConvergence, dataFreshness, getLearningProgress, fetchCachedRiskScores
Data badgelive / cached / unavailable
Variantfull only

StrategicPosturePanel

FieldDetail
Filesrc/components/StrategicPosturePanel.ts
Panel IDstrategic-posture
PurposeTheater-level military posture assessment.
ServicesfetchCachedTheaterPosture, fetchMilitaryVessels, recalcPostureWithVessels
Variantfull only
NotesMulti-stage loading, 5-minute refresh interval.

CascadePanel

FieldDetail
Filesrc/components/CascadePanel.ts
Panel IDcascade
PurposeInfrastructure cascade / dependency-graph analysis.
ServicesbuildDependencyGraph, calculateCascade, getGraphStats, clearGraphCache (from infrastructure-cascade service)
Variantfull only

MonitorPanel

FieldDetail
Filesrc/components/MonitorPanel.ts (172 lines)
Panel IDmonitors
PurposeUser-defined keyword monitors that match against news.
Key methodsremoveMonitor(id), renderResults(news)
DOMInput + add button, #monitorsList (.monitor-tag pills), #monitorsResults
MatchingWord-boundary regex, max 10 results per keyword.
VariantAll

News & Content Panels

NewsPanel

FieldDetail
Filesrc/components/NewsPanel.ts (593 lines)
Constructornew NewsPanel(id: string, title: string)
PurposeClustered news feed with velocity scoring and AI summaries.
ScrollingWindowedList<PreparedCluster> with chunkSize: 8.
ServicesanalysisWorker, enrichWithVelocityML, getClusterAssetContext, activityTracker, generateSummary, translateText, getSourcePropagandaRisk / getSourceTier / getSourceType
DOM extrasDeviation indicator, summary container, summarize button.
VariantSITE_VARIANT used in summary cache key.

LiveNewsPanel

FieldDetail
Filesrc/components/LiveNewsPanel.ts (703 lines)
Panel IDlive-news
PurposeEmbedded YouTube live-stream player with channel switching.
DOMYouTube IFrame player, channel switcher bar, mute/live buttons.
ServicesfetchLiveVideoId, isDesktopRuntime, getRemoteApiBaseUrl
Variant channelstechTECH_LIVE_CHANNELS (Bloomberg, Yahoo Finance, CNBC, NASA TV). world / fullFULL_LIVE_CHANNELS (Bloomberg, Sky, Euronews, DW, CNBC, France24, Al Arabiya, Al Jazeera).
NotesIdle pause after 5 minutes of inactivity.

PredictionPanel

FieldDetail
Filesrc/components/PredictionPanel.ts (62 lines)
Panel IDpolymarket
PurposePolymarket prediction market odds display.
Key methodsrenderPredictions(data)
DOM.prediction-item with question text, volume, yes/no percentage bars.
VariantAll

LiveWebcamsPanel

FieldDetail
Filesrc/components/LiveWebcamsPanel.ts
Panel IDlive-webcams
PurposeGrid of live YouTube webcam feeds from global locations.
DataHardcoded WEBCAM_FEEDS (YouTube channels).
VariantAll
NotesRegion filters, grid/single view toggle, idle pause.

Markets & Finance Panels

MarketPanel

FieldDetail
Filesrc/components/MarketPanel.ts (152 lines, shared file)
Panel IDmarkets
PurposeStock index overview with sparkline charts.
DOM.market-item with inline sparkline <svg>.
HelperminiSparkline() — generates a tiny inline SVG polyline.

HeatmapPanel

FieldDetail
Filesrc/components/MarketPanel.ts (shared file)
Panel IDheatmap
PurposeMarket heatmap grid (sector / index performance).
DOM.heatmap grid of colour-coded cells.

CommoditiesPanel

FieldDetail
Filesrc/components/MarketPanel.ts (shared file)
Panel IDcommodities
PurposeCommodity price overview.
DOM.commodities-grid of price cells.

CryptoPanel

FieldDetail
Filesrc/components/MarketPanel.ts (shared file)
Panel IDcrypto
PurposeTop crypto assets with sparklines.
DOM.market-item with inline sparkline <svg>.

ETFFlowsPanel

FieldDetail
Filesrc/components/ETFFlowsPanel.ts
Panel IDetf-flows
PurposeETF fund flow data.
Servicesfetch('/api/etf-flows')
RefreshAuto, every 3 minutes.
Variantfinance / full / tech

MacroSignalsPanel

FieldDetail
Filesrc/components/MacroSignalsPanel.ts
Panel IDmacro-signals
PurposeMacro economic signal aggregator with BUY/CASH verdict.
Servicesfetch('/api/macro-signals')
DOMSparklines, donut gauge, verdict label.
RefreshAuto, every 3 minutes.
Variantfinance / full / tech

StablecoinPanel

FieldDetail
Filesrc/components/StablecoinPanel.ts
Panel IDstablecoins
PurposeStablecoin peg deviation monitor.
Servicesfetch('/api/stablecoin-markets')
DOMPeg status badges (pegged / depegging / depegged).
RefreshAuto, every 3 minutes.
Variantfinance / full / tech

InvestmentsPanel

FieldDetail
Filesrc/components/InvestmentsPanel.ts
Panel IDgcc-investments
Constructornew InvestmentsPanel(onInvestmentClick?)
PurposeGCC / Gulf sovereign investment tracker.
ServicesGULF_INVESTMENTS config data.
Variantfinance
NotesMulti-filter, sortable columns.

EconomicPanel

FieldDetail
Filesrc/components/EconomicPanel.ts
Panel IDeconomic
PurposeThree-tab economic dashboard: indicators (FRED), oil (EIA), spending (USASpending).
Key methodsupdate(data), updateOil(data), updateSpending(data)
VariantAll

Military & Security Panels

UcdpEventsPanel

FieldDetail
Filesrc/components/UcdpEventsPanel.ts
Panel IDucdp-events
PurposeUppsala Conflict Data Program — armed conflict event log.
Key methodssetEventClickHandler(), setEvents(), getEvents()
DOMThree tabs: state-based / non-state / one-sided. Max 50 rows per tab.
Variantfull only

PlaybackControl

FieldDetail
Filesrc/components/PlaybackControl.ts (178 lines)
PurposeTime-travel slider for historical snapshot playback.
DOMdiv.playback-control with toggle, range slider, action buttons (⏮ ◀ LIVE ▶ ⏭).
Key methodsgetElement(), onSnapshotChange callback.
ServicesgetSnapshotTimestamps(), getSnapshotAt()
NotesAdds .playback-mode class to <body> when active.

Natural Events & Humanitarian Panels

ClimateAnomalyPanel

FieldDetail
Filesrc/components/ClimateAnomalyPanel.ts
Panel IDclimate
PurposeClimate anomaly zones with severity indicators.
Key methodssetZoneClickHandler(handler), setAnomalies(anomalies)
ServicesgetSeverityIcon, formatDelta from climate service.

SatelliteFiresPanel

FieldDetail
Filesrc/components/SatelliteFiresPanel.ts
Panel IDsatellite-fires
PurposeNASA FIRMS satellite fire detection statistics.
Key methodsupdate(stats, totalCount)
Variantfull only

PopulationExposurePanel

FieldDetail
Filesrc/components/PopulationExposurePanel.ts
Panel IDpopulation-exposure
PurposePopulation within impact radius of active events.
Key methodssetExposures()
DOMEvent type icons (conflict / earthquake / flood / fire). Highlighted row at 1 M+.

DisplacementPanel

FieldDetail
Filesrc/components/DisplacementPanel.ts
Panel IDdisplacement
PurposeUNHCR displacement data — refugee origin / hosting.
Key methodssetCountryClickHandler(), setData(data)
ServicesformatPopulation from UNHCR service.
DOMTwo tabs: origins / hosts.

Infrastructure & Tech Panels

TechEventsPanel

FieldDetail
Filesrc/components/TechEventsPanel.ts
Constructornew TechEventsPanel(id)
PurposeTech conferences, earnings calls, product launches.
Servicesfetch('/api/tech-events')
DOMView mode switcher: upcoming / conferences / earnings / all.
Varianttech

TechHubsPanel

FieldDetail
Filesrc/components/TechHubsPanel.ts
Panel IDtech-hubs
PurposeTop-10 tech hub activity ranking.
Key methodssetOnHubClick(), setActivities()
Varianttech

TechReadinessPanel

FieldDetail
Filesrc/components/TechReadinessPanel.ts
Panel IDtech-readiness
PurposeCountry technology readiness rankings (World Bank data).
Key methodsrefresh()
ServicesgetTechReadinessRankings from worldbank service.
RefreshEvery 6 hours. Top 25 countries.
Varianttech

GeoHubsPanel

FieldDetail
Filesrc/components/GeoHubsPanel.ts
Panel IDgeo-hubs
PurposeGeopolitical hub activity monitor.
Key methodssetOnHubClick(), setActivities()
ServicesGeoHubActivity type.
Variantfull only

RegulationPanel

FieldDetail
Filesrc/components/RegulationPanel.ts
Panel IDregulation
PurposeAI / tech regulation tracker by country and timeline.
DOMFour view modes: timeline / deadlines / regulations / countries.
ServicesAI_REGULATIONS, COUNTRY_REGULATION_PROFILES
Varianttech

ServiceStatusPanel

FieldDetail
Filesrc/components/ServiceStatusPanel.ts
Panel IDservice-status
PurposeExternal service health / availability monitor.
RefreshAuto, every 60 seconds.
DOMCategory filter chips, status rows.
Varianttech primarily
NotesDesktop readiness checks via Tauri bridge.

Platform Panels

StatusPanel

FieldDetail
Filesrc/components/StatusPanel.ts (251 lines)
Panel IDstatus
PurposeInternal feed & API health status dashboard.
Key methodsupdateFeed(name, status), updateApi(name, status), setFeedDisabled(name)
DOMdiv.status-panel-container with toggle button, sections: feeds-list, apis-list, storage-info.
Variant datatechTECH_FEEDS / TECH_APIS. world / fullWORLD_FEEDS / WORLD_APIS.

RuntimeConfigPanel

FieldDetail
Filesrc/components/RuntimeConfigPanel.ts
Panel IDruntime-config
PurposeRuntime configuration / API-key management panel.
Key methodscommitPendingSecrets(), hasPendingChanges(), verifyPendingSecrets()
VariantAll
NotesDesktop vs web mode adapts form fields. Tauri bridge for secure secrets storage.

LanguageSelector

FieldDetail
Filesrc/components/LanguageSelector.ts
PurposeUI language switcher dropdown.
Constructornew LanguageSelector()
Key methodsgetElement()
ServicesENABLED_LANGUAGES, changeLanguage, getCurrentLanguage
VariantAll

Modals & Widgets

Standalone components that are not panels — overlays, banners, badges, and small UI affordances.

SignalModal

FieldDetail
Filesrc/components/SignalModal.ts (326 lines)
PurposeFull-screen modal for correlation signals and unified alerts.
DOMdiv.signal-modal-overlay → header, scrollable content, footer (audio toggle + dismiss).
Methodsshow(signals), showSignal(signal), showAlert(alert), setLocationClickHandler(), hide()
AudioInline base64-encoded WAV notification sound.
TypesCorrelationSignal, UnifiedAlert

CountryIntelModal

FieldDetail
Filesrc/components/CountryIntelModal.ts
PurposeAI-generated country intelligence briefing modal.
ServicesgetCSSColor, country-instability types.

CountryBriefPage

FieldDetail
Filesrc/components/CountryBriefPage.ts
PurposeFull-page overlay showing a comprehensive country intelligence brief with nearby infrastructure analysis.
ServicesgetNearbyInfrastructure, haversineDistanceKm, exportCountryBriefJSON, exportCountryBriefCSV

CountryTimeline

FieldDetail
Filesrc/components/CountryTimeline.ts
Constructornew CountryTimeline(container)
PurposeD3 SVG timeline of country events across conflict / protest / natural / military lanes.
Methodsrender(events)

StoryModal

FieldDetail
Filesrc/components/StoryModal.ts
PurposeShareable story card generator and viewer.
Exported functionsopenStoryModal(data), closeStoryModal()
Share targetsWhatsApp, X (Twitter), LinkedIn, clipboard copy.
NotesGenerates PNG image for sharing via canvas rendering.

MobileWarningModal

FieldDetail
Filesrc/components/MobileWarningModal.ts
PurposeFirst-visit warning on mobile devices about limited functionality.
StaticMobileWarningModal.shouldShow()
NotesDismissible, remembers via localStorage.

DownloadBanner

FieldDetail
Filesrc/components/DownloadBanner.ts
PurposePrompts web users to download the desktop app.
ExportedmaybeShowDownloadBanner()
Platform detectionmacos-arm64, macos-x64, windows, linux

CommunityWidget

FieldDetail
Filesrc/components/CommunityWidget.ts
PurposeSmall floating widget linking to GitHub Discussions.
ExportedmountCommunityWidget()
NotesDismissible via localStorage.

PizzIntIndicator

FieldDetail
Filesrc/components/PizzIntIndicator.ts
PurposeDEFCON-style 1–5 threat indicator with expandable detail panel.
DOMToggle button + expandable panel.
NotesLinks to pizzint.watch.

IntelligenceGapBadge (IntelligenceFindingsBadge)

FieldDetail
Filesrc/components/IntelligenceGapBadge.ts
PurposeHeader badge + dropdown showing intelligence findings and gaps.
Key methodssetOnSignalClick(), setOnAlertClick()
NotesAudio notification for new findings. full variant only.

VerificationChecklist

FieldDetail
Filesrc/components/VerificationChecklist.ts
PurposeBellingcat-style open-source verification checklist (8 checks).
FrameworkPreact component (extends Component) — the only Preact component in the codebase.
NotesVerdict scoring based on completed checks.

Variant Visibility Matrix

Componentworld / fulltechfinance
Panel (base)
DeckGLMap
MapComponent
MapContainer
MapPopup
VirtualList / WindowedList
SearchModal
NewsPanel
LiveNewsPanel
PredictionPanel
LiveWebcamsPanel
MarketPanel
HeatmapPanel
CommoditiesPanel
CryptoPanel
ETFFlowsPanel
MacroSignalsPanel
StablecoinPanel
InvestmentsPanel
EconomicPanel
InsightsPanel
CIIPanel
GdeltIntelPanel
StrategicRiskPanel
StrategicPosturePanel
CascadePanel
MonitorPanel
UcdpEventsPanel
ClimateAnomalyPanel
SatelliteFiresPanel
PopulationExposurePanel
DisplacementPanel
TechEventsPanel
TechHubsPanel
TechReadinessPanel
GeoHubsPanel
RegulationPanel
ServiceStatusPanel
StatusPanel
RuntimeConfigPanel
LanguageSelector
PlaybackControl
SignalModal
CountryIntelModal
CountryBriefPage
CountryTimeline
StoryModal
MobileWarningModal
DownloadBanner
CommunityWidget
PizzIntIndicator
IntelligenceFindingsBadge
VerificationChecklist

Component Interaction Diagram

mermaid
graph TD
    subgraph App["App.ts (Orchestrator)"]
        APP[App]
    end

    subgraph Maps["Map System"]
        MC[MapContainer]
        DGL[DeckGLMap]
        SVG[MapComponent]
        MP[MapPopup]
        MC -->|desktop/WebGL| DGL
        MC -->|mobile/fallback| SVG
        DGL --> MP
        SVG --> MP
    end

    subgraph Intelligence["Intelligence & Analysis"]
        INS[InsightsPanel]
        CII[CIIPanel]
        GDL[GdeltIntelPanel]
        SRP[StrategicRiskPanel]
        SPP[StrategicPosturePanel]
        CSC[CascadePanel]
        MON[MonitorPanel]
    end

    subgraph News["News & Content"]
        NP[NewsPanel]
        LNP[LiveNewsPanel]
        PP[PredictionPanel]
        LWP[LiveWebcamsPanel]
    end

    subgraph Markets["Markets & Finance"]
        MKT[MarketPanel]
        HMP[HeatmapPanel]
        CMD[CommoditiesPanel]
        CRY[CryptoPanel]
        ETF[ETFFlowsPanel]
        MAC[MacroSignalsPanel]
        STB[StablecoinPanel]
        INV[InvestmentsPanel]
        ECO[EconomicPanel]
    end

    subgraph Military["Military & Security"]
        UCDP[UcdpEventsPanel]
        PBC[PlaybackControl]
    end

    subgraph NatHum["Natural & Humanitarian"]
        CLP[ClimateAnomalyPanel]
        SFP[SatelliteFiresPanel]
        PEP[PopulationExposurePanel]
        DSP[DisplacementPanel]
    end

    subgraph Tech["Infrastructure & Tech"]
        TEP[TechEventsPanel]
        THP[TechHubsPanel]
        TRP[TechReadinessPanel]
        GHP[GeoHubsPanel]
        REG[RegulationPanel]
        SSP[ServiceStatusPanel]
    end

    subgraph Platform["Platform"]
        STP[StatusPanel]
        RCP[RuntimeConfigPanel]
        LNG[LanguageSelector]
    end

    subgraph Modals["Modals & Widgets"]
        SIG[SignalModal]
        CIM[CountryIntelModal]
        CBP[CountryBriefPage]
        CTL[CountryTimeline]
        STM[StoryModal]
        IGB[IntelligenceFindingsBadge]
        PIZ[PizzIntIndicator]
    end

    subgraph Services["Service Layer"]
        HES[hotspot-escalation]
        CIS[country-instability]
        GCS[geo-convergence]
        MLW[mlWorker]
        ACT[activityTracker]
        SAS[signalAggregator]
    end

    subgraph Search["Search"]
        SM[SearchModal]
    end

    APP --> MC
    APP --> SM
    APP --> Intelligence
    APP --> News
    APP --> Markets
    APP --> Military
    APP --> NatHum
    APP --> Tech
    APP --> Platform
    APP --> Modals

    DGL --> HES
    DGL --> CIS
    DGL --> GCS
    SVG --> HES
    SVG --> CIS
    SVG --> GCS

    INS --> MLW
    INS --> SAS
    CII --> CIS
    SRP --> GCS

    NP --> MLW
    NP --> ACT

    SM -.->|registers sources| APP
    SIG -.->|triggered by| SAS
    IGB -.->|triggered by| SAS

Reading the Diagram

  • Solid arrows () represent ownership or direct method calls.
  • Dashed arrows (-.->) represent event-driven or callback-based connections.
  • App.ts is the top-level orchestrator that instantiates all panels, wires callbacks, and drives the refresh cycle.
  • The Service Layer is shared — multiple panels and map components call the same services.
  • MapContainer is the single map entry point; it delegates to DeckGLMap or MapComponent based on runtime capability detection.

Appendix: Barrel Exports

src/components/index.ts re-exports 40+ symbols:

ts
// Panels
export { Panel } from './Panel';
export { NewsPanel } from './NewsPanel';
export { LiveNewsPanel } from './LiveNewsPanel';
export { MarketPanel, HeatmapPanel, CommoditiesPanel, CryptoPanel } from './MarketPanel';
export { CIIPanel } from './CIIPanel';
export { MonitorPanel } from './MonitorPanel';
export { PredictionPanel } from './PredictionPanel';
export { StatusPanel } from './StatusPanel';
export { InsightsPanel } from './InsightsPanel';
export { CascadePanel } from './CascadePanel';
export { ClimateAnomalyPanel } from './ClimateAnomalyPanel';
export { EconomicPanel } from './EconomicPanel';
export { ETFFlowsPanel } from './ETFFlowsPanel';
export { GdeltIntelPanel } from './GdeltIntelPanel';
export { GeoHubsPanel } from './GeoHubsPanel';
export { MacroSignalsPanel } from './MacroSignalsPanel';
export { StablecoinPanel } from './StablecoinPanel';
export { InvestmentsPanel } from './InvestmentsPanel';
export { TechEventsPanel } from './TechEventsPanel';
export { TechHubsPanel } from './TechHubsPanel';
export { TechReadinessPanel } from './TechReadinessPanel';
export { UcdpEventsPanel } from './UcdpEventsPanel';
export { DisplacementPanel } from './DisplacementPanel';
export { SatelliteFiresPanel } from './SatelliteFiresPanel';
export { PopulationExposurePanel } from './PopulationExposurePanel';
export { StrategicPosturePanel } from './StrategicPosturePanel';
export { StrategicRiskPanel } from './StrategicRiskPanel';
export { RegulationPanel } from './RegulationPanel';
export { ServiceStatusPanel } from './ServiceStatusPanel';
export { RuntimeConfigPanel } from './RuntimeConfigPanel';
export { LiveWebcamsPanel } from './LiveWebcamsPanel';

// Map system
export { DeckGLMap } from './DeckGLMap';
export { MapComponent } from './Map';
export { MapContainer } from './MapContainer';

// Scrolling
export { VirtualList, WindowedList } from './VirtualList';

// Search
export { SearchModal } from './SearchModal';

// Modals & widgets
export { SignalModal } from './SignalModal';
export { CountryIntelModal } from './CountryIntelModal';
export { CountryBriefPage } from './CountryBriefPage';
export { CountryTimeline } from './CountryTimeline';
export { PlaybackControl } from './PlaybackControl';
export { LanguageSelector } from './LanguageSelector';
export { VerificationChecklist } from './VerificationChecklist';
// ... and standalone functions

Note: The barrel file is the canonical list. If a component is not exported here it is either internal or mounted directly by App.ts.