Check in map of science's comparison view for 1.4 release testing
Remaining works: - support csv download for sub-entity - show sub-entity mapping results
This commit is contained in:
parent
60a87403d1
commit
be65655c7e
14 changed files with 895 additions and 316 deletions
|
@ -14,22 +14,110 @@ function switchMarkerManager(id) {
|
|||
}
|
||||
}
|
||||
|
||||
function createVisModeController(visMode) {
|
||||
if (visMode === ENTITY_VIS_MODE) {
|
||||
var controller = new EntityVisModeController(map);
|
||||
visModeControllers[controller.visMode] = controller;
|
||||
}
|
||||
|
||||
if (visMode === COMPARISON_VIS_MODE) {
|
||||
var controller = new ComparisonVisModeController(map);
|
||||
visModeControllers[controller.visMode] = controller;
|
||||
controller.loadData(scienceMapDataURL, false);
|
||||
}
|
||||
}
|
||||
|
||||
function isActiveVisMode(visMode) {
|
||||
return (currentVisMode == visMode);
|
||||
return (currentVisMode === visMode);
|
||||
}
|
||||
|
||||
function getVisModeController(visMode){
|
||||
if (visModeControllers[visMode] == null) {
|
||||
createVisModeController(visMode);
|
||||
}
|
||||
return visModeControllers[visMode];
|
||||
}
|
||||
|
||||
function switchVisMode(visMode) {
|
||||
if (currentVisMode != visMode) {
|
||||
currentVisMode = visMode;
|
||||
if (!isActiveVisMode(visMode)) {
|
||||
if (currentController) {
|
||||
currentController.cleanView();
|
||||
}
|
||||
currentController = getVisModeController(visMode);
|
||||
currentVisMode = visMode;
|
||||
currentController.initView();
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
function initFilter(dom) {
|
||||
|
||||
// Switch filter handling
|
||||
$("." + dom.filterOptionClass).live('click', function() {
|
||||
var obj = $(this);
|
||||
if (!obj.hasClass(dom.activeFilterClass)) {
|
||||
var checked = obj.attr('id');
|
||||
if (checked === dom.secondFilterID) {
|
||||
$("#" + dom.firstFilterID).removeClass(dom.activeFilterClass);
|
||||
currentController.changeFilter(2);
|
||||
|
||||
} else if (checked === dom.firstFilterID) {
|
||||
$("#" + dom.secondFilterID).removeClass(dom.activeFilterClass);
|
||||
currentController.changeFilter(1);
|
||||
}
|
||||
|
||||
obj.addClass(dom.activeFilterClass);
|
||||
}
|
||||
});
|
||||
|
||||
$("#" + dom.firstFilterID).trigger('click');
|
||||
}
|
||||
|
||||
function initVisModeTypeButton() {
|
||||
// Switch vis mode handling
|
||||
var viewTypeRadio = "input[name='view-type']";
|
||||
$(viewTypeRadio).change( function() {
|
||||
var visMode = $(viewTypeRadio+ ":checked").val();
|
||||
switchVisMode(visMode);
|
||||
});
|
||||
|
||||
/* Init default filter */
|
||||
$(viewTypeRadio+ ":eq(0)").click();
|
||||
}
|
||||
|
||||
function initGlobalToolTips() {
|
||||
|
||||
createToolTip($("#imageIconOne"), $('#toolTipOne').html(), "topLeft");
|
||||
createToolTip($("#imageIconThree"), $('#toolTipThree').html(), "topRight");
|
||||
}
|
||||
|
||||
function createToolTip(target, tipText, tipLocation) {
|
||||
target.qtip({
|
||||
content: {
|
||||
text: tipText
|
||||
},
|
||||
position: {
|
||||
corner: {
|
||||
target: 'center',
|
||||
tooltip: tipLocation
|
||||
}
|
||||
},
|
||||
show: {
|
||||
when: {
|
||||
event: 'mouseover'
|
||||
}
|
||||
},
|
||||
hide: {
|
||||
fixed: true // Make it fixed so it can be hovered over
|
||||
},
|
||||
style: {
|
||||
padding: '6px 6px',
|
||||
// Give it some extra padding
|
||||
width: 500,
|
||||
textAlign: 'left',
|
||||
backgroundColor: '#ffffc0',
|
||||
fontSize: '.7em',
|
||||
padding: '6px 10px 6px 10px',
|
||||
lineHeight: '14px'
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue