Public
Edited
Jun 10
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
nodes_table = {
const nodes = mc1_graph2.nodes;
return d3.create("table")
.call(table => {
const columns = Object.keys(nodes[0]);
table.append("thead").append("tr")
.selectAll("th")
.data(columns)
.enter().append("th")
.text(d => d);
table.append("tbody")
.selectAll("tr")
.data(nodes)
.enter().append("tr")
.selectAll("td")
.data(row => columns.map(col => row[col]))
.enter().append("td")
.text(d => d);
})
.node();
}

Insert cell
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();
}

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more