1. Modified javascript for person level page to adapt tp freemarker changes.

2. Abstracted out the table generating code for sparklines out. This gives us flexibility to put the table wherever we want in the template.
3. Made changes to coauth person l;evel page to display all the content. TThe data is all there with links.
4. Adapted person pub count & coauth sparklines to adapt to new table generating template.
5. Changed coauth vis code gen to include a missing data value.
6. Fixed a bug in person level req handler.
This commit is contained in:
cdtank 2010-12-23 23:55:57 +00:00
parent 428c8a24ce
commit 7568601dc4
7 changed files with 576 additions and 557 deletions

View file

@ -294,6 +294,7 @@ function createTable(tableID, tableContainer, tableData) {
table.prependTo('#' + tableContainer);
$('#' + tableContainer + " #loadingData").remove();
}
//renderStatsOnNodeClicked, CoRelations, noOfCoRelations

View file

@ -21,7 +21,7 @@
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn('number', 'Unique co-authors');
data.addRows(${sparklineVO.numOfYearsToBeRendered});
data.addRows(${sparklineVO.yearToEntityCountDataTable?size});
<#list sparklineVO.yearToEntityCountDataTable as yearToUniqueCoauthorsDataElement>
data.setValue(${yearToUniqueCoauthorsDataElement.yearToEntityCounter}, 0, '${yearToUniqueCoauthorsDataElement.year}');
@ -43,7 +43,6 @@
maxValue: '${sparklineVO.latestRenderedPublicationYear?c}'
}]));
<#else>
</#if>
@ -87,6 +86,7 @@
var sparksText = ' co-author(s) from <span class="sparkline_range">${sparklineVO.earliestYearConsidered?c}'
+ ' to ${sparklineVO.latestRenderedPublicationYear?c}</span> '
+ ' <a href="${sparklineVO.downloadDataLink}" class="inline_href">(.CSV File)</a> ';
</#if>
$('#${sparklineContainerID} td.sparkline_text').html(sparksText);
@ -152,7 +152,9 @@
});
</script>
</div><!-- Sparkline Viz -->
</div>
<!-- Sparkline Viz -->
<#if sparklineVO.shortVisMode>
<#--<span class="vis_link">-->
@ -161,37 +163,23 @@
<#else>
<!-- For Full Sparkline - Print the Table of Couauthor Counts per Year -->
<p>
<table id='sparkline_data_table'>
<caption>
Unique Co-Authors per year <a href="${sparklineVO.downloadDataLink}">(.CSV File)</a>
</caption>
<thead>
<tr>
<th>
Year
</th>
<th>
Count
</th>
</tr>
</thead>
<tbody>
<#if displayTable?? && displayTable>
<#list sparklineVO.yearToActivityCount?keys as year>
<tr>
<td>
${year}
</td>
<td>
${sparklineVO.yearToActivityCount[year]}
</td>
</tr>
</#list>
<p>
<#assign tableID = "sparkline_data_table" />
<#assign tableCaption = "Unique Co-Authors per year " />
<#assign tableActivityColumnName = "Count" />
<#assign tableContent = sparklineVO.yearToActivityCount />
<#assign fileDownloadLink = sparklineVO.downloadDataLink />
<#include "yearToActivityCountTable.ftl">
</tbody>
</table>
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
<br />
</p>
</#if>
</p>
</#if>
</div>

View file

@ -5,12 +5,12 @@
<#assign dataVisualizationURLRoot ="/visualizationData">
<#assign egoURI ="${egoURIParam?url}">
<#assign egoCoAuthorshipDataFeederURL = '${urls.base}${dataVisualizationURLRoot}?vis=coauthorship&uri=${egoURI}&visMode=coauthor_network_stream&labelField=label'>
<#assign egoCoAuthorshipDataFeederURL = '${urls.base}${dataVisualizationURLRoot}?vis=coauthorship&uri=${egoURI}&vis_mode=coauthor_network_stream&labelField=label'>
<#assign coprincipalinvestigatorURL = '${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${egoURI}&visMode=copi'>
<#assign coprincipalinvestigatorURL = '${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${egoURI}&vis_mode=copi'>
<#assign egoCoAuthorsListDataFileURL = '${urls.base}${dataVisualizationURLRoot}?vis=coauthorship&uri=${egoURI}&visMode=coauthors'>
<#assign egoCoAuthorshipNetworkDataFileURL = '${urls.base}${dataVisualizationURLRoot}?vis=coauthorship&uri=${egoURI}&visMode=coauthor_network_download'>
<#assign egoCoAuthorsListDataFileURL = '${urls.base}${dataVisualizationURLRoot}?vis=coauthorship&uri=${egoURI}&vis_mode=coauthors'>
<#assign egoCoAuthorshipNetworkDataFileURL = '${urls.base}${dataVisualizationURLRoot}?vis=coauthorship&uri=${egoURI}&vis_mode=coauthor_network_download'>
<#assign swfLink = '${urls.images}/visualization/coauthorship/EgoCentric.swf'>
<#assign adobeFlashDetector = '${urls.base}/js/visualization/coauthorship/AC_OETags.js'>
@ -68,11 +68,10 @@ $(document).ready(function(){
$("#coauth_table_container").empty().html('<img id="loadingData" width="auto" src="${loadingImageLink}" />');
</#if>
processProfileInformation("ego_label",
"ego_moniker",
"ego_profile_image",
jQuery.parseJSON(getWellFormedURLs("${egoURI}", "profile_info")));
jQuery.parseJSON(getWellFormedURLs("${egoURIParam}", "profile_info")));
<#if (numOfCoAuthorShips?? && numOfCoAuthorShips <= 0) || (numOfAuthors?? && numOfAuthors <= 0) >
if ($('#ego_label').text().length > 0) {
@ -96,7 +95,7 @@ $(document).ready(function(){
<div class = "toggle_visualization">
<h2>Co-Investigator Network</h2>
<a style = "margin-top:0px;" class="view-all-style" href='<c:out value="${coprincipalinvestigatorURL}"/>'>View</a>
<a style = "margin-top:0px;" class="view-all-style" href='${coprincipalinvestigatorURL}'>View</a>
<span class="pictos-arrow-10">4</span>
</div>
@ -106,7 +105,7 @@ $(document).ready(function(){
<h2 class="sub_headings">Co-Author Network </h2>
<#if (numOfCoAuthorShips?? && numOfCoAuthorShips <= 0) || (numOfAuthors?? && numOfAuthors <= 0) >
<#if (numOfCoAuthorShips?? && numOfCoAuthorShips > 0) || (numOfAuthors?? && numOfAuthors > 0) >
<a class = "fileDownloadPlaceHolder" href="${egoCoAuthorshipNetworkDataFileURL}">(GraphML File)</a>
<#else>
@ -131,7 +130,7 @@ $(document).ready(function(){
</div>
<#if (numOfCoAuthorShips?? && numOfCoAuthorShips <= 0) || (numOfAuthors?? && numOfAuthors <= 0) >
<#if (numOfCoAuthorShips?? && numOfCoAuthorShips > 0) || (numOfAuthors?? && numOfAuthors > 0) >
<div id="bodyPannel">
<div id="visPanel" style="float: right; width: 600px;">
@ -167,6 +166,9 @@ $(document).ready(function(){
<#-- Sparkline -->
<div style="width: 60%; height: 100px; float:right;">
<#assign displayTable = false />
<#assign sparklineVO = egoPubSparklineVO />
<#include "personPublicationSparklineContent.ftl">
@ -181,9 +183,19 @@ $(document).ready(function(){
<h3 class="sub_headings" id="table_heading">Tables</h3>
<div class="vis-tables">
<p id="publications_table_container" class="datatable">
TABLE
<#assign tableID = "publication_data_table" />
<#assign tableCaption = "Publications per year " />
<#assign tableActivityColumnName = "Publications" />
<#assign tableContent = egoPubSparklineVO.yearToActivityCount />
<#assign fileDownloadLink = egoPubSparklineVO.downloadDataLink />
<#include "yearToActivityCountTable.ftl">
</p>
</div>
<#if (numOfCoAuthorShips > 0) >

View file

@ -21,7 +21,7 @@
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn('number', 'Publications');
data.addRows(${sparklineVO.numOfYearsToBeRendered});
data.addRows(${sparklineVO.yearToEntityCountDataTable?size});
<#list sparklineVO.yearToEntityCountDataTable as yearToPublicationCountDataElement>
data.setValue(${yearToPublicationCountDataElement.yearToEntityCounter}, 0, '${yearToPublicationCountDataElement.year}');
@ -160,38 +160,25 @@
<#--</span>-->
<#else>
<!-- For Full Sparkline - Print the Table of Publication Counts per Year -->
<#if displayTable?? && displayTable>
<p>
<table id='sparkline_data_table'>
<caption>
Publications per year <a href="${sparklineVO.downloadDataLink}">(.CSV File)</a>
</caption>
<thead>
<tr>
<th>
Year
</th>
<th>
Publications
</th>
</tr>
</thead>
<tbody>
<#assign tableID = "sparkline_data_table" />
<#assign tableCaption = "Publications per year " />
<#assign tableActivityColumnName = "Publications" />
<#assign tableContent = sparklineVO.yearToActivityCount />
<#assign fileDownloadLink = sparklineVO.downloadDataLink />
<#list sparklineVO.yearToActivityCount?keys as year>
<tr>
<td>
${year}
</td>
<td>
${sparklineVO.yearToActivityCount[year]}
</td>
</tr>
</#list>
<#include "yearToActivityCountTable.ftl">
</tbody>
</table>
Download data as <a href="${sparklineVO.downloadDataLink}">.csv</a> file.
<br />
</p>
</#if>
</#if>
</div>

View file

@ -0,0 +1,29 @@
<table id='${tableID}'>
<caption>
${tableCaption} <a href="${fileDownloadLink}">(.CSV File)</a>
</caption>
<thead>
<tr>
<th>
Year
</th>
<th>
${tableActivityColumnName}
</th>
</tr>
</thead>
<tbody>
<#list tableContent?keys as year>
<tr>
<td>
${year}
</td>
<td>
${tableContent[year]}
</td>
</tr>
</#list>
</tbody>
</table>

View file

@ -148,6 +148,8 @@ public class CoAuthorshipVisCodeGenerator {
numOfYearsToBeRendered = currentYear - minPubYearConsidered + 1;
sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered);
visualizationCode.append("<style type='text/css'>"
+ "." + VISUALIZATION_STYLE_CLASS + " table{"
+ " margin: 0;"

View file

@ -82,7 +82,7 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler {
VisualizationFrameworkConstants.VIS_MODE_KEY);
if (VisualizationFrameworkConstants.CO_PI_VIS.equalsIgnoreCase(visMode)) {
if (VisualizationFrameworkConstants.COPI_VIS_MODE.equalsIgnoreCase(visMode)) {
QueryRunner<CoPIData> coPIQueryManager = new CoPIGrantCountQueryRunner(egoURI, dataSource, log);