diff --git a/productMods/css/visualization/entitycomparison/layout.css b/productMods/css/visualization/entitycomparison/layout.css index ae99242c..a9cd0398 100644 --- a/productMods/css/visualization/entitycomparison/layout.css +++ b/productMods/css/visualization/entitycomparison/layout.css @@ -14,7 +14,7 @@ } #subject-parent-entity { - display: none; + display: none; } #error-container { @@ -25,15 +25,21 @@ float: right; } +.current-year-bar, .known-bar { - display: inline-block; - cursor: help; + display: inline-block; + cursor: help; +} + +.current-year-bar { + opacity: 0.5; + filter:alpha(opacity=50); } .unknown-inner-bar { - opacity: 0.5; - filter:alpha(opacity=50); - display: inline-block; + opacity: 0.5; + filter:alpha(opacity=50); + display: inline-block; } .bar-count-text { @@ -42,36 +48,41 @@ } img.bar-count-icon { - vertical-align: super; - cursor: help; + vertical-align: super; + cursor: help; } .unknown-bar { - background: url("../../../images/visualization/diagonal.png") repeat scroll 50% 50% #666666; - cursor: help; + background: url("../../../images/visualization/diagonal.png") repeat scroll 50% 50% #666666; + cursor: help; } .legend-bar { - margin-bottom: 3px; - cursor:default; + margin-bottom: 3px; + cursor:default; +} + +.current-year-legend-bar { + display: inline-block; } .unknown-legend-bar { - background: url("../../../images/visualization/legend-unknown-bar-dark.png") repeat #B7B7B7; + background: url("../../../images/visualization/legend-unknown-bar-dark.png") repeat #B7B7B7; } +#legend-current-year-bar-text, #legend-known-bar-text, #legend-unknown-bar-text { - font-size: 0.75em; + font-size: 0.75em; } span#copy-vis-viewlink { - display: none; + display: none; } img#copy-vis-viewlink-icon { - cursor: pointer; + cursor: pointer; } a.temporalGraphLinks { diff --git a/productMods/js/visualization/entitycomparison/util.js b/productMods/js/visualization/entitycomparison/util.js index 245f064b..d150a44d 100644 --- a/productMods/js/visualization/entitycomparison/util.js +++ b/productMods/js/visualization/entitycomparison/util.js @@ -224,8 +224,9 @@ function init(graphContainer) { $("#comparisonParameter").text("Total Number of " + optionSelected); $('#yaxislabel').html("Number of " + optionSelected).mbFlipText(false); $('#comparisonHeader').html(optionSelected).css('font-weight', 'bold'); - $('#legend-known-bar-text').text("Known " + COMPARISON_PARAMETERS_INFO[currentParameter].name + " year"); - $('#legend-unknown-bar-text').text("Unknown " + COMPARISON_PARAMETERS_INFO[currentParameter].name + " year"); + $('#legend-known-bar-text').text(COMPARISON_PARAMETERS_INFO[currentParameter].name + " with known year"); + $('#legend-current-year-bar-text').text(COMPARISON_PARAMETERS_INFO[currentParameter].name + " from current incomplete year"); + $('#legend-unknown-bar-text').text(COMPARISON_PARAMETERS_INFO[currentParameter].name + "with unknown year"); var defaultFlotOptions = { @@ -512,6 +513,7 @@ function calcSumOfComparisonParameter(entity) { var known = 0; var unknown = 0; + var currentYear = 0; $.each(entity.data, function(index, data){ @@ -519,15 +521,18 @@ function calcSumOfComparisonParameter(entity) { unknown += this[1]; } else { known += this[1]; + + if (this[0] === globalDateObject.getFullYear()) { + currentYear += this[1]; + } } - - }); sum = { knownYearCount: known, - unknownYearCount: unknown + unknownYearCount: unknown, + currentYearCount: currentYear }; return sum; @@ -660,6 +665,9 @@ function createLegendRow(entity, bottomDiv) { var knownBar = $(''); knownBar.attr('class', 'known-bar'); + + var currentYearBar = $(''); + currentYearBar.attr('class', 'current-year-bar'); var unknownBar = $(''); unknownBar.attr('class', 'unknown-bar'); @@ -671,6 +679,7 @@ function createLegendRow(entity, bottomDiv) { unknownBar.append(unknownBarInnerSpan); barDiv.append(knownBar); + barDiv.append(currentYearBar); barDiv.append(unknownBar); var numAttributeText = $(''); @@ -705,7 +714,7 @@ function renderBarAndLabel(entity, divBar, divLabel, spanElement) { var sum = combinedCount.knownYearCount + combinedCount.unknownYearCount; var normalizedWidth = getNormalizedWidth(entity, sum); - var knownNormalizedWidth = getNormalizedWidth(entity, combinedCount.knownYearCount); + var knownNormalizedWidth = getNormalizedWidth(entity, combinedCount.knownYearCount - combinedCount.currentYearCount); if (combinedCount.unknownYearCount) { var unknownNormalizedWidth = getNormalizedWidth(entity, combinedCount.unknownYearCount); @@ -713,8 +722,15 @@ function renderBarAndLabel(entity, divBar, divLabel, spanElement) { var unknownNormalizedWidth = 0; } + if (combinedCount.currentYearCount) { + var currentNormalizedWidth = getNormalizedWidth(entity, combinedCount.currentYearCount); + } else { + var currentNormalizedWidth = 0; + } + divBar.css("width", normalizedWidth + 5); divBar.children(".known-bar").html(" ").css("background-color", colorToAssign).css("width", knownNormalizedWidth); + divBar.children(".current-year-bar").html(" ").css("background-color", colorToAssign).css("width", currentNormalizedWidth); divBar.children(".unknown-bar").children(".unknown-inner-bar").html(" ").css("background-color", colorToAssign).css("width", unknownNormalizedWidth); var entityLabelForLegend = divLabel.find(".entity-label-url"); diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonBody.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonBody.ftl index 3d8211e0..417af4fe 100644 --- a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonBody.ftl +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonBody.ftl @@ -2,11 +2,11 @@
-
-   - -
- +
+   + +
+

${organizationLabel}  information icon

@@ -97,7 +97,8 @@

Legend

-   Known ${currentParameterObject.name} year
-   Unknown ${currentParameterObject.name} year +   ${currentParameterObject.name} with known year
+   ${currentParameterObject.name} from current incomplete year
+   ${currentParameterObject.name} with unknown year \ No newline at end of file