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
139
Issues
139
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
c41a5b02
Commit
c41a5b02
authored
Nov 28, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/465-dev-graph-explorer-recursion-error' into dev-merge
parents
2e4c9344
2ddee534
Pipeline
#3424
failed with stage
in 0 seconds
Changes
15
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
73 additions
and
39 deletions
+73
-39
packages.dhall
packages.dhall
+4
-6
spago.dhall
spago.dhall
+0
-1
Cloak.purs
src/Gargantext/Components/Bootstrap/Abstract/Cloak.purs
+3
-4
Sync.purs
src/Gargantext/Components/Forest/Tree/Node/Tools/Sync.purs
+0
-1
Layout.purs
src/Gargantext/Components/GraphExplorer/Layout.purs
+2
-2
Resources.purs
src/Gargantext/Components/GraphExplorer/Resources.purs
+1
-3
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+0
-1
Legend.purs
src/Gargantext/Components/GraphExplorer/Sidebar/Legend.purs
+0
-1
Controls.purs
...Gargantext/Components/GraphExplorer/Toolbar/Controls.purs
+1
-5
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
Graphology.purs
src/Gargantext/Hooks/Sigmax/Graphology.purs
+2
-5
Utils.purs
src/Gargantext/Utils.purs
+4
-2
DataSequence.purs
src/SeqFix/DataSequence.purs
+30
-0
No files found.
packages.dhall
View file @
c41a5b02
let upstream =
https://github.com/garganscript/package-sets/releases/download/v0.1.4/release.dhall
sha256:e03eafe0c7ea0ac143d07ec6d9f20c804bd6b6f95a8d89bf287c279e770584c8
https://github.com/garganscript/package-sets/releases/download/v0.1.6/release.dhall sha256:443a37602d5b9353c4daf4349079a77d5dddf07a7b35219016b167404d1e1138
let overrides =
{ graphql-client =
...
...
@@ -61,8 +60,7 @@ let overrides =
, version = "v9.2.2"
}
, jest =
{ -- markdown-it dependency
dependencies =
{ dependencies =
[ "aff"
, "aff-promise"
, "effect"
...
...
@@ -125,7 +123,7 @@ let additions =
, "unsafe-coerce"
]
, repo = "https://github.com/garganscript/purescript-sequences.git"
, version = "
7ad61fde5239fbf66ceeefc0b7608aa9cbc53701
"
, version = "
recursion-fix
"
}
, spec-discovery =
{ dependencies = [ "prelude", "effect", "arrays", "spec", "node-fs" ]
...
...
@@ -194,4 +192,4 @@ let additions =
}
}
in upstream
// overrides //
additions
in upstream
⫽ overrides ⫽
additions
spago.dhall
View file @
c41a5b02
...
...
@@ -70,7 +70,6 @@ to generate this file without the comments in this block.
, "record"
, "record-extra"
, "routing"
, "sequences"
, "simple-json"
, "simple-json-generics"
, "simplecrypto"
...
...
src/Gargantext/Components/Bootstrap/Abstract/Cloak.purs
View file @
c41a5b02
...
...
@@ -33,6 +33,9 @@ options =
, sustainingPhaseDuration : Nothing
}
cname :: String
cname = "b-cloak"
-- | Abstract component type easing the transition display between a content
-- | component and transitional (or cloak) component
-- |
...
...
@@ -108,10 +111,6 @@ options =
-- | ```
cloak :: forall r. R2.OptLeaf Options Props r
cloak = R2.optLeaf component options
cname :: String
cname = "b-cloak"
component :: R.Component Props
component = R.hooksComponent cname cpt where
cpt props _ = do
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools/Sync.purs
View file @
c41a5b02
...
...
@@ -49,7 +49,6 @@ type GraphUpdateButtonProps =
graphUpdateButton :: Record GraphUpdateButtonProps -> R.Element
graphUpdateButton p = R.createElement graphUpdateButtonCpt p []
graphUpdateButtonCpt :: R.Component GraphUpdateButtonProps
graphUpdateButtonCpt = here.component "graphUpdateButton" cpt
where
...
...
src/Gargantext/Components/GraphExplorer/Layout.purs
View file @
c41a5b02
...
...
@@ -51,8 +51,8 @@ type Props =
layout :: R2.Leaf Props
layout = R2.leaf layoutCpt
layoutCpt :: R.
Memo
Props
layoutCpt =
R.memo' $ here.component "explorerWriteGraph
" cpt where
layoutCpt :: R.
Component
Props
layoutCpt =
here.component "layout
" cpt where
cpt { fa2Ref
, sigmaRef
} _ = do
...
...
src/Gargantext/Components/GraphExplorer/Resources.purs
View file @
c41a5b02
...
...
@@ -64,7 +64,6 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
, edgeConfluence
, edgeWeight
, forceAtlasState
, graph
, graphStage
, hyperdataGraph
, mouseSelectorSize
...
...
@@ -78,7 +77,6 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
edgeWeight' <- R2.useLive' edgeWeight
forceAtlasState' <- R2.useLive' forceAtlasState
graphStage' <- R2.useLive' graphStage
graph' <- R2.useLive' graph
startForceAtlas' <- R2.useLive' startForceAtlas
hyperdataGraph' <- R2.useLive' hyperdataGraph
...
...
@@ -101,7 +99,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
here.log "[drawGraph (Cleanup)] sigma killed"
-- Stage Init
R.useEffect
1
' graphStage' $ case graphStage' of
R.useEffect
2' hyperdataGraph
' graphStage' $ case graphStage' of
GET.Init -> do
let mCamera = getter _.mCamera hyperdataGraph'
...
...
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
c41a5b02
...
...
@@ -160,7 +160,6 @@ sideTabLegendCpt = here.component "sideTabLegend" cpt where
sideTabData :: R2.Leaf Props
sideTabData = R2.leaf sideTabDataCpt
sideTabDataCpt :: R.Component Props
sideTabDataCpt = here.component "sideTabData" cpt where
cpt props _ = do
...
...
src/Gargantext/Components/GraphExplorer/Sidebar/Legend.purs
View file @
c41a5b02
...
...
@@ -31,7 +31,6 @@ type Props =
legend :: R2.Leaf Props
legend = R2.leaf legendCpt
legendCpt :: R.Component Props
legendCpt = here.component "legend" cpt where
cpt { legendSeq
...
...
src/Gargantext/Components/GraphExplorer/Toolbar/Controls.purs
View file @
c41a5b02
...
...
@@ -54,9 +54,7 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
, edgeWeight
, forceAtlasState
, graph
, graphId
, graphStage
, hyperdataGraph
, labelRenderedSizeThreshold
, labelSize
, mouseSelectorSize
...
...
@@ -71,9 +69,7 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
forceAtlasState' <- R2.useLive' forceAtlasState
graph' <- R2.useLive' graph
graphId' <- R2.useLive' graphId
graphStage' <- R2.useLive' graphStage
hyperdataGraph' <- R2.useLive' hyperdataGraph
selectedNodeIds' <- R2.useLive' selectedNodeIds
showSidebar' <- R2.useLive' showSidebar
...
...
@@ -89,7 +85,7 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
-- When graph is changed, cleanup the mFAPauseRef so that forceAtlas
-- timeout is retriggered.
R.useEffect' $ do
R.useEffect
1' graphStage
' $ do
case graphStage' of
GET.Init -> R.setRef mFAPauseRef Nothing
_ -> pure unit
...
...
src/Gargantext/Components/Nodes/Graph.purs
View file @
c41a5b02
module Gargantext.Components.Nodes.
Corpus.
Graph
module Gargantext.Components.Nodes.Graph
( node
) where
...
...
@@ -6,7 +6,7 @@ import Gargantext.Prelude
import DOM.Simple (document, querySelector)
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.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\))
...
...
@@ -27,14 +27,16 @@ import Gargantext.Utils (getter)
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Record as Record
import Toestand as T
type Props =
( graphId :: GET.GraphId
)
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 nodeCpt
...
...
@@ -49,8 +51,8 @@ nodeCpt = here.component "node" cpt where
session <- useSession
graphVersion' <- R2.useLive' graphVersion
state
' /\ state <- R2.useBox'
Nothing
cache
' /\ cache <- R2.useBox'
(GET.defaultCacheParams :: GET.CacheParams)
state
<- T.useBox
Nothing
cache
<- T.useBox
(GET.defaultCacheParams :: GET.CacheParams)
-- | Computed
-- |
...
...
@@ -82,8 +84,23 @@ nodeCpt = here.component "node" cpt where
-- | 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
{ isDisplayed: isJust state'
, idlingPhaseDuration: Just 150
...
...
@@ -167,6 +184,7 @@ hydrateStoreCpt = here.component "hydrateStore" cpt where
-- |
pure $
GraphStore.provide
state
[
...
...
src/Gargantext/Components/Router.purs
View file @
c41a5b02
...
...
@@ -23,8 +23,8 @@ import Gargantext.Components.Nodes.Corpus as Corpus
import Gargantext.Components.Nodes.Corpus.Code (corpusCodeLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
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.Graph as Graph
import Gargantext.Components.Nodes.File (fileLayout)
import Gargantext.Components.Nodes.Frame as Frame
import Gargantext.Components.Nodes.Home (homeLayout)
...
...
src/Gargantext/Hooks/Loader.purs
View file @
c41a5b02
...
...
@@ -78,7 +78,7 @@ useLoaderEffect { errorHandler, loader: loader', path, state } = do
state' <- T.useLive T.unequal state
oPath <- R.useRef path
R.useEffect' $ do
R.useEffect
2' path state
' $ do
path' <- R.readRefM oPath
if (path' == path) && (isJust state')
then pure $ R.nothing
...
...
src/Gargantext/Hooks/Sigmax/Graphology.purs
View file @
c41a5b02
...
...
@@ -44,12 +44,9 @@ newGraph = runEffectFn1 _newGraph
graphFromSigmaxGraph :: Types.Graph Types.Node Types.Edge -> Effect Graph
graphFromSigmaxGraph (Types.Graph g) = do
graph <- newGraph unit
_ <- traverse (addNode graph) nodes
_ <- traverse (addEdge graph) edges
_ <- traverse (addNode graph)
g.
nodes
_ <- traverse (addEdge graph)
g.
edges
pure graph
where
nodes = A.fromFoldable g.nodes
edges = A.fromFoldable g.edges
addNode :: Graph -> Record Types.Node -> Effect String
addNode g node@{ id } = runEffectFn3 _addNode g id node
...
...
src/Gargantext/Utils.purs
View file @
c41a5b02
...
...
@@ -2,13 +2,14 @@ module Gargantext.Utils where
import Prelude
import Data.Array as A
import Data.Char (fromCharCode)
import Data.Either (Either(..))
import Data.Foldable (class Foldable, foldr)
import Data.Lens (Lens', lens)
import Data.Maybe (Maybe(..), fromJust)
import Data.Newtype (class Newtype, unwrap, wrap)
import Data.Sequence.Ordered as OSeq
--
import Data.Sequence.Ordered as OSeq
import Data.Set (Set)
import Data.Set as Set
import Data.String as S
...
...
@@ -100,7 +101,8 @@ sortWith :: forall a b f. Functor f =>
Unfoldable f =>
Ord b =>
(a -> b) -> f a -> f a
sortWith f = map (\(On _ y) -> y) <<< OSeq.toUnfoldable <<< foldr (\x -> OSeq.insert (On (f x) x)) OSeq.empty
--sortWith f = map (\(On _ y) -> y) <<< OSeq.toUnfoldable <<< foldr (\x -> OSeq.insert (On (f x) x)) OSeq.empty
sortWith f xs = A.toUnfoldable $ A.sortWith f (A.fromFoldable xs)
href :: Effect String
...
...
src/SeqFix/DataSequence.purs
0 → 100644
View file @
c41a5b02
module Data.Sequence where
import Prelude
import Data.Array as A
import Data.Functor as Functor
import Data.Tuple (Tuple(..))
type Seq = Array
cons = A.cons
length = A.length
concatMap = A.concatMap
drop = A.drop
filter = A.filter
map = Functor.map
take = A.take
fromFoldable = A.fromFoldable
toUnfoldable = A.toUnfoldable
empty = []
head = A.head
null = A.null
snoc = A.snoc
singleton = A.singleton
splitAt idx seq = Tuple s.before s.after
where
s = A.splitAt idx seq
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