Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
b02c92a4
Commit
b02c92a4
authored
Sep 13, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/romain-testing' into testing
parents
12120fcf
a272535a
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
252 additions
and
238 deletions
+252
-238
constants.py
gargantext/constants.py
+5
-0
nodes.py
gargantext/views/api/nodes.py
+18
-23
extras_explorerjs.js
static/lib/graphExplorer/extras_explorerjs.js
+35
-18
DataScanner.js
static/lib/graphExplorer/tinawebJS/DataScanner.js
+5
-5
Tinaweb.js
static/lib/graphExplorer/tinawebJS/Tinaweb.js
+16
-16
asyncFA2.js
static/lib/graphExplorer/tinawebJS/asyncFA2.js
+10
-10
enviroment.js
static/lib/graphExplorer/tinawebJS/enviroment.js
+11
-11
globalUtils.js
static/lib/graphExplorer/tinawebJS/globalUtils.js
+18
-18
jLouvain.js
static/lib/graphExplorer/tinawebJS/jLouvain.js
+5
-5
main.js
static/lib/graphExplorer/tinawebJS/main.js
+2
-2
main_backup.js
static/lib/graphExplorer/tinawebJS/main_backup.js
+4
-4
methods.js
static/lib/graphExplorer/tinawebJS/methods.js
+21
-21
minimap.js
static/lib/graphExplorer/tinawebJS/minimap.js
+11
-11
sigma.forceatlas2.js
static/lib/graphExplorer/tinawebJS/sigma.forceatlas2.js
+7
-7
sigma.parseCustom.js
static/lib/graphExplorer/tinawebJS/sigma.parseCustom.js
+16
-16
sigmaUtils.js
static/lib/graphExplorer/tinawebJS/sigmaUtils.js
+25
-25
explorer.html
templates/graphExplorer/explorer.html
+43
-46
No files found.
gargantext/constants.py
View file @
b02c92a4
...
...
@@ -351,6 +351,11 @@ QUERY_SIZE_N_MAX = 1000
QUERY_SIZE_N_DEFAULT
=
1000
# ------------------------------------------------------------------------------
# Graph <=> nodes API parameters
# number of relevant publications shown
DEFAULT_N_DOCS_HAVING_NGRAM
=
5
# ------------------------------------------------------------------------------
# Graph constraints to compute the graph:
# Modes: live graph generation, graph asynchronously computed or errors detected
...
...
gargantext/views/api/nodes.py
View file @
b02c92a4
from
gargantext.models
import
Node
,
Ngram
,
NodeNgram
,
NodeNodeNgram
,
NodeNode
from
gargantext.constants
import
NODETYPES
from
gargantext.constants
import
NODETYPES
,
DEFAULT_N_DOCS_HAVING_NGRAM
from
gargantext.util.db
import
session
,
delete
,
func
,
bulk_insert
from
gargantext.util.db_cache
import
cache
,
or_
from
gargantext.util.validation
import
validate
...
...
@@ -144,7 +144,7 @@ class NodeListHaving(APIView):
Takes IDs of corpus and ngram and returns list of relevent documents in json format
according to TFIDF score (order is decreasing).
2016-09: add total counts to output json
'''
def
get
(
self
,
request
,
corpus_id
):
parameters
=
get_parameters
(
request
)
...
...
@@ -155,7 +155,7 @@ class NodeListHaving(APIView):
except
:
raise
ValidationException
(
'"ngram_ids" needs integers separated by comma.'
)
limit
=
5
limit
=
DEFAULT_N_DOCS_HAVING_NGRAM
nodes_list
=
[]
corpus
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
corpus_id
)
.
first
()
...
...
@@ -178,26 +178,18 @@ class NodeListHaving(APIView):
.
filter
(
Node
.
typename
==
'DOCUMENT'
,
Node
.
parent_id
==
corpus
.
id
)
.
filter
(
or_
(
*
[
NodeNodeNgram
.
ngram_id
==
ngram_id
for
ngram_id
in
ngram_ids
]))
.
group_by
(
Node
)
)
# get the total count before applying limit
nodes_count
=
nodes_query
.
count
()
# now the query with the limit
nodes_results_query
=
(
nodes_query
.
order_by
(
func
.
sum
(
NodeNodeNgram
.
score
)
.
desc
())
.
limit
(
limit
)
)
# print("\n")
# print("in TFIDF:")
# print("\tcorpus_id:",corpus_id)
# convert query result to a list of dicts
# if nodes_query is None:
# print("TFIDF error, juste take sums")
# nodes_query = (session
# .query(Node, func.sum(NodeNgram.weight))
# .join(NodeNgram, NodeNgram.node_id == Node.id)
# .filter(Node.parent_id == corpus_id)
# .filter(Node.typename == 'DOCUMENT')
# .filter(or_(*[NodeNgram.ngram_id==ngram_id for ngram_id in ngram_ids]))
# .group_by(Node)
# .order_by(func.sum(NodeNgram.weight).desc())
# .limit(limit)
# )
for
node
,
score
in
nodes_query
:
for
node
,
score
in
nodes_results_query
:
print
(
node
,
score
)
print
(
"
\t
corpus:"
,
corpus_id
,
"
\t
"
,
node
.
name
)
node_dict
=
{
...
...
@@ -209,7 +201,10 @@ class NodeListHaving(APIView):
node_dict
[
key
]
=
node
.
hyperdata
[
key
]
nodes_list
.
append
(
node_dict
)
return
JsonHttpResponse
(
nodes_list
)
return
JsonHttpResponse
({
'count'
:
nodes_count
,
'records'
:
nodes_list
})
...
...
static/lib/graphExplorer/extras_explorerjs.js
View file @
b02c92a4
...
...
@@ -3,13 +3,13 @@
*/
function
newPopup
(
url
)
{
console
.
log
(
'FUN extras_explorerjs:newPopup'
)
//
console.log('FUN extras_explorerjs:newPopup')
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
getIDFromURL
(
item
)
{
console
.
log
(
'FUN extras_explorerjs:getIDFromURL'
)
//
console.log('FUN extras_explorerjs:getIDFromURL')
var
pageurl
=
window
.
location
.
href
.
split
(
"/"
)
var
cid
;
for
(
var
i
in
pageurl
)
{
...
...
@@ -22,7 +22,7 @@ function getIDFromURL( item ) {
}
function
modify_ngrams
(
classname
)
{
console
.
log
(
'FUN extras_explorerjs:modify_ngrams'
)
//
console.log('FUN extras_explorerjs:modify_ngrams')
console
.
clear
()
var
corpus_id
=
getIDFromURL
(
"corpora"
)
// not used
...
...
@@ -86,7 +86,14 @@ function CRUD( list_id , ngram_ids , http_method , callback) {
}
// general listener: shift key in the window <=> add to selection
$
(
document
).
on
(
'keyup keydown'
,
function
(
e
){
// changes the global boolean ("add node to selection" status) if keydown and SHIFT
checkBox
=
e
.
shiftKey
// show it in the real checkbox too
$
(
'#checkboxdiv'
).
prop
(
"checked"
,
e
.
shiftKey
)
}
);
// = = = = = = = = = = = [ Clusters Plugin ] = = = = = = = = = = = //
...
...
@@ -95,7 +102,7 @@ function CRUD( list_id , ngram_ids , http_method , callback) {
// then, add the button in the html with the sigmaUtils.clustersBy(x) listener.
//TODO: move to ClustersPlugin.js or smntng
function
ChangeGraphAppearanceByAtt
(
manualflag
)
{
console
.
log
(
'FUN extras_explorerjs:ChangeGraphAppearanceByAtt'
)
//
console.log('FUN extras_explorerjs:ChangeGraphAppearanceByAtt')
if
(
!
isUndef
(
manualflag
)
&&
!
colorByAtt
)
colorByAtt
=
manualflag
;
if
(
!
colorByAtt
)
return
;
...
...
@@ -235,7 +242,7 @@ function CRUD( list_id , ngram_ids , http_method , callback) {
// then, it runs external library jLouvain()
//TODO: move to ClustersPlugin.js or smntng
function
RunLouvain
()
{
console
.
log
(
'FUN extras_explorerjs:RunLouvain'
)
//
console.log('FUN extras_explorerjs:RunLouvain')
var
node_realdata
=
[]
var
nodesV
=
getVisibleNodes
()
...
...
@@ -262,7 +269,7 @@ function CRUD( list_id , ngram_ids , http_method , callback) {
// Highlight nodes belonging to cluster_i when you click in thecluster_i of the legend
//TODO: move to ClustersPlugin.js or smntng
function
HoverCluster
(
ClusterCode
)
{
console
.
log
(
'FUN extras_explorerjs:HoverCluster'
)
//
console.log('FUN extras_explorerjs:HoverCluster')
console
.
log
(
ClusterCode
)
var
raw
=
ClusterCode
.
split
(
"||"
)
...
...
@@ -350,7 +357,7 @@ function CRUD( list_id , ngram_ids , http_method , callback) {
// daclass = "clust_default" | "clust_louvain" | "clust_x" ...
//TODO: move to ClustersPlugin.js or smntng
function
set_ClustersLegend
(
daclass
)
{
console
.
log
(
'FUN extras_explorerjs:set_ClustersLegend'
)
//
console.log('FUN extras_explorerjs:set_ClustersLegend')
//partialGraph.states.slice(-1)[0].LouvainFait = true
if
(
daclass
==
"clust_default"
&&
Clusters
.
length
==
0
)
...
...
@@ -412,7 +419,7 @@ function CRUD( list_id , ngram_ids , http_method , callback) {
// PHP-mode when you've a cortext db.
function
getTopPapers_OriginalVersion
(
type
){
console
.
log
(
'FUN extras_explorerjs:getTopPapers_OriginalVersion'
)
//
console.log('FUN extras_explorerjs:getTopPapers_OriginalVersion')
if
(
getAdditionalInfo
){
jsonparams
=
JSON
.
stringify
(
getSelections
());
bi
=
(
Object
.
keys
(
categories
).
length
==
2
)?
1
:
0
;
...
...
@@ -444,7 +451,7 @@ function getTopPapers_OriginalVersion(type){
// PHP-mode when you've a cortext db.
function
getTopProposals
(
type
,
jsonparams
,
thisgexf
)
{
console
.
log
(
'FUN extras_explorerjs:getTopProposals'
)
//
console.log('FUN extras_explorerjs:getTopProposals')
type
=
"semantic"
;
if
(
swclickActual
==
"social"
)
{
nodesA
=
[]
...
...
@@ -500,7 +507,7 @@ function getTopProposals(type , jsonparams , thisgexf) {
// Just for Garg
function
genericGetTopPapers
(
theids
,
corpus_id
,
thediv
)
{
console
.
log
(
'FUN extras_explorerjs:genericGetTopPapers'
)
//
console.log('FUN extras_explorerjs:genericGetTopPapers')
if
(
getAdditionalInfo
)
{
$
(
"#"
+
thediv
).
show
();
$
.
ajax
({
...
...
@@ -561,7 +568,7 @@ function genericGetTopPapers(theids , corpus_id , thediv) {
// Just for Garg: woops, override
function
getTopPapers
(
type
){
console
.
log
(
'FUN extras_explorerjs:getTopPapers'
)
//
console.log('FUN extras_explorerjs:getTopPapers')
if
(
getAdditionalInfo
){
$
(
"#topPapers"
).
show
();
...
...
@@ -597,8 +604,10 @@ function getTopPapers(type){
// pr(window.location.origin+'/api/tfidf/'+corpus_id+'/'+theids.join("a") )
// var arraydata = $.parseJSON(data)
var
output
=
"<ul style='padding: 0px; margin: 13px;'>"
for
(
var
i
in
data
)
{
var
pub
=
data
[
i
]
var
nDocsHavingNgram
=
data
.
count
;
var
nDocsShown
=
data
.
records
.
length
;
for
(
var
i
in
data
.
records
)
{
var
pub
=
data
.
records
[
i
]
if
(
pub
[
"title"
])
{
var
gquery
=
"https://search.iscpif.fr/?categories=general&q="
+
pub
[
"title"
].
replace
(
" "
+
"+"
)
...
...
@@ -645,6 +654,13 @@ function getTopPapers(type){
}
output
+=
"</ul>"
$
(
"#tab-container-top"
).
show
();
$
(
"#pubs-count-info"
).
remove
()
var
countInfo
=
$
(
'<span />'
).
attr
(
'id'
,
'pubs-count-info'
)
countInfo
.
html
(
" ("
+
nDocsShown
+
"/"
+
nDocsHavingNgram
+
")"
)
$
(
"#pubs-legend"
).
append
(
countInfo
)
// $('#tab-container-top').easytabs({updateHash:false});
$
(
"#topPapers"
).
html
(
output
);
},
...
...
@@ -664,7 +680,7 @@ function getTopPapers(type){
}
function
getCookie
(
name
)
{
console
.
log
(
'FUN extras_explorerjs:getCookie'
)
//
console.log('FUN extras_explorerjs:getCookie')
var
cookieValue
=
null
;
if
(
document
.
cookie
&&
document
.
cookie
!=
''
)
{
var
cookies
=
document
.
cookie
.
split
(
';'
);
...
...
@@ -681,7 +697,7 @@ function getCookie(name) {
}
// Just for Garg
function
printCorpuses
()
{
console
.
log
(
'FUN extras_explorerjs:printCorpuses'
)
//
console.log('FUN extras_explorerjs:printCorpuses')
console
.
clear
()
console
.
log
(
"!!!!!!!! Corpus chosen, going to make the diff !!!!!!!! "
)
pr
(
corpusesList
)
...
...
@@ -803,7 +819,7 @@ function printCorpuses() {
// Just for Garg
function
GetUserPortfolio
()
{
console
.
log
(
'FUN extras_explorerjs:GetUserPortfolio'
)
//
console.log('FUN extras_explorerjs:GetUserPortfolio')
//http://localhost:8000/api/corpusintersection/1a50317a50145
var
pageurl
=
window
.
location
.
href
.
split
(
"/"
)
var
pid
;
...
...
@@ -921,7 +937,7 @@ function GetUserPortfolio() {
}
function
camaraButton
(){
console
.
log
(
'FUN extras_explorerjs:camaraButton'
)
//
console.log('FUN extras_explorerjs:camaraButton')
$
(
"#PhotoGraph"
).
click
(
function
(){
//canvas=partialGraph._core.domElements.nodes;
...
...
@@ -973,8 +989,9 @@ function camaraButton(){
});
}
function
getTips
(){
console
.
log
(
'FUN extras_explorerjs:getTips'
)
//
console.log('FUN extras_explorerjs:getTips')
param
=
''
;
text
=
...
...
static/lib/graphExplorer/tinawebJS/DataScanner.js
View file @
b02c92a4
function
scanDataFolder
(){
console
.
log
(
'FUN t.DataScanner:scanDataFolder'
)
//
console.log('FUN t.DataScanner:scanDataFolder')
$
.
ajax
({
type
:
'GET'
,
url
:
'php/DirScan_main.php'
,
...
...
@@ -18,19 +18,19 @@ function scanDataFolder(){
}
function
getGexfPath
(
v
){
console
.
log
(
'FUN t.DataScanner:getGexfPath'
)
//
console.log('FUN t.DataScanner:getGexfPath')
gexfpath
=
(
gexfDictReverse
[
v
])?
gexfDictReverse
[
v
]:
v
;
return
gexfpath
;
}
function
getGexfLegend
(
gexfPath
){
console
.
log
(
'FUN t.DataScanner:getGexfLegend'
)
//
console.log('FUN t.DataScanner:getGexfLegend')
legend
=
(
gexfDict
[
gexfPath
])?
gexfDict
[
gexfPath
]:
gexfPath
;
return
legend
;
}
function
jsActionOnGexfSelector
(
gexfLegend
){
console
.
log
(
'FUN t.DataScanner:jsActionOnGexfSelector'
)
//
console.log('FUN t.DataScanner:jsActionOnGexfSelector')
if
(
getGexfPath
[
gexfLegend
])
window
.
location
=
window
.
location
.
origin
+
window
.
location
.
pathname
+
"?file="
+
encodeURIComponent
(
getGexfPath
(
gexfLegend
));
else
...
...
@@ -38,7 +38,7 @@ function jsActionOnGexfSelector(gexfLegend){
}
function
listGexfs
(){
console
.
log
(
'FUN t.DataScanner:listGexfs'
)
//
console.log('FUN t.DataScanner:listGexfs')
divlen
=
$
(
"#gexfs"
).
length
;
if
(
divlen
>
0
)
{
param
=
JSON
.
stringify
(
gexfDict
);
...
...
static/lib/graphExplorer/tinawebJS/Tinaweb.js
View file @
b02c92a4
// Function.prototype.index
(
function
(
reComments
,
reParams
,
reNames
)
{
Function
.
prototype
.
index
=
function
(
arrParamNames
)
{
console
.
log
(
'FUN t.TinawebJS:Function=>index'
)
//
console.log('FUN t.TinawebJS:Function=>index')
var
fnMe
=
this
;
arrParamNames
=
arrParamNames
||
(((
fnMe
+
''
).
replace
(
reComments
,
''
)
...
...
@@ -25,7 +25,7 @@
// on window resize
// @param canvasdiv: id of the div (without '#')
function
sigmaLimits
(
canvasdiv
,
SidecolumnIsInvisible
)
{
console
.
log
(
'FUN t.TinawebJS:sigmaLimits (div='
+
canvasdiv
+
')'
)
;
//
console.log('FUN t.TinawebJS:sigmaLimits (div=' + canvasdiv + ')') ;
var
canvas
=
document
.
getElementById
(
canvasdiv
)
;
var
sidecolumn
=
document
.
getElementById
(
'sidecolumn'
)
;
...
...
@@ -52,10 +52,10 @@ function sigmaLimits( canvasdiv, SidecolumnIsInvisible ) {
SelectionEngine
=
function
()
{
console
.
log
(
'FUN t.TinawebJS:SelectionEngine:new'
)
//
console.log('FUN t.TinawebJS:SelectionEngine:new')
// Selection Engine!! finally...
this
.
SelectorEngine_part01
=
(
function
(
cursorsize
,
area
)
{
console
.
log
(
'FUN t.TinawebJS:SelectionEngine:SelectorEngine_part01'
)
//
console.log('FUN t.TinawebJS:SelectionEngine:SelectorEngine_part01')
var
clickedNodes
=
[]
if
(
cursorsize
>
0
)
{
clickedNodes
=
this
.
SelectThis2
(
area
)
...
...
@@ -70,7 +70,7 @@ SelectionEngine = function() {
}).
index
();
this
.
SelectorEngine_part02
=
(
function
(
addvalue
,
clicktype
,
prevsels
,
currsels
)
{
console
.
log
(
'FUN t.TinawebJS:SelectionEngine:SelectorEngine_part02'
)
//
console.log('FUN t.TinawebJS:SelectionEngine:SelectorEngine_part02')
print
(
"Add[]:"
)
print
(
addvalue
)
print
(
"clicktype:"
)
...
...
@@ -127,7 +127,7 @@ SelectionEngine = function() {
}).
index
();
this
.
SelectorEngine
=
(
function
(
cursorsize
,
area
,
addvalue
,
clicktype
,
prevsels
,
currsels
)
{
console
.
log
(
'FUN t.TinawebJS:SelectionEngine:SelectorEngine'
)
//
console.log('FUN t.TinawebJS:SelectionEngine:SelectorEngine')
var
targeted
=
[]
var
buffer
=
Object
.
keys
(
prevsels
).
map
(
Number
).
sort
(
this
.
sortNumber
);
...
...
@@ -199,7 +199,7 @@ SelectionEngine = function() {
// uses: SelectorEngine() and MultipleSelection2()
this
.
search
=
function
(
string
)
{
console
.
log
(
'FUN t.TinawebJS:SelectionEngine:search'
)
//
console.log('FUN t.TinawebJS:SelectionEngine:search')
var
id_node
=
''
;
var
results
=
find
(
string
)
...
...
@@ -230,7 +230,7 @@ SelectionEngine = function() {
//Util
this
.
intersect_safe
=
function
(
a
,
b
)
{
console
.
log
(
'FUN t.TinawebJS:SelectionEngine:intersect_safe'
)
//
console.log('FUN t.TinawebJS:SelectionEngine:intersect_safe')
var
ai
=
0
,
bi
=
0
;
var
result
=
new
Array
();
...
...
@@ -249,7 +249,7 @@ SelectionEngine = function() {
// return Nodes-ids under the clicked Area
// external usage : partialGraph
this
.
SelectThis2
=
function
(
area
)
{
console
.
log
(
'FUN t.TinawebJS:SelectionEngine:SelectThis2'
)
//
console.log('FUN t.TinawebJS:SelectionEngine:SelectThis2')
var
x1
=
area
.
x1
;
var
y1
=
area
.
y1
;
...
...
@@ -273,7 +273,7 @@ SelectionEngine = function() {
// external usage : partialGraph , updateLeftPanel_fix();
this
.
MultipleSelection2
=
(
function
(
nodes
,
nodesDict
,
edgesDict
)
{
console
.
log
(
'FUN t.TinawebJS:SelectionEngine:MultipleSelection2'
)
//
console.log('FUN t.TinawebJS:SelectionEngine:MultipleSelection2')
// pr("IN SelectionEngine.MultipleSelection2:")
print
(
nodes
)
greyEverything
();
...
...
@@ -370,7 +370,7 @@ SelectionEngine = function() {
};
TinaWebJS
=
function
(
sigmacanvas
)
{
console
.
log
(
'FUN t.TinawebJS:TinaWebJS:new'
)
//
console.log('FUN t.TinawebJS:TinaWebJS:new')
// '#canvasid'
this
.
sigmacanvas
=
sigmacanvas
;
...
...
@@ -380,12 +380,12 @@ TinaWebJS = function ( sigmacanvas ) {
}
this
.
getSigmaCanvas
=
function
()
{
console
.
log
(
'FUN t.TinawebJS:getSigmaCanvas'
)
//
console.log('FUN t.TinawebJS:getSigmaCanvas')
return
this
.
sigmacanvas
;
}
this
.
AdjustSigmaCanvas
=
function
(
canvasdiv
)
{
console
.
log
(
'FUN t.TinawebJS:AdjustSigmaCanvas'
)
//
console.log('FUN t.TinawebJS:AdjustSigmaCanvas')
if
(
!
canvasdiv
)
// '#canvasid' => 'canvasid'
canvasdiv
=
sigmacanvas
.
substring
(
1
);
...
...
@@ -394,7 +394,7 @@ TinaWebJS = function ( sigmacanvas ) {
}
this
.
SearchListeners
=
function
()
{
console
.
log
(
'FUN t.TinawebJS:SearchListeners'
)
//
console.log('FUN t.TinawebJS:SearchListeners')
var
SelInst
=
new
SelectionEngine
();
$
.
ui
.
autocomplete
.
prototype
.
_renderItem
=
function
(
ul
,
item
)
{
...
...
@@ -510,19 +510,19 @@ TinaWebJS = function ( sigmacanvas ) {
}
}
});
}
// external usage: SelectorEngine*() , MultipleSelection2() ,
// enviroment.js:changeType()|changeLevel()|NodeWeightFilter()|EdgeWeightFilter
this
.
initListeners
=
function
(
categories
,
partialGraph
)
{
console
.
log
(
'FUN t.TinawebJS:initListeners'
)
//
console.log('FUN t.TinawebJS:initListeners')
var
SelInst
=
new
SelectionEngine
();
$
(
"#semLoader"
).
hide
();
$
(
"#closeloader"
).
click
();
$
(
'.etabs'
).
click
(
function
(){
$
.
doTimeout
(
500
,
function
()
{
$
(
"#opossiteNodes"
).
readmore
({
maxHeight
:
200
});
...
...
static/lib/graphExplorer/tinawebJS/asyncFA2.js
View file @
b02c92a4
// Mathieu Jacomy @ Sciences Po Médialab & WebAtlas
var
ForceAtlas2
=
function
(
graph
)
{
console
.
log
(
'FUN t.asyncFA2:ForceAtlas2'
)
//
console.log('FUN t.asyncFA2:ForceAtlas2')
var
self
=
this
;
this
.
graph
=
graph
;
...
...
@@ -32,7 +32,7 @@ var ForceAtlas2 = function(graph) {
// Runtime (the ForceAtlas2 itself)
this
.
init
=
function
()
{
console
.
log
(
'FUN t.asyncFA2:init'
)
//
console.log('FUN t.asyncFA2:init')
self
.
state
=
{
step
:
0
,
index
:
0
};
self
.
graph
.
nodes
.
forEach
(
function
(
n
)
{
n
.
fa2
=
{
...
...
@@ -48,12 +48,12 @@ var ForceAtlas2 = function(graph) {
}
this
.
go
=
function
()
{
console
.
log
(
'FUN t.asyncFA2:go'
)
//
console.log('FUN t.asyncFA2:go')
while
(
self
.
onebucle
())
{}
}
this
.
onebucle
=
function
()
{
console
.
log
(
'FUN t.asyncFA2:onebucle'
)
//
console.log('FUN t.asyncFA2:onebucle')
var
graph
=
self
.
graph
;
var
nodes
=
graph
.
nodes
;
var
edges
=
graph
.
edges
;
...
...
@@ -350,7 +350,7 @@ var ForceAtlas2 = function(graph) {
}
this
.
end
=
function
()
{
console
.
log
(
'FUN t.asyncFA2:end'
)
//
console.log('FUN t.asyncFA2:end')
this
.
graph
.
nodes
.
forEach
(
function
(
n
)
{
n
.
fa2
=
null
;
});
...
...
@@ -358,7 +358,7 @@ var ForceAtlas2 = function(graph) {
// Auto Settings
this
.
setAutoSettings
=
function
()
{
console
.
log
(
'FUN t.asyncFA2:setAutoSettings'
)
//
console.log('FUN t.asyncFA2:setAutoSettings')
var
graph
=
this
.
graph
;
// Tuning
...
...
@@ -839,7 +839,7 @@ var ForceAtlas2 = function(graph) {
var
updateMassAndGeometry
=
function
()
{
console
.
log
(
'FUN t.asyncFA2:updateMassAndGeometry'
)
//
console.log('FUN t.asyncFA2:updateMassAndGeometry')
if
(
this
.
nodes
.
length
>
1
)
{
// Compute Mass
var
mass
=
0
;
...
...
@@ -892,7 +892,7 @@ var Region = function(nodes, depth) {
var
buildSubRegions
=
function
()
{
console
.
log
(
'FUN t.asyncFA2:buildSubRegions'
)
//
console.log('FUN t.asyncFA2:buildSubRegions')
if
(
this
.
nodes
.
length
>
1
)
{
var
leftNodes
=
[];
var
rightNodes
=
[];
...
...
@@ -944,7 +944,7 @@ var buildSubRegions = function() {
};
var
applyForce
=
function
(
n
,
Force
,
theta
)
{
console
.
log
(
'FUN t.asyncFA2:applyForce'
)
//
console.log('FUN t.asyncFA2:applyForce')
if
(
this
.
nodes
.
length
<
2
)
{
var
regionNode
=
this
.
nodes
[
0
];
Force
.
apply_nn
(
n
,
regionNode
);
...
...
@@ -967,7 +967,7 @@ var applyForce = function(n, Force, theta) {
};
var
startForceAtlas2
=
function
(
graph
,
limit_it
)
{
console
.
log
(
'FUN t.asyncFA2:startForceAtlas2'
)
//
console.log('FUN t.asyncFA2:startForceAtlas2')
// pr("inside FA2")
//// if(!this.forceatlas2) {
// pr(graph);
...
...
static/lib/graphExplorer/tinawebJS/enviroment.js
View file @
b02c92a4
...
...
@@ -3,7 +3,7 @@
//============================ < NEW BUTTONS > =============================//
function
changeType_old
()
{
console
.
log
(
'FUN t.enviroment:changeType_old'
)
//
console.log('FUN t.enviroment:changeType_old')
pr
(
"***swclickActual:"
+
swclickActual
+
" , swMacro:"
+
swMacro
);
if
(
swclickActual
==
"social"
)
{
...
...
@@ -119,7 +119,7 @@ function changeType_old() {
function
changeType
()
{
console
.
log
(
'FUN t.enviroment:changeType'
)
//
console.log('FUN t.enviroment:changeType')
var
present
=
partialGraph
.
states
.
slice
(
-
1
)[
0
];
// Last
var
past
=
partialGraph
.
states
.
slice
(
-
2
)[
0
]
// avant Last
var
lastpos
=
partialGraph
.
states
.
length
-
1
;
...
...
@@ -377,7 +377,7 @@ function changeType() {
}
function
changeLevel
()
{
console
.
log
(
'FUN t.enviroment:changeLevel'
)
//
console.log('FUN t.enviroment:changeLevel')
var
present
=
partialGraph
.
states
.
slice
(
-
1
)[
0
];
// Last
var
past
=
partialGraph
.
states
.
slice
(
-
2
)[
0
]
// avant Last
var
lastpos
=
partialGraph
.
states
.
length
-
1
;
...
...
@@ -504,7 +504,7 @@ function changeLevel() {
}
function
changeLevel_old
()
{
console
.
log
(
'FUN t.enviroment:changeLevel_old'
)
//
console.log('FUN t.enviroment:changeLevel_old')
bf
=
swclickActual
pushSWClick
(
swclickActual
);
pr
(
"swMacro: "
+
swMacro
+
" - [swclickPrev: "
+
bf
+
"] - [swclickActual: "
+
swclickActual
+
"]"
)
...
...
@@ -553,7 +553,7 @@ function changeLevel_old() {
// EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
function
EdgeWeightFilter
(
sliderDivID
,
type_attrb
,
type
,
criteria
)
{
console
.
log
(
'FUN t.enviroment:EdgeWeightFilter'
)
//
console.log('FUN t.enviroment:EdgeWeightFilter')
// console.log("")
// console.log("")
// console.log(" - - - - EdgeWeightFilter - - - ")
...
...
@@ -765,7 +765,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
// NodeWeightFilter ( "#sliderANodeWeight" , "Document" , "type" , "size")
// NodeWeightFilter ( "#sliderBNodeWeight" , "NGram" , "type" , "size")
function
NodeWeightFilter
(
categories
,
sliderDivID
,
type_attrb
,
type
,
criteria
)
{
console
.
log
(
'FUN t.enviroment:NodeWeightFilter'
)
//
console.log('FUN t.enviroment:NodeWeightFilter')
// if ($(sliderDivID).html()!="") {
// pr("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]")
...
...
@@ -879,7 +879,7 @@ function NodeWeightFilter( categories , sliderDivID , type_attrb , type , crit
}
function
getGraphElement
(
elem
)
{
console
.
log
(
'FUN t.enviroment:getGraphElement'
)
//
console.log('FUN t.enviroment:getGraphElement')
if
(
elem
.
split
(
";"
).
length
==
1
)
return
partialGraph
.
_core
.
graph
.
nodesIndex
[
elem
];
else
{
if
(
!
isUndef
(
partialGraph
.
_core
.
graph
.
edgesIndex
[
elem
]))
...
...
@@ -896,7 +896,7 @@ function getGraphElement(elem) {
// AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "Document" , "size")
// AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "NGram" , "size")
function
AlgorithmForSliders
(
elements
,
type_attrb
,
type
,
criteria
)
{
console
.
log
(
'FUN t.enviroment:AlgorithmForSliders'
)
//
console.log('FUN t.enviroment:AlgorithmForSliders')
// console.clear()
// console.log( "\t - - - - - AlgorithmForSliders - - - - -" )
// console.log( "" )
...
...
@@ -1003,7 +1003,7 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
//============================= < SEARCH > =============================//
function
updateSearchLabels
(
id
,
name
,
type
){
console
.
log
(
'FUN t.enviroment:updateSearchLabels'
)
//
console.log('FUN t.enviroment:updateSearchLabels')
labels
.
push
({
'id'
:
id
,
'label'
:
name
,
...
...
@@ -1012,7 +1012,7 @@ function updateSearchLabels(id,name,type){
}
function
extractContext
(
string
,
context
)
{
console
.
log
(
'FUN t.enviroment:extractContext'
)
//
console.log('FUN t.enviroment:extractContext')
var
matched
=
string
.
toLowerCase
().
indexOf
(
context
.
toLowerCase
());
if
(
matched
==
-
1
)
...
...
@@ -1043,7 +1043,7 @@ function extractContext(string, context) {
}
function
searchLabel
(
string
){
console
.
log
(
'FUN t.enviroment:searchLabel'
)
//
console.log('FUN t.enviroment:searchLabel')
var
id_node
=
''
;
var
n
;
...
...
static/lib/graphExplorer/tinawebJS/globalUtils.js
View file @
b02c92a4
...
...
@@ -10,7 +10,7 @@ function print(msg) {
//to general utils
function
getClientTime
(){
console
.
log
(
'FUN t.globalUtils:getClientTime'
)
//
console.log('FUN t.globalUtils:getClientTime')
var
totalSec
=
new
Date
().
getTime
()
/
1000
;
var
d
=
new
Date
();
var
hours
=
d
.
getHours
();
...
...
@@ -21,13 +21,13 @@ function getClientTime(){
}
function
compareNumbers
(
a
,
b
)
{
console
.
log
(
'FUN t.globalUtils:compareNumbers'
)
//
console.log('FUN t.globalUtils:compareNumbers')
return
a
-
b
;
}
//python range(a,b) | range(a)
function
calc_range
(
begin
,
end
)
{
console
.
log
(
'FUN t.globalUtils:calc_range'
)
//
console.log('FUN t.globalUtils:calc_range')
if
(
typeof
end
===
"undefined"
)
{
end
=
begin
;
begin
=
0
;
}
...
...
@@ -41,7 +41,7 @@ function calc_range(begin, end) {
//to general utils (not used btw)
function
cloneObject
(
source
)
{
console
.
log
(
'FUN t.globalUtils:cloneObject'
)
//
console.log('FUN t.globalUtils:cloneObject')
for
(
i
in
source
)
{
if
(
typeof
source
[
i
]
==
'source'
)
{
this
[
i
]
=
new
cloneObject
(
source
[
i
]);
...
...
@@ -53,14 +53,14 @@ function cloneObject(source) {
}
function
isUndef
(
variable
){
// console.log('FUN t.globalUtils:isUndef')
//
//
console.log('FUN t.globalUtils:isUndef')
if
(
typeof
(
variable
)
===
"undefined"
)
return
true
;
else
return
false
;
}
$
.
fn
.
toggleClick
=
function
(){
console
.
log
(
'FUN t.globalUtils:toggleClick'
)
//
console.log('FUN t.globalUtils:toggleClick')
methods
=
arguments
,
// store the passed arguments for future reference
count
=
methods
.
length
;
// cache the number of methods
...
...
@@ -77,7 +77,7 @@ $.fn.toggleClick = function(){
getUrlParam
=
(
function
()
{
console
.
log
(
'FUN t.globalUtils:getUrlParam'
)
//
console.log('FUN t.globalUtils:getUrlParam')
var
get
=
{
push
:
function
(
key
,
value
){
var
cur
=
this
[
key
];
...
...
@@ -108,7 +108,7 @@ getUrlParam = (function () {
function
ArraySortByValue
(
array
,
sortFunc
){
console
.
log
(
'FUN t.globalUtils:ArraySortByValue'
)
//
console.log('FUN t.globalUtils:ArraySortByValue')
var
tmp
=
[];
oposMAX
=
0
;
for
(
var
k
in
array
)
{
...
...
@@ -130,7 +130,7 @@ function ArraySortByValue(array, sortFunc){
function
ArraySortByKey
(
array
,
sortFunc
){
console
.
log
(
'FUN t.globalUtils:ArraySortByKey'
)
//
console.log('FUN t.globalUtils:ArraySortByKey')
var
tmp
=
[];
for
(
var
k
in
array
)
{
if
(
array
.
hasOwnProperty
(
k
))
{
...
...
@@ -149,7 +149,7 @@ function ArraySortByKey(array, sortFunc){
function
is_empty
(
obj
)
{
console
.
log
(
'FUN t.globalUtils:is_empty'
)
//
console.log('FUN t.globalUtils:is_empty')
// Assume if it has a length property with a non-zero value
// that that property is correct.
if
(
obj
.
length
&&
obj
.
length
>
0
)
return
false
;
...
...
@@ -163,14 +163,14 @@ function is_empty(obj) {
function
getByID
(
elem
)
{
console
.
log
(
'FUN t.globalUtils:getByID'
)
//
console.log('FUN t.globalUtils:getByID')
return
document
.
getElementById
(
elem
);
}
function
hex2rga
(
sent_hex
)
{
// console.log('FUN t.globalUtils:hex2rga')
//
//
console.log('FUN t.globalUtils:hex2rga')
result
=
[]
hex
=
(
sent_hex
.
charAt
(
0
)
===
"#"
?
sent_hex
.
substr
(
1
)
:
sent_hex
);
// check if 6 letters are provided
...
...
@@ -185,7 +185,7 @@ function hex2rga(sent_hex) {
}
function
calculateFull
(
hex
)
{
// console.log('FUN t.globalUtils:calculateFull')
//
//
console.log('FUN t.globalUtils:calculateFull')
var
r
=
parseInt
(
hex
.
substring
(
0
,
2
),
16
);
var
g
=
parseInt
(
hex
.
substring
(
2
,
4
),
16
);
var
b
=
parseInt
(
hex
.
substring
(
4
,
6
),
16
);
...
...
@@ -195,7 +195,7 @@ function calculateFull(hex) {
// function for calculating 3 letters hex value
function
calculatePartial
(
hex
)
{
console
.
log
(
'FUN t.globalUtils:calculatePartial'
)
//
console.log('FUN t.globalUtils:calculatePartial')
var
r
=
parseInt
(
hex
.
substring
(
0
,
1
)
+
hex
.
substring
(
0
,
1
),
16
);
var
g
=
parseInt
(
hex
.
substring
(
1
,
2
)
+
hex
.
substring
(
1
,
2
),
16
);
var
b
=
parseInt
(
hex
.
substring
(
2
,
3
)
+
hex
.
substring
(
2
,
3
),
16
);
...
...
@@ -203,13 +203,13 @@ function calculatePartial(hex) {
}
function
componentToHex
(
c
)
{
console
.
log
(
'FUN t.globalUtils:componentToHex'
)
//
console.log('FUN t.globalUtils:componentToHex')
var
hex
=
c
.
toString
(
16
);
return
hex
.
length
==
1
?
"0"
+
hex
:
hex
;
}
function
rgbToHex
(
r
,
g
,
b
)
{
console
.
log
(
'FUN t.globalUtils:rgbToHex'
)
//
console.log('FUN t.globalUtils:rgbToHex')
return
"#"
+
componentToHex
(
r
)
+
componentToHex
(
g
)
+
componentToHex
(
b
);
}
...
...
@@ -218,7 +218,7 @@ function rgbToHex(r, g, b) {
* function to load a given css file
*/
loadCSS
=
function
(
href
)
{
console
.
log
(
'FUN t.globalUtils:loadCSS'
)
//
console.log('FUN t.globalUtils:loadCSS')
var
cssLink
=
$
(
"<link rel='stylesheet' type='text/css' href='"
+
href
+
"'>"
);
$
(
"head"
).
append
(
cssLink
);
};
...
...
@@ -227,7 +227,7 @@ function rgbToHex(r, g, b) {
* function to load a given js file
*/
loadJS
=
function
(
src
)
{
console
.
log
(
'FUN t.globalUtils:loadJS'
)
//
console.log('FUN t.globalUtils:loadJS')
var
jsLink
=
$
(
"<script type='text/javascript' src='"
+
src
+
"'>"
);
$
(
"head"
).
append
(
jsLink
);
};
static/lib/graphExplorer/tinawebJS/jLouvain.js
View file @
b02c92a4
...
...
@@ -8,7 +8,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
*/
(
function
(){
jLouvain
=
function
(){
console
.
log
(
'FUN t.jLouvain:jLouvain'
)
//
console.log('FUN t.jLouvain:jLouvain')
//Constants
var
__PASS_MAX
=
-
1
var
__MIN
=
0.0000001
...
...
@@ -116,7 +116,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
//Core-Algorithm Related
function
init_status
(
graph
,
status
,
part
){
console
.
log
(
'FUN t.jLouvain:init_status'
)
//
console.log('FUN t.jLouvain:init_status')
status
[
'nodes_to_com'
]
=
{};
status
[
'total_weight'
]
=
0
;
status
[
'internals'
]
=
{};
...
...
@@ -271,7 +271,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
}
function
induced_graph
(
partition
,
graph
){
console
.
log
(
'FUN t.jLouvain:induced_graph'
)
//
console.log('FUN t.jLouvain:induced_graph')
var
ret
=
{
nodes
:[],
edges
:[],
_assoc_mat
:
{}};
var
w_prec
,
weight
;
//add nodes from partition values
...
...
@@ -289,7 +289,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
}
function
partition_at_level
(
dendogram
,
level
){
console
.
log
(
'FUN t.jLouvain:partition_at_level'
)
//
console.log('FUN t.jLouvain:partition_at_level')
var
partition
=
clone
(
dendogram
[
0
]);
for
(
var
i
=
1
;
i
<
level
+
1
;
i
++
)
Object
.
keys
(
partition
).
forEach
(
function
(
key
,
j
){
...
...
@@ -302,7 +302,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
function
generate_dendogram
(
graph
,
part_init
){
console
.
log
(
'FUN t.jLouvain:generate_dendogram'
)
//
console.log('FUN t.jLouvain:generate_dendogram')
if
(
graph
.
edges
.
length
==
0
){
var
part
=
{};
...
...
static/lib/graphExplorer/tinawebJS/main.js
View file @
b02c92a4
...
...
@@ -89,7 +89,7 @@ $.ajax({
});
function
showDialog
(
url
,
hasError
,
status
,
msg
)
{
console
.
log
(
'FUN t.main:showDialog'
+
'hasError:'
+
hasError
)
//
console.log('FUN t.main:showDialog' + 'hasError:'+hasError)
// hide loader gif etc
$
(
"#semLoader"
).
hide
();
$
(
"#closeloader"
).
click
();
...
...
@@ -111,7 +111,7 @@ function showDialog(url, hasError, status, msg) {
function
MainFunction
(
RES
)
{
console
.
log
(
' ------------'
)
console
.
log
(
'FUN t.main:MainFunction'
)
//
console.log('FUN t.main:MainFunction')
console
.
log
(
' ------------'
)
var
fileparam
;
// = { db|api.json , somefile.json|gexf }
var
the_data
=
RES
[
"data"
];
...
...
static/lib/graphExplorer/tinawebJS/main_backup.js
View file @
b02c92a4
...
...
@@ -71,7 +71,7 @@ else {
//just CSS
function
sigmaLimits
(){
console
.
log
(
'FUN t.main_backup:sigmaLimits'
)
//
console.log('FUN t.main_backup:sigmaLimits')
pr
(
"
\
t*** sigmaLimits()"
)
pw
=
$
(
'#sigma-example'
).
width
();
...
...
@@ -92,7 +92,7 @@ function sigmaLimits(){
}
function
bringTheNoise
(
pathfile
,
type
){
console
.
log
(
'FUN t.main_backup:bringTheNoise'
)
//
console.log('FUN t.main_backup:bringTheNoise')
$
(
"#semLoader"
).
hide
();
...
...
@@ -307,7 +307,7 @@ function bringTheNoise(pathfile,type){
function
theListeners
(){
console
.
log
(
'FUN t.main_backup:theListeners'
)
//
console.log('FUN t.main_backup:theListeners')
pr
(
"in THELISTENERS"
);
// leftPanel("close");
$
(
"#closeloader"
).
click
();
//modal.hide doesnt work :c
...
...
@@ -692,7 +692,7 @@ function theListeners(){
// Social Spatialization
// Semantic Spatialization
function
SigmaLayouting
(
URL
,
DATA
,
NAME
)
{
console
.
log
(
'FUN t.main_backup:SigmaLayouting'
)
//
console.log('FUN t.main_backup:SigmaLayouting')
pr
(
URL
+
"?"
+
DATA
)
return
$
.
ajax
({
type
:
'GET'
,
...
...
static/lib/graphExplorer/tinawebJS/methods.js
View file @
b02c92a4
function
cancelSelection
(
fromTagCloud
)
{
console
.
log
(
'FUN t.methods:cancelSelection'
)
//
console.log('FUN t.methods:cancelSelection')
pr
(
"
\
t***in cancelSelection"
);
highlightSelectedNodes
(
false
);
//Unselect the selected ones :D
opossites
=
[];
...
...
@@ -55,7 +55,7 @@ function cancelSelection (fromTagCloud) {
}
function
highlightSelectedNodes
(
flag
){
console
.
log
(
'FUN t.methods:highlightSelectedNodes'
)
//
console.log('FUN t.methods:highlightSelectedNodes')
pr
(
"
\
t***methods.js:highlightSelectedNodes(flag)"
+
flag
+
" selEmpty:"
+
is_empty
(
selections
))
if
(
!
is_empty
(
selections
)){
for
(
var
i
in
selections
)
{
...
...
@@ -78,7 +78,7 @@ function highlightSelectedNodes(flag){
}
function
alertCheckBox
(
eventCheck
){
console
.
log
(
'FUN t.methods:alertCheckBox'
)
//
console.log('FUN t.methods:alertCheckBox')
if
(
!
isUndef
(
eventCheck
.
checked
))
checkBox
=
eventCheck
.
checked
;
}
...
...
@@ -91,7 +91,7 @@ function alertCheckBox(eventCheck){
// b : Meso-Semantic
// AaBb: Socio-Semantic
function
RefreshState
(
newNOW
){
console
.
log
(
'FUN t.methods:RefreshState'
)
//
console.log('FUN t.methods:RefreshState')
pr
(
"
\
t
\
t
\
tin RefreshState newNOW:_"
+
newNOW
+
"_."
)
if
(
newNOW
!=
""
)
{
...
...
@@ -178,7 +178,7 @@ function RefreshState(newNOW){
}
function
pushSWClick
(
arg
){
console
.
log
(
'FUN t.methods:pushSWClick'
)
//
console.log('FUN t.methods:pushSWClick')
swclickPrev
=
swclickActual
;
swclickActual
=
arg
;
}
...
...
@@ -186,7 +186,7 @@ function pushSWClick(arg){
function
manualForceLabel
(
nodeid
,
active
)
{
console
.
log
(
'FUN t.methods:manualForceLabel'
)
//
console.log('FUN t.methods:manualForceLabel')
// pr("manual|"+nodeid+"|"+active)
partialGraph
.
_core
.
graph
.
nodesIndex
[
nodeid
].
active
=
active
;
partialGraph
.
draw
();
...
...
@@ -195,7 +195,7 @@ function manualForceLabel(nodeid,active) {
// nodes information div
function
htmlfied_nodesatts
(
elems
){
console
.
log
(
'FUN t.methods:htmlfied_nodesatts'
)
//
console.log('FUN t.methods:htmlfied_nodesatts')
var
socnodes
=
[]
var
semnodes
=
[]
for
(
var
i
in
elems
)
{
...
...
@@ -242,14 +242,14 @@ function htmlfied_nodesatts(elems){
function
manualSelectNode
(
nodeid
)
{
console
.
log
(
'FUN t.methods:manualSelectNode'
)
//
console.log('FUN t.methods:manualSelectNode')
cancelSelection
(
false
);
var
SelInst
=
new
SelectionEngine
();
SelInst
.
MultipleSelection2
({
nodes
:[
nodeid
]});
}
function
htmlfied_tagcloud
(
elems
,
limit
)
{
console
.
log
(
'FUN t.methods:htmlfied_tagcloud'
)
//
console.log('FUN t.methods:htmlfied_tagcloud')
if
(
elems
.
length
==
0
)
return
false
;
var
termNodes
=
[]
js1
=
""
//'onclick="graphTagCloudElem(\'';
...
...
@@ -282,7 +282,7 @@ function htmlfied_tagcloud(elems , limit) {
//missing: getTopPapers for both node types
//considering complete graphs case! <= maybe i should mv it
function
updateLeftPanel_fix
(
sels
,
oppos
)
{
console
.
log
(
'FUN t.methods:updateLeftPanel_fix'
)
//
console.log('FUN t.methods:updateLeftPanel_fix')
pr
(
"updateLeftPanel() corrected version** "
)
var
namesDIV
=
''
var
alterNodesDIV
=
''
...
...
@@ -354,7 +354,7 @@ function updateLeftPanel_fix( sels , oppos ) {
}
function
printStates
()
{
console
.
log
(
'FUN t.methods:printStates'
)
//
console.log('FUN t.methods:printStates')
pr
(
"
\
t
\
t
\
t
\
t---------"
+
getClientTime
()
+
"---------"
)
pr
(
"
\
t
\
t
\
t
\
tswMacro: "
+
swMacro
)
pr
(
"
\
t
\
t
\
t
\
tswActual: "
+
swclickActual
+
" | swPrev: "
+
swclickPrev
)
...
...
@@ -370,13 +370,13 @@ function printStates() {
//true: button disabled
//false: button enabled
function
LevelButtonDisable
(
TF
){
console
.
log
(
'FUN t.methods:LevelButtonDisable'
)
//
console.log('FUN t.methods:LevelButtonDisable')
$
(
'#changelevel'
).
prop
(
'disabled'
,
TF
);
}
//Fixed! apres: refactor!
function
graphTagCloudElem
(
nodes
)
{
console
.
log
(
'FUN t.methods:graphTagCloudElem'
)
//
console.log('FUN t.methods:graphTagCloudElem')
pr
(
"in graphTagCloudElem, nodae_id: "
+
nodes
);
cancelSelection
();
partialGraph
.
emptyGraph
();
...
...
@@ -486,7 +486,7 @@ function graphTagCloudElem(nodes) {
function
greyEverything
(){
console
.
log
(
'FUN t.methods:greyEverything'
)
//
console.log('FUN t.methods:greyEverything')
nds
=
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
!
n
[
'hidden'
];
});
...
...
@@ -515,7 +515,7 @@ function greyEverything(){
function
graphResetColor
(){
console
.
log
(
'FUN t.methods:graphResetColor'
)
//
console.log('FUN t.methods:graphResetColor')
nds
=
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
x
)
{
return
!
x
[
'hidden'
];
});
...
...
@@ -538,7 +538,7 @@ function graphResetColor(){
function
hideEverything
(){
console
.
log
(
'FUN t.methods:hideEverything'
)
//
console.log('FUN t.methods:hideEverything')
pr
(
"
\
thiding all"
);
nodeslength
=
0
;
for
(
var
n
in
partialGraph
.
_core
.
graph
.
nodesIndex
){
...
...
@@ -555,7 +555,7 @@ function hideEverything(){
function
add1Elem
(
id
)
{
console
.
log
(
'FUN t.methods:add1Elem'
)
//
console.log('FUN t.methods:add1Elem')
id
=
""
+
id
;
if
(
id
.
split
(
";"
).
length
==
1
)
{
// i've received a NODE
id
=
parseInt
(
id
)
...
...
@@ -605,7 +605,7 @@ function add1Elem(id) {
function
pushFilterValue
(
filtername
,
arg
){
console
.
log
(
'FUN t.methods:pushFilterValue'
)
//
console.log('FUN t.methods:pushFilterValue')
if
(
lastFilter
[
filtername
][
"orig"
]
==
"-"
)
{
lastFilter
[
filtername
][
"orig"
]
=
arg
;
lastFilter
[
filtername
][
"last"
]
=
arg
;
...
...
@@ -618,7 +618,7 @@ function pushFilterValue(filtername,arg){
function
saveGraph
()
{
console
.
log
(
'FUN t.methods:saveGraph'
)
//
console.log('FUN t.methods:saveGraph')
size
=
getByID
(
"check_size"
).
checked
color
=
getByID
(
"check_color"
).
checked
atts
=
{
"size"
:
size
,
"color"
:
color
}
...
...
@@ -635,7 +635,7 @@ function saveGraph() {
}
function
saveGEXF
(
nodes
,
edges
,
atts
){
console
.
log
(
'FUN t.methods:saveGEXF'
)
//
console.log('FUN t.methods:saveGEXF')
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'
;
...
...
@@ -695,7 +695,7 @@ function saveGEXF(nodes,edges,atts){
}
function
saveGraphIMG
(){
console
.
log
(
'FUN t.methods:saveGraphIMG'
)
//
console.log('FUN t.methods:saveGraphIMG')
var
strDownloadMime
=
"image/octet-stream"
var
nodesDiv
=
partialGraph
.
_core
.
domElements
.
nodes
;
...
...
static/lib/graphExplorer/tinawebJS/minimap.js
View file @
b02c92a4
function
draw1Circle
(
ctx
,
x
,
y
,
color
)
{
console
.
log
(
'FUN t.minimap:draw1Circle'
)
//
console.log('FUN t.minimap:draw1Circle')
ctx
.
strokeStyle
=
'#000'
;
ctx
.
lineWidth
=
1
;
ctx
.
fillStyle
=
color
;
...
...
@@ -15,7 +15,7 @@ function draw1Circle(ctx , x , y , color) {
function
trackMouse
()
{
console
.
log
(
'FUN t.minimap:trackMouse'
)
//
console.log('FUN t.minimap:trackMouse')
if
(
!
shift_key
)
{
// $.doTimeout(300,function (){
var
ctx
=
partialGraph
.
_core
.
domElements
.
mouse
.
getContext
(
'2d'
);
...
...
@@ -76,7 +76,7 @@ function trackMouse() {
};
function
changeGraphPosition
(
evt
,
echelle
)
{
console
.
log
(
'FUN t.minimap:changeGraphPosition'
)
//
console.log('FUN t.minimap:changeGraphPosition')
document
.
body
.
style
.
cursor
=
"move"
;
var
_coord
=
{
x
:
evt
.
pageX
,
...
...
@@ -89,7 +89,7 @@ function changeGraphPosition(evt, echelle) {
}
function
onOverviewMove
(
evt
)
{
console
.
log
(
'FUN t.minimap:onOverviewMove'
)
//
console.log('FUN t.minimap:onOverviewMove')
/*
pageX: 1247 pageY: 216
screenX: 1188 screenY: 307
...
...
@@ -104,7 +104,7 @@ function onOverviewMove(evt) {
}
function
startMove
(
evt
){
console
.
log
(
'FUN t.minimap:startMove'
)
//
console.log('FUN t.minimap:startMove')
evt
.
preventDefault
();
partialGraph
.
dragOn
=
true
;
partialGraph
.
lastMouse
=
{
...
...
@@ -115,14 +115,14 @@ function startMove(evt){
}
function
endMove
(
evt
){
console
.
log
(
'FUN t.minimap:endMove'
)
//
console.log('FUN t.minimap:endMove')
document
.
body
.
style
.
cursor
=
"default"
;
partialGraph
.
dragOn
=
false
;
partialGraph
.
mouseHasMoved
=
false
;
}
function
onGraphScroll
(
evt
,
delta
)
{
console
.
log
(
'FUN t.minimap:onGraphScroll'
)
//
console.log('FUN t.minimap:onGraphScroll')
$
(
"#zoomSlider"
).
slider
(
"value"
,
partialGraph
.
position
().
ratio
);
// partialGraph.totalScroll += delta;
// if (Math.abs(partialGraph.totalScroll) >= 1) {
...
...
@@ -178,7 +178,7 @@ function onGraphScroll(evt, delta) {
}
function
initializeMap
()
{
console
.
log
(
'FUN t.minimap:initializeMap'
)
//
console.log('FUN t.minimap:initializeMap')
clearInterval
(
partialGraph
.
timeRefresh
);
partialGraph
.
oldParams
=
{};
...
...
@@ -196,7 +196,7 @@ function initializeMap() {
}
function
updateMap
(){
console
.
log
(
'FUN t.minimap:updateMap'
)
//
console.log('FUN t.minimap:updateMap')
if
(
minimap
){
partialGraph
.
imageMini
=
""
;
partialGraph
.
ctxMini
=
""
;
...
...
@@ -222,7 +222,7 @@ function updateMap(){
}
function
traceMap
()
{
console
.
log
(
'FUN t.minimap:traceMap'
)
//
console.log('FUN t.minimap:traceMap')
//pr("\ttracingmap");
partialGraph
.
echelleGenerale
=
Math
.
pow
(
Math
.
SQRT2
,
partialGraph
.
position
().
ratio
);
partialGraph
.
ctxMini
.
putImageData
(
partialGraph
.
imageMini
,
0
,
0
);
...
...
@@ -242,7 +242,7 @@ function traceMap() {
}
function
startMiniMap
(){
console
.
log
(
'FUN t.minimap:startMiniMap'
)
//
console.log('FUN t.minimap:startMiniMap')
if
(
minimap
){
partialGraph
.
ctxMini
=
document
.
getElementById
(
'overview'
).
getContext
(
'2d'
);
partialGraph
.
ctxMini
.
clearRect
(
0
,
0
,
overviewWidth
,
overviewHeight
);
...
...
static/lib/graphExplorer/tinawebJS/sigma.forceatlas2.js
View file @
b02c92a4
...
...
@@ -6,7 +6,7 @@ var first_time=true;
sigma
.
forceatlas2
=
sigma
.
forceatlas2
||
{};
sigma
.
forceatlas2
.
ForceAtlas2
=
function
(
graph
,
V
,
E
)
{
console
.
log
(
'FUN t.sigma.forceatlas2:ForceAtlas2'
)
//
console.log('FUN t.sigma.forceatlas2:ForceAtlas2')
sigma
.
classes
.
Cascade
.
call
(
this
);
var
self
=
this
;
this
.
graph
=
graph
;
...
...
@@ -983,7 +983,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
// The Region class, as used by the Barnes Hut optimization
sigma
.
forceatlas2
.
Region
=
function
(
nodes
,
depth
)
{
console
.
log
(
'FUN t.sigma.forceatlas2:Region'
)
//
console.log('FUN t.sigma.forceatlas2:Region')
sigma
.
classes
.
Cascade
.
call
(
this
);
this
.
depthLimit
=
20
;
this
.
size
=
0
;
...
...
@@ -1001,7 +1001,7 @@ sigma.forceatlas2.Region = function(nodes, depth) {
}
sigma
.
forceatlas2
.
Region
.
prototype
.
updateMassAndGeometry
=
function
()
{
console
.
log
(
'FUN t.sigma.forceatlas2:updateMassAndGeometry'
)
//
console.log('FUN t.sigma.forceatlas2:updateMassAndGeometry')
if
(
this
.
nodes
.
length
>
1
)
{
// Compute Mass
var
mass
=
0
;
...
...
@@ -1037,7 +1037,7 @@ sigma.forceatlas2.Region.prototype.updateMassAndGeometry = function() {
};
sigma
.
forceatlas2
.
Region
.
prototype
.
buildSubRegions
=
function
()
{
console
.
log
(
'FUN t.sigma.forceatlas2:buildSubRegions'
)
//
console.log('FUN t.sigma.forceatlas2:buildSubRegions')
if
(
this
.
nodes
.
length
>
1
)
{
var
leftNodes
=
[];
var
rightNodes
=
[];
...
...
@@ -1089,7 +1089,7 @@ sigma.forceatlas2.Region.prototype.buildSubRegions = function() {
};
sigma
.
forceatlas2
.
Region
.
prototype
.
applyForce
=
function
(
n
,
Force
,
theta
)
{
console
.
log
(
'FUN t.sigma.forceatlas2:applyForce'
)
//
console.log('FUN t.sigma.forceatlas2:applyForce')
if
(
this
.
nodes
.
length
<
2
)
{
var
regionNode
=
this
.
nodes
[
0
];
Force
.
apply_nn
(
n
,
regionNode
);
...
...
@@ -1114,7 +1114,7 @@ sigma.forceatlas2.Region.prototype.applyForce = function(n, Force, theta) {
sigma
.
publicPrototype
.
startForceAtlas2
=
function
()
{
console
.
log
(
'FUN t.sigma.forceatlas2:applyForce'
)
//
console.log('FUN t.sigma.forceatlas2:applyForce')
//if(!this.forceatlas2) {
if
(
fa2enabled
)
{
...
...
@@ -1159,7 +1159,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
};
sigma
.
publicPrototype
.
stopForceAtlas2
=
function
()
{
console
.
log
(
'FUN t.sigma.forceatlas2:stopForceAtlas2'
)
//
console.log('FUN t.sigma.forceatlas2:stopForceAtlas2')
var
present
=
partialGraph
.
states
.
slice
(
-
1
)[
0
]
if
(
this
.
forceatlas2
)
{
if
(
this
.
forceatlas2
.
count
)
{
...
...
static/lib/graphExplorer/tinawebJS/sigma.parseCustom.js
View file @
b02c92a4
...
...
@@ -2,7 +2,7 @@
// Level-01
ParseCustom
=
function
(
format
,
data
)
{
console
.
log
(
'FUN t.sigma.parseCustom:ParseCustom'
)
//
console.log('FUN t.sigma.parseCustom:ParseCustom')
this
.
data
=
data
;
this
.
format
=
format
;
this
.
nbCats
=
0
;
...
...
@@ -39,7 +39,7 @@ ParseCustom = function ( format , data ) {
// Level-02
ParseCustom
.
prototype
.
scanFile
=
function
()
{
console
.
log
(
'FUN t.sigma.parseCustom:scanFile'
)
//
console.log('FUN t.sigma.parseCustom:scanFile')
switch
(
this
.
format
)
{
case
"api.json"
:
pr
(
"scanFile: "
+
this
.
format
)
...
...
@@ -66,7 +66,7 @@ ParseCustom.prototype.scanFile = function() {
// Level-02
ParseCustom
.
prototype
.
makeDicts
=
function
(
categories
)
{
console
.
log
(
'FUN t.sigma.parseCustom:makeDicts'
)
//
console.log('FUN t.sigma.parseCustom:makeDicts')
console
.
warn
(
"this.format:"
,
this
.
format
)
switch
(
this
.
format
)
{
case
"api.json"
:
...
...
@@ -97,7 +97,7 @@ ParseCustom.prototype.makeDicts = function(categories) {
// Level-00
function
scanGexf
(
gexf
)
{
console
.
log
(
'FUN t.sigma.parseCustom:scanGexf'
)
//
console.log('FUN t.sigma.parseCustom:scanGexf')
var
categoriesDict
=
{},
categories
=
[];
nodesNodes
=
gexf
.
getElementsByTagName
(
'nodes'
);
for
(
i
=
0
;
i
<
nodesNodes
.
length
;
i
++
){
...
...
@@ -146,7 +146,7 @@ function scanGexf(gexf) {
// Level-00
// for {1,2}partite graphs
function
dictfyGexf
(
gexf
,
categories
)
{
console
.
log
(
'FUN t.sigma.parseCustom:dictfyGexf'
)
//
console.log('FUN t.sigma.parseCustom:dictfyGexf')
var
catDict
=
{}
var
catCount
=
{}
...
...
@@ -482,7 +482,7 @@ function dictfyGexf( gexf , categories ) {
// Level-00
function
scanJSON
(
data
,
format
)
{
console
.
log
(
'FUN t.sigma.parseCustom:scanJSON'
)
//
console.log('FUN t.sigma.parseCustom:scanJSON')
var
categoriesDict
=
{},
categories
=
[];
var
nodes
=
data
.
nodes
;
...
...
@@ -530,7 +530,7 @@ function scanJSON( data, format ) {
// Level-00
// for {1,2}partite graphs
function
dictfyJSON
(
data
,
categories
,
isCompact
)
{
console
.
log
(
'FUN t.sigma.parseCustom:dictfyJSON'
)
//
console.log('FUN t.sigma.parseCustom:dictfyJSON')
console
.
clear
()
console
.
log
(
"IN DICTIFY JSON"
)
var
catDict
=
{}
...
...
@@ -765,7 +765,7 @@ function dictfyJSON( data , categories, isCompact ) {
// to move
function
buildInitialState
(
categories
)
{
console
.
log
(
'FUN t.sigma.parseCustom:buildInitialState'
)
//
console.log('FUN t.sigma.parseCustom:buildInitialState')
var
firstState
=
[]
for
(
var
i
=
0
;
i
<
categories
.
length
;
i
++
)
{
if
(
i
==
0
)
firstState
.
push
(
true
)
...
...
@@ -776,7 +776,7 @@ function buildInitialState( categories ) {
//to move
function
makeSystemStates
(
cats
)
{
console
.
log
(
'FUN t.sigma.parseCustom:makeSystemStates'
)
//
console.log('FUN t.sigma.parseCustom:makeSystemStates')
var
systemstates
=
{}
var
N
=
Math
.
pow
(
2
,
cats
.
length
);
...
...
@@ -810,7 +810,7 @@ function makeSystemStates (cats) {
//to_del
function
parse
(
gexfPath
)
{
console
.
log
(
'FUN t.sigma.parseCustom:parse'
)
//
console.log('FUN t.sigma.parseCustom:parse')
var
gexfhttp
;
gexfhttp
=
window
.
XMLHttpRequest
?
new
XMLHttpRequest
()
:
new
ActiveXObject
(
'Microsoft.XMLHTTP'
);
gexfhttp
.
open
(
'GET'
,
gexfPath
,
false
);
...
...
@@ -820,7 +820,7 @@ function parse(gexfPath) {
//to_del
function
scanCategories
()
{
console
.
log
(
'FUN t.sigma.parseCustom:scanCategories'
)
//
console.log('FUN t.sigma.parseCustom:scanCategories')
nodesNodes
=
gexf
.
getElementsByTagName
(
'nodes'
);
for
(
i
=
0
;
i
<
nodesNodes
.
length
;
i
++
){
var
nodesNode
=
nodesNodes
[
i
];
// Each xml node 'nodes' (plural)
...
...
@@ -853,7 +853,7 @@ function scanCategories() {
//to_del
function
onepartiteExtract
(){
console
.
log
(
'FUN t.sigma.parseCustom:onepartiteExtract'
)
//
console.log('FUN t.sigma.parseCustom:onepartiteExtract')
var
i
,
j
,
k
;
// partialGraph.emptyGraph();
// Parse Attributes
...
...
@@ -1097,7 +1097,7 @@ function onepartiteExtract(){
//to_del
function
fullExtract
(){
console
.
log
(
'FUN t.sigma.parseCustom:fullExtract'
)
//
console.log('FUN t.sigma.parseCustom:fullExtract')
var
i
,
j
,
k
;
// Parse Attributes
// This is confusing, so I'll comment heavily
...
...
@@ -1426,7 +1426,7 @@ function fullExtract(){
//to_del
function
JSONFile
(
URL
)
{
console
.
log
(
'FUN t.sigma.parseCustom:JSONFile'
)
//
console.log('FUN t.sigma.parseCustom:JSONFile')
return
$
.
ajax
({
...
...
@@ -1452,7 +1452,7 @@ function JSONFile( URL ) {
//to_del
function
parseSimpleJSON
(
data
,
seed
)
{
console
.
log
(
'FUN t.sigma.parseCustom:parseSimpleJSON'
)
//
console.log('FUN t.sigma.parseCustom:parseSimpleJSON')
var
i
,
j
,
k
;
rand
=
new
RVUniformC
(
seed
);
//partialGraph.emptyGraph();
...
...
@@ -1547,7 +1547,7 @@ function parseSimpleJSON( data , seed ) {
//to_del
// For CommunityExplorer API
function
extractFromJson
(
data
,
seed
){
console
.
log
(
'FUN t.sigma.parseCustom:extractFromJson'
)
//
console.log('FUN t.sigma.parseCustom:extractFromJson')
var
i
,
j
,
k
;
rand
=
new
RVUniformC
(
seed
);
//partialGraph.emptyGraph();
...
...
static/lib/graphExplorer/tinawebJS/sigmaUtils.js
View file @
b02c92a4
...
...
@@ -2,12 +2,12 @@
SigmaUtils
=
function
()
{
console
.
log
(
'FUN t.SigmaUtils:SigmaUtils:new'
)
//
console.log('FUN t.SigmaUtils:SigmaUtils:new')
this
.
nbCats
=
0
;
// input = GEXFstring
this
.
FillGraph
=
function
(
initialState
,
catDict
,
nodes
,
edges
,
graph
)
{
console
.
log
(
'FUN t.SigmaUtils:SigmaUtils:FillGraph'
)
//
console.log('FUN t.SigmaUtils:SigmaUtils:FillGraph')
print
(
"Filling the graaaaph:"
)
print
(
catDict
)
...
...
@@ -66,7 +66,7 @@ SigmaUtils = function () {
//for socialgraph
function
showMeSomeLabels
(
N
){
console
.
log
(
'FUN t.sigmaUtils:showMeSomeLabels'
)
//
console.log('FUN t.sigmaUtils:showMeSomeLabels')
/*======= Show some labels at the beginning =======*/
minIn
=
50
,
maxIn
=
0
,
...
...
@@ -108,34 +108,34 @@ function showMeSomeLabels(N){
}
function
getnodes
(){
console
.
log
(
'FUN t.sigmaUtils:getnodes'
)
//
console.log('FUN t.sigmaUtils:getnodes')
return
partialGraph
.
_core
.
graph
.
nodes
;
}
function
getnodesIndex
(){
console
.
log
(
'FUN t.sigmaUtils:getnodesIndex'
)
//
console.log('FUN t.sigmaUtils:getnodesIndex')
return
partialGraph
.
_core
.
graph
.
nodesIndex
;
}
function
getedges
(){
console
.
log
(
'FUN t.sigmaUtils:getedges'
)
//
console.log('FUN t.sigmaUtils:getedges')
return
partialGraph
.
_core
.
graph
.
edges
;
}
function
getedgesIndex
(){
console
.
log
(
'FUN t.sigmaUtils:getedgesIndex'
)
//
console.log('FUN t.sigmaUtils:getedgesIndex')
return
partialGraph
.
_core
.
graph
.
edgesIndex
;
}
function
getVisibleEdges
()
{
console
.
log
(
'FUN t.sigmaUtils:getVisibleEdges'
)
//
console.log('FUN t.sigmaUtils:getVisibleEdges')
return
partialGraph
.
_core
.
graph
.
edges
.
filter
(
function
(
e
)
{
return
!
e
[
'hidden'
];
});
}
function
getVisibleNodes
()
{
console
.
log
(
'FUN t.sigmaUtils:getVisibleNodes'
)
//
console.log('FUN t.sigmaUtils:getVisibleNodes')
return
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
!
n
[
'hidden'
];
});
...
...
@@ -143,25 +143,25 @@ function getVisibleNodes() {
function
getNodesByAtt
(
att
)
{
console
.
log
(
'FUN t.sigmaUtils:getNodesByAtt'
)
//
console.log('FUN t.sigmaUtils:getNodesByAtt')
return
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
n
[
'type'
]
==
att
;
});
}
function
getn
(
id
){
console
.
log
(
'FUN t.sigmaUtils:getn'
)
//
console.log('FUN t.sigmaUtils:getn')
return
partialGraph
.
_core
.
graph
.
nodesIndex
[
id
];
}
function
gete
(
id
){
console
.
log
(
'FUN t.sigmaUtils:gete'
)
//
console.log('FUN t.sigmaUtils:gete')
return
partialGraph
.
_core
.
graph
.
edgesIndex
[
id
];
}
function
find
(
label
){
console
.
log
(
'FUN t.sigmaUtils:find'
)
//
console.log('FUN t.sigmaUtils:find')
var
results
=
[];
var
nds
=
getnodesIndex
();
label
=
label
.
toLowerCase
()
...
...
@@ -178,7 +178,7 @@ function find(label){
}
function
exactfind
(
label
)
{
console
.
log
(
'FUN t.sigmaUtils:exactfind'
)
//
console.log('FUN t.sigmaUtils:exactfind')
nds
=
getnodesIndex
();
for
(
var
i
in
nds
){
n
=
nds
[
i
];
...
...
@@ -193,7 +193,7 @@ function exactfind(label) {
function
getNodeLabels
(
elems
){
console
.
log
(
'FUN t.sigmaUtils:getNodeLabels'
)
//
console.log('FUN t.sigmaUtils:getNodeLabels')
var
labelss
=
[]
for
(
var
i
in
elems
){
var
id
=
(
!
isUndef
(
elems
[
i
].
key
))?
elems
[
i
].
key
:
i
...
...
@@ -203,13 +203,13 @@ function getNodeLabels(elems){
}
function
getNodeIDs
(
elems
){
console
.
log
(
'FUN t.sigmaUtils:getNodeIDs'
)
//
console.log('FUN t.sigmaUtils:getNodeIDs')
return
Object
.
keys
(
elems
)
}
function
getSelections
(){
console
.
log
(
'FUN t.sigmaUtils:getSelections'
)
//
console.log('FUN t.sigmaUtils:getSelections')
params
=
[];
for
(
var
i
in
selections
){
params
.
push
(
Nodes
[
i
].
label
);
...
...
@@ -221,7 +221,7 @@ function getSelections(){
//This receives an array not a dict!
// i added an excpt... why
function
getNeighs
(
sels
,
arr
)
{
console
.
log
(
'FUN t.sigmaUtils:getNeighs'
)
//
console.log('FUN t.sigmaUtils:getNeighs')
neighDict
=
{};
for
(
var
i
in
sels
)
{
id
=
sels
[
i
]
...
...
@@ -240,7 +240,7 @@ function getNeighs(sels,arr) {
//Using bipartiteN2D or bipartiteD2N
//This receives an array not a dict!
function
getNeighs2
(
sels
,
arr
){
console
.
log
(
'FUN t.sigmaUtils:getNeighs2'
)
//
console.log('FUN t.sigmaUtils:getNeighs2')
neighDict
=
{};
for
(
var
i
in
sels
)
{
id
=
sels
[
i
]
...
...
@@ -257,7 +257,7 @@ function getNeighs2(sels,arr){
//to general utils
function
getArrSubkeys
(
arr
,
id
)
{
console
.
log
(
'FUN t.sigmaUtils:getArrSubkeys'
)
//
console.log('FUN t.sigmaUtils:getArrSubkeys')
var
result
=
[]
for
(
var
i
in
arr
)
{
result
.
push
(
arr
[
i
][
id
])
...
...
@@ -266,7 +266,7 @@ function getArrSubkeys(arr,id) {
}
function
getCountries
(){
console
.
log
(
'FUN t.sigmaUtils:getCountries'
)
//
console.log('FUN t.sigmaUtils:getCountries')
var
nodes
=
getVisibleNodes
();
var
countries
=
{}
...
...
@@ -285,7 +285,7 @@ function getCountries(){
function
getAcronyms
()
{
console
.
log
(
'FUN t.sigmaUtils:getAcronyms'
)
//
console.log('FUN t.sigmaUtils:getAcronyms')
var
nodes
=
getVisibleNodes
();
var
acrs
=
{}
pr
(
"in getAcronyms"
)
...
...
@@ -302,7 +302,7 @@ function getAcronyms() {
function
clustersBy
(
daclass
,
att2change
)
{
console
.
log
(
'FUN t.sigmaUtils:clustersBy'
)
//
console.log('FUN t.sigmaUtils:clustersBy')
cancelSelection
(
false
);
var
v_nodes
=
getVisibleNodes
();
...
...
@@ -422,7 +422,7 @@ function clustersBy(daclass , att2change ) {
function
colorsBy
(
daclass
,
att2change
)
{
console
.
log
(
'FUN t.sigmaUtils:colorsBy'
)
//
console.log('FUN t.sigmaUtils:colorsBy')
pr
(
""
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
...
...
@@ -471,7 +471,7 @@ function colorsBy(daclass, att2change ) {
//just for fun
function
makeEdgeWeightUndef
()
{
console
.
log
(
'FUN t.sigmaUtils:makeEdgeWeightUndef'
)
//
console.log('FUN t.sigmaUtils:makeEdgeWeightUndef')
for
(
var
e
in
partialGraph
.
_core
.
graph
.
edges
)
{
partialGraph
.
_core
.
graph
.
edges
[
e
].
weight
=
1
;
}
...
...
templates/graphExplorer/explorer.html
View file @
b02c92a4
...
...
@@ -58,7 +58,7 @@
<!-- this is the tweakbar -->
<div
class=
"container-fluid navbar-default"
>
<div
id=
"defaultop"
class=
"row"
>
<div
id=
"left"
class=
"col-sm-
9 col-md-9
col-lg-7"
>
<div
id=
"left"
class=
"col-sm-
10 col-md-10
col-lg-7"
>
<ul
class=
"nav navbar-nav"
>
<!--
...
...
@@ -79,11 +79,25 @@
<button
type=
"button"
id=
"changelevel"
class=
"btn btn-info btn-sm"
disabled
>
Change Level
</button>
</a></li>
<!-- TODO fix: category0 -> category1 switching -->
<li
class=
'basicitem'
><a>
Selector size
<br>
<div
id=
"unranged-value"
class=
"settingslider"
></div>
<!-- Create a subgraph -->
<ul
id=
"category0"
class=
"nav"
>
<li><small>
Nodes
</small>
<div
id=
"slidercat0nodesweight"
class=
"settingslider"
></div></li>
<li><small>
Edges
</small>
<div
id=
"slidercat0edgesweight"
class=
"settingslider"
></div></li>
</ul>
</a></li>
<li
class=
'basicitem'
><a>
Compare
<br>
<img
width=
"30"
title=
"Compare with other corpus!"
onclick=
"GetUserPortfolio(); $('#corpuses').modal('show');"
src=
"{% static "
img
/
INTER
.
png
"
%}"
></img>
</a></li>
<li
class=
'basicitem'
><a>
<!-- TODO fix: category0 -> category1 switching -->
Label size
<br>
<div
id=
"slidercat0nodessize"
class=
"settingslider"
></div>
</a></li>
<li
class=
'basicitem'
><a>
Colors
<br>
...
...
@@ -96,11 +110,9 @@
</a></li>
<li
class=
'basicitem'
><a>
<!-- TODO fix: category0 -> category1 switching -->
Label size
<br>
<div
id=
"slidercat0nodessize"
class=
"settingslider"
></div>
Selector size
<br>
<div
id=
"unranged-value"
class=
"settingslider"
></div>
</a></li>
<!--
<li>
<a>
...
...
@@ -109,28 +121,22 @@
</li>
-->
<!-- TODO fix: category0 -> category1 switching -->
<li
class=
'basicitem'
><a>
<!-- Create a subgraph -->
<ul
id=
"category0"
class=
"nav"
>
<li><small>
Nodes
</small>
<div
id=
"slidercat0nodesweight"
class=
"settingslider"
></div></li>
<li><small>
Edges
</small>
<div
id=
"slidercat0edgesweight"
class=
"settingslider"
></div></li>
</ul>
</a></li>
<li
class=
'basicitem'
><a>
Compare
<br>
<img
width=
"30"
title=
"Compare with other corpus!"
onclick=
"GetUserPortfolio(); $('#corpuses').modal('show');"
src=
"{% static "
img
/
INTER
.
png
"
%}"
></img>
</a></li>
</ul>
</div>
<!-- /div#left -->
<div
id=
"right"
class=
"col-sm-
2 col-md-2
col-lg-4"
>
<div
id=
"right"
class=
"col-sm-
1 col-md-1
col-lg-4"
>
<div
class=
'row'
id=
"searchnav"
>
<div
class=
"col-sm-1 col-md-1 col-lg-1"
style=
"font-size:75%; line-height:90%; padding:0"
>
<input
id=
"checkboxdiv"
onclick=
"alertCheckBox(this);"
title=
"Add next search results to current selection"
class=
"btn btn-info"
type=
"checkbox"
></input>
Add
</div>
<!-- the smaller the viewport, the larger the relative search box size -->
<div
class=
"col-sm-11 col-md-1
0 col-lg-10
"
>
<div
class=
"col-sm-11 col-md-1
1 col-lg-11
"
>
<div
id=
"search_input_group"
class=
"input-group input-group-sm"
>
<span
class=
"input-group-btn"
>
<button
id=
"searchbutton"
...
...
@@ -154,15 +160,6 @@
<div
id=
"unused_msg"
></div>
</div>
<div
class=
"col-sm-1 col-md-2 col-lg-2"
>
<input
id=
"checkboxdiv"
onclick=
"alertCheckBox(this);"
title=
"Add next search results to current selection"
class=
"btn btn-info"
type=
"checkbox"
></input>
<p
style=
"font-size:75%; line-height:90%"
>
Add
</p>
</div>
</div>
<!--
...
...
@@ -218,15 +215,11 @@
-->
<li>
<a
href=
"#"
id=
"snapicon"
onclick=
"saveGraphIMG();"
>
<img
title=
"Take a photo!"
width=
"34px"
src=
"{% static "
img
/
camera
.
png
"
%}"
></img>
</a>
<a
href=
"#"
id=
"edgesButton"
>
</a>
</li>
<li>
<a
href=
"#"
id=
"saveAs"
>
<img
width=
"30px"
title=
"Save As..."
src=
"{% static "
img
/
save
.
png
"
%}"
></img>
</a>
<a
href=
"#"
id=
"lensButton"
>
</a>
</li>
<li>
...
...
@@ -241,14 +234,18 @@
<a
href=
"#"
id=
"zoomMinusButton"
title=
"S'éloigner"
>
</a>
</li>
<li>
<a
href=
"#"
id=
"lensButton"
>
</a>
<a
href=
"#"
id=
"snapicon"
onclick=
"saveGraphIMG();"
>
<img
title=
"Take a photo!"
width=
"34px"
src=
"{% static "
img
/
camera
.
png
"
%}"
></img>
</a>
</li>
<li>
<a
href=
"#"
id=
"edgesButton"
>
</a>
<a
href=
"#"
id=
"saveAs"
>
<img
width=
"30px"
title=
"Save As..."
src=
"{% static "
img
/
save
.
png
"
%}"
></img>
</a>
</li>
</ul>
</div>
...
...
@@ -287,7 +284,7 @@
<div
id=
"tab-container-top"
class=
'tab-container'
style=
"display: none;"
>
<ul
class=
'etabs'
>
<li
id=
"tabmed"
class=
'tab active'
><a
href=
"#tabs3"
>
Pubs
</a></li>
<li
id=
"tabmed"
class=
'tab active'
><a
id=
"pubs-legend"
href=
"#tabs3"
>
Pubs
</a></li>
<li
id=
"tabgps"
class=
'tab'
><a
href=
"#tabs3"
></a></li>
</ul>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment