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 { .collaboratorship-link {
padding-top: 3px; /*padding-top: 3px;*/
} }
.collaboratorship-link a { .collaboratorship-link a {
@ -32,7 +32,7 @@ span.incomplete-data-holder,
} }
.collaboratorship-link h3 { .collaboratorship-link h3 {
line-height: 1em; line-height: 1em !important;
font-size: 1em !important; font-size: 1em !important;
margin-bottom: 0px !important; margin-bottom: 0px !important;
padding-top: 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 id="coauthorship_link_container" class="collaboratorship-link-container">
<div class="collaboratorship-icon"> <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>
<div class="collaboratorship-link"> <div class="collaboratorship-link">
<h3><a href="${coAuthorURL}">Co-Author Network</a></h3> <h3><a href="${coAuthorURL}">Co-Author Network</a></h3>
@ -27,7 +27,7 @@
<div id="coinvestigator_link_container" class="collaboratorship-link-container"> <div id="coinvestigator_link_container" class="collaboratorship-link-container">
<div class="collaboratorship-icon"> <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>
<div class="collaboratorship-link"> <div class="collaboratorship-link">
<h3><a href="${coInvestigatorURL}">Co-Investigator Network</a></h3> <h3><a href="${coInvestigatorURL}">Co-Investigator Network</a></h3>

View file

@ -17,15 +17,21 @@
<script type="text/javascript"> <script type="text/javascript">
function drawGrantCountVisualization(providedSparklineImgTD) { function drawGrantCountVisualization(providedSparklineImgTD) {
var unknownYearGrantCounts = ${sparklineVO.unknownYearGrants};
var onlyUnknownYearGrants = false;
var data = new google.visualization.DataTable(); var data = new google.visualization.DataTable();
data.addColumn('string', 'Year'); data.addColumn('string', 'Year');
data.addColumn('number', 'Grants'); data.addColumn('number', 'Grants');
data.addRows(${sparklineVO.yearToEntityCountDataTable?size}); data.addRows(${sparklineVO.yearToEntityCountDataTable?size});
var knownYearGrantCounts = 0;
<#list sparklineVO.yearToEntityCountDataTable as yearToGrantCountDataElement> <#list sparklineVO.yearToEntityCountDataTable as yearToGrantCountDataElement>
data.setValue(${yearToGrantCountDataElement.yearToEntityCounter}, 0, '${yearToGrantCountDataElement.year}'); data.setValue(${yearToGrantCountDataElement.yearToEntityCounter}, 0, '${yearToGrantCountDataElement.year}');
data.setValue(${yearToGrantCountDataElement.yearToEntityCounter}, 1, ${yearToGrantCountDataElement.currentEntitiesCount}); data.setValue(${yearToGrantCountDataElement.yearToEntityCounter}, 1, ${yearToGrantCountDataElement.currentEntitiesCount});
knownYearGrantCounts += ${yearToGrantCountDataElement.currentEntitiesCount};
</#list> </#list>
<#-- Create a view of the data containing only the column pertaining to grant count. --> <#-- Create a view of the data containing only the column pertaining to grant count. -->
@ -54,6 +60,16 @@
chartType: 'ls', chartType: 'ls',
chartLabel: 'r' 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.. 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> <#if sparklineVO.shortVisMode>
@ -118,9 +138,26 @@
renderedShortSparks += data.getValue(value, 1); 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'; var sparksText = ' within the last 10 years';
if (totalGrants !== totalGrantCount) {
sparksText += ' (' + totalGrantCount + ' total)';
}
<#else> <#else>
@ -128,16 +165,38 @@
* Sparks that will be rendered will always be the one's which has * Sparks that will be rendered will always be the one's which has
* any year associated with it. Hence. * any year associated with it. Hence.
* */ * */
var renderedSparks = ${sparklineVO.renderedSparks}; 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>");
/*
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}' var sparksText = ' from <span class="sparkline_range">${sparklineVO.earliestYearConsidered?c}'
+ ' to ${sparklineVO.latestRenderedGrantYear?c}</span> ' + ' to ${sparklineVO.latestRenderedGrantYear?c}</span>';
+ '<br /> <a href="${sparklineVO.downloadDataLink}" >(.CSV File)</a> ';
if (totalGrants !== totalGrantCount) {
sparksText += ' (' + totalGrantCount + ' total)';
}
sparksText += '<br /> <a href="${sparklineVO.downloadDataLink}" >(.CSV File)</a> ';
</#if> </#if>
$('#${sparklineContainerID} td.sparkline_text').html(sparksText); if (!onlyUnknownYearGrants) {
$('#${sparklineContainerID} td.sparkline_text').html(sparksText);
}
} }
@ -180,16 +239,16 @@
sparklineImgTD.attr('class', 'sparkline_style'); sparklineImgTD.attr('class', 'sparkline_style');
row.append(sparklineImgTD); row.append(sparklineImgTD);
var row2 = $('<tr>'); var row2 = $('<tr>');
var sparklineNumberTD = $('<td>'); var sparklineNumberTD = $('<td>');
sparklineNumberTD.attr('class', 'sparkline_number'); sparklineNumberTD.attr('class', 'sparkline_number');
sparklineNumberTD.css('text-align', 'left'); sparklineNumberTD.css('text-align', 'left');
row2.append(sparklineNumberTD); row2.append(sparklineNumberTD);
var row3 = $('<tr>'); var row3 = $('<tr>');
var sparklineTextTD = $('<td>'); var sparklineTextTD = $('<td>');
sparklineTextTD.attr('class', 'sparkline_text'); sparklineTextTD.attr('class', 'sparkline_text');
sparklineTextTD.css('text-align', 'left'); sparklineTextTD.css('text-align', 'left');
row3.append(sparklineTextTD); row3.append(sparklineTextTD);
table.append(row); table.append(row);
table.append(row2); table.append(row2);
@ -211,18 +270,18 @@
<!-- For Full Sparkline - Print the Table of Grant Counts per Year --> <!-- For Full Sparkline - Print the Table of Grant Counts per Year -->
<#if displayTable?? && displayTable> <#if displayTable?? && displayTable>
<p> <p>
<#assign tableID = "grant_sparkline_data_table" /> <#assign tableID = "grant_sparkline_data_table" />
<#assign tableCaption = "Grants per year " /> <#assign tableCaption = "Grants per year " />
<#assign tableActivityColumnName = "Grants" /> <#assign tableActivityColumnName = "Grants" />
<#assign tableContent = sparklineVO.yearToActivityCount /> <#assign tableContent = sparklineVO.yearToActivityCount />
<#assign fileDownloadLink = sparklineVO.downloadDataLink /> <#assign fileDownloadLink = sparklineVO.downloadDataLink />
<#include "yearToActivityCountTable.ftl"> <#include "yearToActivityCountTable.ftl">
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file. Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
<br /> <br />
</p> </p>
</#if> </#if>

View file

@ -18,20 +18,27 @@
function drawPubCountVisualization(providedSparklineImgTD) { function drawPubCountVisualization(providedSparklineImgTD) {
var unknownYearPublicationCounts = ${sparklineVO.unknownYearPublications};
var onlyUnknownYearPublications = false;
var data = new google.visualization.DataTable(); var data = new google.visualization.DataTable();
data.addColumn('string', 'Year'); data.addColumn('string', 'Year');
data.addColumn('number', 'Publications'); data.addColumn('number', 'Publications');
data.addRows(${sparklineVO.yearToEntityCountDataTable?size}); data.addRows(${sparklineVO.yearToEntityCountDataTable?size});
var knownYearPublicationCounts = 0;
<#list sparklineVO.yearToEntityCountDataTable as yearToPublicationCountDataElement> <#list sparklineVO.yearToEntityCountDataTable as yearToPublicationCountDataElement>
data.setValue(${yearToPublicationCountDataElement.yearToEntityCounter}, 0, '${yearToPublicationCountDataElement.year}'); data.setValue(${yearToPublicationCountDataElement.yearToEntityCounter}, 0, '${yearToPublicationCountDataElement.year}');
data.setValue(${yearToPublicationCountDataElement.yearToEntityCounter}, 1, ${yearToPublicationCountDataElement.currentEntitiesCount}); data.setValue(${yearToPublicationCountDataElement.yearToEntityCounter}, 1, ${yearToPublicationCountDataElement.currentEntitiesCount});
knownYearPublicationCounts += ${yearToPublicationCountDataElement.currentEntitiesCount};
</#list> </#list>
<#-- Create a view of the data containing only the column pertaining to publication count. --> <#-- Create a view of the data containing only the column pertaining to publication count. -->
var sparklineDataView = new google.visualization.DataView(data); var sparklineDataView = new google.visualization.DataView(data);
sparklineDataView.setColumns([1]); sparklineDataView.setColumns([1]);
<#if sparklineVO.shortVisMode> <#if sparklineVO.shortVisMode>
<#-- For the short view we only want the last 10 year's view of publication count, hence we filter <#-- 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', chartType: 'ls',
chartLabel: 'r' 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.. 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> <#if sparklineVO.shortVisMode>
<#-- We want to display how many publication counts were considered, so this is used to calculate this. --> <#-- 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); 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"; var pubDisplay = "publication";
} else { } else {
var pubDisplay = "publications"; 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>"); $('#${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'; var sparksText = ' within the last 10 years';
if (totalPubs !== totalPublicationCount) {
sparksText += ' (' + totalPublicationCount + ' total)';
}
<#else> <#else>
/* /*
* Sparks that will be rendered will always be the one's which has * Sparks that will be rendered will always be the one's which has
* any year associated with it. Hence. * any year associated with it. Hence.
* */ * */
var renderedSparks = ${sparklineVO.renderedSparks}; var renderedSparks = ${sparklineVO.renderedSparks};
var totalPubs = parseInt(renderedSparks) + 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 renderedSparks only hold counts
of publications which have any date associated with it.
*/
var totalPubs = onlyUnknownYearPublications ? unknownYearPublicationCounts : renderedSparks;
if ( totalPubs == 1 ) { if ( totalPubs == 1 ) {
var pubDisplay = "publication"; var pubDisplay = "publication";
} else { } 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>"); $('#${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}' var sparksText = ' from <span class="sparkline_range">${sparklineVO.earliestYearConsidered?c}'
+ ' to ${sparklineVO.latestRenderedPublicationYear?c}</span> ' + ' to ${sparklineVO.latestRenderedPublicationYear?c}</span>';
+ ' <br /><a href="${sparklineVO.downloadDataLink}">(.CSV File)</a> ';
if (totalPubs !== totalPublicationCount) {
sparksText += ' (' + totalPublicationCount + ' total)';
}
sparksText += ' <br /><a href="${sparklineVO.downloadDataLink}">(.CSV File)</a> ';
</#if> </#if>
$('#${sparklineContainerID} td.sparkline_text').html(sparksText); if (!onlyUnknownYearPublications) {
$('#${sparklineContainerID} td.sparkline_text').html(sparksText);
}
} }
@ -196,10 +238,10 @@
sparklineImgTD.attr('class', 'sparkline_style'); sparklineImgTD.attr('class', 'sparkline_style');
row.append(sparklineImgTD); row.append(sparklineImgTD);
var row2 = $('<tr>'); var row2 = $('<tr>');
var sparklineNumberTD = $('<td>'); var sparklineNumberTD = $('<td>');
sparklineNumberTD.attr('class', 'sparkline_number'); sparklineNumberTD.attr('class', 'sparkline_number');
sparklineNumberTD.css('text-align', 'left'); sparklineNumberTD.css('text-align', 'left');
row2.append(sparklineNumberTD); row2.append(sparklineNumberTD);
var row3 = $('<tr>'); var row3 = $('<tr>');
@ -228,18 +270,18 @@
<#if displayTable?? && displayTable> <#if displayTable?? && displayTable>
<p> <p>
<#assign tableID = "publications_sparkline_data_table" /> <#assign tableID = "publications_sparkline_data_table" />
<#assign tableCaption = "Publications per year " /> <#assign tableCaption = "Publications per year " />
<#assign tableActivityColumnName = "Publications" /> <#assign tableActivityColumnName = "Publications" />
<#assign tableContent = sparklineVO.yearToActivityCount /> <#assign tableContent = sparklineVO.yearToActivityCount />
<#assign fileDownloadLink = sparklineVO.downloadDataLink /> <#assign fileDownloadLink = sparklineVO.downloadDataLink />
<#include "yearToActivityCountTable.ftl"> <#include "yearToActivityCountTable.ftl">
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file. Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
<br /> <br />
</p> </p>
</#if> </#if>