1. New icons for co-auth & co-pi vis links.

2. Changes the logic for language to be displayed along with different sparklines in different cases. Person Publication & Grant is done.
This commit is contained in:
cdtank 2011-01-25 18:00:59 +00:00
parent 30ebe3c7cd
commit 6469038bb5
14 changed files with 151 additions and 50 deletions

View file

@ -24,7 +24,7 @@ span.incomplete-data-holder,
}
.collaboratorship-link {
padding-top: 3px;
/*padding-top: 3px;*/
}
.collaboratorship-link a {
@ -32,7 +32,7 @@ span.incomplete-data-holder,
}
.collaboratorship-link h3 {
line-height: 1em;
line-height: 1em !important;
font-size: 1em !important;
margin-bottom: 0px !important;
padding-top: 0px !important;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -18,7 +18,7 @@
<div id="coauthorship_link_container" class="collaboratorship-link-container">
<div class="collaboratorship-icon">
<a href="${coAuthorURL}"><img src="${coAuthorIcon}" alt="Co-author Network icon" width="22px" height="23px" /></a>
<a href="${coAuthorURL}"><img src="${coAuthorIcon}" alt="Co-author Network icon" width="30px" height="30px" /></a>
</div>
<div class="collaboratorship-link">
<h3><a href="${coAuthorURL}">Co-Author Network</a></h3>
@ -27,7 +27,7 @@
<div id="coinvestigator_link_container" class="collaboratorship-link-container">
<div class="collaboratorship-icon">
<a href="${coInvestigatorURL}"><img src="${coInvestigatorIcon}" alt="Co-investigator Network icon" width="22px" height="23px" /></a>
<a href="${coInvestigatorURL}"><img src="${coInvestigatorIcon}" alt="Co-investigator Network icon" width="30px" height="30px" /></a>
</div>
<div class="collaboratorship-link">
<h3><a href="${coInvestigatorURL}">Co-Investigator Network</a></h3>

View file

@ -17,15 +17,21 @@
<script type="text/javascript">
function drawGrantCountVisualization(providedSparklineImgTD) {
var unknownYearGrantCounts = ${sparklineVO.unknownYearGrants};
var onlyUnknownYearGrants = false;
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn('number', 'Grants');
data.addRows(${sparklineVO.yearToEntityCountDataTable?size});
var knownYearGrantCounts = 0;
<#list sparklineVO.yearToEntityCountDataTable as yearToGrantCountDataElement>
data.setValue(${yearToGrantCountDataElement.yearToEntityCounter}, 0, '${yearToGrantCountDataElement.year}');
data.setValue(${yearToGrantCountDataElement.yearToEntityCounter}, 1, ${yearToGrantCountDataElement.currentEntitiesCount});
knownYearGrantCounts += ${yearToGrantCountDataElement.currentEntitiesCount};
</#list>
<#-- Create a view of the data containing only the column pertaining to grant count. -->
@ -54,6 +60,16 @@
chartType: 'ls',
chartLabel: 'r'
}
/*
This means that all the publications have unknown years & we do not need to display
the sparkline.
*/
if (unknownYearGrantCounts > 0 && knownYearGrantCounts < 1) {
onlyUnknownYearGrants = true;
} else {
/*
Test if we want to go for the approach when serving visualizations from a secure site..
@ -106,7 +122,11 @@
}
);
}
}
}
var totalGrantCount = knownYearGrantCounts + unknownYearGrantCounts;
<#if sparklineVO.shortVisMode>
@ -118,9 +138,26 @@
renderedShortSparks += data.getValue(value, 1);
});
$('#${sparklineContainerID} td.sparkline_number').text(parseInt(renderedShortSparks) + parseInt(${sparklineVO.unknownYearGrants})).css("font-weight", "bold").attr("class", "grey").append("<span style='color: #2485AE;'> grant(s) <br/></span>");
/*
In case that there are only unknown grants we want the text to mention these counts,
which would not be mentioned in the other case because the renderedShortSparks only hold counts
of grants which have any date associated with it.
*/
var totalGrants = onlyUnknownYearGrants ? unknownYearGrantCounts : renderedShortSparks;
if (totalGrants === 1) {
var grantDisplay = "grant";
} else {
var grantDisplay = "grants";
}
$('#${sparklineContainerID} td.sparkline_number').text(totalGrants).css("font-weight", "bold").attr("class", "grey").append("<span style='color: #2485AE;'> " + grantDisplay + " <br/></span>");
var sparksText = ' within the last 10 years';
if (totalGrants !== totalGrantCount) {
sparksText += ' (' + totalGrantCount + ' total)';
}
<#else>
@ -128,16 +165,38 @@
* Sparks that will be rendered will always be the one's which has
* any year associated with it. Hence.
* */
var renderedSparks = ${sparklineVO.renderedSparks};
$('#${sparklineContainerID} td.sparkline_number').text(parseInt(renderedSparks) + parseInt(${sparklineVO.unknownYearGrants})).css("font-weight", "bold").attr("class", "grey").append("<span style='color: #2485AE;'> grant(s) <br/></span>");
var renderedSparks = ${sparklineVO.renderedSparks};
/*
In case that there are only unknown grants we want the text to mention these counts,
which would not be mentioned in the other case because the renderedSparks only hold counts
of grants which have any date associated with it.
*/
var totalGrants = onlyUnknownYearGrants ? unknownYearGrantCounts : renderedSparks;
if (totalGrants === 1) {
var grantDisplay = "grant";
} else {
var grantDisplay = "grants";
}
$('#${sparklineContainerID} td.sparkline_number').text(totalGrants).css("font-weight", "bold").attr("class", "grey").append("<span style='color: #2485AE;'> " + grantDisplay + " <br/></span>");
var sparksText = ' from <span class="sparkline_range">${sparklineVO.earliestYearConsidered?c}'
+ ' to ${sparklineVO.latestRenderedGrantYear?c}</span> '
+ '<br /> <a href="${sparklineVO.downloadDataLink}" >(.CSV File)</a> ';
+ ' to ${sparklineVO.latestRenderedGrantYear?c}</span>';
if (totalGrants !== totalGrantCount) {
sparksText += ' (' + totalGrantCount + ' total)';
}
sparksText += '<br /> <a href="${sparklineVO.downloadDataLink}" >(.CSV File)</a> ';
</#if>
$('#${sparklineContainerID} td.sparkline_text').html(sparksText);
if (!onlyUnknownYearGrants) {
$('#${sparklineContainerID} td.sparkline_text').html(sparksText);
}
}
@ -180,16 +239,16 @@
sparklineImgTD.attr('class', 'sparkline_style');
row.append(sparklineImgTD);
var row2 = $('<tr>');
var row2 = $('<tr>');
var sparklineNumberTD = $('<td>');
sparklineNumberTD.attr('class', 'sparkline_number');
sparklineNumberTD.css('text-align', 'left');
sparklineNumberTD.css('text-align', 'left');
row2.append(sparklineNumberTD);
var row3 = $('<tr>');
var sparklineTextTD = $('<td>');
sparklineTextTD.attr('class', 'sparkline_text');
sparklineTextTD.css('text-align', 'left');
sparklineTextTD.css('text-align', 'left');
row3.append(sparklineTextTD);
table.append(row);
table.append(row2);
@ -211,18 +270,18 @@
<!-- For Full Sparkline - Print the Table of Grant Counts per Year -->
<#if displayTable?? && displayTable>
<p>
<#assign tableID = "grant_sparkline_data_table" />
<#assign tableCaption = "Grants per year " />
<#assign tableActivityColumnName = "Grants" />
<#assign tableContent = sparklineVO.yearToActivityCount />
<#assign fileDownloadLink = sparklineVO.downloadDataLink />
<#include "yearToActivityCountTable.ftl">
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
<br />
</p>
<p>
<#assign tableID = "grant_sparkline_data_table" />
<#assign tableCaption = "Grants per year " />
<#assign tableActivityColumnName = "Grants" />
<#assign tableContent = sparklineVO.yearToActivityCount />
<#assign fileDownloadLink = sparklineVO.downloadDataLink />
<#include "yearToActivityCountTable.ftl">
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
<br />
</p>
</#if>

View file

@ -18,20 +18,27 @@
function drawPubCountVisualization(providedSparklineImgTD) {
var unknownYearPublicationCounts = ${sparklineVO.unknownYearPublications};
var onlyUnknownYearPublications = false;
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn('number', 'Publications');
data.addRows(${sparklineVO.yearToEntityCountDataTable?size});
var knownYearPublicationCounts = 0;
<#list sparklineVO.yearToEntityCountDataTable as yearToPublicationCountDataElement>
data.setValue(${yearToPublicationCountDataElement.yearToEntityCounter}, 0, '${yearToPublicationCountDataElement.year}');
data.setValue(${yearToPublicationCountDataElement.yearToEntityCounter}, 1, ${yearToPublicationCountDataElement.currentEntitiesCount});
knownYearPublicationCounts += ${yearToPublicationCountDataElement.currentEntitiesCount};
</#list>
<#-- Create a view of the data containing only the column pertaining to publication count. -->
var sparklineDataView = new google.visualization.DataView(data);
sparklineDataView.setColumns([1]);
<#if sparklineVO.shortVisMode>
<#-- For the short view we only want the last 10 year's view of publication count, hence we filter
@ -55,6 +62,16 @@
chartType: 'ls',
chartLabel: 'r'
}
/*
This means that all the publications have unknown years & we do not need to display
the sparkline.
*/
if (unknownYearPublicationCounts > 0 && knownYearPublicationCounts < 1) {
onlyUnknownYearPublications = true;
} else {
/*
Test if we want to go for the approach when serving visualizations from a secure site..
@ -107,8 +124,11 @@
);
}
}
var totalPublicationCount = knownYearPublicationCounts + unknownYearPublicationCounts;
<#if sparklineVO.shortVisMode>
<#-- We want to display how many publication counts were considered, so this is used to calculate this. -->
@ -119,9 +139,14 @@
renderedShortSparks += data.getValue(value, 1);
});
var totalPubs = parseInt(renderedShortSparks) + parseInt(${sparklineVO.unknownYearPublications});
/*
In case that there are only unknown publications we want the text to mention these counts,
which would not be mentioned in the other case because the renderedShortSparks only hold counts
of publications which have any date associated with it.
*/
var totalPubs = onlyUnknownYearPublications ? unknownYearPublicationCounts : renderedShortSparks;
if ( totalPubs == 1 ) {
if (totalPubs === 1) {
var pubDisplay = "publication";
} else {
var pubDisplay = "publications";
@ -130,16 +155,26 @@
$('#${sparklineContainerID} td.sparkline_number').text(totalPubs).css("font-weight", "bold").attr("class", "grey").append("<span style='color: #2485AE;'> "+ pubDisplay +"<br/></span>");
var sparksText = ' within the last 10 years';
if (totalPubs !== totalPublicationCount) {
sparksText += ' (' + totalPublicationCount + ' total)';
}
<#else>
/*
* Sparks that will be rendered will always be the one's which has
* any year associated with it. Hence.
* */
var renderedSparks = ${sparklineVO.renderedSparks};
var totalPubs = parseInt(renderedSparks) + parseInt(${sparklineVO.unknownYearPublications});
var renderedSparks = ${sparklineVO.renderedSparks};
/*
In case that there are only unknown publications we want the text to mention these counts,
which would not be mentioned in the other case because the renderedSparks only hold counts
of publications which have any date associated with it.
*/
var totalPubs = onlyUnknownYearPublications ? unknownYearPublicationCounts : renderedSparks;
if ( totalPubs == 1 ) {
var pubDisplay = "publication";
} else {
@ -149,11 +184,18 @@
$('#${sparklineContainerID} td.sparkline_number').text(totalPubs).css("font-weight", "bold").attr("class", "grey").append("<span style='color: #2485AE;'> "+ pubDisplay +"<br/></span>");
var sparksText = ' from <span class="sparkline_range">${sparklineVO.earliestYearConsidered?c}'
+ ' to ${sparklineVO.latestRenderedPublicationYear?c}</span> '
+ ' <br /><a href="${sparklineVO.downloadDataLink}">(.CSV File)</a> ';
+ ' to ${sparklineVO.latestRenderedPublicationYear?c}</span>';
if (totalPubs !== totalPublicationCount) {
sparksText += ' (' + totalPublicationCount + ' total)';
}
sparksText += ' <br /><a href="${sparklineVO.downloadDataLink}">(.CSV File)</a> ';
</#if>
$('#${sparklineContainerID} td.sparkline_text').html(sparksText);
if (!onlyUnknownYearPublications) {
$('#${sparklineContainerID} td.sparkline_text').html(sparksText);
}
}
@ -196,10 +238,10 @@
sparklineImgTD.attr('class', 'sparkline_style');
row.append(sparklineImgTD);
var row2 = $('<tr>');
var row2 = $('<tr>');
var sparklineNumberTD = $('<td>');
sparklineNumberTD.attr('class', 'sparkline_number');
sparklineNumberTD.css('text-align', 'left');
sparklineNumberTD.css('text-align', 'left');
row2.append(sparklineNumberTD);
var row3 = $('<tr>');
@ -228,18 +270,18 @@
<#if displayTable?? && displayTable>
<p>
<#assign tableID = "publications_sparkline_data_table" />
<#assign tableCaption = "Publications per year " />
<#assign tableActivityColumnName = "Publications" />
<#assign tableContent = sparklineVO.yearToActivityCount />
<#assign fileDownloadLink = sparklineVO.downloadDataLink />
<#include "yearToActivityCountTable.ftl">
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
<br />
</p>
<p>
<#assign tableID = "publications_sparkline_data_table" />
<#assign tableCaption = "Publications per year " />
<#assign tableActivityColumnName = "Publications" />
<#assign tableContent = sparklineVO.yearToActivityCount />
<#assign fileDownloadLink = sparklineVO.downloadDataLink />
<#include "yearToActivityCountTable.ftl">
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
<br />
</p>
</#if>