Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-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
Przemyslaw Kaminski
haskell-gargantext
Commits
b81113bd
Commit
b81113bd
authored
Jun 27, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GRAPH] Metadata with ListId
parent
5affca09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
Graph.hs
src/Gargantext/Viz/Graph.hs
+2
-0
API.hs
src/Gargantext/Viz/Graph/API.hs
+4
-2
No files found.
src/Gargantext/Viz/Graph.hs
View file @
b81113bd
...
...
@@ -25,6 +25,7 @@ import Data.Text (Text, pack)
import
GHC.Generics
(
Generic
)
import
GHC.IO
(
FilePath
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Core.Types
(
ListId
)
import
Gargantext.Database.Types.Node
(
NodeId
)
import
Gargantext.Prelude
import
Test.QuickCheck
(
elements
)
...
...
@@ -91,6 +92,7 @@ makeLenses ''LegendField
data
GraphMetadata
=
GraphMetadata
{
_gm_title
::
Text
-- title of the graph
,
_gm_corpusId
::
[
NodeId
]
-- we can map with different corpus
,
_gm_legend
::
[
LegendField
]
-- legend of the Graph
,
_gm_listId
::
ListId
}
deriving
(
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"_gm_"
)
''
G
raphMetadata
)
...
...
src/Gargantext/Viz/Graph/API.hs
View file @
b81113bd
...
...
@@ -60,15 +60,17 @@ getGraph :: NodeId -> GargServer (Get '[JSON] Graph)
getGraph
nId
=
do
nodeGraph
<-
getNode
nId
HyperdataGraph
let
cId
=
maybe
(
panic
"no parentId"
)
identity
$
_node_parentId
nodeGraph
lId
<-
defaultList
cId
let
metadata
=
GraphMetadata
"Title"
[
maybe
0
identity
$
_node_parentId
nodeGraph
]
[
LegendField
1
"#FFF"
"Cluster"
,
LegendField
2
"#FFF"
"Cluster"
]
lId
-- (map (\n -> LegendField n "#FFFFFF" (pack $ show n)) [1..10])
let
cId
=
maybe
(
panic
"no parentId"
)
identity
$
_node_parentId
nodeGraph
lIds
<-
selectNodesWithUsername
NodeList
userMaster
lId
<-
defaultList
cId
ngs
<-
filterListWithRoot
GraphTerm
<$>
mapTermListRoot
[
lId
]
NgramsTerms
myCooc
<-
Map
.
filter
(
>
1
)
<$>
getCoocByNgrams
(
Diagonal
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