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 =
, showLogin :: R.State Boolean
)
type Props = (
graph :: SigmaxT.SGraph
type Props =
( graph :: SigmaxT.SGraph
, graphVersion :: R.State Int
, hyperdataGraph :: GET.HyperdataGraph
, mMetaData :: Maybe GET.MetaData
......@@ -66,7 +66,6 @@ explorerLayoutCpt = R2.hooksComponent thisModule "explorerLayout" cpt
where
cpt props _ = do
graphVersion <- R.useState' 0
pure $ explorerLayoutView graphVersion props
explorerLayoutView :: R.State Int -> Record LayoutProps -> R.Element
......@@ -103,7 +102,10 @@ explorerCpt = R2.hooksComponent thisModule "explorer" cpt
} _ = do
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
graphRef <- R.useRef null
......@@ -275,8 +277,7 @@ graphViewCpt = R2.hooksComponent thisModule "graphView" cpt
R.useEffect1' (fst controls.multiSelectEnabled) $ do
R.setRef multiSelectEnabledRef $ fst controls.multiSelectEnabled
pure $ Graph.graph {
elRef
pure $ Graph.graph { elRef
, forceAtlas2Settings: Graph.forceAtlas2Settings
, graph
, mCamera
......@@ -344,7 +345,10 @@ modeGraphType Types.Terms = "def"
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
......
......@@ -109,7 +109,7 @@ controlsCpt = R2.hooksComponent thisModule "controls" cpt
-- CPU, has memory leaks etc.
R.useEffect1' (fst props.forceAtlasState) $ do
if (fst props.forceAtlasState) == SigmaxT.InitialRunning then do
timeoutId <- setTimeout 2000 $ do
timeoutId <- setTimeout 9000 $ do
let (toggled /\ setToggled) = props.forceAtlasState
case toggled of
SigmaxT.InitialRunning -> setToggled $ const SigmaxT.Paused
......
......@@ -286,8 +286,8 @@ instance showSideTab :: Show SideTab where
show SideTabCommunity = "Community"
newtype Camera = Camera {
ratio :: Number
newtype Camera =
Camera { ratio :: Number
, x :: 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