1. Fixed a bug for an edge case in coauthorsip vis

This commit is contained in:
cdtank 2010-07-19 21:15:46 +00:00
parent d3af6d949e
commit ddae9bb311

View file

@ -193,14 +193,17 @@ public class VisualizationCodeGenerator {
for (int publicationYear = minPubYearConsidered; publicationYear <= currentYear; publicationYear++) {
String stringPublishedYear = String.valueOf(publicationYear);
Integer currentUniqueCoAuthors = yearToUniqueCoauthors.get(stringPublishedYear).size();
if (currentUniqueCoAuthors == null) {
currentUniqueCoAuthors = 0;
Set<Node> currentCoAuthors = yearToUniqueCoauthors.get(stringPublishedYear);
Integer currentUniqueCoAuthors = null;
if (currentCoAuthors != null) {
currentUniqueCoAuthors = currentCoAuthors.size();
allCoAuthorsWithKnownAuthorshipYears.addAll(currentCoAuthors);
} else {
allCoAuthorsWithKnownAuthorshipYears.addAll(yearToUniqueCoauthors.get(stringPublishedYear));
currentUniqueCoAuthors = 0;
}
visualizationCode.append("data.setValue("
+ uniqueCoAuthorCounter
+ ", 0, '"
@ -212,8 +215,6 @@ public class VisualizationCodeGenerator {
+ ", 1, "
+ currentUniqueCoAuthors
+ ");\n");
uniqueCoAuthorCounter++;
}