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
fb0485ac
Commit
fb0485ac
authored
Jul 04, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug new db.json + generalize TW.byType to gexfs if someday multiple types
cf. same for jsons in
de6b4496
parent
4096b7d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
11 deletions
+32
-11
info_div.php
twbackends/phpAPI/info_div.php
+1
-1
enviroment.js
twmain/enviroment.js
+8
-4
main.js
twmain/main.js
+1
-1
sigma.parseCustom.js
twmain/sigma.parseCustom.js
+22
-5
No files found.
twbackends/phpAPI/info_div.php
View file @
fb0485ac
...
@@ -9,7 +9,7 @@ ini_set('display_startup_errors',1);
...
@@ -9,7 +9,7 @@ ini_set('display_startup_errors',1);
include
(
'parameters_details.php'
);
include
(
'parameters_details.php'
);
if
(
$_GET
[
'dbtype'
]
==
"
sql
"
)
{
if
(
$_GET
[
'dbtype'
]
==
"
CortextDB
"
)
{
$base
=
new
PDO
(
"sqlite:"
.
$mainpath
.
$graphdb
);
$base
=
new
PDO
(
"sqlite:"
.
$mainpath
.
$graphdb
);
include
(
'default_div.php'
);
include
(
'default_div.php'
);
}
}
...
...
twmain/enviroment.js
View file @
fb0485ac
...
@@ -1129,10 +1129,14 @@ function jsActionOnGexfSelector(graphBasename){
...
@@ -1129,10 +1129,14 @@ function jsActionOnGexfSelector(graphBasename){
// override default categories with the ones from db.json
// override default categories with the ones from db.json
if
(
TW
.
gmenuInfos
[
graphPath
])
{
if
(
TW
.
gmenuInfos
[
graphPath
])
{
if
(
TW
.
gmenuInfos
[
graphPath
].
node0
&&
TW
.
gmenuInfos
[
graphPath
].
node0
.
name
)
if
(
TW
.
gmenuInfos
[
graphPath
][
0
]
&&
TW
.
gmenuInfos
[
graphPath
][
0
].
name
)
{
TW
.
conf
.
catSem
=
TW
.
gmenuInfos
[
graphPath
].
node0
.
name
TW
.
conf
.
catSem
=
TW
.
gmenuInfos
[
graphPath
][
0
].
name
if
(
TW
.
gmenuInfos
[
graphPath
].
node1
&&
TW
.
gmenuInfos
[
graphPath
].
node1
.
name
)
console
.
log
(
"new catSem:"
,
TW
.
conf
.
catSem
)
TW
.
conf
.
catSem
=
TW
.
gmenuInfos
[
graphPath
].
node1
.
name
}
if
(
TW
.
gmenuInfos
[
graphPath
][
1
]
&&
TW
.
gmenuInfos
[
graphPath
][
1
].
name
)
{
TW
.
conf
.
catSoc
=
TW
.
gmenuInfos
[
graphPath
][
1
].
name
console
.
log
(
"new catSoc:"
,
TW
.
conf
.
catSoc
)
}
}
}
mainStartGraph
(
newDataRes
[
"format"
],
newDataRes
[
"data"
],
TW
.
instance
)
mainStartGraph
(
newDataRes
[
"format"
],
newDataRes
[
"data"
],
TW
.
instance
)
...
...
twmain/main.js
View file @
fb0485ac
...
@@ -284,7 +284,7 @@ function syncRemoteGraphData () {
...
@@ -284,7 +284,7 @@ function syncRemoteGraphData () {
TW
.
gmenuInfos
[
path
+
"/"
+
aGraph
][
0
]
=
gSrcEntry
.
node0
TW
.
gmenuInfos
[
path
+
"/"
+
aGraph
][
0
]
=
gSrcEntry
.
node0
}
}
if
(
gSrcEntry
.
node1
)
{
if
(
gSrcEntry
.
node1
)
{
TW
.
gmenuInfos
[
path
+
"/"
+
aGraph
][
0
]
=
gSrcEntry
.
node0
TW
.
gmenuInfos
[
path
+
"/"
+
aGraph
][
1
]
=
gSrcEntry
.
node1
}
}
}
}
...
...
twmain/sigma.parseCustom.js
View file @
fb0485ac
...
@@ -192,8 +192,6 @@ function scanGexf(gexfContent) {
...
@@ -192,8 +192,6 @@ function scanGexf(gexfContent) {
if
(
!
isUndef
(
declaredAttrs
.
nodeAttrs
[
attr
]))
if
(
!
isUndef
(
declaredAttrs
.
nodeAttrs
[
attr
]))
attr
=
declaredAttrs
.
nodeAttrs
[
attr
].
title
attr
=
declaredAttrs
.
nodeAttrs
[
attr
].
title
// console.log('attr', attr)
// THIS WILL BECOME catDict (if ncats == 1 => monopart)
// THIS WILL BECOME catDict (if ncats == 1 => monopart)
if
(
attr
==
"category"
)
categoriesDict
[
val
]
=
val
;
if
(
attr
==
"category"
)
categoriesDict
[
val
]
=
val
;
}
}
...
@@ -602,12 +600,18 @@ function dictfyGexf( gexf , categories ){
...
@@ -602,12 +600,18 @@ function dictfyGexf( gexf , categories ){
var
catCount
=
{}
var
catCount
=
{}
for
(
var
i
in
categories
)
catDict
[
categories
[
i
]]
=
i
;
for
(
var
i
in
categories
)
catDict
[
categories
[
i
]]
=
i
;
var
edges
=
{},
nodes
=
{}
var
edges
=
{},
nodes
=
{}
,
nodesByType
=
{}
var
declaredAtts
=
gexfCheckAttributesMap
(
gexf
)
var
declaredAtts
=
gexfCheckAttributesMap
(
gexf
)
var
nodesAttributes
=
declaredAtts
.
nodeAttrs
var
nodesAttributes
=
declaredAtts
.
nodeAttrs
// var edgesAttributes = declaredAtts.eAttrs
// var edgesAttributes = declaredAtts.eAttrs
// 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
]
=
[]
}
var
elsNodes
=
gexf
.
getElementsByTagName
(
'nodes'
)
// The list of xml nodes 'nodes' (plural)
var
elsNodes
=
gexf
.
getElementsByTagName
(
'nodes'
)
// The list of xml nodes 'nodes' (plural)
TW
.
labels
=
[];
TW
.
labels
=
[];
...
@@ -744,6 +748,14 @@ function dictfyGexf( gexf , categories ){
...
@@ -744,6 +748,14 @@ function dictfyGexf( gexf , categories ){
// save record
// save record
nodes
[
node
.
id
]
=
node
nodes
[
node
.
id
]
=
node
// console.log("catDict", catDict)
// console.log("node.type", node.type)
if
(
!
nodesByType
[
catDict
[
node
.
type
]])
{
console
.
warn
(
"unrecognized type:"
,
node
.
type
)
}
else
{
nodesByType
[
catDict
[
node
.
type
]].
push
(
node
.
id
)
}
if
(
parseFloat
(
node
.
size
)
<
minNodeSize
)
if
(
parseFloat
(
node
.
size
)
<
minNodeSize
)
minNodeSize
=
parseFloat
(
node
.
size
);
minNodeSize
=
parseFloat
(
node
.
size
);
...
@@ -886,7 +898,7 @@ function dictfyGexf( gexf , categories ){
...
@@ -886,7 +898,7 @@ function dictfyGexf( gexf , categories ){
resDict
.
catCount
=
catCount
;
// ex: {'ISIterms':1877} ie #nodes
resDict
.
catCount
=
catCount
;
// ex: {'ISIterms':1877} ie #nodes
resDict
.
nodes
=
nodes
;
// { nid1: {label:"...", size:"11.1", attributes:"...", color:"#aaa", etc}, nid2: ...}
resDict
.
nodes
=
nodes
;
// { nid1: {label:"...", size:"11.1", attributes:"...", color:"#aaa", etc}, nid2: ...}
resDict
.
edges
=
edges
;
resDict
.
edges
=
edges
;
resDict
.
byType
=
nodesByType
;
return
resDict
;
return
resDict
;
}
}
...
@@ -1055,7 +1067,12 @@ function dictfyJSON( data , categories ) {
...
@@ -1055,7 +1067,12 @@ function dictfyJSON( data , categories ) {
// record
// record
nodes
[
node
.
id
]
=
node
;
nodes
[
node
.
id
]
=
node
;
nodesByType
[
catDict
[
node
.
type
]].
push
(
node
.
id
)
if
(
!
nodesByType
[
catDict
[
node
.
type
]])
{
console
.
warn
(
"unrecognized type:"
,
node
.
type
)
}
else
{
nodesByType
[
catDict
[
node
.
type
]].
push
(
node
.
id
)
}
// creating a faceted index from node.attributes
// creating a faceted index from node.attributes
if
(
TW
.
conf
.
scanClusters
)
{
if
(
TW
.
conf
.
scanClusters
)
{
...
...
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