Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverted size and fixed broken y axis #4

Merged
merged 1 commit into from
Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions index2.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ <h1>Paperbuzz Visualizations</h1>
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,

Expand Down
10 changes: 5 additions & 5 deletions script5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand All @@ -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 + ")");


Expand Down Expand Up @@ -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);
Expand Down