Commit 31d29953 authored by pksm3's avatar pksm3

everything set i think

parent 1e49df00
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
<div id="graphid" style="visibility: hidden;">./graph.json</div> <div id="graphid" style="visibility: hidden;">./graph.json</div>
</a> </a>
</li> </li>
<!-- <!--
<li> <li>
<a> <a>
...@@ -156,7 +157,7 @@ ...@@ -156,7 +157,7 @@
<input id="searchinput" autocomplete="off" class="form-control input-sm col-lg-8" placeholder="Search" type="text"> <input id="searchinput" autocomplete="off" class="form-control input-sm col-lg-8" placeholder="Search" type="text">
</a></li> </a></li>
</ul> </ul>
<!--
<ul id="colorGraph" class="nav navbar-nav navbar-right"> <ul id="colorGraph" class="nav navbar-nav navbar-right">
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
...@@ -171,6 +172,7 @@ ...@@ -171,6 +172,7 @@
</ul> </ul>
</li> </li>
</ul> </ul>
-->
...@@ -221,12 +223,13 @@ ...@@ -221,12 +223,13 @@
<a href="#" id="aUnfold" class="rightarrow"></a> <a href="#" id="aUnfold" class="rightarrow"></a>
</div> </div>
</li> </li>
<!--
<li> <li>
<a href="#" id="geomapicon" onclick="$('#geomapmodal').modal('show'); callGeomap();"> <a href="#" id="geomapicon" onclick="$('#geomapmodal').modal('show'); callGeomap();">
<img title="World Map Distribution" width="34px" src="libs/img2/world.png"></img> <img title="World Map Distribution" width="34px" src="libs/img2/world.png"></img>
</a> </a>
</li> </li>
-->
<li> <li>
...@@ -358,7 +361,7 @@ ...@@ -358,7 +361,7 @@
<div class="geomapCont"></div> <div class="geomapCont"></div>
</div> </div>
<!-- </div> --> <!-- </div> -->
<!-- <div class="geomapCont"></div> --> <!-- <div class="geomapCont"></div> -->
<div id="closegeomap" data-dismiss="modal"></div> <div id="closegeomap" data-dismiss="modal"></div>
</div> </div>
...@@ -368,6 +371,8 @@ ...@@ -368,6 +371,8 @@
<script src="libs/jquery/jquery.mousewheel.min.js" type="text/javascript"></script> <script src="libs/jquery/jquery.mousewheel.min.js" type="text/javascript"></script>
<script type="text/javascript" src="libs/freshslider.1.0.js"></script> <script type="text/javascript" src="libs/freshslider.1.0.js"></script>
<script src="libs/readmore.js" type="text/javascript"></script>
<script src="libs/jquery/jquery.easytabs.min.js" type="text/javascript"></script>
<script src="libs/bootstrap/js/bootstrap.min.js"></script> <script src="libs/bootstrap/js/bootstrap.min.js"></script>
<!--<script src="libs/bootswatch/js/bootswatch.js"></script>--> <!--<script src="libs/bootswatch/js/bootswatch.js"></script>-->
...@@ -393,6 +398,9 @@ ...@@ -393,6 +398,9 @@
<script src="tinawebJS/main.js" type="text/javascript" language="javascript"></script> <script src="tinawebJS/main.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript">
$('#tab-container').easytabs({updateHash:false});
</script>
......
/* /*
* Customize as you want ;) * Customize as you want ;)
*/ */
function newPopup(url) {
popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
function callGeomap(){ function callGeomap(){
db=JSON.stringify('community.db'); db=JSON.stringify('community.db');
if(is_empty(selections)){ if(is_empty(selections)){
...@@ -157,20 +162,22 @@ function getTopPapers(type){ ...@@ -157,20 +162,22 @@ function getTopPapers(type){
dbsPaths=JSON.stringify(dbsPaths); dbsPaths=JSON.stringify(dbsPaths);
thisgexf=JSON.stringify(decodeURIComponent(getUrlParam.file)); thisgexf=JSON.stringify(decodeURIComponent(getUrlParam.file));
image='<img style="display:block; margin: 0px auto;" src="'+twjs+'img/ajax-loader.gif"></img>'; image='<img style="display:block; margin: 0px auto;" src="'+twjs+'img/ajax-loader.gif"></img>';
$("#topPapers").show();
$("#topPapers").html(image); $("#topPapers").html(image);
bi=(Object.keys(categories).length==2)?1:0; bi=(Object.keys(categories).length==2)?1:0;
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: twjs+'php/info_div.php', url: 'php/info_div.php',
data: "type="+type+"&bi="+bi+"&query="+jsonparams+"&dbs="+dbsPaths+"&gexf="+thisgexf, data: "type="+type+"&bi="+bi+"&query="+jsonparams+"&dbs="+dbsPaths+"&gexf="+thisgexf,
//contentType: "application/json", //contentType: "application/json",
//dataType: 'json', //dataType: 'json',
success : function(data){ success : function(data){
pr(twjs+'php/info_div.php?'+"type="+type+"&bi="+bi+"&query="+jsonparams+"&dbs="+dbsPaths+"&gexf="+thisgexf); pr('php/info_div.php?'+"type="+type+"&bi="+bi+"&query="+jsonparams+"&dbs="+dbsPaths+"&gexf="+thisgexf);
$("#topPapers").html(data); $("#topPapers").html(data);
$("#topPapers").show();
}, },
error: function(){ error: function(){
pr('Page Not found: updateLeftPanel_uni()'); pr('Page Not found: getTopPapers()');
} }
}); });
} }
...@@ -303,6 +310,7 @@ function getTips(){ ...@@ -303,6 +310,7 @@ function getTips(){
"<li>To explore the neighborhood of a selection, either double click on the selected nodes, either click on the macro/meso level button. Zoom out in meso view return to macro view.</li>"+ "<li>To explore the neighborhood of a selection, either double click on the selected nodes, either click on the macro/meso level button. Zoom out in meso view return to macro view.</li>"+
"<li>Click on the 'all nodes' tab below to view the full clickable list of nodes.</li>"+ "<li>Click on the 'all nodes' tab below to view the full clickable list of nodes.</li>"+
"</ul>"; "</ul>";
$("#tab-container").hide();
return text; return text;
} }
......
...@@ -357,7 +357,7 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) { ...@@ -357,7 +357,7 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
$(sliderDivID).freshslider({ $(sliderDivID).freshslider({
range: true, range: true,
step:1, step:1,
value:[10, 60], value:[10, 70],
enabled: false, enabled: false,
onchange:function(low, high){ onchange:function(low, high){
console.log(low, high); console.log(low, high);
...@@ -378,7 +378,7 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) { ...@@ -378,7 +378,7 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
step: 1, step: 1,
min:0, min:0,
max:steps-1, max:steps-1,
bgcolor:(type_attrb=="Document")?"#27c470":"#FFA500" , bgcolor:(type=="Document")?"#27c470":"#FFA500" ,
value:[0,steps-1], value:[0,steps-1],
onchange:function(low, high){ onchange:function(low, high){
var filtervalue = low+"-"+high var filtervalue = low+"-"+high
......
...@@ -112,6 +112,13 @@ function bringTheNoise(pathfile,type){ ...@@ -112,6 +112,13 @@ function bringTheNoise(pathfile,type){
body.style.paddingTop=$("#dafixedtop").height()+"px"; body.style.paddingTop=$("#dafixedtop").height()+"px";
$('.etabs').click(function(){
$.doTimeout(500,function (){
$("#opossiteNodes").readmore({maxHeight:200});
$("#sameNodes").readmore({maxHeight:200});
});
});
$("#changetype").click(function(){ $("#changetype").click(function(){
pr("") pr("")
pr(" ############ changeTYPE click"); pr(" ############ changeTYPE click");
...@@ -119,6 +126,9 @@ function bringTheNoise(pathfile,type){ ...@@ -119,6 +126,9 @@ function bringTheNoise(pathfile,type){
changeType(); changeType();
$.doTimeout(500,function (){
$('.etabs a[href="#tabs1"]').trigger('click');
});
printStates() printStates()
pr(" ############ / changeTYPE click"); pr(" ############ / changeTYPE click");
...@@ -204,8 +214,8 @@ function bringTheNoise(pathfile,type){ ...@@ -204,8 +214,8 @@ function bringTheNoise(pathfile,type){
parse(decodeURIComponent(pathfile)); parse(decodeURIComponent(pathfile));
if(type=="mono") { if(type=="mono") {
$("#changetype").hide();
$("#changetype").hide();
if( pathfile.indexOf(".json") > -1 ) { if( pathfile.indexOf(".json") > -1 ) {
JSONFile( pathfile ) JSONFile( pathfile )
...@@ -214,6 +224,12 @@ function bringTheNoise(pathfile,type){ ...@@ -214,6 +224,12 @@ function bringTheNoise(pathfile,type){
} }
pushSWClick("social"); pushSWClick("social");
$("#taboppos").remove();
$.doTimeout(500,function (){
$('.etabs a[href="#tabs2"]').trigger('click');
});
pr(partialGraph._core.graph.nodes.length) pr(partialGraph._core.graph.nodes.length)
pr(partialGraph._core.graph.edges.length) pr(partialGraph._core.graph.edges.length)
} }
...@@ -597,22 +613,13 @@ function theListeners(){ ...@@ -597,22 +613,13 @@ function theListeners(){
// finished but not used // i've to put a timeout, idkwhy
// NodeWeightFilter ( "#sliderANodeWeight" , "Document" , "type" , "size") $.doTimeout(100,function (){
$("#sliderANodeWeight").freshslider({
range: true, NodeWeightFilter ( "#sliderANodeWeight" , "type" , "Document" , "size")
step:1,
value:[10, 60],
enabled: false,
onchange:function(low, high){
console.log(low, high);
}
});
// finished EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
//this should be available at start!! });
// pr("applying edge weith filter")
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
//finished //finished
......
...@@ -30,7 +30,7 @@ function cancelSelection (fromTagCloud) { ...@@ -30,7 +30,7 @@ function cancelSelection (fromTagCloud) {
if(fromTagCloud==false){ if(fromTagCloud==false){
$("#names").html(""); $("#names").html("");
$("#topPapers").html(""); $("#topPapers").hide(); $("#topPapers").html(""); $("#topPapers").hide();
$("#opossiteNodes").html(""); $("#opossiteNodes").html(""); $("#tab-container").hide();
$("#information").html(""); $("#information").html("");
$("#searchinput").val(""); $("#searchinput").val("");
$("#switchbutton").hide(); $("#switchbutton").hide();
...@@ -353,6 +353,30 @@ function htmlfied_alternodes(elems) { ...@@ -353,6 +353,30 @@ function htmlfied_alternodes(elems) {
return oppositesNodes return oppositesNodes
} }
function manualForceLabel(nodeid,active) {
// pr("manual|"+nodeid+"|"+active)
partialGraph._core.graph.nodesIndex[nodeid].active=active;
partialGraph.draw();
}
function htmlfied_samenodes(elems) {
var sameNodes=[]
js1=' onmouseover="manualForceLabel(this.id,true);" ';
js2=' onmouseout="manualForceLabel(this.id,true);" ';
if(elems.length>0) {
var A = getVisibleNodes()
for (var a in A){
n = A[a]
if(!n.active && n.color.charAt(0)=="#" ) {
sameNodes.push('<li onmouseover="manualForceLabel(\''+n.id+'\',true)" onmouseout="manualForceLabel(\''+n.id+'\',false)" >'+ n.label+ '</li>')
}
}
}
return sameNodes
}
// nodes information div // nodes information div
function htmlfied_nodesatts(elems){ function htmlfied_nodesatts(elems){
...@@ -386,9 +410,9 @@ function htmlfied_nodesatts(elems){ ...@@ -386,9 +410,9 @@ function htmlfied_nodesatts(elems){
if(node.type==catSem){ if(node.type==catSem){
information += '<li><b>' + node.label + '</b></li>'; information += '<li><b>' + node.label + '</b></li>';
google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="'+twjs+'img/google.png"></img></a>'; google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="'+'img/google.png"></img></a>';
wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="'+twjs+'img/wikipedia.png"></img></a>'; wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="'+'img/wikipedia.png"></img></a>';
flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="'+twjs+'img/flickr.png"></img></a>'; flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="'+'img/flickr.png"></img></a>';
information += '<li>'+google+"&nbsp;"+wiki+"&nbsp;"+flickr+'</li><br>'; information += '<li>'+google+"&nbsp;"+wiki+"&nbsp;"+flickr+'</li><br>';
semnodes.push(information) semnodes.push(information)
} }
...@@ -418,17 +442,28 @@ function updateLeftPanel_fix() { ...@@ -418,17 +442,28 @@ function updateLeftPanel_fix() {
alterNodesDIV+= '</div>'; alterNodesDIV+= '</div>';
} }
sameNodesDIV = "";
sameNodesDIV+='<div id="sameNodes"><ul style="list-style: none;">';//tagcloud
sameNodesDIV += htmlfied_samenodes( getNodeIDs(selections) ).join("\n") ;
sameNodesDIV+= '</ul></div>';
// getTopPapers("semantic"); // getTopPapers("semantic");
informationDIV += '<br><h4>Information:</h4><ul>'; informationDIV += '<br><h4>Information:</h4><ul>';
informationDIV += htmlfied_nodesatts( getNodeIDs(selections) ).join("<br>\n") informationDIV += htmlfied_nodesatts( getNodeIDs(selections) ).join("<br>\n")
informationDIV += '</ul><br>'; informationDIV += '</ul><br>';
$("#names").html(namesDIV); $("#names").html(namesDIV).readmore({maxHeight:100});
$("#opossiteNodes").html(alterNodesDIV); $("#tab-container").show();
$("#opossiteNodes").html(alterNodesDIV).readmore({maxHeight:200});
$("#sameNodes").html(sameNodesDIV).readmore({maxHeight:200});
$("#information").html(informationDIV); $("#information").html(informationDIV);
$("#tips").html(""); $.doTimeout(30,function (){
$("#tips").html("");
});
// $("#topPapers").show(); // $("#topPapers").show();
if(categoriesIndex.length==1) getTopPapers("semantic");
else getTopPapers(swclickActual);
} }
function printStates() { function printStates() {
...@@ -574,7 +609,6 @@ function markAsSelected(n_id,sel) { ...@@ -574,7 +609,6 @@ function markAsSelected(n_id,sel) {
nodeSel.attr['grey'] = 0; nodeSel.attr['grey'] = 0;
if(categoriesIndex.length==1) { if(categoriesIndex.length==1) {
pr("jeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeere")
if( !isUndef(nodes1[nodeSel.id]) && if( !isUndef(nodes1[nodeSel.id]) &&
!isUndef(nodes1[nodeSel.id].neighbours) !isUndef(nodes1[nodeSel.id].neighbours)
){ ){
...@@ -582,17 +616,19 @@ function markAsSelected(n_id,sel) { ...@@ -582,17 +616,19 @@ function markAsSelected(n_id,sel) {
for(var i in neigh){ for(var i in neigh){
vec = partialGraph._core.graph.nodesIndex[neigh[i]]; vec = partialGraph._core.graph.nodesIndex[neigh[i]];
vec.color = vec.attr['true_color']; if(vec) {
vec.attr['grey'] = 0; vec.color = vec.attr['true_color'];
an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id]; vec.attr['grey'] = 0;
if(!isUndef(an_edge) && !an_edge.hidden){ an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
} an_edge.attr['grey'] = 0;
an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id]; }
if(!isUndef(an_edge) && !an_edge.hidden){ an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
} }
} }
} }
...@@ -1583,9 +1619,9 @@ function changeToMeso(iwannagraph) { ...@@ -1583,9 +1619,9 @@ function changeToMeso(iwannagraph) {
socsemFlag=true; socsemFlag=true;
} }
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight"); $("#category-B").show();
// NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size") EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
// EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight"); NodeWeightFilter ( "#sliderBNodeWeight" , "type", "NGram" , "size");
$("#colorGraph").hide(); $("#colorGraph").hide();
} }
...@@ -1691,6 +1727,9 @@ function changeToMeso(iwannagraph) { ...@@ -1691,6 +1727,9 @@ function changeToMeso(iwannagraph) {
} }
} }
$("#category-B").show();
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size");
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight"); // EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
// NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size") // NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
$("#colorGraph").hide(); $("#colorGraph").hide();
...@@ -1737,6 +1776,11 @@ function changeToMacro(iwannagraph) { ...@@ -1737,6 +1776,11 @@ function changeToMacro(iwannagraph) {
createEdgesForExistingNodes(iwannagraph); createEdgesForExistingNodes(iwannagraph);
if(iwannagraph=="social") showMeSomeLabels(6); if(iwannagraph=="social") showMeSomeLabels(6);
else {
$("#category-B").show();
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size");
}
swMacro=true; swMacro=true;
if (!is_empty(selections)) if (!is_empty(selections))
......
...@@ -627,11 +627,7 @@ function JSONFile( URL ) { ...@@ -627,11 +627,7 @@ function JSONFile( URL ) {
contentType: "application/json", contentType: "application/json",
async: true, async: true,
success : function(data) { success : function(data) {
pr("nodes:")
pr(data.nodes)
pr("---------")
pr("links: ")
pr(data.links)
if(!isUndef(getUrlParam.seed))seed=getUrlParam.seed; if(!isUndef(getUrlParam.seed))seed=getUrlParam.seed;
parseSimpleJSON(data,seed) parseSimpleJSON(data,seed)
...@@ -682,7 +678,7 @@ function parseSimpleJSON( data , seed ) { ...@@ -682,7 +678,7 @@ function parseSimpleJSON( data , seed ) {
htmlCont:"", htmlCont:"",
color:color color:color
}); // The graph node }); // The graph node
pr(node)
Nodes[i] = node; Nodes[i] = node;
partialGraph.addNode( i , node ); partialGraph.addNode( i , node );
} }
......
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