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
|
@ -159,6 +159,14 @@ public class CoAuthorshipVisCodeGenerator {
|
|||
sparklineData.setRenderedSparks(renderedFullSparks);
|
||||
|
||||
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
|
||||
|
@ -168,10 +176,14 @@ public class CoAuthorshipVisCodeGenerator {
|
|||
if (yearToUniqueCoauthors.get(VOConstants.DEFAULT_PUBLICATION_YEAR) != null) {
|
||||
unknownYearCoauthors = yearToUniqueCoauthors
|
||||
.get(VOConstants.DEFAULT_PUBLICATION_YEAR).size();
|
||||
|
||||
totalUniqueCoInvestigators.addAll(yearToUniqueCoauthors.get(VOConstants.DEFAULT_GRANT_YEAR));
|
||||
}
|
||||
|
||||
sparklineData.setUnknownYearPublications(unknownYearCoauthors);
|
||||
|
||||
sparklineData.setTotalCollaborationshipCount(totalUniqueCoInvestigators.size());
|
||||
|
||||
if (providedVisContainerID != null) {
|
||||
visContainerID = providedVisContainerID;
|
||||
} else {
|
||||
|
|
|
@ -159,17 +159,25 @@ public class CoPIVisCodeGenerator {
|
|||
renderedFullSparks += currentUniqueCoPIs;
|
||||
uniqueCoPICounter++;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* For the purpose of this visualization I have come up with a term
|
||||
* "Sparks" which essentially means data points. Sparks that will be
|
||||
* rendered in full mode will always be the one's which have any year
|
||||
* associated with it. Hence.
|
||||
*/
|
||||
sparklineData.setRenderedSparks(renderedFullSparks);
|
||||
sparklineData.setRenderedSparks(allCoPIsWithKnownGrantShipYears.size());
|
||||
|
||||
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
|
||||
* associated with them. Hence.
|
||||
|
@ -178,8 +186,13 @@ public class CoPIVisCodeGenerator {
|
|||
if (yearToUniqueCoPIs.get(VOConstants.DEFAULT_GRANT_YEAR) != null) {
|
||||
unknownYearGrants = yearToUniqueCoPIs.get(
|
||||
VOConstants.DEFAULT_GRANT_YEAR).size();
|
||||
|
||||
totalUniqueCoInvestigators.addAll(yearToUniqueCoPIs.get(VOConstants.DEFAULT_GRANT_YEAR));
|
||||
|
||||
}
|
||||
|
||||
sparklineData.setTotalCollaborationshipCount(totalUniqueCoInvestigators.size());
|
||||
|
||||
sparklineData.setUnknownYearGrants(unknownYearGrants);
|
||||
|
||||
if (providedVisContainerID != null) {
|
||||
|
|
|
@ -17,6 +17,8 @@ public class SparklineData {
|
|||
private Integer unknownYearPublications;
|
||||
private Integer unknownYearGrants;
|
||||
|
||||
private Integer totalCollaborationshipCount;
|
||||
|
||||
private Map<String, Integer> yearToActivityCount;
|
||||
|
||||
private String downloadDataLink = "";
|
||||
|
@ -29,7 +31,16 @@ public class SparklineData {
|
|||
private List<YearToEntityCountDataElement> yearToEntityCountDataTable;
|
||||
|
||||
private int numOfYearsToBeRendered;
|
||||
|
||||
|
||||
public void setTotalCollaborationshipCount(
|
||||
Integer totalCollaborationshipCount) {
|
||||
this.totalCollaborationshipCount = totalCollaborationshipCount;
|
||||
}
|
||||
|
||||
public Integer getTotalCollaborationshipCount() {
|
||||
return totalCollaborationshipCount;
|
||||
}
|
||||
|
||||
public Integer getEarliestRenderedGrantYear() {
|
||||
return earliestRenderedGrantYear;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue