Skip to content

Commit

Permalink
Merge pull request #75 from vitorfs/dev
Browse files Browse the repository at this point in the history
Release v2.0.3
  • Loading branch information
vitorfs authored Sep 8, 2021
2 parents 0b83620 + 3c71f18 commit 6d98e63
Show file tree
Hide file tree
Showing 11 changed files with 334 additions and 316 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Parsifal 2.0.3 (2021-09-08)
===========================

Bugfixes
--------

- Fix data analysis load state for charts (#69)
- Fix keyboard arrow navigation on study selection page. (#71)
- Fix search scopus results rendering when there is no data. (#73)
2 changes: 1 addition & 1 deletion parsifal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from parsifal.utils.version import get_version

VERSION = (2, 0, 2, "final", 0)
VERSION = (2, 0, 3, "final", 0)

__version__ = get_version(VERSION)
166 changes: 84 additions & 82 deletions parsifal/apps/reviews/conducting/static/js/conducting_data_analysis.js
Original file line number Diff line number Diff line change
@@ -1,90 +1,92 @@
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(drawChartCallback);
$(function () {
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(drawChartCallback);

function drawChartCallback() {
drawChart();
drawYearLines();
}

function drawPieChart(rows) {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Source');
data.addColumn('number', 'Number of Aticles');
data.addRows(rows);
var options = {'height': 400};
var chart = new google.visualization.PieChart(document.getElementById('articles-selection-pie'));
chart.draw(data, options);
}

function drawColumnChart(rows) {
var data = google.visualization.arrayToDataTable(rows);
var options = {
vAxis: {title: 'Number of Articles', titleTextStyle: {color: '#3A3D40'}},
'height': 400
};
var chart = new google.visualization.ColumnChart(document.getElementById('articles-selection-column'));
chart.draw(data, options);
}
function drawChartCallback() {
drawChart();
drawYearLines();
}

function drawLineChart(rows) {
var data = google.visualization.arrayToDataTable(rows);
var options = {
vAxis: {title: 'Number of Articles', titleTextStyle: {color: '#3A3D40'}},
'height': 400
};
var chart = new google.visualization.LineChart(document.getElementById('articles-selection-line'));
chart.draw(data, options);
}
function drawPieChart(rows) {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Source');
data.addColumn('number', 'Number of Articles');
data.addRows(rows);
var options = {'height': 400};
var chart = new google.visualization.PieChart(document.getElementById('articles-selection-pie'));
chart.draw(data, options);
}

function drawChart() {
$.ajax({
url: '/reviews/conducting/articles_selection_chart/',
data: {'review-id': $("#review-id").val()},
type: 'get',
cache: false,
beforeSend: function () {
$("#articles-selection-pie").spinner(false);
$("#articles-selection-column").spinner(false);
},
success: function (data) {
var source_data = data.split(",");
var rows_pie = [];
var rows_chart = [['Source', 'Selected', 'Accepted']];
for (var i = source_data.length - 1; i >= 0; i--) {
row = source_data[i].split(":");
rows_pie.push([row[0], parseInt(row[1])]);
rows_chart.push([row[0], parseInt(row[1]), parseInt(row[2])]);
function drawColumnChart(rows) {
var data = google.visualization.arrayToDataTable(rows);
var options = {
vAxis: {title: 'Number of Articles', titleTextStyle: {color: '#3A3D40'}},
'height': 400
};
drawPieChart(rows_pie);
drawColumnChart(rows_chart);
},
complete: function () {
$("#articles-selection-pie").spinner();
$("#articles-selection-column").spinner();
var chart = new google.visualization.ColumnChart(document.getElementById('articles-selection-column'));
chart.draw(data, options);
}
});
}

function drawYearLines() {
$.ajax({
url: '/reviews/conducting/articles_per_year/',
data: {'review-id': $("#review-id").val()},
type: 'get',
cache: false,
beforeSend: function () {
$("#articles-selection-line").spinner(false);
},
success: function (data) {
var source_data = data.split(",");
var rows = [['Year', 'Number of Articles']];
for (var i = source_data.length - 1; i >= 0; i--) {
row = source_data[i].split(":");
rows.push([row[0], parseInt(row[1])]);
function drawLineChart(rows) {
var data = google.visualization.arrayToDataTable(rows);
var options = {
vAxis: {title: 'Number of Articles', titleTextStyle: {color: '#3A3D40'}},
'height': 400
};
drawLineChart(rows);
},
complete: function () {
$("#articles-selection-line").spinner();
var chart = new google.visualization.LineChart(document.getElementById('articles-selection-line'));
chart.draw(data, options);
}

function drawChart() {
$.ajax({
url: '/reviews/conducting/articles_selection_chart/',
data: {'review-id': $("#review-id").val()},
type: 'get',
cache: false,
beforeSend: function () {
$("#articles-selection-pie").spinner(false);
$("#articles-selection-column").spinner(false);
},
success: function (data) {
var source_data = data.split(",");
var rows_pie = [];
var rows_chart = [['Source', 'Selected', 'Accepted']];
for (var i = source_data.length - 1; i >= 0; i--) {
row = source_data[i].split(":");
rows_pie.push([row[0], parseInt(row[1])]);
rows_chart.push([row[0], parseInt(row[1]), parseInt(row[2])]);
}
drawPieChart(rows_pie);
drawColumnChart(rows_chart);
},
complete: function () {
$("#articles-selection-pie").spinner();
$("#articles-selection-column").spinner();
}
});
}

function drawYearLines() {
$.ajax({
url: '/reviews/conducting/articles_per_year/',
data: {'review-id': $("#review-id").val()},
type: 'get',
cache: false,
beforeSend: function () {
$("#articles-selection-line").spinner(false);
},
success: function (data) {
var source_data = data.split(",");
var rows = [['Year', 'Number of Articles']];
for (var i = source_data.length - 1; i >= 0; i--) {
row = source_data[i].split(":");
rows.push([row[0], parseInt(row[1])]);
}
drawLineChart(rows);
},
complete: function () {
$("#articles-selection-line").spinner();
}
});
}
});
}
});
Loading

0 comments on commit 6d98e63

Please sign in to comment.