Commit 5ba5691b authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[graph] forceatlas with hidden edges is working now

parent 1a6af8b1
...@@ -111,8 +111,9 @@ controlsCpt = here.component "controls" cpt ...@@ -111,8 +111,9 @@ controlsCpt = here.component "controls" cpt
R.useEffect' $ Sigmax.handleForceAtlas2Pause sigmaRef forceAtlasState mFAPauseRef Graph.forceAtlas2Settings R.useEffect' $ Sigmax.handleForceAtlas2Pause sigmaRef forceAtlasState mFAPauseRef Graph.forceAtlas2Settings
-- Handle automatic edge hiding when FA is running (to prevent flickering). -- Handle automatic edge hiding when FA is running (to prevent flickering).
R.useEffect2' sigmaRef forceAtlasState' $ do -- TODO Commented temporarily: this breaks forceatlas rendering after reset
T.modify_ (SigmaxT.forceAtlasEdgeState forceAtlasState') showEdges -- R.useEffect2' sigmaRef forceAtlasState' $ do
-- T.modify_ (SigmaxT.forceAtlasEdgeState forceAtlasState') showEdges
-- Automatic opening of sidebar when a node is selected (but only first time). -- Automatic opening of sidebar when a node is selected (but only first time).
R.useEffect' $ do R.useEffect' $ do
......
...@@ -15,16 +15,15 @@ module Gargantext.Components.GraphExplorer.ToggleButton ...@@ -15,16 +15,15 @@ module Gargantext.Components.GraphExplorer.ToggleButton
import Prelude import Prelude
import Effect (Effect) import Effect (Effect)
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Components.Graph as Graph import Gargantext.Components.Graph as Graph
import Gargantext.Hooks.Sigmax as Sigmax import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Sigma as Sigma import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Hooks.Sigmax.Types as SigmaxTypes import Gargantext.Hooks.Sigmax.Types as SigmaxTypes
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.ToggleButton" here = R2.here "Gargantext.Components.GraphExplorer.ToggleButton"
...@@ -184,6 +183,7 @@ resetForceAtlasButtonCpt = here.component "resetForceAtlasToggleButton" cpt ...@@ -184,6 +183,7 @@ resetForceAtlasButtonCpt = here.component "resetForceAtlasToggleButton" cpt
-- startForceAtlas2 sigma -- startForceAtlas2 sigma
Sigmax.dependOnSigma (R.readRef sigmaRef) "[resetForceAtlasButton] no sigma" $ \sigma -> do Sigmax.dependOnSigma (R.readRef sigmaRef) "[resetForceAtlasButton] no sigma" $ \sigma -> do
Sigma.killForceAtlas2 sigma Sigma.killForceAtlas2 sigma
Sigma.refreshForceAtlas sigma Graph.forceAtlas2Settings
T.write_ SigmaxTypes.Killed forceAtlasState T.write_ SigmaxTypes.Killed forceAtlasState
type TreeToggleButtonProps = ( type TreeToggleButtonProps = (
......
...@@ -168,7 +168,7 @@ toggleForceAtlasState InitialRunning = Paused ...@@ -168,7 +168,7 @@ toggleForceAtlasState InitialRunning = Paused
toggleForceAtlasState InitialStopped = InitialRunning toggleForceAtlasState InitialStopped = InitialRunning
toggleForceAtlasState Running = Paused toggleForceAtlasState Running = Paused
toggleForceAtlasState Paused = Running toggleForceAtlasState Paused = Running
toggleForceAtlasState Killed = Running toggleForceAtlasState Killed = InitialRunning
-- | Custom state for show edges. Normally it is EShow or EHide (show/hide -- | Custom state for show edges. Normally it is EShow or EHide (show/hide
-- | edges). However, edges are temporarily turned off when forceAtlas is -- | edges). However, edges are temporarily turned off when forceAtlas is
...@@ -219,6 +219,7 @@ forceAtlasEdgeState Running EShow = ETempHiddenThenShow ...@@ -219,6 +219,7 @@ forceAtlasEdgeState Running EShow = ETempHiddenThenShow
forceAtlasEdgeState Running es = es forceAtlasEdgeState Running es = es
forceAtlasEdgeState Paused ETempHiddenThenShow = EShow forceAtlasEdgeState Paused ETempHiddenThenShow = EShow
forceAtlasEdgeState Paused es = es forceAtlasEdgeState Paused es = es
forceAtlasEdgeState Killed ETempHiddenThenShow = EShow
forceAtlasEdgeState Killed es = es forceAtlasEdgeState Killed es = es
......
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