D3-visualising-data
D3-visualising-data copied to clipboard
issues arising from https://github.com/IsaKiko/D3-visualising-data/pull/27
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:
- var margin = {top: 21.5, right: 21.5, bottom: 21.5, left: 39.5};
- refreshData(); update() --> refreshData
- include solution for automatic check boxes
lesson notes: write up and explain solution for automatic checkboxes (optional)
cc @twitwi
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]);
}