Commit a9a97032 authored by PkSM3's avatar PkSM3

geomap activate it

parent a280eea6
......@@ -75,15 +75,6 @@
<button type="button" id="changetype" class="btn btn-primary btn-sm">Change Type</button>
</a>
</li>
<!--
<li class="dropdown btn-group">
<button href="#" class="dropdown-toggle btn btn-primary btn-sm" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true">
Scholars <b class="caret"></b>
</button>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">Keywords</a></li>
</ul>
</li> -->
<li>
<a>
......@@ -91,20 +82,6 @@
</a>
</li>
<!--
<li>
<a>
<div id="bipartiteComponent" class="btn-group" data-toggle="buttons">
<label class="btn btn-primary btn-sm active"><input onchange='changeButton(this);' type="radio" name="options" id="social"> Scholars</label>
<label class="btn btn-success btn-sm"><input onchange="changeButton(this);" type="radio" name="options" id="sociosemantic"> Mixed</label>
<label class="btn btn-info btn-sm"><input onchange="changeButton(this);" type="radio" name="options" id="semantic"> Keywords</label>
</div>
</a>
</li>
-->
<li>
<a>
<div style="margin:0em 2em;" id="unranged-value"></div>
......@@ -205,7 +182,7 @@
<!-- Page content -->
<div id="sigma-example"></div>
<ul id="ctlzoom">
<!-- <div class="content-header">
......@@ -277,7 +254,7 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Modal title</h4>
<h4 class="modal-title">Exporting GEXF file</h4>
</div>
<div class="modal-body form-horizontal">
......@@ -288,7 +265,7 @@
<div class="radio">
<label>
<input type="radio" name="optionsRadios" id="fullgraph" value="option1" checked="true">
Complete Graph
Full Graph
</label>
</div>
<div class="radio">
......@@ -301,6 +278,27 @@
</div>
</div>
<div class="modal-body form-horizontal">
Which atributes do you want to keep?:
<div class="form-group">
<label class="col-lg-2 control-label"> </label>
<div class="col-lg-10">
<div class="checkbox">
<label>
<input type="checkbox" name="optionsRadios" id="check_size" value="option1">
Size
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="optionsRadios" id="check_color" value="option2">
Color
</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button id="closesavemodal" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="saveGraph();">Save File</button>
......@@ -321,6 +319,22 @@
<div id="geomapmodal" class="modal fade">
<!-- <div class="modal-content"> -->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Geomap</h4>
</div>
<div class="modal-body">
<div class="geomapCont"></div>
</div>
<!-- </div> -->
<!-- <div class="geomapCont"></div> -->
<!-- <div id="closemodal2" data-dismiss="modal"></div> -->
</div>
<!--<script src="libs/jquery/jquery-1.9.1.js"></script>-->
<!--<script src="libs/jquery/jquery-ui.js" type="text/javascript"></script>-->
......
......@@ -1223,23 +1223,24 @@ function hoverNodeEffectWhileFA2(selectionRadius) {
partialGraph.bind('downnodes', function (event) {
var nodeID = event.content;
pr("\t\t\t\t"+nodeID+" -> "+Nodes[nodeID].label);
if(cursor_size==0 && !checkBox){
//Normal click on a node
$.doTimeout(30,function (){
MultipleSelection(nodeID);
});
// getOpossitesNodes(nodeID, false);//passing just the node-id
}
if(cursor_size==0 && checkBox){
//Normal click on a node, but we won't clean the previous selections
$.doTimeout(30,function (){
MultipleSelection(nodeID);
});
// getOpossitesNodes(nodeID, false);//passing just the node-id
if(nodeID.length>0) {
pr("\t\t\t\t"+nodeID+" -> "+Nodes[nodeID].label);
if(cursor_size==0 && !checkBox){
//Normal click on a node
$.doTimeout(30,function (){
MultipleSelection(nodeID);
});
// getOpossitesNodes(nodeID, false);//passing just the node-id
}
if(cursor_size==0 && checkBox){
//Normal click on a node, but we won't clean the previous selections
$.doTimeout(30,function (){
MultipleSelection(nodeID);
});
// getOpossitesNodes(nodeID, false);//passing just the node-id
}
}
// if(cursor_size>0 &&){
// //The click WAS in a node and the cursor_size is ON
// //if(checkBox==false) cancelSelection(false);
......@@ -1778,19 +1779,24 @@ function getByID(elem) {
function saveGraph() {
size = getByID("check_size").checked
color = getByID("check_color").checked
atts = {"size":size,"color":color}
pr(atts)
if(getByID("fullgraph").checked) {
saveGEXF ( getnodes() , getedges() );
saveGEXF ( getnodes() , getedges() , atts);
}
if(getByID("visgraph").checked) {
saveGEXF ( getVisibleNodes() , getVisibleEdges() )
saveGEXF ( getVisibleNodes() , getVisibleEdges(), atts )
}
$("#closesavemodal").click();
}
function saveGEXF(nodes,edges){
function saveGEXF(nodes,edges,atts){
gexf = '<?xml version="1.0" encoding="UTF-8"?>\n';
gexf += '<gexf xmlns="http://www.gexf.net/1.1draft" xmlns:viz="http://www.gephi.org/gexf/viz" version="1.1">\n';
gexf += '<graph defaultedgetype="undirected" type="static">\n';
......@@ -1810,8 +1816,11 @@ function saveGEXF(nodes,edges){
gexf += '<node id="'+nodes[n].id+'" label="'+nodes[n].label+'">\n';
gexf += ' <viz:position x="'+nodes[n].x+'" y="'+nodes[n].y+'" z="0" />\n';
col = hex2rga(nodes[n].color);
gexf += ' <viz:color r="'+col[0]+'" g="'+col[1]+'" b="'+col[2]+'" a="1"/>\n';
if(atts["color"]) gexf += ' <viz:size value="'+nodes[n].size+'" />\n';
if(atts["color"]) {
col = hex2rga(nodes[n].color);
gexf += ' <viz:color r="'+col[0]+'" g="'+col[1]+'" b="'+col[2]+'" a="1"/>\n';
}
gexf += ' <attvalues>\n';
gexf += ' <attvalue for="0" value="'+nodes[n].type+'"/>\n';
gexf += ' <attvalue for="1" value="'+Nodes[nodes[n].id].CC+'"/>\n';
......
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