Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
2ef6c710
Commit
2ef6c710
authored
Jun 29, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distinct size ratio updating for each type
also fixed an fa2 condition
parent
9532a8e0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
92 additions
and
33 deletions
+92
-33
explorerjs.html
explorerjs.html
+22
-6
settings_explorerjs.js
settings_explorerjs.js
+4
-4
selection-panels-mobile.css
twlibs/css/selection-panels-mobile.css
+1
-1
twjs.css
twlibs/css/twjs.css
+2
-2
Tinaweb.js
twmain/Tinaweb.js
+30
-9
enviroment.js
twmain/enviroment.js
+3
-1
main.js
twmain/main.js
+1
-1
methods.js
twmain/methods.js
+2
-0
sigmaUtils.js
twmain/sigmaUtils.js
+27
-9
No files found.
explorerjs.html
View file @
2ef6c710
...
...
@@ -186,10 +186,26 @@
<div
id=
"unranged-value"
class=
"settingslider"
></div>
</a></li>
<li><a>
Label size
<br>
<div
id=
"sliderlabelsize"
class=
"settingslider"
></div>
</a></li>
<li
class=
"tworow-selectors"
>
<!-- Adjust the node sizes per nodetype-->
<table>
<tr
class=
"for-nodecategory-0"
>
<td
class=
"slider-legend"
>
Node 0 Size
</td>
<td
id=
"sliderlabelsize0"
class=
"settingslider"
>
</td>
</tr>
<tr
class=
"for-nodecategory-1"
>
<td
class=
"slider-legend"
>
Node 1 Size
</td>
<td
id=
"sliderlabelsize1"
class=
"settingslider"
>
</td>
</tr>
</table>
</li>
<li
id=
"setcolorsMenu"
class=
"dropdown"
>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
role=
"button"
aria-haspopup=
"true"
aria-expanded=
"false"
>
...
...
@@ -199,7 +215,7 @@
</ul>
</a></li>
<li
class=
"
weight
-selectors for-nodecategory-0"
>
<li
class=
"
tworow
-selectors for-nodecategory-0"
>
<!-- Create a subgraph over nodes from TW.categories[0] (terms or def nodes)-->
<table>
<tr>
...
...
@@ -218,7 +234,7 @@
</tr>
</table>
</li>
<li
class=
"
weight
-selectors for-nodecategory-1"
>
<li
class=
"
tworow
-selectors for-nodecategory-1"
>
<!-- Create a subgraph over nodes from TW.categories[1] (docs or people)-->
<table>
<tr
class=
"weight-selector"
>
...
...
settings_explorerjs.js
View file @
2ef6c710
...
...
@@ -147,7 +147,7 @@ TW.conf = (function(TW){
// to normalize node sizes: (NB not very useful because tina normalizes them at display)
TWConf
.
desirableNodeSizeMin
=
1
;
TWConf
.
desirableNodeSizeMax
=
1
2
;
TWConf
.
desirableNodeSizeMax
=
2
;
// =============
...
...
@@ -155,8 +155,8 @@ TW.conf = (function(TW){
// =============
// Node typology: categories (resp. 0 and 1) will get these default labels
TWConf
.
catSem
=
"
ter
m"
;
TWConf
.
catSoc
=
"
person
"
;
TWConf
.
catSem
=
"
NGra
m"
;
TWConf
.
catSoc
=
"
Document
"
;
// NB: these labels may be superseded by the input data's node types values
// cf. sortNodeTypes()
...
...
@@ -316,7 +316,7 @@ TW.conf = (function(TW){
logFacets
:
false
,
// ...about parsing node attribute:value facets
logSettings
:
false
,
// ...about settings at Tina and Sigma init time
logStates
:
false
,
// ...about TW.states array
logSelections
:
fals
e
logSelections
:
tru
e
}
...
...
twlibs/css/selection-panels-mobile.css
View file @
2ef6c710
...
...
@@ -43,7 +43,7 @@
#defaultop
#searchnav
{
padding-left
:
15px
!important
;
}
#defaultop
.
weight
-selectors
{
#defaultop
.
tworow
-selectors
{
padding-left
:
15px
!important
;
margin-left
:
0
!important
;
}
...
...
twlibs/css/twjs.css
View file @
2ef6c710
...
...
@@ -104,13 +104,13 @@ html.waiting {
max-width
:
300px
;
}
#defaultop
.
weight
-selectors
{
#defaultop
.
tworow
-selectors
{
width
:
135px
!important
;
padding-top
:
15px
;
margin
:
0
25px
;
}
#defaultop
.
weight
-selectors
td
{
#defaultop
.
tworow
-selectors
td
{
width
:
135px
!important
;
padding
:
0
0
10px
0
;
}
...
...
twmain/Tinaweb.js
View file @
2ef6c710
...
...
@@ -1093,27 +1093,48 @@ var TinaWebJS = function ( sigmacanvas ) {
// node's label size
var
labelSizeTimeout
=
null
$
(
"#sliderlabelsize"
).
freshslider
({
$
(
"#sliderlabelsize
0
"
).
freshslider
({
step
:.
25
,
min
:
0
,
max
:
5
,
value
:
TW
.
conf
.
sigmaJsDrawingProperties
[
'labelSizeRatio'
]
||
1
,
value
:
1
,
bgcolor
:
"#FFA500"
,
onchange
:
function
(
value
){
if
(
labelSizeTimeout
)
{
clearTimeout
(
labelSizeTimeout
)
}
labelSizeTimeout
=
setTimeout
(
function
(){
if
(
TW
.
gui
.
sizeRatios
[
0
]
!=
value
)
{
TW
.
gui
.
sizeRatios
[
0
]
=
value
// -------------------------------------------------------------
// generic efficient method acting on entire graphs label ratio
// (can't use it b/c we need to distinguish by type)
// var adaptedLabelThreshold = 7 - value
// TW.partialGraph.settings('labelSizeRatio', value)
// TW.partialGraph.settings('labelThreshold', adaptedLabelThreshold)
// -------------------------------------------------------------
TW
.
partialGraph
.
render
()
}
},
200
)
}
});
var
labelSizeTimeout
=
null
$
(
"#sliderlabelsize1"
).
freshslider
({
step
:.
25
,
min
:
0
,
max
:
5
,
value
:
1
,
bgcolor
:
"#27c470"
,
onchange
:
function
(
value
){
if
(
labelSizeTimeout
)
{
clearTimeout
(
labelSizeTimeout
)
}
labelSizeTimeout
=
setTimeout
(
function
(){
if
(
TW
.
partialGraph
.
settings
(
'labelSizeRatio'
)
!=
value
)
{
var
adaptedLabelThreshold
=
7
-
value
// console.log("value", value, "thres", adaptedLabelThreshold)
TW
.
partialGraph
.
settings
(
'labelSizeRatio'
,
value
)
TW
.
partialGraph
.
settings
(
'labelThreshold'
,
adaptedLabelThreshold
)
if
(
TW
.
gui
.
sizeRatios
[
1
]
!=
value
)
{
TW
.
gui
.
sizeRatios
[
1
]
=
value
TW
.
partialGraph
.
render
()
}
},
200
)
}
});
...
...
twmain/enviroment.js
View file @
2ef6c710
...
...
@@ -25,6 +25,8 @@ TW.gui.manuallyChecked = false;
TW
.
gui
.
handpickedcolor
=
false
;
// <= changes edge rendering strategy
TW
.
gui
.
lastFilters
=
{}
TW
.
gui
.
sizeRatios
=
[
1
,
1
]
// sizeRatios per nodetype
// POSS: themed variants (ex: for dark bg vs light bg)
// contrasted color list for clusterColoring()
...
...
@@ -576,7 +578,7 @@ function changeLevel() {
// recreate FA2 nodes array after you change the nodes
reInitFa2
({
useSoftMethod
:
!
futurelevel
,
useSoftMethod
:
false
,
callback
:
function
()
{
TW
.
gui
.
elHtml
.
classList
.
remove
(
'waiting'
);
...
...
twmain/main.js
View file @
2ef6c710
...
...
@@ -534,7 +534,7 @@ function mainStartGraph(inFormat, inData, twInstance) {
if
(
!
TW
.
conf
.
filterSliders
)
{
var
filterEls
=
document
.
getElementsByClassName
(
'
weight
-selectors'
)
var
filterEls
=
document
.
getElementsByClassName
(
'
tworow
-selectors'
)
for
(
var
k
in
filterEls
)
{
if
(
filterEls
[
k
]
&&
filterEls
[
k
].
style
)
filterEls
[
k
].
style
.
display
=
"none"
...
...
twmain/methods.js
View file @
2ef6c710
...
...
@@ -702,6 +702,8 @@ function saveGraphIMG(){
function
reInitFa2
(
params
)
{
if
(
!
params
)
params
=
{}
sigma_utils
.
ourStopFA2
()
if
(
params
.
useSoftMethod
)
{
// soft method: we just update FA2 internal index
// (is good enough if new nodes are subset of previous nodes)
...
...
twmain/sigmaUtils.js
View file @
2ef6c710
...
...
@@ -89,9 +89,6 @@ var SigmaUtils = function () {
let
X
=
node
[
prefix
+
'x'
]
let
Y
=
node
[
prefix
+
'y'
]
if
(
!
activeFlag
&&
size
<
settings
(
'labelThreshold'
))
return
;
if
(
!
node
.
label
||
typeof
node
.
label
!==
'string'
)
return
;
...
...
@@ -99,6 +96,14 @@ var SigmaUtils = function () {
settings
(
'defaultLabelSize'
)
:
settings
(
'labelSizeRatio'
)
*
size
;
// apply type-specific size slider ratios
var
typeId
=
TW
.
categories
.
indexOf
(
node
.
type
)
||
0
fontSize
*=
TW
.
gui
.
sizeRatios
[
typeId
]
if
(
!
activeFlag
&&
fontSize
<
settings
(
'labelThreshold'
)
*
settings
(
'labelSizeRatio'
))
return
;
// our customization: active nodes like zoom x2 post-its
if
(
activeFlag
)
{
fontSize
*=
2
...
...
@@ -277,14 +282,20 @@ var SigmaUtils = function () {
// our shapes are dependant on flags, type AND categories
// so we need the bool and conditions
// type-specific actions
// ----------------------
// other POSS: we rename n.type at parsing
// and each action (recoloring/selection)
// to use sigma's "def vs someType" syntax
// NB cost of this condition seems small:
// - without: [11 - 30] ms for 23 nodes
// - with : [11 - 33] ms for 23 nodes
var
catSocFlag
=
(
node
.
type
!=
TW
.
categories
[
0
])
var
typeId
=
TW
.
categories
.
indexOf
(
node
.
type
)
||
0
// apply type-specific size slider ratios
nodeSize
*=
TW
.
gui
.
sizeRatios
[
typeId
]
borderSize
*=
TW
.
gui
.
sizeRatios
[
typeId
]
// mode variants 1: if a coloringFunction is active
if
(
!
TW
.
gui
.
handpickedcolor
)
{
...
...
@@ -335,7 +346,7 @@ var SigmaUtils = function () {
context
.
fillStyle
=
borderColor
context
.
beginPath
();
if
(
catSocFlag
)
{
if
(
typeId
==
1
)
{
// (Square shape)
// thinner borderSize for squares looks better
// otherwise hb = (nodeSize + borderSize) / 2
...
...
@@ -364,7 +375,7 @@ var SigmaUtils = function () {
context
.
beginPath
();
if
(
catSocFlag
)
{
if
(
typeId
==
1
)
{
// (Square shape)
let
hn
=
nodeSize
/
2
context
.
moveTo
(
X
+
hn
,
Y
+
hn
);
...
...
@@ -407,6 +418,11 @@ var SigmaUtils = function () {
settings
(
'labelSizeRatio'
)
*
size
;
// largerall: our customized size boosts
// apply type-specific size slider ratios
var
typeId
=
TW
.
categories
.
indexOf
(
node
.
type
)
||
0
fontSize
*=
TW
.
gui
.
sizeRatios
[
typeId
]
if
(
!
node
.
customAttrs
.
active
)
{
fontSize
*=
1.3
...
...
@@ -514,12 +530,14 @@ var SigmaUtils = function () {
this
.
ourStopFA2
=
function
()
{
TW
.
partialGraph
.
stopForceAtlas2
();
try
{
TW
.
partialGraph
.
stopForceAtlas2
();
}
catch
(
e
)
{
console
.
log
(
e
)}
if
(
document
.
getElementById
(
'layoutwait'
))
{
document
.
getElementById
(
'layoutwait'
).
remove
()
}
catch
(
e
)
{}
// restore edges if needed
if
(
document
.
getElementById
(
'edges-switch'
).
checked
)
{
...
...
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