I am looking to create a dropdown/select list from a .csv file. Is it possible to create a dropdown/select list from d3 nest? I'm working on a force directed graph that is being populated from a .csv file. I would like for the user to be able to choose from the dropdown list which node it wants to highlight. Previously I used a text search based and it worked, but I am actually looking for a dropdown list instead of text based search. Thank you in advance!
You can refer to this link
var nodesmap = d3.nest()
.key(function (d) { return d.name; })
.rollup(function (d) { return { "name": d[0].name, "group": d[0].group, "size": d[0].size }; })
.map(graph.nodes);
var output = document.createElement('block_container');
var select = d3.select("#searchName").append("select");
list.selectAll("option")
.data(nodesmap)
.enter()
.append("option")
.attr("value", function(d) {return d.key;})
.text(function(d) {
return d.key; });
return output;
I used the les_mis.csv
P.s: I am not even sure if I had setup the jsfiddle appropriately. Excuse my noobness.