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
1ed34b98
Commit
1ed34b98
authored
Oct 04, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GraphExplorer] fix forceAtlas settings
parent
f1cff044
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
Resources.purs
src/Gargantext/Components/GraphExplorer/Resources.purs
+4
-4
ForceAtlas2.js
src/Gargantext/Hooks/Sigmax/ForceAtlas2.js
+4
-2
ForceAtlas2.purs
src/Gargantext/Hooks/Sigmax/ForceAtlas2.purs
+3
-3
No files found.
src/Gargantext/Components/GraphExplorer/Resources.purs
View file @
1ed34b98
...
...
@@ -52,7 +52,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
cpt { elRef
, fa2Ref
, sigmaRef
, forceAtlas2Settings: fa2
, forceAtlas2Settings: fa2
Settings
, transformedGraph
} _ = do
...
...
@@ -136,7 +136,7 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
if startForceAtlas' then
case R.readRef fa2Ref of
Nothing -> do
fa2 <- ForceAtlas2.init (Sigma.graph sig)
fa2 <- ForceAtlas2.init (Sigma.graph sig)
fa2Settings
ForceAtlas2.start fa2
R.setRef fa2Ref (Just fa2)
Just fa2 -> do
...
...
@@ -389,7 +389,7 @@ type ForceAtlas2Settings =
-- , worker :: Boolean
)
forceAtlas2Settings ::
{|ForceAtlas2Settings}
forceAtlas2Settings ::
Record ForceAtlas2Settings
forceAtlas2Settings =
{ adjustSizes : true
, barnesHutOptimize : true
...
...
@@ -405,7 +405,7 @@ forceAtlas2Settings =
, outboundAttractionDistribution : false
, scalingRatio : 1000.0
, skipHidden : false
, slowDown :
1.0
, slowDown :
0.2
, startingIterations : 10.0
, strongGravityMode : false
}
src/Gargantext/Hooks/Sigmax/ForceAtlas2.js
View file @
1ed34b98
...
...
@@ -2,11 +2,13 @@
// https://graphology.github.io/standard-library/layout-forceatlas2.html
// import forceAtlas2 from 'graphology-layout-forceatlas2';
import
FA2Layout
from
'graphology-layout-forceatlas2/worker'
;
export
function
_init
(
graph
)
{
export
function
_init
(
graph
,
settings
)
{
// let inferred = forceAtlas2.inferSettings(graph);
return
new
FA2Layout
(
graph
,
{
settings
:
{
gravity
:
1
}
,
settings
,
getEdgeWeight
:
'weight'
})
}
...
...
src/Gargantext/Hooks/Sigmax/ForceAtlas2.purs
View file @
1ed34b98
...
...
@@ -21,14 +21,14 @@ foreign import data FA2Layout :: Type
-- TODO inferSettings
-- TODO init with settings
foreign import _init ::
EffectFn1 Graphology.Graph
FA2Layout
foreign import _init ::
forall settings. EffectFn2 Graphology.Graph settings
FA2Layout
foreign import _start :: EffectFn1 FA2Layout Unit
foreign import _stop :: EffectFn1 FA2Layout Unit
foreign import _kill :: EffectFn1 FA2Layout Unit
foreign import _isRunning :: EffectFn1 FA2Layout Boolean
init ::
Graphology.Graph
-> Effect FA2Layout
init = runEffectFn
1
_init
init ::
forall settings. Graphology.Graph -> settings
-> Effect FA2Layout
init = runEffectFn
2
_init
start :: FA2Layout -> Effect Unit
start = runEffectFn1 _start
...
...
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