1. Fix for http://issues.library.cornell.edu/browse/NIHVIVO-3070 made sure that the rows in the table for person level vis were created based on whether the entity in question has egoURI or not, instead of depending upon flash vis to provide sorted list with egoNode being the first element.

2. Tentative fix for http://issues.library.cornell.edu/browse/NIHVIVO-2953 will wait to hear more to change the UX further.

3. Fix for http://issues.library.cornell.edu/browse/NIHVIVO-2523 the current placement for downloading of this csv is subject to change.
This commit is contained in:
tankchintan 2011-07-27 21:44:45 +00:00
parent c37ae62188
commit 6c3818f84a
8 changed files with 123 additions and 43 deletions

View file

@ -200,6 +200,22 @@ a.map-of-science-links {
padding: 4px 5px 3px;
}
#download-unlocated-journal-info {
background-color: #2485AE;
height: 20px;
margin-top: 10px;
max-width: 260px;
padding: 4px 5px 3px;
text-align: center;
}
#download-unlocated-journal-info a {
color: white;
cursor: pointer;
font-weight: bold;
text-decoration: none;
}
#main-science-areas-table-container {
margin-top: 0;
}

View file

@ -108,7 +108,6 @@ $("input[type=checkbox].easyDeselectCheckbox").live('click', function(){
var entityToBeRemoved = URIToEntityRecord[checkboxValue];
if(!checkbox.is(':checked')){
//console.log("Easy deselect checkbox is unclicked!");
updateRowHighlighter(linkedCheckbox);
removeUsedColor(entityToBeRemoved);
removeEntityUnChecked(renderedObjects, entityToBeRemoved);
@ -169,8 +168,6 @@ $(".filter-option").live('click', function() {
temporalGraphProcessor.currentSelectedFilter = "ORGANIZATIONS";
}
// clearRenderedObjects();
$(this).addClass('active-filter');
temporalGraphProcessor.dataTable.fnDraw();
@ -419,6 +416,8 @@ function entityCheckboxOperatedOnEventListener() {
var checkboxValue = $(this).attr("value");
var entity = URIToEntityRecord[checkboxValue];
temporalGraphProcessor.isDefaultSelectionsMaintained = false;
if (checkbox.is(':checked')) {
performEntityCheckboxSelectedActions(entity, checkboxValue, checkbox);
@ -436,8 +435,6 @@ function renderTemporalGraphVisualization(parameters) {
setupLoadingScreen(parameters.responseContainer);
//return;
getTemporalGraphData(parameters.dataURL,
parameters.bodyContainer,
parameters.errorContainer,
@ -570,6 +567,8 @@ var entitySelector = {
temporalGraphProcessor = {
isDefaultSelectionsMaintained: true,
loadingScreenTimeout: '',
currentSelectedFilter: 'ORGANIZATIONS',
@ -626,9 +625,20 @@ temporalGraphProcessor = {
var currentSelectedEntityURIs = [];
/*
* We want to make sure that the currently selected entities are preserved only if they
* were somehow manipulated by the users.
* */
if (!temporalGraphProcessor.isDefaultSelectionsMaintained) {
$.each(URIToCheckedEntities, function(index, entity){
currentSelectedEntityURIs.push(index);
});
}
/*
* Reset the "is default selections maintained" value.
* */
temporalGraphProcessor.isDefaultSelectionsMaintained = true;
clearRenderedObjects();
@ -658,6 +668,13 @@ temporalGraphProcessor = {
}
});
} else {
/*
* We have to redraw the table so that top 3 entities are selected. fnDraw() triggers sorting of the
* table and other filters.
* */
temporalGraphProcessor.dataTable.fnDraw();
/*
* This will make sure that top 3 entities are selected by default when the page loads.
*/

View file

@ -209,7 +209,7 @@ function visLoaded(nodes){
var jsonedNodes = jQuery.parseJSON(nodes);
$(document).ready(function() {
createTable(collaboratorTableMetadata.tableID, collaboratorTableMetadata.tableContainer, jsonedNodes.slice(1));
createTable(collaboratorTableMetadata.tableID, collaboratorTableMetadata.tableContainer, jsonedNodes);
});
}
@ -238,6 +238,11 @@ function createTable(tableID, tableContainer, tableData) {
$.each(tableData, function(i, item){
/*
* Make sure that we dont append a row that belong to the ego in the "co-investigator/author" table.
* */
if (item.url !== unEncodedEgoURI) {
number_of_works = item[collaboratorTableMetadata.jsonNumberWorksProperty];
var row = $('<tr>');
@ -246,6 +251,7 @@ function createTable(tableID, tableContainer, tableData) {
row.append($('<td>').html(number_of_works));
table.append(row);
}
});

View file

@ -28,8 +28,10 @@
<#assign mapOfScienceIcon = '${urls.images}/visualization/mapofscience/vivo-scimap.png'>
<#assign entityMapOfScienceDataURL = "${urls.base}${dataVisualizationURLRoot}?vis=${mapOfScienceVisParam}&uri=${entityURI}&output=json">
<#assign entityMapOfScienceDisciplineCSVURL = "${urls.base}${dataVisualizationURLRoot}?vis=${mapOfScienceVisParam}&uri=${entityURI}&output=csv&vis_mode=discipline">
<#assign entityMapOfScienceSubDisciplineCSVURL = "${urls.base}${dataVisualizationURLRoot}?vis=${mapOfScienceVisParam}&uri=${entityURI}&output=csv&vis_mode=subdiscipline">
<#assign entityMapOfScienceUnlocatedJournalsCSVURL = "${urls.base}${dataVisualizationURLRoot}?vis=${mapOfScienceVisParam}&uri=${entityURI}&output=csv&vis_mode=unlocated_journals">
<script language="JavaScript" type="text/javascript">

View file

@ -66,7 +66,15 @@ corresponding changes in the included Templates. -->
mapped <span id="percent-mapped"></span>% of <span id="total-publications"></span> publications
<img class="filterInfoIcon" id="imageIconThree" src="${urls.images}/iconInfo.png"
alt="information icon"
title="" /></div>
title="" />
<div id="download-unlocated-journal-info">
<a href="${entityMapOfScienceUnlocatedJournalsCSVURL}">Save Unlocated Journals</a>
</div>
</div>
</div>
</div>

View file

@ -93,6 +93,7 @@ public class VisualizationFrameworkConstants {
* */
public static final String DISCIPLINE_TO_ACTIVTY_VIS_MODE = "discipline";
public static final String SUBDISCIPLINE_TO_ACTIVTY_VIS_MODE = "subdiscipline";
public static final String SCIENCE_UNLOCATED_JOURNALS_VIS_MODE = "unlocated_journals";
/*

View file

@ -176,8 +176,6 @@ public class MapOfScienceVisualizationRequestHandler implements
}
/**
* Provides response when json file containing the publication count over the
* years is requested.
* @param vitroRequest
*
* @param entity
@ -210,6 +208,14 @@ public class MapOfScienceVisualizationRequestHandler implements
outputFileName += "_subdiscipline-to-publications" + ".csv";
} else if (VisualizationFrameworkConstants.SCIENCE_UNLOCATED_JOURNALS_VIS_MODE
.equalsIgnoreCase(vitroRequest.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY))) {
fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
getUnlocatedJournalsCSVContent(entity));
outputFileName += "_unlocated-journals" + ".csv";
} else {
fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
@ -440,7 +446,7 @@ public class MapOfScienceVisualizationRequestHandler implements
}
return new PublicationJournalStats(publicationsWithNoJournalCount, journalToPublicationCount);
return new PublicationJournalStats(publicationsWithNoJournalCount, journalToPublicationCount, null);
}
private void updateEntityMapOfScienceInformation(MapOfScience entityJson,
@ -488,7 +494,8 @@ public class MapOfScienceVisualizationRequestHandler implements
csvFileContent.append("Discipline, Publication Count, % Activity\n");
ScienceMappingResult result = extractScienceMappingResultFromActivities(subjectEntity);
PublicationJournalStats stats = extractScienceMappingResultFromActivities(subjectEntity);
ScienceMappingResult result = stats.scienceMapping;
Map<Integer, Float> disciplineToPublicationCount = new HashMap<Integer, Float>();
@ -550,6 +557,38 @@ public class MapOfScienceVisualizationRequestHandler implements
return csvFileContent.toString();
}
private String getUnlocatedJournalsCSVContent(Entity subjectEntity) {
StringBuilder csvFileContent = new StringBuilder();
csvFileContent.append("Journal, Publication Count\n");
PublicationJournalStats stats = extractScienceMappingResultFromActivities(subjectEntity);
ScienceMappingResult result = stats.scienceMapping;
DecimalFormat percentageActivityFormat = new DecimalFormat("#.#");
csvFileContent.append(StringEscapeUtils.escapeCsv("No Journal"));
csvFileContent.append(", ");
csvFileContent.append(percentageActivityFormat.format(stats.noJournalCount));
csvFileContent.append("\n");
if (result != null) {
Map<String, Float> mappedResult = result.getUnmappedResult();
for (Map.Entry<String, Float> currentUnMappedJournal : mappedResult.entrySet()) {
csvFileContent.append(StringEscapeUtils.escapeCsv(currentUnMappedJournal.getKey()));
csvFileContent.append(", ");
csvFileContent.append(percentageActivityFormat.format(currentUnMappedJournal.getValue()));
csvFileContent.append("\n");
}
}
return csvFileContent.toString();
}
private String getSubDisciplineToPublicationsCSVContent(Entity subjectEntity) {
@ -557,7 +596,8 @@ public class MapOfScienceVisualizationRequestHandler implements
csvFileContent.append("Sub-Discipline, Publication Count, % Activity\n");
ScienceMappingResult result = extractScienceMappingResultFromActivities(subjectEntity);
PublicationJournalStats stats = extractScienceMappingResultFromActivities(subjectEntity);
ScienceMappingResult result = stats.scienceMapping;
Float totalMappedPublications = new Float(0);
@ -603,7 +643,7 @@ public class MapOfScienceVisualizationRequestHandler implements
return csvFileContent.toString();
}
private ScienceMappingResult extractScienceMappingResultFromActivities(
private PublicationJournalStats extractScienceMappingResultFromActivities(
Entity subjectEntity) {
Set<Activity> publicationsForEntity = new HashSet<Activity>();
@ -615,20 +655,24 @@ public class MapOfScienceVisualizationRequestHandler implements
PublicationJournalStats publicationStats = getPublicationJournalStats(publicationsForEntity);
ScienceMappingResult result = getScienceMappingResult(publicationStats.journalToPublicationCount);
return result;
publicationStats.scienceMapping = getScienceMappingResult(publicationStats.journalToPublicationCount);
return publicationStats;
}
private class PublicationJournalStats {
int noJournalCount;
Map<String, Integer> journalToPublicationCount;
ScienceMappingResult scienceMapping;
public PublicationJournalStats(int noJournalCount,
Map<String, Integer> journalToPublicationCount) {
Map<String, Integer> journalToPublicationCount,
ScienceMappingResult scienceMapping) {
this.noJournalCount = noJournalCount;
this.journalToPublicationCount = journalToPublicationCount;
this.scienceMapping = scienceMapping;
}
}

View file

@ -64,11 +64,6 @@ public class TemporalGrantVisualizationRequestHandler implements
}
/* System.out.println("current models in the system are");
for (Map.Entry<String, Model> entry : ConstructedModelTracker.getAllModels().entrySet()) {
System.out.println(entry.getKey() + " -> " + entry.getValue().size());
}
*/
return prepareStandaloneMarkupResponse(vitroRequest, entityURI);
}
@ -176,15 +171,6 @@ public class TemporalGrantVisualizationRequestHandler implements
Map<String, Activity> grantURIForAssociatedPeopleToVO = new HashMap<String, Activity>();
Map<String, Activity> allGrantURIToVO = new HashMap<String, Activity>();
/**
* TODO: Change this to use DataSet when an optimum solution is reached. Currently grant constructs are causing
* endless wait times on a large dataset like UFl. When I tried to add all the datasets manually to the Datasource
* it responded in an order of magnitude higher than with just the defaultOntModel.
* Brian Lowe is looking into this weird behavior see http://issues.library.cornell.edu/browse/NIHVIVO-2275
*/
// DataSource dataSource = DatasetFactory.create();
// dataSource.setDefaultModel(vitroRequest.getJenaOntModel());
allGrantURIToVO = SelectOnModelUtilities.getGrantsForAllSubOrganizations(dataset, organizationEntity);
Entity organizationWithAssociatedPeople = SelectOnModelUtilities