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
8bf54c2f
Commit
8bf54c2f
authored
Apr 21, 2022
by
arturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
>>> continue
parent
04a7e04d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
18 deletions
+9
-18
Layout.purs
src/Gargantext/Components/GraphExplorer/Layout.purs
+0
-11
Resources.purs
src/Gargantext/Components/GraphExplorer/Resources.purs
+4
-3
Sigmax.purs
src/Gargantext/Hooks/Sigmax.purs
+5
-4
No files found.
src/Gargantext/Components/GraphExplorer/Layout.purs
View file @
8bf54c2f
...
...
@@ -214,7 +214,6 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
-- |
{ edgeConfluence
, edgeWeight
, multiSelectEnabled
, nodeSize
, removedNodeIds
, selectedNodeIds
...
...
@@ -226,7 +225,6 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
edgeConfluence' <- R2.useLive' edgeConfluence
edgeWeight' <- R2.useLive' edgeWeight
multiSelectEnabled' <- R2.useLive' multiSelectEnabled
nodeSize' <- R2.useLive' nodeSize
removedNodeIds' <- R2.useLive' removedNodeIds
selectedNodeIds' <- R2.useLive' selectedNodeIds
...
...
@@ -235,8 +233,6 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
hyperdataGraph' <- R2.useLive' hyperdataGraph
graph' <- R2.useLive' graph
multiSelectEnabledRef <- R.useRef multiSelectEnabled'
-- | Computed
-- |
...
...
@@ -258,12 +254,6 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
let mCamera' (GET.HyperdataGraph { mCamera }) = mCamera
-- | Hooks
-- |
R.useEffect1' multiSelectEnabled' $ do
R.setRef multiSelectEnabledRef multiSelectEnabled'
-- | Render
-- |
pure $
...
...
@@ -273,7 +263,6 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
, elRef
, forceAtlas2Settings: Graph.forceAtlas2Settings
, mCamera: mCamera' hyperdataGraph'
, multiSelectEnabledRef
, sigmaRef
, sigmaSettings: Graph.sigmaSettings
, transformedGraph
...
...
src/Gargantext/Components/GraphExplorer/Resources.purs
View file @
8bf54c2f
...
...
@@ -36,7 +36,6 @@ type Props sigma forceatlas2 =
, elRef :: R.Ref (Nullable Element)
, forceAtlas2Settings :: forceatlas2
, mCamera :: Maybe GET.Camera
, multiSelectEnabledRef :: R.Ref Boolean
, sigmaRef :: R.Ref Sigmax.Sigma
, sigmaSettings :: sigma
, transformedGraph :: SigmaxTypes.SGraph
...
...
@@ -58,6 +57,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
, graph
, startForceAtlas
, selectedNodeIds
, multiSelectEnabled
} <- Stores.useStore GraphStore.context
showEdges' <- R2.useLive' showEdges
...
...
@@ -74,6 +74,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
, graphStage
, startForceAtlas'
, graph'
, multiSelectEnabled
}
props
)
...
...
@@ -98,7 +99,6 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
-- |
stageHooks { elRef
, mCamera
, multiSelectEnabledRef
, selectedNodeIds
, forceAtlas2Settings: fa2
, graph'
...
...
@@ -107,6 +107,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
, graphStage': GET.Init
, startForceAtlas'
, boxes
, multiSelectEnabled
} = do
R.useEffectOnce' $ do
let rSigma = R.readRef sigmaRef
...
...
@@ -132,7 +133,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
Sigmax.dependOnSigma (R.readRef sigmaRef) "[graphCpt (Ready)] no sigma" $ \sigma -> do
-- bind the click event only initially, when ref was empty
Sigmax.bindSelectedNodesClick sigma selectedNodeIds multiSelectEnabled
Ref
Sigmax.bindSelectedNodesClick sigma selectedNodeIds multiSelectEnabled
_ <- Sigma.bindMouseSelectorPlugin sigma
pure unit
...
...
src/Gargantext/Hooks/Sigmax.purs
View file @
8bf54c2f
module Gargantext.Hooks.Sigmax
where
import DOM.Simple.Console (log)
import DOM.Simple.Types (Element)
import Data.Array as A
import Data.Either (either)
...
...
@@ -188,12 +189,12 @@ multiSelectUpdate new selected = foldl fld selected new
Set.insert item selectedAcc
bindSelectedNodesClick :: Sigma.Sigma -> T.Box ST.NodeIds ->
R.Ref
Boolean -> Effect Unit
bindSelectedNodesClick sigma selectedNodeIds multiSelectEnabled
Ref
=
bindSelectedNodesClick :: Sigma.Sigma -> T.Box ST.NodeIds ->
T.Box
Boolean -> Effect Unit
bindSelectedNodesClick sigma selectedNodeIds multiSelectEnabled =
Sigma.bindClickNodes sigma $ \nodes -> do
let multiSelectEnabled = R.readRef multiSelectEnabledRef
let nodeIds = Set.fromFoldable $ map _.id nodes
if multiSelectEnabled then
multiSelectEnabled' <- T.read multiSelectEnabled
if multiSelectEnabled' then
T.modify_ (multiSelectUpdate nodeIds) selectedNodeIds
else
T.write_ nodeIds selectedNodeIds
...
...
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