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
d1e913f4
Commit
d1e913f4
authored
Nov 17, 2018
by
Sudhir Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graph frontend Integration is done
parent
942d054b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
46 deletions
+22
-46
Types.purs
src/Gargantext/Components/GraphExplorer/Types.purs
+11
-11
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+4
-28
Layout.purs
src/Gargantext/Pages/Layout.purs
+3
-3
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+1
-1
Router.purs
src/Gargantext/Router.purs
+3
-3
No files found.
src/Gargantext/Components/GraphExplorer/Types.purs
View file @
d1e913f4
...
@@ -39,18 +39,18 @@ derive instance newtypeGraphData :: Newtype GraphData _
...
@@ -39,18 +39,18 @@ derive instance newtypeGraphData :: Newtype GraphData _
instance decodeJsonGraphData :: DecodeJson GraphData where
instance decodeJsonGraphData :: DecodeJson GraphData where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
nodes <- obj .? "
graph_
nodes"
nodes <- obj .? "nodes"
edges <- obj .? "
graph_
edges"
edges <- obj .? "edges"
pure $ GraphData { nodes, edges }
pure $ GraphData { nodes, edges }
instance decodeJsonNode :: DecodeJson Node where
instance decodeJsonNode :: DecodeJson Node where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
id_ <- obj .? "
node_
id"
id_ <- obj .? "id"
type_ <- obj .? "
node_
type"
type_ <- obj .? "type"
label <- obj .? "
node_
label"
label <- obj .? "label"
size <- obj .? "
node_
size"
size <- obj .? "size"
attributes <- obj .? "
node_
attributes"
attributes <- obj .? "attributes"
pure $ Node { id_, type_, size, label, attributes }
pure $ Node { id_, type_, size, label, attributes }
instance decodeJsonCluster :: DecodeJson Cluster where
instance decodeJsonCluster :: DecodeJson Cluster where
...
@@ -62,10 +62,10 @@ instance decodeJsonCluster :: DecodeJson Cluster where
...
@@ -62,10 +62,10 @@ instance decodeJsonCluster :: DecodeJson Cluster where
instance decodeJsonEdge :: DecodeJson Edge where
instance decodeJsonEdge :: DecodeJson Edge where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
id_ <- obj .? "
edge_
id"
id_ <- obj .? "id"
source <- obj .? "
edge_
source"
source <- obj .? "source"
target <- obj .? "
edge_
target"
target <- obj .? "target"
weight <- obj .? "
edge_
weight"
weight <- obj .? "weight"
pure $ Edge { id_, source, target, weight }
pure $ Edge { id_, source, target, weight }
newtype Legend = Legend {id_ ::Int , label :: String}
newtype Legend = Legend {id_ ::Int , label :: String}
...
...
src/Gargantext/Pages/Corpus/Graph.purs
View file @
d1e913f4
...
@@ -68,7 +68,7 @@ performAction (LoadGraph fp) _ _ = void do
...
@@ -68,7 +68,7 @@ performAction (LoadGraph fp) _ _ = void do
-- graph.
-- graph.
case gd of
case gd of
Left err -> do
Left err -> do
_ <- liftEffect $
log err
_ <- liftEffect $
log err
modifyState identity
modifyState identity
Right resp -> modifyState \(State s) -> State s {graphData = resp, sigmaGraphData = Just $ convert resp, legendData = getLegendData resp}
Right resp -> modifyState \(State s) -> State s {graphData = resp, sigmaGraphData = Just $ convert resp, legendData = getLegendData resp}
...
@@ -95,18 +95,7 @@ convert (GraphData r) = SigmaGraphData { nodes, edges}
...
@@ -95,18 +95,7 @@ convert (GraphData r) = SigmaGraphData { nodes, edges}
render :: Render State {} Action
render :: Render State {} Action
render d p (State s) c =
render d p (State s) c =
[ select [ onChange $ \e -> d $ LoadGraph (unsafeCoerce e).target.value, value s.filePath]
[
[ option [value ""] [text ""]
, option [value "example_01_clean.json"] [text "example_01_clean.json"]
, option [value "example_01_conditional.json"] [text "example_01_conditional.json"]
, option [value "example_01_distributional.json"] [text "example_01_distributional.json"]
, option [value "example_02.json"] [text "example_02.json"]
, option [value "example_02_clean.json"] [text "example_02_clean.json"]
, option [value "example_03.json"] [text "example_03.json"]
, option [value "example_03_clean.json"] [text "example_03_clean.json"]
, option [value "imtNew.json"] [text "imtNew.json"]
-- , option [value "exemplePhyloBipartite.gexf"] [text "exemplePhyloBipartite.gexf"]
]
]
]
<>
<>
case s.sigmaGraphData of
case s.sigmaGraphData of
...
@@ -279,7 +268,7 @@ specOld = simpleSpec performAction render'
...
@@ -279,7 +268,7 @@ specOld = simpleSpec performAction render'
render' :: Render State {} Action
render' :: Render State {} Action
render' d _ (State st) _ =
render' d _ (State st) _ =
[ div [className "row"] [
[ div [className "row"] [
div [className "col-md-12", style {marginTop : "
21
px", marginBottom : "21px"}]
div [className "col-md-12", style {marginTop : "
34
px", marginBottom : "21px"}]
[ menu [_id "toolbar"]
[ menu [_id "toolbar"]
[ ul'
[ ul'
[
[
...
@@ -349,20 +338,7 @@ specOld = simpleSpec performAction render'
...
@@ -349,20 +338,7 @@ specOld = simpleSpec performAction render'
, div [className "row"]
, div [className "row"]
[ div [className "col-md-9"]
[ div [className "col-md-9"]
[ div [style {border : "1px black solid", height: "90%"}] $
[ div [style {border : "1px black solid", height: "90%"}] $
[ select [ onChange $ \e -> d $ LoadGraph (unsafeCoerce e).target.value
[
, value st.filePath
]
[ option [value ""] [text ""]
, option [value "example_01_clean.json"] [text "example_01_clean.json"]
, option [value "example_01_conditional.json"] [text "example_01_conditional.json"]
, option [value "example_01_distributional.json"] [text "example_01_distributional.json"]
, option [value "example_02.json"] [text "example_02.json"]
, option [value "example_02_clean.json"] [text "example_02_clean.json"]
, option [value "example_03.json"] [text "example_03.json"]
, option [value "example_03_clean.json"] [text "example_03_clean.json"]
, option [value "imtNew.json"] [text "imtNew.json"]
-- , option [value "exemplePhyloBipartite.gexf"] [text "exemplePhyloBipartite.gexf"]
]
]
]
<>
<>
case st.sigmaGraphData of
case st.sigmaGraphData of
...
...
src/Gargantext/Pages/Layout.purs
View file @
d1e913f4
...
@@ -55,9 +55,9 @@ dispatchAction dispatcher _ (Document n) = do
...
@@ -55,9 +55,9 @@ dispatchAction dispatcher _ (Document n) = do
dispatcher $ SetRoute $ Document n
dispatcher $ SetRoute $ Document n
dispatcher $ DocumentViewA $ Document.Load n
dispatcher $ DocumentViewA $ Document.Load n
dispatchAction dispatcher _
PGraphExplorer
= do
dispatchAction dispatcher _
(PGraphExplorer nid)
= do
dispatcher $ SetRoute
PGraphExplorer
dispatcher $ SetRoute
$ PGraphExplorer nid
dispatcher $ GraphExplorerA $ GE.LoadGraph
2
dispatcher $ GraphExplorerA $ GE.LoadGraph
nid
--dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
--dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
dispatchAction dispatcher _ NGramsTable = do
dispatchAction dispatcher _ NGramsTable = do
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
d1e913f4
...
@@ -59,7 +59,7 @@ pagesComponent s = case s.currentRoute of
...
@@ -59,7 +59,7 @@ pagesComponent s = case s.currentRoute of
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
selectSpec (Document i) = layout0 $ focus _documentViewState _documentViewAction Annotation.docview
selectSpec (Document i) = layout0 $ focus _documentViewState _documentViewAction Annotation.docview
selectSpec
PGraphExplorer
= focus _graphExplorerState _graphExplorerAction GE.specOld
selectSpec
(PGraphExplorer i)
= focus _graphExplorerState _graphExplorerAction GE.specOld
selectSpec Dashboard = layout0 $ noState Dsh.layoutDashboard
selectSpec Dashboard = layout0 $ noState Dsh.layoutDashboard
selectSpec (Annuaire i) = layout0 $ cmapProps (const {annuaireId: i}) $ noState A.layout
selectSpec (Annuaire i) = layout0 $ cmapProps (const {annuaireId: i}) $ noState A.layout
...
...
src/Gargantext/Router.purs
View file @
d1e913f4
...
@@ -20,7 +20,7 @@ data Routes
...
@@ -20,7 +20,7 @@ data Routes
| Corpus Int
| Corpus Int
| AddCorpus
| AddCorpus
| Document Int
| Document Int
| PGraphExplorer
| PGraphExplorer
Int
| NGramsTable
| NGramsTable
| Dashboard
| Dashboard
| Annuaire Int
| Annuaire Int
...
@@ -36,7 +36,7 @@ routing =
...
@@ -36,7 +36,7 @@ routing =
<|> NGramsTable <$ route "ngrams"
<|> NGramsTable <$ route "ngrams"
<|> Document <$> (route "document" *> int)
<|> Document <$> (route "document" *> int)
<|> Dashboard <$ route "dashboard"
<|> Dashboard <$ route "dashboard"
<|> PGraphExplorer <$
route "graph"
<|> PGraphExplorer <$
> (route "graph" *> int )
<|> Annuaire <$> (route "annuaire" *> int)
<|> Annuaire <$> (route "annuaire" *> int)
<|> UserPage <$> (route "user" *> int)
<|> UserPage <$> (route "user" *> int)
<|> Home <$ lit ""
<|> Home <$ lit ""
...
@@ -58,7 +58,7 @@ instance showRoutes :: Show Routes where
...
@@ -58,7 +58,7 @@ instance showRoutes :: Show Routes where
show (Annuaire i) = "Annuaire" <> show i
show (Annuaire i) = "Annuaire" <> show i
show (Folder i) = "Folder" <> show i
show (Folder i) = "Folder" <> show i
show Dashboard = "Dashboard"
show Dashboard = "Dashboard"
show
PGraphExplorer = "graphExplorer"
show
(PGraphExplorer i) = "graphExplorer" <> show i
show Home = "Home"
show Home = "Home"
...
...
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