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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
f85f4767
Commit
f85f4767
authored
Nov 18, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph] some refactoring of graph and trying to debug recursion
parent
fe8425ea
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
9 deletions
+27
-9
Resources.purs
src/Gargantext/Components/GraphExplorer/Resources.purs
+1
-1
Graph.purs
src/Gargantext/Components/Nodes/Graph.purs
+24
-6
Router.purs
src/Gargantext/Components/Router.purs
+1
-1
Loader.purs
src/Gargantext/Hooks/Loader.purs
+1
-1
No files found.
src/Gargantext/Components/GraphExplorer/Resources.purs
View file @
f85f4767
...
@@ -101,7 +101,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
...
@@ -101,7 +101,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
here.log "[drawGraph (Cleanup)] sigma killed"
here.log "[drawGraph (Cleanup)] sigma killed"
-- Stage Init
-- Stage Init
R.useEffect
1
' graphStage' $ case graphStage' of
R.useEffect
2' hyperdataGraph
' graphStage' $ case graphStage' of
GET.Init -> do
GET.Init -> do
let mCamera = getter _.mCamera hyperdataGraph'
let mCamera = getter _.mCamera hyperdataGraph'
...
...
src/Gargantext/Components/Nodes/Graph.purs
View file @
f85f4767
module Gargantext.Components.Nodes.
Corpus.
Graph
module Gargantext.Components.Nodes.Graph
( node
( node
) where
) where
...
@@ -6,7 +6,7 @@ import Gargantext.Prelude
...
@@ -6,7 +6,7 @@ import Gargantext.Prelude
import DOM.Simple (document, querySelector)
import DOM.Simple (document, querySelector)
import Data.Int as I
import Data.Int as I
import Data.Maybe (Maybe(..), isJust, maybe)
import Data.Maybe (Maybe(..),
fromMaybe,
isJust, maybe)
import Data.Sequence as Seq
import Data.Sequence as Seq
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
...
@@ -27,14 +27,16 @@ import Gargantext.Utils (getter)
...
@@ -27,14 +27,16 @@ import Gargantext.Utils (getter)
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Record as Record
import Record as Record
import Toestand as T
type Props =
type Props =
( graphId :: GET.GraphId
( graphId :: GET.GraphId
)
)
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.Nodes.
Corpus.
Graph"
here = R2.here "Gargantext.Components.Nodes.Graph"
node :: R2.Leaf ( key :: String | Props )
node :: R2.Leaf ( key :: String | Props )
node = R2.leaf nodeCpt
node = R2.leaf nodeCpt
...
@@ -49,8 +51,8 @@ nodeCpt = here.component "node" cpt where
...
@@ -49,8 +51,8 @@ nodeCpt = here.component "node" cpt where
session <- useSession
session <- useSession
graphVersion' <- R2.useLive' graphVersion
graphVersion' <- R2.useLive' graphVersion
state
' /\ state <- R2.useBox'
Nothing
state
<- T.useBox
Nothing
cache
' /\ cache <- R2.useBox'
(GET.defaultCacheParams :: GET.CacheParams)
cache
<- T.useBox
(GET.defaultCacheParams :: GET.CacheParams)
-- | Computed
-- | Computed
-- |
-- |
...
@@ -82,8 +84,23 @@ nodeCpt = here.component "node" cpt where
...
@@ -82,8 +84,23 @@ nodeCpt = here.component "node" cpt where
-- | Render
-- | Render
-- |
-- |
pure $
pure $ renderNode { cache, graphId, state }
type RenderNodeProps = (
cache :: T.Box GET.CacheParams,
graphId :: GET.GraphId,
state :: T.Box (Maybe GET.HyperdataGraph)
)
renderNode :: R2.Leaf RenderNodeProps
renderNode = R2.leaf renderNodeCpt
renderNodeCpt :: R.Component RenderNodeProps
renderNodeCpt = here.component "renderNode" cpt where
cpt { cache, graphId, state } _ = do
cache' <- T.useLive T.unequal cache
state' <- T.useLive T.unequal state
pure $
B.cloak
B.cloak
{ isDisplayed: isJust state'
{ isDisplayed: isJust state'
, idlingPhaseDuration: Just 150
, idlingPhaseDuration: Just 150
...
@@ -97,6 +114,7 @@ nodeCpt = here.component "node" cpt where
...
@@ -97,6 +114,7 @@ nodeCpt = here.component "node" cpt where
GET.HyperdataGraph { graph: hyperdataGraph } = loaded
GET.HyperdataGraph { graph: hyperdataGraph } = loaded
Tuple mMetaData graph = convert hyperdataGraph
Tuple mMetaData graph = convert hyperdataGraph
in
in
-- H.div {} [ H.text "hello" ]
hydrateStore
hydrateStore
{ cacheParams: cache'
{ cacheParams: cache'
, graph
, graph
...
...
src/Gargantext/Components/Router.purs
View file @
f85f4767
...
@@ -23,8 +23,8 @@ import Gargantext.Components.Nodes.Corpus as Corpus
...
@@ -23,8 +23,8 @@ import Gargantext.Components.Nodes.Corpus as Corpus
import Gargantext.Components.Nodes.Corpus.Code (corpusCodeLayout)
import Gargantext.Components.Nodes.Corpus.Code (corpusCodeLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
import Gargantext.Components.Nodes.Corpus.Document as Document
import Gargantext.Components.Nodes.Corpus.Document as Document
import Gargantext.Components.Nodes.Corpus.Graph as Graph
import Gargantext.Components.Nodes.Corpus.Phylo as Phylo
import Gargantext.Components.Nodes.Corpus.Phylo as Phylo
import Gargantext.Components.Nodes.Graph as Graph
import Gargantext.Components.Nodes.File (fileLayout)
import Gargantext.Components.Nodes.File (fileLayout)
import Gargantext.Components.Nodes.Frame as Frame
import Gargantext.Components.Nodes.Frame as Frame
import Gargantext.Components.Nodes.Home (homeLayout)
import Gargantext.Components.Nodes.Home (homeLayout)
...
...
src/Gargantext/Hooks/Loader.purs
View file @
f85f4767
...
@@ -78,7 +78,7 @@ useLoaderEffect { errorHandler, loader: loader', path, state } = do
...
@@ -78,7 +78,7 @@ useLoaderEffect { errorHandler, loader: loader', path, state } = do
state' <- T.useLive T.unequal state
state' <- T.useLive T.unequal state
oPath <- R.useRef path
oPath <- R.useRef path
R.useEffect' $ do
R.useEffect
2' path state
' $ do
path' <- R.readRefM oPath
path' <- R.readRefM oPath
if (path' == path) && (isJust state')
if (path' == path) && (isJust state')
then pure $ R.nothing
then pure $ R.nothing
...
...
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