From 6c3818f84a4901687e0854053fb2898ab3aaf9ac Mon Sep 17 00:00:00 2001 From: tankchintan Date: Wed, 27 Jul 2011 21:44:45 +0000 Subject: [PATCH] 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. --- .../css/visualization/mapofscience/layout.css | 16 +++++ .../entitycomparison/gui-event-manager.js | 37 ++++++++--- .../visualization/personlevel/person-level.js | 24 ++++--- .../mapOfScience/mapOfScienceSetup.ftl | 2 + .../mapOfScience/mapOfScienceStandalone.ftl | 10 ++- .../VisualizationFrameworkConstants.java | 1 + ...pOfScienceVisualizationRequestHandler.java | 62 ++++++++++++++++--- ...poralGrantVisualizationRequestHandler.java | 14 ----- 8 files changed, 123 insertions(+), 43 deletions(-) diff --git a/productMods/css/visualization/mapofscience/layout.css b/productMods/css/visualization/mapofscience/layout.css index 787468f4..7e660c5a 100644 --- a/productMods/css/visualization/mapofscience/layout.css +++ b/productMods/css/visualization/mapofscience/layout.css @@ -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; } diff --git a/productMods/js/visualization/entitycomparison/gui-event-manager.js b/productMods/js/visualization/entitycomparison/gui-event-manager.js index c2f13537..b7f525bd 100644 --- a/productMods/js/visualization/entitycomparison/gui-event-manager.js +++ b/productMods/js/visualization/entitycomparison/gui-event-manager.js @@ -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(); @@ -379,7 +376,7 @@ var processJSONData = { * dynamically generate checkboxes */ loadData: function(jsonData, dataTableParams) { - + processJSONData.setupGlobals(jsonData, true); temporalGraphProcessor.dataTable = prepareTableForDataTablePagination(jsonData, dataTableParams); @@ -395,7 +392,7 @@ var processJSONData = { * dynamically generate checkboxes */ reloadData: function(preselectedEntityURIs, jsonData) { - + processJSONData.setupGlobals(jsonData); temporalGraphProcessor.dataTable = reloadDataTablePagination(preselectedEntityURIs, jsonData); @@ -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 = []; - $.each(URIToCheckedEntities, function(index, entity){ - currentSelectedEntityURIs.push(index); - }); + /* + * 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. */ diff --git a/productMods/js/visualization/personlevel/person-level.js b/productMods/js/visualization/personlevel/person-level.js index 4b7d5289..52dd0909 100644 --- a/productMods/js/visualization/personlevel/person-level.js +++ b/productMods/js/visualization/personlevel/person-level.js @@ -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,14 +238,20 @@ function createTable(tableID, tableContainer, tableData) { $.each(tableData, function(i, item){ - number_of_works = item[collaboratorTableMetadata.jsonNumberWorksProperty]; - - var row = $(''); - - row.append($('').html(item.label)); - row.append($('').html(number_of_works)); - - table.append(row); + /* + * 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 = $(''); + + row.append($('').html(item.label)); + row.append($('').html(number_of_works)); + + table.append(row); + } }); diff --git a/productMods/templates/freemarker/visualization/mapOfScience/mapOfScienceSetup.ftl b/productMods/templates/freemarker/visualization/mapOfScience/mapOfScienceSetup.ftl index 8034fbc4..7cb7304d 100644 --- a/productMods/templates/freemarker/visualization/mapOfScience/mapOfScienceSetup.ftl +++ b/productMods/templates/freemarker/visualization/mapOfScience/mapOfScienceSetup.ftl @@ -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">