FLUJOS/INFO/DOCS/ARQUITECTURA_FLUJOS_APP_JS.txt
CAPITANSITO 954f47996f refactor: reorganizar docs y pocs bajo INFO/
- docs/ → INFO/DOCS/CONTEXT/ (documentación técnica en markdown)
- FLUJOS/DOCS/ + FLUJOS_DATOS/DOCS/ → INFO/DOCS/ (txts de arquitectura)
- POCS/ → INFO/POCS/ (pruebas de concepto)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 23:49:33 +02:00

32 lines
1.7 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

┌──────────────────────────┐
│ 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 │
└───────────────────────────┘