Commit 9890a4bd authored by PkSM3's avatar PkSM3

last version

parent b38c8aa4
This diff is collapsed.
Thanks for using TinawebJS
This work is lead by the Complex Systems Institute of Paris Ile-de-France (ISC-PIF, http://iscpif.fr) and the Centre D'analyse et de Mathématiques Sociale, both CNRS entities.
HOMEPAGE
http://tinasoft.eu/
SOURCE CODE REPOSITORY
https://github.com/moma/explorerjs
AUTHORS
- Researchers and engineers of the ISC-PIF
David Chavalarias <david dot chavalarias at iscpif ... fr>
Samuel Castillo
Aknowledgments
Former Tina developpers (java based software from which tinawebJS is adapted)
elias showk <elishowk_at-nonutc.fr>
julian bilcke <julian.bilcke_at-iscpif.fr>
TinawebJS is build on Alexis Jacomy's sigmaJS (http://sigmajs.org)
This work is the continuation of the TINA project, an European Union FP7 project - FP7-ICT-2009-C
REQUIREMENTS
WEB BROWSER compatible with javascript : we recommend Firefox (http://getfirefox.com) or Chrome
COPYRIGHT AND LICENSE
Copyright (C) 2013-2016 Institut des Systèmes Complexes de Paris Ile-de-France
CAMS - Centre National de la Recherche Scientifique
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
*.sqlite
*.db
*~
*.gexf
...@@ -2,6 +2,44 @@ ...@@ -2,6 +2,44 @@
* Customize as you want ;) * Customize as you want ;)
*/ */
function selectionToMap(){
if(geomap) {
db=getCurrentDBforCurrentGexf();
db=JSON.stringify(db);
param='geomap/?db='+db+'';
if(is_empty(selections)){
newPopup('geomap/?db='+db+'&query=all');
} else pr("selection to geomap: be patient");
}
}
function getCurrentDBforCurrentGexf(){
folderID=dataFolderTree["gexf_idfolder"][decodeURIComponent(getUrlParam.file)];
dbsRaw = dataFolderTree["folders"][folderID];
dbsPaths=[];
for(var i in dbsRaw){
dbs = dbsRaw[i]["dbs"];
for(var j in dbs){
dbsPaths.push(i+"/"+dbs[j]);
}
break;
}
return dbsPaths;
}
function getGlobalDBs(){
graphdb=dataFolderTree["folders"];
for(var i in graphdb){
for(var j in graphdb[i]){
if(j=="data") {
maindbs=graphdb[i][j]["dbs"];
for(var k in maindbs){
return j+"/"+maindbs[k];
}
}
}
}
}
function getTopPapers(type){ function getTopPapers(type){
if(getAdditionalInfo){ if(getAdditionalInfo){
...@@ -12,13 +50,18 @@ function getTopPapers(type){ ...@@ -12,13 +50,18 @@ function getTopPapers(type){
jsonparams=JSON.stringify(params); jsonparams=JSON.stringify(params);
//jsonparams = jsonparams.replaceAll("&","__and__"); //jsonparams = jsonparams.replaceAll("&","__and__");
jsonparams = jsonparams.split('&').join('__and__'); jsonparams = jsonparams.split('&').join('__and__');
dbsPaths=getCurrentDBforCurrentGexf();
//dbsPaths.push(getGlobalDBs());
dbsPaths=JSON.stringify(dbsPaths);
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: 'php/info_div.php', url: twjs+'php/info_div.php',
data: "type="+type+"&query="+jsonparams, data: "type="+type+"&query="+jsonparams+"&dbs="+dbsPaths,
//contentType: "application/json", //contentType: "application/json",
//dataType: 'json', //dataType: 'json',
success : function(data){ success : function(data){
pr(twjs+'php/info_div.php?'+"type="+type+"&query="+jsonparams+"&dbs="+dbsPaths);
$("#topPapers").html(data); $("#topPapers").html(data);
}, },
error: function(){ error: function(){
...@@ -28,33 +71,157 @@ function getTopPapers(type){ ...@@ -28,33 +71,157 @@ function getTopPapers(type){
} }
} }
//For UNI-PARTITE
function updateLeftPanel_uni(){//Uni-partite graph
pr("\t ** in updateLeftPanel_uni() ** ");
var names='';
var information='';
counter=0;
names+='<div id="selectionsBox">';
names += '<h4>';
for(var i in selections){
if(counter==4){
names += '<h4>[...]</h4>';
break;
}
names += Nodes[i].label+', ';
counter++;
}
names += '</h4>';
names=names.replace(", </h4>","</h4>");
names=names.replace(", <h4>","<h4>");
names+='</div>';
minFont=12;
//maxFont=(minFont+oposMAX)-1;
maxFont=20;
getTopPapers("semantic");
js2='\');"';
information += '<br><h4>Information:</h4>';
information += '<ul>';
for(var i in selections){
information += '<div id="opossitesBox">';
information += '<li><b>' + Nodes[i].label.toUpperCase() + '</b></li>';
//for(var j in Nodes[i].attributes){
// if(Nodes[i].attributes[j].attr=="period"||
// Nodes[i].attributes[j].attr=="cluster_label"
// )
information +=
'<li><b>Topic' +
'</b>:&nbsp;'+Nodes[i].attributes["cluster_label"]+'</li>';
function getTips(){ information += '<a href="https://www.google.com/#q='+Nodes[i].label+'" target=blank>'+'www</a>';
text = //}
"<br>"+ information += '</div>';
"Basic Interactions:"+ information += '</ul><br>';
"<ul>"+ }
"<li>Click on a node to select/unselect and get its information. In case of multiple selection, the button unselect clears all selections.</li>"+
"<li>The switch button switch allows to change the view type.</li>"+
"</ul>"+ $("#names").html(names); //Information extracted, just added
"<br>"+ $("#information").html(information); //Information extracted, just added
"Graph manipulation:"+ $("#tips").html("");
"<ul>"+ $("#topPapers").show();
"<li>Link and node sizes indicate their strength.</li>"+ /***** The animation *****/
"<li>To fold/unfold the graph (keep only strong links or weak links), use the 'edges filter' sliders.</li>"+ _cG = $("#leftcolumn");
"<li>To select a more of less specific area of the graph, use the 'nodes filter' slider.</li>"+ _cG.animate({
"</ul>"+ "left" : "0px"
"<br>"+ }, function() {
"Micro/Macro view:"+ $("#aUnfold").attr("class","leftarrow");
"<ul>"+ $("#zonecentre").css({
"<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>"+ left: _cG.width() + "px"
"<li>Click on the 'all nodes' tab below to view the full clickable list of nodes.</li>"+ });
"</ul>"; });
return text;
} }
//ADEME examples: //FOR UNI-PARTITE
function selectionUni(currentNode){
pr("in selectionUni");
if(checkBox==false && cursor_size==0) {
highlightSelectedNodes(false);
opossites = [];
selections = [];
partialGraph.refresh();
}
if((typeof selections[currentNode.id])=="undefined"){
selections[currentNode.id] = 1;
currentNode.active=true;
}
else {
delete selections[currentNode.id];
currentNode.active=false;
}
//highlightOpossites(nodes1[currentNode.id].neighbours);
// currentNode.color = currentNode.attr['true_color'];
// currentNode.attr['grey'] = 0;
//
//
partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8);
partialGraph.refresh();
}
//JUST ADEME
function camaraButton(){
$("#PhotoGraph").click(function (){
//canvas=partialGraph._core.domElements.nodes;
var nodesCtx = partialGraph._core.domElements.nodes;
/*
var edgesCtx = document.getElementById("sigma_edges_1").getContext('2d');
var edgesImg = edgesCtx.getImageData(0, 0, document.getElementById("sigma_edges_1").width, document.getElementById("sigma_edges_1").height)
nodesCtx.putImageData(edgesImg,0,0);
//ctx.drawImage(partialGraph._core.domElements.edges,0,0)
//var oCanvas = ctx;
*/
//div = document.getElementById("sigma_nodes_1").getContext('2d');
//ctx = div.getContext("2d");
//oCanvas.drawImage(partialGraph._core.domElements.edges,0,0);
Canvas2Image.saveAsPNG(nodesCtx);
/*
Canvas2Image.saveAsJPEG(oCanvas); // will prompt the user to save the image as JPEG.
// Only supported by Firefox.
Canvas2Image.saveAsBMP(oCanvas); // will prompt the user to save the image as BMP.
// returns an <img> element containing the converted PNG image
var oImgPNG = Canvas2Image.saveAsPNG(oCanvas, true);
// returns an <img> element containing the converted JPEG image (Only supported by Firefox)
var oImgJPEG = Canvas2Image.saveAsJPEG(oCanvas, true);
// returns an <img> element containing the converted BMP image
var oImgBMP = Canvas2Image.saveAsBMP(oCanvas, true);
// all the functions also takes width and height arguments.
// These can be used to scale the resulting image:
// saves a PNG image scaled to 100x100
Canvas2Image.saveAsPNG(oCanvas, false, 100, 100);
*/
});
}
//JUST ADEME
function getChatFrame() { function getChatFrame() {
content = '<div id="showChat" onclick="showhideChat();"><a href="#" id="aShowChat"> </a></div>'; content = '<div id="showChat" onclick="showhideChat();"><a href="#" id="aShowChat"> </a></div>';
content += '<iframe src="'+ircUrl+'"' content += '<iframe src="'+ircUrl+'"'
...@@ -62,6 +229,8 @@ function getChatFrame() { ...@@ -62,6 +229,8 @@ function getChatFrame() {
$("#rightcolumn").html(content); $("#rightcolumn").html(content);
} }
//JUST ADEME
function showhideChat(){ function showhideChat(){
cg = document.getElementById("rightcolumn"); cg = document.getElementById("rightcolumn");
...@@ -71,4 +240,22 @@ function showhideChat(){ ...@@ -71,4 +240,22 @@ function showhideChat(){
} }
else cg.style.right="-400px"; else cg.style.right="-400px";
} }
} }
\ No newline at end of file
function getTips(){
param='href="#" onclick="selectionToMap();" ';
text = '<div><br/><br/><h4>TIPS</h4><p> <b>- You can search for an expression in the search bar.</b><br/><p> <b>- When a node is selected, you can clic in the side bar on its name to launch a google search on that term.</b><br/><p> <b>- Double clic on a node to get more information</b><br/><b>- Double clic an empty area to erase current selection</b></p></div><br/><center><strong><a '+param+' >See the network world distribution</a></strong></center><br/><div id="footer"></div></div>';
return text;
}
function closeDialog () {
$('#windowTitleDialog').modal('hide');
}
function okClicked () {
//document.title = document.getElementById ("xlInput").value;
closeDialog ();
}
Subproject commit f05bf3b221165fb8f550d12d556bc1235309d6b6 Subproject commit e50678833301bc20614a14a242da940942138afd
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
<script src="tinawebJS/js/sigma.forceatlas2.js" type="text/javascript" language="javascript"></script> <script src="tinawebJS/js/sigma.forceatlas2.js" type="text/javascript" language="javascript"></script>
<script src="settings.js" type="text/javascript" language="javascript"></script> <script src="settings.js" type="text/javascript" language="javascript"></script>
<script src="tinawebJS/js/sigma.parseCustom.js" type="text/javascript" language="javascript"></script> <script src="tinawebJS/js/sigma.parseCustom.js" type="text/javascript" language="javascript"></script>
<script src="tinawebJS/js/extras.js" type="text/javascript" language="javascript"></script> <script src="extras.js" type="text/javascript" language="javascript"></script>
<script src="tinawebJS/js/sigmaUtils.js" type="text/javascript" language="javascript"></script>
<script src="tinawebJS/js/methods.js" type="text/javascript" language="javascript"></script> <script src="tinawebJS/js/methods.js" type="text/javascript" language="javascript"></script>
<script src="tinawebJS/js/minimap.js" type="text/javascript" language="javascript"></script> <script src="tinawebJS/js/minimap.js" type="text/javascript" language="javascript"></script>
<script src="tinawebJS/js/enviroment.js" type="text/javascript" language="javascript"></script> <script src="tinawebJS/js/enviroment.js" type="text/javascript" language="javascript"></script>
...@@ -227,6 +228,9 @@ ...@@ -227,6 +228,9 @@
--> -->
</div> </div>
<div id="leftcontent"> <div id="leftcontent">
<div style="text-align: center;">
<img src="rock/rock.png">
</div>
<div style="text-align: center;"> <div style="text-align: center;">
<img onclick="changeSwitchImage('fromHtml','')" id="switchbutton" width="60" src="tinawebJS/img/trans/showKeywords.png"></img> <img onclick="changeSwitchImage('fromHtml','')" id="switchbutton" width="60" src="tinawebJS/img/trans/showKeywords.png"></img>
</div> </div>
......
...@@ -4,19 +4,12 @@ ...@@ -4,19 +4,12 @@
// ============ < DEVELOPER OPTIONS > ============ // ============ < DEVELOPER OPTIONS > ============
var geomap=false; var geomap=false;
var getAdditionalInfo=false;//for topPapers div var getAdditionalInfo=false;//for topPapers div
var mainfile=encodeURIComponent("");//" e.g : data/2-Terms-Authors-300nodes.gexf"; var mainfile=encodeURIComponent("data/InnovativeAward.gexf");//"2-Terms-Authors-300nodes.gexf";
var gexfDict={};
//gexfDict["data/the.gexf"]="The characteristic name";
var dataSource = {};
dataSource["netw01"] = {
gexf:"",
db:""
};
dataSource["netw02"] = {
gexf:"",
db:""
};
ircNick=""; ircNick="";
ircCHN=""; ircCHN="";
...@@ -33,14 +26,14 @@ var cursor_size= 100; ...@@ -33,14 +26,14 @@ var cursor_size= 100;
var desirableTagCloudFont_MIN=12; var desirableTagCloudFont_MIN=12;
var desirableTagCloudFont_MAX=20; var desirableTagCloudFont_MAX=20;
var desirableNodeSizeMIN=4; var desirableNodeSizeMIN=1;
var desirableNodeSizeMAX=12; var desirableNodeSizeMAX=12;
var desirableScholarSize=6; //Remember that all scholars have the same size! var desirableScholarSize=6; //Remember that all scholars have the same size!
var fa2enabled=false; var fa2enabled=false;
var showLabelsIfZoom=2.0;
// ============ < SIGMA.JS PROPERTIES > ============ // ============ < SIGMA.JS PROPERTIES > ============
var desirableNodeSizeMIN=4; var desirableNodeSizeMIN=1;
var desirableNodeSizeMAX=12; var desirableNodeSizeMAX=12;
var desirableScholarSize=6; //Remember that all scholars have the same size! var desirableScholarSize=6; //Remember that all scholars have the same size!
...@@ -49,7 +42,7 @@ var fa2enabled=false; ...@@ -49,7 +42,7 @@ var fa2enabled=false;
defaultLabelSize: 12,//in fact I'm using it as minLabelSize' defaultLabelSize: 12,//in fact I'm using it as minLabelSize'
defaultLabelBGColor: '#fff', defaultLabelBGColor: '#fff',
defaultLabelHoverColor: '#000', defaultLabelHoverColor: '#000',
labelThreshold: 9, labelThreshold: 12,
defaultEdgeType: 'curve', defaultEdgeType: 'curve',
borderSize: 2.5,//Something other than 0 borderSize: 2.5,//Something other than 0
...@@ -73,6 +66,7 @@ var fa2enabled=false; ...@@ -73,6 +66,7 @@ var fa2enabled=false;
// ============ < VARIABLES.JS > ============ // ============ < VARIABLES.JS > ============
var dataFolderTree = {};
//"http://webchat.freenode.net/?nick=Ademe&channels=#anoe" //"http://webchat.freenode.net/?nick=Ademe&channels=#anoe"
var ircUrl="http://webchat.freenode.net/?nick="+ircNick+"&channels="+ircCHN; var ircUrl="http://webchat.freenode.net/?nick="+ircNick+"&channels="+ircCHN;
var twjs="tinawebJS/"; var twjs="tinawebJS/";
...@@ -113,6 +107,7 @@ var semanticConverged=0; ...@@ -113,6 +107,7 @@ var semanticConverged=0;
var socialConverged=0; var socialConverged=0;
var selections = []; var selections = [];
var deselections={};
var opossites = {}; var opossites = {};
var opos=[]; var opos=[];
var oposMAX; var oposMAX;
......
Subproject commit 48b160ef8b448189ccc1823e9157be9b954761a0 Subproject commit 3c33cf5719a166b090a55f8cd8fdd36ef93d922f
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