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
cac574fe
Commit
cac574fe
authored
Jul 11, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better init time for graph-instance-related globals
parent
0716cc83
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
26 deletions
+22
-26
Tinaweb.js
twmain/Tinaweb.js
+3
-1
main.js
twmain/main.js
+17
-13
methods.js
twmain/methods.js
+2
-12
No files found.
twmain/Tinaweb.js
View file @
cac574fe
...
@@ -1057,7 +1057,9 @@ var TinaWebJS = function ( sigmacanvas ) {
...
@@ -1057,7 +1057,9 @@ var TinaWebJS = function ( sigmacanvas ) {
if
(
TW
.
conf
.
getRelatedDocs
)
{
if
(
TW
.
conf
.
getRelatedDocs
)
{
let
ul
=
document
.
getElementById
(
'reldocs-tabs'
)
let
ul
=
document
.
getElementById
(
'reldocs-tabs'
)
let
tabEls
=
[]
// remove any previous tabs
ul
.
innerHTML
=
""
TW
.
gui
.
reldocTabs
=
[{},{}]
// for all existing nodetypes
// for all existing nodetypes
for
(
let
nodetypeId
in
initialActivetypes
)
{
for
(
let
nodetypeId
in
initialActivetypes
)
{
...
...
twmain/main.js
View file @
cac574fe
...
@@ -2,22 +2,9 @@
...
@@ -2,22 +2,9 @@
// ======= [ main TW properties initialization ] ======== //
// ======= [ main TW properties initialization ] ======== //
TW
.
Nodes
=
[];
TW
.
Edges
=
[];
TW
.
ByType
=
{}
// node ids sorted by nodetype id (0, 1)
TW
.
Relations
=
{}
// edges sorted by source/target type id ("00", "11")
TW
.
Clusters
=
[];
// "by value" facet index built in parseCustom
TW
.
File
=
""
// remember the currently opened file
TW
.
File
=
""
// remember the currently opened file
TW
.
partialGraph
=
null
// will contain the sigma visible graph instance
TW
.
labels
=
[];
// fulltext search list
TW
.
categories
=
[];
// possible node types and their inverted map
TW
.
catDict
=
{};
TW
.
lastRelDocQueries
=
{}
// avoids resending ajax if same query twice in a row
// used iff servermenu
// used iff servermenu
TW
.
gmenuPaths
=
{};
// map [graphname => graphsource] for file selectors
TW
.
gmenuPaths
=
{};
// map [graphname => graphsource] for file selectors
TW
.
gmenuInfos
=
{};
// map [graphsource => { node0/1 categories
TW
.
gmenuInfos
=
{};
// map [graphsource => { node0/1 categories
...
@@ -346,6 +333,23 @@ function syncRemoteGraphData () {
...
@@ -346,6 +333,23 @@ function syncRemoteGraphData () {
// (NB inspired by Samuel's legacy bringTheNoise() function)
// (NB inspired by Samuel's legacy bringTheNoise() function)
function
mainStartGraph
(
inFormat
,
inData
,
twInstance
)
{
function
mainStartGraph
(
inFormat
,
inData
,
twInstance
)
{
// Graph-related vars
// ------------------
// POSS: "new TWGraph()..."
TW
.
Nodes
=
[];
TW
.
Edges
=
[];
TW
.
ByType
=
{}
// node ids sorted by nodetype id (0, 1)
TW
.
Relations
=
{}
// edges sorted by source/target type id ("00", "11")
TW
.
Clusters
=
[];
// "by value" facet index built in parseCustom
TW
.
partialGraph
=
null
// will contain the sigma visible graph instance
TW
.
labels
=
[];
// fulltext search list
TW
.
categories
=
[];
// possible node types and their inverted map
TW
.
catDict
=
{};
TW
.
lastRelDocQueries
=
{}
// avoids resending ajax if same query twice in a row
if
(
!
inFormat
||
!
inData
)
{
if
(
!
inFormat
||
!
inData
)
{
alert
(
"error on data load"
)
alert
(
"error on data load"
)
}
}
...
...
twmain/methods.js
View file @
cac574fe
...
@@ -81,18 +81,6 @@ TW.resetGraph = function() {
...
@@ -81,18 +81,6 @@ TW.resetGraph = function() {
// call the sigma graph clearing
// call the sigma graph clearing
TW
.
instance
.
clearSigma
()
TW
.
instance
.
clearSigma
()
// TW.categories, TW.Nodes and TW.Edges will be reset by mainStartGraph
// reset remaining global vars
TW
.
labels
=
[]
TW
.
Relations
=
{}
TW
.
states
=
[
TW
.
initialSystemState
]
TW
.
lastRelDocQueries
=
{}
// reset related docs tabs
document
.
getElementById
(
"reldocs-tabs"
).
innerHTML
=
""
TW
.
gui
.
reldocTabs
=
[{},{}]
// reset rendering gui flags
// reset rendering gui flags
TW
.
gui
.
selectionActive
=
false
TW
.
gui
.
selectionActive
=
false
TW
.
gui
.
handpickedcolor
=
false
TW
.
gui
.
handpickedcolor
=
false
...
@@ -104,6 +92,8 @@ TW.resetGraph = function() {
...
@@ -104,6 +92,8 @@ TW.resetGraph = function() {
// reset other gui flags
// reset other gui flags
TW
.
gui
.
checkBox
=
false
TW
.
gui
.
checkBox
=
false
TW
.
gui
.
lastFilters
=
{}
TW
.
gui
.
lastFilters
=
{}
// remaining global vars will be reset by new graph mainStartGraph
}
}
...
...
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