Commit 2cb8ed02 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/side-docs' into masterLocal

parents 484dae7a b63bfd70
...@@ -29,9 +29,18 @@ newtype Edge = Edge ...@@ -29,9 +29,18 @@ newtype Edge = Edge
derive instance newtypeEdge :: Newtype Edge _ derive instance newtypeEdge :: Newtype Edge _
type CorpusId = Int
type CorpusLabel = String
newtype GraphSideCorpus = GraphSideCorpus
{ corpusId :: CorpusId
, corpusLabel :: CorpusLabel
}
newtype GraphData = GraphData newtype GraphData = GraphData
{ nodes :: Array Node { nodes :: Array Node
, edges :: Array Edge , edges :: Array Edge
, sides :: Array GraphSideCorpus
} }
derive instance newtypeGraphData :: Newtype GraphData _ derive instance newtypeGraphData :: Newtype GraphData _
...@@ -41,7 +50,9 @@ instance decodeJsonGraphData :: DecodeJson GraphData where ...@@ -41,7 +50,9 @@ instance decodeJsonGraphData :: DecodeJson GraphData where
obj <- decodeJson json obj <- decodeJson json
nodes <- obj .? "nodes" nodes <- obj .? "nodes"
edges <- obj .? "edges" edges <- obj .? "edges"
pure $ GraphData { nodes, edges } -- TODO: sides
-- sides <- obj .? "corpusId"
pure $ GraphData { nodes, edges, sides: [GraphSideCorpus { corpusId: 1004223, corpusLabel: "Patents" }, GraphSideCorpus { corpusId: 998770, corpusLabel: "Books" }] }
instance decodeJsonNode :: DecodeJson Node where instance decodeJsonNode :: DecodeJson Node where
decodeJson json = do decodeJson json = do
......
...@@ -198,7 +198,7 @@ type Limit = Int ...@@ -198,7 +198,7 @@ type Limit = Int
type Offset = Int type Offset = Int
data OrderBy = DateAsc | DateDesc data OrderBy = DateAsc | DateDesc
| TitleAsc | TitleDesc | TitleAsc | TitleDesc
| FavDesc | FavAsc | ScoreDesc | ScoreAsc
derive instance genericOrderBy :: Generic OrderBy _ derive instance genericOrderBy :: Generic OrderBy _
......
...@@ -29,6 +29,7 @@ import Gargantext.Components.Login.Types (AuthData(..), TreeId) ...@@ -29,6 +29,7 @@ import Gargantext.Components.Login.Types (AuthData(..), TreeId)
import Gargantext.Components.Tree as Tree import Gargantext.Components.Tree as Tree
import Gargantext.Config as Config import Gargantext.Config as Config
import Gargantext.Config.REST (get, post) import Gargantext.Config.REST (get, post)
import Gargantext.Pages.Corpus.Graph.Tabs as GT
import Gargantext.Utils (getter) import Gargantext.Utils (getter)
import Math (cos, sin) import Math (cos, sin)
import Partial.Unsafe (unsafePartial) import Partial.Unsafe (unsafePartial)
...@@ -82,7 +83,7 @@ newtype NodeResults = NodeResults ...@@ -82,7 +83,7 @@ newtype NodeResults = NodeResults
initialState :: State initialState :: State
initialState = State initialState = State
{ graphData : GraphData {nodes : [], edges : []} { graphData : GraphData {nodes: [], edges: [], sides: []}
, filePath : "" , filePath : ""
, sigmaGraphData : Nothing , sigmaGraphData : Nothing
, legendData : [] , legendData : []
...@@ -343,7 +344,7 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render'] ...@@ -343,7 +344,7 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
Just treeId -> Just treeId ->
(cmapProps (const {root: treeId}) (noState Tree.treeview)) (cmapProps (const {root: treeId}) (noState Tree.treeview))
render' :: Render State {} Action render' :: Render State {} Action
render' d _ (State st) _ = render' d _ (State st@{graphData: GraphData {sides}}) _ =
[ div [className "container-fluid", style {"padding-top" : "100px"}] [ div [className "container-fluid", style {"padding-top" : "100px"}]
[ div [className "row", style {"padding-bottom" : "10px"}] [ div [className "row", style {"padding-bottom" : "10px"}]
[ [
...@@ -559,15 +560,12 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render'] ...@@ -559,15 +560,12 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
] ]
, div [] , div []
[ p [] [] [ p [] []
, div [className "col-md-12"][ case st.selectedNode of , div [className "col-md-12"]
Nothing -> span [] [] [ GT.tabsElt {sides}
Just selectedNode -> p [] [text $ "BOUKLI HACENE Ghouthi, GRIPON Vincent, FARRUGIA Nicolas, ARZEL Matthieu, ", a [href "http://localhost:2015/#/userPage/1"][text "JEZEQUEL Michel. "], text "Finding All Matches in a Database using Binary Neural Networks. COGNITIVE 2017 : The Ninth International Conference on Advanced Cognitive Technologies and Applications, 19-23 february 2017, Athènes, Greece, 2017, pp. 59-64"] , p [] []
, p [] ]
[
]
]
] ]
] ]
] ]
else else
div [] [] -- ends sidepanel column here div [] [] -- ends sidepanel column here
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment