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
3268a4c7
Commit
3268a4c7
authored
Sep 05, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Graph] more forceAtlas work, still not done
parent
0a44304c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
Graph.purs
src/Gargantext/Components/Graph.purs
+16
-7
ToggleButton.purs
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
+3
-1
No files found.
src/Gargantext/Components/Graph.purs
View file @
3268a4c7
...
...
@@ -8,6 +8,7 @@ import Prelude
import Data.Maybe (Maybe(..))
import Data.Nullable (Nullable, null)
import DOM.Simple.Console (log2)
import FFI.Simple (delay)
import Reactix as R
import Reactix.DOM.HTML as RH
import Gargantext.Hooks.Sigmax
...
...
@@ -43,16 +44,24 @@ graphCpt = R.hooksComponent "Graph" cpt
cpt props _ = do
ref <- R.useRef null
let mSigma = R.readRef props.sigmaRef
_ <- pure $ log2 "[graphCpt] mSigma" mSigma
sigma <- case mSigma of
Just s -> pure s
Nothing -> do
sigma_ <- useSigma ref props.sigmaSettings
_ <- pure $ R.setRef props.sigmaRef $ Just sigma_
pure sigma_
sigma <- useSigma ref props.sigmaSettings
useCanvasRenderer ref sigma
useData sigma props.graph
useForceAtlas2 sigma props.forceAtlas2Settings
R.useLayoutEffect $
delay unit $ \_ -> do
log2 "[graphCpt] mSigma" mSigma
pure $ case mSigma of
Just s -> do
log2 "[graphCpt] mSigma is Just" s
pure unit
Nothing -> do
log2 "[graphCpt] setting sigmaRef" $ Just sigma
log2 "[graphCpt] readSigma" $ readSigma sigma
R.setRef props.sigmaRef $ Just sigma
pure $ RH.div { ref, style: {height: "95%"} } []
type SigmaSettings =
...
...
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
View file @
3268a4c7
...
...
@@ -84,8 +84,10 @@ pauseForceAtlasButton sigmaRef state = R.createElement el props []
Just sigma -> do
log2 "[pauseForceAtlasButton] sigma" sigma
log2 "[pauseForceAtlasButton] toggled" toggled
let rSigma = Sigmax.readSigma sigma
log2 "[pauseForceAtlasButton] rSigma" rSigma
if toggled then
case
Sigmax.readSigma s
igma of
case
rS
igma of
Nothing -> pure unit
Just s -> stopForceAtlas2 s
else
...
...
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