edges_table = {
const edges = mc1_graph2.links ?? mc1_graph2.edges;
if (!edges || edges.length === 0) return html`<p>No hay enlaces en el grafo.</p>`;
const columns = Object.keys(edges[0]);
return d3.create("table")
.call(table => {
table.append("thead").append("tr")
.selectAll("th")
.data(columns)
.enter().append("th")
.text(d => d);
table.append("tbody")
.selectAll("tr")
.data(edges)
.enter().append("tr")
.selectAll("td")
.data(row => columns.map(col => row[col]))
.enter().append("td")
.text(d => d);
})
.node();
}