diff --git a/app/templates/v2/screens/cluster.html b/app/templates/v2/screens/cluster.html index a67a5b8..3f38710 100644 --- a/app/templates/v2/screens/cluster.html +++ b/app/templates/v2/screens/cluster.html @@ -285,15 +285,21 @@ function renderClusterGraph(cl) { return map[f] || '#888'; }; - const nodes = rawNodes.map(n => ({ - id: n.drucksache, + // Edges sind Index-basiert (a/b sind Positionen in rawNodes). + // d3.forceLink mappt per id-Lookup → wir nutzen den Index als id-String. + const nodes = rawNodes.map((n, i) => ({ + id: String(i), drucksache: n.drucksache, title: n.title || n.titel || n.drucksache, bundesland: n.bundesland || '', fraktion: (n.fraktionen && n.fraktionen[0]) || '', score: n.gwoe_score != null ? parseFloat(n.gwoe_score) : 5, })); - const links = rawEdges.map(e => ({ source: e.a, target: e.b, sim: e.sim || 0.5 })); + const links = rawEdges.map(e => ({ + source: String(e.a), + target: String(e.b), + sim: e.sim || 0.5, + })); const svg = d3.select(container).append('svg') .attr('width', width).attr('height', height)