32 lines
1.7 KiB
Text
32 lines
1.7 KiB
Text
┌──────────────────────────┐
|
||
│ Cliente JS (output_*.js) │
|
||
│ getData({tema, …}) │
|
||
└────────────┬─────────────┘
|
||
│ HTTP GET /api/data?tema=…&nodos=…&minSim=…
|
||
▼
|
||
┌─────────────────────────────────────────┐
|
||
│ FLUJOS_APP.js – Express /api/data │
|
||
│ │
|
||
│ 1) Parsea req.query: tema, nodos, minSim│
|
||
│ 2) nodesQuery = { tema, subtema?, … } │
|
||
│ 3) .find(nodesQuery).limit(nodos) → │
|
||
│ wikipediaNodes, noticiasNodes, │
|
||
│ torrentsNodes │
|
||
│ 4) Combina y formatea a `formattedNodes`│
|
||
│ 5) nodeIds = formattedNodes.map(id) │
|
||
│ 6) linksQuery = { │
|
||
│ noticia1: { $in: nodeIds }, │
|
||
│ noticia2: { $in: nodeIds }, │
|
||
│ porcentaje_similitud: { $gte: min }│
|
||
│ } │
|
||
│ 7) comparacionesCollection.find(linksQuery) → rawLinks │
|
||
│ 8) Formatea rawLinks a `{ source, target, value }` │
|
||
│ 9) Responde `{ nodes: formattedNodes, links: formattedLinks }` │
|
||
└────────────┬────────────────────────────┘
|
||
│
|
||
▼
|
||
┌───────────────────────────┐
|
||
│ Cliente JS recibe JSON │
|
||
│ Filtra nodos sin conexiones│
|
||
│ Dibuja ForceGraph3D │
|
||
└───────────────────────────┘
|