From d3ac516bc3d2cb5b70da4f8ac9cd9b1c36c0f0a5 Mon Sep 17 00:00:00 2001 From: Nat Meysenburg Date: Fri, 4 Sep 2015 15:37:36 -0400 Subject: [PATCH 1/4] Remove call to googleapis that is repetative --- web/search.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/search.html b/web/search.html index dfff960..ffe3af1 100644 --- a/web/search.html +++ b/web/search.html @@ -176,8 +176,6 @@

Advanced Filters:

- - From 5420a1ed25f1d5b6a0d3c7fdc28872d9bf576d40 Mon Sep 17 00:00:00 2001 From: Nat Meysenburg Date: Fri, 4 Sep 2015 15:54:15 -0400 Subject: [PATCH 2/4] Remove unused calls to d3. --- web/search.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/web/search.html b/web/search.html index ffe3af1..b596204 100644 --- a/web/search.html +++ b/web/search.html @@ -132,10 +132,6 @@ - - - - @@ -177,7 +173,7 @@

Advanced Filters:

- + From f7ed2bf2189cffc84210d9e5116935d95cb3405e Mon Sep 17 00:00:00 2001 From: Nat Meysenburg Date: Fri, 4 Sep 2015 15:54:46 -0400 Subject: [PATCH 3/4] Remove unused word cloud. --- web/js/definitions.js | 73 ------------------------------------------- 1 file changed, 73 deletions(-) diff --git a/web/js/definitions.js b/web/js/definitions.js index ad2a907..cc5a1da 100644 --- a/web/js/definitions.js +++ b/web/js/definitions.js @@ -481,79 +481,6 @@ function buildDeepLink() { return link; } -// function wordCloud() { -// var words = loadTermsArray(); -// var fill = d3.scale.category20(); -// d3.layout.cloud().size([960, 400]) -// .words(words.map(function(d) { -// return {text: d, size: d.size}; -// })) -// .padding(3) -// .rotate(function() { return ~~(Math.random() * 2) * 90; }) -// .font("Impact") -// .fontSize(function(d) { return d.size; }) -// .on("end", draw) -// .start(); -// function draw(words) { -// d3.select("div#word-cloud").append("svg") -// .attr("width", 960) -// .attr("height", 400) -// .append("g") -// .attr("transform", "translate(150,150)") -// .selectAll("text") -// .data(words) -// .enter().append("text") -// .style("font-size", function(d) { return d.size + "px"; }) -// .style("font-family", "Impact") -// .style("fill", function(d, i) { return fill(i); }) -// .attr("text-anchor", "middle") -// .attr("transform", function(d) { -// return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; -// }) -// .text(function(d) { return d.text; }); -// } -// $('div#word-cloud text').click(function() { -// firequery($(this)[0].innerHTML, 'filters', 'all'); -// }); -// } - -// function map() { -// var width = 960, -// height = 500; - -// var projection = d3.geo.kavrayskiy7(), -// color = d3.scale.category20(), -// graticule = d3.geo.graticule(); - -// var path = d3.geo.path() -// .projection(projection); - -// var svg = d3.select("#map").append("svg") -// .attr("width", width) -// .attr("height", height); - -// svg.append("path") -// .datum(graticule) -// .attr("class", "graticule") -// .attr("d", path); - -// svg.append("path") -// .datum(graticule.outline) -// .attr("class", "graticule outline") -// .attr("d", path); - -// d3.json("map/world-50m.json", function(error, world) { -// var countries = topojson.feature(world, world.objects.countries).features; - - -// svg.selectAll(".country") -// .data(countries) -// .enter().insert("path", ".graticule") -// .attr("class", "country") -// .attr("d", path) -// // .style("fill", function(d, i) { return color(d.color = d3.max(neighbors[i], function(n) { return countries[n].color; }) + 1 | 0); }); -// }); -// } function definitionTabs() { $('ul#term-tabs').each(function(){ From 66a32e58925d03f060adb9c559bb76b0236c4ed8 Mon Sep 17 00:00:00 2001 From: Nat Meysenburg Date: Fri, 4 Sep 2015 17:01:50 -0400 Subject: [PATCH 4/4] Fix year sorting issue. --- web/js/definitions.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/js/definitions.js b/web/js/definitions.js index cc5a1da..cdaf68c 100644 --- a/web/js/definitions.js +++ b/web/js/definitions.js @@ -63,16 +63,16 @@ function loadYears() { for (i = 0; i < data.result.total; i++) { var year = data.result.records[i]; year = year['Year']; - if (year === 'No year given') { - var ckanyear = ''; - var year = year; + if (year === '.') { + var ckanyear = year; + var year = "No year given"; } else { var ckanyear = year; year = year.substring(0, year.length -2); } if (!(year in years)) { years[year] = ckanyear; } - } + } $('body').data('years', years); } }); @@ -86,13 +86,13 @@ function loadYearsArray() { $.each(years, function( k, v ) { out.push(k); }); - return out.sort(); + return out.sort(); } function buildYearSelect() { var ckanyears = loadYears(); var years = loadYearsArray(); var noyear = years.pop(); - var options = ''; + var options = ''; $.each(years, function(k, year) { options += ''; });