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
269a4f58
Commit
269a4f58
authored
Sep 25, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transitive titling + option for no titling
parent
8f770926
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
15 deletions
+55
-15
explorerjs.html
explorerjs.html
+1
-0
settings_explorerjs.js
settings_explorerjs.js
+3
-2
extras_explorerjs.js
twmain/extras_explorerjs.js
+43
-8
settings_explorerjs.comex.js
twpresets/settings_explorerjs.comex.js
+5
-3
settings_explorerjs.devdefault.js
twpresets/settings_explorerjs.devdefault.js
+3
-2
No files found.
explorerjs.html
View file @
269a4f58
...
...
@@ -724,6 +724,7 @@
<label
for=
"attr-titling-metric"
class=
"smlabel input-group-addon"
>
Titling metric
</label>
<select
id=
"attr-titling-metric"
name=
"attr-titling-metric"
class=
"custom-select form-control"
>
<option
value=
"off"
>
No titling (preserve original values)
</option>
<!-- other attrs filled by fillAttrsInForm(., 'num') -->
</select>
</div>
...
...
settings_explorerjs.js
View file @
269a4f58
...
...
@@ -73,12 +73,13 @@ TW.conf = (function(TW){
'auto-outdegree'
:
{
'col'
:
"heatmap"
,
'n'
:
7
,
'binmode'
:
'samepop'
,
'legend'
:
'Auto OutDegree'
},
'cluster_index'
:
{
'col'
:
"cluster"
,
'binmode'
:
'off'
},
'clust_louvain'
:
{
'col'
:
"cluster"
,
'binmode'
:
'off'
,
'legend'
:
'Louvain clustering'
},
'legend'
:
'Louvain clustering'
,
'titlingMetric'
:
'auto-outdegree'
},
'country'
:{
'col'
:
"cluster"
,
'binmode'
:
'off'
,
'legend'
:
'Country'
},
'titlingMetric'
:
'off'
;
},
'total_occurrences'
:{
'col'
:
"heatmap"
,
'binmode'
:
'samerange'
,
...
...
twmain/extras_explorerjs.js
View file @
269a4f58
...
...
@@ -430,7 +430,10 @@ function updateColorsLegend ( daclass, forTypes, groupedByTicks ) {
}
// we add a title to cluster classes by ranking their nodes and taking k best labels, except if type is "social"
if
(
TW
.
facetOptions
[
daclass
]
&&
TW
.
facetOptions
[
daclass
].
col
==
'cluster'
&&
curType
!=
TW
.
categories
[
1
])
{
if
(
TW
.
facetOptions
[
daclass
]
&&
TW
.
facetOptions
[
daclass
].
titlingMetric
&&
TW
.
facetOptions
[
daclass
].
titlingMetric
!=
'off'
&&
TW
.
facetOptions
[
daclass
].
col
==
'cluster'
)
{
// let t0 = performance.now()
...
...
@@ -455,10 +458,42 @@ function updateColorsLegend ( daclass, forTypes, groupedByTicks ) {
getVal
=
function
(
node
)
{
return
node
.
size
}
}
for
(
let
j
in
legendInfo
[
l
][
'nids'
])
{
let
n
=
TW
.
partialGraph
.
graph
.
nodes
(
legendInfo
[
l
][
'nids'
][
j
])
// our source of words (labels)
let
ndsToRetrieveNameFrom
=
{}
// if node0 contains meaningful labels for titling
// we can title node1 clusters using node0 neighborhood
// => we'll use metric on bipartite neighborhood labels
// POSS it could be a conf option to use another type or not
if
(
curType
==
TW
.
categories
[
1
]
&&
TW
.
Relations
[
"XR"
])
{
// transitive step from nodetype to their surrogate nodetype
for
(
var
i
in
legendInfo
[
l
][
'nids'
])
{
let
start_nid
=
legendInfo
[
l
][
'nids'
][
i
]
let
transitiveNids
=
TW
.
Relations
[
"XR"
][
start_nid
]
for
(
var
j
in
transitiveNids
)
{
let
nei_nid
=
transitiveNids
[
j
]
if
(
!
ndsToRetrieveNameFrom
[
nei_nid
])
{
ndsToRetrieveNameFrom
[
nei_nid
]
=
1
}
else
{
ndsToRetrieveNameFrom
[
nei_nid
]
+=
1
// <== coef
}
}
}
}
// normal case => directly use metric on these nodes' labels
else
{
for
(
var
i
in
legendInfo
[
l
][
'nids'
])
{
let
nid
=
legendInfo
[
l
][
'nids'
][
i
]
ndsToRetrieveNameFrom
[
nid
]
=
1
}
}
for
(
var
nid
in
ndsToRetrieveNameFrom
)
{
let
n
=
TW
.
Nodes
[
nid
]
let
coef
=
ndsToRetrieveNameFrom
[
nid
]
let
theRankingVal
=
getVal
(
n
)
let
theRankingVal
=
getVal
(
n
)
*
Math
.
sqrt
(
coef
)
if
(
titles
.
length
<
maxLen
)
{
titles
.
push
({
'key'
:
n
.
label
,
'val'
:
theRankingVal
})
...
...
@@ -1107,9 +1142,9 @@ function fillAttrsInForm(menuId, optionalAttTypeConstraint) {
let
elChooser
=
document
.
getElementById
(
menuId
)
// 1- remove any previous options from possible previous graphs
let
autoOptions
=
document
.
getElementById
(
menuId
).
querySelectorAll
(
'option
'
)
for
(
var
i
=
0
;
i
<=
auto
Options
.
length
-
1
;
i
++
)
{
elChooser
.
removeChild
(
auto
Options
[
i
])
let
filledOptions
=
document
.
getElementById
(
menuId
).
querySelectorAll
(
'option[data-opttype=filled]
'
)
for
(
var
i
=
0
;
i
<=
filled
Options
.
length
-
1
;
i
++
)
{
elChooser
.
removeChild
(
filled
Options
[
i
])
}
// 2- ls | uniq all options (no matter what active type they belong too)
...
...
@@ -1146,7 +1181,7 @@ function fillAttrsInForm(menuId, optionalAttTypeConstraint) {
opt
.
dataset
.
opttype
=
"auto"
}
else
{
opt
.
dataset
.
opttype
=
"f
romFacets
"
opt
.
dataset
.
opttype
=
"f
illed
"
}
elChooser
.
appendChild
(
opt
)
}
...
...
twpresets/settings_explorerjs.comex.js
View file @
269a4f58
...
...
@@ -73,12 +73,13 @@ TW.conf = (function(TW){
'auto-outdegree'
:
{
'col'
:
"heatmap"
,
'n'
:
7
,
'binmode'
:
'samepop'
,
'legend'
:
'Auto OutDegree'
},
'cluster_index'
:
{
'col'
:
"cluster"
,
'binmode'
:
'off'
},
'clust_louvain'
:
{
'col'
:
"cluster"
,
'binmode'
:
'off'
,
'legend'
:
'Louvain clustering'
},
'legend'
:
'Louvain clustering'
,
'titlingMetric'
:
'auto-outdegree'
},
'country'
:{
'col'
:
"cluster"
,
'binmode'
:
'off'
,
'legend'
:
'Country'
},
'titlingMetric'
:
'off'
;
},
'normfactor'
:{
'col'
:
"heatmap"
,
...
...
@@ -89,7 +90,8 @@ TW.conf = (function(TW){
'ACR'
:{
'col'
:
"cluster"
,
'binmode'
:
'off'
,
'legend'
:
'Affiliation'
'legend'
:
'Affiliation'
,
'titlingMetric'
:
'off'
;
},
'nbjobs'
:{
'col'
:
"heatmap"
,
...
...
twpresets/settings_explorerjs.devdefault.js
View file @
269a4f58
...
...
@@ -73,12 +73,13 @@ TW.conf = (function(TW){
'auto-outdegree'
:
{
'col'
:
"heatmap"
,
'n'
:
7
,
'binmode'
:
'samepop'
,
'legend'
:
'Auto OutDegree'
},
'cluster_index'
:
{
'col'
:
"cluster"
,
'binmode'
:
'off'
},
'clust_louvain'
:
{
'col'
:
"cluster"
,
'binmode'
:
'off'
,
'legend'
:
'Louvain clustering'
},
'legend'
:
'Louvain clustering'
,
'titlingMetric'
:
'auto-outdegree'
},
'country'
:{
'col'
:
"cluster"
,
'binmode'
:
'off'
,
'legend'
:
'Country'
},
'titlingMetric'
:
'off'
;
},
'total_occurrences'
:{
'col'
:
"heatmap"
,
'binmode'
:
'samerange'
,
...
...
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