From d95418833d59ae5922d8025e8eb000913917385d Mon Sep 17 00:00:00 2001 From: kiddhustle Date: Wed, 16 Sep 2020 17:54:24 +0100 Subject: [PATCH 1/2] accessibilty fixes --- multimap/index.html | 5 ++--- multimap/js/script.js | 39 +++++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/multimap/index.html b/multimap/index.html index fb8e8a6..db17b16 100644 --- a/multimap/index.html +++ b/multimap/index.html @@ -18,11 +18,9 @@ }) (window, document, 'script', 'dataLayer', 'GTM-MBCBVQS'); - - Multiple variables map - + @@ -451,6 +449,7 @@ } input[type='radio']:checked+label { + background: #206095; color: white; } diff --git a/multimap/js/script.js b/multimap/js/script.js index e7479d3..ca54c49 100644 --- a/multimap/js/script.js +++ b/multimap/js/script.js @@ -219,15 +219,15 @@ if(Modernizr.webgl) { //Flatten data values and work out breaks - if(config.ons.breaks[a] =="jenks" || config.ons.breaks[a] =="equal") { + if(config.ons.breaks =="jenks" || config.ons.breaks =="equal") { var values = data.map(function(d) { return +d[variables[a]]; }).filter(function(d) {return !isNaN(d)}).sort(d3.ascending); }; - if(config.ons.breaks[a] =="jenks") { + if(config.ons.breaks =="jenks") { breaks = []; - ss.ckmeans(values, (dvc.numberBreaks[a])).map(function(cluster,i) { - if(i Date: Thu, 17 Sep 2020 10:44:22 +0100 Subject: [PATCH 2/2] dvc724: PR feedback - mobile variable select --- multimap/js/script.js | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/multimap/js/script.js b/multimap/js/script.js index ca54c49..78f0ebd 100644 --- a/multimap/js/script.js +++ b/multimap/js/script.js @@ -195,17 +195,25 @@ if(Modernizr.webgl) { // .on('click',function(d,i){onchange(i)}) - selectgroup = d3.select('#selectnav') - .append('select') - .attr('class','dropdown') - .on('change', onselect) - .selectAll("option") - .data(dvc.varlabels) - .enter() - .append('option') - .attr("value", function(d,i){return i}) - .property("selected", function(d, i) {return i===dvc.varload;}) - .text(function(d,i){return dvc.varlabels[i]}); + var container = d3.select('#selectnav') + + container.append('label') + .attr('for', 'selectlistMobile') + .attr('class', 'visuallyhidden') + .text('Choose from selection'); + + selectgroup = container + .append('select') + .attr('class', 'dropdown') + .attr('id', 'selectlistMobile') + .on('change', onselect) + .selectAll("option") + .data(dvc.varlabels) + .enter() + .append('option') + .attr("value", function (d, i) { return i }) + .property("selected", function (d, i) { return i === dvc.varload; }) + .text(function (d, i) { return dvc.varlabels[i] }); } @@ -756,18 +764,12 @@ if(Modernizr.webgl) { var menuarea = d3.zip(areanames,areacodes).sort(function(a, b){ return d3.ascending(a[0], b[0]); }); // Build option menu for occupations - var container = d3.select("#selectNav").append("div").attr("id", "sel") - - var optns = container.append("select") + var optns = d3.select("#selectNav").append("div").attr("id", "sel") + .append("select") .attr("id", "areaselect") .attr("style", "width:calc(100% - 6px)") .attr("class", "chosen-select"); - container.append('label') - .attr('for', 'areaselect') - .attr('class', 'visuallyhidden') - .text('Select an area'); - optns.append("option") // .attr("value","first") // .text("");