Open IsaKiko opened 9 years ago
this might help
//var region_names = ["Sub-Saharan Africa", "South Asia", "Middle East & North Africa", "America", "East Asia & Pacific", "Europe & Central Asia"];
var region_names = nations.map(function(d) { return d.region; });
region_names = d3.set(region_names).values();
for (i in region_names) {
var lab = d3.select("body").append("label");
lab
.append("input")
.attr("type", "checkbox")
.attr("class", "region_cb")
.attr("value", region_names[i]);
lab.append("span").text(region_names[i]);
lab.append("br");
//d3.select("body").append("span").html(region_names[i]);
}
PR https://github.com/IsaKiko/D3-visualising-data/pull/27 will result in the following changes in the rest of the repo
include in css file: svg { border: 5px solid red; }
change in js files:
lesson notes: write up and explain solution for automatic checkboxes (optional)
cc @twitwi