1. Improved wordings for the hover-over for bars in the legend,
This commit is contained in:
parent
c8a8f27937
commit
1e55fe9f1f
2 changed files with 26 additions and 12 deletions
|
@ -678,9 +678,10 @@ function createLegendRow(entity, bottomDiv) {
|
||||||
|
|
||||||
unknownBar.append(unknownBarInnerSpan);
|
unknownBar.append(unknownBarInnerSpan);
|
||||||
|
|
||||||
|
barDiv.append(unknownBar);
|
||||||
barDiv.append(knownBar);
|
barDiv.append(knownBar);
|
||||||
barDiv.append(currentYearBar);
|
barDiv.append(currentYearBar);
|
||||||
barDiv.append(unknownBar);
|
|
||||||
|
|
||||||
var numAttributeText = $('<span>');
|
var numAttributeText = $('<span>');
|
||||||
numAttributeText.attr('class', 'bar-count-text');
|
numAttributeText.attr('class', 'bar-count-text');
|
||||||
|
@ -718,12 +719,14 @@ function renderBarAndLabel(entity, divBar, divLabel, spanElement) {
|
||||||
|
|
||||||
if (combinedCount.unknownYearCount) {
|
if (combinedCount.unknownYearCount) {
|
||||||
var unknownNormalizedWidth = getNormalizedWidth(entity, combinedCount.unknownYearCount);
|
var unknownNormalizedWidth = getNormalizedWidth(entity, combinedCount.unknownYearCount);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var unknownNormalizedWidth = 0;
|
var unknownNormalizedWidth = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (combinedCount.currentYearCount) {
|
if (combinedCount.currentYearCount) {
|
||||||
var currentNormalizedWidth = getNormalizedWidth(entity, combinedCount.currentYearCount);
|
var currentNormalizedWidth = getNormalizedWidth(entity, combinedCount.currentYearCount);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var currentNormalizedWidth = 0;
|
var currentNormalizedWidth = 0;
|
||||||
}
|
}
|
||||||
|
@ -733,17 +736,26 @@ function renderBarAndLabel(entity, divBar, divLabel, spanElement) {
|
||||||
divBar.children(".current-year-bar").html(" ").css("background-color", colorToAssign).css("width", currentNormalizedWidth);
|
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);
|
divBar.children(".unknown-bar").children(".unknown-inner-bar").html(" ").css("background-color", colorToAssign).css("width", unknownNormalizedWidth);
|
||||||
|
|
||||||
|
var countExplanation = (combinedCount.knownYearCount - combinedCount.currentYearCount) + ' of '
|
||||||
|
+ sum + ' were ' + COMPARISON_PARAMETERS_INFO[currentParameter].verbName + " in a completed year";
|
||||||
|
|
||||||
|
divBar.children(".known-bar").attr("title", countExplanation);
|
||||||
|
|
||||||
|
countExplanation = combinedCount.currentYearCount + ' of '
|
||||||
|
+ sum + ' were ' + COMPARISON_PARAMETERS_INFO[currentParameter].verbName + ' in the current incomplete year (not charted above)';
|
||||||
|
|
||||||
|
divBar.children(".current-year-bar").attr("title", countExplanation);
|
||||||
|
|
||||||
|
countExplanation = combinedCount.unknownYearCount + ' of '
|
||||||
|
+ sum + ' have an unknown ' + COMPARISON_PARAMETERS_INFO[currentParameter].name + " year (not charted above)";
|
||||||
|
|
||||||
|
divBar.children(".unknown-bar").attr("title", countExplanation);
|
||||||
|
|
||||||
var entityLabelForLegend = divLabel.find(".entity-label-url");
|
var entityLabelForLegend = divLabel.find(".entity-label-url");
|
||||||
entityLabelForLegend.html(entity.label);
|
entityLabelForLegend.html(entity.label);
|
||||||
entityLabelForLegend.ellipsis();
|
entityLabelForLegend.ellipsis();
|
||||||
entityLabelForLegend.wrap("<a class='entity-url' title='" + entity.label + "' href='" + getVIVOURL(entity.entityURI) + "'></a>");
|
entityLabelForLegend.wrap("<a class='entity-url' title='" + entity.label + "' href='" + getVIVOURL(entity.entityURI) + "'></a>");
|
||||||
|
|
||||||
var countExplanation = 'VIVO knows the ' + COMPARISON_PARAMETERS_INFO[currentParameter].name + ' year for '
|
|
||||||
+ combinedCount.knownYearCount + ' out of '
|
|
||||||
+ sum + ' of these ' + COMPARISON_PARAMETERS_INFO[currentParameter].pluralName;
|
|
||||||
|
|
||||||
divBar.attr("title", countExplanation);
|
|
||||||
|
|
||||||
spanElement.text(sum).css("font-size", "0.8em").css("color", "#595B5B");
|
spanElement.text(sum).css("font-size", "0.8em").css("color", "#595B5B");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
<#assign publicationParameter = { "name": "publication",
|
<#assign publicationParameter = { "name": "publication",
|
||||||
"pluralName": "publications",
|
"pluralName": "publications",
|
||||||
|
"verbName": "published",
|
||||||
"dropDownText": "by Publications",
|
"dropDownText": "by Publications",
|
||||||
"viewLink": "${organizationPublicationTemporalGraphURL}",
|
"viewLink": "${organizationPublicationTemporalGraphURL}",
|
||||||
"viewBaseLink": "${subOrganizationPublicationTemporalGraphCommonURL}",
|
"viewBaseLink": "${subOrganizationPublicationTemporalGraphCommonURL}",
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
|
|
||||||
<#assign grantParameter = { "name": "grant",
|
<#assign grantParameter = { "name": "grant",
|
||||||
"pluralName": "grants",
|
"pluralName": "grants",
|
||||||
|
"verbName": "granted",
|
||||||
"dropDownText": "by Grants",
|
"dropDownText": "by Grants",
|
||||||
"viewLink": "${organizationGrantTemporalGraphURL}",
|
"viewLink": "${organizationGrantTemporalGraphURL}",
|
||||||
"viewBaseLink": "${subOrganizationGrantTemporalGraphCommonURL}",
|
"viewBaseLink": "${subOrganizationGrantTemporalGraphCommonURL}",
|
||||||
|
|
Loading…
Add table
Reference in a new issue