From d88c818b678c7ac141e2e5d9b8a519765d2cb9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 1 Aug 2018 12:16:02 +0200 Subject: [PATCH] fix: CSS for country graph --- website/web/static/linegraph_country.css | 9 +++++++++ website/web/static/linegraph_country.js | 4 ++-- website/web/templates/country.html | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 website/web/static/linegraph_country.css diff --git a/website/web/static/linegraph_country.css b/website/web/static/linegraph_country.css new file mode 100644 index 0000000..adc95dc --- /dev/null +++ b/website/web/static/linegraph_country.css @@ -0,0 +1,9 @@ +.axis--x path { + display: none; +} + +.line { + fill: none; + stroke: steelblue; + stroke-width: 1.5px; +} diff --git a/website/web/static/linegraph_country.js b/website/web/static/linegraph_country.js index 7541058..fff4a32 100644 --- a/website/web/static/linegraph_country.js +++ b/website/web/static/linegraph_country.js @@ -12,14 +12,13 @@ function linegraph(call_path) { z = d3.scaleOrdinal(d3.schemeCategory10); var line = d3.line() - .curve(d3.curveBasis) + .curve(d3.curveLinear) .x(function(d) { return x(d.date); }) .y(function(d) { return y(d.rank); }); d3.json(call_path, {credentials: 'same-origin'}).then(function(data) { var country_ranks = d3.entries(data).map(function(country_rank) { - x.domain(d3.extent(country_rank.value, function(d) { return parseTime(d[0]); })); return { country: country_rank.key, values: d3.values(country_rank.value).map(function(d) { @@ -28,6 +27,7 @@ function linegraph(call_path) { }; }); + x.domain(d3.extent(country_ranks[0].values, function(d) { return d.date; })); y.domain([ d3.min(country_ranks, function(c) { return d3.min(c.values, function(d) { return d.rank; }); }), d3.max(country_ranks, function(c) { return d3.max(c.values, function(d) { return d.rank; }); }) diff --git a/website/web/templates/country.html b/website/web/templates/country.html index 1a72de0..069e422 100644 --- a/website/web/templates/country.html +++ b/website/web/templates/country.html @@ -2,6 +2,7 @@ {% block head %} {{ super() }} + {% endblock %}