1)Committing ftls for persongrantcount and co-pi.
2)Modified {standalone,dynamic} activator for coauthor, personpubcount,persongrantcount and copi. -- fixed the path 3)Modified persongrantcountrequesthandler -- fixed the path
This commit is contained in:
parent
3730aecb6f
commit
af69cb0c51
12 changed files with 427 additions and 247 deletions
|
@ -1,5 +1,5 @@
|
||||||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
<#if shouldVIVOrenderVis>
|
<#if shouldVIVOrenderVis>
|
||||||
<#include "/visualization/coauthorship/coAuthorshipSparklineContent.ftl">
|
<#include "coAuthorshipSparklineContent.ftl">
|
||||||
</#if>
|
</#if>
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
|
|
||||||
${headScripts.add(googleJSAPI)}
|
${headScripts.add(googleJSAPI)}
|
||||||
|
|
||||||
<#include "/visualization/coauthorship/coAuthorshipSparklineContent.ftl">
|
<#include "coAuthorshipSparklineContent.ftl">
|
|
@ -1,241 +0,0 @@
|
||||||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
|
||||||
|
|
||||||
<#assign visImageContextPath = "${urls.images}/visualization/" >
|
|
||||||
<#assign loadingImageLink = "${visImageContextPath}ajax-loader.gif">
|
|
||||||
|
|
||||||
<#assign egoVivoProfileURL = "${urls.base}/individual?uri=${egoURI}">
|
|
||||||
|
|
||||||
<#assign egoSparklineDataURL = '${urls.base}${dataVisualizationURLRoot}?vis=person_grant_count&uri=${egoURI}&labelField=label'>
|
|
||||||
<#assign coInvestigationDownloadFile = '${urls.base}${dataVisualizationURLRoot}?vis=person_level&uri=${egoURI}&labelField=label'>
|
|
||||||
|
|
||||||
<div id="body">
|
|
||||||
|
|
||||||
|
|
||||||
<#--
|
|
||||||
|
|
||||||
Support for this has ended. Only created for the VIVO Conf Demo.
|
|
||||||
|
|
||||||
<style type="text/css">
|
|
||||||
|
|
||||||
#profileImage img{
|
|
||||||
width: 90px;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#body h1 {
|
|
||||||
margin:0.0em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sparkline_wrapper_table {
|
|
||||||
display: inline;
|
|
||||||
vertical-align: bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
.investigator_name {
|
|
||||||
color: #13968c;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.neutral_investigator_name {
|
|
||||||
color: black;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.investigator_moniker {
|
|
||||||
color: #9C9C9C;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sub_headings {
|
|
||||||
color: #121b3c;
|
|
||||||
padding-top: 10px;
|
|
||||||
margin-bottom: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sub_headings a {
|
|
||||||
font-size:0.7em;
|
|
||||||
font-weight:normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.sparkline_wrapper_table td, th {
|
|
||||||
vertical-align: bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inline_href {
|
|
||||||
}
|
|
||||||
|
|
||||||
#ego_profile {
|
|
||||||
padding-left:10px;
|
|
||||||
padding-top:10px;
|
|
||||||
min-height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ego_label {
|
|
||||||
font-size:1.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ego_profile_image {
|
|
||||||
float:left;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ego_profile_image img{
|
|
||||||
width: 90px;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ego_sparkline {
|
|
||||||
cursor:pointer;
|
|
||||||
height:36px;
|
|
||||||
width:471px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#coinvestigations_table th {
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if IE]>
|
|
||||||
<style type="text/css">
|
|
||||||
|
|
||||||
#${egoGrantSparklineContainerID},
|
|
||||||
#${uniqueCoPIsSparklineVisContainerID} {
|
|
||||||
padding-bottom:15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ego_label {
|
|
||||||
margin-left:-3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
<div id="ego_profile">
|
|
||||||
|
|
||||||
|
|
||||||
<%-- Image --%>
|
|
||||||
<div id="ego_profile_image" class="thumbnail"></div>
|
|
||||||
|
|
||||||
<%-- Label --%>
|
|
||||||
<a href="${egoVivoProfileURL}"><h1><span id="ego_label" class="investigator_name"></span></h1></a>
|
|
||||||
|
|
||||||
<%-- Moniker--%>
|
|
||||||
<span id="ego_moniker" class="investigator_moniker"></span>
|
|
||||||
|
|
||||||
|
|
||||||
<div style="clear:both;"></div>
|
|
||||||
|
|
||||||
<c:choose>
|
|
||||||
<c:when test='${numOfInvestigators > 0}'>
|
|
||||||
|
|
||||||
<div id="incomplete-data">This information is based solely on grants which have been loaded into the VIVO system.
|
|
||||||
This may only be a small sample of the person's total work. </div>
|
|
||||||
|
|
||||||
<h2 class="sub_headings">Co-Investigator Network
|
|
||||||
<c:choose>
|
|
||||||
<c:when test="${numOfCoInvestigations > 0 || numOfInvestigators > 0}">
|
|
||||||
<a href="${coInvestigationDownloadFile}">(GraphML File)</a></h2>
|
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<c:if test='${numOfInvestigators > 0}'>
|
|
||||||
<c:set var='investigatorsText' value='multi-investigator' />
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
<span id="no_coinvestigations">Currently there are no ${investigatorsText} grants for
|
|
||||||
<a href="${egoVivoProfileURL}"><span id="no_coinvestigations_person" class="investigator_name">this investigator</span></a> in the VIVO database.</span>
|
|
||||||
</c:otherwise>
|
|
||||||
</c:choose>
|
|
||||||
|
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<span id="no_coinvestigations">Currently there are no grants for <a href="${egoVivoProfileURL}"><span id="no_coinvestigations_person" class="investigator_name">
|
|
||||||
this investigator</span></a> in the VIVO database.</span>
|
|
||||||
</c:otherwise>
|
|
||||||
</c:choose>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<c:if test='${numOfCoInvestigations > 0 || numOfInvestigators > 0}'>
|
|
||||||
|
|
||||||
<div id="bodyPannel">
|
|
||||||
|
|
||||||
<div id="visPanel" style="float: left; width: 600px;">
|
|
||||||
<script language="JavaScript" type="text/javascript">
|
|
||||||
<!--
|
|
||||||
renderCoInvestigationVisualization();
|
|
||||||
//-->
|
|
||||||
</script>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="dataPanel">
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
<br />
|
|
||||||
<div id="profileImage" class="thumbnail"></div>
|
|
||||||
|
|
||||||
<div class="bold"><strong><span id="investigatorName" class="neutral_investigator_name"> </span></strong></div>
|
|
||||||
|
|
||||||
<div class="italicize"><span id="profileMoniker" class="investigator_moniker"></span></div>
|
|
||||||
<div><a href="#" id="profileUrl">VIVO profile</a> | <a href="#" id="coInvestigationVisUrl">Co-Investigator network</a></div>
|
|
||||||
<br />
|
|
||||||
<div class="investigator_stats" id="num_works"><span class="numbers" style="width: 40px;" id="works"></span> <span class="investigator_stats_text">Grant(s)</span></div>
|
|
||||||
<div class="investigator_stats" id="num_investigators"><span class="numbers" style="width: 40px;" id="coInvestigators"></span> <span class="investigator_stats_text">Co-Investigator(s)</span></div>
|
|
||||||
|
|
||||||
<div class="investigator_stats" id="fGrant" style="visibility:hidden"><span class="numbers" style="width:40px;" id="firstGrant"></span> <span>First Grant</span></div>
|
|
||||||
<div class="investigator_stats" id="lGrant" style="visibility:hidden"><span class="numbers" style="width:40px;" id="lastGrant"></span> <span>Last Grant</span></div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
|
|
||||||
<c:if test='${numOfCoInvestigations > 0}'>
|
|
||||||
|
|
||||||
<div class="vis_stats">
|
|
||||||
|
|
||||||
<h2 class="sub_headings">Table</h2>
|
|
||||||
|
|
||||||
<c:if test='${numOfCoInvestigations > 0}'>
|
|
||||||
|
|
||||||
<div class="vis-tables">
|
|
||||||
<p id="coinve_table_container" class="datatable"></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
<div style="clear:both;"></div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script language="JavaScript" type="text/javascript">
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
<c:if test='${numOfCoInvestigations > 0}'>
|
|
||||||
$("#coinve_table_container").empty().html('<img id="loadingData" with="auto" src="${loadingImageLink}" />');
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
processProfileInformation("ego_label",
|
|
||||||
"ego_moniker",
|
|
||||||
"ego_profile_image",
|
|
||||||
jQuery.parseJSON(getWellFormedURLs("${requestScope.egoURIParam}", "profile_info")));
|
|
||||||
|
|
||||||
<c:if test='${empty numOfCoInvestigations || empty numOfInvestigators}'>
|
|
||||||
|
|
||||||
if ($('#ego_label').text().length > 0) {
|
|
||||||
setProfileName('no_coinvestigations_person', $('#ego_label').text());
|
|
||||||
}
|
|
||||||
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
-->
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
|
<#if shouldVIVOrenderVis>
|
||||||
|
<#include "coInvestigationSparklineContent.ftl">
|
||||||
|
</#if>
|
|
@ -0,0 +1,197 @@
|
||||||
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
<#assign visContainerID = '${sparklineVO.visContainerDivID}'>
|
||||||
|
|
||||||
|
<#if sparklineVO.shortVisMode>
|
||||||
|
<#assign sparklineContainerID = 'unique_coinvestigators_short_sparkline_vis'>
|
||||||
|
<#else>
|
||||||
|
<#assign sparklineContainerID = 'unique_coinvestigators_full_sparkline_vis'>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#-- This is used to prevent collision between sparkline & visualization conatiner div ids. -->
|
||||||
|
<#if visContainerID?upper_case == sparklineContainerID?upper_case>
|
||||||
|
<#assign sparklineContainerID = visContainerID + "_spark">
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<div class="staticPageBackground">
|
||||||
|
<div id="${visContainerID}">
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function drawCoInvestigatorsSparklineVisualization(providedSparklineImgTD) {
|
||||||
|
|
||||||
|
var data = new google.visualization.DataTable();
|
||||||
|
data.addColumn('string', 'Year');
|
||||||
|
data.addColumn('number', 'Unique co-investigators');
|
||||||
|
data.addRows(${sparklineVO.numOfYearsToBeRendered});
|
||||||
|
|
||||||
|
<#list sparklineVO.yearToEntityCountDataTable as yearToUniqueCoinvestigatorsDataElement>
|
||||||
|
data.setValue(${yearToUniqueCoinvestigatorsDataElement.yearToEntityCounter}, 0, '${yearToUniqueCoinvestigatorsDataElement.year}');
|
||||||
|
data.setValue(${yearToUniqueCoinvestigatorsDataElement.yearToEntityCounter}, 1, ${yearToUniqueCoinvestigatorsDataElement.currentEntitiesCount});
|
||||||
|
</#list>
|
||||||
|
|
||||||
|
<#-- Create a view of the data containing only the column pertaining to coinvestigators 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 coinvestigators count, hence we filter
|
||||||
|
the data we actually want to use for render. -->
|
||||||
|
|
||||||
|
sparklineDataView.setRows(data.getFilteredRows([{
|
||||||
|
column: 0,
|
||||||
|
minValue: '${sparklineVO.earliestRenderedGrantYear?c}',
|
||||||
|
maxValue: '${sparklineVO.latestRenderedGrantYear?c}'
|
||||||
|
}]));
|
||||||
|
|
||||||
|
<#else>
|
||||||
|
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#-- Create the vis object and draw it in the div pertaining to sparkline. -->
|
||||||
|
var sparkline = new google.visualization.ImageSparkLine(providedSparklineImgTD[0]);
|
||||||
|
sparkline.draw(sparklineDataView, {
|
||||||
|
width: 65,
|
||||||
|
height: 30,
|
||||||
|
showAxisLines: false,
|
||||||
|
showValueLabels: false,
|
||||||
|
labelPosition: 'none'
|
||||||
|
});
|
||||||
|
|
||||||
|
<#if sparklineVO.shortVisMode>
|
||||||
|
|
||||||
|
<#-- We want to display how many coinvestigators were considered, so this is used to calculate this. -->
|
||||||
|
|
||||||
|
var shortSparkRows = sparklineDataView.getViewRows();
|
||||||
|
var renderedShortSparks = 0;
|
||||||
|
$.each(shortSparkRows, function(index, value) {
|
||||||
|
renderedShortSparks += data.getValue(value, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#${sparklineContainerID} td.sparkline_number').text(parseInt(renderedShortSparks) + parseInt(${sparklineVO.unknownYearGrants}));
|
||||||
|
|
||||||
|
var sparksText = ' co-investigator(s) within the last 10 years <span class="incomplete-data-holder" title="This information'
|
||||||
|
+ ' is based solely on grants which have been loaded into the VIVO system. This may only be a small'
|
||||||
|
+ ' sample of the person\'s total work.">incomplete list</span>';
|
||||||
|
|
||||||
|
<#else>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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}));
|
||||||
|
|
||||||
|
var sparksText = ' co-investigator(s) from <span class="sparkline_range">${sparklineVO.earliestYearConsidered?c}'
|
||||||
|
+ ' to ${sparklineVO.latestRenderedGrantYear?c}</span> '
|
||||||
|
+ ' <a href="${sparklineVO.downloadDataLink}" class="inline_href">(.CSV File)</a> ';
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
$('#${sparklineContainerID} td.sparkline_text').html(sparksText);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This will activate the visualization. It takes care of creating
|
||||||
|
* div elements to hold the actual sparkline image and then calling the
|
||||||
|
* drawCoInvestigatorsSparklineVisualization function.
|
||||||
|
* */
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
var sparklineImgTD;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is a nuclear option (creating the container in which everything goes)
|
||||||
|
* the only reason this will be ever used is the API user never submitted a
|
||||||
|
* container ID in which everything goes. The alternative was to let the
|
||||||
|
* vis not appear in the calling page at all. So now atleast vis appears but
|
||||||
|
* appended at the bottom of the body.
|
||||||
|
* */
|
||||||
|
|
||||||
|
if ($('#${visContainerID}').length === 0) {
|
||||||
|
$('<div/>', {
|
||||||
|
'id': '${visContainerID}'
|
||||||
|
}).appendTo('body');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($('#${sparklineContainerID}').length === 0) {
|
||||||
|
|
||||||
|
$('<div/>', {
|
||||||
|
'id': '${sparklineContainerID}',
|
||||||
|
'class': 'sparkline_style'
|
||||||
|
}).prependTo('#${visContainerID}');
|
||||||
|
|
||||||
|
var table = $('<table>');
|
||||||
|
table.attr('class', 'sparkline_wrapper_table');
|
||||||
|
var row = $('<tr>');
|
||||||
|
sparklineImgTD = $('<td>');
|
||||||
|
sparklineImgTD.attr('id', '${sparklineContainerID}_img');
|
||||||
|
sparklineImgTD.attr('width', '65');
|
||||||
|
sparklineImgTD.attr('align', 'right');
|
||||||
|
sparklineImgTD.attr('class', 'sparkline_style');
|
||||||
|
|
||||||
|
row.append(sparklineImgTD);
|
||||||
|
|
||||||
|
var sparklineNumberTD = $('<td>');
|
||||||
|
sparklineNumberTD.attr('width', '30');
|
||||||
|
sparklineNumberTD.attr('align', 'right');
|
||||||
|
sparklineNumberTD.attr('class', 'sparkline_number');
|
||||||
|
row.append(sparklineNumberTD);
|
||||||
|
var sparklineTextTD = $('<td>');
|
||||||
|
sparklineTextTD.attr('width', '450');
|
||||||
|
sparklineTextTD.attr('class', 'sparkline_text');
|
||||||
|
row.append(sparklineTextTD);
|
||||||
|
table.append(row);
|
||||||
|
table.prependTo('#${sparklineContainerID}');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
drawCoInvestigatorsSparklineVisualization(sparklineImgTD);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</div><!-- Sparkline Viz -->
|
||||||
|
|
||||||
|
<#if sparklineVO.shortVisMode>
|
||||||
|
<#--<span class="vis_link">-->
|
||||||
|
<p><a class="all-vivo-grants" href="${sparklineVO.fullTimelineNetworkLink}">View full timeline and co-investigator network.</a></p>
|
||||||
|
<#--</span>-->
|
||||||
|
<#else>
|
||||||
|
<!-- For Full Sparkline - Print the Table of CoInvestigator Counts per Year -->
|
||||||
|
<p>
|
||||||
|
<table id='sparkline_data_table'>
|
||||||
|
<caption>
|
||||||
|
Unique Co-Investigators per year <a href="${sparklineVO.downloadDataLink}">(.CSV File)</a>
|
||||||
|
</caption>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Year
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Count
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<#list sparklineVO.yearToActivityCount?keys as year>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
${year}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
${sparklineVO.yearToActivityCount[year]}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</#list>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
|
||||||
|
<br />
|
||||||
|
</p>
|
||||||
|
</#if>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
|
<#assign googleJSAPI = 'http://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22areachart%22%2C%22imagesparkline%22%5D%7D%5D%7D'>
|
||||||
|
|
||||||
|
${headScripts.add(googleJSAPI)}
|
||||||
|
|
||||||
|
<#include "coInvestigationSparklineContent.ftl">
|
|
@ -0,0 +1,5 @@
|
||||||
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
|
<#if shouldVIVOrenderVis>
|
||||||
|
<#include "personGrantSparklineContent.ftl">
|
||||||
|
</#if>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
|
<#assign googleJSAPI = 'http://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22areachart%22%2C%22imagesparkline%22%5D%7D%5D%7D'>
|
||||||
|
|
||||||
|
${headScripts.add(googleJSAPI)}
|
||||||
|
|
||||||
|
<#include "personGrantSparklineContent.ftl">
|
|
@ -0,0 +1,200 @@
|
||||||
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
<#assign visContainerID = '${sparklineVO.visContainerDivID}'>
|
||||||
|
|
||||||
|
<#if sparklineVO.shortVisMode>
|
||||||
|
<#assign sparklineContainerID = 'grant_count_short_sparkline_vis'>
|
||||||
|
<#else>
|
||||||
|
<#assign sparklineContainerID = 'grant_count_full_sparkline_vis'>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#-- This is used to prevent collision between sparkline & visualization conatiner div ids. -->
|
||||||
|
<#if visContainerID?upper_case == sparklineContainerID?upper_case>
|
||||||
|
<#assign sparklineContainerID = visContainerID + "_spark">
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<div class="staticPageBackground">
|
||||||
|
<div id="${visContainerID}">
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function drawGrantCountVisualization(providedSparklineImgTD) {
|
||||||
|
|
||||||
|
var data = new google.visualization.DataTable();
|
||||||
|
data.addColumn('string', 'Year');
|
||||||
|
data.addColumn('number', 'Grants');
|
||||||
|
data.addRows(${sparklineVO.numOfYearsToBeRendered});
|
||||||
|
|
||||||
|
<#list sparklineVO.yearToEntityCountDataTable as yearToGrantCountDataElement>
|
||||||
|
data.setValue(${yearToGrantCountDataElement.yearToEntityCounter}, 0, '${yearToGrantCountDataElement.year}');
|
||||||
|
data.setValue(${yearToGrantCountDataElement.yearToEntityCounter}, 1, ${yearToGrantCountDataElement.currentEntitiesCount});
|
||||||
|
</#list>
|
||||||
|
|
||||||
|
<#-- Create a view of the data containing only the column pertaining to grant 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 grant count, hence we filter
|
||||||
|
the data we actually want to use for render. -->
|
||||||
|
|
||||||
|
sparklineDataView.setRows(data.getFilteredRows([{
|
||||||
|
column: 0,
|
||||||
|
minValue: '${sparklineVO.earliestRenderedGrantYear?c}',
|
||||||
|
maxValue: '${sparklineVO.latestRenderedGrantYear?c}'
|
||||||
|
/*minValue: '2001',
|
||||||
|
maxValue: '2011'*/
|
||||||
|
}]));
|
||||||
|
|
||||||
|
<#else>
|
||||||
|
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#-- Create the vis object and draw it in the div pertaining to sparkline. -->
|
||||||
|
var sparkline = new google.visualization.ImageSparkLine(providedSparklineImgTD[0]);
|
||||||
|
sparkline.draw(sparklineDataView, {
|
||||||
|
width: 65,
|
||||||
|
height: 30,
|
||||||
|
showAxisLines: false,
|
||||||
|
showValueLabels: false,
|
||||||
|
labelPosition: 'none'
|
||||||
|
});
|
||||||
|
|
||||||
|
<#if sparklineVO.shortVisMode>
|
||||||
|
|
||||||
|
<#-- We want to display how many grant counts were considered, so this is used to calculate this. -->
|
||||||
|
|
||||||
|
var shortSparkRows = sparklineDataView.getViewRows();
|
||||||
|
var renderedShortSparks = 0;
|
||||||
|
$.each(shortSparkRows, function(index, value) {
|
||||||
|
renderedShortSparks += data.getValue(value, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#${sparklineContainerID} td.sparkline_number').text(parseInt(renderedShortSparks) + parseInt(${sparklineVO.unknownYearGrants}));
|
||||||
|
|
||||||
|
var sparksText = ' grant(s) within the last 10 years <span class="incomplete-data-holder" title="This information'
|
||||||
|
+ ' is based solely on grants which have been loaded into the VIVO system. This may only be a small'
|
||||||
|
+ ' sample of the person\'s total work.">incomplete list</span>';
|
||||||
|
|
||||||
|
<#else>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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}));
|
||||||
|
|
||||||
|
var sparksText = ' grant(s) from <span class="sparkline_range">${sparklineVO.earliestYearConsidered?c}'
|
||||||
|
+ ' to ${sparklineVO.latestRenderedGrantYear?c}</span> '
|
||||||
|
+ ' <a href="${sparklineVO.downloadDataLink}" class="inline_href">(.CSV File)</a> ';
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
$('#${sparklineContainerID} td.sparkline_text').html(sparksText);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This will activate the visualization. It takes care of creating
|
||||||
|
* div elements to hold the actual sparkline image and then calling the
|
||||||
|
* drawGrantCountVisualization function.
|
||||||
|
* */
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
var sparklineImgTD;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is a nuclear option (creating the container in which everything goes)
|
||||||
|
* the only reason this will be ever used is the API user never submitted a
|
||||||
|
* container ID in which everything goes. The alternative was to let the
|
||||||
|
* vis not appear in the calling page at all. So now atleast vis appears but
|
||||||
|
* appended at the bottom of the body.
|
||||||
|
* */
|
||||||
|
|
||||||
|
if ($('#${visContainerID}').length === 0) {
|
||||||
|
$('<div/>', {
|
||||||
|
'id': '${visContainerID}'
|
||||||
|
}).appendTo('body');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('#${sparklineContainerID}').length === 0) {
|
||||||
|
|
||||||
|
$('<div/>', {
|
||||||
|
'id': '${sparklineContainerID}',
|
||||||
|
'class': 'sparkline_style'
|
||||||
|
}).prependTo('#${visContainerID}');
|
||||||
|
|
||||||
|
var table = $('<table>');
|
||||||
|
table.attr('class', 'sparkline_wrapper_table');
|
||||||
|
var row = $('<tr>');
|
||||||
|
sparklineImgTD = $('<td>');
|
||||||
|
sparklineImgTD.attr('id', '${sparklineContainerID}_img');
|
||||||
|
sparklineImgTD.attr('width', '65');
|
||||||
|
sparklineImgTD.attr('align', 'right');
|
||||||
|
sparklineImgTD.attr('class', 'sparkline_style');
|
||||||
|
|
||||||
|
row.append(sparklineImgTD);
|
||||||
|
|
||||||
|
var sparklineNumberTD = $('<td>');
|
||||||
|
sparklineNumberTD.attr('width', '30');
|
||||||
|
sparklineNumberTD.attr('align', 'right');
|
||||||
|
sparklineNumberTD.attr('class', 'sparkline_number');
|
||||||
|
row.append(sparklineNumberTD);
|
||||||
|
var sparklineTextTD = $('<td>');
|
||||||
|
sparklineTextTD.attr('width', '450');
|
||||||
|
sparklineTextTD.attr('class', 'sparkline_text');
|
||||||
|
row.append(sparklineTextTD);
|
||||||
|
table.append(row);
|
||||||
|
table.prependTo('#${sparklineContainerID}');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
drawGrantCountVisualization(sparklineImgTD);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</div><!-- Sparkline Viz -->
|
||||||
|
|
||||||
|
<#if sparklineVO.shortVisMode>
|
||||||
|
<#--<span class="vis_link">-->
|
||||||
|
<p><a class="all-vivo-grants" href="${sparklineVO.fullTimelineNetworkLink}">View all VIVO grants and corresponding co-investigator network.</a></p>
|
||||||
|
<#--</span>-->
|
||||||
|
<#else>
|
||||||
|
<!-- For Full Sparkline - Print the Table of Grant Counts per Year -->
|
||||||
|
<p>
|
||||||
|
<table id='sparkline_data_table'>
|
||||||
|
<caption>
|
||||||
|
Grants per year <a href="${sparklineVO.downloadDataLink}">(.CSV File)</a>
|
||||||
|
</caption>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Year
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Grants
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<#list sparklineVO.yearToActivityCount?keys as year>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
${year}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
${sparklineVO.yearToActivityCount[year]}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</#list>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
|
||||||
|
<br />
|
||||||
|
</p>
|
||||||
|
</#if>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
<#if shouldVIVOrenderVis>
|
<#if shouldVIVOrenderVis>
|
||||||
<#include "/visualization/publication/personPublicationSparklineContent.ftl">
|
<#include "personPublicationSparklineContent.ftl">
|
||||||
</#if>
|
</#if>
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
|
|
||||||
${headScripts.add(googleJSAPI)}
|
${headScripts.add(googleJSAPI)}
|
||||||
|
|
||||||
<#include "/visualization/publication/personPublicationSparklineContent.ftl">
|
<#include "personPublicationSparklineContent.ftl">
|
|
@ -240,7 +240,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
|
||||||
|
|
||||||
Portal portal = vreq.getPortal();
|
Portal portal = vreq.getPortal();
|
||||||
|
|
||||||
String standaloneTemplate = "/visualization/grantCount.ftl";
|
String standaloneTemplate = "personGrantCountStandaloneActivator.ftl";
|
||||||
|
|
||||||
Map<String, Object> body = new HashMap<String, Object>();
|
Map<String, Object> body = new HashMap<String, Object>();
|
||||||
body.put("portalBean", portal);
|
body.put("portalBean", portal);
|
||||||
|
@ -267,7 +267,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
|
||||||
Portal portal = vreq.getPortal();
|
Portal portal = vreq.getPortal();
|
||||||
|
|
||||||
|
|
||||||
String dynamicTemplate = "/visualization/sparklineAjaxVisContent.ftl";
|
String dynamicTemplate = "personGrantCountDynamicActivator.ftl";
|
||||||
|
|
||||||
Map<String, Object> body = new HashMap<String, Object>();
|
Map<String, Object> body = new HashMap<String, Object>();
|
||||||
body.put("portalBean", portal);
|
body.put("portalBean", portal);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue