From ccca0e21334190326a66205010dfcec294fa2d7c Mon Sep 17 00:00:00 2001 From: Juan Pablo Alperin Date: Tue, 13 Mar 2018 14:25:05 -0700 Subject: [PATCH] reverted size and fixed broken y axis --- index2.html | 10 +++++----- script5.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/index2.html b/index2.html index 7fd74e8..d1d751e 100755 --- a/index2.html +++ b/index2.html @@ -32,12 +32,12 @@

Paperbuzz Visualizations

var options = { baseUrl: 'http://pkp-alm.lib.sfu.ca', minItemsToShowGraph: { - minEventsForYearly: 6, - minEventsForMonthly: 6, - minEventsForDaily: 6, - minYearsForYearly: 4, + minEventsForYearly: 1, + minEventsForMonthly: 1, + minEventsForDaily: 1, + minYearsForYearly: 1, minMonthsForMonthly: 1, - minDaysForDaily: 5 + minDaysForDaily: 1 }, showTitle: true, diff --git a/script5.js b/script5.js index ab65fec..9909c02 100755 --- a/script5.js +++ b/script5.js @@ -32,7 +32,6 @@ function PaperbuzzViz(options) { var published_date = year+"-"+month+"-"+day; // var published_date = '2017-08-02'; // year+"-"+month+"-"+day; - // extract publication date var pub_date = parseDate(published_date); @@ -368,7 +367,7 @@ function PaperbuzzViz(options) { var viz = {}; // size parameters - viz.margin = {top: 20, right: 20, bottom: 20, left: 50}; + viz.margin = {top: 20, right: 20, bottom: 30, left: 50}; viz.width = 500 - viz.margin.left - viz.margin.right; viz.height = 200 - viz.margin.top - viz.margin.bottom; @@ -395,9 +394,8 @@ function PaperbuzzViz(options) { // the chart viz.svg = viz.chartDiv.append("svg") .attr("width", viz.width + viz.margin.left + viz.margin.right) - .attr("height", viz.height + viz.margin.top + viz.margin.bottom); - - viz.svg.append("g") + .attr("height", viz.height + viz.margin.top + viz.margin.bottom) + .append("g") .attr("transform", "translate(" + viz.margin.left + "," + viz.margin.top + ")"); @@ -456,6 +454,8 @@ function PaperbuzzViz(options) { var yAxis = d3.axisLeft(viz.y) .tickValues([d3.max(viz.y.domain())]); + // TODO: for month/year, change ticks to a more reasonable number + // when there are too many years var ticks; if (level == 'day') { ticks = d3.timeDay.every(4);