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
250d851d
Commit
250d851d
authored
Jun 14, 2019
by
James Laver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate confluence slider
parent
cca9d339
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
18 deletions
+26
-18
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+26
-18
No files found.
src/Gargantext/Pages/Corpus/Graph.purs
View file @
250d851d
...
...
@@ -30,6 +30,7 @@ import Effect.Aff.Class (liftAff)
import Effect.Class (liftEffect)
import Effect.Console (log)
import Effect.Uncurried (runEffectFn1, runEffectFn2)
import DOM.Simple.Console (log2)
import Gargantext.Components.GraphExplorer.Sigmajs (Color(Color), SigmaEasing, SigmaGraphData(SigmaGraphData), SigmaNode, SigmaSettings, canvas, edgeShape, edgeShapes, forceAtlas2, setSigmaRef, getSigmaRef, cameras, CameraProps, getCameraProps, goTo, pauseForceAtlas2, sStyle, sigmaOnMouseMove, 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)
...
...
@@ -173,7 +174,7 @@ type EdgeFilters =
{ confluence :: Range.Closed Number }
defaultEdgeFilters :: EdgeFilters
defaultEdgeFilters = { confluence: Range.closedProbability }
defaultEdgeFilters = { confluence: Range.
Closed { min : 0.4, max: 1.0 } } -- Range.
closedProbability }
type NodeFilters = {}
...
...
@@ -202,27 +203,22 @@ performAction (LoadGraph fp) _ _ = void do
_ <- logs fp
_ <- modifyState \(State s) -> State s {corpusId = fp, sigmaGraphData = Nothing}
rawGraphData <- lift $ getNodes fp
liftEffect $ log2 "rawGraphData:" rawGraphData
treeResp <- liftEffect $ getAuthData
case treeResp of
Just (AuthData {token,tree_id }) ->
modifyState \(State s) ->
State $
s { rawGraphData = rawGraphData
, graphData = filterGraphData (State s) rawGraphData
, sigmaGraphData = Just $ sigmafy rawGraphData
, legendData = getLegendData rawGraphData
, treeId = Just tree_id}
Nothing ->
modifyState \(State s) ->
State $
s { rawGraphData = rawGraphData
, graphData = filterGraphData (State s) rawGraphData
, sigmaGraphData = Just $ sigmafy rawGraphData
, legendData = getLegendData rawGraphData
, treeId = Nothing}
modifyState \(State s) ->
let graphData = filterGraphData (State s) rawGraphData in
State $
s { rawGraphData = rawGraphData
, graphData = graphData
, sigmaGraphData = Just $ sigmafy graphData
, legendData = getLegendData graphData
, treeId = map treeId treeResp
}
-- TODO: here one might `catchError getNodes` to visually empty the
-- graph.
--modifyState \(State s) -> State s {rawGraphData, graphData=filterGraphData (State s) rawGraphData, sigmaGraphData = Just $ sigmafy rawGraphData, legendData = getLegendData rawGraphData}
where treeId (AuthData {tree_id}) = tree_id
performAction (SelectNode selectedNode@(SelectedNode node)) _ (State state) =
modifyState_ $ \(State s) ->
...
...
@@ -624,6 +620,18 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
modCamera0 (const {ratio})
]
]
, li [className "col-md-1"]
[ span [] [text "Confluence"]
,input [ _type "range"
, _id "confluence"
, max "1.0"
, defaultValue "1.0"
, min "1.0"
, onChange \e -> do
let ratio = (100.0 - numberTargetValue e) / 100.0
modCamera0 (const {ratio})
]
]
, li [className "col-md-1"]
[ span [] [text "MultiNode"]
, input
...
...
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