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
03e20929
Commit
03e20929
authored
Apr 18, 2018
by
Sudhir Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graphExplorer layout
parent
b4e74a52
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
2 deletions
+81
-2
GraphExplorer.purs
src/GraphExplorer.purs
+56
-0
Navigation.purs
src/Navigation.purs
+20
-1
PageRouter.purs
src/PageRouter.purs
+5
-1
No files found.
src/GraphExplorer.purs
0 → 100644
View file @
03e20929
module GraphExplorer where
import React.DOM (button, button', div, form', input, li', menu, text, ul, ul')
import React.DOM.Props (_id, _type, className, name, placeholder, value)
import Thermite (Spec, defaultPerformAction, simpleSpec)
newtype State = State {mode :: String}
data Action = NoOp
initialState :: State
initialState = State {mode : "select"}
spec :: forall eff props. Spec eff State props Action
spec = simpleSpec defaultPerformAction render
where
render _ _ _ _ =
[ div [className "row"] [
div [className "col-md-12"]
[ menu [_id "toolbar"]
[ ul'
[ li'
[--GraphLoader here
]
, li'
[ button [className "btn btn-success btn-sm"] [text "Change Type"]
]
, li'
[ button [className "btn btn-primary btn-sm"] [text "Change Level"]
]
, li'
[ form'
[ input [_type "text", name "query", placeholder "Select Topics"] []
, input [_type "submit", value "Search"] []
]
]
, li'
[ button' [text "Screenshot"]]
, li'
[ button' [text "Save"] -- TODO: Implement Save!
]
]
]
]
]
, div [className "row"]
[ div [className "col-md-8"]
[ div [] [text "GraphExplorer here...."]
]
, div [className "col-md-4"]
[ div [_id "sidepanel"]
[ text "SidePanel for contextual information"
]
]
]
]
src/Navigation.purs
View file @
03e20929
...
...
@@ -34,6 +34,7 @@ import Tabview as TV
import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultPerformAction, defaultRender, focus, modifyState, simpleSpec, withState)
import Unsafe.Coerce (unsafeCoerce)
import UserPage as UP
import GraphExplorer as GE
type E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e)
...
...
@@ -52,6 +53,7 @@ type AppState =
, corpusAnalysis :: CA.State
, showLogin :: Boolean
, showCorpus :: Boolean
, graphExplorer :: GE.State
}
initAppState :: AppState
...
...
@@ -70,6 +72,7 @@ initAppState =
, corpusAnalysis : CA.initialState
, showLogin : false
, showCorpus : false
, graphExplorer : GE.initialState
}
data Action
...
...
@@ -84,6 +87,7 @@ data Action
| AnnotationDocumentViewA D.Action
| TreeViewA NT.Action
| TabViewA TV.Action
| GraphExplorerA GE.Action
| Search String
| Go
| CorpusAnalysisA CA.Action
...
...
@@ -125,7 +129,6 @@ performAction _ _ _ = void do
_landingState :: Lens' AppState L.State
_landingState = lens (\s -> s.landingState) (\s ss -> s{landingState = ss})
_landingAction :: Prism' Action L.Action
_landingAction = prism LandingA \action ->
case action of
...
...
@@ -233,6 +236,16 @@ _corpusAction = prism CorpusAnalysisA \action ->
_-> Left action
_graphExplorerState :: Lens' AppState GE.State
_graphExplorerState = lens (\s -> s.graphExplorer) (\s ss -> s{graphExplorer = ss})
_graphExplorerAction :: Prism' Action GE.Action
_graphExplorerAction = prism GraphExplorerA \action ->
case action of
GraphExplorerA caction -> Right caction
_-> Left action
pagesComponent :: forall props eff. AppState -> Spec (E eff) AppState props Action
pagesComponent s =
case s.currentRoute of
...
...
@@ -256,6 +269,7 @@ pagesComponent s =
selectSpec Tabview = layout0 $ focus _tabviewState _tabviewAction TV.tab1
-- To be removed
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
selectSpec PGraphExplorer = focus _graphExplorerState _graphExplorerAction GE.spec
selectSpec _ = simpleSpec defaultPerformAction defaultRender
routingSpec :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
...
...
@@ -579,3 +593,8 @@ dispatchAction dispatcher _ CorpusAnalysis = do
_ <- dispatcher $ SetRoute $ CorpusAnalysis
--_ <- dispatcher $ CorpusAnalysisA $ CA.NoOp
pure unit
dispatchAction dispatcher _ PGraphExplorer = do
_ <- dispatcher $ SetRoute $ PGraphExplorer
--_ <- dispatcher $ GraphExplorerA $ GE.NoOp
pure unit
src/PageRouter.purs
View file @
03e20929
...
...
@@ -25,6 +25,7 @@ data Routes
| AnnotationDocumentView Int
| Tabview
| CorpusAnalysis
| PGraphExplorer
instance showRoutes :: Show Routes where
...
...
@@ -37,6 +38,7 @@ instance showRoutes :: Show Routes where
show (AnnotationDocumentView i) = "DocumentView"
show Tabview = "Tabview"
show CorpusAnalysis = "corpus"
show PGraphExplorer = "graphExplorer"
int :: Match Int
int = floor <$> num
...
...
@@ -52,6 +54,7 @@ routing =
<|> docviewRoute
<|> addcorpusRoute
<|> corpusAnalysis
<|> graphExplorer
<|> home
where
tabview = Tabview <$ route "tabview"
...
...
@@ -62,6 +65,7 @@ routing =
addcorpusRoute = AddCorpus <$ route "addCorpus"
loginRoute = Login <$ route "login"
corpusAnalysis = CorpusAnalysis <$ route "corpus"
graphExplorer = PGraphExplorer <$ route "graphExplorer"
home = Home <$ lit ""
route str = lit "" *> lit str
...
...
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