All files / scripts/coalition-dashboard types.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77                                                                                                                                                         
/**
 * @module Analytics/CoalitionIntelligence/Types
 * @description TypeScript interface and type declarations for the Coalition Intelligence Dashboard.
 *
 * @author Hack23 AB
 * @license Apache-2.0
 */
 
import type { SimulationNodeDatum, SimulationLinkDatum, DSVRowString } from 'd3';
 
// ========== Interfaces ==========
 
export interface PartyConfig {
  name: string;
  color: string;
  fullName: string;
}
 
export interface PartyNode extends SimulationNodeDatum {
  id: string;
  name: string;
  fullName: string;
  color: string;
  influence: number;
}
 
export interface CoalitionLink extends SimulationLinkDatum<PartyNode> {
  strength: number;
}
 
export interface VotingAnomaly {
  party: string;
  date: string;
  deviation: number;
  severity: string;
}
 
export interface AnnualVoteEntry {
  year: number;
  votes: number;
}
 
export interface HeatMapDatum {
  party1: string;
  party2: string;
  alignment: number;
}
 
export type CoalitionAlignment = Record<string, Record<string, number>>;
export type BehavioralPatterns = Record<string, number>;
export type AnnualVotes = Record<string, AnnualVoteEntry[]>;
 
export interface DataCache {
  coalitionAlignment: CoalitionAlignment | null;
  behavioralPatterns: BehavioralPatterns | null;
  decisionPatterns: DSVRowString<string>[] | null;
  votingAnomalies: VotingAnomaly[] | null;
  annualVotes: AnnualVotes | null;
}
 
export interface DataFiles {
  coalition: string[];
  behavioral: string[];
  decision: string[];
  anomalyClassification: string[];
  anomalyByParty: string[];
  annualVotes: string[];
  decisionTrends: string[];
  partyMomentum: string[];
}
 
export interface DataConfig {
  files: DataFiles;
  useMockData: boolean;
}