1. Made changes to the sparkline text per Nick/Micah's request
2. Made chanegs to content on person level page
This commit is contained in:
parent
672f086f98
commit
5203cd0182
3 changed files with 37 additions and 16 deletions
|
@ -111,7 +111,6 @@ public class VisualizationCodeGenerator {
|
||||||
if (yearToUniqueCoauthorsCount.size() > 0) {
|
if (yearToUniqueCoauthorsCount.size() > 0) {
|
||||||
try {
|
try {
|
||||||
minPublishedYear = Integer.parseInt(Collections.min(publishedYears));
|
minPublishedYear = Integer.parseInt(Collections.min(publishedYears));
|
||||||
System.out.println("min pub year - " + minPublishedYear);
|
|
||||||
} catch (NoSuchElementException e1) {
|
} catch (NoSuchElementException e1) {
|
||||||
log.debug("vis: " + e1.getMessage() + " error occurred for " + yearToUniqueCoauthorsCount.toString());
|
log.debug("vis: " + e1.getMessage() + " error occurred for " + yearToUniqueCoauthorsCount.toString());
|
||||||
} catch (NumberFormatException e2) {
|
} catch (NumberFormatException e2) {
|
||||||
|
@ -221,10 +220,13 @@ public class VisualizationCodeGenerator {
|
||||||
* Total publications will also consider publications that have no year associated with
|
* Total publications will also consider publications that have no year associated with
|
||||||
* it. Hence.
|
* it. Hence.
|
||||||
* */
|
* */
|
||||||
|
Integer unknownYearCoauthors = 0;
|
||||||
if (yearToUniqueCoauthorsCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
|
if (yearToUniqueCoauthorsCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
|
||||||
totalUniqueCoAuthors += yearToUniqueCoauthorsCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR);
|
totalUniqueCoAuthors += yearToUniqueCoauthorsCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR);
|
||||||
|
unknownYearCoauthors = yearToUniqueCoauthorsCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String sparklineDisplayOptions = "{width: 63, height: 21, showAxisLines: false, " +
|
String sparklineDisplayOptions = "{width: 63, height: 21, showAxisLines: false, " +
|
||||||
"showValueLabels: false, labelPosition: 'none'}";
|
"showValueLabels: false, labelPosition: 'none'}";
|
||||||
|
|
||||||
|
@ -261,6 +263,7 @@ public class VisualizationCodeGenerator {
|
||||||
shortSparkMinYear,
|
shortSparkMinYear,
|
||||||
visContainerID,
|
visContainerID,
|
||||||
visualizationCode,
|
visualizationCode,
|
||||||
|
unknownYearCoauthors,
|
||||||
totalUniqueCoAuthors,
|
totalUniqueCoAuthors,
|
||||||
sparklineDisplayOptions);
|
sparklineDisplayOptions);
|
||||||
} else {
|
} else {
|
||||||
|
@ -268,6 +271,7 @@ public class VisualizationCodeGenerator {
|
||||||
minPubYearConsidered,
|
minPubYearConsidered,
|
||||||
visContainerID,
|
visContainerID,
|
||||||
visualizationCode,
|
visualizationCode,
|
||||||
|
unknownYearCoauthors,
|
||||||
totalUniqueCoAuthors,
|
totalUniqueCoAuthors,
|
||||||
renderedFullSparks,
|
renderedFullSparks,
|
||||||
sparklineDisplayOptions);
|
sparklineDisplayOptions);
|
||||||
|
@ -287,8 +291,8 @@ public class VisualizationCodeGenerator {
|
||||||
|
|
||||||
private void generateShortSparklineVisualizationContent(int currentYear,
|
private void generateShortSparklineVisualizationContent(int currentYear,
|
||||||
int shortSparkMinYear, String visContainerID,
|
int shortSparkMinYear, String visContainerID,
|
||||||
StringBuilder visualizationCode, int totalUniqueCoAuthors,
|
StringBuilder visualizationCode, int unknownYearCoauthors,
|
||||||
String sparklineDisplayOptions) {
|
int totalUniqueCoAuthors, String sparklineDisplayOptions) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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.
|
||||||
|
@ -330,7 +334,7 @@ public class VisualizationCodeGenerator {
|
||||||
/*
|
/*
|
||||||
* Generate the text introducing the vis.
|
* Generate the text introducing the vis.
|
||||||
* */
|
* */
|
||||||
visualizationCode.append("$('#" + visDivNames.get("SHORT_SPARK") + " td.sparkline_number').text(renderedShortSparks);");
|
visualizationCode.append("$('#" + visDivNames.get("SHORT_SPARK") + " td.sparkline_number').text(parseInt(renderedShortSparks) + parseInt(" + unknownYearCoauthors + "));");
|
||||||
visualizationCode.append("var shortSparksText = ''" +
|
visualizationCode.append("var shortSparksText = ''" +
|
||||||
"+ ' Unique co-author(s) with year from '" +
|
"+ ' Unique co-author(s) with year from '" +
|
||||||
"+ ' " + totalUniqueCoAuthors + " '" +
|
"+ ' " + totalUniqueCoAuthors + " '" +
|
||||||
|
@ -353,7 +357,7 @@ public class VisualizationCodeGenerator {
|
||||||
|
|
||||||
private void generateFullSparklineVisualizationContent(
|
private void generateFullSparklineVisualizationContent(
|
||||||
int currentYear, int minPubYearConsidered, String visContainerID, StringBuilder visualizationCode,
|
int currentYear, int minPubYearConsidered, String visContainerID, StringBuilder visualizationCode,
|
||||||
int totalUniqueCoAuthors, int renderedFullSparks,
|
int unknownYearCoauthors, int totalUniqueCoAuthors, int renderedFullSparks,
|
||||||
String sparklineDisplayOptions) {
|
String sparklineDisplayOptions) {
|
||||||
|
|
||||||
String csvDownloadURLHref = "";
|
String csvDownloadURLHref = "";
|
||||||
|
@ -383,7 +387,7 @@ public class VisualizationCodeGenerator {
|
||||||
");\n" +
|
");\n" +
|
||||||
"full_spark.draw(fullSparklineView, " + sparklineDisplayOptions + ");\n");
|
"full_spark.draw(fullSparklineView, " + sparklineDisplayOptions + ");\n");
|
||||||
|
|
||||||
visualizationCode.append("$('#" + visDivNames.get("FULL_SPARK") + " td.sparkline_number').text('" + renderedFullSparks + "');");
|
visualizationCode.append("$('#" + visDivNames.get("FULL_SPARK") + " td.sparkline_number').text('" + (renderedFullSparks + unknownYearCoauthors) + "');");
|
||||||
|
|
||||||
visualizationCode.append("var allSparksText = ''" +
|
visualizationCode.append("var allSparksText = ''" +
|
||||||
"+ ' Unique co-author(s) from '" +
|
"+ ' Unique co-author(s) from '" +
|
||||||
|
|
|
@ -118,7 +118,6 @@ public class VisualizationCodeGenerator {
|
||||||
if (yearToPublicationCount.size() > 0) {
|
if (yearToPublicationCount.size() > 0) {
|
||||||
try {
|
try {
|
||||||
minPublishedYear = Integer.parseInt(Collections.min(publishedYears));
|
minPublishedYear = Integer.parseInt(Collections.min(publishedYears));
|
||||||
System.out.println("min pub year - " + minPublishedYear);
|
|
||||||
} catch (NoSuchElementException e1) {
|
} catch (NoSuchElementException e1) {
|
||||||
log.debug("vis: " + e1.getMessage() + " error occurred for " + yearToPublicationCount.toString());
|
log.debug("vis: " + e1.getMessage() + " error occurred for " + yearToPublicationCount.toString());
|
||||||
} catch (NumberFormatException e2) {
|
} catch (NumberFormatException e2) {
|
||||||
|
@ -231,8 +230,10 @@ public class VisualizationCodeGenerator {
|
||||||
* Total publications will also consider publications that have no year associated with
|
* Total publications will also consider publications that have no year associated with
|
||||||
* it. Hence.
|
* it. Hence.
|
||||||
* */
|
* */
|
||||||
|
Integer unknownYearPublications = 0;
|
||||||
if (yearToPublicationCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
|
if (yearToPublicationCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
|
||||||
totalPublications += yearToPublicationCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR);
|
totalPublications += yearToPublicationCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR);
|
||||||
|
unknownYearPublications = yearToPublicationCount.get(VOConstants.DEFAULT_PUBLICATION_YEAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
String sparklineDisplayOptions = "{width: 63, height: 21, showAxisLines: false, " +
|
String sparklineDisplayOptions = "{width: 63, height: 21, showAxisLines: false, " +
|
||||||
|
@ -271,13 +272,15 @@ public class VisualizationCodeGenerator {
|
||||||
shortSparkMinYear,
|
shortSparkMinYear,
|
||||||
visContainerID,
|
visContainerID,
|
||||||
visualizationCode,
|
visualizationCode,
|
||||||
|
unknownYearPublications,
|
||||||
totalPublications,
|
totalPublications,
|
||||||
sparklineDisplayOptions);
|
sparklineDisplayOptions);
|
||||||
} else {
|
} else {
|
||||||
generateFullSparklineVisualizationContent(currentYear,
|
generateFullSparklineVisualizationContent(currentYear,
|
||||||
minPubYearConsidered,
|
minPubYearConsidered,
|
||||||
visContainerID,
|
visContainerID,
|
||||||
visualizationCode,
|
visualizationCode,
|
||||||
|
unknownYearPublications,
|
||||||
totalPublications,
|
totalPublications,
|
||||||
renderedFullSparks,
|
renderedFullSparks,
|
||||||
sparklineDisplayOptions);
|
sparklineDisplayOptions);
|
||||||
|
@ -297,8 +300,8 @@ public class VisualizationCodeGenerator {
|
||||||
|
|
||||||
private void generateShortSparklineVisualizationContent(int currentYear,
|
private void generateShortSparklineVisualizationContent(int currentYear,
|
||||||
int shortSparkMinYear, String visContainerID,
|
int shortSparkMinYear, String visContainerID,
|
||||||
StringBuilder visualizationCode, int totalPublications,
|
StringBuilder visualizationCode, int unknownYearPublications,
|
||||||
String sparklineDisplayOptions) {
|
int totalPublications, String sparklineDisplayOptions) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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.
|
||||||
|
@ -340,9 +343,15 @@ public class VisualizationCodeGenerator {
|
||||||
/*
|
/*
|
||||||
* Generate the text introducing the vis.
|
* Generate the text introducing the vis.
|
||||||
* */
|
* */
|
||||||
visualizationCode.append("$('#" + visDivNames.get("SHORT_SPARK") + " td.sparkline_number').text(renderedShortSparks);");
|
|
||||||
|
|
||||||
|
String imcompleteDataText = "This information is based solely on publications which have been loaded into the VIVO system. " +
|
||||||
|
"This may only be a small sample of the person's total work.";
|
||||||
|
|
||||||
|
visualizationCode.append("$('#" + visDivNames.get("SHORT_SPARK") + " td.sparkline_number').text(parseInt(renderedShortSparks) + parseInt(" + unknownYearPublications + "));");
|
||||||
visualizationCode.append("var shortSparksText = ''" +
|
visualizationCode.append("var shortSparksText = ''" +
|
||||||
"+ ' publications within the last 10 years '" +
|
"+ ' publications within the last 10 years " +
|
||||||
|
"<span title=\"" + imcompleteDataText + "\">(incomplete data)</span>'" +
|
||||||
/*"+ ' " + totalPublications + " '" +
|
/*"+ ' " + totalPublications + " '" +
|
||||||
"+ ' total " +
|
"+ ' total " +
|
||||||
"<span class=\"sparkline_range\">" +
|
"<span class=\"sparkline_range\">" +
|
||||||
|
@ -362,7 +371,9 @@ public class VisualizationCodeGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateFullSparklineVisualizationContent(
|
private void generateFullSparklineVisualizationContent(
|
||||||
int currentYear, int minPubYearConsidered, String visContainerID, StringBuilder visualizationCode,
|
int currentYear, int minPubYearConsidered, String visContainerID,
|
||||||
|
StringBuilder visualizationCode,
|
||||||
|
int unknownYearPublications,
|
||||||
int totalPublications, int renderedFullSparks,
|
int totalPublications, int renderedFullSparks,
|
||||||
String sparklineDisplayOptions) {
|
String sparklineDisplayOptions) {
|
||||||
|
|
||||||
|
@ -393,7 +404,7 @@ public class VisualizationCodeGenerator {
|
||||||
");\n" +
|
");\n" +
|
||||||
"full_spark.draw(fullSparklineView, " + sparklineDisplayOptions + ");\n");
|
"full_spark.draw(fullSparklineView, " + sparklineDisplayOptions + ");\n");
|
||||||
|
|
||||||
visualizationCode.append("$('#" + visDivNames.get("FULL_SPARK") + " td.sparkline_number').text('" + renderedFullSparks + "');");
|
visualizationCode.append("$('#" + visDivNames.get("FULL_SPARK") + " td.sparkline_number').text('" + (renderedFullSparks + unknownYearPublications) + "');");
|
||||||
|
|
||||||
visualizationCode.append("var allSparksText = ''" +
|
visualizationCode.append("var allSparksText = ''" +
|
||||||
"+ ' publications '" +
|
"+ ' publications '" +
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
<c:set var='numOfAuthors' value='${requestScope.numOfAuthors}' />
|
<c:set var='numOfAuthors' value='${requestScope.numOfAuthors}' />
|
||||||
<c:set var='numOfCoAuthorShips' value='${requestScope.numOfCoAuthorShips}' />
|
<c:set var='numOfCoAuthorShips' value='${requestScope.numOfCoAuthorShips}' />
|
||||||
|
|
||||||
|
<c:url var="egoVivoProfileURL" value="/individual">
|
||||||
|
<c:param name="uri" value="${requestScope.egoURIParam}" />
|
||||||
|
</c:url>
|
||||||
|
|
||||||
<c:url var="egoSparklineDataURL" value="/admin/visQuery">
|
<c:url var="egoSparklineDataURL" value="/admin/visQuery">
|
||||||
<c:param name="render_mode" value="data" />
|
<c:param name="render_mode" value="data" />
|
||||||
|
@ -137,7 +140,7 @@ table.sparkline_wrapper_table td, th {
|
||||||
<span id="ego_profile_image"></span>
|
<span id="ego_profile_image"></span>
|
||||||
|
|
||||||
<%-- Label --%>
|
<%-- Label --%>
|
||||||
<h1><span id="ego_label" class="author_name"></span></h1>
|
<a href="${egoVivoProfileURL}"><h1><span id="ego_label" class="author_name"></span></h1></a>
|
||||||
|
|
||||||
<%-- Moniker--%>
|
<%-- Moniker--%>
|
||||||
<span id="ego_moniker" class="author_moniker"></span>
|
<span id="ego_moniker" class="author_moniker"></span>
|
||||||
|
@ -145,6 +148,9 @@ table.sparkline_wrapper_table td, th {
|
||||||
|
|
||||||
<div style="clear:both;"></div>
|
<div style="clear:both;"></div>
|
||||||
|
|
||||||
|
<div id="incomplete-data">This information is based solely on publications which have been loaded into the VIVO system.
|
||||||
|
This may only be a small sample of the person's total work. </div>
|
||||||
|
|
||||||
<%-- Sparkline --%>
|
<%-- Sparkline --%>
|
||||||
<h2 class="sub_headings">General Statistics</h2>
|
<h2 class="sub_headings">General Statistics</h2>
|
||||||
<div id="${egoPubSparklineContainerID}">
|
<div id="${egoPubSparklineContainerID}">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue