table2 = {
var names = _.keys(data[0]);
const table = d3.create("table");
table
.append("thead")
.join("tr")
.selectAll("th")
.data(names)
.join("th")
.text((d) => d)
.style("background-color", "#aaa")
.style("color", "#fff");
table
.append("tbody")
.selectAll("tr")
.data(data)
.join("tr")
.selectAll("td")
.data((row) => _.values(row))
.join("td")
.text((d) => d);
return table.node();
}