1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module Gargantext.Hooks.Sigmax.Noverlap where
-- FFI for noverlap: https://graphology.github.io/standard-library/layout-noverlap.html
import Prelude
import Data.Array as A
import Data.Sequence as Seq
import Data.Set as Set
import Data.Traversable (traverse)
import Effect (Effect)
import Effect.Timer (setTimeout)
import Effect.Uncurried (EffectFn1, EffectFn2, EffectFn3, EffectFn4, runEffectFn1, runEffectFn2, runEffectFn3, runEffectFn4)
import FFI.Simple ((..), (...), (.=))
import Gargantext.Hooks.Sigmax.Graphology as Graphology
import Gargantext.Hooks.Sigmax.Types as Types
import Record as Record
-- | Type representing the web worker.
foreign import data NoverlapLayout :: Type
graph :: NoverlapLayout -> Graphology.Graph
graph s = s .. "graph" :: Graphology.Graph
foreign import _init :: forall settings. EffectFn2 Graphology.Graph settings NoverlapLayout
foreign import _start :: EffectFn1 NoverlapLayout Unit
foreign import _stop :: EffectFn1 NoverlapLayout Unit
foreign import _kill :: EffectFn1 NoverlapLayout Unit
foreign import _isRunning :: EffectFn1 NoverlapLayout Boolean
init :: forall settings. Graphology.Graph -> settings -> Effect NoverlapLayout
init = runEffectFn2 _init
start :: NoverlapLayout -> Effect Unit
start = runEffectFn1 _start
stop :: NoverlapLayout -> Effect Unit
stop = runEffectFn1 _stop
kill :: NoverlapLayout -> Effect Unit
kill = runEffectFn1 _kill
isRunning :: NoverlapLayout -> Effect Boolean
isRunning = runEffectFn1 _isRunning