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
66183b2b
Commit
66183b2b
authored
Jul 18, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better strategy for situations where Card({observed nodetypes}) > 2
parent
1ad12dcd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
sigma.parseCustom.js
twmain/sigma.parseCustom.js
+14
-2
sigmaUtils.js
twmain/sigmaUtils.js
+3
-4
No files found.
twmain/sigma.parseCustom.js
View file @
66183b2b
...
...
@@ -651,10 +651,16 @@ function dictfyGexf( gexf , categories ){
// NB nodesByType lists arrays of ids per nodetype
// (equivalent to TW.partialGraph.graph.getNodesByType but on full nodeset)
for
(
var
i
in
categories
)
{
catDict
[
categories
[
i
]]
=
i
nodesByType
[
i
]
=
[]
let
subCats
=
categories
[
i
].
split
(
/
\/
/g
)
for
(
var
j
in
subCats
)
{
catDict
[
subCats
[
j
]]
=
i
}
}
var
elsNodes
=
gexf
.
getElementsByTagName
(
'nodes'
)
// The list of xml nodes 'nodes' (plural)
TW
.
labels
=
[];
...
...
@@ -1057,8 +1063,13 @@ function dictfyJSON( data , categories ) {
// NB nodesByType lists arrays of ids per nodetype
// (equivalent to TW.partialGraph.graph.getNodesByType but on full nodeset)
for
(
var
i
in
categories
)
{
catDict
[
categories
[
i
]]
=
i
nodesByType
[
i
]
=
[]
let
subCats
=
categories
[
i
].
split
(
/
\/
/g
)
for
(
var
j
in
subCats
)
{
catDict
[
subCats
[
j
]]
=
i
}
}
// normalization, same as parseGexf
...
...
@@ -1111,6 +1122,7 @@ function dictfyJSON( data , categories ) {
// record
nodes
[
node
.
id
]
=
node
;
if
(
!
nodesByType
[
catDict
[
node
.
type
]])
{
console
.
warn
(
"unrecognized type:"
,
node
.
type
)
}
...
...
twmain/sigmaUtils.js
View file @
66183b2b
...
...
@@ -97,11 +97,10 @@ var SigmaUtils = function () {
settings
(
'labelSizeRatio'
)
*
size
;
// apply type-specific size slider ratios
var
typeId
=
TW
.
cat
egories
.
indexOf
(
node
.
type
)
||
0
var
typeId
=
TW
.
cat
Dict
[
node
.
type
]
||
0
size
*=
TW
.
gui
.
sizeRatios
[
typeId
]
fontSize
*=
TW
.
gui
.
sizeRatios
[
typeId
]
if
(
!
activeFlag
&&
fontSize
<
settings
(
'labelThreshold'
)
*
settings
(
'labelSizeRatio'
))
return
;
...
...
@@ -292,7 +291,7 @@ var SigmaUtils = function () {
// NB cost of this condition seems small:
// - without: [11 - 30] ms for 23 nodes
// - with : [11 - 33] ms for 23 nodes
var
typeId
=
TW
.
cat
egories
.
indexOf
(
node
.
type
)
||
0
var
typeId
=
TW
.
cat
Dict
[
node
.
type
]
||
0
// apply type-specific size slider ratios
nodeSize
*=
TW
.
gui
.
sizeRatios
[
typeId
]
...
...
@@ -421,7 +420,7 @@ var SigmaUtils = function () {
// largerall: our customized size boosts
// apply type-specific size slider ratios
var
typeId
=
TW
.
cat
egories
.
indexOf
(
node
.
type
)
||
0
var
typeId
=
TW
.
cat
Dict
[
node
.
type
]
||
0
size
*=
TW
.
gui
.
sizeRatios
[
typeId
]
fontSize
*=
TW
.
gui
.
sizeRatios
[
typeId
]
...
...
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