Commit 6a4e0439 authored by Romain Loth's avatar Romain Loth

first deployment of ProjectExplorer for comex using new method

parent 7c0749cf
...@@ -46,7 +46,22 @@ There are two exceptions are: ...@@ -46,7 +46,22 @@ There are two exceptions are:
# - explorerjs.html -> static/ProjectExplorer/explorerjs.prod.html # - explorerjs.html -> static/ProjectExplorer/explorerjs.prod.html
``` ```
4) finally update the settings property `ourlibs` (path to twlibs) with the same URL prefix
```
nano static/ProjectExplorer/settings_explorerjs.js
----------------- [IN NANO] --------------------
(...)
TWConf.paths = {
'ourlibs': 'static/ProjectExplorer/twlibs', // <=== here
...
}
(...)
-----------------------------------------------
```
- to use it within a different GUI layout: take our html as an exemple and create your own html importing the same libs and exposing the same div ids. - to use it within a different GUI layout: take our html as an exemple and create your own html importing the same libs and exposing the same div ids.
- the directory `twpresets/` contains specific variants of `settings_explorerjs` for some common deployment tasks of the ISCPIF (comex, gargantext)
- optionally, the backends under `twbackends`: - optionally, the backends under `twbackends`:
- they are the only server-side elements of the tina distribution - they are the only server-side elements of the tina distribution
......
...@@ -444,7 +444,7 @@ ...@@ -444,7 +444,7 @@
</div> </div>
</div> </div>
<div class="question"> <div class="question reldocs">
<div class="input-group"> <div class="input-group">
<label for="reldocs-type" class="smlabel input-group-addon">Related documents type</label> <label for="reldocs-type" class="smlabel input-group-addon">Related documents type</label>
<select id="reldocs-type" name="reldocs-type" <select id="reldocs-type" name="reldocs-type"
......
...@@ -6,8 +6,8 @@ TW.conf = (function(TW){ ...@@ -6,8 +6,8 @@ TW.conf = (function(TW){
let TWConf = {} let TWConf = {}
TWConf.branding = 'ProjectExplorer' // <--- the name displayed in upper left TWConf.branding = 'Community Explorer 2' // <--- name displayed in upper left
TWConf.brandingLink = 'https://github.com/moma/ProjectExplorer' // <--- link to "home" TWConf.brandingLink = 'https://communityexplorer.org' // <--- link to "home"
// ========================== // ==========================
...@@ -17,10 +17,10 @@ TW.conf = (function(TW){ ...@@ -17,10 +17,10 @@ TW.conf = (function(TW){
// Graph data source // Graph data source
// ----------------- // -----------------
// the graph input depends on TWConf.sourcemode (or manual url arg 'sourcemode') // the graph input depends on TWConf.sourcemode (or manual url arg 'sourcemode')
TWConf.sourcemode = "servermenu" // accepted: "api" | "serverfile" | "servermenu" | "localfile" TWConf.sourcemode = "api" // accepted: "api" | "serverfile" | "servermenu" | "localfile"
// server-side .gexf|.json default source // server-side .gexf|.json default source
TWConf.sourceFile = "data/politoscope/ProgrammeDesCandidats.enrichi.gexf" TWConf.sourceFile = ""
// ...or server-side gexf default source list // ...or server-side gexf default source list
TWConf.sourceMenu = "db.json" TWConf.sourceMenu = "db.json"
...@@ -34,21 +34,13 @@ TW.conf = (function(TW){ ...@@ -34,21 +34,13 @@ TW.conf = (function(TW){
// Related documents (topPapers) data source // Related documents (topPapers) data source
// ----------------------------------------- // -----------------------------------------
TWConf.getRelatedDocs = true TWConf.getRelatedDocs = false
TWConf.relatedDocsMax = 10 TWConf.relatedDocsMax = 10
TWConf.relatedDocsAPI = "http://127.0.0.1:5000/twitter_search"
TWConf.relatedDocsType = "wosLocalDB" // accepted: "twitter" | "wosLocalDB" TWConf.relatedDocsType = "twitter" // accepted: "twitter" | "wosLocalDB"
// POSSible: "elastic" // POSSible: "elastic"
TWConf.relatedDocsAPIS = {
// routes by corresponding type
"wosLocalDB": "twbackends/phpAPI",
"twitter": "http://127.0.0.1:5000/twitter_search"
}
// fallback topPapers API if none found by type
TWConf.relatedDocsAPI = "LOCALDB"
// ======================= // =======================
// DATA FACETS AND LEGENDS // DATA FACETS AND LEGENDS
// ======================= // =======================
...@@ -114,8 +106,8 @@ TW.conf = (function(TW){ ...@@ -114,8 +106,8 @@ TW.conf = (function(TW){
'weight' : {'col': "heatmap" , 'n': 5, 'binmode': 'samerange' }, 'weight' : {'col': "heatmap" , 'n': 5, 'binmode': 'samerange' },
'Weighted Degree' : {'col': "heatmap", 'n': 8, 'binmode': 'samerange' }, 'Weighted Degree' : {'col': "heatmap", 'n': 8, 'binmode': 'samerange' },
'out-degree' : {'col': "heatmap" , 'n': 3, 'binmode': 'samepop' }, 'out-degree' : {'col': "heatmap" , 'n': 3, 'binmode': 'samepop' },
'countryuniform' : {'col': "cluster" , 'binmode': 'off'}, 'CC' : {'col': "cluster" , 'binmode': 'off'},
'countrypareto' : {'col': "cluster" , 'binmode': 'off'}, 'ACR' : {'col': "cluster" , 'binmode': 'off'},
'cluster_universal_index': {'col': "cluster" , 'binmode': 'off' }, 'cluster_universal_index': {'col': "cluster" , 'binmode': 'off' },
'community_orphan' : {'col': "cluster" , 'binmode': 'off' } 'community_orphan' : {'col': "cluster" , 'binmode': 'off' }
...@@ -135,7 +127,7 @@ TW.conf = (function(TW){ ...@@ -135,7 +127,7 @@ TW.conf = (function(TW){
// when coloring method is "cluster", should the colors change each time ? // when coloring method is "cluster", should the colors change each time ?
TWConf.randomizeClusterColors = false TWConf.randomizeClusterColors = true
// default clustering attribute (<---> used for initial node colors) // default clustering attribute (<---> used for initial node colors)
TWConf.nodeClusAtt = "modularity_class" TWConf.nodeClusAtt = "modularity_class"
...@@ -155,14 +147,15 @@ TW.conf = (function(TW){ ...@@ -155,14 +147,15 @@ TW.conf = (function(TW){
// ============= // =============
// Node typology: categories (resp. 0 and 1) will get these default labels // Node typology: categories (resp. 0 and 1) will get these default labels
TWConf.catSem = "term"; TWConf.catSem = "Terms";
TWConf.catSoc = "person"; TWConf.catSoc = "Document";
// NB: these labels may be superseded by the input data's node types values // NB: these labels may be superseded by the input data's node types values
// cf. sortNodeTypes() // cf. sortNodeTypes()
// Modules path // Modules path
// ------------ // ------------
TWConf.paths = { TWConf.paths = {
'ourlibs': 'static/tinawebJS/twlibs',
'modules': 'twmodules' 'modules': 'twmodules'
} }
Object.freeze(TWConf.paths) // /!\ to prevent path modification before load Object.freeze(TWConf.paths) // /!\ to prevent path modification before load
...@@ -202,7 +195,6 @@ TW.conf = (function(TW){ ...@@ -202,7 +195,6 @@ TW.conf = (function(TW){
// TW.geomap = false; // TW.geomap = false;
// TW.twittertimeline = false; // TW.twittertimeline = false;
TWConf.maxPastStates = 5 ; // number of TW.states to remember (~CTRL-Z) TWConf.maxPastStates = 5 ; // number of TW.states to remember (~CTRL-Z)
...@@ -213,8 +205,8 @@ TW.conf = (function(TW){ ...@@ -213,8 +205,8 @@ TW.conf = (function(TW){
// if fa2Available, the auto-run config: // if fa2Available, the auto-run config:
TWConf.fa2Enabled= false; // fa2 auto-run at start and after graph modified ? TWConf.fa2Enabled= true; // fa2 auto-run at start and after graph modified ?
TWConf.fa2Milliseconds=5000; // duration of auto-run TWConf.fa2Milliseconds=10000; // duration of auto-run
TWConf.minNodesForAutoFA2 = 5 // graph size threshold to auto-run TWConf.minNodesForAutoFA2 = 5 // graph size threshold to auto-run
...@@ -293,7 +285,7 @@ TW.conf = (function(TW){ ...@@ -293,7 +285,7 @@ TW.conf = (function(TW){
// em size range for neighbor nodes "tagcloud" (1 = "normal size") // em size range for neighbor nodes "tagcloud" (1 = "normal size")
TWConf.tagcloudFontsizeMin = .8 ; TWConf.tagcloudFontsizeMin = .8 ;
TWConf.tagcloudFontsizeMax = 2 ; TWConf.tagcloudFontsizeMax = 1.5 ;
TWConf.tagcloudSameLimit = 50 // max displayed neighbors of the same type TWConf.tagcloudSameLimit = 50 // max displayed neighbors of the same type
TWConf.tagcloudOpposLimit = 10 // max displayed neighbors of the opposite type TWConf.tagcloudOpposLimit = 10 // max displayed neighbors of the opposite type
...@@ -311,7 +303,7 @@ TW.conf = (function(TW){ ...@@ -311,7 +303,7 @@ TW.conf = (function(TW){
initialShowAll: false, // show all nodes on bipartite case init (docs + terms in one view) initialShowAll: false, // show all nodes on bipartite case init (docs + terms in one view)
// show verbose console logs... // show verbose console logs...
logFetchers: false, // ...about ajax/fetching of graph data logFetchers: false, // ...about ajax/fetching of graph data
logParsers: false, // ...about parsing said data logParsers: false, // ...about parsing said data
logFacets: false, // ...about parsing node attribute:value facets logFacets: false, // ...about parsing node attribute:value facets
logSettings: false, // ...about settings at Tina and Sigma init time logSettings: false, // ...about settings at Tina and Sigma init time
......
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
/* ----------- */ /* ----------- */
.reldocs {
display: none;
}
#sidefold { #sidefold {
position: absolute; position: absolute;
left: 0; left: 0;
......
...@@ -277,6 +277,7 @@ p.micromessage{ ...@@ -277,6 +277,7 @@ p.micromessage{
#information .information-vcard { #information .information-vcard {
border: 2px solid #555; border: 2px solid #555;
padding: 2em 1em .3em 1em; padding: 2em 1em .3em 1em;
margin: 1em;
background-color:#fff; background-color:#fff;
border-radius: .3em; border-radius: .3em;
} }
......
...@@ -1062,6 +1062,15 @@ var TinaWebJS = function ( sigmacanvas ) { ...@@ -1062,6 +1062,15 @@ var TinaWebJS = function ( sigmacanvas ) {
} }
}); });
if (TW.conf.getRelatedDocs) {
let reldocsEls = document.querySelectorAll('.reldocs')
for (var k in reldocsEls) {
if (reldocsEls[k].style) {
reldocsEls[k].style.display = 'block'
}
}
}
if (TW.conf.filterSliders) { if (TW.conf.filterSliders) {
// the indice of the first cat to be active (ex: '1') // the indice of the first cat to be active (ex: '1')
......
...@@ -1000,7 +1000,7 @@ function updateSearchLabels(id,name,type){ ...@@ -1000,7 +1000,7 @@ function updateSearchLabels(id,name,type){
function createWaitIcon(idname, width) { function createWaitIcon(idname, width) {
let icon = document.createElement('img') let icon = document.createElement('img')
icon.src = 'twlibs/img/loader.gif' icon.src = TW.conf.path.ourlibs+'/img/loader.gif'
icon.style.position = 'absolute' icon.style.position = 'absolute'
icon.style.left = '0' icon.style.left = '0'
......
...@@ -339,9 +339,9 @@ function htmlfied_nodesatts(elems){ ...@@ -339,9 +339,9 @@ function htmlfied_nodesatts(elems){
if(swActual(node.type) == 'semantic'){ if(swActual(node.type) == 'semantic'){
information += '<li><b>' + node.label + '</b></li>'; information += '<li><b>' + node.label + '</b></li>';
let google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="twlibs/img/google.png"></img></a>'; let google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="'+TW.conf.paths.ourlibs+'/img/google.png"></img></a>';
let wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="twlibs/img/wikipedia.png"></img></a>'; let wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="'+TW.conf.paths.ourlibs+'/img/wikipedia.png"></img></a>';
let flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="twlibs/img/flickr.png"></img></a>'; let flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="'+TW.conf.paths.ourlibs+'/img/flickr.png"></img></a>';
information += '<li>'+google+"&nbsp;"+wiki+"&nbsp;"+flickr+'</li><br>'; information += '<li>'+google+"&nbsp;"+wiki+"&nbsp;"+flickr+'</li><br>';
semnodes.push(information) semnodes.push(information)
} }
......
...@@ -171,9 +171,11 @@ TW.conf = (function(TW){ ...@@ -171,9 +171,11 @@ TW.conf = (function(TW){
TWConf.ModulesFlags["crowdsourcingModule"] = true ; TWConf.ModulesFlags["crowdsourcingModule"] = true ;
// Other optional functionalities // Other GUI options
// ----------------------------- // ------------------
TWConf.filterSliders = true // show sliders for nodes/edges subsets TWConf.sidePanelSize = "300px" // width of the side panel (def: 400px)
TWConf.filterSliders = true // show sliders for nodes/edges subsets
TWConf.clusterColorsAtt = true; // show "Set colors" menu TWConf.clusterColorsAtt = true; // show "Set colors" menu
......
...@@ -26,7 +26,7 @@ fi ...@@ -26,7 +26,7 @@ fi
if [ -e explorerjs.html ] if [ -e explorerjs.html ]
then then
perl -pse 's/ ((?:href|src)=[\x22\x27]?)(twlibs3?|twmain)/ $1$pathprefix$2/g' -- -pathprefix=$newpathprefix < explorerjs.html > explorerjs.prod.html perl -pse 's/ ((?:href|src)=[\x22\x27]?)(twlibs3?|twmain|settings_explorerjs)/ $1$pathprefix$2/g' -- -pathprefix=$newpathprefix < explorerjs.html > explorerjs.prod.html
echo 'created: explorerjs.prod.html' echo 'created: explorerjs.prod.html'
exit 0 exit 0
else else
......
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