Commit 807d7a4a authored by PkSM3's avatar PkSM3

last functional version

parent b8ef076d
......@@ -210,10 +210,11 @@
#aUnfold {
display: block; width: 12px; height: 12px; background-image: url("../tinawebJS/img/fleches-horiz.png"); margin: 0 auto;
}
/*
#saveAs {
display: block; width: 30px; height: 30px; background:url("../tinawebJS/img/Save.png"); margin: 0 auto;
}
*/
#zoomSlider {
background:#fff;
......
/* Example tokeninput style #1: Token vertical list*/
ul.token-input-list {
overflow: hidden;
height: auto !important;
height: 1%;
width: 400px;
border: 1px solid #999;
cursor: text;
font-size: 12px;
font-family: Verdana;
z-index: 999;
margin: 0;
padding: 0;
background-color: #fff;
list-style-type: none;
clear: left;
}
ul.token-input-list li {
list-style-type: none;
}
ul.token-input-list li input {
border: 0;
width: 350px;
padding: 3px 8px;
background-color: white;
-webkit-appearance: caret;
}
li.token-input-token {
overflow: hidden;
height: auto !important;
height: 1%;
margin: 3px;
padding: 3px 5px;
background-color: #d0efa0;
color: #000;
font-weight: bold;
cursor: default;
display: block;
}
li.token-input-token p {
float: left;
padding: 0;
margin: 0;
}
li.token-input-token span {
float: right;
color: #777;
cursor: pointer;
}
li.token-input-selected-token {
background-color: #08844e;
color: #fff;
}
li.token-input-selected-token span {
color: #bbb;
}
div.token-input-dropdown {
position: absolute;
width: 400px;
background-color: #fff;
overflow: hidden;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
cursor: default;
font-size: 12px;
font-family: Verdana;
z-index: 1;
}
div.token-input-dropdown p {
margin: 0;
padding: 5px;
font-weight: bold;
color: #777;
}
div.token-input-dropdown ul {
margin: 0;
padding: 0;
}
div.token-input-dropdown ul li {
background-color: #fff;
padding: 3px;
list-style-type: none;
}
div.token-input-dropdown ul li.token-input-dropdown-item {
background-color: #fafafa;
}
div.token-input-dropdown ul li.token-input-dropdown-item2 {
background-color: #fff;
}
div.token-input-dropdown ul li em {
font-weight: bold;
font-style: normal;
}
div.token-input-dropdown ul li.token-input-selected-dropdown-item {
background-color: #d0efa0;
}
......@@ -14,11 +14,11 @@
<link rel="stylesheet" href="css/sidebar.css" media="screen">
<link rel="stylesheet" href="bootswatch/css/bootswatch.css">
<link rel="stylesheet" href="css/font.css" type="text/css">
<link rel="stylesheet" href="css/token-input.css" type="text/css">
</head>
<body class="gradient">
<!-- this is the topbar -->
<div id="fixedtop" class="navbar navbar-default navbar-fixed-top">
<div class="container">
......@@ -36,66 +36,20 @@
<ul class="nav navbar-nav">
<li class="disabled">
<a>SELECT</a>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" id="themes">Keywords <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a tabindex="-1">Keywords</a></li>
</ul>
</li>
<li class="disabled">
<a>AND</a>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" id="themes">Scholars <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a tabindex="-1">Scholars</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" id="themes">refine <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
<a id="addfiltercountry" href="#">Filter by country</a>
</li>
<!--<li>
<a id="addcolor" href="#">Color by</a>
</li>-->
<li>
<a id="addfilterkeyword" href="#">Filter by keyword</a>
</li>
<li>
<a id="addfiltertag" href="#">Filter by community tags</a>
</li>
<li>
<a id="addfilterorganization" href="#">Filter by organization</a>
</li>
<li>
<a id="addfilterlaboratory" href="#">Filter by laboratory</a>
</li>
</ul>
</li>
<li>
<a href="#">CREATE DIRECTORY</a>
</li>
<li class="disabled">
<a>OR</a>
<a>
<span class="label label-default">NETWORK: </span>
</a>
</li>
<li>
<a href="#">MAP</a>
<a>
<span id="network" class="label label-success"></span>
</a>
</li>
<li>
asdadasd
.
<div id="log"></div>
</li>
......@@ -147,12 +101,18 @@
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a>
<input type="checkbox" id="checkboxdiv" onclick="alertCheckBox(this);">Add</input>
</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a>
<input id="searchinput" autocomplete="off" class="form-control input-sm col-lg-8" placeholder="Search" type="text">
</a></li>
</ul>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a>
<input id="searchinput" autocomplete="off" class="form-control input-sm col-lg-8" placeholder="Search" type="text">
</a></li>
</ul>
<!--
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
......@@ -212,10 +172,22 @@
<a href="#" id="aUnfold" class="rightarrow"></a>
</div>
</li>
<li>
<a href="#" id="geomapicon" onclick="$('#geomapmodal').modal('show'); callGeomap();">
<img width="34px" src="img/world.png"></img>
</a>
</li>
<!--
<li>
<a href="#" id="statsicon" onclick="$('#statsmodal').modal('show');" >
<img width="34px" src="img/stats.png"></img>
</a>
</li> -->
<li>
<a href="#" id="saveAs" title="export as"> </a>
</li>
<li>
<a href="#" id="saveAs"><img width="30px" src="img/save.png"></img></a>
</li>
<li>
<a href="#" id="zoomPlusButton" title="S'approcher"> </a>
......@@ -254,15 +226,64 @@
<div class="modal fade">
<div id="modalloader" class="modal fade">
<div id="loader">
<img src="img/loader.gif"></img>
</div>
<div id="closemodal" data-dismiss="modal"></div>
<div id="closeloader" data-dismiss="modal"></div>
</div>
<div id="statsmodal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>Here goes the stats</p>
</div>
</div>
</div>
</div>
<div id="mainmodal" class="modal fade">
<div id="my-text-input"></div>
<!-- <div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Come on, change network</h4>
</div>
<div class="modal-body">
</div>
</div>
</div> -->
</div>
<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>-->
......@@ -270,6 +291,7 @@
<script src="jquery/jquery-ui.js" type="text/javascript"></script>
<script src="libs/jquery/jquery.ba-dotimeout.min.js" type="text/javascript"></script>
<script src="libs/jquery/jquery.mousewheel.min.js" type="text/javascript"></script>
<script src="libs/jquery/jquery.tokeninput.js" type="text/javascript"></script>
<script type="text/javascript" src="libs/freshslider.1.0.js"></script>
<!--source: http://www.jqueryscript.net/slider/Simple-Nice-jQuery-Value-Range-Slider-Plugin-Fresh-Slider.html-->
......@@ -277,12 +299,13 @@
<script src="libs/bootstrap/js/bootstrap.min.js"></script>
<script src="bootswatch/js/bootswatch.js"></script>
<script src="libs/bootstrap/js/bootstrap-modal.js" type="text/javascript"></script>
<!-- <script src="geomap/js/raphael/raphael-min.js" charset="utf-8" ></script>-->
<!-- <script src="geomap/js/jquery.mapael.js" charset="utf-8" ></script>-->
<!-- <script src="geomap/js/maps/world_countries.js" charset="utf-8" ></script>-->
<!-- <script src="geomap/examples.js" charset="utf-8" ></script>-->
<!-- <link rel="stylesheet" type="text/css" href="geomap/css/geo.css" />-->
<script src="geomap2/js/raphael/raphael-min.js" charset="utf-8" ></script>
<script src="geomap2/js/jquery.mapael.js" charset="utf-8" ></script>
<script src="geomap2/js/maps/world_countries.js" charset="utf-8" ></script>
<script src="geomap2/examples.js" charset="utf-8" ></script>
<link rel="stylesheet" type="text/css" href="geomap2/css/geo.css" />
<!-- <script src="tinawebJS/js/canvas2image/base64.js" type="text/javascript"></script>-->
<!-- <script src="tinawebJS/js/canvas2image/canvas2image.js" type="text/javascript"></script>-->
......
......@@ -33,8 +33,8 @@ function callGeomap(){
}
pr('in callGeomap: db='+db+'&query='+jsonparams);
initiateMap(db,jsonparams,"geomap2/");
$("#ctlzoom").hide();
$("#CurrentView").hide();
// $("#ctlzoom").hide();
// $("#CurrentView").hide();
}
function callTWJS(){
......
This diff is collapsed.
geomap
======
Plotting data from countries on a worldmap (raphael JS+ sqlite)
.geomapCont {
margin:auto;
width:90%;
text-align:center;
white-space: nowrap;
}
.distBar {
width:200px;
height:10px;
border-radius:3px;
border:1px solid #848484;
display: inline-block;
-moz-border-radius: 0px 0px 0px 0px;
-webkit-border-radius: 0px 0px 0px 0px;
background: -moz-linear-gradient(center left, #FFFF00 0%,#FF0000 100%);
background: -webkit-gradient(linear, left bottom, right bottom, color-stop(0, #FFFF00),color-stop(1, #FF0000));
}
.min,.max {
width:100px;
height:100px;
display: inline-block;
}
.mapTooltip {
position:absolute;/*position:fixed;*/
background-color : #fff;
moz-opacity:0.70;
opacity: 0.70;
filter:alpha(opacity=70);
border-radius:10px;
padding : 10px;
z-index: 1000;
max-width: 200px;
display:none;
color:#343434;
}
.mapLegend {
}
.map, .therange{
/* IE10 Consumer Preview */
background-image: -ms-radial-gradient(left top, ellipse farthest-corner, #FFFFFF 0%, #45CDFF 100%);
/* Mozilla Firefox */
background-image: -moz-radial-gradient(left top, ellipse farthest-corner, #FFFFFF 0%, #45CDFF 100%);
/* Opera */
background-image: -o-radial-gradient(left top, ellipse farthest-corner, #FFFFFF 0%, #45CDFF 100%);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(radial, left top, 0, left top, 994, color-stop(0, #FFFFFF), color-stop(1, #45CDFF));
/* Webkit (Chrome 11+) */
background-image: -webkit-radial-gradient(left top, ellipse farthest-corner, #FFFFFF 0%, #45CDFF 100%);
/* W3C Markup, IE10 Release Preview */
background-image: radial-gradient(ellipse farthest-corner at left top, #FFFFFF 0%, #45CDFF 100%);
position:relative;
}
.zoomIn, .zoomOut {
background-color:#fff;
border:1px solid #ccc;
color:#000;
width:15px;
height:15px;
line-height: 15px;
text-align:center;
border-radius:3px;
cursor:pointer;
position:absolute;
top : 10px;
font-weight:bold;
left : 10px;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
}
.zoomOut {
top:30px;
}
getUrlParam = (function () {
var get = {
push:function (key,value){
var cur = this[key];
if (cur.isArray){
this[key].push(value);
}else {
this[key] = [];
this[key].push(cur);
this[key].push(value);
}
}
},
search = document.location.search,
decode = function (s,boo) {
var a = decodeURIComponent(s.split("+").join(" "));
return boo? a.replace(/\s+/g,''):a;
};
search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function (a,b,c) {
if (get[decode(b,true)]){
get.push(decode(b,true),decode(c));
}else {
get[decode(b,true)] = decode(c);
}
});
return get;
})();
//Countries and Colors:
var borderLine="#848484";//white-gray
var withoutData="#FFFFFF";//white
var onHover="#73fb76";//green
if(typeof(getUrlParam.db)!=="undefined" && typeof(getUrlParam.query)!=="undefined"){
initiateMap(getUrlParam.db,getUrlParam.query,"");
}
function getGeomapDiv(min,max){
txt="";
txt+='<div class="maparea6">';
txt+=' <div class="map">';
txt+='<span>Alternative content for the map</span>';
txt+=' </div>';
txt+=' <div class="areaLegend">';
txt+=' </div>';
txt+='</div>';
txt+='<div class="therange">';
txt+=' <div>Range of Publications:</div>';
txt+=' <div class="min">'+min+'</div>&nbsp;';
txt+=' <div class="distBar"></div>&nbsp;';
txt+=' <div class="max">'+max+'</div>';
txt+='</div>';
return txt;
}
function initiateMap(db,query,submodName){
if(typeof(getUrlParam.db)!=="undefined" && typeof(getUrlParam.query)!=="undefined"){
db=getUrlParam.db;
query=getUrlParam.query;
}//geomap/?db=["data/nci/graph.db"]&query=["all"]
imageLoading='<br><br><br><br><br><br><img style="display:block; margin: 0px auto;" src="'+submodName+'preview.gif"></img>';
$(".geomapCont").html(imageLoading);
console.log(submodName+"php/mapael.php"+"?db="+db+"&query="+query);
$.ajax({
type: 'GET',
//url: 'areas.json',
url: submodName+"php/mapael.php",
data:"db="+db+"&query="+query,
contentType: "application/json",
//dataType: 'jsonp',
success : function(data){
console.log(data);
$(".geomapCont").html(getGeomapDiv(data["min"],data["max"]));
$(".maparea6").mapael({
map : {
name : "world_countries",
zoom: {
enabled: true,
maxLevel : 10
},
defaultArea: {
attrs : {
stroke : borderLine, //Country border line
"stroke-width" : 1,
fill: withoutData, //Color of Countries value = 0
cursor: "pointer"
},
attrsHover : {
fill: onHover, //Country on Hover
animDuration : 300
}
},
afterInit : function($self, paper, areas, plots, options) {
var mapConf = $.fn.mapael.maps[this.name]
var coords = {};
console.log("salut monde");
//id="image0";
//coords = mapConf.getCoords(options.images[id].latitude, options.images[id].longitude);
//paper.image(options.images[id].src, coords.x - options.images[id].width / 2, coords.y - options.images[id].height / 2, options.images[id].width, options.images[id].height);
}
},
'images' : {
'image0' : {
'src' : 'http://www.neveldo.fr/mapael/cross-icon.png',
'latitude' : '6.452667',
'longitude' : '7.510333',
'width':170,
'height':150
}
},
legend : {
area : {
display : false,
title :"Population by country",
slices : data["slices"]
}/*,
plot :{
display : true,
title: "Some cities ..."
, slices : [
{
max :500000,
attrs : {
fill : "#f99200"
},
attrsHover :{
transform : "s1.5",
"stroke-width" : 1
},
label :"less than 500 000 inhabitants",
size : 10
},
{
min :500000,
max :1000000,
attrs : {
fill : "#f99200"
},
attrsHover :{
transform : "s1.5",
"stroke-width" : 1
},
label :"Between 500 000 and 1 000 000 inhabitants",
size : 20
},
{
min :1000000,
attrs : {
fill : "#f99200"
},
attrsHover :{
transform : "s1.5",
"stroke-width" : 1
},
label :"More than 1 million inhabitants",
size : 30
}
]
}*/
},/*
plots : {
'paris' : {
latitude :48.86,
longitude :2.3444,
value : 500000000,
tooltip: {content : "Paris<br />Population: 500000000"}
},
'newyork' : {
latitude :40.667,
longitude :-73.833,
value : 200001,
tooltip: {content : "New york<br />Population: 200001"}
},
'sydney' : {
latitude :-33.917,
longitude :151.167,
value : 600000,
tooltip: {content : "Sydney<br />Population: 600000"}
},
'brasilia' : {
latitude :-15.781682,
longitude :-47.924195,
value : 200000001,
tooltip: {content : "Brasilia<br />Population: 200000001"}
},
'tokyo': {
latitude :35.687418,
longitude :139.692306,
value : 200001,
tooltip: {content : "Tokyo<br />Population: 200001"}
}
},*/
areas: data["areas"]
});
$(".map").on("mousewheel", function(e) {
if (e.deltaY > 0)
$(".maparea6").trigger("zoom", $(".maparea6").data("zoomLevel") + 1);
else
$(".maparea6").trigger("zoom", $(".maparea6").data("zoomLevel") - 1);
return false;
});
},
error: function(){
console.log("Page Not found.");
}
});
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Demo</title>
<link rel="stylesheet" type="text/css" href="css/geo.css" />
</head>
<body>
<div class="geomapCont">
</div>
<script src="../libs/jquery/jquery-1.9.1.js" charset="utf-8" ></script>
<script src="js/jquery.mousewheel.js" charset="utf-8"></script>
<script src="js/raphael/raphael-min.js" charset="utf-8" ></script>
<script src="js/jquery.mapael.js" charset="utf-8" ></script>
<script src="js/maps/world_countries.js" charset="utf-8" ></script>
<script src="examples.js" charset="utf-8" ></script>
</body>
</html>
var CC={};
CC["AF"]="Afghanistan";
CC["AL"]="Albania";
CC["DZ"]="Algeria";
CC["AO"]="Angola";
CC["AR"]="Argentina";
CC["AM"]="Armenia";
CC["AU"]="Australia";
CC["AT"]="Austria";
CC["AZ"]="Azerbaijan";
CC["BD"]="Bangladesh";
CC["BY"]="Belarus";
CC["BE"]="Belgium";
CC["BZ"]="Belize";
CC["BJ"]="Benin";
CC["BT"]="Bhutan";
CC["VE"]="Bolivarian Republic of Venezuela";
CC["BA"]="Bosnia and Herzegovina";
CC["BW"]="Botswana";
CC["BR"]="Brazil";
CC["BN"]="Brunei Darussalam";
CC["BG"]="Bulgaria";
CC["BF"]="Burkina Faso";
CC["BI"]="Burundi";
CC["KH"]="Cambodia";
CC["CM"]="Cameroon";
CC["CA"]="Canada";
CC["CF"]="Central African Republic";
CC["TD"]="Chad";
CC["CL"]="Chile";
CC["CN"]="China";
CC["CO"]="Colombia";
CC["CG"]="Congo";
CC["CR"]="Costa Rica";
CC["HR"]="Croatia";
CC["CU"]="Cuba";
CC["CY"]="Cyprus";
CC["CZ"]="Czech Republic";
CC["KP"]="Democratic People\u2019s Republic of Korea";
CC["DK"]="Denmark";
CC["DJ"]="Djibouti";
CC["DO"]="Dominican Republic";
CC["EC"]="Ecuador";
CC["EG"]="Egypt";
CC["SV"]="El Salvador";
CC["GQ"]="Equatorial Guinea";
CC["ER"]="Eritrea";
CC["EE"]="Estonia";
CC["ET"]="Ethiopia";
CC["FK"]="Falkland Islands (Malvinas)";
CC["FJ"]="Fiji";
CC["FI"]="Finland";
CC["FR"]="France";
CC["GF"]="French Guiana";
CC["GA"]="Gabon";
CC["GM"]="Gambia";
CC["GE"]="Georgia";
CC["DE"]="Germany";
CC["GH"]="Ghana";
CC["GR"]="Greece";
CC["GL"]="Greenland";
CC["GT"]="Guatemala";
CC["GN"]="Guinea";
CC["GW"]="Guinea-Bissau";
CC["GY"]="Guyana";
CC["HT"]="Haiti";
CC["HN"]="Honduras";
CC["HU"]="Hungary";
CC["IS"]="Iceland";
CC["IN"]="India";
CC["ID"]="Indonesia";
CC["IQ"]="Iraq";
CC["IE"]="Ireland";
CC["IR"]="Islamic Republic of Iran";
CC["IL"]="Israel";
CC["IT"]="Italy";
CC["CI"]="Ivory Coast";
CC["JM"]="Jamaica";
CC["JP"]="Japan";
CC["JO"]="Jordan";
CC["KZ"]="Kazakhstan";
CC["KE"]="Kenya";
CC["KW"]="Kuwait";
CC["KG"]="Kyrgyzstan";
CC["LA"]="Lao People\u2019s Democratic Republic";
CC["LV"]="Latvia";
CC["LB"]="Lebanon";
CC["LS"]="Lesotho";
CC["LR"]="Liberia";
CC["LY"]="Libyan Arab Jamahiriya";
CC["LT"]="Lithuania";
CC["LU"]="Luxembourg";
CC["MG"]="Madagascar";
CC["MW"]="Malawi";
CC["MY"]="Malaysia";
CC["ML"]="Mali";
CC["MR"]="Mauritania";
CC["MX"]="Mexico";
CC["MN"]="Mongolia";
CC["MA"]="Morocco";
CC["MZ"]="Mozambique";
CC["MM"]="Myanmar";
CC["NA"]="Namibia";
CC["NP"]="Nepal";
CC["NL"]="Netherlands";
CC["NC"]="New Caledonia";
CC["NZ"]="New Zealand";
CC["NI"]="Nicaragua";
CC["NE"]="Niger";
CC["NG"]="Nigeria";
CC["NO"]="Norway";
CC["PS"]="Occupied Palestinian Territory";
CC["OM"]="Oman";
CC["PK"]="Pakistan";
CC["PA"]="Panama";
CC["PG"]="Papua New Guinea";
CC["PY"]="Paraguay";
CC["PE"]="Peru";
CC["PH"]="Philippines";
CC["BO"]="Plurinational State of Bolivia";
CC["PL"]="Poland";
CC["PT"]="Portugal";
CC["TW"]="Province of China Taiwan";
CC["PR"]="Puerto Rico";
CC["QA"]="Qatar";
CC["KR"]="Republic of Korea";
CC["MD"]="Republic of Moldova";
CC["RO"]="Romania";
CC["RU"]="Russian Federation";
CC["RW"]="Rwanda";
CC["SA"]="Saudi Arabia";
CC["SN"]="Senegal";
CC["RS"]="Serbia";
CC["SL"]="Sierra Leone";
CC["SK"]="Slovakia";
CC["SB"]="Solomon Islands";
CC["SO"]="Somalia";
CC["ZA"]="South Africa";
CC["ES"]="Spain";
CC["LK"]="Sri Lanka";
CC["SD"]="Sudan";
CC["SR"]="Suriname";
CC["SJ"]="Svalbard and Jan Mayen";
CC["SZ"]="Swaziland";
CC["SE"]="Sweden";
CC["CH"]="Switzerland";
CC["SY"]="Syrian Arab Republic";
CC["TJ"]="Tajikistan";
CC["TH"]="Thailand";
CC["CD"]="The Democratic Republic of the Congo";
CC["MK"]="The Former Yugoslav Republic of Macedonia";
CC["TL"]="Timor-Leste";
CC["TG"]="Togo";
CC["TN"]="Tunisia";
CC["TR"]="Turkey";
CC["TM"]="Turkmenistan";
CC["UG"]="Uganda";
CC["UA"]="Ukraine";
CC["AE"]="United Arab Emirates";
CC["GB"]="United Kingdom";
CC["TZ"]="United Republic of Tanzania";
CC["US"]="United States";
CC["UY"]="Uruguay";
CC["UZ"]="Uzbekistan";
CC["VU"]="Vanuatu";
CC["VN"]="Viet Nam";
CC["EH"]="Western Sahara";
CC["YE"]="Yemen";
CC["ZM"]="Zambia";
CC["ZW"]="Zimbabwe";
CC["TZ"]="Tanzania";
This diff is collapsed.
This diff is collapsed.
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
* Licensed under the MIT License (LICENSE.txt).
*
* Version: 3.1.6
*
* Requires: jQuery 1.2.2+
*/
(function (factory) {
if ( typeof define === 'function' && define.amd ) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS style for Browserify
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
slice = Array.prototype.slice,
nullLowestDeltaTimeout, lowestDelta;
if ( $.event.fixHooks ) {
for ( var i = toFix.length; i; ) {
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
}
}
$.event.special.mousewheel = {
version: '3.1.6',
setup: function() {
if ( this.addEventListener ) {
for ( var i = toBind.length; i; ) {
this.addEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = handler;
}
},
teardown: function() {
if ( this.removeEventListener ) {
for ( var i = toBind.length; i; ) {
this.removeEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = null;
}
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
},
unmousewheel: function(fn) {
return this.unbind('mousewheel', fn);
}
});
function handler(event) {
var orgEvent = event || window.event,
args = slice.call(arguments, 1),
delta = 0,
deltaX = 0,
deltaY = 0,
absDelta = 0;
event = $.event.fix(orgEvent);
event.type = 'mousewheel';
// Old school scrollwheel delta
if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaX = deltaY * -1;
deltaY = 0;
}
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
delta = deltaY === 0 ? deltaX : deltaY;
// New school wheel delta (wheel event)
if ( 'deltaY' in orgEvent ) {
deltaY = orgEvent.deltaY * -1;
delta = deltaY;
}
if ( 'deltaX' in orgEvent ) {
deltaX = orgEvent.deltaX;
if ( deltaY === 0 ) { delta = deltaX * -1; }
}
// No change actually happened, no reason to go any further
if ( deltaY === 0 && deltaX === 0 ) { return; }
// Store lowest absolute delta to normalize the delta values
absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
if ( !lowestDelta || absDelta < lowestDelta ) {
lowestDelta = absDelta;
}
// Get a whole, normalized value for the deltas
delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
// Add information to the event object
event.deltaX = deltaX;
event.deltaY = deltaY;
event.deltaFactor = lowestDelta;
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
// Clearout lowestDelta after sometime to better
// handle multiple device types that give different
// a different lowestDelta
// Ex: trackpad = 3 and mouse wheel = 120
if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
function nullLowestDelta() {
lowestDelta = null;
}
}));
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1">
<file>
<url>php/mapael.php</url>
<bookmark id="1">
<name/>
<line>142</line>
<key/>
</bookmark>
</file>
</editor-bookmarks>
</project-private>
include.path=${php.global.include.path}
php.version=PHP_53
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=true
web.root=.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>geomap</name>
</data>
</configuration>
</project>
<?
//localhost/ColorGradient/ColorGradient.php?steps=5
class ColorGenerator {
public $steps;
public $thecolors = array();
public $begin = 0xFF0000;
public $end = 0xFFFF00;
public function __construct($nbsteps = "") {
$this->steps = $nbsteps;
}
public function getColours() {
$theColorBegin = $this->begin;
$theColorEnd = $this->end;
$theNumSteps = $this->steps; //255;
$theColorBegin = (($theColorBegin >= 0x000000) && ($theColorBegin <= 0xffffff)) ? $theColorBegin : 0x000000;
$theColorEnd = (($theColorEnd >= 0x000000) && ($theColorEnd <= 0xffffff)) ? $theColorEnd : 0xffffff;
$theNumSteps = (($theNumSteps > 0) && ($theNumSteps < 256)) ? $theNumSteps : 16;
//printf("<p>values ares: (color begin: 0x%06X), (color end: 0x%06X), (number of steps: %d)</p>\n", $theColorBegin, $theColorEnd, $theNumSteps);
$theR0 = ($theColorBegin & 0xff0000) >> 16;
$theG0 = ($theColorBegin & 0x00ff00) >> 8;
$theB0 = ($theColorBegin & 0x0000ff) >> 0;
$theR1 = ($theColorEnd & 0xff0000) >> 16;
$theG1 = ($theColorEnd & 0x00ff00) >> 8;
$theB1 = ($theColorEnd & 0x0000ff) >> 0;
// return the interpolated value between pBegin and pEnd
function interpolate($pBegin, $pEnd, $pStep, $pMax) {
if ($pBegin < $pEnd) {
return (($pEnd - $pBegin) * ($pStep / $pMax)) + $pBegin;
} else {
return (($pBegin - $pEnd) * (1 - ($pStep / $pMax))) + $pEnd;
}
}
// generate gradient swathe now
for ($i = 0; $i <= $this->steps; $i++) {
$theR = interpolate($theR0, $theR1, $i, $theNumSteps);
$theG = interpolate($theG0, $theG1, $i, $theNumSteps);
$theB = interpolate($theB0, $theB1, $i, $theNumSteps);
$theVal = ((($theR << 8) | $theG) << 8) | $theB;
array_push($this->thecolors, strtoupper(dechex($theVal)));
}
}
}
?>
<?php
class scanTree {
public $root;
public $dbs = array();
public function __construct($rootpath = "") {
$this->root = $rootpath;
}
public function getDirectoryTree($dir) {
$folder = array();
$dbs = array();
$gexfs = array();
$dataFolder = $this->root . $dir;
$files = scandir($dataFolder);
foreach ($files as $f) {
if ($f != "." and $f != ".." and $f[strlen($f) - 1] != "~") {
if (is_dir($dataFolder . "/" . $f)) {
//pr("Dir: ".$f);
$subfolder = $f;
$this->getDirectoryTree($dir . "/" . $subfolder);
} else {
//pr("File: ".$f);
if ((strpos($f, '.db')) or (strpos($f, '.sqlite')) or (strpos($f, '.sqlite3')))
array_push($dbs, $dir."/".$f);
//$dir . "/" .
}
}
}
array_push($this->dbs, $dbs);
}
}
?>
<?php
$country=array();
$country["afghanistan"]="AF";
$country["armenia"]="AM";
$country["argentina"]="AR";
$country["austria"]="AT";
$country["australia"]="AU";
$country["bosnia and herzegovina"]="BA";
$country["bangladesh"]="BD";
$country["belgium"]="BE";
$country["burkina faso"]="BF";
$country["bulgaria"]="BG";
$country["burundi"]="BI";
$country["benin"]="BJ";
$country["la paz - bolivia"]="BO";
$country["325 - bethânia - ipatinga - minas gerais - brasil"]="BR";
$country["883 fundos sidil divinópolis mg brasil"]="BR";
$country["883 sidil divinópolis mg brasil"]="BR";
$country["avenida josé assis de vasconcelos"]="BR";
$country["brasil"]="BR";
$country["brazil"]="BR";
$country["rio de janeiro"]="BR";
$country["rua itapecerica"]="BR";
$country["rua meaipe . condominio valparaiso i. bloco c1. apt 204. laranjeiras - serra- es"]="BR";
$country["viçosa mg"]="BR";
$country["botswana"]="BW";
$country["btbswb"]="BW";
$country["belarus"]="BY";
$country["canada"]="CA";
$country["congo democratic republic of"]="CG";
$country["democratic republic of congo"]="CG";
$country["democratic republic of the congo"]="CG";
$country["geneva"]="CH";
$country["switzerland"]="CH";
$country["chile"]="CL";
$country["cameroon"]="CM";
$country["cameroun"]="CM";
$country["china"]="CN";
$country["hong kong"]="CN";
$country["shanghai"]="CN";
$country["中国"]="CN";
$country["colombia"]="CO";
$country["costa rica"]="CR";
$country["germany"]="DE";
$country["denmark"]="DK";
$country["dominican republic"]="DO";
$country["egypt"]="EG";
$country["spain"]="ES";
$country["ethiopia"]="ET";
$country["france"]="FR";
$country["britain"]="GB";
$country["england"]="GB";
$country["u.k."]="GB";
$country["uk"]="GB";
$country["united kingdom"]="GB";
$country["united kingdon"]="GB";
$country["accraghana"]="GH";
$country["ghana"]="GH";
$country["the gambia"]="GM";
$country["greece"]="GR";
$country["guatemala"]="GT";
$country["guatemala city"]="GT";
$country["honduras"]="HN";
$country["haiti"]="HT";
$country["indonesia"]="ID";
$country["yogyakarta"]="ID";
$country["ireland"]="IE";
$country["israel"]="IL";
$country["184-1 thiruvikanagar street"]="IN";
$country["184/1 thiruvikanagar .harur tk.dharmapuri.tamilnadu st"]="IN";
$country["dharmapuri dt"]="IN";
$country["dist.udalguri.p.o. dimakuchi.vill.no 2 sonajuli"]="IN";
$country["harur tk & po"]="IN";
$country["india"]="IN";
$country["nagaland india"]="IN";
$country["state assam"]="IN";
$country["tamilnadu st.india"]="IN";
$country["italy"]="IT";
$country["jordan"]="JO";
$country["kenya"]="KE";
$country["kenya."]="KE";
$country["kenyan"]="KE";
$country["kyrgyzstan"]="KG";
$country["cambodia"]="KH";
$country["lebanon"]="LB";
$country["sri lanka"]="LK";
$country["lithuania"]="LT";
$country["moldova"]="MD";
$country["mali"]="ML";
$country["malawi"]="MW";
$country["dona ana"]="MX";
$country["mexico"]="MX";
$country["méxico"]="MX";
$country["osvaldoalbuquerque65@hotmail.com"]="MX";
$country["malaysia"]="MY";
$country["mozambique"]="MZ";
$country["namibia"]="NA";
$country["abuja-nigeria"]="NG";
$country["nigeria"]="NG";
$country["nigeria/australia"]="NG";
$country["netherlands"]="NL";
$country["the netherlands"]="NL";
$country["the netherlands and egypt"]="NL";
$country["norway"]="NO";
$country["nepal"]="NP";
$country["new zealand"]="NZ";
$country["oman"]="OM";
$country["panama"]="PA";
$country["peru"]="PE";
$country["papua new guinea"]="PG";
$country["philippines"]="PH";
$country["pakistan"]="PK";
$country["palestine"]="PS";
$country["paraguay"]="PY";
$country["qatar"]="QA";
$country["romania"]="RO";
$country["republic of serbia"]="RS";
$country["serbia"]="RS";
$country["russian federation"]="RU";
$country["rwanda"]="RW";
$country["sverige"]="SE";
$country["sweden"]="SE";
$country["singapore"]="SG";
$country["slovenia"]="SI";
$country["somalia"]="SO";
$country["united state somalia diaspora"]="SO";
$country["el salvador"]="SV";
$country["swaziland"]="SZ";
$country["togo"]="TG";
$country["thailand"]="TH";
$country["turkey"]="TR";
$country["tanzania"]="TZ";
$country["tanzania in east africa"]="TZ";
$country["usa & tanzania"]="TZ";
$country["Украина.Одесса"]="UA";
$country["uganda"]="UG";
$country["uganda-africa"]="UG";
$country["17 dennison st"]="US";
$country["america"]="US";
$country["atlanta ga"]="US";
$country["u.s.a."]="US";
$country["united state of america"]="US";
$country["united states"]="US";
$country["united states of america"]="US";
$country["us"]="US";
$country["usa"]="US";
$country["waltham ma"]="US";
$country["venezuela"]="VE";
$country["vietnam"]="VN";
$country["kosovo"]="XK";
$country["republic of south africa"]="ZA";
$country["south africa"]="ZA";
$country["zambia"]="ZM";
$country["zambia and south africa"]="ZM";
$country["zimbabwe"]="ZW";
?>
<?php
$CC=array();
$CC["AF"]="Afghanistan";
$CC["AL"]="Albania";
$CC["DZ"]="Algeria";
$CC["AO"]="Angola";
$CC["AR"]="Argentina";
$CC["AM"]="Armenia";
$CC["AU"]="Australia";
$CC["AT"]="Austria";
$CC["AZ"]="Azerbaijan";
$CC["BD"]="Bangladesh";
$CC["BY"]="Belarus";
$CC["BE"]="Belgium";
$CC["BZ"]="Belize";
$CC["BJ"]="Benin";
$CC["BT"]="Bhutan";
$CC["VE"]="Bolivarian Republic of Venezuela";
$CC["BA"]="Bosnia and Herzegovina";
$CC["BW"]="Botswana";
$CC["BR"]="Brazil";
$CC["BN"]="Brunei Darussalam";
$CC["BG"]="Bulgaria";
$CC["BF"]="Burkina Faso";
$CC["BI"]="Burundi";
$CC["KH"]="Cambodia";
$CC["CM"]="Cameroon";
$CC["CA"]="Canada";
$CC["CF"]="Central African Republic";
$CC["TD"]="Chad";
$CC["CL"]="Chile";
$CC["CN"]="China";
$CC["CO"]="Colombia";
$CC["CG"]="Congo";
$CC["CR"]="Costa Rica";
$CC["HR"]="Croatia";
$CC["CU"]="Cuba";
$CC["CY"]="Cyprus";
$CC["CZ"]="Czech Republic";
$CC["KP"]="Democratic People\u2019s Republic of Korea";
$CC["DK"]="Denmark";
$CC["DJ"]="Djibouti";
$CC["DO"]="Dominican Republic";
$CC["EC"]="Ecuador";
$CC["EG"]="Egypt";
$CC["SV"]="El Salvador";
$CC["GQ"]="Equatorial Guinea";
$CC["ER"]="Eritrea";
$CC["EE"]="Estonia";
$CC["ET"]="Ethiopia";
$CC["FK"]="Falkland Islands (Malvinas)";
$CC["FJ"]="Fiji";
$CC["FI"]="Finland";
$CC["FR"]="France";
$CC["GF"]="French Guiana";
$CC["GA"]="Gabon";
$CC["GM"]="Gambia";
$CC["GE"]="Georgia";
$CC["DE"]="Germany";
$CC["GH"]="Ghana";
$CC["GR"]="Greece";
$CC["GL"]="Greenland";
$CC["GT"]="Guatemala";
$CC["GN"]="Guinea";
$CC["GW"]="Guinea-Bissau";
$CC["GY"]="Guyana";
$CC["HT"]="Haiti";
$CC["HN"]="Honduras";
$CC["HU"]="Hungary";
$CC["IS"]="Iceland";
$CC["IN"]="India";
$CC["ID"]="Indonesia";
$CC["IQ"]="Iraq";
$CC["IE"]="Ireland";
$CC["IR"]="Islamic Republic of Iran";
$CC["IL"]="Israel";
$CC["IT"]="Italy";
$CC["CI"]="Ivory Coast";
$CC["JM"]="Jamaica";
$CC["JP"]="Japan";
$CC["JO"]="Jordan";
$CC["KZ"]="Kazakhstan";
$CC["KE"]="Kenya";
$CC["KW"]="Kuwait";
$CC["KG"]="Kyrgyzstan";
$CC["LA"]="Lao People\u2019s Democratic Republic";
$CC["LV"]="Latvia";
$CC["LB"]="Lebanon";
$CC["LS"]="Lesotho";
$CC["LR"]="Liberia";
$CC["LY"]="Libyan Arab Jamahiriya";
$CC["LT"]="Lithuania";
$CC["LU"]="Luxembourg";
$CC["MG"]="Madagascar";
$CC["MW"]="Malawi";
$CC["MY"]="Malaysia";
$CC["ML"]="Mali";
$CC["MR"]="Mauritania";
$CC["MX"]="Mexico";
$CC["MN"]="Mongolia";
$CC["MA"]="Morocco";
$CC["MZ"]="Mozambique";
$CC["MM"]="Myanmar";
$CC["NA"]="Namibia";
$CC["NP"]="Nepal";
$CC["NL"]="Netherlands";
$CC["NC"]="New Caledonia";
$CC["NZ"]="New Zealand";
$CC["NI"]="Nicaragua";
$CC["NE"]="Niger";
$CC["NG"]="Nigeria";
$CC["NO"]="Norway";
$CC["PS"]="Occupied Palestinian Territory";
$CC["OM"]="Oman";
$CC["PK"]="Pakistan";
$CC["PA"]="Panama";
$CC["PG"]="Papua New Guinea";
$CC["PY"]="Paraguay";
$CC["PE"]="Peru";
$CC["PH"]="Philippines";
$CC["BO"]="Plurinational State of Bolivia";
$CC["PL"]="Poland";
$CC["PT"]="Portugal";
$CC["TW"]="Province of China Taiwan";
$CC["PR"]="Puerto Rico";
$CC["QA"]="Qatar";
$CC["KR"]="Republic of Korea";
$CC["MD"]="Republic of Moldova";
$CC["RO"]="Romania";
$CC["RU"]="Russian Federation";
$CC["RW"]="Rwanda";
$CC["SA"]="Saudi Arabia";
$CC["SN"]="Senegal";
$CC["RS"]="Serbia";
$CC["SL"]="Sierra Leone";
$CC["SK"]="Slovakia";
$CC["SB"]="Solomon Islands";
$CC["SO"]="Somalia";
$CC["ZA"]="South Africa";
$CC["ES"]="Spain";
$CC["LK"]="Sri Lanka";
$CC["SD"]="Sudan";
$CC["SR"]="Suriname";
$CC["SJ"]="Svalbard and Jan Mayen";
$CC["SZ"]="Swaziland";
$CC["SE"]="Sweden";
$CC["CH"]="Switzerland";
$CC["SY"]="Syrian Arab Republic";
$CC["TJ"]="Tajikistan";
$CC["TH"]="Thailand";
$CC["CD"]="The Democratic Republic of the Congo";
$CC["MK"]="The Former Yugoslav Republic of Macedonia";
$CC["TL"]="Timor-Leste";
$CC["TG"]="Togo";
$CC["TN"]="Tunisia";
$CC["TR"]="Turkey";
$CC["TM"]="Turkmenistan";
$CC["UG"]="Uganda";
$CC["UA"]="Ukraine";
$CC["AE"]="United Arab Emirates";
$CC["GB"]="United Kingdom";
$CC["TZ"]="United Republic of Tanzania";
$CC["US"]="United States";
$CC["UY"]="Uruguay";
$CC["UZ"]="Uzbekistan";
$CC["VU"]="Vanuatu";
$CC["VN"]="Viet Nam";
$CC["EH"]="Western Sahara";
$CC["YE"]="Yemen";
$CC["ZM"]="Zambia";
$CC["ZW"]="Zimbabwe";
$CC["TZ"]="Tanzania";
?>
<?php
header('Content-Type: application/json');
/*
geomap/php/mapael.php?db=["data/nci/graph.db"]&query=["biomass","fuel","cooperatives","energy use","energy poverty","wind power","clean energy","social business","remote areas","Solar","battery","kerosene lanterns","retailers","lamps","energy production","distribution","grid electricity"]
*/
include('parameters_details.php');
include('countries_iso3166.php');
$sql="";
$table="scholars";
$column="country";
$query = str_replace( '__and__', '&', $_GET["query"] );
$query = str_replace( 'D::', '', $query );
$elems = json_decode($query);
$selectiveQuery=true;
if(count($elems)==1){
foreach ($elems as $e){
if($e=="all") {
$selectiveQuery=false;
break;
}
}
}
$norm_country = array();
if($selectiveQuery){
$countries_temp=array();
foreach($elems as $e){
$sql="SELECT ".$column." FROM ".$table." where id=".$e;
foreach ($base->query($sql) as $row) {
if($countries_temp[$row[$column]]) $countries_temp[$row[$column]]+=1;
else $countries_temp[$row[$column]]=1;
}
}
arsort($countries_temp);
foreach ($countries_temp as $key => $value) {
$code = strtoupper($key);
if($CC[$code]){
$tempcount = 0;
if ($norm_country[$code]) {
$norm_country[$code]["value"]+=$value;
$norm_country[$code]["tooltip"]["content"] = "" ;
} else {
$info = array();
$info["code"] = $code;
$info["value"] = $value;
$info["attrs"] = array();
$info["attrs"]["href"] = "";
$info["tooltip"] = array();
$info["tooltip"]["content"] = "";
$norm_country[$code] = $info;
}
}
}
$country_divisor=getDivisors($mainpath,$db,$table,$column);
foreach ($norm_country as $key => $value){
if($CC[$key]){
$finalval=$value["value"]/($country_divisor[$key]+1);
$info = array();
$info["code"] = $key;
$info["value"] = $value["value"];
$info["floatval"] = $finalval;
$info["attrs"] = array();
$info["attrs"]["href"] = "#";
$info["tooltip"] = array();
$info["tooltip"]["content"] = "";
$norm_country[$key] = $info;
}
}
$maxzeros=0;
foreach ($norm_country as $key => $value) {
$dafloat="".$value["floatval"];
$aaa=explode(".", $dafloat);
$right=$aaa[1];
$thesize=count($right)+1;
$zerosCount=0;
foreach (range(0, $thesize) as $i) {
if($right[$i]=="0") $zerosCount+=1;
}
if($zerosCount>$maxzeros)$maxzeros=$zerosCount;
}
$maxzeros+=3;//more zeros, more precision!
$mult=pow(10,$maxzeros);
$minF=100000.0;
$maxF=0.0;
foreach ($norm_country as $key => $value){
$realOCC=$value["value"];
$floatVal=$value["floatval"];
$fakeOCC=ceil($floatVal*$mult);
$percentage=round(($floatVal*100),2);
$info = array();
$info["code"] = $key;
$info["realValue"] = $realOCC;
$info["percentage"] = $percentage;
$info["value"] = $fakeOCC;
$info["attrs"] = array();
$info["attrs"]["href"] = "#";
$info["tooltip"] = array();
//$info["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$key] . "</span><br/>" . $realOCC.' people ('.$info["percentage"].'%)';
$norm_country[$key] = $info;
if($percentage>$maxF) $maxF=$percentage;
if($percentage<$minF) $minF=$percentage;
}
$fmin=$minF;
$fmax=100.000000;
// pr($fmin);
// pr($fmax);
// pr($minF);
// pr($maxF);
// pr("-----");
// pr((($fmax-$fmin)/($maxF-$minF))."*");
// pr("-----");
$constant=(($fmax-$fmin)/($maxF));
foreach ($norm_country as $key => $value){
$old=$value["percentage"];
$new=$old*$constant;# da formula!
$norm_country[$key]["percentage"]=round($new,2);
$norm_country[$key]["tooltip"]["content"]= "<span style='font-weight=bold;'>" . $CC[$key] . "</span><br/>" . $value["realValue"].' people ('.round($new,2).'%)';
//pr($value["code"].": ".$value["realValue"].", ".$value["percentage"].", div:".($country_divisor[$key]+1));
}
} else {
// $column="data";
$sql = "select count(*),data from ISIkeyword GROUP BY data ORDER BY count(*) DESC";
$sql = "select count(*),country from scholars GROUP BY country ORDER BY count(*) DESC";
////}
////$sql="select count(*),data from ISIC1Country GROUP BY data ORDER BY count(*) DESC";//ademe
//
foreach ($base->query($sql) as $row) {
$code = strtoupper($row[$column]);
$tempcount = 0;
if ($norm_country[$code]) {
$norm_country[$code]["value"]+=$row["count(*)"];
$norm_country[$code]["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$code] . "</span><br/>" . $norm_country[$code]["value"].' people';
} else {
$info = array();
$info["code"] = $code;
$info["value"] = $row["count(*)"];
$info["attrs"] = array();
$info["attrs"]["href"] = "#";
$info["tooltip"] = array();
$info["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$code] . "</span><br/>" . $row["count(*)"].' people';
$norm_country[$code] = $info;
}
}
}
$occToCC = array();
foreach ($norm_country as $c) {
if (!$occToCC[$c["value"]]) {
$occToCC[$c["value"]] = array();
}
array_push($occToCC[$c["value"]], $c["code"]);
}
krsort($occToCC);
$countries_occ_DESC = array();
foreach ($occToCC as $key => $value) {
$info = array();
$info["occ"] = $key;
$info["countries"] = $value;
$info["color"] = "";
array_push($countries_occ_DESC, $info);
}
$min=$countries_occ_DESC[count($countries_occ_DESC)-1]["occ"];
$max=$countries_occ_DESC[0]["occ"];
$colors = array();
include_once("ColourGradient.php");
$nbSteps=count($countries_occ_DESC)-1;
$instance = new ColorGenerator($nbSteps);
$instance->getColours();
$colors=$instance->thecolors;
foreach ($countries_occ_DESC as $key => $value) {
if ($key < count($colors)) {
$countries_occ_DESC[$key]["color"] = $colors[min(count($colors), $key)];
} else $countries_occ_DESC[$key]["color"] = $colors[count($colors) - 1];
}
$temp = $countries_occ_DESC;
$theslices = array();
$thedata = array();
foreach ($temp as $key => $value) {
$info = array();
$info["min"] = $value["occ"];
$info["max"] = $value["occ"]+1;
$info["attrs"] = array();
$info["attrs"]["fill"] = "#".$value["color"];
$info["label"] = "[".$value["color"]."] Papers: ".$value["occ"];
array_push($theslices, $info);
$temp2 = $value["countries"];
foreach ($temp2 as $j) {
if ($j != "") {
$moreinfo = array();
$moreinfo["value"] = $value["occ"];
$moreinfo["attr"] = array();
$moreinfo["attr"]["href"] = "#";
$moreinfo["tooltip"] = array();
if($selectiveQuery){
if($norm_country[$j]["realValue"]==1){
$moreinfo["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$j] . "</span><br/>" . $norm_country[$j]["realValue"]. ' person ('.$norm_country[$j]["percentage"].'%)';
} else {
$moreinfo["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$j] . "</span><br/>" . $norm_country[$j]["realValue"]. ' people ('.$norm_country[$j]["percentage"].'%)';
}
} else {
$moreinfo["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$j] . "</span><br/>" . $value["occ"]. ' people';
}
$thedata[$j] = $moreinfo;
}
}
}
$info = array();
$info["min"] = 0;
$info["max"] = 1;
$info["attrs"] = array();
$info["attrs"]["fill"] = "#FFFFFF";
$info["label"] = "[WHITE] Papers: 0";
array_push($theslices, $info);
$finalarray=array();
$finalarray["areas"]=$thedata;
$finalarray["slices"]=$theslices;
if($selectiveQuery){
$minInt=100000;
$maxInt=0;
$minFloat=100000.0;
$maxFloat=0.0;
foreach ($norm_country as $key => $value) {
if($value["realValue"]>$maxInt) $maxInt=$value["realValue"];
if($value["realValue"]<$minInt) $minInt=$value["realValue"];
if($value["percentage"]>$maxFloat) $maxFloat=$value["percentage"];
if($value["percentage"]<$minFloat) $minFloat=$value["percentage"];
}
$min=$minInt." (".$minFloat."%)";
$max=$maxInt." (".$maxFloat."%)";
}
$finalarray["min"]=$min;
$finalarray["max"]=$max;
echo json_encode($finalarray);
//revert
function getDivisors($mainpath,$dbnam,$table,$column){
include('countries_iso3166.php');
$conn = new PDO("sqlite:" .$mainpath.$dbnam);
$sql = "select count(*),".$column." from ".$table." GROUP BY ".$column." ORDER BY count(*) DESC";
$country_divisor=array();
foreach ($conn->query($sql) as $row) {
$code = strtoupper($row[$column]);
if($CC[$code]){
$tempcount = 0;
if ($country_divisor[$code]) {
$country_divisor[$code]+=$row["count(*)"];
} else {
$country_divisor[$code] = $row["count(*)"];
}
}
}
return $country_divisor;
}
function pr($msg) {
echo $msg . "\n";
}
?>
<?php
// Common parameters for all function proposing insight into the corpora
$mainpath=dirname(dirname(getcwd()))."/"; // -> /var/www/ademe/data/
$db=json_decode($_GET["db"]);
$dbname="";
foreach($db as $d){
if (strpos($d, 'graph.db') !== false){
$db=$d;
break;
}
}
//$dbname=$db[0];//getDB($mainpath);//'homework-20750-1-homework-db.db';;
$base = new PDO("sqlite:" .$mainpath.$db);
$max_item_displayed=6;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>TinawebJS</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="stylesheet" href="jquery/jquery-ui.css" media="screen">
<link rel="stylesheet" href="css/bootstrap.css" media="screen">
<link rel="stylesheet" href="bootswatch/css/bootswatch.css">
<style type="text/css">
body{background: #eee url(http://subtlepatterns.com/patterns/sativa.png);}
html,body{
position: relative;
height: 100%;
}
.login-container{
position: relative;
width: 300px;
margin: 80px auto;
padding: 20px 40px 40px;
text-align: center;
background: #fff;
border: 1px solid #ccc;
}
#output{
position: absolute;
width: 300px;
top: -75px;
left: 0;
color: #fff;
}
#output.alert-success{
background: rgb(25, 204, 25);
}
#output.alert-danger{
background: rgb(228, 105, 105);
}
.login-container::before,.login-container::after{
content: "";
position: absolute;
width: 100%;height: 100%;
top: 3.5px;left: 0;
background: #fff;
z-index: -1;
-webkit-transform: rotateZ(4deg);
-moz-transform: rotateZ(4deg);
-ms-transform: rotateZ(4deg);
border: 1px solid #ccc;
}
.login-container::after{
top: 5px;
z-index: -2;
-webkit-transform: rotateZ(-2deg);
-moz-transform: rotateZ(-2deg);
-ms-transform: rotateZ(-2deg);
}
.avatar{
width: 100px;height: 100px;
margin: 10px auto 30px;
border-radius: 100%;
border: 2px solid #aaa;
background-size: cover;
}
.form-box input{
width: 100%;
padding: 10px;
text-align: center;
height:40px;
border: 1px solid #ccc;;
background: #fafafa;
transition:0.2s ease-in-out;
}
.form-box input:focus{
outline: 0;
background: #eee;
}
.form-box input[type="text"]{
border-radius: 5px 5px 0 0;
text-transform: lowercase;
}
.form-box input[type="password"]{
border-radius: 0 0 5px 5px;
border-top: 0;
}
.form-box button.login{
margin-top:15px;
padding: 10px 20px;
}
.animated {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes fadeInUp {
0% {
opacity: 0;
-webkit-transform: translateY(20px);
transform: translateY(20px);
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
@keyframes fadeInUp {
0% {
opacity: 0;
-webkit-transform: translateY(20px);
-ms-transform: translateY(20px);
transform: translateY(20px);
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0);
}
}
.fadeInUp {
-webkit-animation-name: fadeInUp;
animation-name: fadeInUp;
}
</style>
</head>
<body>
<div class="container">
<div class="login-container">
<div id="output"></div>
<div class="avatar"></div>
<div class="form-box">
<form action="" method="">
<input name="user" type="text" placeholder="username">
<input type="password" placeholder="password">
<button class="btn btn-info btn-block login" type="submit">Login</button>
</form>
</div>
</div>
</div>
<!--<script src="libs/jquery/jquery-1.9.1.js"></script>-->
<!--<script src="libs/jquery/jquery-ui.js" type="text/javascript"></script>-->
<script src="jquery/jquery-1.10.2.js" type="text/javascript"></script>
<script src="jquery/jquery-ui.js" type="text/javascript"></script>
<script src="querypage.js" type="text/javascript"></script>
<script src="libs/bootstrap/js/bootstrap.min.js"></script>
<script src="bootswatch/js/bootswatch.js"></script>
<script src="libs/bootstrap/js/bootstrap-modal.js" type="text/javascript"></script>
</body>
</html>
This diff is collapsed.
from extractDataCustom import extract as SQLite
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
def main():
f = open("globalstats","w")
f.write("sch"+"\t"+"kw"+"\t"+"n1"+"\t"+"n2"+"\t"+"nbi"+"\n")
import sqlite3
connection=sqlite3.connect('../community.db')
connection.row_factory = sqlite3.Row# Magic line!
cursor=connection.cursor()
for row in cursor.execute("SELECT unique_id FROM scholars where keywords_ids>0"):
print row["unique_id"]
# unique_id = "Elisa__Omodei"
# db=SQLite(unique_id)
# db.extract()
# tempGraph = db.buildSimpleJSONFinal(db.Graph)
# graphArray = db.buildJSON_sansfa2(db.Graph)
# S = graphArray["stats"]
# f.write(S["sch"]+"\t"+S["kw"]+"\t"+S["n1"]+"\t"+S["n2"]+"\t"+S["nbi"]+"\n")
f.close()
if __name__ == "__main__":
main()
\ No newline at end of file
# -*- coding: utf-8 -*-
from FA2 import ForceAtlas2
from extractDataCustom import extract as SQLite
import json
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
def main():
#query = request.args['query']
#{"categorya"%3A"Keywords"%2C"categoryb"%3A"Scholars"%2C"keywords"%3A[]%2C"countries"%3A["Chile"]%2C"laboratories"%3A[]%2C"coloredby"%3A[]%2C"tags"%3A[]%2C"organizations"%3A[]}
# i=int(sys.argv[2])
# unique_id = sys.argv[1]
# db=SQLite(unique_id)
# db.extract()
# < Data Extraction > #
i = 100
unique_id = "Christophe__Lang"#"Noël__Bonneuil"
db=SQLite(unique_id)
db.extract()
# < / Data Extraction > #
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.init()
# spatialized.getGraph()
# for i in range(0,i):
# spatialized.atomicGo()
graphArray = db.buildJSON_sansfa2(db.Graph)
# A=graphArray["edges"]
# for j in A:
# print A[j]
#
# print "finish"
print graphArray["stats"]
# return json.dumps(graphArray)
if __name__ == "__main__":
main()
This diff is collapsed.
# -*- coding: utf-8 -*-
from FA2 import ForceAtlas2
from extractData import extract as SQLite
from extractDataCustom import extract as SQLite
import sys
reload(sys)
......
$(function(){
var textfield = $("input[name=user]");
$('button[type="submit"]').click(function(e) {
e.preventDefault();
//little validation just to check username
if (textfield.val() != "") {
//$("body").scrollTo("#output");
$("#output").addClass("alert alert-success animated fadeInUp").html("Welcome back " + "<span style='text-transform:uppercase'>" + textfield.val() + "</span>");
$("#output").removeClass(' alert-danger');
$("input").css({
"height":"0",
"padding":"0",
"margin":"0",
"opacity":"0"
});
//change button text
$('button[type="submit"]').html("continue")
.removeClass("btn-info")
.addClass("btn-default").click(function(){
$("input").css({
"height":"auto",
"padding":"10px",
"opacity":"1"
}).val("");
});
//show avatar
$(".avatar").css({
"background-image": "url('http://api.randomuser.me/0.3.2/portraits/women/35.jpg')"
});
} else {
//remove success mesage replaced with error message
$("#output").removeClass(' alert alert-success');
$("#output").addClass("alert alert-danger animated fadeInUp").html("sorry enter a username ");
}
//console.log(textfield.val());
});
});
......@@ -628,34 +628,37 @@ function searchLabel(string){
function search(string) {
var id_node = '';
partialGraph.iterNodes(function (n) {
if(n.hidden==false){
if(!n.hidden){
if (n.label == string) {
id_node = n.id;
return n;
}
}
});
getOpossitesNodes(id_node, false);
// getOpossitesNodes(id_node, false);
if(categoriesIndex.length==1) updateLeftPanel_uni();
if(categoriesIndex.length==2) updateLeftPanel_fix();
$.doTimeout(30,function (){
MultipleSelection(id_node);
});
// if(categoriesIndex.length==1) updateLeftPanel_uni();
// if(categoriesIndex.length==2) updateLeftPanel_fix();
if(is_empty(selections)==true){
$("#names").html("");
$("#opossiteNodes").html("");
$("#information").html("");
changeButton("unselectNodes");
}
else {
greyEverything();
overNodes=true;
for(var i in selections){
markAsSelected(i,true);
}
changeButton("selectNode");
partialGraph.draw();
}
// if(is_empty(selections)==true){
// $("#names").html("");
// $("#opossiteNodes").html("");
// $("#information").html("");
// changeButton("unselectNodes");
// }
// else {
// greyEverything();
// overNodes=true;
// for(var i in selections){
// markAsSelected(i,true);
// }
// changeButton("selectNode");
// partialGraph.draw();
// }
$("input#searchinput").val("");
$("input#searchinput").autocomplete( "close" );
}
......
// === monitor windows resize === //
var counterrrr=0;
$( window ).resize(function() {
var deftoph=$("#defaultop").height();
var refh=$("#fixedtop").height();
pr("deftoph:"+deftoph+" vs refh: "+refh)
if(deftoph>(refh*2)) window.location.reload();
counterrrr++;
$("#log").html("redimension nro: "+counterrrr);
sigmaLimits();
......@@ -32,9 +36,12 @@ if (mainfile) {
} else {
if(isUndef(getUrlParam.nodeidparam)) {
pr("doing something 'cause i'm a doer"); mainfile=true;
bringTheNoise("data/pkmn_types.gexf","mono");
scanCategories();
pr("do nothing, 'cause don't wanna");
$('#mainmodal').modal('show');
$("#my-text-input").tokenInput("try.json");
// pr("doing something 'cause i'm a doer"); mainfile=true;
// bringTheNoise("data/pkmn_types.gexf","mono");
// scanCategories();
} else {
if(getUrlParam.nodeidparam.indexOf("__")===-1){
......@@ -71,8 +78,8 @@ function sigmaLimits(){
}
function bringTheNoise(pathfile,type){
// $('.modal').modal('show');
$('#modalloader').modal('show');
// === get width and height === //
sigmaLimits();
......@@ -163,13 +170,15 @@ function bringTheNoise(pathfile,type){
}
});
// $("#statsicon").click(function(){
// $('#statsmodal').modal('show');
// });
// === start minimap library... currently off === //
startMiniMap();
var deftoph=$("#defaultop").height();
var refh=$("#fixedtop").height();
pr("deftoph:"+deftoph+" vs refh: "+refh)
if(deftoph>(refh*2)) window.location.reload();
console.log("parsing...");
// < === EXTRACTING DATA === >
......@@ -204,7 +213,21 @@ function bringTheNoise(pathfile,type){
if(fa2enabled==="off") $("#edgesButton").hide();
pushSWClick("social");
pr(partialGraph._core.graph.nodes.length)
pr(partialGraph._core.graph.edges.length)
nbnodes = partialGraph._core.graph.nodes.length
if(nbnodes>=400 && nbnodes<1000) {
snbnodes = nbnodes+"";
cut1 = snbnodes[0];
cut2 = snbnodes.length;
pr("cut1: "+cut1)
pr("cut2: "+cut2)
iterationsFA2 = Math.round(iterationsFA2/(cut1/cut2))
}
if(nbnodes>=1000) iterationsFA2 = 150;
pr("iterationsFA2: "+iterationsFA2)
var netname = pathfile.replace(/\_/g, ' ').toUpperCase();
$("#network").html(netname);
// < === ASYNCHRONOUS FA2.JS === >
pr(getClientTime()+" : Ini FA2");
var ForceAtlas2 = new Worker("FA2.js");
......@@ -245,7 +268,7 @@ function bringTheNoise(pathfile,type){
function theListeners(){
pr("in THELISTENERS");
// leftPanel("close");
$("#closemodal").click();//modal.hide doesnt work :c
$("#closeloader").click();//modal.hide doesnt work :c
// startForceAtlas2(partialGraph._core.graph);r(
cancelSelection(false);
......@@ -269,7 +292,7 @@ function theListeners(){
var desc = extractContext(item.desc, searchVal);
return $('<li onclick=\'var s = "'+item.label+'"; search(s);$("#searchinput").val(strSearchBar);\'></li>')
.data('item.autocomplete', item)
.append("<a><span class=\"labelresult\">" + item.label + "</span><br ><small>" + desc + "<small></a>" )
.append("<a><span class=\"labelresult\">" + item.label + "</span></a>" )
.appendTo(ul);
};
......@@ -277,8 +300,9 @@ function theListeners(){
source: function(request, response) {
matches = [];
var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
pr(labels);
var results = $.grep(labels, function(e) {
return matcher.test(e.label) || matcher.test(e.desc);
return matcher.test(e.label); //|| matcher.test(e.desc);
});
if (!results.length) {
......@@ -310,32 +334,20 @@ function theListeners(){
}
});
// i've a list of coincidences and i press enter like a boss
$("#searchinput").keydown(function (e) {
if (e.keyCode == 13 && $("input#searchinput").data('is_open') === true) {
// Search has several results and you pressed ENTER
if(!is_empty(matches)) {
checkBox=true;
if(!is_empty(matches)) {
var coincidences = []
for(j=0;j<matches.length;j++){
nodeFound=searchLabel(matches[j].label);
getOpossitesNodes(nodeFound,true);
coincidences.push(matches[j].id)
}
if(is_empty(selections)==true){
$("#names").html("");
$("#opossiteNodes").html("");
$("#information").html("");
changeButton("unselectNodes");
}
else {
greyEverything();
overNodes=true;
for(var i in selections){
markAsSelected(i,true);
}
changeButton("selectNode");
partialGraph.draw();
}
checkBox=false;
pr("coincidencees: ");
pr(coincidences);
$.doTimeout(30,function (){
MultipleSelection(coincidences);
});
$("input#searchinput").val("");
$("input#searchinput").autocomplete( "close" );
//$("input#searchinput").trigger('autocompleteclose');
......@@ -347,9 +359,17 @@ function theListeners(){
if (e.keyCode == 13 && $("input#searchinput").data('is_open') !== true) {
pr("search KEY UP");
var s = $("#searchinput").val();
// pr(s)
// pr(exactfind(s))
$("#searchinput").val(strSearchBar);
if(categoriesIndex.length==1) updateLeftPanel_uni();
if(categoriesIndex.length==2) updateLeftPanel_fix();
var coincidence = exactfind(s);
$.doTimeout(30,function (){
MultipleSelection(coincidence.id);
});
$("input#searchinput").val("");
$("input#searchinput").autocomplete( "close" );
// if(categoriesIndex.length==1) updateLeftPanel_uni();
// if(categoriesIndex.length==2) updateLeftPanel_fix();
}
});
......
......@@ -252,7 +252,6 @@ function pushSWClick(arg){
}
// it receives entire node
function selection(currentNode){
pr("\t***in selection()");
......@@ -425,7 +424,6 @@ function getOpossitesNodes(node_id, entireNode) {
// });
}
//to sigma utils!
function getNodeLabels(elems){
var labelss=[]
......@@ -1195,8 +1193,8 @@ function DrawAsSelectedNodes( nodeskeys ) {
function MultipleSelection(nodes){
pr("IN MULTIPLE SELECTION")
pr("IN MULTIPLE SELECTION:")
if(!checkBox) cancelSelection(false);
greyEverything();
......@@ -1213,7 +1211,27 @@ function MultipleSelection(nodes){
markAsSelected(nodeid,true);
}
checkBox=false;
}
} else {
// pr("=============")
// pr("receiving nodes: ")
// pr(nodes);
// pr("ndsids content: ")
// pr(ndsids)
// pr("selections content PREV: ")
// pr(selections)
for(var i in ndsids){
nodeid = ndsids[i]
getOpossitesNodes(nodeid,false); //false -> just nodeid
// markAsSelected(nodeid,true);
}
for( var i in selections){
markAsSelected(i,true);
}
// pr("selections content AFTER: ")
// pr(selections)
// pr("=============")
}
overNodes=true;
partialGraph.draw();
......@@ -1225,15 +1243,22 @@ function MultipleSelection(nodes){
function hoverNodeEffectWhileFA2(selectionRadius) {
partialGraph.bind('downnodes', function (event) {
pr("\t\t\t\t"+event.content+" -> "+Nodes[event.content].label);
var nodeID = event.content;
pr("\t\t\t\t"+nodeID+" -> "+Nodes[nodeID].label);
if(cursor_size==0 && !checkBox){
//Normal click on a node
getOpossitesNodes(event.content, false);//passing just the node-id
$.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
getOpossitesNodes(event.content, false);//passing just the node-id
$.doTimeout(30,function (){
MultipleSelection(nodeID);
});
// getOpossitesNodes(nodeID, false);//passing just the node-id
}
// if(cursor_size>0 &&){
......@@ -1254,32 +1279,32 @@ function hoverNodeEffectWhileFA2(selectionRadius) {
// }
// });
// }
if(categoriesIndex.length==1) updateLeftPanel_uni();
if(categoriesIndex.length==2) updateLeftPanel_fix();
// if(categoriesIndex.length==1) updateLeftPanel_uni();
// if(categoriesIndex.length==2) updateLeftPanel_fix();
//The most brilliant way of knowing if an array is empty in the world of JavaScript
i=0; for(var s in selections) {i++;break};
// //The most brilliant way of knowing if an array is empty in the world of JavaScript
// i=0; for(var s in selections) {i++;break};
if(is_empty(selections) || i==0){
pr("cursor radius ON, downNode -> selecciones vacias");
$("#names").html(""); //Information extracted, just added
$("#opossiteNodes").html(""); //Information extracted, just added
$("#information").html("");
$("#tips").html(getTips());
$("#topPapers").html(""); $("#topPapers").hide();
changeButton("unselectNodes");
//cancelSelection(false);
graphResetColor();
}
else {
greyEverything();
for(var i in selections){
markAsSelected(i,true);
}
RefreshState("")
}
overNodes=true;
partialGraph.draw();
// if(is_empty(selections) || i==0){
// pr("cursor radius ON, downNode -> selecciones vacias");
// $("#names").html(""); //Information extracted, just added
// $("#opossiteNodes").html(""); //Information extracted, just added
// $("#information").html("");
// $("#tips").html(getTips());
// $("#topPapers").html(""); $("#topPapers").hide();
// changeButton("unselectNodes");
// //cancelSelection(false);
// graphResetColor();
// }
// else {
// greyEverything();
// for(var i in selections){
// markAsSelected(i,true);
// }
// RefreshState("")
// }
// overNodes=true;
// partialGraph.draw();
});
}
......
This diff is collapsed.
......@@ -89,7 +89,7 @@ function exactfind(label) {
nds=getnodesIndex();
for(var i in nds){
n=nds[i];
if(n.hidden==false){
if(!n.hidden){
if (n.label==label) {
return n;
}
......
[
{"id":"856","name":"House"},
{"id":"1035","name":"Desperate Housewives"},
{"id":"123", "name":"Lost"}
]
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