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 _
instance decodeJsonGraphData :: DecodeJson GraphData where
decodeJson json = do
obj <- decodeJson json
nodes <- obj .? "
graph_
nodes"
edges <- obj .? "
graph_
edges"
nodes <- obj .? "nodes"
edges <- obj .? "edges"
pure $ GraphData { nodes, edges }
instance decodeJsonNode :: DecodeJson Node where
decodeJson json = do
obj <- decodeJson json
id_ <- obj .? "
node_
id"
type_ <- obj .? "
node_
type"
label <- obj .? "
node_
label"
size <- obj .? "
node_
size"
attributes <- obj .? "
node_
attributes"
id_ <- obj .? "id"
type_ <- obj .? "type"
label <- obj .? "label"
size <- obj .? "size"
attributes <- obj .? "attributes"
pure $ Node { id_, type_, size, label, attributes }
instance decodeJsonCluster :: DecodeJson Cluster where
...
...
@@ -62,10 +62,10 @@ instance decodeJsonCluster :: DecodeJson Cluster where
instance decodeJsonEdge :: DecodeJson Edge where
decodeJson json = do
obj <- decodeJson json
id_ <- obj .? "
edge_
id"
source <- obj .? "
edge_
source"
target <- obj .? "
edge_
target"
weight <- obj .? "
edge_
weight"
id_ <- obj .? "id"
source <- obj .? "source"
target <- obj .? "target"
weight <- obj .? "weight"
pure $ Edge { id_, source, target, weight }
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
-- graph.
case gd of
Left err -> do
_ <- liftEffect $
log err
_ <- liftEffect $
log err
modifyState identity
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}
render :: Render State {} Action
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
...
...
@@ -279,7 +268,7 @@ specOld = simpleSpec performAction render'
render' :: Render State {} Action
render' d _ (State st) _ =
[ 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"]
[ ul'
[
...
...
@@ -349,20 +338,7 @@ specOld = simpleSpec performAction render'
, div [className "row"]
[ div [className "col-md-9"]
[ 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
...
...
src/Gargantext/Pages/Layout.purs
View file @
d1e913f4
...
...
@@ -55,9 +55,9 @@ dispatchAction dispatcher _ (Document n) = do
dispatcher $ SetRoute $ Document n
dispatcher $ DocumentViewA $ Document.Load n
dispatchAction dispatcher _
PGraphExplorer
= do
dispatcher $ SetRoute
PGraphExplorer
dispatcher $ GraphExplorerA $ GE.LoadGraph
2
dispatchAction dispatcher _
(PGraphExplorer nid)
= do
dispatcher $ SetRoute
$ PGraphExplorer nid
dispatcher $ GraphExplorerA $ GE.LoadGraph
nid
--dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
dispatchAction dispatcher _ NGramsTable = do
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
d1e913f4
...
...
@@ -59,7 +59,7 @@ pagesComponent s = case s.currentRoute of
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
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 (Annuaire i) = layout0 $ cmapProps (const {annuaireId: i}) $ noState A.layout
...
...
src/Gargantext/Router.purs
View file @
d1e913f4
...
...
@@ -20,7 +20,7 @@ data Routes
| Corpus Int
| AddCorpus
| Document Int
| PGraphExplorer
| PGraphExplorer
Int
| NGramsTable
| Dashboard
| Annuaire Int
...
...
@@ -36,7 +36,7 @@ routing =
<|> NGramsTable <$ route "ngrams"
<|> Document <$> (route "document" *> int)
<|> Dashboard <$ route "dashboard"
<|> PGraphExplorer <$
route "graph"
<|> PGraphExplorer <$
> (route "graph" *> int )
<|> Annuaire <$> (route "annuaire" *> int)
<|> UserPage <$> (route "user" *> int)
<|> Home <$ lit ""
...
...
@@ -58,7 +58,7 @@ instance showRoutes :: Show Routes where
show (Annuaire i) = "Annuaire" <> show i
show (Folder i) = "Folder" <> show i
show Dashboard = "Dashboard"
show
PGraphExplorer = "graphExplorer"
show
(PGraphExplorer i) = "graphExplorer" <> show i
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