Commit e32bc4a6 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] #205 GraphExplorer, still needs to lower the loader when recomputing (TODO)

parent 162bd7ff
...@@ -49,8 +49,8 @@ type LayoutProps = ...@@ -49,8 +49,8 @@ type LayoutProps =
, showLogin :: R.State Boolean , showLogin :: R.State Boolean
) )
type Props = ( type Props =
graph :: SigmaxT.SGraph ( graph :: SigmaxT.SGraph
, graphVersion :: R.State Int , graphVersion :: R.State Int
, hyperdataGraph :: GET.HyperdataGraph , hyperdataGraph :: GET.HyperdataGraph
, mMetaData :: Maybe GET.MetaData , mMetaData :: Maybe GET.MetaData
...@@ -66,7 +66,6 @@ explorerLayoutCpt = R2.hooksComponent thisModule "explorerLayout" cpt ...@@ -66,7 +66,6 @@ explorerLayoutCpt = R2.hooksComponent thisModule "explorerLayout" cpt
where where
cpt props _ = do cpt props _ = do
graphVersion <- R.useState' 0 graphVersion <- R.useState' 0
pure $ explorerLayoutView graphVersion props pure $ explorerLayoutView graphVersion props
explorerLayoutView :: R.State Int -> Record LayoutProps -> R.Element explorerLayoutView :: R.State Int -> Record LayoutProps -> R.Element
...@@ -103,7 +102,10 @@ explorerCpt = R2.hooksComponent thisModule "explorer" cpt ...@@ -103,7 +102,10 @@ explorerCpt = R2.hooksComponent thisModule "explorer" cpt
} _ = do } _ = do
let startForceAtlas = maybe true (\(GET.MetaData { startForceAtlas }) -> startForceAtlas) mMetaData let startForceAtlas = maybe true (\(GET.MetaData { startForceAtlas }) -> startForceAtlas) mMetaData
let forceAtlasS = if startForceAtlas then SigmaxT.InitialRunning else SigmaxT.InitialStopped
let forceAtlasS = if startForceAtlas
then SigmaxT.InitialRunning
else SigmaxT.InitialStopped
dataRef <- R.useRef graph dataRef <- R.useRef graph
graphRef <- R.useRef null graphRef <- R.useRef null
...@@ -275,8 +277,7 @@ graphViewCpt = R2.hooksComponent thisModule "graphView" cpt ...@@ -275,8 +277,7 @@ graphViewCpt = R2.hooksComponent thisModule "graphView" cpt
R.useEffect1' (fst controls.multiSelectEnabled) $ do R.useEffect1' (fst controls.multiSelectEnabled) $ do
R.setRef multiSelectEnabledRef $ fst controls.multiSelectEnabled R.setRef multiSelectEnabledRef $ fst controls.multiSelectEnabled
pure $ Graph.graph { pure $ Graph.graph { elRef
elRef
, forceAtlas2Settings: Graph.forceAtlas2Settings , forceAtlas2Settings: Graph.forceAtlas2Settings
, graph , graph
, mCamera , mCamera
...@@ -344,7 +345,10 @@ modeGraphType Types.Terms = "def" ...@@ -344,7 +345,10 @@ modeGraphType Types.Terms = "def"
getNodes :: Session -> R.State Int -> GET.GraphId -> Aff GET.HyperdataGraph getNodes :: Session -> R.State Int -> GET.GraphId -> Aff GET.HyperdataGraph
getNodes session (graphVersion /\ _) graphId = get session $ NodeAPI Types.Graph (Just graphId) ("?version=" <> show graphVersion) getNodes session (graphVersion /\ _) graphId =
get session $ NodeAPI Types.Graph
(Just graphId)
("?version=" <> show graphVersion)
transformGraph :: Record Controls.Controls -> SigmaxT.SGraph -> SigmaxT.SGraph transformGraph :: Record Controls.Controls -> SigmaxT.SGraph -> SigmaxT.SGraph
......
...@@ -109,7 +109,7 @@ controlsCpt = R2.hooksComponent thisModule "controls" cpt ...@@ -109,7 +109,7 @@ controlsCpt = R2.hooksComponent thisModule "controls" cpt
-- CPU, has memory leaks etc. -- CPU, has memory leaks etc.
R.useEffect1' (fst props.forceAtlasState) $ do R.useEffect1' (fst props.forceAtlasState) $ do
if (fst props.forceAtlasState) == SigmaxT.InitialRunning then do if (fst props.forceAtlasState) == SigmaxT.InitialRunning then do
timeoutId <- setTimeout 2000 $ do timeoutId <- setTimeout 9000 $ do
let (toggled /\ setToggled) = props.forceAtlasState let (toggled /\ setToggled) = props.forceAtlasState
case toggled of case toggled of
SigmaxT.InitialRunning -> setToggled $ const SigmaxT.Paused SigmaxT.InitialRunning -> setToggled $ const SigmaxT.Paused
......
...@@ -286,8 +286,8 @@ instance showSideTab :: Show SideTab where ...@@ -286,8 +286,8 @@ instance showSideTab :: Show SideTab where
show SideTabCommunity = "Community" show SideTabCommunity = "Community"
newtype Camera = Camera { newtype Camera =
ratio :: Number Camera { ratio :: Number
, x :: Number , x :: Number
, y :: Number , y :: Number
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment