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
19e49990
Commit
19e49990
authored
Nov 26, 2018
by
Sudhir Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui changes
parent
d1c7c8d9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
9 deletions
+39
-9
Login.css
dist/css/Login.css
+6
-0
.psc-ide-port
src/.psc-ide-port
+1
-0
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+17
-6
Actions.purs
src/Gargantext/Pages/Layout/Actions.purs
+4
-0
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+9
-3
States.purs
src/Gargantext/Pages/Layout/States.purs
+2
-0
No files found.
dist/css/Login.css
View file @
19e49990
...
...
@@ -157,3 +157,9 @@ text-align: center;
text-decoration
:
none
;
}
#sp-container
{
-webkit-transition
:
width
2s
;
/* For Safari 3.1 to 6.0 */
transition
:
width
2s
;
}
src/.psc-ide-port
0 → 100644
View file @
19e49990
15747
\ No newline at end of file
src/Gargantext/Pages/Corpus/Graph.purs
View file @
19e49990
...
...
@@ -24,15 +24,16 @@ import Math (cos, sin)
import Partial.Unsafe (unsafePartial)
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.Props (_id, _type, checked, className, href, name, onChange, 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 Unsafe.Coerce (unsafeCoerce)
data Action
= LoadGraph Int
--- need to make it as String
= LoadGraph Int
| SelectNode SelectedNode
| ShowSidePanel
newtype SelectedNode = SelectedNode {id :: String, label :: String}
...
...
@@ -45,6 +46,7 @@ newtype State = State
, sigmaGraphData :: Maybe SigmaGraphData
, legendData :: Array Legend
, selectedNode :: Maybe SelectedNode
, showSidePanel :: Boolean
}
initialState :: State
...
...
@@ -54,6 +56,7 @@ initialState = State
, sigmaGraphData : Nothing
, legendData : []
, selectedNode : Nothing
, showSidePanel : false
}
graphSpec :: Spec State {} Action
...
...
@@ -75,6 +78,9 @@ performAction (LoadGraph fp) _ _ = void do
performAction (SelectNode node) _ _ = void do
modifyState $ \(State s) -> State s {selectedNode = pure node}
performAction (ShowSidePanel) _ (State state) = void do
modifyState $ \(State s) -> State s {showSidePanel = not (state.showSidePanel) }
convert :: GraphData -> SigmaGraphData
convert (GraphData r) = SigmaGraphData { nodes, edges}
where
...
...
@@ -268,7 +274,7 @@ specOld = simpleSpec performAction render'
render' :: Render State {} Action
render' d _ (State st) _ =
[ div [className "row"] [
div [className "col-md-12", style {margin
Top : "34px", margin
Bottom : "21px"}]
div [className "col-md-12", style {marginBottom : "21px"}]
[ menu [_id "toolbar"]
[ ul'
[
...
...
@@ -331,12 +337,13 @@ specOld = simpleSpec performAction render'
, li'
[ button [className "btn btn-primary"] [text "Save"] -- TODO: Implement Save!
]
, button [onClick \_ -> d ShowSidePanel, className "btn btn-primary"] [text "show sidepanel"]
]
]
]
]
, div [className "row"]
[ div [
className "col-md-9
"]
[ div [
if (st.showSidePanel) then className "col-md-10" else className "col-md-12
"]
[ div [style {border : "1px black solid", height: "90%"}] $
[
]
...
...
@@ -361,9 +368,11 @@ specOld = simpleSpec performAction render'
<>
if length st.legendData > 0 then [div [style {position : "absolute", bottom : "10px", border: "1px solid black", boxShadow : "rgb(0, 0, 0) 0px 2px 6px", marginLeft : "10px", padding: "16px"}] [dispLegend st.legendData]] else []
]
, div [className "col-md-3", style {border : "1px black solid", backgroundColor : "beige"}]
, if (st.showSidePanel) then
div [_id "sp-container",className "col-md-2", style {border : "1px black solid", backgroundColor : "beige", position:"absolute",right: "0px",top:"265px"}]
[ div [className "row"]
[ div [_id "sidepanel" ,
className "col-md-12",
style {borderBottom : "1px solid black"}]
[ div [_id "sidepanel" , style {borderBottom : "1px solid black"}]
[ case st.selectedNode of
Nothing -> span [] []
Just selectedNode -> p [] [text $ "selected Node : " <> getter _.label selectedNode
...
...
@@ -459,6 +468,8 @@ specOld = simpleSpec performAction render'
]
]
]
else
div [] [] -- ends sidepanel column here
]
]
...
...
src/Gargantext/Pages/Layout/Actions.purs
View file @
19e49990
...
...
@@ -38,6 +38,7 @@ data Action
| Go
| ShowLogin
| ShowAddcorpus
| ShowTree
performAction :: PerformAction AppState {} Action
...
...
@@ -46,6 +47,9 @@ performAction (SetRoute route) _ _ = void do
performAction (Search s) _ _ = void do
modifyState $ _ {search = s}
performAction (ShowTree) _ (state) = void do
modifyState $ _ {showTree = not (state.showTree)}
performAction (ShowLogin) _ _ = void do
liftEffect $ modalShow "loginModal"
modifyState $ _ {showLogin = true}
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
19e49990
...
...
@@ -88,8 +88,10 @@ layout0 layout =
then ls as
else outerLayout1
, rs bs ]
ls = over _render \render d p s c -> [ div [className "col-md-2" ] (render d p s c) ]
rs = over _render \render d p s c -> [ div [className "col-md-10"] (render d p s c) ]
ls = over _render \render d p s c -> [
div [if (s.showTree) then className "col-md-2" else className ""] if (s.showTree) then (render d p s c) else (render d p s c)
]
rs = over _render \render d p s c -> [ div [if (s.showTree) then className "col-md-10" else className "col-md-12"] (render d p s c) ]
cont = over _render \render d p s c -> [ div [className "row" ] (render d p s c) ]
as = focus _treeState _treeAction Tree.treeview
...
...
@@ -111,7 +113,7 @@ layoutSidebar = over _render \render d p s c ->
[ div [ _id "dafixedtop"
, className "navbar navbar-inverse navbar-fixed-top"
, role "navigation"
] [ div [className "container"]
] [ div [className "container
-fluid
"]
[ div [ className "navbar-inner" ]
[ divLogo
, div [ className "collapse navbar-collapse"]
...
...
@@ -282,6 +284,10 @@ divDropdownRight d =
-- else
[text " Login / Signup"]
]
, li []
[
button [onClick $ \e -> d ShowTree, className "btn btn-primary"] [text "ShowTree"]
]
]
layoutFooter :: Spec AppState {} Action
...
...
src/Gargantext/Pages/Layout/States.purs
View file @
19e49990
...
...
@@ -27,6 +27,7 @@ type AppState =
, showCorpus :: Boolean
, graphExplorerState :: GE.State
, initialized :: Boolean
, showTree :: Boolean
}
initAppState :: AppState
...
...
@@ -43,6 +44,7 @@ initAppState =
, showCorpus : false
, graphExplorerState : GE.initialState
, initialized : false
, showTree : false
}
---------------------------------------------------------
...
...
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