Files
nav-carte/types/structure-v2.ts
Jules NenyandClaude Opus 5.5 6ca6afbfce feat(carte): B4b-M2, une structure d'outre-mer va dans l'encart de son territoire
EncartsOutremer décide par le champ territoire de l'épingle ; seule la page
le posait, et pour les Org seulement. epingleStructure le pose désormais
depuis s.territoire, filtré par DOM_TOM comme pour une Org. Type StructureV2 :
geocodage, territoire, et les trois champs de taxonomie de M3.
utils/carte.ts inchangé.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWGVn2kurLPzxVc5F3mQJ5
2026-11-12 09:12:31 +01:00

100 lines
2.9 KiB
TypeScript

/**
* Types V2 - Carte des réseaux de bifurcation
* Source : public/data/reseaux-bifurcation.json
*/
export interface StructureV2 {
id: string
nom: string
url: string
pays: string
ville: string
famille_principale: 1 | 2 | 3 | 4 | 5
familles_secondaires?: number[]
hashtags: string[]
type_principal: string
badges: {
centre_ressources: boolean
mouvement_manifeste: boolean
contre_pouvoir_spatial: boolean
f6_recherche_politique: boolean
}
description_courte: string
description_longue: string
pensees: { id: string; label: string; confiance: string }[]
sources: { type: string; titre: string; url: string }[]
already_in_v1: boolean
eligible_v2: boolean
// Geocoords (ajoutés par géocodage - peut être null)
latitude?: number | null
longitude?: number | null
/** B4b-M2 : d'où vient le point (commune du siège, ou centroïde et sa raison). */
geocodage?: { precision: 'commune' | 'centroide'; source?: string; confiance?: string; code_commune?: string; raison?: string; date: string }
/** B4b-M2 : territoire d'outre-mer (nom de TERRITOIRES_OUTREMER, utils/carte.ts), sinon absent. */
territoire?: string
/** B4b-M3 : type et postures portés par la fiche (recopiés de data/taxonomie/organisations.json). */
type_organisation?: string
postures?: string[]
taxonomie_source?: { type_organisation: string; postures: Record<string, string> }
}
export interface ReseauxBifurcationData {
version: string
meta: {
total_structures: number
total_projets_emblematiques: number
total_edges_graphe: number
familles: { id: number; label: string; color: string }[]
hashtags_officiels: string[]
}
structures: StructureV2[]
projets: ProjetEmblematique[]
graphe: { edges: GrapheEdge[] }
}
export interface ProjetEmblematique {
id: string
nom: string
structure_parent: string
annee?: number
lieu?: string
geocoords?: { lat: number; lng: number } | null
description: string
url?: string | null
tags: string[]
}
export interface GrapheEdge {
source: string
target: string
types: string[]
score: number
evidence: string
}
// Mapping StructureV2 vers le format attendu par NavMap (interface Org)
// NavMap attend { Id, latitude, longitude, nom, ... }
export function structureToMapOrg(s: StructureV2, index: number): {
Id: number
nom: string
latitude?: number | null
longitude?: number | null
prioritaire?: boolean
famille_principale?: number
hashtags?: string[]
type_principal?: string
description_courte?: string
} {
return {
Id: index,
nom: s.nom,
latitude: s.latitude,
longitude: s.longitude,
prioritaire: s.badges?.centre_ressources || s.badges?.mouvement_manifeste || s.badges?.contre_pouvoir_spatial,
famille_principale: s.famille_principale,
hashtags: s.hashtags,
type_principal: s.type_principal,
description_courte: s.description_courte,
}
}