Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
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
Grégoire Locqueville
purescript-gargantext
Commits
65165d69
Commit
65165d69
authored
Nov 13, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Graph] default 2-sec timeout for forceAtlas2
parent
ecf2265f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
Sigmax.purs
src/Gargantext/Hooks/Sigmax.purs
+12
-3
No files found.
src/Gargantext/Hooks/Sigmax.purs
View file @
65165d69
...
...
@@ -14,6 +14,7 @@ import Data.Sequence (Seq)
import Data.Sequence as Seq
import Data.Traversable (traverse_)
import Effect (Effect)
import Effect.Timer (setTimeout)
import FFI.Simple (delay)
import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Hooks.Sigmax.Types (Graph(..))
...
...
@@ -27,6 +28,8 @@ type Sigma =
, cleanup :: R.Ref (Seq (Effect Unit))
}
type ForceAtlas2Timeout = Int
type Data n e = { graph :: R.Ref (Graph n e) }
initSigma :: R.Hooks Sigma
...
...
@@ -231,7 +234,7 @@ startSigmaEff ref sigmaRef settings forceAtlas2Settings graph = do
log "[startSigmaEff] calling useDataEff"
useDataEff sigma graph
log "[startSigmaEff] calling useForceAtlas2Eff"
useForceAtlas2Eff sigma forceAtlas2Settings
useForceAtlas2Eff sigma forceAtlas2Settings
(Just 2000)
Just sig -> do
log "[startSigmaEff] sigma initialized already"
useCanvasRendererEff ref rSigma
...
...
@@ -297,8 +300,8 @@ useCanvasRendererEff container sigma =
errorKillingMsg = "[useCanvasRenderer] Error killing renderer:"
killedMsg = "[useCanvasRenderer] Killed renderer"
useForceAtlas2Eff :: forall settings. Sigma -> settings -> Effect Unit
useForceAtlas2Eff sigma settings = effect
useForceAtlas2Eff :: forall settings. Sigma -> settings ->
Maybe ForceAtlas2Timeout ->
Effect Unit
useForceAtlas2Eff sigma settings
mFATimeout
= effect
where
effect = dependOnSigma sigma sigmaNotFoundMsg withSigma
withSigma sig = do
...
...
@@ -306,5 +309,11 @@ useForceAtlas2Eff sigma settings = effect
log sigma
Sigma.startForceAtlas2 sig settings
--cleanupFirst sigma (Sigma.killForceAtlas2 sig)
case mFATimeout of
Nothing -> pure unit
Just timeout -> do
_ <- setTimeout timeout $ do
Sigma.stopForceAtlas2 sig
pure unit
startingMsg = "[Graph] Starting ForceAtlas2"
sigmaNotFoundMsg = "[Graph] Sigma not found, not initialising"
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