Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…gets into feature/SearchResVis
  • Loading branch information
Lisa Wagner committed Nov 10, 2015
2 parents dd66070 + e1e8e35 commit 9e955c7
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 105 deletions.
12 changes: 6 additions & 6 deletions Dashboard/Geochart/geochart.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function Geochart(root, visTemplate) {
GEO.Evt = {

legendClicked : function( legend, legendIndex ) {
var selectedIndices = [];
/*var selectedIndices = [];
var selectedData = [];
var inputData = GEO.Input.data;
for (var i = 0; i < inputData.length; i++) {
Expand All @@ -69,30 +69,30 @@ function Geochart(root, visTemplate) {
legend.selected = false;
}
d3.selectAll('.legend').select("div").style("border", function(l, i){ if(i == legendIndex && legend.selected) return "0.1em lime solid"; return "none"; });

*/
},


legendMouseOvered : function(d){

d3.select(this).select("div")
/*d3.select(this).select("div")
.style("border", "0.1em yellow solid")
.style("width", "1.4em")
.style("height", "1.4em");
d3.select(this).select("text")
.style("font-size", "0.9em");
.style("font-size", "0.9em"); */
},

legendMouseOuted : function(d){

d3.select(this).select("div")
/* d3.select(this).select("div")
.style("border", function(){ if(d.selected) return "0.1em lime solid"; return "none"; })
.style("width", function(){ if(d.selected) return "1.4em"; return "1.5em"; })
.style("height", function(){ if(d.selected) return "1.4em"; return "1.5em"; });
d3.select(this).select("text")
.style("font-size", "0.85em");
.style("font-size", "0.85em"); */

}
};
Expand Down
12 changes: 6 additions & 6 deletions Dashboard/Timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function Timeline( root, visTemplate ){
* */
TIMEVIS.Evt.legendClicked = function( legendDatum, legendIndex ){

var indicesToHighlight = [];
/*var indicesToHighlight = [];
var dataToHighlight = [];
if( legendDatum.selected === false ){
Expand Down Expand Up @@ -350,32 +350,32 @@ function Timeline( root, visTemplate ){
}
d3.selectAll('.legend').select("div")
.style("border", function(l, i){ if(i == legendIndex && legendDatum.selected) return "0.1em lime solid"; return "none"; });
.style("border", function(l, i){ if(i == legendIndex && legendDatum.selected) return "0.1em lime solid"; return "none"; }); */

};


TIMEVIS.Evt.legendMouseOvered = function(d){

d3.select(this).select("div")
/* d3.select(this).select("div")
.style("border", "0.1em yellow solid")
.style("width", "1.4em")
.style("height", "1.4em");
d3.select(this).select("text")
.style("font-size", "0.9em");
.style("font-size", "0.9em"); */
};


TIMEVIS.Evt.legendMouseOuted = function(d){

d3.select(this).select("div")
/*d3.select(this).select("div")
.style("border", function(){ if(d.selected) return "0.1em lime solid"; return "none"; })
.style("width", function(){ if(d.selected) return "1.4em"; return "1.5em"; })
.style("height", function(){ if(d.selected) return "1.4em"; return "1.5em"; });
d3.select(this).select("text")
.style("font-size", "0.85em");
.style("font-size", "0.85em"); */

};

Expand Down
3 changes: 2 additions & 1 deletion Dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<script type="text/javascript" src="libs/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="libs/jquery-dropdown/jquery.dropdown.min.js"></script>
<script type="text/javascript" src="libs/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="libs/lodash.js"></script>
<!--<script type="text/javascript" src="libs/lodash.js"></script>-->
<script type="text/javascript" src="uRank/modules/tagcloud/landscape/js/libs/underscore.js"></script>
<link rel="stylesheet" type="text/css" href="libs/jquery-ui/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="libs/jquery-dropdown/jquery.dropdown.min.css" />
<link rel="stylesheet" type="text/css" href="libs/leaflet/leaflet.css" />
Expand Down
3 changes: 2 additions & 1 deletion Dashboard/js/filterhandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,11 @@ var FilterHandler = {
return;

var type = FilterHandler.currentFilter.type;
if (_(FilterHandler.filters).some(function(item){ return item.type != FilterHandler.currentFilter.type; })){
if (!_(FilterHandler.filters).some(function(item){ return item.type == type; })){
FilterHandler.clearType(type);
} else {
FilterHandler.currentFilter = null;
FilterHandler.refreshFiltervisualisation(type);
}

FilterHandler.ext.selectItems();
Expand Down
145 changes: 94 additions & 51 deletions Dashboard/js/logginghandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var LoggingHandler = {
//loggingEndpoint: 'http://{SERVER}/eexcess-privacy-proxy-1.0-SNAPSHOT/api/v1/log/moduleStatisticsCollected',
visExt: undefined,
wasDocumentWindowOpened: false,
origin: { clientType: '', clientVersion: '', userID: '', module: 'RecDashboard' },
origin: { clientType: '', clientVersion: '', userID: 'SID' + Math.floor(Math.random() * 10000000000), module: 'RecDashboard' },

init: function(visExt){
LoggingHandler.browser = getBrowserInfo();
Expand Down Expand Up @@ -73,34 +73,32 @@ var LoggingHandler = {
if (LoggingHandler.buffer.length >= LoggingHandler.bufferSize){
LoggingHandler.sendBuffer();
}

LoggingHandler.directLog(logobject);
},

sendBuffer: function(){
var logData = {
"origin": LoggingHandler.origin,
"content": { logs: LoggingHandler.buffer},
"queryID": "XX" //A33B29B-BC67-426B-786D-322F85182DA6"
};
// calling centralized C4 logging API
api2.sendLog(api2.logInteractionType.moduleStatisticsCollected, logData, function(event, jqXHR) { console.log(event); console.log(jqXHR); });
//api2.sendLog(api2.logInteractionType.itemOpened, logData, function(event, jqXHR) { console.log(event); console.log(jqXHR); });
api2.moduleStatisticsCollected(LoggingHandler.origin, {logs: LoggingHandler.buffer}, globals.queryID);
LoggingHandler.buffer = [];
},

directLog: function(logobject){
if (logobject.action == "Item opened"){
api2.itemOpened(LoggingHandler.origin, { id: logobject.itemid }, globals.queryID);
} else if (logobject.action == "Link item clicked"){
api2.itemCitedAsHyperlink(LoggingHandler.origin, { id: logobject.itemid }, globals.queryID);
} else if (logobject.action == 'Link item image clicked'){
api2.itemCitedAsImage(LoggingHandler.origin, { id: logobject.itemid }, globals.queryID);
} else if (logobject.action == 'Dashboard opened'){
api2.moduleOpened(LoggingHandler.origin, "RecDashboard");
} else if (logobject.action == 'Window is closing'){
api2.moduleClosed(LoggingHandler.origin, 'RecDashboard', logobject.duration);
}
}
};


var api2 = {
logInteractionType: {
moduleOpened: "moduleOpened",
moduleClosed: "moduleClosed",
moduleStatisticsCollected: "moduleStatisticsCollected",
itemOpened: "itemOpened",
itemClosed: "itemClosed",
itemCitedAsImage: "itemCitedAsImage",
itemCitedAsText: "itemCitedAsText",
itemCitedAsHyperlink: "itemCitedAsHyperlink",
itemRated: "itemRated"
},
settings : {
//base_url: "https://eexcess-dev.joanneum.at/eexcess-privacy-proxy-issuer-1.0-SNAPSHOT/issuer/", // dev
base_url: "https://eexcess.joanneum.at/eexcess-privacy-proxy-issuer-1.0-SNAPSHOT/issuer/", // stable
Expand All @@ -111,42 +109,87 @@ var api2 = {
suffix_recommend: 'recommend',
suffix_details: 'getDetails',
suffix_favicon: 'getPartnerFavIcon?partnerId=',
suffix_log: 'log/',
origin: {
clientType: '',
clientVersion: '',
userID: ''
}
suffix_log: 'log/'
},
originException: function(errorMsg) {
this.toString = function() {
return errorMsg;

moduleOpened: function (origin, moduleName) {
if (typeof origin !== 'object') {throw new LoggingFormatException(origin, 'object')}
if (typeof moduleName != 'string') {throw new LoggingFormatException(moduleName, 'string')}
var eventData = {
origin: origin,
content: {
name: moduleName
}
};
api2.sendLog('moduleOpened', eventData);
},

complementOrigin : function(origin) {
// if (typeof origin === 'undefined') {
// throw new api2.originException("origin undefined");
// } else if (typeof origin.module === 'undefined') {
// throw new api2.originException("origin.module undfined");
// } else if (typeof api2.settings.origin === 'undefined') {
// throw new api2.originException('origin undefined (need to initialize via APIconnector.init({origin:{clientType:"<name of client>", clientVersion:"version nr",userID:"<UUID>"}})');
// } else if (typeof api2.settings.origin.clientType === 'undefined') {
// throw new api2.originException('origin.clientType undefined (need to initialize via APIconnector.init({origin:{clientType:"<name of client>"}})');
// } else if (typeof api2.settings.origin.clientVersion === 'undefined') {
// throw new api2.originException('origin.clientVersion undefined (need to initialize via APIconnector.init({origin:{clientVersion:"<version nr>"}})');
// } else if (typeof api2.settings.origin.userID === 'undefined') {
// throw new api2.originException('origin.userID undefined (need to initialize via APIconnector.init({origin:{userID:"<UUID>"}})');
// } else {
// origin.clientType = api2.settings.origin.clientType;
// origin.clientVersion = api2.settings.origin.clientVersion;
// origin.userID = api2.settings.origin.userID;
// }
return origin;
moduleClosed: function (origin, moduleName, duration) {
if (typeof origin != 'object') {throw new LoggingFormatException(origin, 'object')}
if (typeof moduleName != 'string') {throw new LoggingFormatException(moduleName, 'string')}
if (typeof duration != 'number') {throw new LoggingFormatException(duration, 'number')}
var eventData = {
origin: origin,
content: {
name: moduleName,
duration: duration
}
};
api2.sendLog('moduleClosed', eventData);
},
moduleStatisticsCollected: function (origin, statistics, queryID) {
if (typeof origin != 'object') {throw new LoggingFormatException(origin, 'object')}
var eventData = {
origin: origin,
content: statistics,
queryID: queryID
};
api2.sendLog('moduleStatisticsCollected', eventData);
},
itemOpened: function (origin, documentBadge, queryID) {
if (typeof origin != 'object') {throw new LoggingFormatException(origin, 'object')}
if (typeof documentBadge != 'object') {throw new LoggingFormatException(documentBadge, 'object')}
if (typeof queryID != 'string') {throw new LoggingFormatException(queryID, 'string')}
var eventData = {
origin: origin,
content: {
documentBadge: documentBadge
},
queryID: queryID
};
api2.sendLog('itemOpened', eventData);
},
//itemClosed: function (origin, documentBadge, queryID, duration) {
//},
itemCitedAsImage: function (origin, documentBadge, queryID) {
if (typeof origin != 'object') {throw new LoggingFormatException(origin, 'object')}
if (typeof documentBadge != 'object') {throw new LoggingFormatException(documentBadge, 'object')}
if (typeof queryID != 'string') {throw new LoggingFormatException(queryID, 'string')}
var eventData = {
origin: origin,
content: {
documentBadge: documentBadge
},
queryID: queryID
};
api2.sendLog('itemCitedAsImage', eventData);
},
//itemCitedAsText: function (origin, documentBadge, queryID) {
//},
itemCitedAsHyperlink: function (origin, documentBadge, queryID) {
if (typeof origin != 'object') {throw new LoggingFormatException(origin, 'object')}
if (typeof documentBadge != 'object') {throw new LoggingFormatException(documentBadge, 'object')}
if (typeof queryID != 'string') {throw new LoggingFormatException(queryID, 'string')}
var eventData = {
origin: origin,
content: {
documentBadge: documentBadge
},
queryID: queryID
};
api2.sendLog('itemCitedAsHyperlink', eventData);
},

sendLog: function(interactionType, logEntry, callback) {
logEntry.origin = api2.complementOrigin(logEntry.origin);
sendLog: function(interactionType, logEntry, callback) {
var xhr;
xhr = $.ajax({
url: api2.settings.base_url + api2.settings.suffix_log + interactionType,
Expand Down
5 changes: 4 additions & 1 deletion Dashboard/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function getUrankDimensions(root, rootWidth, rootHeight){
function getLandscapeDimensions(root, iWidth, rootWidth, rootHeight){

var rootHeight = $(root).height();
var legendWidth = 50;
var legendWidth = 60;

var margin = { top: 30, bottom: 5, left: 80, right: 20 };
var height = rootHeight - margin.top - margin.bottom;
Expand Down Expand Up @@ -125,6 +125,9 @@ Settings.prototype.getInitData = function( data, mappings, arg ){

function fixMissingAndMalformattedValues( data ){
var dataArray = [];
if (!data)
return dataArray;

data.forEach(function(d, i){
var obj = {};
obj['id'] = d.id;
Expand Down
10 changes: 9 additions & 1 deletion Dashboard/media/css/vis-template-style-.css
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ svg.timeline .node{
#div-wrap-legends {
display: inline-block;
margin-top: 5px;
width: 70px;
width: 80px;
}

/*
Expand Down Expand Up @@ -1381,6 +1381,14 @@ p.eexcess_ritem_short {
#eexcess_fixed_controls #eexcess_btnreset { background-image: url('../icons/dashboard-controls/24/reset.png'); }
#eexcess_fixed_controls #vis_dashboard_info { background-image: url('../icons/dashboard-controls/24/info.png'); }
#eexcess_fixed_controls #vis_dashboard_feedback { background-image: url('../icons/dashboard-controls/24/feedback.png'); }

.eexcess_mapping_container {
text-align: left;
}
#eexcess_mapping_container_0 > ul > li > label > input {
vertical-align: middle;
margin-top:1px;
}

#vis_feeadback_dialog textarea {
resize : none;
Expand Down
Loading

0 comments on commit 9e955c7

Please sign in to comment.