1. Made changes to fix the bug NIHVIVO-2087. Incorrent count values were being displayed in cases of collaborators sparklines.
This commit is contained in:
parent
f62776d24f
commit
f1e9475716
5 changed files with 51 additions and 5 deletions
|
@ -125,7 +125,11 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var totalPublicationCount = knownYearPublicationCounts + unknownYearPublicationCounts;
|
if (${sparklineVO.totalCollaborationshipCount?c}) {
|
||||||
|
var totalPublicationCount = ${sparklineVO.totalCollaborationshipCount?c};
|
||||||
|
} else {
|
||||||
|
var totalPublicationCount = knownYearPublicationCounts + unknownYearPublicationCounts;
|
||||||
|
}
|
||||||
|
|
||||||
<#if sparklineVO.shortVisMode>
|
<#if sparklineVO.shortVisMode>
|
||||||
|
|
||||||
|
|
|
@ -124,8 +124,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (${sparklineVO.totalCollaborationshipCount?c}) {
|
||||||
|
var totalGrantCount = ${sparklineVO.totalCollaborationshipCount?c};
|
||||||
|
} else {
|
||||||
|
var totalGrantCount = knownYearGrantCounts + unknownYearGrantCounts;
|
||||||
|
}
|
||||||
|
|
||||||
var totalGrantCount = knownYearGrantCounts + unknownYearGrantCounts;
|
|
||||||
|
|
||||||
<#if sparklineVO.shortVisMode>
|
<#if sparklineVO.shortVisMode>
|
||||||
|
|
||||||
|
|
|
@ -159,6 +159,14 @@ public class CoAuthorshipVisCodeGenerator {
|
||||||
sparklineData.setRenderedSparks(renderedFullSparks);
|
sparklineData.setRenderedSparks(renderedFullSparks);
|
||||||
|
|
||||||
sparklineData.setYearToEntityCountDataTable(yearToUniqueCoauthorsCountDataTable);
|
sparklineData.setYearToEntityCountDataTable(yearToUniqueCoauthorsCountDataTable);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is required only for the sparklines which convey collaborationships like coinvestigatorships
|
||||||
|
* and coauthorship. There are edge cases where a collaborator can be present for in a collaboration
|
||||||
|
* with known & unknown year. We do not want to repeat the count for this collaborator when we present
|
||||||
|
* it in the front-end.
|
||||||
|
* */
|
||||||
|
Set<Node> totalUniqueCoInvestigators = new HashSet<Node>(allCoAuthorsWithKnownAuthorshipYears);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Total publications will also consider publications that have no year associated with
|
* Total publications will also consider publications that have no year associated with
|
||||||
|
@ -168,10 +176,14 @@ public class CoAuthorshipVisCodeGenerator {
|
||||||
if (yearToUniqueCoauthors.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
|
if (yearToUniqueCoauthors.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
|
||||||
unknownYearCoauthors = yearToUniqueCoauthors
|
unknownYearCoauthors = yearToUniqueCoauthors
|
||||||
.get(VOConstants.DEFAULT_PUBLICATION_YEAR).size();
|
.get(VOConstants.DEFAULT_PUBLICATION_YEAR).size();
|
||||||
|
|
||||||
|
totalUniqueCoInvestigators.addAll(yearToUniqueCoauthors.get(VOConstants.DEFAULT_GRANT_YEAR));
|
||||||
}
|
}
|
||||||
|
|
||||||
sparklineData.setUnknownYearPublications(unknownYearCoauthors);
|
sparklineData.setUnknownYearPublications(unknownYearCoauthors);
|
||||||
|
|
||||||
|
sparklineData.setTotalCollaborationshipCount(totalUniqueCoInvestigators.size());
|
||||||
|
|
||||||
if (providedVisContainerID != null) {
|
if (providedVisContainerID != null) {
|
||||||
visContainerID = providedVisContainerID;
|
visContainerID = providedVisContainerID;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -159,17 +159,25 @@ public class CoPIVisCodeGenerator {
|
||||||
renderedFullSparks += currentUniqueCoPIs;
|
renderedFullSparks += currentUniqueCoPIs;
|
||||||
uniqueCoPICounter++;
|
uniqueCoPICounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For the purpose of this visualization I have come up with a term
|
* For the purpose of this visualization I have come up with a term
|
||||||
* "Sparks" which essentially means data points. Sparks that will be
|
* "Sparks" which essentially means data points. Sparks that will be
|
||||||
* rendered in full mode will always be the one's which have any year
|
* rendered in full mode will always be the one's which have any year
|
||||||
* associated with it. Hence.
|
* associated with it. Hence.
|
||||||
*/
|
*/
|
||||||
sparklineData.setRenderedSparks(renderedFullSparks);
|
sparklineData.setRenderedSparks(allCoPIsWithKnownGrantShipYears.size());
|
||||||
|
|
||||||
sparklineData.setYearToEntityCountDataTable(yearToUniqueInvestigatorsCountDataTable);
|
sparklineData.setYearToEntityCountDataTable(yearToUniqueInvestigatorsCountDataTable);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is required only for the sparklines which convey collaborationships like coinvestigatorships
|
||||||
|
* and coauthorship. There are edge cases where a collaborator can be present for in a collaboration
|
||||||
|
* with known & unknown year. We do not want to repeat the count for this collaborator when we present
|
||||||
|
* it in the front-end.
|
||||||
|
* */
|
||||||
|
Set<CoPINode> totalUniqueCoInvestigators = new HashSet<CoPINode>(allCoPIsWithKnownGrantShipYears);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Total grants will also consider grants that have no year
|
* Total grants will also consider grants that have no year
|
||||||
* associated with them. Hence.
|
* associated with them. Hence.
|
||||||
|
@ -178,8 +186,13 @@ public class CoPIVisCodeGenerator {
|
||||||
if (yearToUniqueCoPIs.get(VOConstants.DEFAULT_GRANT_YEAR) != null) {
|
if (yearToUniqueCoPIs.get(VOConstants.DEFAULT_GRANT_YEAR) != null) {
|
||||||
unknownYearGrants = yearToUniqueCoPIs.get(
|
unknownYearGrants = yearToUniqueCoPIs.get(
|
||||||
VOConstants.DEFAULT_GRANT_YEAR).size();
|
VOConstants.DEFAULT_GRANT_YEAR).size();
|
||||||
|
|
||||||
|
totalUniqueCoInvestigators.addAll(yearToUniqueCoPIs.get(VOConstants.DEFAULT_GRANT_YEAR));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sparklineData.setTotalCollaborationshipCount(totalUniqueCoInvestigators.size());
|
||||||
|
|
||||||
sparklineData.setUnknownYearGrants(unknownYearGrants);
|
sparklineData.setUnknownYearGrants(unknownYearGrants);
|
||||||
|
|
||||||
if (providedVisContainerID != null) {
|
if (providedVisContainerID != null) {
|
||||||
|
|
|
@ -17,6 +17,8 @@ public class SparklineData {
|
||||||
private Integer unknownYearPublications;
|
private Integer unknownYearPublications;
|
||||||
private Integer unknownYearGrants;
|
private Integer unknownYearGrants;
|
||||||
|
|
||||||
|
private Integer totalCollaborationshipCount;
|
||||||
|
|
||||||
private Map<String, Integer> yearToActivityCount;
|
private Map<String, Integer> yearToActivityCount;
|
||||||
|
|
||||||
private String downloadDataLink = "";
|
private String downloadDataLink = "";
|
||||||
|
@ -29,7 +31,16 @@ public class SparklineData {
|
||||||
private List<YearToEntityCountDataElement> yearToEntityCountDataTable;
|
private List<YearToEntityCountDataElement> yearToEntityCountDataTable;
|
||||||
|
|
||||||
private int numOfYearsToBeRendered;
|
private int numOfYearsToBeRendered;
|
||||||
|
|
||||||
|
public void setTotalCollaborationshipCount(
|
||||||
|
Integer totalCollaborationshipCount) {
|
||||||
|
this.totalCollaborationshipCount = totalCollaborationshipCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTotalCollaborationshipCount() {
|
||||||
|
return totalCollaborationshipCount;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getEarliestRenderedGrantYear() {
|
public Integer getEarliestRenderedGrantYear() {
|
||||||
return earliestRenderedGrantYear;
|
return earliestRenderedGrantYear;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue