Skip to content

Commit

Permalink
changed article
Browse files Browse the repository at this point in the history
  • Loading branch information
jalperin committed Mar 9, 2018
1 parent 1fad484 commit 7322e77
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions index2.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ <h1>Paperbuzz Visualizations</h1>

var paperbuzzviz = undefined;
var doi = '10.1371/journal.pmed.0020124';
var doi = '10.7287/peerj.preprints.3119v1';

var doi = '10.1007/s00266-017-0820-4';

var doi = '10.7287/peerj.preprints.3119v1';
d3.json('https://api.paperbuzz.org/v0/doi/' + doi, function(data) {
options.paperbuzzStatsJson = data
paperbuzzviz = new PaperbuzzViz(options);
Expand Down
21 changes: 15 additions & 6 deletions script5.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ function PaperbuzzViz(options) {

// TODO: Fix to use parseDate
// TODO: Fix to work when no pub date is available. Use earliest event
var year = data.metadata["published-online"]["date-parts"][0][0];
var month = data.metadata["published-online"]["date-parts"][0][1];
var day = data.metadata["published-online"]["date-parts"][0][2];
// var published_date = '2017-08-02'; // year+"-"+month+"-"+day;
var published_date = year+"-"+month+"-"+day;
// var year = data.metadata["published-online"]["date-parts"][0][0];
// var month = data.metadata["published-online"]["date-parts"][0][1];
// var day = data.metadata["published-online"]["date-parts"][0][2];
var published_date = '2017-08-02'; // year+"-"+month+"-"+day;
// var published_date = year+"-"+month+"-"+day;

// extract publication date
var pub_date = parseDate(published_date);
Expand Down Expand Up @@ -451,7 +451,16 @@ function PaperbuzzViz(options) {
var yAxis = d3.axisLeft(viz.y)
.tickValues([d3.max(viz.y.domain())]);

var xAxis = d3.axisBottom(viz.x);
var ticks;
if (level == 'day') {
ticks = d3.timeDay.every(4);
} else if (level == 'month') {
ticks = d3.timeMonth.every(2);
} else {
ticks = d3.timeYear.every(1)
}
var xAxis = d3.axisBottom(viz.x)
.ticks(ticks);

//
// The chart itself
Expand Down

0 comments on commit 7322e77

Please sign in to comment.