IsaKiko / D3-visualising-data

Lesson plans for teaching the basics of HTML, CSS, SVG, JSON, and JS (primarily D3.js), in order to create browser-based data visualisations.
http://isakiko.github.io/D3-visualising-data/
Other
35 stars 35 forks source link

issues arising from https://github.com/IsaKiko/D3-visualising-data/pull/27 #28

Open IsaKiko opened 9 years ago

IsaKiko commented 9 years ago

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

twitwi commented 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]);
    }