Commit b3481133 authored by PkSM3's avatar PkSM3

pre-alpha version

parent 922747f9
@import url("//fonts.googleapis.com/css?family=Josefin+Sans:300,400,700"); /*@import url("//fonts.googleapis.com/css?family=Josefin+Sans:300,400,700");*/
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ /*! normalize.css v2.1.3 | MIT License | git.io/normalize */
......
...@@ -2,13 +2,21 @@ ...@@ -2,13 +2,21 @@
margin-bottom:1px; margin-bottom:1px;
} }
#defaultop{
min-height: 5%;
max-height: 10%;
}
#sigma-example { #sigma-example {
width: 100%; width: 100%;
height: 300px; height: 300px;
position:relative; position:relative;
float:right; float:left;
} }
/*.btn-sm[normal] {*/ /*.btn-sm[normal] {*/
/* background-image: -webkit-linear-gradient(#5f8ab9, #3e648d 50%, #385a7f);*/ /* background-image: -webkit-linear-gradient(#5f8ab9, #3e648d 50%, #385a7f);*/
/* background-image: linear-gradient(#5f8ab9, #3e648d 50%, #385a7f);*/ /* background-image: linear-gradient(#5f8ab9, #3e648d 50%, #385a7f);*/
...@@ -37,6 +45,7 @@ ...@@ -37,6 +45,7 @@
background-color:white; background-color:white;
color:#250587; color:#250587;
margin: 7px; margin: 7px;
padding: 3px;
border: 1px solid #666; border: 1px solid #666;
-moz-border-radius: 3px; -moz-border-radius: 3px;
-webkit-border-radius: 3px; -webkit-border-radius: 3px;
...@@ -46,12 +55,25 @@ ...@@ -46,12 +55,25 @@
box-shadow: 0px 2px 6px #000; box-shadow: 0px 2px 6px #000;
} }
/*.selection-item{
display:inline-block;
border:solid 1px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-khtml-border-radius: 6px;'+
border-color:#BDBDBD;
padding:0px 2px 0px 2px;
margin:1px 0px 1px 0px;
cursor: pointer;
}*/
#opossitesBox{ #opossitesBox{
margin: 7px; margin: 7px;
padding: 10px 0px 10px 10px; padding: 10px;
border-style:solid; border-style:solid;
background-color:white; background-color:white;
color:black;
margin: 7px; margin: 7px;
border: 1px solid #666; border: 1px solid #666;
-moz-border-radius: 3px; -moz-border-radius: 3px;
...@@ -62,6 +84,21 @@ ...@@ -62,6 +84,21 @@
box-shadow: 0px 2px 6px #000; box-shadow: 0px 2px 6px #000;
} }
.tagcloud-item{
display:inline-block;
border:solid 1px;
/*box-shadow: 0px 0px 0px 1px rgba(0,0,0,0.3); */
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-khtml-border-radius: 6px;'+
border-color:#BDBDBD;
padding:0px 2px 0px 2px;
margin:1px 0px 1px 0px;
cursor: pointer;
}
#topPapers{ #topPapers{
margin: 7px; margin: 7px;
padding: 10px 0px 10px 10px; padding: 10px 0px 10px 10px;
...@@ -86,11 +123,15 @@ ...@@ -86,11 +123,15 @@
.gradient { .gradient {
background-color: #f0f0f8; background-color: #f0f0f8;
background-image: -webkit-radial-gradient(#ffffff, #d8d8e0); background-image: -moz-radial-gradient(#ffffff, #d8d8e0); background-image: -webkit-radial-gradient(#ffffff, #d8d8e0); background-image: -moz-radial-gradient(#ffffff, #d8d8e0);
/*background-color: #434343;*/
/*background-image: linear-gradient(#434343, #282828);*/
background-image: linear-gradient(0deg, transparent 24%, rgba(0, 0, 0, .02) 25%, rgba(0, 0, 0, .02) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, .02) 75%, rgba(0, 0, 0, .02) 76%, transparent 77%, transparent), linear-gradient(90deg, transparent 24%, rgba(0, 0, 0, .02) 25%, rgba(0, 0, 0, .02) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, .02) 75%, rgba(0, 0, 0, .02) 76%, transparent 77%, transparent);
background-size: 50px 50px;
} }
/* ZOOM IN OUT */ /* ZOOM IN OUT */
#ctlzoom { #ctlzoom {
position: absolute; left: 220px; bottom: 5px; list-style: none; padding: 0; margin: 0;/*EDIT*/ position: absolute; right: 220px; bottom: 5px; list-style: none; padding: 0; margin: 0;/*EDIT*/
} }
#ctlzoom li { #ctlzoom li {
...@@ -182,11 +223,11 @@ ...@@ -182,11 +223,11 @@
#showChat{ #showChat{
position: absolute; top: 16px; left: -14px; width: 20px; height: 100px; background: rgb(250, 250, 252); padding: 2px 2px 2px 0; border-top-right-radius: 5px; border-bottom-right-radius: 5px; box-shadow: 1px 1px 2px #808090; position: absolute; top: 16px; right: -14px; width: 20px; height: 100px; background: rgb(250, 250, 252); padding: 2px 2px 2px 0; border-top-left-radius: 5px; border-bottom-left-radius: 5px; box-shadow: 1px 1px 2px #808090;
} }
#aShowChat { #aShowChat {
float: left; width: 100%; height: 100%; background-image: url("../tinawebJS/img/chat.png"); float: right; width: 100%; height: 100%; background-image: url("../tinawebJS/img/chat.png");
} }
...@@ -209,3 +250,29 @@ ...@@ -209,3 +250,29 @@
.rightarrow:hover { .rightarrow:hover {
background-position: 0 -12px; background-position: 0 -12px;
} }
#tips{
padding-left: 5%;
padding-right: 5%;
font-size:80%;
}
#tips ul{
/*list-style:none;*/
padding-left:10%;
}
#information {
font-size:80%;
}
#information ul {
list-style:none;
padding-left:5%;
}
.btn-sm:hover {
font-weight: bold;
}
@font-face {
font-family: 'Josefin Sans';
font-style: normal;
font-weight: 300;
src: local('Josefin Sans Light'), local('JosefinSans-Light'), url('JosefinSans300.woff') format('woff');
}
@font-face {
font-family: 'Josefin Sans';
font-style: normal;
font-weight: 400;
src: local('Josefin Sans'), local('JosefinSans'), url('JosefinSans400.woff') format('woff');
}
@font-face {
font-family: 'Josefin Sans';
font-style: normal;
font-weight: 700;
src: local('Josefin Sans Bold'), local('JosefinSans-Bold'), url('JosefinSans700.woff') format('woff');
}
This diff is collapsed.
#cuerpo { #wrapper {
/*transition: all 0.1s ease 0s;*/
} }
/*old one*/ /*old one*/
...@@ -22,16 +22,20 @@ box-shadow: 0px 0px 3px 0px #888888; ...@@ -22,16 +22,20 @@ box-shadow: 0px 0px 3px 0px #888888;
#leftcolumn { #leftcolumn {
margin-left: -210px; overflow-y: scroll;
margin-right: 0px; margin-right: -210px;
left: 210px; margin-left: 0px;
padding-bottom: 10px;
padding-left: 5px;
right: 210px;
width: 210px; width: 210px;
position: fixed; position: fixed;
height: 100%; height: 100%;
/*border: 1px #888888 solid;*/ border: 1px #888888 solid;
background: #fff url(../img/bg.jpg) repeat top left; background: #fff url(../img/bg.jpg) repeat top right;
-webkit-border-radius: 0px 11px 11px 0px;-moz-border-radius: 0px 11px 11px 0px;border-radius: 0px 11px 11px 0px;-webkit-box-shadow: #B3B3B3 4px 4px 4px;-moz-box-shadow: #B3B3B3 4px 4px 4px; box-shadow: #B3B3B3 4px 4px 4px; -webkit-border-radius: 0px 11px 11px 0px;-moz-border-radius: 0px 11px 11px 0px; border-radius: 0px 11px 11px 0px;-webkit-box-shadow: #B3B3B3 4px 4px 4px;-moz-box-shadow: #B3B3B3 4px 4px 4px; box-shadow: #B3B3B3 4px 4px 4px;
transition: all 0.1s ease 0s; /*-webkit-border-radius: 11px 0px 0px 11px;-moz-border-radius: 11px 0px 0px 11px;border-radius: 11px 0px 0px 11px;-webkit-box-shadow: #B3B3B3 4px 4px 4px;-moz-box-shadow: #B3B3B3 4px 4px 4px; box-shadow: #B3B3B3 4px 4px 4px;*/
/*transition: all 0.1s ease 0s;*/
} }
#page-content-wrapper { #page-content-wrapper {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -38,16 +38,16 @@ function callGeomap(){ ...@@ -38,16 +38,16 @@ function callGeomap(){
} }
function callTWJS(){ function callTWJS(){
// db=getCurrentDBforCurrentGexf(); // db=getCurrentDBforCurrentGexf();
// db=JSON.stringify(db); // db=JSON.stringify(db);
// if(is_empty(selections)){ // if(is_empty(selections)){
// jsonparams='["all"]'; // jsonparams='["all"]';
// } else { // } else {
// jsonparams=JSON.stringify(getSelections()); // jsonparams=JSON.stringify(getSelections());
// jsonparams = jsonparams.split('&').join('__and__'); // jsonparams = jsonparams.split('&').join('__and__');
// } // }
// pr('in callGeomap: db='+db+'&query='+jsonparams); // pr('in callGeomap: db='+db+'&query='+jsonparams);
// initiateMap(db,jsonparams,"geomap/"); //From GEOMAP submod // initiateMap(db,jsonparams,"geomap/"); //From GEOMAP submod
$("#ctlzoom").show(); $("#ctlzoom").show();
$("#CurrentView").show(); $("#CurrentView").show();
} }
...@@ -67,6 +67,7 @@ function selectionToMap(){ ...@@ -67,6 +67,7 @@ function selectionToMap(){
} }
} }
//DataFolderMode
function getCurrentDBforCurrentGexf(){ function getCurrentDBforCurrentGexf(){
folderID=dataFolderTree["gexf_idfolder"][decodeURIComponent(getUrlParam.file)]; folderID=dataFolderTree["gexf_idfolder"][decodeURIComponent(getUrlParam.file)];
dbsRaw = dataFolderTree["folders"][folderID]; dbsRaw = dataFolderTree["folders"][folderID];
...@@ -81,6 +82,7 @@ function getCurrentDBforCurrentGexf(){ ...@@ -81,6 +82,7 @@ function getCurrentDBforCurrentGexf(){
return dbsPaths; return dbsPaths;
} }
//DataFolderMode
function getGlobalDBs(){ function getGlobalDBs(){
graphdb=dataFolderTree["folders"]; graphdb=dataFolderTree["folders"];
for(var i in graphdb){ for(var i in graphdb){
...@@ -95,6 +97,7 @@ function getGlobalDBs(){ ...@@ -95,6 +97,7 @@ function getGlobalDBs(){
} }
} }
//DataFolderMode
function getTopPapers(type){ function getTopPapers(type){
if(getAdditionalInfo){ if(getAdditionalInfo){
jsonparams=JSON.stringify(getSelections()); jsonparams=JSON.stringify(getSelections());
...@@ -124,6 +127,7 @@ function getTopPapers(type){ ...@@ -124,6 +127,7 @@ function getTopPapers(type){
} }
} }
//very obsolete: please renew!
//For UNI-PARTITE //For UNI-PARTITE
function updateLeftPanel_uni(){//Uni-partite graph function updateLeftPanel_uni(){//Uni-partite graph
pr("\t ** in updateLeftPanel_uni() ** "); pr("\t ** in updateLeftPanel_uni() ** ");
...@@ -160,10 +164,10 @@ function updateLeftPanel_uni(){//Uni-partite graph ...@@ -160,10 +164,10 @@ function updateLeftPanel_uni(){//Uni-partite graph
for(var i in selections){ for(var i in selections){
information += '<div id="opossitesBox">'; information += '<div id="opossitesBox">';
information += '<li><b>' + Nodes[i].label.toUpperCase() + '</b></li>'; information += '<li><b>' + Nodes[i].label.toUpperCase() + '</b></li>';
//for(var j in Nodes[i].attributes){ //for(var j in Nodes[i].attributes){
// if(Nodes[i].attributes[j].attr=="period"|| // if(Nodes[i].attributes[j].attr=="period"||
// Nodes[i].attributes[j].attr=="cluster_label" // Nodes[i].attributes[j].attr=="cluster_label"
// ) // )
information += information +=
'<li><b>Topic' + '<li><b>Topic' +
'</b>:&nbsp;'+Nodes[i].attributes["cluster_label"]+'</li>'; '</b>:&nbsp;'+Nodes[i].attributes["cluster_label"]+'</li>';
...@@ -215,10 +219,10 @@ function selectionUni(currentNode){ ...@@ -215,10 +219,10 @@ function selectionUni(currentNode){
currentNode.active=false; currentNode.active=false;
} }
//highlightOpossites(nodes1[currentNode.id].neighbours); //highlightOpossites(nodes1[currentNode.id].neighbours);
// currentNode.color = currentNode.attr['true_color']; // currentNode.color = currentNode.attr['true_color'];
// currentNode.attr['grey'] = 0; // currentNode.attr['grey'] = 0;
// //
// //
partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8); partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8);
...@@ -327,7 +331,7 @@ function getTips(){ ...@@ -327,7 +331,7 @@ function getTips(){
//da hell is this
function closeDialog () { function closeDialog () {
$('#windowTitleDialog').modal('hide'); $('#windowTitleDialog').modal('hide');
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
jQuery.fn.highlight=function(b){function a(e,j){var l=0;if(e.nodeType==3){var k=e.data.toUpperCase().indexOf(j);if(k>=0){var h=document.createElement("span");h.className="highlight";var f=e.splitText(k);var c=f.splitText(j.length);var d=f.cloneNode(true);h.appendChild(d);f.parentNode.replaceChild(h,f);l=1}}else{if(e.nodeType==1&&e.childNodes&&!/(script|style)/i.test(e.tagName)){for(var g=0;g<e.childNodes.length;++g){g+=a(e.childNodes[g],j)}}}return l}return this.each(function(){a(this,b.toUpperCase())})};jQuery.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;with(this.parentNode){replaceChild(this.firstChild,this);normalize()}}).end()};jQuery.dynaCloud={max:20,sort:true,auto:true,single:true,wordStats:true,scale:4,stopwords:["a","about","above","accordingly","after","again","against","ah","all","also","although","always","am","among","amongst","an","and","any","anymore","anyone","are","as","at","away","be","been","begin","beginning","beginnings","begins","begone","begun","being","below","between","but","by","ca","can","cannot","come","could","did","do","doing","during","each","either","else","end","et","etc","even","ever","far","ff","following","for","from","further","furthermore","get","go","goes","going","got","had","has","have","he","her","hers","herself","him","himself","his","how","i","if","in","into","is","it","its","itself","last","lastly","less","many","may","me","might","more","must","my","myself","near","nearly","never","new","next","no","not","now","o","of","off","often","oh","on","only","or","other","otherwise","our","ourselves","out","over","perhaps","put","puts","quite","s","said","saw","say","see","seen","shall","she","should","since","so","some","such","t","than","that","the","their","them","themselves","then","there","therefore","these","they","this","those","though","throughout","thus","to","too","toward","unless","until","up","upon","us","ve","very","was","we","were","what","whatever","when","where","which","while","who","whom","whomever","whose","why","with","within","without","would","yes","your","yours","yourself","yourselves"]};jQuery(function(){jQuery.dynaCloud.stopwords=new RegExp("\\s(("+jQuery.dynaCloud.stopwords.join("|")+")\\s)+","gi");if(jQuery.dynaCloud.auto){jQuery(".dynacloud").dynaCloud()}});jQuery.fn.dynaCloud=function(a){var b={};return this.each(function(){var n=[];var m=0;if(jQuery.wordStats&&jQuery.dynaCloud.wordStats){jQuery.wordStats.computeTopWords(jQuery.dynaCloud.max,this);for(var h=0,f=jQuery.wordStats.topWords.length;h<f&&h<=jQuery.dynaCloud.max;++h){var o=jQuery.wordStats.topWords[h].substring(1);if(typeof b[o]=="undefined"){b[o]={count:jQuery.wordStats.topWeights[h],el:o}}else{b[o].count+=jQuery.wordStats.topWeights[h]}m=Math.max(b[o].count,m)}jQuery.wordStats.clear()}else{var d=jQuery(this).text().replace(/[^A-Z\xC4\xD6\xDCa-z\xE4\xF6\xFC\xDF0-9_]/g," ").replace(jQuery.dynaCloud.stopwords," ").split(" ");var c=/^[a-z\xE4\xF6\xFC]*[A-Z\xC4\xD6\xDC]([A-Z\xC4\xD6\xDC\xDF]+|[a-z\xE4\xF6\xFC\xDF]{3,})/;jQuery.each(d,function(l,p){if(c.test(p)){var j=p.toLowerCase();if(typeof b[j]=="undefined"){b[j]={count:1,el:p}}else{b[j].count+=1}m=Math.max(b[j].count,m)}})}jQuery.each(b,function(j,l){n[n.length]=l});if(jQuery.dynaCloud.sort){n.sort(function(j,i){if(j.count==i.count){return j.el<i.el?-1:(j.el==i.el?0:1)}else{return j.count<i.count?1:-1}})}var g;if((g=jQuery(a?a:"#dynacloud")).length==0){jQuery(document.body).append('<p id="dynacloud"></p>');g=jQuery("#dynacloud")}g.empty();var e=jQuery.dynaCloud.max==-1?n.length:Math.min(jQuery.dynaCloud.max,n.length);for(var h=0;h<e;++h){g.append('<a href="#'+n[h].el+'" style="font-size: '+Math.ceil((n[h].count/m)*jQuery.dynaCloud.scale)+'em"><span>'+n[h].el+"</span></a> &nbsp; ")}var k=this;jQuery("a",g).each(function(){jQuery(this).click(function(){if(jQuery.dynaCloud.single){jQuery(document.body).removeHighlight()}var i=jQuery(this).text().toUpperCase();jQuery(k).each(function(){jQuery(this).highlight(i)});return false})})})};
\ No newline at end of file
;(function($, window, document, undefined) {
var pluginName = 'autoHidingNavbar',
$window = $(window),
$document = $(document),
_scrollThrottleTimer = null,
_resizeThrottleTimer = null,
_throttleDelay = 70,
_lastScrollHandlerRun = 0,
_previousScrollTop = null,
_windowHeight = $window.height(),
_visible = true,
_hideOffset,
defaults = {
disableAutohide: false,
showOnUpscroll: true,
showOnBottom: true,
hideOffset: 'auto', // "auto" means the navbar height
animationDuration: 200
};
function AutoHidingNavbar(element, options) {
this.element = $(element);
this.settings = $.extend({}, defaults, options);
this._defaults = defaults;
this._name = pluginName;
this.init();
}
function hide(autoHidingNavbar) {
if (!_visible) {
return;
}
autoHidingNavbar.element.addClass('navbar-hidden').animate({
top: -autoHidingNavbar.element.height()
}, {
queue: false,
duration: autoHidingNavbar.settings.animationDuration
});
$('.dropdown.open .dropdown-toggle', autoHidingNavbar.element).dropdown('toggle');
_visible = false;
}
function show(autoHidingNavbar) {
if (_visible) {
return;
}
autoHidingNavbar.element.removeClass('navbar-hidden').animate({
top: 0
}, {
queue: false,
duration: autoHidingNavbar.settings.animationDuration
});
_visible = true;
}
function detectState(autoHidingNavbar) {
var scrollTop = $window.scrollTop(),
scrollDelta = scrollTop - _previousScrollTop;
_previousScrollTop = scrollTop;
if (scrollDelta < 0) {
if (_visible) {
return;
}
if (autoHidingNavbar.settings.showOnUpscroll || scrollTop <= _hideOffset) {
show(autoHidingNavbar);
}
}
else if (scrollDelta > 0) {
if (!_visible) {
if (autoHidingNavbar.settings.showOnBottom && scrollTop + _windowHeight === $document.height()) {
show(autoHidingNavbar);
}
return;
}
if (scrollTop >= _hideOffset) {
hide(autoHidingNavbar);
}
}
}
function scrollHandler(autoHidingNavbar) {
if (autoHidingNavbar.settings.disableAutohide) {
return;
}
_lastScrollHandlerRun = new Date().getTime();
detectState(autoHidingNavbar);
}
function bindEvents(autoHidingNavbar) {
$document.on('scroll.' + pluginName, function() {
if (new Date().getTime() - _lastScrollHandlerRun > _throttleDelay) {
scrollHandler(autoHidingNavbar);
}
else {
clearTimeout(_scrollThrottleTimer);
_scrollThrottleTimer = setTimeout(function() {
scrollHandler(autoHidingNavbar);
}, _throttleDelay);
}
});
$window.on('resize.' + pluginName, function() {
clearTimeout(_resizeThrottleTimer);
_resizeThrottleTimer = setTimeout(function() {
_windowHeight = $window.height();
}, _throttleDelay);
});
}
function unbindEvents() {
$document.off('.' + pluginName);
$window.off('.' + pluginName);
}
AutoHidingNavbar.prototype = {
init: function() {
this.elements = {
navbar: this.element
};
this.setDisableAutohide(this.settings.disableAutohide);
this.setShowOnUpscroll(this.settings.showOnUpscroll);
this.setShowOnBottom(this.settings.showOnBottom);
this.setHideOffset(this.settings.hideOffset);
this.setAnimationDuration(this.settings.animationDuration);
_hideOffset = this.settings.hideOffset === 'auto' ? this.element.height() : this.settings.hideOffset;
bindEvents(this);
return this.element;
},
setDisableAutohide: function(value) {
this.settings.disableAutohide = value;
return this.element;
},
setShowOnUpscroll: function(value) {
this.settings.showOnUpscroll = value;
return this.element;
},
setShowOnBottom: function(value) {
this.settings.showOnBottom = value;
return this.element;
},
setHideOffset: function(value) {
this.settings.hideOffset = value;
return this.element;
},
setAnimationDuration: function(value) {
this.settings.animationDuration = value;
return this.element;
},
show: function() {
show(this);
return this.element;
},
hide: function() {
hide(this);
return this.element;
},
destroy: function() {
unbindEvents(this);
show(this);
$.data(this, 'plugin_' + pluginName, null);
return this.element;
}
};
$.fn[pluginName] = function(options) {
var args = arguments;
if (options === undefined || typeof options === 'object') {
return this.each(function() {
if (!$.data(this, 'plugin_' + pluginName)) {
$.data(this, 'plugin_' + pluginName, new AutoHidingNavbar(this, options));
}
});
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
var returns;
this.each(function() {
var instance = $.data(this, 'plugin_' + pluginName);
if (instance instanceof AutoHidingNavbar && typeof instance[options] === 'function') {
returns = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
}
});
return returns !== undefined ? returns : this;
}
};
})(jQuery, window, document);
...@@ -93,7 +93,8 @@ class extract: ...@@ -93,7 +93,8 @@ class extract:
info['position'] = res3[n-1]['position']; info['position'] = res3[n-1]['position'];
info['job_market'] = res3[n-1]['job_market']; info['job_market'] = res3[n-1]['job_market'];
info['login'] = res3[n-1]['login']; info['login'] = res3[n-1]['login'];
self.scholars[ide] = info; if info['nb_keywords']>0:
self.scholars[ide] = info;
except Exception as error: except Exception as error:
print "sql3:\t"+sql3 print "sql3:\t"+sql3
......
...@@ -41,6 +41,17 @@ def main(): ...@@ -41,6 +41,17 @@ def main():
tempGraph = db.buildSimpleJSONFinal(db.Graph) tempGraph = db.buildSimpleJSONFinal(db.Graph)
# Arnaud Banos network:
# Bruce Edmonds exists twice, but one of them has no keywords
# import pprint as p
# A=tempGraph["edges"]
# for j in A:
# s=j["source"]
# t=j["target"]
# if s=="D::593" or t=="D::593":
# print j
spatialized = ForceAtlas2(tempGraph) spatialized = ForceAtlas2(tempGraph)
spatialized.init() spatialized.init()
......
...@@ -96,6 +96,10 @@ var gexf; ...@@ -96,6 +96,10 @@ var gexf;
var checkBox=false; var checkBox=false;
var overNodes=false; var overNodes=false;
var shift_key=false;
var NOW="A";
var PAST="--";
var swclickActual=""; var swclickActual="";
var swclickPrev=""; var swclickPrev="";
...@@ -162,16 +166,16 @@ var RVUniformC = function(seed){ ...@@ -162,16 +166,16 @@ var RVUniformC = function(seed){
this.u; this.u;
this.seed=seed; this.seed=seed;
this.x = this.seed; this.x = this.seed;
// this.generar = function(n){ // this.generar = function(n){
// uniforme = []; // uniforme = [];
// x = 0.0; // x = 0.0;
// x = this.seed; // x = this.seed;
// for(i = 1; i < n ; i++){ // for(i = 1; i < n ; i++){
// x = ((x*this.a)+this.b)%this.m; // x = ((x*this.a)+this.b)%this.m;
// uniforme[i] = x/this.m; // uniforme[i] = x/this.m;
// } // }
// return uniforme; // return uniforme;
// }; // };
this.getRandom = function(){ this.getRandom = function(){
x = ((this.x*this.a)+this.b)%this.m; x = ((this.x*this.a)+this.b)%this.m;
this.x = x; this.x = x;
......
function scanDataFolder(){
$.ajax({
type: 'GET',
url: twjs+'php/DirScan_main.php',
//data: "type="+type+"&query="+jsonparams,
//contentType: "application/json",
//dataType: 'json',
success : function(data){
console.log(data);
dataFolderTree=data;
},
error: function(){
console.log('Page Not found: updateLeftPanel_uni()');
}
});
}
function getGexfPath(v){
gexfpath=(gexfDictReverse[v])?gexfDictReverse[v]:v;
return gexfpath;
}
function getGexfLegend(gexfPath){
legend=(gexfDict[gexfPath])?gexfDict[gexfPath]:gexfPath;
return legend;
}
function jsActionOnGexfSelector(gexfLegend){
window.location=window.location.origin+window.location.pathname+"?file="+encodeURIComponent(getGexfPath(gexfLegend));
}
function listGexfs(){
divlen=$("#gexf").length;
if(divlen>0) {
param = JSON.stringify(gexfDict);
$.ajax({
type: 'GET',
url: twjs+'php/listFiles.php',
//contentType: "application/json",
//dataType: 'json',
success : function(data){
html="<select style='width:150px;' ";
javs='onchange="'+'jsActionOnGexfSelector(this.value);'+'"';
html+=javs;
html+=">";
html+='<option selected>[Select your Graph]</option>';
for(var i in data){
//pr("path: "+data[i]);
//pr("legend: "+getGexfLegend(data[i]));
//pr("");
html+="<option>"+getGexfLegend(data[i])+"</option>";
}
html+="</select>";
$("#gexfs").html(html);
},
error: function(){
console.log("Page Not found.");
}
});
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
function trackMouse() { function trackMouse() {
$.doTimeout(200,function (){ if(!shift_key) {
var ctx = partialGraph._core.domElements.mouse.getContext('2d'); // $.doTimeout(300,function (){
ctx.globalCompositeOperation = "source-over"; var ctx = partialGraph._core.domElements.mouse.getContext('2d');
ctx.clearRect(0, 0, partialGraph._core.domElements.nodes.width, partialGraph._core.domElements.nodes.height); ctx.globalCompositeOperation = "source-over";
ctx.clearRect(0, 0, partialGraph._core.domElements.nodes.width, partialGraph._core.domElements.nodes.height);
x = partialGraph._core.mousecaptor.mouseX; x = partialGraph._core.mousecaptor.mouseX;
y = partialGraph._core.mousecaptor.mouseY; y = partialGraph._core.mousecaptor.mouseY;
ctx.strokeStyle = '#000'; ctx.strokeStyle = '#000';
ctx.lineWidth = 1; ctx.lineWidth = 1;
ctx.beginPath(); ctx.fillStyle = "#71C3FF";
ctx.globalAlpha = 0.5;
if(partialGraph._core.mousecaptor.ratio>showLabelsIfZoom){ ctx.beginPath();
for(var i in partialGraph._core.graph.nodesIndex){
n=partialGraph._core.graph.nodesIndex[i]; if(partialGraph._core.mousecaptor.ratio>showLabelsIfZoom){
if(n.hidden==false){ for(var i in partialGraph._core.graph.nodesIndex){
distance = Math.sqrt( n=partialGraph._core.graph.nodesIndex[i];
Math.pow((x-parseInt(n.displayX)),2) + if(n.hidden==false){
Math.pow((y-parseInt(n.displayY)),2) distance = Math.sqrt(
); Math.pow((x-parseInt(n.displayX)),2) +
if(parseInt(distance)<=cursor_size) { Math.pow((y-parseInt(n.displayY)),2)
partialGraph._core.graph.nodesIndex[i].forceLabel=true; );
} else { if(parseInt(distance)<=cursor_size) {
partialGraph._core.graph.nodesIndex[i].forceLabel=true;
} else {
if(typeof(n.neighbour)!=="undefined") {
if(!n.neighbour) partialGraph._core.graph.nodesIndex[i].forceLabel=false;
} else partialGraph._core.graph.nodesIndex[i].forceLabel=false;
}
}
}
partialGraph.draw(2,2,2);
} else {
for(var i in partialGraph._core.graph.nodesIndex){
n=partialGraph._core.graph.nodesIndex[i];
if(!n.hidden){
partialGraph._core.graph.nodesIndex[i].forceLabel=false;
if(typeof(n.neighbour)!=="undefined") { if(typeof(n.neighbour)!=="undefined") {
if(!n.neighbour) partialGraph._core.graph.nodesIndex[i].forceLabel=false; if(!n.neighbour) partialGraph._core.graph.nodesIndex[i].forceLabel=false;
else partialGraph._core.graph.nodesIndex[i].forceLabel=true;
} else partialGraph._core.graph.nodesIndex[i].forceLabel=false; } else partialGraph._core.graph.nodesIndex[i].forceLabel=false;
} }
} }
} partialGraph.draw(2,2,2);
partialGraph.draw(2,2,2); }
} else { ctx.arc(x, y, cursor_size, 0, Math.PI * 2, true);
for(var i in partialGraph._core.graph.nodesIndex){ //ctx.arc(partialGraph._core.width/2, partialGraph._core.height/2, 4, 0, 2 * Math.PI, true);/*todel*/
n=partialGraph._core.graph.nodesIndex[i]; ctx.closePath();
if(!n.hidden){ ctx.fill();
partialGraph._core.graph.nodesIndex[i].forceLabel=false; ctx.stroke();
if(typeof(n.neighbour)!=="undefined") { // });
if(!n.neighbour) partialGraph._core.graph.nodesIndex[i].forceLabel=false;
else partialGraph._core.graph.nodesIndex[i].forceLabel=true;
} else partialGraph._core.graph.nodesIndex[i].forceLabel=false;
}
}
partialGraph.draw(2,2,2);
} }
ctx.arc(x, y, cursor_size, 0, Math.PI * 2, true);
//ctx.arc(partialGraph._core.width/2, partialGraph._core.height/2, 4, 0, 2 * Math.PI, true);/*todel*/
ctx.closePath();
ctx.stroke();
});
}; };
function changeGraphPosition(evt, echelle) { function changeGraphPosition(evt, echelle) {
...@@ -150,22 +155,9 @@ function onGraphScroll(evt, delta) { ...@@ -150,22 +155,9 @@ function onGraphScroll(evt, delta) {
} }
function initializeMap() { function initializeMap() {
clearInterval(partialGraph.timeRefresh); clearInterval(partialGraph.timeRefresh);
partialGraph.oldParams = {}; partialGraph.oldParams = {};
$("#zoomSlider").slider({
orientation: "vertical",
value: partialGraph.position().ratio,
min: sigmaJsMouseProperties.minRatio,
max: sigmaJsMouseProperties.maxRatio,
range: "min",
step: 0.1,
slide: function( event, ui ) {
partialGraph.zoomTo(
partialGraph._core.width / 2,
partialGraph._core.height / 2,
ui.value);
}
});
if(minimap){ if(minimap){
$("#overviewzone").css({ $("#overviewzone").css({
width : overviewWidth + "px", width : overviewWidth + "px",
......
...@@ -498,12 +498,12 @@ sigma.classes.Cascade = function() { ...@@ -498,12 +498,12 @@ sigma.classes.Cascade = function() {
); );
} }
else { else {
if(cursor_size>0 && e.type=="mousedown") {/**/ if(cursor_size>0 && e.type=="mousedown" && !shift_key) {/**/
//The click WASN'T in a node and the cursor_size is ON //The click WASN'T in a node and the cursor_size is ON
x1 = partialGraph._core.mousecaptor.mouseX; x1 = partialGraph._core.mousecaptor.mouseX;
y1 = partialGraph._core.mousecaptor.mouseY; y1 = partialGraph._core.mousecaptor.mouseY;
counter=0; var counter=0;
actualSel=[]; var actualSel=[];
partialGraph.iterNodes(function(n){ partialGraph.iterNodes(function(n){
if(n.hidden==false){ if(n.hidden==false){
distance = Math.sqrt( distance = Math.sqrt(
...@@ -517,34 +517,36 @@ sigma.classes.Cascade = function() { ...@@ -517,34 +517,36 @@ sigma.classes.Cascade = function() {
} }
}); });
//Error in debugger console??? //Error in debugger console???
// pr("here here!!"); // pr("here here!!");
// pr(selections.length); // pr(selections.length);
// pr(selections); // pr(selections);
// pr(is_empty(selections)); // pr(is_empty(selections));
//The most brilliant way of knowing if an array is empty in the world of JavaScript //The most brilliant way of knowing if an array is empty in the world of JavaScript
i=0; for(var s in actualSel) { i++; break;} i=0; for(var s in actualSel) { i++; break;}
if(is_empty(actualSel)==true || i==0){ if(is_empty(actualSel) || i==0){
pr("cursor radius ON, mouseDown -> selecciones vacias"); pr("cursor radius ON, mouseDown -> selecciones vacias");
// $("#names").html(""); // $("#names").html("");
// $("#opossiteNodes").html(""); // $("#opossiteNodes").html("");
// $("#information").html(""); // $("#information").html("");
// $("#topPapers").html(""); // $("#topPapers").html("");
// $("#tips").html(getTips()); // $("#tips").html(getTips());
// changeButton("unselectNodes"); // changeButton("unselectNodes");
// if(counter>0) graphResetColor(); // if(counter>0) graphResetColor();
} } else {
else { if(!checkBox) cancelSelection(false);
if(checkBox==false) cancelSelection(false);
overNodes=true; overNodes=true;
for(var i in actualSel) getOpossitesNodes(actualSel[i],false); for(var i in actualSel) getOpossitesNodes(actualSel[i],false);
//here selections[] is filled
greyEverything(); greyEverything();
for(var i in selections) markAsSelected(i,true); for(var i in selections) markAsSelected(i,true);
changeButton("selectNode"); changeButton("selectNode");
if(categoriesIndex.length==1) updateLeftPanel_uni(); if(categoriesIndex.length==1) updateLeftPanel_uni();
if(categoriesIndex.length==2) updateLeftPanel(); if(categoriesIndex.length==2) updateLeftPanel_fix();
LevelButtonDisable(false);
} }
RefreshState("")
partialGraph.draw(); partialGraph.draw();
} }
} }
......
...@@ -16,18 +16,20 @@ function parse(gexfPath) { ...@@ -16,18 +16,20 @@ function parse(gexfPath) {
gexf = gexfhttp.responseXML; gexf = gexfhttp.responseXML;
} }
function scanCategories(){ function scanCategories(){
nodesNodes = gexf.getElementsByTagName('nodes'); nodesNodes = gexf.getElementsByTagName('nodes');
for(i=0; i<nodesNodes.length; i++){ for(i=0; i<nodesNodes.length; i++){
var nodesNode = nodesNodes[i]; // Each xml node 'nodes' (plural) var nodesNode = nodesNodes[i]; // Each xml node 'nodes' (plural)
nodeNodes = nodesNode.getElementsByTagName('node'); node = nodesNode.getElementsByTagName('node');
for(j=0; j<nodeNodes.length; j++){ for(j=0; j<node.length; j++){
attvalueNodes = nodeNodes[j].getElementsByTagName('attvalue'); attvalueNodes = node[j].getElementsByTagName('attvalue');
for(k=0; k<attvalueNodes.length; k++){ for(k=0; k<attvalueNodes.length; k++){
attvalueNode = attvalueNodes[k]; attvalueNode = attvalueNodes[k];
attr = attvalueNode.getAttribute('for'); attr = attvalueNode.getAttribute('for');
val = attvalueNode.getAttribute('value'); val = attvalueNode.getAttribute('value');
pr(val)
if (attr=="category") categories[val]=val; if (attr=="category") categories[val]=val;
} }
} }
...@@ -51,7 +53,7 @@ function scanCategories(){ ...@@ -51,7 +53,7 @@ function scanCategories(){
function onepartiteExtract(){ function onepartiteExtract(){
var i, j, k; var i, j, k;
// partialGraph.emptyGraph(); // partialGraph.emptyGraph();
// Parse Attributes // Parse Attributes
// This is confusing, so I'll comment heavily // This is confusing, so I'll comment heavily
var nodesAttributes = []; // The list of attributes of the nodes of the graph that we build in json var nodesAttributes = []; // The list of attributes of the nodes of the graph that we build in json
...@@ -170,10 +172,10 @@ function onepartiteExtract(){ ...@@ -170,10 +172,10 @@ function onepartiteExtract(){
var attvalueNode = attvalueNodes[k]; var attvalueNode = attvalueNodes[k];
var attr = attvalueNode.getAttribute('for'); var attr = attvalueNode.getAttribute('for');
var val = attvalueNode.getAttribute('value'); var val = attvalueNode.getAttribute('value');
// node.attributes.push({ // node.attributes.push({
// attr:attr, // attr:attr,
// val:val // val:val
// }); // });
atts[attr]=val; atts[attr]=val;
node.attributes = atts; node.attributes = atts;
} }
...@@ -182,9 +184,9 @@ function onepartiteExtract(){ ...@@ -182,9 +184,9 @@ function onepartiteExtract(){
//if(node.attributes[0].attr=="weight"){ //if(node.attributes[0].attr=="weight"){
if(typeof(node.size)==="undefined") node.size=parseInt(node.attributes["weight"]); if(typeof(node.size)==="undefined") node.size=parseInt(node.attributes["weight"]);
//} //}
// if(node.attributes[1].attr=="weight"){ // if(node.attributes[1].attr=="weight"){
// node.size=node.attributes[1].val; // node.size=node.attributes[1].val;
// } // }
partialGraph.addNode(id,node); partialGraph.addNode(id,node);
labels.push({ labels.push({
...@@ -401,18 +403,18 @@ function fullExtract(){ ...@@ -401,18 +403,18 @@ function fullExtract(){
/* Para asignar tamaño a los NGrams */ /* Para asignar tamaño a los NGrams */
if(atts["category"]===categoriesIndex[1]) { if(atts["category"]===categoriesIndex[1]) {
if(typeof(node.size)==="undefined") node.size=parseInt(val).toFixed(2); if(typeof(node.size)==="undefined") node.size=parseInt(val).toFixed(2);
// /* Type of Node*/ /* Type of Node*/
// //console.log(val); //console.log(val);
// //if(val<30) val=30; //if(val<30) val=30;
// //Nodes[id].size=(parseInt(val).toFixed(2)*5)/70; //Nodes[id].size=(parseInt(val).toFixed(2)*5)/70;
// // Nodes[id].size=parseInt(val).toFixed(2); // Nodes[id].size=parseInt(val).toFixed(2);
// // node.size=Nodes[id].size; // node.size=Nodes[id].size;
// // if(id.charAt(0)=="D") { // if(id.charAt(0)=="D") {
// // Nodes[id].size = "5"; // Nodes[id].size = "5";
// // node.size = "5"; // node.size = "5";
// // } // }
} }
/* Para asignar tamaño a los NGrams */ /* Para asignar tamaño a los NGrams */
} }
//console.log(node.attributes); //console.log(node.attributes);
nodecat=node.attributes["category"]; nodecat=node.attributes["category"];
...@@ -519,17 +521,17 @@ function fullExtract(){ ...@@ -519,17 +521,17 @@ function fullExtract(){
} }
else nodes1[source].neighbours.push(target); else nodes1[source].neighbours.push(target);
// if((typeof nodes1[target])=="undefined"){ // if((typeof nodes1[target])=="undefined"){
// nodes1[target] = { // nodes1[target] = {
// label: Nodes[target].label, // label: Nodes[target].label,
// neighbours: [] // neighbours: []
// }; // };
// nodes1[target].neighbours.push(source); // nodes1[target].neighbours.push(source);
// } // }
// else nodes1[target].neighbours.push(source); // else nodes1[target].neighbours.push(source);
} }
//
//
if(idS=="N" && idT=="N"){ if(idS=="N" && idT=="N"){
edge.label="nodes2"; edge.label="nodes2";
//pr("nodes2"); //pr("nodes2");
...@@ -543,8 +545,7 @@ function fullExtract(){ ...@@ -543,8 +545,7 @@ function fullExtract(){
} }
else nodes2[source].neighbours.push(target); else nodes2[source].neighbours.push(target);
} }
//
//
if((idS=="D" && idT=="N")||(idS=="N" && idT=="D")){ if((idS=="D" && idT=="N")||(idS=="N" && idT=="D")){
edge.label="bipartite"; edge.label="bipartite";
//pr("bipartite"); //pr("bipartite");
...@@ -597,7 +598,7 @@ function extractFromJson(data,seed){ ...@@ -597,7 +598,7 @@ function extractFromJson(data,seed){
categoriesIndex[0]=catSoc; categoriesIndex[0]=catSoc;
categoriesIndex[1]=catSem; categoriesIndex[1]=catSem;
for(var i in nodesNodes){ for(var i in nodesNodes) {
colorRaw = nodesNodes[i].color.split(","); colorRaw = nodesNodes[i].color.split(",");
color = '#'+sigma.tools.rgbToHex( color = '#'+sigma.tools.rgbToHex(
parseFloat(colorRaw[2]), parseFloat(colorRaw[2]),
...@@ -642,8 +643,7 @@ function extractFromJson(data,seed){ ...@@ -642,8 +643,7 @@ function extractFromJson(data,seed){
nodeK = Nodes[i]; nodeK = Nodes[i];
nodeK.hidden=true;/**///should be uncommented nodeK.hidden=true;/**///should be uncommented
partialGraph.addNode(i,nodeK); partialGraph.addNode(i,nodeK);
} } else {
else {
partialGraph.addNode(i,Nodes[i]); partialGraph.addNode(i,Nodes[i]);
unHide(i); unHide(i);
} }
...@@ -651,11 +651,12 @@ function extractFromJson(data,seed){ ...@@ -651,11 +651,12 @@ function extractFromJson(data,seed){
var edgeId = 0; var edgeId = 0;
var edgesNodes = data.edges; var edgesNodes = data.edges;
for(var i in edgesNodes){ for(var i in edgesNodes) {
//pr(edgesNodes[i]); //pr(edgesNodes[i]);
var indice=edgesNodes[i].s+";"+edgesNodes[i].t;
var source = edgesNodes[i].s; var source = edgesNodes[i].s;
var target = edgesNodes[i].t; var target = edgesNodes[i].t;
var indice=source+";"+target;
if(indice.indexOf("D::593")!==-1) pr(indice)
var edge = { var edge = {
id: indice, id: indice,
sourceID: source, sourceID: source,
......
...@@ -62,13 +62,16 @@ function gete(id){ ...@@ -62,13 +62,16 @@ function gete(id){
return partialGraph._core.graph.edgesIndex[id]; return partialGraph._core.graph.edgesIndex[id];
} }
function find(label){ function find(label){
results=[]; var results=[];
nds=getnodesIndex(); var nds=getnodesIndex();
label=label.toLowerCase()
for(var i in nds){ for(var i in nds){
n=nds[i]; var n=nds[i];
if(n.hidden==false){ if(n.hidden==false){
if (n.label.indexOf(label)!==-1) { var possiblematch=n.label.toLowerCase()
if (possiblematch.indexOf(label)!==-1) {
results.push(n); results.push(n);
} }
} }
...@@ -108,14 +111,28 @@ function getSelections(){ ...@@ -108,14 +111,28 @@ function getSelections(){
return params; return params;
} }
//i added an excpt... why
function getNeighs(sels,arr){ function getNeighs(sels,arr){
neighDict={}; neighDict={};
for(var i in sels) { for(var i in sels) {
A=arr[i].neighbours; if(!isUndef(arr[i])) {
for(var j in A){ A=arr[i].neighbours;
neighDict[A[j]]=1 for(var j in A){
neighDict[A[j]]=1
}
neighDict[i]=1;
} }
neighDict[i]=1;
} }
return neighDict; return neighDict;
} }
\ No newline at end of file
//to general utils
function getClientTime(){
var totalSec = new Date().getTime() / 1000;
var d = new Date();
var hours = d.getHours();
var minutes = parseInt( totalSec / 60 ) % 60;
var seconds = (totalSec % 60).toFixed(4);
var result = (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":" + (seconds < 10 ? "0" + seconds : seconds);
return result;
}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1"/>
</project-private> </project-private>
#!/bin/bash
function FA2gephi {
for f in gexfs/*.gexf
do
if [[ "$f" != *_.gexf* ]]
then
java -jar tinaviz-2.0-SNAPSHOT.jar "$f" 10 &
break;
fi
done
}
function testing {
for f in gexfs/*.gexf
do
if [[ "$f" != *_.gexf* ]]
then
variable=`cat $f | grep "<description>Carla__Taramasco"`
if [[ "$variable" != "" ]]
then
echo $f
fi
fi
done
}
#Searching for the word "Magic"
function test2 {
iter=`find . -name '*.js' -print`
for f in $iter
do
filename=`echo $f | sed s/"\.\/"//g`
variable=`cat $filename | grep "zoomTo"`
if [[ "$variable" != "" ]]
then
echo $filename
fi
done
}
test2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment