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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
22367b4a
Commit
22367b4a
authored
Nov 28, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Graph] warnings cleanup, reset fa pause ref in controls
parent
bb705423
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
22 deletions
+12
-22
Graph.purs
src/Gargantext/Components/Graph.purs
+4
-10
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+0
-9
Controls.purs
src/Gargantext/Components/GraphExplorer/Controls.purs
+8
-3
No files found.
src/Gargantext/Components/Graph.purs
View file @
22367b4a
...
@@ -4,27 +4,21 @@ module Gargantext.Components.Graph
...
@@ -4,27 +4,21 @@ module Gargantext.Components.Graph
-- , forceAtlas2Settings, ForceAtlas2Settings, ForceAtlas2OptionalSettings
-- , forceAtlas2Settings, ForceAtlas2Settings, ForceAtlas2OptionalSettings
-- )
-- )
where
where
import Prelude (bind, const, discard, pure, ($), unit
, map, (==), (&&), class Eq
)
import Prelude (bind, const, discard, pure, ($), unit)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.Map as Map
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Nullable (notNull, null, Nullable)
import Data.Nullable (Nullable)
import Data.Set as Set
import Data.Tuple (fst)
import Data.Tuple (fst, snd, Tuple(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import DOM.Simple (createElement, setAttr)
import DOM.Simple.Console (log, log2)
import DOM.Simple.Console (log, log2)
import DOM.Simple.Types (Element)
import DOM.Simple.Types (Element)
import Effect.Class (liftEffect)
import FFI.Simple (delay)
import Effect.Timer (setTimeout)
import FFI.Simple (delay, (..))
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as RH
import Reactix.DOM.HTML as RH
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Types as SigmaxTypes
import Gargantext.Hooks.Sigmax.Types as SigmaxTypes
import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Utils.Reactix as R2
type OnProps = ()
type OnProps = ()
...
...
src/Gargantext/Components/GraphExplorer.purs
View file @
22367b4a
...
@@ -5,14 +5,12 @@ import Gargantext.Prelude hiding (max,min)
...
@@ -5,14 +5,12 @@ import Gargantext.Prelude hiding (max,min)
import Data.FoldableWithIndex (foldMapWithIndex)
import Data.FoldableWithIndex (foldMapWithIndex)
import Data.Foldable (foldMap)
import Data.Foldable (foldMap)
import Data.Int (toNumber)
import Data.Int (toNumber)
import Data.Map as Map
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Nullable (null, Nullable)
import Data.Nullable (null, Nullable)
import Data.Sequence as Seq
import Data.Sequence as Seq
import Data.Set as Set
import Data.Set as Set
import Data.Tuple (fst, snd, Tuple(..))
import Data.Tuple (fst, snd, Tuple(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log, log2)
import DOM.Simple.Types (Element)
import DOM.Simple.Types (Element)
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Reactix as R
import Reactix as R
...
@@ -72,12 +70,6 @@ explorerCpt :: R.Component Props
...
@@ -72,12 +70,6 @@ explorerCpt :: R.Component Props
explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
where
where
cpt {frontends, graph, graphId, mCurrentRoute, mMetaData, session, sessions, treeId} _ = do
cpt {frontends, graph, graphId, mCurrentRoute, mMetaData, session, sessions, treeId} _ = do
R.useEffect' $ do
case graph of
Nothing -> log "[explorerCpt] empty graph data"
Just (SigmaxTypes.Graph {nodes}) -> do
log2 "[explorerCpt] number of nodes" $ Seq.length nodes
dataRef <- R.useRef graph
dataRef <- R.useRef graph
graphRef <- R.useRef null
graphRef <- R.useRef null
controls <- Controls.useGraphControls
controls <- Controls.useGraphControls
...
@@ -89,7 +81,6 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
...
@@ -89,7 +81,6 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
Tuple Nothing Nothing -> pure unit
Tuple Nothing Nothing -> pure unit
Tuple (Just g1) (Just g2) | SigmaxTypes.eqGraph g1 g2 -> pure unit
Tuple (Just g1) (Just g2) | SigmaxTypes.eqGraph g1 g2 -> pure unit
_ -> do
_ -> do
log "[explorerCpt] data changed"
let rSigma = R.readRef controls.sigmaRef
let rSigma = R.readRef controls.sigmaRef
Sigmax.cleanupSigma rSigma "explorerCpt"
Sigmax.cleanupSigma rSigma "explorerCpt"
R.setRef dataRef graph
R.setRef dataRef graph
...
...
src/Gargantext/Components/GraphExplorer/Controls.purs
View file @
22367b4a
...
@@ -11,10 +11,10 @@ module Gargantext.Components.GraphExplorer.Controls
...
@@ -11,10 +11,10 @@ module Gargantext.Components.GraphExplorer.Controls
) where
) where
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import D
OM.Simple.Console (log, log2
)
import D
ata.Tuple (fst
)
import Data.Tuple.Nested ((/\), get1)
import Data.Tuple.Nested ((/\), get1)
import Effect (Effect)
import Effect (Effect)
import Effect.Timer (
clearTimeout,
setTimeout)
import Effect.Timer (setTimeout)
import Prelude
import Prelude
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as RH
import Reactix.DOM.HTML as RH
...
@@ -26,7 +26,6 @@ import Gargantext.Components.GraphExplorer.SlideButton (cursorSizeButton, labelS
...
@@ -26,7 +26,6 @@ import Gargantext.Components.GraphExplorer.SlideButton (cursorSizeButton, labelS
import Gargantext.Components.GraphExplorer.ToggleButton (edgesToggleButton, pauseForceAtlasButton)
import Gargantext.Components.GraphExplorer.ToggleButton (edgesToggleButton, pauseForceAtlasButton)
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
...
@@ -79,6 +78,12 @@ controlsCpt = R.hooksComponent "GraphControls" cpt
...
@@ -79,6 +78,12 @@ controlsCpt = R.hooksComponent "GraphControls" cpt
-- If user pauses FA before auto is triggered, clear the timeoutId
-- If user pauses FA before auto is triggered, clear the timeoutId
mFAPauseRef <- R.useRef Nothing
mFAPauseRef <- R.useRef Nothing
-- when graph is changed, cleanup the mFAPauseRef
R.useEffect' $ do
case fst props.graphStage of
Graph.Init -> R.setRef mFAPauseRef Nothing
_ -> pure unit
--R.useEffect $ handleForceAtlasPause props.sigmaRef localControls.pauseForceAtlas mFAPauseRef
--R.useEffect $ handleForceAtlasPause props.sigmaRef localControls.pauseForceAtlas mFAPauseRef
R.useEffect' $ Sigmax.handleForceAtlas2Pause props.sigmaRef localControls.pauseForceAtlas (get1 localControls.showEdges) mFAPauseRef
R.useEffect' $ Sigmax.handleForceAtlas2Pause props.sigmaRef localControls.pauseForceAtlas (get1 localControls.showEdges) mFAPauseRef
...
...
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