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
142
Issues
142
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
a2522ff6
Unverified
Commit
a2522ff6
authored
Apr 16, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GraphExplorer] Add a Pause button to stop/start ForceAtlas2
parent
2c779c66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
Sigmajs.js
src/Gargantext/Components/GraphExplorer/Sigmajs.js
+11
-0
Sigmajs.purs
src/Gargantext/Components/GraphExplorer/Sigmajs.purs
+2
-0
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+7
-2
No files found.
src/Gargantext/Components/GraphExplorer/Sigmajs.js
View file @
a2522ff6
...
...
@@ -54,4 +54,15 @@ exports.goToImpl = function(cam) {
return
cam
.
goTo
(
props
);
};
};
exports
.
pauseForceAtlas2
=
function
()
{
var
s
=
window
.
sigmaGargInstance
;
if
(
s
)
{
if
(
s
.
isForceAtlas2Running
())
{
s
.
stopForceAtlas2
()
}
else
{
s
.
startForceAtlas2
()
}
}
};
src/Gargantext/Components/GraphExplorer/Sigmajs.purs
View file @
a2522ff6
...
...
@@ -271,6 +271,8 @@ foreign import goToImpl :: forall o. CameraInstance -> EffectFn1 { | o } CameraI
goTo :: forall o. Optional o CameraProps => CameraInstance -> { | o } -> Effect CameraInstance
goTo cam = runEffectFn1 (goToImpl cam)
foreign import pauseForceAtlas2 :: Effect Unit
type SigmaProps =
( renderer :: Renderer
, settings :: SigmaSettings
...
...
src/Gargantext/Pages/Corpus/Graph.purs
View file @
a2522ff6
...
...
@@ -27,7 +27,7 @@ import Effect.Aff.Class (liftAff)
import Effect.Class (liftEffect)
import Effect.Console (log)
import Effect.Uncurried (runEffectFn1, runEffectFn2)
import Gargantext.Components.GraphExplorer.Sigmajs (Color(Color), SigmaEasing, SigmaGraphData(SigmaGraphData), SigmaNode, SigmaSettings, canvas, edgeShape, edgeShapes, forceAtlas2, setSigmaRef, getSigmaRef, cameras, CameraProps, getCameraProps, goTo, sStyle, sigma, sigmaEasing, sigmaEdge, sigmaEnableWebGL, sigmaNode, sigmaSettings)
import Gargantext.Components.GraphExplorer.Sigmajs (Color(Color), SigmaEasing, SigmaGraphData(SigmaGraphData), SigmaNode, SigmaSettings, canvas, edgeShape, edgeShapes, forceAtlas2, setSigmaRef, getSigmaRef, cameras, CameraProps, getCameraProps, goTo,
pauseForceAtlas2,
sStyle, sigma, sigmaEasing, sigmaEdge, sigmaEnableWebGL, sigmaNode, sigmaSettings)
import Gargantext.Components.GraphExplorer.Types (Cluster(..), MetaData(..), Edge(..), GraphData(..), Legend(..), Node(..), getLegendData)
import Gargantext.Components.Login.Types (AuthData(..), TreeId)
import Gargantext.Components.RandomText (words)
...
...
@@ -253,7 +253,7 @@ mySettings :: SigmaSettings
mySettings = sigmaSettings { verbose : true
, drawLabels: true
, drawEdgeLabels: true
, drawEdges:
fals
e
, drawEdges:
tru
e
, drawNodes: true
, labelSize : "proportional"
--, nodesPowRatio: 0.3
...
...
@@ -515,6 +515,11 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
, onClick \_ -> modCamera0 (const {x: 0.0, y: 0.0, ratio: 1.0})
] [text "Center"]
]
, li'
[ button [ className "btn btn-primary"
, onClick \_ -> pauseForceAtlas2
] [text "Pause"]
]
, li'
[ button [className "btn btn-primary"
, onClick \_ -> do
...
...
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