-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcartografia.html
More file actions
79 lines (71 loc) · 3.01 KB
/
Copy pathcartografia.html
File metadata and controls
79 lines (71 loc) · 3.01 KB
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
78
79
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cartografía · Investigación e[ad]</title>
<link rel="stylesheet" href="style.css">
<script src="d3.v7.min.js"></script>
</head>
<body>
<div class="surface">
<header class="topbar">
<a href="index.html" class="home">← Investigación e[ad]</a>
<div class="titulo">Cartografía</div>
<div class="audiencia">Postulantes</div>
<div class="grow"></div>
<input type="search" id="search" placeholder="Buscar línea o sublínea…">
</header>
<aside class="controls">
<h3>Envolventes</h3>
<label><input type="checkbox" data-toggle-envolvente="area" checked> Áreas del programa</label>
<label><input type="checkbox" data-toggle-envolvente="modo"> Modos de investigar</label>
<label><input type="checkbox" data-toggle-envolvente="salida"> Salidas (industria/academia/estado)</label>
<h3>Aristas</h3>
<label><input type="checkbox" data-toggle-edge="jerarquica" checked> Pertenencia a línea</label>
<label><input type="checkbox" data-toggle-edge="proximidad_semantica" checked> Proximidad temática</label>
</aside>
<main class="canvas">
<svg></svg>
<div class="tooltip"></div>
<div class="detail-panel"></div>
<div class="empty-state">
<div>Sin coincidencias para esta búsqueda.</div>
<button onclick="window.graph.clearFilters()">Limpiar</button>
</div>
<div class="loading">
<div class="sello-loader" id="sello-loader">Cargando el cuerpo investigativo del programa…</div>
</div>
</main>
</div>
<script src="data-loader.js"></script>
<script src="graph.js"></script>
<script>
const SHEET_ID = '1Vbua3waIfGyszVnu3vr6qv2KvwVqK1zIHnZIrIEaFzQ';
const FALLBACK_JSON = 'mad-map-data.json';
const graph = new MadMapGraph({
surface: 'cartografia',
allowedEdges: ['jerarquica', 'proximidad_semantica'],
defaultEdges: ['jerarquica', 'proximidad_semantica'],
allowPerfiles: false,
defaultShowPerfiles: false,
defaultEnvolventes: ['area'],
allowedFilters: [],
});
window.graph = graph;
// Sello como mensaje de carga (fetch fallback local mientras Sheets carga)
fetch(FALLBACK_JSON).then(r => r.json()).then(d => {
if (d.sello && d.sello.texto) {
document.getElementById('sello-loader').textContent = d.sello.texto;
}
}).catch(() => {});
// Cablear controles
document.querySelectorAll('input[data-toggle-envolvente]').forEach(el =>
el.addEventListener('change', () => graph.toggleEnvolvente(el.dataset.toggleEnvolvente)));
document.querySelectorAll('input[data-toggle-edge]').forEach(el =>
el.addEventListener('change', () => graph.toggleEdge(el.dataset.toggleEdge)));
document.getElementById('search').addEventListener('input', (e) => graph.setSearch(e.target.value));
graph.loadFromSheets(SHEET_ID, FALLBACK_JSON);
</script>
</body>
</html>