diff --git a/productMods/css/visualization/entitycomparison/layout.css b/productMods/css/visualization/entitycomparison/layout.css index 36f5746c..381646e6 100644 --- a/productMods/css/visualization/entitycomparison/layout.css +++ b/productMods/css/visualization/entitycomparison/layout.css @@ -20,6 +20,55 @@ .easy-deselect-label a.temporal-vis-url { float: right; } + +.known-bar { + display: inline-block; + cursor: help; +} + +.unknown-inner-bar { + opacity: 0.5; + filter:alpha(opacity=50); + display: inline-block; +} + +.bar-count-text { + padding-right: 3px; + vertical-align: super; +} + +img.bar-count-icon { + vertical-align: super; + cursor: help; +} + +.unknown-bar { + background: url("../../../images/visualization/diagonal.png") repeat scroll 50% 50% #666666; + cursor: help; +} + +.legend-bar { + margin-bottom: 3px; +} + +.unknown-legend-bar { + background: url("../../../images/visualization/legend-unknown-bar-dark.png") repeat #B7B7B7; +} + + +#legend-known-bar-text, +#legend-unknown-bar-text { + font-size: 0.75em; +} + +span#copy-vis-viewlink { + display: none; +} + +img#copy-vis-viewlink-icon { + cursor: pointer; +} + a.temporalGraphLinks { background-color: #2485AE; color: white; @@ -224,4 +273,4 @@ p.displayCounter{ #noPubsOrGrants-span a { color: #84a655; font-size:16px; -} +} \ No newline at end of file diff --git a/productMods/images/iconInfo-small.png b/productMods/images/iconInfo-small.png new file mode 100644 index 00000000..cd825c43 Binary files /dev/null and b/productMods/images/iconInfo-small.png differ diff --git a/productMods/images/visualization/diagonal.png b/productMods/images/visualization/diagonal.png new file mode 100644 index 00000000..64ece570 Binary files /dev/null and b/productMods/images/visualization/diagonal.png differ diff --git a/productMods/images/visualization/legend-unknown-bar-dark.png b/productMods/images/visualization/legend-unknown-bar-dark.png new file mode 100644 index 00000000..91e19084 Binary files /dev/null and b/productMods/images/visualization/legend-unknown-bar-dark.png differ diff --git a/productMods/images/visualization/legend-unknown-bar-light.png b/productMods/images/visualization/legend-unknown-bar-light.png new file mode 100644 index 00000000..f545ae68 Binary files /dev/null and b/productMods/images/visualization/legend-unknown-bar-light.png differ diff --git a/productMods/js/visualization/entitycomparison/constants.js b/productMods/js/visualization/entitycomparison/constants.js index 823b32fd..17f50395 100644 --- a/productMods/js/visualization/entitycomparison/constants.js +++ b/productMods/js/visualization/entitycomparison/constants.js @@ -37,8 +37,8 @@ var globalDateObject; var year; var colors, prevColor, colorToAssign, - colorToRemove, renderedObjects, labelToEntityRecord, - setOfLabels, labelToCheckedEntities, stopWordsToCount; + colorToRemove, renderedObjects, URIToEntityRecord, + setOfLabels, URIToCheckedEntities, stopWordsToCount; var graphContainer; var tableDiv; @@ -66,9 +66,9 @@ function initConstants() { prevColor = {}; colorToAssign, colorToRemove; renderedObjects = []; - labelToEntityRecord = {}; + URIToEntityRecord = {}; setOfLabels = []; - labelToCheckedEntities = {}; + URIToCheckedEntities = {}; stopWordsToCount = {}; lastCachedAtDateTimes = []; //options for Flot @@ -100,7 +100,5 @@ function initConstants() { borderColor : "#D9D9D9" } }; - FlotOptions.colors = colorConstantQueue; - } \ No newline at end of file diff --git a/productMods/js/visualization/entitycomparison/gui-event-manager.js b/productMods/js/visualization/entitycomparison/gui-event-manager.js index 5068b0f5..c9f0a8b8 100644 --- a/productMods/js/visualization/entitycomparison/gui-event-manager.js +++ b/productMods/js/visualization/entitycomparison/gui-event-manager.js @@ -3,9 +3,10 @@ $(document).ready(function() { /* - * This will set intitial values of the constants present in constants.js + * This will set initial values of the constants present in constants.js * */ initConstants(); + /* This is used to cache the current state whether the user is allowed to select more entities from the datatable or not. Once Max number of entity selection is reached the user can no longer select more & this variable will be set to false. */ @@ -27,34 +28,45 @@ $(document).ready(function() { var selectedValue = $("select.comparisonValues option:selected").val(); - var selectedParameter; + var selectedDataURL; $.each(COMPARISON_PARAMETERS_INFO, function(index, parameter) { if (parameter.value === selectedValue) { - selectedParameter = parameter; - window.location = parameter.viewLink; + + currentParameter = parameter.name; + selectedDataURL = parameter.dataLink; } }); - //$("#body").empty().html("
'); - parentP.attr('id', slugify(entity.label)); + parentP.attr('id', slugify(entity.entityURI)); var labelDiv = $('
'); entityLabelTH.html('Entity Name'); - var publicationCountTH = $(' | '); + var activityCountTH = $(' | '); if ($("select.comparisonValues option:selected").text() === "by Publications") { - publicationCountTH.html('Publication Count'); + activityCountTH.html('Publication Count'); } else { - publicationCountTH.html('Grant Count'); + activityCountTH.html('Grant Count'); } + activityCountTH.attr("id", "activity-count-column"); var entityTypeTH = $(' | '); entityTypeTH.html('Entity Type'); tr.append(checkboxTH); tr.append(entityLabelTH); - tr.append(publicationCountTH); + tr.append(activityCountTH); tr.append(entityTypeTH); thead.append(tr); @@ -1005,20 +1053,26 @@ function prepareTableForDataTablePagination(jsonData, dataTableParams){ table.append(thead); var tbody = $(' | '); + var checkboxCount = 0; - $.each(labelToEntityRecord, function(index, val){ + $.each(URIToEntityRecord, function(index, val) { var entityTypesWithoutStopWords = removeStopWords(val); var row = $('
---|---|---|---|
');
- checkboxTD.html(' | '); labelTD.css("width", "100px"); - labelTD.html(index); + labelTD.html(val.label); var publicationCountTD = $(' | '); - publicationCountTD.html(calcSumOfComparisonParameter(val)); + + var combinedCount = calcSumOfComparisonParameter(val); + + publicationCountTD.html(combinedCount.knownYearCount + combinedCount.unknownYearCount); var entityTypeTD = $(' | ');
entityTypeTD.html(entityTypesWithoutStopWords);
@@ -1076,6 +1130,91 @@ function prepareTableForDataTablePagination(jsonData, dataTableParams){
}
+
+/*
+ * function to create a table to be
+ * used by jquery.dataTables. The JsonObject
+ * returned is used to populate the pagination table.
+ */
+function reloadDataTablePagination(preselectedEntityURIs, jsonData){
+
+ resetStopWordCount();
+
+ /*
+ * In case no entities are selected, we want that redraw should happen so that top entities are
+ * pre-selected.
+ * */
+ var shouldRedraw = preselectedEntityURIs.length ? false : true;
+
+ var currentDataTable = $('#datatable').dataTable();
+
+ currentDataTable.fnClearTable();
+
+ if ($("select.comparisonValues option:selected").text() === "by Publications") {
+ $("#activity-count-column").html('Publication Count');
+ } else {
+ $("#activity-count-column").html('Grant Count');
+ }
+
+ function addNewRowAfterReload(entity) {
+
+ var checkboxTD = '![]() Legend + Known ${currentParameterObject.name} year+ Unknown ${currentParameterObject.name} year \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnGrantsStandalone.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnGrantsStandalone.ftl index 9a1de299..dd88f20d 100644 --- a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnGrantsStandalone.ftl +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnGrantsStandalone.ftl @@ -5,6 +5,12 @@ corresponding changes in the included Templates. --> <#assign currentParameter = "grant"> + + <#include "entityComparisonSetup.ftl"> <#assign temporalGraphDownloadFileLink = '${temporalGraphDownloadCSVCommonURL}&vis=entity_grant_count'> diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnPublicationsStandalone.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnPublicationsStandalone.ftl index be1b6eb1..abd59d55 100644 --- a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnPublicationsStandalone.ftl +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnPublicationsStandalone.ftl @@ -5,6 +5,12 @@ corresponding changes in the included Templates. --> <#assign currentParameter = "publication"> + + <#include "entityComparisonSetup.ftl"> <#assign temporalGraphDownloadFileLink = '${temporalGraphDownloadCSVCommonURL}&vis=entity_comparison'> diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonSetup.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonSetup.ftl index 799d6b93..c8a46376 100644 --- a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonSetup.ftl +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonSetup.ftl @@ -13,20 +13,27 @@ <#assign subOrganizationPublicationTemporalGraphCommonURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_comparison"> <#assign organizationPublicationTemporalGraphURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_comparison&uri=${organizationURI}"> +<#assign organizationPublicationTemporalGraphDataURL = "${urls.base}${dataVisualizationURLRoot}?vis=entity_comparison&uri=${organizationURI}&vis_mode=json"> + <#assign organizationGrantTemporalGraphURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_grant_count&uri=${organizationURI}"> +<#assign organizationGrantTemporalGraphDataURL = "${urls.base}${dataVisualizationURLRoot}?vis=entity_grant_count&uri=${organizationURI}&vis_mode=json"> <#assign temporalGraphSmallIcon = '${urls.images}/visualization/temporal_vis_small_icon.jpg'> <#assign temporalGraphDownloadCSVCommonURL = '${urls.base}${dataVisualizationURLRoot}?uri=${organizationURI}&labelField=label'> <#assign publicationParameter = { "name": "publication", + "pluralName": "publications", "dropDownText": "by Publications", - "viewLink": "${organizationPublicationTemporalGraphURL}", + "viewLink": "${organizationPublicationTemporalGraphURL}", + "dataLink": "${organizationPublicationTemporalGraphDataURL}", "value": "Publications" }> - + <#assign grantParameter = { "name": "grant", + "pluralName": "grants", "dropDownText": "by Grants", "viewLink": "${organizationGrantTemporalGraphURL}", + "dataLink": "${organizationGrantTemporalGraphDataURL}", "value": "Grants" }> <#assign parameterOptions = [publicationParameter, grantParameter]> @@ -42,6 +49,15 @@ we will default to using the stable version unless the request comes from IE 9 i we will use rev 293 (dev build version) of the flot & excanvas files. --> + + ${scripts.add('', '', '', @@ -50,6 +66,7 @@ ${scripts.add(' diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/cached/TemporalPublicationVisualizationRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/cached/TemporalPublicationVisualizationRequestHandler.java index 034ea98b..8179fd46 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/cached/TemporalPublicationVisualizationRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/cached/TemporalPublicationVisualizationRequestHandler.java @@ -15,7 +15,6 @@ import org.apache.commons.logging.Log; import com.google.gson.Gson; import com.hp.hpl.jena.query.Dataset; -import com.hp.hpl.jena.rdf.model.Model; import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; @@ -27,7 +26,6 @@ import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitycomparison.EntityComparisonUtilityFunctions; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Activity; -import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.ConstructedModelTracker; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Entity; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.JsonObject; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.SubEntity; @@ -58,11 +56,11 @@ public class TemporalPublicationVisualizationRequestHandler implements } - System.out.println("current models in the system are"); - for (Map.Entry |