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
4b5da332
Commit
4b5da332
authored
Dec 05, 2018
by
Sudhir Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
open side panel on node click
parent
e840626a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+8
-7
No files found.
src/Gargantext/Pages/Corpus/Graph.purs
View file @
4b5da332
module Gargantext.Pages.Corpus.Graph where
module Gargantext.Pages.Corpus.Graph where
import Effect.Unsafe
import Gargantext.Prelude
import Gargantext.Prelude
import Affjax (defaultRequest, request)
import Affjax (defaultRequest, request)
...
@@ -25,16 +26,15 @@ import Math (cos, sin)
...
@@ -25,16 +26,15 @@ import Math (cos, sin)
import Partial.Unsafe (unsafePartial)
import Partial.Unsafe (unsafePartial)
import React (ReactElement)
import React (ReactElement)
import React.DOM (a, br', button, div, form', input, li, li', menu, option, p, select, span, text, ul, ul')
import React.DOM (a, br', button, div, form', input, li, li', menu, option, p, select, span, text, ul, ul')
import React.DOM.Props (_id, _type, checked, className, href, name, onChange, onClick,placeholder, style, title, value)
import React.DOM.Props (_id, _type, checked, className, href, name, onChange, onClick,
placeholder, style, title, value)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
import Effect.Unsafe
data Action
data Action
= LoadGraph Int
= LoadGraph Int
| SelectNode SelectedNode
| SelectNode SelectedNode
| ShowSidePanel
| ShowSidePanel
Boolean
| ShowControls
| ShowControls
newtype SelectedNode = SelectedNode {id :: String, label :: String}
newtype SelectedNode = SelectedNode {id :: String, label :: String}
...
@@ -78,8 +78,8 @@ performAction (LoadGraph fp) _ _ = void do
...
@@ -78,8 +78,8 @@ performAction (LoadGraph fp) _ _ = void do
performAction (SelectNode node) _ _ = void do
performAction (SelectNode node) _ _ = void do
modifyState $ \(State s) -> State s {selectedNode = pure node}
modifyState $ \(State s) -> State s {selectedNode = pure node}
performAction (ShowSidePanel) _ (State state) = void do
performAction (ShowSidePanel
b
) _ (State state) = void do
modifyState $ \(State s) -> State s {showSidePanel =
not (state.showSidePanel)
}
modifyState $ \(State s) -> State s {showSidePanel =
b
}
performAction (ShowControls) _ (State state) = void do
performAction (ShowControls) _ (State state) = void do
...
@@ -284,8 +284,8 @@ specOld = simpleSpec performAction render'
...
@@ -284,8 +284,8 @@ specOld = simpleSpec performAction render'
[text "Show Controls"]
[text "Show Controls"]
, button [className "btn btn-primary"
, button [className "btn btn-primary"
, style {position:"relative",top:"-25px",left: "1380px"}
, style {position:"relative",top:"-25px",left: "1380px"}
,onClick \_ -> d
S
howSidePanel
,onClick \_ -> d
$ ShowSidePanel $ not st.s
howSidePanel
] [text "
show
SidePanel"]
] [text "
Show
SidePanel"]
]
]
, if (st.showControls) then
, if (st.showControls) then
div [className "col-md-12", style {marginBottom : "21px"}]
div [className "col-md-12", style {marginBottom : "21px"}]
...
@@ -373,6 +373,7 @@ specOld = simpleSpec performAction render'
...
@@ -373,6 +373,7 @@ specOld = simpleSpec performAction render'
, onClickNode : \e -> unsafePerformEffect $ do
, onClickNode : \e -> unsafePerformEffect $ do
_ <- log " hello 2"
_ <- log " hello 2"
--logs $ unsafeCoerce e
--logs $ unsafeCoerce e
_ <- d $ ShowSidePanel true
_ <- d $ SelectNode $ SelectedNode {id : (unsafeCoerce e).data.node.id, label : (unsafeCoerce e).data.node.label}
_ <- d $ SelectNode $ SelectedNode {id : (unsafeCoerce e).data.node.id, label : (unsafeCoerce e).data.node.label}
pure unit
pure unit
}
}
...
...
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