Commit e5d1e4ec authored by Romain Loth's avatar Romain Loth

WIP bi colors in bipa cases

parent ce9b46c4
...@@ -159,8 +159,8 @@ ...@@ -159,8 +159,8 @@
<li> <li>
<a> <a>
<select id="aselector" onchange="console.log('salut monde')" class="selectpicker" data-style="btn btn-success btn-sm" data-width="auto"> <select id="aselector" onchange="console.log('salut monde')" class="selectpicker" data-style="btn btn-success btn-sm" data-width="auto">
<option value="Document" selected>Scholars</option> <option value="Scholars" selected>Scholars</option>
<option value="NGram">Keywords</option> <option value="Keywords">Keywords</option>
</select> </select>
</a> </a>
</li> </li>
...@@ -430,9 +430,9 @@ ...@@ -430,9 +430,9 @@
</div><!-- /row --> </div><!-- /row -->
</div> </div>
<!-- attributes' legends (absolute position bottom left)
<!-- class="my-legend" (absolute position bottom left) --> (contains one div of class "my-legend" per colored nodetype) -->
<div id="legend-for-clusters" class="over-panels"></div> <div id="legend-for-facets" class="over-panels"></div>
<!-- to reopen the panel --> <!-- to reopen the panel -->
<div id="sideunfold"> <div id="sideunfold">
......
...@@ -21,7 +21,7 @@ TW.conf = (function(TW){ ...@@ -21,7 +21,7 @@ TW.conf = (function(TW){
// ...or remote bridge to default source api ajax queries // ...or remote bridge to default source api ajax queries
TWConf.sourceAPI={} TWConf.sourceAPI={}
TWConf.sourceAPI["nodetypes"] = {"node0": "NGram", "node1": "Document" } TWConf.sourceAPI["nodetypes"] = {"node0": "Keywords", "node1": "Scholars" }
TWConf.sourceAPI["forNormalQuery"] = "services/api/graph" TWConf.sourceAPI["forNormalQuery"] = "services/api/graph"
TWConf.sourceAPI["forFilteredQuery"] = "services/api/graph" TWConf.sourceAPI["forFilteredQuery"] = "services/api/graph"
...@@ -114,8 +114,8 @@ TW.conf = (function(TW){ ...@@ -114,8 +114,8 @@ 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 = "NGram"; TWConf.catSem = "Keywords";
TWConf.catSoc = "Document"; TWConf.catSoc = "Scholars";
// NB: these labels may be superseded by: // NB: these labels may be superseded by:
// - the input data's node types values cf. sortNodeTypes() // - the input data's node types values cf. sortNodeTypes()
// - in servermenu mode, by the node0 & node1 properties // - in servermenu mode, by the node0 & node1 properties
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
} }
/* legend re-positioned */ /* legend re-positioned */
.my-legend { #legend-for-facets {
bottom: calc(40% - 105px); bottom: calc(40% - 100px);
/* bot just above #sidebar which has top at calc(105px + 60%); */ /* bot just above #sidebar which has top at calc(105px + 60%); */
} }
...@@ -97,17 +97,20 @@ ...@@ -97,17 +97,20 @@
} }
/* legend reduction */ /* legend reduction */
#legend-for-facets {
max-width: 25%;
}
.my-legend { .my-legend {
max-width: 27%;
max-height: 25%; max-height: 25%;
padding: 0 2px;
font-size: 85%; font-size: 85%;
margin: 0 0 5px 0; margin: 0;
padding: 0 1px 3px 1px;
} }
.my-legend .legend-title { .my-legend .legend-title {
margin-bottom: 0; margin-bottom: 0;
font-size: 90%; font-size: 85%;
} }
.my-legend .legend-scale ul { .my-legend .legend-scale ul {
margin-bottom: 0; margin-bottom: 0;
......
...@@ -33,44 +33,55 @@ ...@@ -33,44 +33,55 @@
} }
/* LEGEND PANEL */ /* LEGEND PANEL */
#legend-for-facets {
bottom: 10px;
left:0;
position:fixed;
/* width: we set it a bit more than #lefttopbox width */
max-width: 20%;
max-height: 40%;
font-size:120%;
cursor: default;
overflow-y:auto;
overflow-x: hidden;
}
.my-legend { .my-legend {
position:fixed; position: relative;
/* width: we set it equal or smaller than #lefttopbox width */ height: 100%;
max-width:20%; width: 100%;
max-height: 30%; margin: 0;
padding: 0 5px; padding: 0 5px 5px 5px;
overflow-y:scroll; opacity:1;
bottom:18px; background-color: white;
left:0;
border:solid 1px black;
background-color:white;
opacity: 0.8;
color:#250587; color:#250587;
margin: 7px; overflow: hidden;
font-size:120%; z-index: 5;
cursor: default;
} }
.my-legend .legend-title { .my-legend .legend-title {
text-align: left; text-align: left;
margin-bottom: 5px; margin-bottom: 5px;
font-weight: bold; font-weight: bold;
font-size: 90%; font-size: 75%;
} }
.my-legend .legend-scale ul { .my-legend .legend-scale ul {
margin: 0; margin: 0;
margin-bottom: 5px; margin-bottom: 5px;
padding: 0; padding: 0;
float: left; float: left;
list-style: none; list-style: none;
} }
.my-legend .legend-scale ul li { .my-legend .legend-scale ul li {
font-size: 80%; font-size: 80%;
list-style: none; list-style: none;
margin-left: 0; margin-left: 0;
line-height: 16px; line-height: 16px;
margin-bottom: 2px; margin-bottom: 2px;
} }
.my-legend ul.legend-labels li span.lgdcol { .my-legend ul.legend-labels li span.lgdcol {
display: block; display: block;
float: left; float: left;
......
...@@ -23,8 +23,8 @@ TW.gui.checkBox=false; ...@@ -23,8 +23,8 @@ TW.gui.checkBox=false;
TW.gui.shiftKey=false; TW.gui.shiftKey=false;
TW.gui.foldedSide=false; TW.gui.foldedSide=false;
TW.gui.manuallyChecked = false; TW.gui.manuallyChecked = false;
TW.gui.handpickedcolor = false; // <= changes edge rendering strategy TW.gui.handpickedcolor = {}; // <= changes rendering, by nodetype
TW.gui.lastFilters = {} TW.gui.lastFilters = {} // <= last values, by slider id
TW.gui.reldocTabs = [{}, {}] // <= by nodetype and then dbtype TW.gui.reldocTabs = [{}, {}] // <= by nodetype and then dbtype
TW.gui.sizeRatios = [1,1] // sizeRatios per nodetype TW.gui.sizeRatios = [1,1] // sizeRatios per nodetype
...@@ -519,7 +519,7 @@ function changeType(optionaltypeFlag) { ...@@ -519,7 +519,7 @@ function changeType(optionaltypeFlag) {
// update the gui (POSS could be handled by TW.pushGUIState) // update the gui (POSS could be handled by TW.pushGUIState)
TW.gui.handpickedcolor = false TW.gui.handpickedcolor = {} // <=> none
updateDynamicFacets() updateDynamicFacets()
changeGraphAppearanceByFacets( getActivetypesNames() ) changeGraphAppearanceByFacets( getActivetypesNames() )
......
This diff is collapsed.
...@@ -96,8 +96,10 @@ function isUndef(variable){ ...@@ -96,8 +96,10 @@ function isUndef(variable){
function stringToSomeInt (anyString) { function stringToSomeInt (anyString) {
let charCodeSum = 0 let charCodeSum = 0
for (let i = 0 ; i < anyString.length ; i++) { if (anyString && anyString.length) {
charCodeSum += anyString.charCodeAt(i) for (let i = 0 ; i < anyString.length ; i++) {
charCodeSum += anyString.charCodeAt(i)
}
} }
return charCodeSum return charCodeSum
} }
......
...@@ -97,7 +97,7 @@ TW.resetGraph = function() { ...@@ -97,7 +97,7 @@ TW.resetGraph = function() {
// reset rendering gui flags // reset rendering gui flags
TW.gui.selectionActive = false TW.gui.selectionActive = false
TW.gui.handpickedcolor = false TW.gui.handpickedcolor = {}
// reset circle size and cursor // reset circle size and cursor
TW.gui.circleSize = 0 TW.gui.circleSize = 0
...@@ -734,7 +734,7 @@ function prepareNodesRenderingProperties(nodesDict) { ...@@ -734,7 +734,7 @@ function prepareNodesRenderingProperties(nodesDict) {
// default unselected color // default unselected color
defgrey_color : "rgba("+rgbStr+","+TW.conf.sigmaJsDrawingProperties.twNodesGreyOpacity+")", defgrey_color : "rgba("+rgbStr+","+TW.conf.sigmaJsDrawingProperties.twNodesGreyOpacity+")",
// will be used for repainting (read when TW.gui.handpickedcolor flag) // will be used for repainting (read when TW.gui.handpickedcolor flags)
alt_color: null, alt_color: null,
altgrey_color: null, altgrey_color: null,
} }
......
...@@ -211,8 +211,8 @@ function scanGexf(gexfContent) { ...@@ -211,8 +211,8 @@ function scanGexf(gexfContent) {
// ex: terms // ex: terms
// ex: ISItermsriskV2_140 & ISItermsriskV2_140 // ex: ISItermsriskV2_140 & ISItermsriskV2_140
// optional arg optionalNodeConf should contain keys of the form: // optional arg optionalNodeConf should contain keys of the form:
// "node0": "NGram", // "node0": "Keywords",
// "node1": "Document" // "node1": "Scholars"
// etc. // etc.
// (it's read from project_conf.json) // (it's read from project_conf.json)
function sortNodeTypes(observedTypesDict, optionalNodeConf) { function sortNodeTypes(observedTypesDict, optionalNodeConf) {
......
This diff is collapsed.
...@@ -21,7 +21,7 @@ TW.conf = (function(TW){ ...@@ -21,7 +21,7 @@ TW.conf = (function(TW){
// ...or remote bridge to default source api ajax queries // ...or remote bridge to default source api ajax queries
TWConf.sourceAPI={} TWConf.sourceAPI={}
TWConf.sourceAPI["nodetypes"] = {"node0": "NGram", "node1": "Document" } TWConf.sourceAPI["nodetypes"] = {"node0": "Keywords", "node1": "Scholars" }
TWConf.sourceAPI["forNormalQuery"] = "services/api/graph" TWConf.sourceAPI["forNormalQuery"] = "services/api/graph"
TWConf.sourceAPI["forFilteredQuery"] = "services/api/graph" TWConf.sourceAPI["forFilteredQuery"] = "services/api/graph"
...@@ -59,7 +59,7 @@ TW.conf = (function(TW){ ...@@ -59,7 +59,7 @@ TW.conf = (function(TW){
TWConf.scanAttributes = true TWConf.scanAttributes = true
// use a facet for default color // use a facet for default color
TWConf.defaultColoring = "clust_louvain" TWConf.defaultColoring = null
// facetOptions: choose here the default visual result of your node attributes // facetOptions: choose here the default visual result of your node attributes
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
......
...@@ -21,7 +21,7 @@ TW.conf = (function(TW){ ...@@ -21,7 +21,7 @@ TW.conf = (function(TW){
// ...or remote bridge to default source api ajax queries // ...or remote bridge to default source api ajax queries
TWConf.sourceAPI={} TWConf.sourceAPI={}
TWConf.sourceAPI["nodetypes"] = {"node0": "NGram", "node1": "Document" } TWConf.sourceAPI["nodetypes"] = {"node0": "Keywords", "node1": "Scholars" }
TWConf.sourceAPI["forNormalQuery"] = "services/api/graph" TWConf.sourceAPI["forNormalQuery"] = "services/api/graph"
TWConf.sourceAPI["forFilteredQuery"] = "services/api/graph" TWConf.sourceAPI["forFilteredQuery"] = "services/api/graph"
......
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