Skip to content

Interactive Dashboard Visualizing CIA Intelligence Exports #15

@pethers

Description

@pethers

📋 Issue Type

Feature - Data Visualization & Dashboard

🎯 Objective

IMPORTANT: CIA platform provides all intelligence data and analysis. This issue focuses on creating an interactive dashboard that visualizes CIA's JSON exports with Swedish election 2026 predictions.

Create an interactive intelligence dashboard that renders CIA platform's data exports with real-time visualizations, Swedish election 2026 predictions, and comprehensive analytics - consuming CIA's pre-processed intelligence for all 349 MPs, 8 parties, and 45 risk rules.

📊 Current State

  • ✅ Static HTML pages with basic party/MP information
  • ✅ Links to CIA platform for intelligence
  • ✅ CIA provides complete intelligence data
  • ❌ No interactive dashboard on riksdagsmonitor
  • ❌ No local visualization of CIA exports
  • ❌ No election predictions display
  • ❌ No real-time analytics rendering

Measured Metrics:

  • Static pages: 14 (one per language)
  • Interactive dashboard elements: 0
  • CIA export visualizations: 0
  • Prediction displays: 0

🚀 Desired State

  • ✅ Interactive Overview Dashboard rendering CIA exports
  • ✅ Swedish Election 2026 predictions from CIA data
  • ✅ Real-time party performance tracking (CIA data)
  • ✅ MP influence rankings with CIA visualizations
  • ✅ Committee network graph (CIA network data)
  • ✅ Voting pattern heatmaps (CIA analysis)
  • ✅ Historical trend analysis (CIA 50+ years data)
  • ✅ Mobile-responsive dashboard

📊 CIA Data Integration Context

CIA Platform Role:
🏭 CIA Provides: Complete intelligence data, OSINT analysis, pre-processed visualizations
📊 CIA Exports: Overview dashboard, party performance, election analysis, Top 10 rankings
🔍 CIA Analyzes: Voting patterns, influence networks, risk scores

Riksdagsmonitor Role:
📊 Visualizes: CIA's JSON exports in interactive dashboard
🎨 Renders: CIA's intelligence in user-friendly format
🌐 Displays: CIA's analytics across 14 languages

CIA Data Products (consumed by dashboard):

  • Overview Dashboard - Parliament snapshot (CIA export)
  • Election Cycle Analysis - Historical patterns and CIA forecasting
  • Party Performance Dashboard - Real-time party metrics (CIA data)
  • Top 10 Rankings - Influential MPs, Productive MPs, Controversial MPs (CIA rankings)
  • Committee Network Analysis - Influence mapping (CIA network data)

Data Source:

  • CIA JSON Exports: Cached in data/cia-exports/current/
  • CIA Schemas: schemas/cia/*.schema.json
  • Fallback: Live CIA API https://www.hack23.com/cia/api/

CIA Export Files Used:

overview-dashboard.json         # Main dashboard data
election-analysis.json          # 2026 predictions
party-performance.json          # Party metrics
top10-influential-mps.json      # Rankings
committee-network.json          # Network graph
voting-patterns.json            # Heatmap data

Methodology:

  • CIA OSINT analysis from DATA_ANALYSIS_INTOP_OSINT.md (451.4 KB)
  • CIA risk scoring algorithms (45 rules)
  • CIA influence network mapping
  • CIA election forecasting models

Implementation Notes:

🌐 Translation & Content Alignment

Translation Guide(s): All 4 guides for dashboard labels and tooltips
Related Homepage Page(s):

  • cia-features.html (Dashboard showcase)
  • swedish-election-2026.html (Election predictions)
  • blog-cia-osint-intelligence.html (OSINT methodology)

Multi-Language Scope: Dashboard in all 14 languages

🔧 Implementation Approach

Phase 1: Dashboard Foundation (Static Site Compatible)

CIA Data Loader:

// dashboard/cia-data-loader.js
class CIADashboardData {
  // Load CIA exports from cache
  async loadOverviewDashboard() {
    return await fetch('/data/cia-exports/current/overview-dashboard.json')
      .then(r => r.json());
  }
  
  async loadElectionAnalysis() {
    return await fetch('/data/cia-exports/current/election-analysis.json')
      .then(r => r.json());
  }
  
  async loadPartyPerformance() {
    return await fetch('/data/cia-exports/current/party-performance.json')
      .then(r => r.json());
  }
  
  // Fallback to live CIA API
  async loadWithFallback(exportName) {
    try {
      return await this.loadFromCache(exportName);
    } catch (e) {
      return await this.loadFromCIA(exportName);
    }
  }
}

Dashboard Layout:

<!-- dashboard/index.html -->
<div class="cia-dashboard">
  <!-- Key Metrics from CIA Overview -->
  <section class="metrics-grid">
    <div class="metric-card">
      <h3>MPs</h3>
      <div class="metric-value" data-cia-metric="totalMPs">349</div>
    </div>
    <div class="metric-card">
      <h3>Parties</h3>
      <div class="metric-value" data-cia-metric="totalParties">8</div>
    </div>
    <div class="metric-card">
      <h3>Risk Rules</h3>
      <div class="metric-value" data-cia-metric="totalRiskRules">45</div>
    </div>
  </section>
  
  <!-- Party Performance Charts (CIA Data) -->
  <section class="party-performance">
    <h2>Party Performance (CIA Analysis)</h2>
    <canvas id="partyChart" data-cia-source="party-performance"></canvas>
  </section>
  
  <!-- Election 2026 Predictions (CIA Forecast) -->
  <section class="election-forecast">
    <h2>Election 2026 Predictions (CIA Model)</h2>
    <div id="seatPredictions" data-cia-source="election-analysis"></div>
  </section>
  
  <!-- Top 10 Rankings (CIA Rankings) -->
  <section class="top-rankings">
    <h2>Top 10 Influential MPs (CIA Rankings)</h2>
    <div id="influentialMPs" data-cia-source="top10-influential-mps"></div>
  </section>
</div>

Phase 2: Visualizations (Lightweight Libraries)

Render CIA Data:

// dashboard/cia-visualizations.js
class CIADashboardRenderer {
  constructor(ciaData) {
    this.data = ciaData;
  }
  
  // Render party performance chart from CIA data
  renderPartyPerformance() {
    const ctx = document.getElementById('partyChart');
    new Chart(ctx, {
      type: 'line',
      data: {
        labels: this.data.timeline,
        datasets: this.data.parties.map(party => ({
          label: party.name,
          data: party.performanceHistory,
          // Data comes from CIA export
        }))
      }
    });
  }
  
  // Render election predictions from CIA forecast
  renderElectionForecast() {
    const predictions = this.data.electionAnalysis.seatPredictions;
    // Render CIA's predictions
    predictions.forEach(party => {
      this.createSeatPredictionCard(party);
    });
  }
  
  // Render Top 10 from CIA rankings
  renderTop10Rankings() {
    const rankings = this.data.top10Influential;
    // Render CIA's rankings
    rankings.forEach((mp, index) => {
      this.createRankingCard(mp, index + 1);
    });
  }
}

Phase 3: Election 2026 Predictions Display

Prediction Renderer:

// dashboard/election-predictions.js
class Election2026Predictions {
  constructor(ciaElectionData) {
    this.forecast = ciaElectionData.forecast;
    this.scenarios = ciaElectionData.coalitionScenarios;
  }
  
  // Render CIA's seat predictions
  renderSeatPredictions() {
    this.forecast.parties.forEach(party => {
      this.renderPartyForecast({
        name: party.name,
        predictedSeats: party.seats,
        confidence: party.confidenceInterval,
        change: party.changeFromPrevious
      });
    });
  }
  
  // Render CIA's coalition scenarios
  renderCoalitionScenarios() {
    this.scenarios.forEach(scenario => {
      this.renderScenario({
        name: scenario.name,
        probability: scenario.probability,
        composition: scenario.parties,
        totalSeats: scenario.totalSeats
      });
    });
  }
}

Phase 4: Polish & Performance

  1. Lazy loading for visualizations
  2. Progressive enhancement
  3. Accessibility (WCAG 2.1 AA)
  4. Performance optimization (Lighthouse 90+)
  5. Cross-browser testing

Files to Create/Modify

dashboard/
  index.html                 # Main dashboard page
  styles.css                 # Dashboard-specific styles
  cia-data-loader.js        # Load CIA exports
  cia-visualizations.js     # Render CIA data
  election-predictions.js   # Election 2026 display
data/
  cia-exports/current/      # CIA data (from Issue #18)
scripts/
  charts.js                 # Chart rendering
styles.css                  # Add dashboard styles

🤖 Recommended Agent

frontend-specialist - Best suited for:

  • Static HTML/CSS dashboard layout
  • Responsive design
  • Vanilla JavaScript for CIA data rendering
  • Performance optimization
  • No JavaScript framework constraints

Alternative: performance-engineer for optimization and lazy loading

✅ Acceptance Criteria

  • Interactive Overview Dashboard rendering CIA exports
  • Swedish Election 2026 prediction page with CIA forecast
  • Party performance charts (CIA data for all 8 parties)
  • MP influence rankings (CIA Top 10 visualizations)
  • Committee network graph (CIA network data)
  • Voting pattern heatmaps (CIA analysis)
  • Mobile-responsive (320px - 1440px+)
  • WCAG 2.1 AA accessibility compliant
  • Lighthouse Performance score 90+
  • Cross-browser tested (Chrome, Safari, Firefox)
  • All 14 languages supported
  • No JavaScript frameworks (vanilla JS only)
  • Lazy loading implemented
  • CIA data attribution visible

📚 References

🏷️ Labels

enhancement, documentation

🔒 Security & Performance

💡 Key Principle

CIA = Intelligence Source | Riksdagsmonitor = Visualization Layer

CIA provides all intelligence data, OSINT analysis, and forecasting. Riksdagsmonitor visualizes CIA's exports in an interactive, accessible dashboard.


Priority: High
Estimated Effort: 7-10 days
Dependencies: Issue #13 (CIA schemas), Issue #18 (CIA consumption)
Related Issues: Issue #16 (visualizations), Issue #20 (forecasting)

Metadata

Metadata

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions